Welcome, Guest. Please login or register.
June 18, 2024, 11:03:33 AM

Login with username, password and session length
* Home Help Arcade Login Register
.
+  Forum
|-+  **Reel Slots** Gaming Machines
| |-+  IGT S and S-plus Reel Games. (Moderator: knagl)
| | |-+  My new 'I have too much spare time' project
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] 3 4 Go Down Print
Author Topic: My new 'I have too much spare time' project  (Read 29130 times)
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #25 on: July 21, 2011, 02:56:20 AM »

Poppo, read each byte separately.

That is what I am doing.  But the problem is the byte is a hex number even though it is the decimal representation.

so looking at the bytes
49
16
00
00
in the right order they would be 00 00 16 49 decimal (which is what I want)
However in reality since they are actually hex values, they are decimal
73
22
00
00
which would be
00 00 22 73 (true decimal and totally wrong).

The Basic Atom I am using can not look at the byte and make it a decimal equivelent of the contents (i.e. make 49 hex = 49 decimal)


But I have a kludge workaround. I have to create a lookup table that will convert the numbers. For example

if byte = 73 then
fixedbyte = 49
endif

Since the byte hex 49 = decimal 73 when it reaches this part of the table, it will assign the correct decimal value to another variable. I can then do the math as I originally hoped.

You didn't read what I posted. I gave you a simple formula to convert the hex value into the correct decimal number. Reread that part of my post. You're method of creating a lookup table is a very inefficient use of chip space.


<EDIT> Here it is again:


   nh --> nd  [In other words, 16 hex converts to 22 decimal. See example.]
   In decimal: INT(n/16)*10 + n MOD 16.  (You want the truncated integer, not rounded.)

Then multiply the results of each byte conversion as appropriate (x100, x10,000, etc.)

Example:

 0x16 --> 22d.
 INT(22/16) [ = 1. ]    *10 [ = 10 ]    + 22 MOD 16 [  = 6  ]  = 16  [ 10+6 ]     *100 = 1600

 0x49 --> 73d.
 INT(73/16)   = 4.    *10  [= 40 ]    + 73 MOD 16 [ = 9 ]    = 49  [40 + 9 ]     *1   = 49

 1600+49 = 1649
« Last Edit: July 21, 2011, 03:10:52 AM by StatFreak » Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #26 on: July 21, 2011, 03:04:08 AM »


I'm not sure I understand the issue about reading bytes? Scratch Head  If you are holding the number as hex, then just perform hex or binary math on it. I figured that you were using decimal based arithmetic operations.

Ok, if you look at the hex dump above you well see that that you can 'read' the decimal coin in number 00001649 (in reverse). lets look at just the 49. That is the decimal number I need. But when I read that memory location, I will indeed get the number 49. However that is a hex value. And the equivalent decimal value is 73. So I can't do any math on the number because all the program sees is either 49 hex or 73 decimal. I need some code that lets it know that 49 IS already decimal. but there is no code to do that.

I'm playing around with using the nibbles, but not getting the results I expect (yet).
Logged
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #27 on: July 21, 2011, 03:10:01 AM »


...I will indeed get the number 49. However that is a hex value. And the equivalent decimal value is 73. So I can't do any math on the number because all the program sees is either 49 hex or 73 decimal. I need some code that lets it know that 49 IS already decimal. but there is no code to do that.

I'm playing around with using the nibbles, but not getting the results I expect (yet).

Yes there is!  Poppo, LOOK AT MY CODE.

Take the number 49. Convert it to 73 decimal. THEN do the math on 73 as indicated, and you will end up with 49 decimal.

 INT(73/16)   = 4.    *10  [= 40 ]    + 73 MOD 16 [ = 9 ]    = 49  [40 + 9 ]     *1   = 49


In decimal: INT(n/16)*10 + n MOD 16.  (You want the truncated integer, not rounded.)



<EDIT/ ADD> You do have to write the code to do the math. You can write it in assembly. It's a very simple and small routine that won't take much space. yes
« Last Edit: July 21, 2011, 03:21:42 AM by StatFreak » Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #28 on: July 21, 2011, 03:15:50 AM »

Yes there is!  Poppo, LOOK AT MY CODE.

Take the number 49. Convert it to 73 decimal. THEN do the math on 73 as indicated, and you will end up with 49 decimal.

 INT(73/16)   = 4.    *10  [= 40 ]    + 73 MOD 16 [ = 9 ]    = 49  [40 + 9 ]     *1   = 49


In decimal: INT(n/16)*10 + n MOD 16.  (You want the truncated integer, not rounded.)

I'm not sure if the processor I am using has all of those math functions. Let me look into it.

I could have had the lookup table written by now.  rotflmao
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #29 on: July 21, 2011, 03:25:19 AM »

Actually the nibble method seems to be working and takes less math.

byte.highnib * 10 + byte.lownib =49

Logged
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #30 on: July 21, 2011, 03:27:34 AM »


I'm not sure if the processor I am using has all of those math functions. Let me look into it.

I could have had the lookup table written by now.  rotflmao

It should. Modulo division is a basic component of computing. All numbers in computers are integers internally, so truncating the result of division that results in a decimal fraction also shouldn't be an issue.

You know, we both can up a head of steam. Putting everything aside, the simple and correct solution is to look at each nibble. Then you won't have to do anything except multiply each one by the correct power of 10. Crazy frying pan  rotflmao rotflmao
Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #31 on: July 21, 2011, 03:30:30 AM »

Actually the nibble method seems to be working and takes less math.

byte.highnib * 10 + byte.lownib =49



We're posting over each other.  arrow bust gut laughing bust gut laughing bust gut laughing

I agree completely. yes That's how everyone does it. (according to Kinsey!)  Weird Eyes Cry Laughing Cry Laughing


<PS> Don't forget all those leading (trailing?)  00's. propeller  Basically, if you read each nibble of each four byte section from left to right, the multiplication goes:
x10, x1;    x1,000, x100;    x100,000, x10,000;  x10,000,000, x1,000,000
Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #32 on: July 21, 2011, 03:41:34 AM »

I'll admit that I am more of a 'hardware' guy. I don't usually have to do a lot of math functions in the programs I write.

When I was first doing the math for the % thing, I was having some problems because none of the examples I found worked. The problem is that there are different versions of the Atom chip and different compilers for them, And with each compiler revision they make some changes. So older code may not work.

Even accessing the EEPROM is done two different ways depending on which version of the compiler you use. On the older version, you could just do a read with a single I2CIN command. With the newer compiler version, you have to set the address doing a I2COUT first, and then do a I2CIN.  And I have 3 different Atom versions with 3 different compilers.  arrow

Thanks for getting me on the right path though.
Logged
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #33 on: July 21, 2011, 03:48:12 AM »

Now you know why we HATE new versions of software for the sake of change.  yes

Joey has to deal with the same types of problems every time the forum software gets an update. Pull Hair 
Actually, upgrades to newer versions of software/firmware keep programmers employed, since tracking down broken code that wasn't broken yesterday takes lots of man-hours.  Cool Thumbs-Up

I spent several years at China Lake getting paid to migrate small departmental databases to a new format with an entirely new front end because the Navy had decided that the perfectly fine, fairly problem-free older program was to be disapproved for use on secure computers. It affected every part of every department on the base, and throughout the Navy, actually.

SF garfield
« Last Edit: July 21, 2011, 03:55:17 AM by StatFreak » Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #34 on: July 21, 2011, 04:15:41 AM »

Well, after WAY too many hours and with help from Stat, I have the core coin in/out part done. I already have the % code written from earlier and just need to paste it all together. Of course with my luck, it won't actually work with the machine.  knockout But that's ok, I enjoy just doing something different.

Time for some serious  zzzzzzz


* eepromdata2.jpg (355.68 KB, 761x642 - viewed 309 times.)
Logged
StatFreak
rotaredoM etiS GLN labolG
Global NLG Site Moderator
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 756
Offline Offline

Gender: Male
Posts: 8549


Warning! Spammers will be eaten, with relish!


« Reply #35 on: July 21, 2011, 04:31:09 AM »

Well, after WAY too many hours and with help from Stat, I have the core coin in/out part done. I already have the % code written from earlier and just need to paste it all together. Of course with my luck, it won't actually work with the machine.  knockout But that's ok, I enjoy just doing something different.

Time for some serious  zzzzzzz

Looking good!  applause applause applause +1 (Karma, or whatever)
Logged

I found myself at NLG garfield  ..but got lost again on the way home. Scratch Head 2
If found, please email me to myself. Thanks. yes
       Executive member in good standing of Rick's SMAA.                              Ehhh...What's Up Doc?
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #36 on: July 21, 2011, 10:21:06 AM »

Ok, so adding in the % caluclation routine was fairly simple and everything is now working (on the test unit)

Now the next step will be to see if it actually works while connected to the machine. Connection will be fairly easy and only needs 3 wires. However, I still have to add some code to make sure it does not try to read the EEPROM while the machine is reading/writing to it. I figure the easiest way to do this is to monitor the play max credits button lamp. As most know when the EEPROM is being written to, there is a delay before you can play again. During that time the lamp is off. So if I wait for the lamp to come on and then pause for a few seconds just to be on the safe side, it should guarantee that the machine is not doing a write. Plus since I don't need to be updating the display very often, I can have it on a slow loop (let's say once every 15 seconds or so).


Now to take another look at this:
Don't forget soft credit collects and jackpots paid.

I understand the jackpots paid (I think) but I am not too sure about the 'soft credit collects'.  Using the SAS data, I have played around a lot with doing various things like add cashable credits, removing credits, cashing out, etc.. No matter what I do, the 'Total coin in meter' and Total coin out meter' (through SAS) have always been accurate and reflect coins actually played and coins actually won. Now I have not hit any jackpots yet with this, so I don't know if the SAS total coin out meter will reflect that or not. If not, I will have to wait until I hit one to see where the data is stored. Then I can just add that in.

So just what are the  'soft credit collects' and how do they come into play? All of the testing I've done shows that credits are properly accounted for in the total coin in and total coin out meters (SAS). If credits have not been played yet (i.e. you just stuck in a $10 bill and then cashed out) nothing is added. But if credits have been won, then the meters reflect that.

