TenPinSolitaire
m (11 revision(s)) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | My PalmPilot has this nifty and addictive game called TenPin Solitaire. |
+ | My [[PalmPilot]] has this nifty and addictive game called [[TenPin]] Solitaire. |
It runs like this: you are presented with: |
It runs like this: you are presented with: |
||
Line 12: | Line 12: | ||
---- |
---- |
||
− | Now, being the happy little hacker wannabe that I am, I found recently that I have a hex editor on my pilot - and of course, the TenPin db is a nice little 240byte memory dump of the current game state and highscore table. |
+ | Now, being the happy little hacker wannabe that I am, I found recently that I have a hex editor on my pilot - and of course, the [[TenPin]] db is a nice little 240byte memory dump of the current game state and highscore table. |
Now if we assume that the aim of the game is to get the highest possible score, then is the method really relevant? *grins* |
Now if we assume that the aim of the game is to get the highest possible score, then is the method really relevant? *grins* |
||
Line 19: | Line 19: | ||
Notes |
Notes |
||
− | * Many values seem to be stored in 16bit segments - given the [PalmPilot|Palm IIIxe] that I have runs on a 16bit dragonball CPU, this makes sense. Word. :) |
+ | * Many values seem to be stored in 16bit segments - given the [[[PalmPilot]]|Palm IIIxe] that I have runs on a 16bit dragonball CPU, this makes sense. Word. :) |
* The memory dump given in the example below is of a completed game as follows: |
* The memory dump given in the example below is of a completed game as follows: |
||
Line 60: | Line 60: | ||
080: 00 0A 00 01 |
080: 00 0A 00 01 |
||
From observation, I'm guessing these for the bytes |
From observation, I'm guessing these for the bytes |
||
− | * 67,69,71: The positional values of the last selected pins |
+ | * 67,69,71: The positional values of the last selected pins (values 0 - 9) |
* 73: no idea. has been 0 or 1 on every observation |
* 73: no idea. has been 0 or 1 on every observation |
||
* 75: no idea, has been 0 or 1 on every observation |
* 75: no idea, has been 0 or 1 on every observation |
||
* 77: Current ball number in play (can only be either 0, 1 or 2) |
* 77: Current ball number in play (can only be either 0, 1 or 2) |
||
* 79: no idea. Has been 0 on every observation |
* 79: no idea. Has been 0 on every observation |
||
− | * 81: Count of completed frames. (0A means 10 frames completes, means we are on the eleventh frame |
+ | * 81: Count of completed frames (normally 0 - 9, but value 0A means 10 frames completed and that we are then on the eleventh) |
* 83: Game over toggle. 0=game in progress, 1=gameover |
* 83: Game over toggle. 0=game in progress, 1=gameover |
||
+ | I'd vaguelly assume that 73 and 75 are values for 'how many cards selected' and 'what stack the last card selected was from' to allow for an undo option (79 would also have to be a toggle to say 'undo permissable' - ie, 'no new pins chosen since last card removed' flag). If nothing else, then 73 or 75 should at least be the count of cards selected, since that information is definately stored!) |
||
− | Bytes 84-155 - 3 words containing frame information, repeated 12(though surely only 11 are needed?) times. |
+ | Bytes 84-155 - 3 words containing frame information, repeated 12 (though surely only 11 are needed?) times. |
* First word - pins struck on first ball |
* First word - pins struck on first ball |
||
* Second word - pins struck on second ball |
* Second word - pins struck on second ball |
||
Line 104: | Line 105: | ||
Links: |
Links: |
||
− | * TenPin Solitaire |
+ | * [[TenPin]] Solitaire |
− | * FileZ (hex editor) |
+ | * [[FileZ]] (hex editor) |
Revision as of 02:04, 25 October 2007
My PalmPilot has this nifty and addictive game called TenPin Solitaire.
It runs like this: you are presented with:
- 10 pins, with numbers 0-9 on them.
- 10 cards numbered 0-9, in three stacks (with 5, 3 and 2 cards in the stacks).
On your first 'bowl', you get the 10 cards. The aim is to select pins (up to three, must be adjacent, may not select from back row on the first selection set) that add up to a card value (mod 10: so 7+7 = 14 = select card 4). The selected pins and card vanish. Repeat. For the second bowl, the top card on each stack is removed, revealing (hopefully) new values beneath to continue.
The pin and card values appear to be chosen randomly. There is no guarantee made that a strike or spare is possible every turn.
Now, being the happy little hacker wannabe that I am, I found recently that I have a hex editor on my pilot - and of course, the TenPin db is a nice little 240byte memory dump of the current game state and highscore table.
Now if we assume that the aim of the game is to get the highest possible score, then is the method really relevant? *grins*
Anyways, here is my analysis of the memory dump...
Notes
- Many values seem to be stored in 16bit segments - given the [[[PalmPilot]]|Palm IIIxe] that I have runs on a 16bit dragonball CPU, this makes sense. Word. :)
- The memory dump given in the example below is of a completed game as follows:
. (_) (_) (_) (_) [-] [-] [1] . [-] [4] . (_) (7) (_) [0] . . (_) (_) . (*) . (_) . . 7- 6/ X_ X_ 9- . 7 27 56 75 84 . . X_ 9/ 32 9- 9/9 . 104 117 122 131 150
Bytes 00-19 - 10 words containing 1bit toggles of the visibility of the 10 pins
000: 00 00 00 00 00 00 00 00 008: 00 00 00 01 00 00 00 00 Here you see that the sixth pin is visible 016: 00 00 00 00
Bytes 20-39 - 10 words containing the values on pins - left to right, back row first
00 02 00 05 024: 00 00 00 08 00 06 00 07 032: 00 09 00 01 00 03 00 03
Bytes 40-59 - 10 words containing the values on cards - back to front, left row first
040: 00 04 00 08 00 00 00 07 048: 00 06 00 02 00 04 00 05 056: 00 01 00 09
Bytes 60-65 - 3 words containing the count of cards on each of the three stacks of cards
00 03 00 02 064: 00 01
Bytes 66-83 - unknown, though I have some guesses
00 01 00 04 00 00 072: 00 00 00 00 00 01 00 01 080: 00 0A 00 01
From observation, I'm guessing these for the bytes
- 67,69,71: The positional values of the last selected pins (values 0 - 9)
- 73: no idea. has been 0 or 1 on every observation
- 75: no idea, has been 0 or 1 on every observation
- 77: Current ball number in play (can only be either 0, 1 or 2)
- 79: no idea. Has been 0 on every observation
- 81: Count of completed frames (normally 0 - 9, but value 0A means 10 frames completed and that we are then on the eleventh)
- 83: Game over toggle. 0=game in progress, 1=gameover
I'd vaguelly assume that 73 and 75 are values for 'how many cards selected' and 'what stack the last card selected was from' to allow for an undo option (79 would also have to be a toggle to say 'undo permissable' - ie, 'no new pins chosen since last card removed' flag). If nothing else, then 73 or 75 should at least be the count of cards selected, since that information is definately stored!)
Bytes 84-155 - 3 words containing frame information, repeated 12 (though surely only 11 are needed?) times.
- First word - pins struck on first ball
- Second word - pins struck on second ball
- Third word - score added on this frame
00 07 00 00 Frame 1: 7,0 088: 00 07 00 06 00 04 00 14 Frame 2: 6,4 096: 00 0A 00 00 00 1D 00 0A Frame 3: 10 Frame 4: 10 104: 00 00 00 13 00 09 00 00 Frame 5: 9,0 112: 00 09 00 0A 00 00 00 14 Frame 6: 10 120: 00 09 00 01 00 0D 00 03 Frame 7: 9,1 Frame 8: 3,2 128: 00 02 00 05 00 09 00 00 Frame 9: 9,0 136: 00 09 00 09 00 01 00 13 Frame 10: 9,1 144: 00 09 00 00 00 09 00 63 Frame 11: 9 152: 00 63 00 63 Space for a 12th frame?
todo: finish hexdump transcribing from here down
Bytes 156-215 - High score table - names: 10 bytes for names (6 bytes for name, then '21 21 00 00' as seperator), 6 fields total.
4E 65 6D 6F Nemo 160: 00 00 21 21 00 00 74 65 !! te 168: 72 72 69 00 21 21 00 00 rri !! 176: 4E 65 6D 6F 00 00 21 21 Nemo !! 184: 00 00 74 65 72 72 69 00 terri 192: 21 21 00 00 54 65 72 72 !! Terr 200: 69 00 21 21 00 00 4E 65 i !! Ne 208: 6D 6F 00 00 21 21 00 0C mo !! Note that the table ends with 0C
Bytes 216-239 - High score table - scores: 4bytes for score value, 6 fields.
216: 00 00 00 AB 00 00 00 A9 High scores of 171, 169 224: 00 00 00 A8 00 00 00 A7 168, 167 232: 00 00 00 A4 00 00 00 A2 164, 162
Links: