diff options
author | RobertoFresca <robbie@mamedev.org> | 2016-03-30 19:04:59 -0300 |
---|---|---|
committer | RobertoFresca <robbie@mamedev.org> | 2016-03-30 19:04:59 -0300 |
commit | aa24c9566f34689af04419d7b9de0508160d8f7f (patch) | |
tree | 71160412a25b2f9194d2865aeffa2fa6406b5166 /src/mame/drivers/snookr10.cpp | |
parent | 228004075bc70fcf6738acfc488db6f1db38e195 (diff) |
Crystal Colours (Ver 1.02): Added default NVRAM. Also added
more technical notes [Roberto Fresca]
Diffstat (limited to 'src/mame/drivers/snookr10.cpp')
-rw-r--r-- | src/mame/drivers/snookr10.cpp | 1044 |
1 files changed, 522 insertions, 522 deletions
diff --git a/src/mame/drivers/snookr10.cpp b/src/mame/drivers/snookr10.cpp index 1d6667c11f5..bb2f41c751a 100644 --- a/src/mame/drivers/snookr10.cpp +++ b/src/mame/drivers/snookr10.cpp @@ -2,617 +2,614 @@ // copyright-holders:Roberto Fresca /********************************************************************************** + SNOOKER 10 / SANDII' + Driver by Roberto Fresca. - SNOOKER 10 / SANDII' - Driver by Roberto Fresca. + Games running on this hardware: - - Games running on this hardware: - - * Snooker 10 (Ver 1.11), Sandii', 1998. - * Apple 10 (Ver 1.21), Sandii', 1998. - * Ten Balls (Ver 1.05), unknown, 1997. - * Crystals Colours (Ver 1.01), JCD srl, 1998. + * Snooker 10 (Ver 1.11), Sandii', 1998. + * Apple 10 (Ver 1.21), Sandii', 1998. + * Ten Balls (Ver 1.05), unknown, 1997. + * Crystals Colours (Ver 1.02), JCD srl, 1998. + * Crystals Colours (Ver 1.01), JCD srl, 1998. *********************************************************************************** + The hardware is generally composed by: - The hardware is generally composed by: - + CPU: 1x 65SC02 at 2MHz. - CPU: 1x 65SC02 at 2MHz. + Sound: 1x AD-65 or U6295 (OKI6295 compatible) at 1MHz, pin7 HIGH. + 1x LM358N + 1x TDA2003 - Sound: 1x AD-65 or U6295 (OKI6295 compatible) at 1MHz, pin7 HIGH. - 1x LM358N - 1x TDA2003 + HD-PLD: 2x AMD MACH231-15-JC/1-18JI/1 or... + 2x XILINX XC9572 - PO100ASJ9745 or... + 2x Lattice ispLSI1024-60LJ for earlier revisions - HD-PLD: 2x AMD MACH231-15-JC/1-18JI/1 or... - 2x XILINX XC9572 - PO100ASJ9745 or... - 2x Lattice ispLSI1024-60LJ for earlier revisions + RAM: 1x 76C88AL-15, SRAM 8Kx8 + NVRAM: 1x 76C88AL-15, SRAM 8Kx8 (battery backed) + ROMs: 4x 27C256 + (3x 27C256 for earlier revisions) + 1x 27C020 - RAM: 1x 76C88AL-15, SRAM 8Kx8 - NVRAM: 1x 76C88AL-15, SRAM 8Kx8 (battery backed) - ROMs: 4x 27C256 - (3x 27C256 for earlier revisions) - 1x 27C020 + PROMs: 1x 82S147 or similar. (512 bytes) - PROMs: 1x 82S147 or similar. (512 bytes) + Clock: 1x Crystal: 16MHz. - Clock: 1x Crystal: 16MHz. - - Other: 1x 28x2 edge connector. - 1x 15-pins connector. - 1x trimmer (volume). - 1x 8 DIP switches. - 1x 3.5 Volt, 55-80 mAh battery. + Other: 1x 28x2 edge connector. + 1x 15-pins connector. + 1x trimmer (volume). + 1x 8 DIP switches. + 1x 3.5 Volt, 55-80 mAh battery. *************************************************************************************** + All supported games have been coded using some italian C.M.C games as point to start, + changing hardware accesses, program logics, graphics, plus protection and some I/O + through the 2x high density PLDs. - All supported games have been coded using some italian C.M.C games as point to start, - changing hardware accesses, program logics, graphics, plus protection and some I/O - through the 2x high density PLDs. - - Color palettes are normally stored in format GGBBBRRR inside a bipolar color PROM - (old hardware), or repeated 64 times inside a regular 27c256 ROM (new hardware). + Color palettes are normally stored in format GGBBBRRR inside a bipolar color PROM + (old hardware), or repeated 64 times inside a regular 27c256 ROM (new hardware). - - bits - - 7654 3210 - ---- -xxx Red component. - --xx x--- Blue component. - xx-- ---- Green component. + - bits - + 7654 3210 + ---- -xxx Red component. + --xx x--- Blue component. + xx-- ---- Green component. - Same as Funworld video hardware, this one was designed to manage 4096 tiles with a - size of 8x4 pixels each. Also support 4bpp graphics and the palette limitation is - 8 bits for color codes (256 x 16 colors). It means the hardware was designed for more - elaborated graphics than these games... + Same as Funworld video hardware, this one was designed to manage 4096 tiles with a + size of 8x4 pixels each. Also support 4bpp graphics and the palette limitation is + 8 bits for color codes (256 x 16 colors). It means the hardware was designed for more + elaborated graphics than these games... - Color PROMs from current games are 512 bytes lenght, but they only use the first 256 bytes. + Color PROMs from current games are 512 bytes lenght, but they only use the first 256 bytes. - The sound is composed by 4-bit ADPCM samples. All the supported games have the same sound ROM. - All the sounds/samples were ripped from the Gottlieb pinball 'Cue Ball Wizard'(1992). + The sound is composed by 4-bit ADPCM samples. All the supported games have the same sound ROM. + All the sounds/samples were ripped from the Gottlieb pinball 'Cue Ball Wizard'(1992). - ***** Game Notes ***** + ***** Game Notes ***** - To initialize NVRAM (for all games), keep pressed ESTATISTICA (key '9') + MANAGEMENT (key '0'), - then press RESET (key F3), and finally release both (ESTATISTICA + MANAGEMENT) keys. + To initialize NVRAM (for all games), keep pressed ESTATISTICA (key '9') + MANAGEMENT (key '0'), + then press RESET (key F3), and finally release both (ESTATISTICA + MANAGEMENT) keys. - Enter ESTATISTICA (key '9'), to enter the stats mode. Press PLAY/CANCELLA (key 'N') - for 5 seconds to reset all values to zero. Press START (key '1') to exit the mode. + Enter ESTATISTICA (key '9'), to enter the stats mode. Press PLAY/CANCELLA (key 'N') + for 5 seconds to reset all values to zero. Press START (key '1') to exit the mode. - Enter MANAGEMENT (key '0'), to enter the management mode. Press PLAY/CANCELLA (key 'N') - to access the PROGRAMAZZIONE (program mode), where you can change the game parameters. - Press START (key '1') to exit both modes. + Enter MANAGEMENT (key '0'), to enter the management mode. Press PLAY/CANCELLA (key 'N') + to access the PROGRAMAZZIONE (program mode), where you can change the game parameters. + Press START (key '1') to exit both modes. - To clear credits (and stats), just re-initialize the NVRAM. + To clear credits (and stats), just re-initialize the NVRAM. - Only for the new hardware revision (snookr10 & apple10), pressing STOP 1 (key 'Z') into the - stats mode, make the hidden Input Test mode to appear. Press RESET (F3) to exit the mode. + Only for the new hardware revision (snookr10 & apple10), pressing STOP 1 (key 'Z') into the + stats mode, make the hidden Input Test mode to appear. Press RESET (F3) to exit the mode. - --- Super Game --- + --- Super Game --- - If you have some points accumulated and need to grab the tokens/tickets, you must to play - a bonus game called SUPER GAME to get the points out. To enter the bonus game, you must - press STOP5 in the attract mode. The payout system is through this game. + If you have some points accumulated and need to grab the tokens/tickets, you must to play + a bonus game called SUPER GAME to get the points out. To enter the bonus game, you must + press STOP5 in the attract mode. The payout system is through this game. - 5 themed items will be shown (apples, balls, etc... depending of the game). - The joker will start to move from item to item quickly, but decreasing the speed gradually. - To beat the game, you need to push the start button in the exact moment when the joker is - located exactly in the center of the screen (item 3). + 5 themed items will be shown (apples, balls, etc... depending of the game). + The joker will start to move from item to item quickly, but decreasing the speed gradually. + To beat the game, you need to push the start button in the exact moment when the joker is + located exactly in the center of the screen (item 3). - Depending of the DIP switches settings, you can grab the prize manually pressing the SCARICA - (payout) button, and then TICKET or HOPPER buttons. Press TICKET button to print a 100 points - ticket. Press HOPPER button to get tokens x10 points. + Depending of the DIP switches settings, you can grab the prize manually pressing the SCARICA + (payout) button, and then TICKET or HOPPER buttons. Press TICKET button to print a 100 points + ticket. Press HOPPER button to get tokens x10 points. - You have 1 attempt for each 100 earned points. If you lose the game, you lose the points. + You have 1 attempt for each 100 earned points. If you lose the game, you lose the points. - NOTE: Bit 7 of input port 0x3004 is tied to bit 7 of input port 0x3003 (DIP switch 1). - This allow to use the PAYOUT button to trigger the Supper Game instead of STOP 5. + NOTE: Bit 7 of input port 0x3004 is tied to bit 7 of input port 0x3003 (DIP switch 1). + This allow to use the PAYOUT button to trigger the Supper Game instead of STOP 5. *************************************************************************************** - - Encryption schemes... - --------------------- - - * Apple 10 - - - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled. - - You can see the following table, where 'Normal tile #' is the tile number called - to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix: - - Normal | Scrambled - tile # | tile # - -------+---------- - 0x00 | 0x00 \ - 0x01 | 0x80 | - 0x02 | 0x40 | Big "0" - 0x03 | 0xC0 | - 0x04 | 0x20 | - 0x05 | 0xA0 / - -------+---------- - 0x06 | 0x60 \ - 0x07 | 0xE0 | - 0x08 | 0x10 | Big "1" - 0x09 | 0x90 | - 0x0A | 0x50 | - 0x0B | 0xD0 / - -------+---------- - 0x0C | 0x30 \ - 0x0D | 0xB0 | - 0x0E | 0x70 | Big "2" - 0x0F | 0xF0 | - 0x10 | 0x08 | - 0x11 | 0x88 / - -------+---------- - 0x12 | 0x48 \ - 0x13 | 0xC8 | - 0x14 | 0x28 | Big "3" - 0x15 | 0xA8 | - 0x16 | 0x68 | - 0x17 | 0xE8 / - -------+---------- - 0x18 | 0x18 \ - 0x19 | 0x98 | - 0x1A | 0x58 | Big "4" - 0x1B | 0xD8 | - 0x1C | 0x38 | - 0x1D | 0xB8 / - -------+---------- - 0x1E | 0x78 \ - 0x1F | 0xF8 | - 0x20 | 0x04 | Big "5" - 0x21 | 0x84 | - 0x22 | 0x44 | - 0x23 | 0xC4 / - -------+---------- - 0x24 | 0x24 \ - 0x25 | 0xA4 | - 0x26 | 0x64 | Big "6" - 0x27 | 0xE4 | - 0x28 | 0x14 | - 0x29 | 0x94 / - -------+---------- - 0x2A | 0x54 \ - 0x2B | 0xD4 | - 0x2C | 0x34 | Big "7" - 0x2D | 0xB4 | - 0x2E | 0x74 | - 0x2F | 0xF4 / - -------+---------- - - So we extract the following decryption table: - - 0 <-> 0; 1 <-> 8; 2 <-> 4; 3 <-> C - 4 <-> 2; 5 <-> A; 6 <-> 6; 7 <-> E - 8 <-> 1; 9 <-> 9; A <-> 5; B <-> D - C <-> 3; D <-> B; E <-> 7; F <-> F - - ...and then swap nibbles. - - Also note that the values are inverted/mirrored bits of the original ones. - - 0x01 (0001) <-> 0x08 (1000) - 0x02 (0010) <-> 0x04 (0100) - 0x03 (0011) <-> 0x0C (1100) - 0x04 (0100) <-> 0x04 (0010) - 0x05 (0101) <-> 0x0A (1010) - ...and so on. - - To properly decrypt the thing 'on the fly' as the hardware does, I applied a bitswap into TILE_GET_INFO. - This method rearrange the tile number for each tile called to be drawn. - - The final algorithm is: - digit #3 - +-------+ swapped digits 1 & 2 - | | +-------+------+ - tile_offset = BITSWAP16((tile_offset & 0xfff),15,14,13,12, 8,9,10,11, 0,1,2,3, 4,5,6,7) - | | | | | | | | || | | | - inverted inverted|inverted - bitorder bitorder|bitorder - - Colors are scrambled in the following way: - - Normal | Scrambled - offset | offset - ----------+----------- - 0x00-0x0F | 0x00-0x0F - 0x10-0x1F | 0x80-0x8F - 0x20-0x2F | 0x40-0x4F - 0x30-0x3F | 0xC0-0xCF - 0x40-0x4F | 0x20-0x2F - 0x50-0x5F | 0xA0-0xAF - 0x60-0x6F | 0x60-0x6F - 0x70-0x7F | 0xE0-0xEF - ----------+----------- - 0x80-0x8F | 0x10-0x1F - 0x90-0x9F | 0x90-0x9F - 0xA0-0xAF | 0x50-0x5F - 0xB0-0xBF | 0xD0-0xDF - 0xC0-0xCF | 0x30-0x3F - 0xD0-0xDF | 0xB0-0xBF - 0xE0-0xEF | 0x70-0x7F - 0xF0-0xFF | 0xF0-0xFF - - And each one of these segments are internally scrambled too. - - So, the algorithm to properly decrypt the color codes is very different here: - - 1st nibble - inverted bitorder - | | | | - color_index = BITSWAP8(color_index,4,5,6,7,2,3,0,1) - <-> <-> - 2nd nibble - swappeed pairs - - Scary, huh?... ;-) + Encryption schemes... + --------------------- + + * Apple 10 + + - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled. + + You can see the following table, where 'Normal tile #' is the tile number called + to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix: + + Normal | Scrambled + tile # | tile # + -------+---------- + 0x00 | 0x00 \ + 0x01 | 0x80 | + 0x02 | 0x40 | Big "0" + 0x03 | 0xC0 | + 0x04 | 0x20 | + 0x05 | 0xA0 / + -------+---------- + 0x06 | 0x60 \ + 0x07 | 0xE0 | + 0x08 | 0x10 | Big "1" + 0x09 | 0x90 | + 0x0A | 0x50 | + 0x0B | 0xD0 / + -------+---------- + 0x0C | 0x30 \ + 0x0D | 0xB0 | + 0x0E | 0x70 | Big "2" + 0x0F | 0xF0 | + 0x10 | 0x08 | + 0x11 | 0x88 / + -------+---------- + 0x12 | 0x48 \ + 0x13 | 0xC8 | + 0x14 | 0x28 | Big "3" + 0x15 | 0xA8 | + 0x16 | 0x68 | + 0x17 | 0xE8 / + -------+---------- + 0x18 | 0x18 \ + 0x19 | 0x98 | + 0x1A | 0x58 | Big "4" + 0x1B | 0xD8 | + 0x1C | 0x38 | + 0x1D | 0xB8 / + -------+---------- + 0x1E | 0x78 \ + 0x1F | 0xF8 | + 0x20 | 0x04 | Big "5" + 0x21 | 0x84 | + 0x22 | 0x44 | + 0x23 | 0xC4 / + -------+---------- + 0x24 | 0x24 \ + 0x25 | 0xA4 | + 0x26 | 0x64 | Big "6" + 0x27 | 0xE4 | + 0x28 | 0x14 | + 0x29 | 0x94 / + -------+---------- + 0x2A | 0x54 \ + 0x2B | 0xD4 | + 0x2C | 0x34 | Big "7" + 0x2D | 0xB4 | + 0x2E | 0x74 | + 0x2F | 0xF4 / + -------+---------- + + So we extract the following decryption table: + + 0 <-> 0; 1 <-> 8; 2 <-> 4; 3 <-> C + 4 <-> 2; 5 <-> A; 6 <-> 6; 7 <-> E + 8 <-> 1; 9 <-> 9; A <-> 5; B <-> D + C <-> 3; D <-> B; E <-> 7; F <-> F + + ...and then swap nibbles. + + Also note that the values are inverted/mirrored bits of the original ones. + + 0x01 (0001) <-> 0x08 (1000) + 0x02 (0010) <-> 0x04 (0100) + 0x03 (0011) <-> 0x0C (1100) + 0x04 (0100) <-> 0x04 (0010) + 0x05 (0101) <-> 0x0A (1010) + ...and so on. + + To properly decrypt the thing 'on the fly' as the hardware does, I applied a bitswap into TILE_GET_INFO. + This method rearrange the tile number for each tile called to be drawn. + + The final algorithm is: + digit #3 + +-------+ swapped digits 1 & 2 + | | +-------+------+ + tile_offset = BITSWAP16((tile_offset & 0xfff),15,14,13,12, 8,9,10,11, 0,1,2,3, 4,5,6,7) + | | | | | | | | || | | | + inverted inverted|inverted + bitorder bitorder|bitorder + Colors are scrambled in the following way: + + Normal | Scrambled + offset | offset + ----------+----------- + 0x00-0x0F | 0x00-0x0F + 0x10-0x1F | 0x80-0x8F + 0x20-0x2F | 0x40-0x4F + 0x30-0x3F | 0xC0-0xCF + 0x40-0x4F | 0x20-0x2F + 0x50-0x5F | 0xA0-0xAF + 0x60-0x6F | 0x60-0x6F + 0x70-0x7F | 0xE0-0xEF + ----------+----------- + 0x80-0x8F | 0x10-0x1F + 0x90-0x9F | 0x90-0x9F + 0xA0-0xAF | 0x50-0x5F + 0xB0-0xBF | 0xD0-0xDF + 0xC0-0xCF | 0x30-0x3F + 0xD0-0xDF | 0xB0-0xBF + 0xE0-0xEF | 0x70-0x7F + 0xF0-0xFF | 0xF0-0xFF + + And each one of these segments are internally scrambled too. + + So, the algorithm to properly decrypt the color codes is very different here: + + 1st nibble + inverted bitorder + | | | | + color_index = BITSWAP8(color_index,4,5,6,7,2,3,0,1) + <-> <-> + 2nd nibble + swappeed pairs + + Scary, huh?... ;-) ----------------------------------------------------------------------------------- - * Crystals Color - - - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled. - - You can see the following table, where 'Normal tile #' is the tile number called - to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix: - - Normal | Scrambled - tile # | tile # - -------+----------- - 0x00 | 0x000 \ - 0x01 | 0x800 | - 0x02 | 0x100 | Big "0" - 0x03 | 0x900 | - 0x04 | 0x004 | - 0x05 | 0x804 / - -------+----------- - 0x06 | 0x104 \ - 0x07 | 0x904 | - 0x08 | 0x008 | Big "1" - 0x09 | 0x808 | - 0x0A | 0x108 | - 0x0B | 0x908 / - -------+----------- - 0x0C | 0x00C \ - 0x0D | 0x80C | - 0x0E | 0x10C | Big "2" - 0x0F | 0x90C | - 0x10 | 0x010 | - 0x11 | 0x810 / - -------+----------- - 0x12 | 0x110 \ - 0x13 | 0x910 | - 0x14 | 0x014 | Big "3" - 0x15 | 0x814 | - 0x16 | 0x114 | - 0x17 | 0x914 / - -------+----------- - 0x18 | 0x018 \ - 0x19 | 0x818 | - 0x1A | 0x118 | Big "4" - 0x1B | 0x918 | - 0x1C | 0x01C | - 0x1D | 0x81C / - -------+----------- - 0x1E | 0x11C \ - 0x1F | 0x91C | - 0x20 | 0x200 | Big "5" - 0x21 | 0xA00 | - 0x22 | 0x300 | - 0x23 | 0xB00 / - -------+----------- - 0x24 | 0x204 \ - 0x25 | 0xA04 | - 0x26 | 0x304 | Big "6" - 0x27 | 0xB04 | - 0x28 | 0x208 | - 0x29 | 0xA08 / - -------+----------- - 0x2A | 0x308 \ - 0x2B | 0xB08 | - 0x2C | 0x20C | Big "7" - 0x2D | 0xA0C | - 0x2E | 0x30C | - 0x2F | 0xB0C / - -------+----------- - - - Will see some binary patterns... - - - TILE NORMAL POS SCRAMBLED POS - -----+---------------+--------------- - 00: 0000 0000 0000 : 0000 0000 0000 - 01: 0000 0000 0001 : 1000 0000 0000 - 02: 0000 0000 0010 : 0001 0000 0000 - 03: 0000 0000 0011 : 1001 0000 0000 - 04: 0000 0000 0100 : 0000 0000 0100 - 05: 0000 0000 0101 : 1000 0000 0100 - 06: 0000 0000 0110 : 0001 0000 0100 - 07: 0000 0000 0111 : 1001 0000 0100 - - 08: 0000 0000 1000 : 0000 0000 1000 - 09: 0000 0000 1001 : 1000 0000 1000 - 0A: 0000 0000 1010 : 0001 0000 1000 - 0B: 0000 0000 1011 : 1001 0000 1000 - 0C: 0000 0000 1100 : 0000 0000 1100 - 0D: 0000 0000 1101 : 1000 0000 1100 - 0E: 0000 0000 1110 : 0001 0000 1100 - 0F: 0000 0000 1111 : 1001 0000 1100 - - 10: 0000 0001 0000 : 0000 0001 0000 - 11: 0000 0001 0001 : 1000 0001 0000 - 12: 0000 0001 0010 : 0001 0001 0000 - 13: 0000 0001 0011 : 1001 0001 0000 - 14: 0000 0001 0100 : 0000 0001 0100 - 15: 0000 0001 0101 : 1000 0001 0100 - 16: 0000 0001 0110 : 0001 0001 0100 - 17: 0000 0001 0111 : 1001 0001 0100 - - 18: 0000 0001 1000 : 0000 0001 1000 - 19: 0000 0001 1001 : 1000 0001 1000 - 1A: 0000 0001 1010 : 0001 0001 1000 - 1B: 0000 0001 1011 : 1001 0001 1000 - 1C: 0000 0001 1100 : 0000 0001 1100 - 1D: 0000 0001 1101 : 1000 0001 1100 - 1E: 0000 0001 1110 : 0001 0001 1100 - 1F: 0000 0001 1111 : 1001 0001 1100 - - 20: 0000 0010 0000 : 0010 0000 0000 - 21: 0000 0010 0001 : 1010 0000 0000 - 22: 0000 0010 0010 : 0011 0000 0000 - 23: 0000 0010 0011 : 1011 0000 0000 - 24: 0000 0010 0100 : 0010 0000 0100 - 25: 0000 0010 0101 : 1010 0000 0100 - 26: 0000 0010 0110 : 0011 0000 0100 - 27: 0000 0010 0111 : 1011 0000 0100 - - 28: 0000 0010 1000 : 0010 0000 1000 - 29: 0000 0010 1001 : 1010 0000 1000 - 2A: 0000 0010 1010 : 0011 0000 1000 - 2B: 0000 0010 1011 : 1011 0000 1000 - 2C: 0000 0010 1100 : 0010 0000 1100 - 2D: 0000 0010 1101 : 1010 0000 1100 - 2E: 0000 0010 1110 : 0011 0000 1100 - 2F: 0000 0010 1111 : 1011 0000 1100 - - 40: 0000 0100 0000 : 0000 0100 0000 - 80: 0000 1000 0000 : 0000 1000 0000 - C0: 0000 1100 0000 : 0000 1100 0000 - 100: 0001 0000 0000 : 0000 0000 0010 - - - We have enough data to arrange the following bitswap: - - - FEDCBA9876543210 -> normal tile index. - |||||||||||| - |||||||||||+--> B - - ||||||||||+---> 8 \ - |||||||||+----> 2 | - ||||||||+-----> 3 | - |||||||+------> 4 | - ||||||+-------> 9 |> FEDC0A517694328B -> encrypted tile index. - |||||+--------> 6 | - ||||+---------> 7 | - |||+----------> 1 | - ||+-----------> 5 | - |+------------> A / - +-------------> 0 - - - - - Color RAM: Colors are scrambled in the following way: - - Normal | Scrambled - offset | offset - ----------+----------- - 0x00-0x1F | 0x00-0x1F - 0x20-0x3F | 0x40-0x5F - 0x40-0x5F | 0x20-0x3F - 0x60-0x7F | 0x60-0x7F - ----------+----------- - 0x80-0x9F | 0x80-0x9F - 0xA0-0xBF | 0xC0-0xDF - 0xC0-0xDF | 0xA0-0xBF - 0xE0-0xFF | 0xE0-0xFF - - - The color codes are swapped in blocks of 32 bytes. 0x20<->0x40 and 0xA0<->0xC0, - giving us the following binary representation: - - Normal | Scrambled - offset | offset - ---------------+----------- - 00: 0000 0000 : 0000 0000 - 20: 0010 0000 : 0100 0000 <-- changed - 40: 0100 0000 : 0010 0000 <-- changed - 60: 0110 0000 : 0110 0000 - 80: 1000 0000 : 1000 0000 - A0: 1010 0000 : 1100 0000 <-- changed - C0: 1100 0000 : 1010 0000 <-- changed - E0: 1110 0000 : 1110 0000 - - - So, the algorithm to properly decrypt the color codes is the following one: - - color_index = BITSWAP8(color_index,7,5,6,4,3,2,1,0) - | | - swapped - - Happy end here :) + * Crystals Color + + - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled. + + You can see the following table, where 'Normal tile #' is the tile number called + to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix: + + Normal | Scrambled + tile # | tile # + -------+----------- + 0x00 | 0x000 \ + 0x01 | 0x800 | + 0x02 | 0x100 | Big "0" + 0x03 | 0x900 | + 0x04 | 0x004 | + 0x05 | 0x804 / + -------+----------- + 0x06 | 0x104 \ + 0x07 | 0x904 | + 0x08 | 0x008 | Big "1" + 0x09 | 0x808 | + 0x0A | 0x108 | + 0x0B | 0x908 / + -------+----------- + 0x0C | 0x00C \ + 0x0D | 0x80C | + 0x0E | 0x10C | Big "2" + 0x0F | 0x90C | + 0x10 | 0x010 | + 0x11 | 0x810 / + -------+----------- + 0x12 | 0x110 \ + 0x13 | 0x910 | + 0x14 | 0x014 | Big "3" + 0x15 | 0x814 | + 0x16 | 0x114 | + 0x17 | 0x914 / + -------+----------- + 0x18 | 0x018 \ + 0x19 | 0x818 | + 0x1A | 0x118 | Big "4" + 0x1B | 0x918 | + 0x1C | 0x01C | + 0x1D | 0x81C / + -------+----------- + 0x1E | 0x11C \ + 0x1F | 0x91C | + 0x20 | 0x200 | Big "5" + 0x21 | 0xA00 | + 0x22 | 0x300 | + 0x23 | 0xB00 / + -------+----------- + 0x24 | 0x204 \ + 0x25 | 0xA04 | + 0x26 | 0x304 | Big "6" + 0x27 | 0xB04 | + 0x28 | 0x208 | + 0x29 | 0xA08 / + -------+----------- + 0x2A | 0x308 \ + 0x2B | 0xB08 | + 0x2C | 0x20C | Big "7" + 0x2D | 0xA0C | + 0x2E | 0x30C | + 0x2F | 0xB0C / + -------+----------- + + + Will see some binary patterns... + + TILE NORMAL POS SCRAMBLED POS + -----+---------------+--------------- + 00: 0000 0000 0000 : 0000 0000 0000 + 01: 0000 0000 0001 : 1000 0000 0000 + 02: 0000 0000 0010 : 0001 0000 0000 + 03: 0000 0000 0011 : 1001 0000 0000 + 04: 0000 0000 0100 : 0000 0000 0100 + 05: 0000 0000 0101 : 1000 0000 0100 + 06: 0000 0000 0110 : 0001 0000 0100 + 07: 0000 0000 0111 : 1001 0000 0100 + + 08: 0000 0000 1000 : 0000 0000 1000 + 09: 0000 0000 1001 : 1000 0000 1000 + 0A: 0000 0000 1010 : 0001 0000 1000 + 0B: 0000 0000 1011 : 1001 0000 1000 + 0C: 0000 0000 1100 : 0000 0000 1100 + 0D: 0000 0000 1101 : 1000 0000 1100 + 0E: 0000 0000 1110 : 0001 0000 1100 + 0F: 0000 0000 1111 : 1001 0000 1100 + + 10: 0000 0001 0000 : 0000 0001 0000 + 11: 0000 0001 0001 : 1000 0001 0000 + 12: 0000 0001 0010 : 0001 0001 0000 + 13: 0000 0001 0011 : 1001 0001 0000 + 14: 0000 0001 0100 : 0000 0001 0100 + 15: 0000 0001 0101 : 1000 0001 0100 + 16: 0000 0001 0110 : 0001 0001 0100 + 17: 0000 0001 0111 : 1001 0001 0100 + + 18: 0000 0001 1000 : 0000 0001 1000 + 19: 0000 0001 1001 : 1000 0001 1000 + 1A: 0000 0001 1010 : 0001 0001 1000 + 1B: 0000 0001 1011 : 1001 0001 1000 + 1C: 0000 0001 1100 : 0000 0001 1100 + 1D: 0000 0001 1101 : 1000 0001 1100 + 1E: 0000 0001 1110 : 0001 0001 1100 + 1F: 0000 0001 1111 : 1001 0001 1100 + + 20: 0000 0010 0000 : 0010 0000 0000 + 21: 0000 0010 0001 : 1010 0000 0000 + 22: 0000 0010 0010 : 0011 0000 0000 + 23: 0000 0010 0011 : 1011 0000 0000 + 24: 0000 0010 0100 : 0010 0000 0100 + 25: 0000 0010 0101 : 1010 0000 0100 + 26: 0000 0010 0110 : 0011 0000 0100 + 27: 0000 0010 0111 : 1011 0000 0100 + + 28: 0000 0010 1000 : 0010 0000 1000 + 29: 0000 0010 1001 : 1010 0000 1000 + 2A: 0000 0010 1010 : 0011 0000 1000 + 2B: 0000 0010 1011 : 1011 0000 1000 + 2C: 0000 0010 1100 : 0010 0000 1100 + 2D: 0000 0010 1101 : 1010 0000 1100 + 2E: 0000 0010 1110 : 0011 0000 1100 + 2F: 0000 0010 1111 : 1011 0000 1100 + + 40: 0000 0100 0000 : 0000 0100 0000 + 80: 0000 1000 0000 : 0000 1000 0000 + C0: 0000 1100 0000 : 0000 1100 0000 + 100: 0001 0000 0000 : 0000 0000 0010 + + + We have enough data to arrange the following bitswap: + + FEDCBA9876543210 -> normal tile index. + |||||||||||| + |||||||||||+--> B - + ||||||||||+---> 8 \ + |||||||||+----> 2 | + ||||||||+-----> 3 | + |||||||+------> 4 | + ||||||+-------> 9 |> FEDC0A517694328B -> encrypted tile index. + |||||+--------> 6 | + ||||+---------> 7 | + |||+----------> 1 | + ||+-----------> 5 | + |+------------> A / + +-------------> 0 - + + + - Color RAM: Colors are scrambled in the following way: + + Normal | Scrambled + offset | offset + ----------+----------- + 0x00-0x1F | 0x00-0x1F + 0x20-0x3F | 0x40-0x5F + 0x40-0x5F | 0x20-0x3F + 0x60-0x7F | 0x60-0x7F + ----------+----------- + 0x80-0x9F | 0x80-0x9F + 0xA0-0xBF | 0xC0-0xDF + 0xC0-0xDF | 0xA0-0xBF + 0xE0-0xFF | 0xE0-0xFF + + + The color codes are swapped in blocks of 32 bytes. 0x20<->0x40 and 0xA0<->0xC0, + giving us the following binary representation: + + Normal | Scrambled + offset | offset + ---------------+----------- + 00: 0000 0000 : 0000 0000 + 20: 0010 0000 : 0100 0000 <-- changed + 40: 0100 0000 : 0010 0000 <-- changed + 60: 0110 0000 : 0110 0000 + 80: 1000 0000 : 1000 0000 + A0: 1010 0000 : 1100 0000 <-- changed + C0: 1100 0000 : 1010 0000 <-- changed + E0: 1110 0000 : 1110 0000 + + + So, the algorithm to properly decrypt the color codes is the following one: + + color_index = BITSWAP8(color_index,7,5,6,4,3,2,1,0) + | | + swapped + + Happy end here :) *********************************************************************************** - - * MEMORY MAPS * - --------------- - - (Old hardware) - - $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. - $1000 - $1000 OKI6295 ;R/W, sound. - $4000 - $4000 Input Port 0 ;R - $4001 - $4001 Input Port 1 ;R - $4002 - $4002 Input Port 2 ;R - $4003 - $4003 Input Port 3 ;R , DIP switches. - $5000 - $5000 Output Port 0 ; W, lamps & counters. - $5001 - $5001 Output Port 1 ; W, lamps. - $6000 - $6FFF Video RAM - $7000 - $7FFF Color RAM - $8000 - $FFFF ROM Space - - - (New hardware) - - $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. - $1000 - $1000 OKI6295 ;R/W, sound. - $3000 - $3000 Input Port 0 ;R - $3001 - $3001 Input Port 1 ;R - $3002 - $3002 Input Port 2 ;R - $3003 - $3003 Input Port 3 ;R , DIP switches. - $3004 - $3004 Input Port 4 ;R , bit 7 in parallel with DIP switch 1. - $5000 - $5000 Output Port 0 ; W, lamps & counters. - $5001 - $5001 Output Port 1 ; W, lamps. - $6000 - $6FFF Video RAM - $7000 - $7FFF Color RAM - $8000 - $FFFF ROM Space - - - (Crystals hardware) - - $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. - $1000 - $1000 Output Port 0 ; W, lamps & counters. - $1001 - $1001 Output Port 1 ; W, lamps. - $2000 - $2008 Special Input ;R , special ports meant for data channels... - $3000 - $3000 Input Port 0 ;R - $3001 - $3001 Input Port 1 ;R - $3002 - $3002 Input Port 2 ;R - $3003 - $3003 Input Port 3 ;R , DIP switches. - $5000 - $5000 OKI6295 ;R/W, sound. - $6000 - $6FFF Video RAM - $7000 - $7FFF Color RAM - $8000 - $FFFF ROM Space + * MEMORY MAPS * + --------------- + + (Old hardware) + + $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. + $1000 - $1000 OKI6295 ;R/W, sound. + $4000 - $4000 Input Port 0 ;R + $4001 - $4001 Input Port 1 ;R + $4002 - $4002 Input Port 2 ;R + $4003 - $4003 Input Port 3 ;R , DIP switches. + $5000 - $5000 Output Port 0 ; W, lamps & counters. + $5001 - $5001 Output Port 1 ; W, lamps. + $6000 - $6FFF Video RAM + $7000 - $7FFF Color RAM + $8000 - $FFFF ROM Space + + + (New hardware) + + $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. + $1000 - $1000 OKI6295 ;R/W, sound. + $3000 - $3000 Input Port 0 ;R + $3001 - $3001 Input Port 1 ;R + $3002 - $3002 Input Port 2 ;R + $3003 - $3003 Input Port 3 ;R , DIP switches. + $3004 - $3004 Input Port 4 ;R , bit 7 in parallel with DIP switch 1. + $5000 - $5000 Output Port 0 ; W, lamps & counters. + $5001 - $5001 Output Port 1 ; W, lamps. + $6000 - $6FFF Video RAM + $7000 - $7FFF Color RAM + $8000 - $FFFF ROM Space + + + (Crystals hardware) + + $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. + $1000 - $1000 Output Port 0 ; W, lamps & counters. + $1001 - $1001 Output Port 1 ; W, lamps. + $2000 - $2008 Special Input ;R , special ports meant for data channels... + $3000 - $3000 Input Port 0 ;R + $3001 - $3001 Input Port 1 ;R + $3002 - $3002 Input Port 2 ;R + $3003 - $3003 Input Port 3 ;R , DIP switches. + $5000 - $5000 OKI6295 ;R/W, sound. + $6000 - $6FFF Video RAM + $7000 - $7FFF Color RAM + $8000 - $FFFF ROM Space *********************************************************************************** + *** Driver Updates *** - *** Driver Updates *** + [2016/03/30] - [2013/05/12] + - Added Crystals Colours (v1.02) + - Set the new set as parent. + - Added proper default NVRAM. + - Added technical notes. - Crystals Colours: - - Decrypted the tile matrix / video RAM. - - Wrote proper memory map and inputs from the scratch. - - Bypassed the program data channels protection. - - Decrypted the colors / color RAM. - - Added button-lamps support. - - Created a default NVRAM. - - Promoted to working state. - - Added technical and encryption notes... + + [2013/05/12] - Snooker 10: - - Fixed NVRAM size. - - Added default NVRAM. + Crystals Colours: + - Decrypted the tile matrix / video RAM. + - Wrote proper memory map and inputs from the scratch. + - Bypassed the program data channels protection. + - Decrypted the colors / color RAM. + - Added button-lamps support. + - Created a default NVRAM. + - Promoted to working state. + - Added technical and encryption notes... - Apple 10: - - Fixed NVRAM size. - - Added default NVRAM. + Snooker 10: + - Fixed NVRAM size. + - Added default NVRAM. - Ten Balls: - - Fixed NVRAM size. - - Added default NVRAM. + Apple 10: + - Fixed NVRAM size. + - Added default NVRAM. + Ten Balls: + - Fixed NVRAM size. + - Added default NVRAM. - [2013/05/04] - - Added Crystals Colours (Ver 1.01). + [2013/05/04] + - Added Crystals Colours (Ver 1.01). - [2008/10/09] - - Reworked the button-lamps matrix system. - - Documented both output ports. - - Connected coin in, key in and payout counters. - - Improved the lamps layout to be more realistic. - - Updated technical notes. + [2008/10/09] + - Reworked the button-lamps matrix system. + - Documented both output ports. + - Connected coin in, key in and payout counters. + - Improved the lamps layout to be more realistic. + - Updated technical notes. - [2008/06/09] - - Fixed the tilemap size. - - Fixed the screen size. - - Updated technical notes. + [2008/06/09] + - Fixed the tilemap size. + - Fixed the screen size. + - Updated technical notes. - [2008/05/29] - - Switched the color system to RESNET calculations. - - Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1. - This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5. - - Demultiplexed lamps matrix. - - Added lamps support, but is still imperfect. - - Updated technical notes. + [2008/05/29] + - Switched the color system to RESNET calculations. + - Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1. + This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5. + - Demultiplexed lamps matrix. + - Added lamps support, but is still imperfect. + - Updated technical notes. - [2008/05/22] - - Confirmed the CPU clock after some PCB measurements. - - Changed the SND clock to 1MHz to match the PCB measurement. - - Corrected the internal OKI6295 frequency turning the pin 7 state to HIGH. - - Inputs: Eliminated all pulse limitations. - Affected buttons have a rattled sound in the real thing too. - - Updated technical notes. + [2008/05/22] + - Confirmed the CPU clock after some PCB measurements. + - Changed the SND clock to 1MHz to match the PCB measurement. + - Corrected the internal OKI6295 frequency turning the pin 7 state to HIGH. + - Inputs: Eliminated all pulse limitations. + Affected buttons have a rattled sound in the real thing too. + - Updated technical notes. - [2008/04/28] - - Created a new machine driver for tenballs due to different memory map. - - Worked all the input ports from the scratch. - - Fixed the sound ROM_REGION. - - Added the oki6295 emulation to all games. - - Hooked output ports. - - Documented and calculated all bits related to lamps. - - Adjusted palette lenght to 256 colors. - - Totally decrypted the apple10 color matrix. Now colors are perfect. - - Created a new machine driver for apple10 due to encryption. - - Reverse engineering the code to complete the DIP switches. - - Added diplocations to DIP switches. - - Promoted snookr10, apple10 and tenballs to 'WORKING' state. - - Added game instructions & notes. - - Updated encryption & technical notes. + [2008/04/28] + - Created a new machine driver for tenballs due to different memory map. + - Worked all the input ports from the scratch. + - Fixed the sound ROM_REGION. + - Added the oki6295 emulation to all games. + - Hooked output ports. + - Documented and calculated all bits related to lamps. + - Adjusted palette lenght to 256 colors. + - Totally decrypted the apple10 color matrix. Now colors are perfect. + - Created a new machine driver for apple10 due to encryption. + - Reverse engineering the code to complete the DIP switches. + - Added diplocations to DIP switches. + - Promoted snookr10, apple10 and tenballs to 'WORKING' state. + - Added game instructions & notes. + - Updated encryption & technical notes. - [2008/04/24] - - Decrypted the apple10 tile matrix. - - Partially decrypted the apple10 color codes. - - Added encryption notes. - - Updated technical notes. + [2008/04/24] + - Decrypted the apple10 tile matrix. + - Partially decrypted the apple10 color codes. + - Added encryption notes. + - Updated technical notes. - [2008/04/18] - - Initial release. Support for snookr10, apple10 and tenballs. - - Added technical/general notes. + [2008/04/18] + - Initial release. Support for snookr10, apple10 and tenballs. + - Added technical/general notes. - *** TO DO *** - - Nothing... :) + *** TO DO *** + - Nothing... :) ***********************************************************************************/ @@ -1159,6 +1156,9 @@ ROM_START( crystalc ) ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ ROM_LOAD( "crystals_colours_4.u28", 0x00000, 0x40000, CRC(ecc6b575) SHA1(f6032e89b30aebeab9ad721608277430084256bc) ) + ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */ + ROM_LOAD( "crystals_colours_1.02_nvram.bin", 0x0000, 0x0800, CRC(20456301) SHA1(224da8fd8ea0997741bd5a7d51c8ca7f264d2302) ) + ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "am27s29pc.u17", 0x0000, 0x0200, CRC(1af53eab) SHA1(1cac837aed75a77a0b93a294b07f2a8de6fcffef) ) ROM_END |