BTW, I did calulate in the leading zeros from the other two bytes. But since they equal zero right now, I still only have a 4 digit number. But it can go up to 99,999,999 (assuming the slot machine's software actually goes that high).


* eepromdata3.jpg (381.01 KB, 797x651 - viewed 305 times.)
« Last Edit: July 21, 2011, 02:51:57 PM by poppo » Logged
zarobhr
Contributing Gold NLG Member
Sr.NLG Member 501 to 1000 Post
*

Total Karma Storms: 178
Offline Offline

Gender: Male
Posts: 622



« Reply #37 on: July 21, 2011, 10:45:33 AM »

from testing i have done jp won meter( which is basically anything 1200 and up is not counted in the coin out meter) since it is handpay. and is reflected on the jp meter.
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #38 on: July 21, 2011, 10:55:29 AM »

from testing i have done jp won meter( which is basically anything 1200 and up is not counted in the coin out meter) since it is handpay. and is reflected on the jp meter.

The only thing I am unsure of is - mechanical meters vs software meters. There are more software meters than mechanical ones, especially with newer SP chips that have more accounting features. So I don't know for sure if the software one (the one I am using) would reflect jackpots too. It's entirely possible that the 'Total coin out meter' (software one) actually does total everything won whether hand pay or not. Unfortunately, I can not force a jackpot.  rotflmao

I suppose I could change the hand-pay limits and see what happens to the total out when a hand-pay occurs.
« Last Edit: July 21, 2011, 11:02:24 AM by poppo » Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #39 on: July 21, 2011, 03:05:23 PM »

And the verdict is.....

of course it works.  propeller

Ok, here is what I did. First I modified the code to wait until I pressed one of the buttons on the carrier board. This way I could control the reads until I was sure it worked, and would wory about monitoring the max bet lamp later.

It's not pretty, but because my EEPROM is mounted on the MPU, I drilled a small hole in the back of the tray to run the 3 wires out. After connecting everything and powering up the machine, I did a read. And thankfully I got the correct values (remember my test EEPROM was a copy of what was in the machine, so they better match).

Next I played 100 plays. During this time, pressed my read button a few times just to verify that the EEPROM had not updated and that it would not honk up the machine. After the expected write pause, I did another read and bingo, the values had updated.  propeller I did a SAS query to double check and everything matched. (SAS results pasted into second picture)

So as useless as this may be, at least it does work.

Ok, that took up a couple of days, now what?  rotflmao


* eepromdata4.jpg (374.8 KB, 750x1000 - viewed 303 times.)

* eepromdata5.jpg (364.89 KB, 1000x750 - viewed 318 times.)
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #40 on: July 21, 2011, 04:42:07 PM »

After tucking everything away inside of the machine (including the display), I decided to just keep using the manual read button. Since I would have the door open anyway, all I have to do is press it to get an update.
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #41 on: July 21, 2011, 05:31:04 PM »

Ok, this was interesting. I was attempting to see if I could do an initial read as soon as the machine is powering up. I waited a few seconds after applying power, pressed my read button and got nothing. And the machine promptly gave me a 65-0 (bad EEPROM) error. I figured I just triggered what I was trying to avoid (both the MPU and me accessing the EEPROM at the same time). I was not able to clear the 65-0 by powering down/up. BTW, there is nothing wrong with the EEPROM and subsequent presses of my button were able to read it just fine. Apparently what happens is if there is a problem reading the EEPROM (which the machine does at power up to compare to the CMOS), a flag gets set somewhere in the CMOS saying it's bad, and you are dead in the water. The machine probably looks for a blank EEPROM before resetting the error flag. So I just pulled the CMOS to get it to lose it's memory (and any set flag). After that, it got me back to the normal 61 (61_1) and all is well again, except I lost my credits as expected.

So apparently a 65_0 does not necessarily mean the EEPROM is bad, only that the MPU failed to read it. I suppose normally that would only happen if it is bad. But once that error flag is set, it stays set until either the EEPROM is replaced or the CMOS is pulled. Of course if the EEPROM really is bad, pulling the CMOS won't help, as the flag will just get set again.
« Last Edit: July 21, 2011, 05:57:39 PM by poppo » Logged
stayouttadabunker
Senior Full time Member.
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 1039
Offline Offline

Gender: Male
Posts: 13447



« Reply #42 on: July 22, 2011, 12:14:40 PM »

You are doing things that not many of us (or any if that...lol) have tried...great stuff Poppo!
I really enjoy reading your "tinkering" projects!
It helps us all understand what is going on during different machine events!  yes
Although it doesn't seem like much right now - it's very innovative
and will definitely come handy when deciphering other machine events.
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #43 on: July 22, 2011, 01:29:08 PM »

I've always liked to tinker with things ever since I was a kid. Once I got an transistor radio for like my 10th birthday or something. I promptly opened it to to see what made it tick. First I looked at all of those cool variable inductors and started tweaking them, I found that you could make the station come in REALLY good. The only problem was that was then the ONLY station it would receive.  Duh!  Next I got the brainy idea  arrow to see how many resistors I could cut out and still have it work. The answer was one.  rotflmao



This is my favorite challenge.  stir the pot / get cooking


* nuspi.jpg (25.16 KB, 265x89 - viewed 324 times.)
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #44 on: July 22, 2011, 03:49:24 PM »

Here is a good example of how wildly the payout percentage can change until you have a lot of spins to average things out. Since this machine was recenlty cleared, all of the meters started at 0. On my first test, the % was 69%. Then after the next 100 pulls it went up to 76%. Then after the next 100 pulls it went back down to 66%. Of course, the more I play, the more stable the number will become. But I'm nowhere near the 97.13% of the SS3819 (yet).

Does this also blow holes in the theory that a freshly cleared machine pays out better?  Tongue Out

BTW, here is where I mounted the display with a big button from another project mounted on top.


* eepromdata6.jpg (215.64 KB, 513x452 - viewed 306 times.)
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #45 on: July 24, 2011, 04:05:22 PM »

To wrap things up on this projects, I put together a small perf-board with a socket for the Atom chip and just enough pins for the signals I use. That way I don't have to waste one of my developement boards. I then mounted the board on the back of the MPU right by where my EEPROM mod is. I can put one of these perf-boards on all of my MPUs and then just swap the Atom chip (they are not exactly cheap). After I stuck a power jack on the board, I realized I could just get the +5v I need from the MPU.  Duh! So that eliminated needing a wall wart.

And yes, before anyone says anything, I need a reminder on which way to turn the volume.  Tongue Out


* eepromdata9.jpg (220.83 KB, 597x615 - viewed 270 times.)
Logged
stayouttadabunker
Senior Full time Member.
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 1039
Offline Offline

Gender: Male
Posts: 13447



« Reply #46 on: July 25, 2011, 12:33:25 AM »

"Left is Louder" is the way my brain remembers it... rotflmao
Logged
poppo
Contributing Gold NLG Member
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 248
Offline Offline

Gender: Male
Posts: 3266



« Reply #47 on: July 25, 2011, 12:40:03 AM »

"Left is Louder" is the way my brain remembers it... rotflmao

But that requires actually remembering something.  arrow
Logged
stayouttadabunker
Senior Full time Member.
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 1039
Offline Offline

Gender: Male
Posts: 13447



« Reply #48 on: July 25, 2011, 12:51:39 AM »

The human brain retains visuals much better!!!>>>
Left is Louder !!!

Left is Louder !!!

Left is Louder !!!
« Last Edit: July 25, 2011, 12:57:42 AM by stayouttadabunker » Logged
stayouttadabunker
Senior Full time Member.
Sr.Tech NLG Member 1000+ Post
*

Total Karma Storms: 1039
Offline Offline

Gender: Male
Posts: 13447



« Reply #49 on: July 25, 2011, 12:58:12 AM »

You may never forget this again!!! Cry Laughing bust gut laughing


Left is Louder !!!
Logged
Pages: 1 [2] 3 4 Go Up Print 
« previous next »
Jump to:  


If you find this site helpful, Please Consider Making a small donation to help defray the cost of hosting and bandwidth.



Newlifegames.com    Newlifegames.net    Newlifegames.org
   New Life Games    NewLifeGames  NLG  We Bring new Life to old Games    1-888-NLG-SLOTS
Are all Copyright and Trademarks of New Life Games LLC 1992 - 2021


FAIR USE NOTICE:

This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner.
We make such material available in an effort to advance awareness and understanding of the issues involved.
We believe this constitutes a fair use of any such copyrighted material as provided for in section 107 of the US Copyright Law.
In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those
who have expressed a prior interest in receiving the included information for research and educational purposes.

For more information please visit: http://www.law.cornell.edu/uscode/17/107.shtml.

If you wish to use copyrighted material from this site for purposes of your own that go beyond fair use,
you must obtain permission directly from the copyright owner.

NewLifeGames.net Web-Site is optimized for use with Fire-Fox and a minimum screen resolution of 1280x768 pixels.


Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
Loon Designed by Mystica
Updated by Runic Warrior
Page created in 0.112 seconds with 19 queries.