Previous 199869 Revisions Next

r22814 Monday 13th May, 2013 at 18:52:10 UTC by Roberto Fresca
Crystals Colours improvements: [Roberto Fresca]

- 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...

Snooker 10 improvements: [Roberto Fresca]

- Fixed NVRAM size.
- Added default NVRAM.

Apple 10 improvements: [Roberto Fresca]

- Fixed NVRAM size.
- Added default NVRAM.

Ten Balls improvements: [Roberto Fresca]

- Fixed NVRAM size.
- Added default NVRAM.


New games added or promoted from NOT_WORKING status
---------------------------------------------------
Crystals Colours (Ver 1.01) [Roberto Fresca, Any]
[src/mame/drivers]snookr10.c
[src/mame/includes]snookr10.h
[src/mame/video]snookr10.c

trunk/src/mame/drivers/snookr10.c
r22813r22814
88
99    Games running on this hardware:
1010
11    * Snooker 10 (Ver 1.11),      Sandii', 1998.
12    * Apple 10 (Ver 1.21),        Sandii', 1998.
13    * Ten Balls (Ver 1.05),       unknown, 1997.
14    * Crystals Colors (Ver 1.01), unknown, 199?.
11    * Snooker 10 (Ver 1.11),       Sandii', 1998.
12    * Apple 10 (Ver 1.21),         Sandii', 1998.
13    * Ten Balls (Ver 1.05),        unknown, 1997.
14    * Crystals Colours (Ver 1.01), JCD srl, 1998.
1515
1616
1717***********************************************************************************
r22813r22814
2626            1x LM358N
2727            1x TDA2003
2828
29    HD-PLD: 2x AMD MACH231-15-JC/1-18JI/1
30            (2x Lattice ispLSI1024-60LJ for earlier revisions)
29    HD-PLD: 2x AMD MACH231-15-JC/1-18JI/1     or...
30            2x XILINX XC9572 - PO100ASJ9745   or...
31            2x Lattice ispLSI1024-60LJ for earlier revisions
3132
3233    RAM:    1x 76C88AL-15, SRAM 8Kx8
3334    NVRAM:  1x 76C88AL-15, SRAM 8Kx8 (battery backed)
r22813r22814
4041    Clock:  1x Crystal: 16MHz.
4142
4243    Other:  1x 28x2 edge connector.
43            1x 15 legs connector.
44            1x 15-pins connector.
4445            1x trimmer (volume).
4546            1x 8 DIP switches.
4647            1x 3.5 Volt, 55-80 mAh battery.
r22813r22814
116117***************************************************************************************
117118
118119
119    Issues / Protection
120    -------------------
120    Encryption schemes...
121    ---------------------
121122
122123    * Apple 10
123124
124    - Tile matrix and color palette are totally encrypted/scrambled.
125    - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled.
125126
126    You can see the following table, where 'Normal tile #' is the tile number called to be drawn, and
127    'Scrambled tile #' is the phisical tile position in the matrix:
127    You can see the following table, where 'Normal tile #' is the tile number called
128   to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix:
128129
129130    Normal | Scrambled
130131    tile # |  tile #
r22813r22814
207208    To properly decrypt the thing 'on the fly' as the hardware does, I applied a bitswap into TILE_GET_INFO.
208209    This method rearrange the tile number for each tile called to be drawn.
209210
210    The final algorithm:
211                                                                   digit #3
212                                                                   +-------+ swapped digits 1 & 2
213                                                                   |       |  +-------+------+
214        tile_offset = BITSWAP16((tile_offset & 0xfff),15,14,13,12, 8,9,10,11, 0,1,2,3, 4,5,6,7)
215                                                                   | | |  |   | | | | || | | |
216                                                                   inverted   inverted|inverted
217                                                                   bitorder   bitorder|bitorder
211    The final algorithm is:
212                                                                 digit #3
213                                                                 +-------+ swapped digits 1 & 2
214                                                                 |       |  +-------+------+
215      tile_offset = BITSWAP16((tile_offset & 0xfff),15,14,13,12, 8,9,10,11, 0,1,2,3, 4,5,6,7)
216                                                                 | | |  |   | | | | || | | |
217                                                                 inverted   inverted|inverted
218                                                                 bitorder   bitorder|bitorder
218219
219220    Colors are scrambled in the following way:
220221
221      Normal   |  Scrambled
222      offset   |   offset
223   ------------+------------
224    0x00-0x0F  |  0x00-0x0F
225    0x10-0x1F  |  0x80-0x8F
226    0x20-0x2F  |  0x40-0x4F
227    0x30-0x3F  |  0xC0-0xCF
228    0x40-0x4F  |  0x20-0x2F
229    0x50-0x5F  |  0xA0-0xAF
230    0x60-0x6F  |  0x60-0x6F
231    0x70-0x7F  |  0xE0-0xEF
232   ------------+------------
233    0x80-0x8F  |  0x10-0x1F
234    0x90-0x9F  |  0x90-0x9F
235    0xA0-0xAF  |  0x50-0x5F
236    0xB0-0xBF  |  0xD0-0xDF
237    0xC0-0xCF  |  0x30-0x3F
238    0xD0-0xDF  |  0xB0-0xBF
239    0xE0-0xEF  |  0x70-0x7F
240    0xF0-0xFF  |  0xF0-0xFF
222      Normal  | Scrambled
223      offset  |  offset
224    ----------+-----------
225    0x00-0x0F | 0x00-0x0F
226    0x10-0x1F | 0x80-0x8F
227    0x20-0x2F | 0x40-0x4F
228    0x30-0x3F | 0xC0-0xCF
229    0x40-0x4F | 0x20-0x2F
230    0x50-0x5F | 0xA0-0xAF
231    0x60-0x6F | 0x60-0x6F
232    0x70-0x7F | 0xE0-0xEF
233    ----------+-----------
234    0x80-0x8F | 0x10-0x1F
235    0x90-0x9F | 0x90-0x9F
236    0xA0-0xAF | 0x50-0x5F
237    0xB0-0xBF | 0xD0-0xDF
238    0xC0-0xCF | 0x30-0x3F
239    0xD0-0xDF | 0xB0-0xBF
240    0xE0-0xEF | 0x70-0x7F
241    0xF0-0xFF | 0xF0-0xFF
241242
242243    And each one of these segments are internally scrambled too.
243244
244245    So, the algorithm to properly decrypt the color codes is very different here:
245246
246                                          1st nibble
247                                      inverted bitorder
248                                           | | | |
249        color_index = BITSWAP8(color_index,4,5,6,7,2,3,0,1)
250                                                   <-> <->
251                                                  2nd nibble
252                                                swappeed pairs
247                                        1st nibble
248                                    inverted bitorder
249                                         | | | |
250      color_index = BITSWAP8(color_index,4,5,6,7,2,3,0,1)
251                                                 <-> <->
252                                                2nd nibble
253                                              swappeed pairs
253254
254    Scary, huh?... ;)
255    Scary, huh?... ;-)
255256
256257
258-----------------------------------------------------------------------------------
259
260    * Crystals Color
261
262    - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled.
263
264    You can see the following table, where 'Normal tile #' is the tile number called
265   to be drawn, and 'Scrambled tile #' is the phisical tile position in the matrix:
266
267    Normal | Scrambled
268    tile # |  tile #
269    -------+-----------
270     0x00  |   0x000   \
271     0x01  |   0x800    |
272     0x02  |   0x100    | Big "0"
273     0x03  |   0x900    |
274     0x04  |   0x004    |
275     0x05  |   0x804   /
276    -------+-----------
277     0x06  |   0x104   \
278     0x07  |   0x904    |
279     0x08  |   0x008    | Big "1"
280     0x09  |   0x808    |
281     0x0A  |   0x108    |
282     0x0B  |   0x908   /
283    -------+-----------
284     0x0C  |   0x00C   \
285     0x0D  |   0x80C    |
286     0x0E  |   0x10C    | Big "2"
287     0x0F  |   0x90C    |
288     0x10  |   0x010    |
289     0x11  |   0x810   /
290    -------+-----------
291     0x12  |   0x110   \
292     0x13  |   0x910    |
293     0x14  |   0x014    | Big "3"
294     0x15  |   0x814    |
295     0x16  |   0x114    |
296     0x17  |   0x914   /
297    -------+-----------
298     0x18  |   0x018   \
299     0x19  |   0x818    |
300     0x1A  |   0x118    | Big "4"
301     0x1B  |   0x918    |
302     0x1C  |   0x01C    |
303     0x1D  |   0x81C   /
304    -------+-----------
305     0x1E  |   0x11C   \
306     0x1F  |   0x91C    |
307     0x20  |   0x200    | Big "5"
308     0x21  |   0xA00    |
309     0x22  |   0x300    |
310     0x23  |   0xB00   /
311    -------+-----------
312     0x24  |   0x204   \
313     0x25  |   0xA04    |
314     0x26  |   0x304    | Big "6"
315     0x27  |   0xB04    |
316     0x28  |   0x208    |
317     0x29  |   0xA08   /
318    -------+-----------
319     0x2A  |   0x308   \
320     0x2B  |   0xB08    |
321     0x2C  |   0x20C    | Big "7"
322     0x2D  |   0xA0C    |
323     0x2E  |   0x30C    |
324     0x2F  |   0xB0C   /
325    -------+-----------
326
327
328    Will see some binary patterns...
329
330
331    TILE    NORMAL POS     SCRAMBLED POS
332    -----+---------------+---------------
333     00:  0000 0000 0000 : 0000 0000 0000
334     01:  0000 0000 0001 : 1000 0000 0000
335     02:  0000 0000 0010 : 0001 0000 0000
336     03:  0000 0000 0011 : 1001 0000 0000
337     04:  0000 0000 0100 : 0000 0000 0100
338     05:  0000 0000 0101 : 1000 0000 0100
339     06:  0000 0000 0110 : 0001 0000 0100
340     07:  0000 0000 0111 : 1001 0000 0100
341
342     08:  0000 0000 1000 : 0000 0000 1000
343     09:  0000 0000 1001 : 1000 0000 1000
344     0A:  0000 0000 1010 : 0001 0000 1000
345     0B:  0000 0000 1011 : 1001 0000 1000
346     0C:  0000 0000 1100 : 0000 0000 1100
347     0D:  0000 0000 1101 : 1000 0000 1100
348     0E:  0000 0000 1110 : 0001 0000 1100
349     0F:  0000 0000 1111 : 1001 0000 1100
350
351     10:  0000 0001 0000 : 0000 0001 0000
352     11:  0000 0001 0001 : 1000 0001 0000
353     12:  0000 0001 0010 : 0001 0001 0000
354     13:  0000 0001 0011 : 1001 0001 0000
355     14:  0000 0001 0100 : 0000 0001 0100
356     15:  0000 0001 0101 : 1000 0001 0100
357     16:  0000 0001 0110 : 0001 0001 0100
358     17:  0000 0001 0111 : 1001 0001 0100
359
360     18:  0000 0001 1000 : 0000 0001 1000
361     19:  0000 0001 1001 : 1000 0001 1000
362     1A:  0000 0001 1010 : 0001 0001 1000
363     1B:  0000 0001 1011 : 1001 0001 1000
364     1C:  0000 0001 1100 : 0000 0001 1100
365     1D:  0000 0001 1101 : 1000 0001 1100
366     1E:  0000 0001 1110 : 0001 0001 1100
367     1F:  0000 0001 1111 : 1001 0001 1100
368
369     20:  0000 0010 0000 : 0010 0000 0000
370     21:  0000 0010 0001 : 1010 0000 0000
371     22:  0000 0010 0010 : 0011 0000 0000
372     23:  0000 0010 0011 : 1011 0000 0000
373     24:  0000 0010 0100 : 0010 0000 0100
374     25:  0000 0010 0101 : 1010 0000 0100
375     26:  0000 0010 0110 : 0011 0000 0100
376     27:  0000 0010 0111 : 1011 0000 0100
377
378     28:  0000 0010 1000 : 0010 0000 1000
379     29:  0000 0010 1001 : 1010 0000 1000
380     2A:  0000 0010 1010 : 0011 0000 1000
381     2B:  0000 0010 1011 : 1011 0000 1000
382     2C:  0000 0010 1100 : 0010 0000 1100
383     2D:  0000 0010 1101 : 1010 0000 1100
384     2E:  0000 0010 1110 : 0011 0000 1100
385     2F:  0000 0010 1111 : 1011 0000 1100
386
387     40:  0000 0100 0000 : 0000 0100 0000
388     80:  0000 1000 0000 : 0000 1000 0000
389     C0:  0000 1100 0000 : 0000 1100 0000
390    100:  0001 0000 0000 : 0000 0000 0010
391
392
393    We have enough data to arrange the following bitswap:
394
395
396    FEDCBA9876543210 -> normal tile index.
397        ||||||||||||
398        |||||||||||+--> B -
399        ||||||||||+---> 8   \
400        |||||||||+----> 2    |
401        ||||||||+-----> 3    |
402        |||||||+------> 4    |
403        ||||||+-------> 9    |> FEDC0A517694328B -> encrypted tile index.
404        |||||+--------> 6    |
405        ||||+---------> 7    |
406        |||+----------> 1    |
407        ||+-----------> 5    |
408        |+------------> A   /
409        +-------------> 0 -
410
411
412    - Color RAM: Colors are scrambled in the following way:
413
414      Normal  | Scrambled
415      offset  |  offset
416    ----------+-----------
417    0x00-0x1F | 0x00-0x1F
418    0x20-0x3F | 0x40-0x5F
419    0x40-0x5F | 0x20-0x3F
420    0x60-0x7F | 0x60-0x7F
421    ----------+-----------
422    0x80-0x9F | 0x80-0x9F
423    0xA0-0xBF | 0xC0-0xDF
424    0xC0-0xDF | 0xA0-0xBF
425    0xE0-0xFF | 0xE0-0xFF
426
427
428    The color codes are swapped in blocks of 32 bytes. 0x20<->0x40 and 0xA0<->0xC0,
429    giving us the following binary representation:
430
431        Normal     | Scrambled
432        offset     | offset
433    ---------------+-----------
434     00: 0000 0000 : 0000 0000
435     20: 0010 0000 : 0100 0000 <-- changed
436     40: 0100 0000 : 0010 0000 <-- changed
437     60: 0110 0000 : 0110 0000
438     80: 1000 0000 : 1000 0000
439     A0: 1010 0000 : 1100 0000 <-- changed
440     C0: 1100 0000 : 1010 0000 <-- changed
441     E0: 1110 0000 : 1110 0000
442
443
444    So, the algorithm to properly decrypt the color codes is the following one:
445
446      color_index = BITSWAP8(color_index,7,5,6,4,3,2,1,0)
447                                           | |
448                                         swapped
449
450    Happy end here :)
451
452
257453***********************************************************************************
258454
259455
r22813r22814
262458
263459    (Old hardware)
264460
265    $0000 - $0FFF   NVRAM         ;R/W, all registers and settings.
461    $0000 - $07FF   NVRAM (battery backed 6116) ;R/W, all registers and settings.
266462    $1000 - $1000   OKI6295        ;R/W, sound.
267463    $4000 - $4000   Input Port 0   ;R
268464    $4001 - $4001   Input Port 1   ;R
269465    $4002 - $4002   Input Port 2   ;R
270466    $4003 - $4003   Input Port 3   ;R  , DIP switches.
271    $5000 - $5000   Output Port 0  ;W  , lamps & counters.
272    $5001 - $5001   Output Port 1  ;W  , lamps.
467    $5000 - $5000   Output Port 0  ;  W, lamps & counters.
468    $5001 - $5001   Output Port 1  ;  W, lamps.
273469    $6000 - $6FFF   Video RAM
274470    $7000 - $7FFF   Color RAM
275471    $8000 - $FFFF   ROM Space
r22813r22814
277473
278474    (New hardware)
279475
280    $0000 - $0FFF   NVRAM         ;R/W, all registers and settings.
476    $0000 - $07FF   NVRAM (battery backed 6116) ;R/W, all registers and settings.
281477    $1000 - $1000   OKI6295        ;R/W, sound.
282478    $3000 - $3000   Input Port 0   ;R
283479    $3001 - $3001   Input Port 1   ;R
284480    $3002 - $3002   Input Port 2   ;R
285481    $3003 - $3003   Input Port 3   ;R  , DIP switches.
286482    $3004 - $3004   Input Port 4   ;R  , bit 7 in parallel with DIP switch 1.
287    $5000 - $5000   Output Port 0  ;W  , lamps & counters.
288    $5001 - $5001   Output Port 1  ;W  , lamps.
483    $5000 - $5000   Output Port 0  ;  W, lamps & counters.
484    $5001 - $5001   Output Port 1  ;  W, lamps.
289485    $6000 - $6FFF   Video RAM
290486    $7000 - $7FFF   Color RAM
291487    $8000 - $FFFF   ROM Space
292488
293489
490    (Crystals hardware)
491
492    $0000 - $07FF   NVRAM (battery backed 6116) ;R/W, all registers and settings.
493    $1000 - $1000   Output Port 0  ;  W, lamps & counters.
494    $1001 - $1001   Output Port 1  ;  W, lamps.
495   $2000 - $2008   Special Input  ;R  , special ports meant for data channels...
496    $3000 - $3000   Input Port 0   ;R
497    $3001 - $3001   Input Port 1   ;R
498    $3002 - $3002   Input Port 2   ;R
499    $3003 - $3003   Input Port 3   ;R  , DIP switches.
500    $5000 - $5000   OKI6295        ;R/W, sound.
501    $6000 - $6FFF   Video RAM
502    $7000 - $7FFF   Color RAM
503    $8000 - $FFFF   ROM Space
504
505
294506***********************************************************************************
295507
296508
297509    *** Driver Updates ***
298510
299511
512    [2013/05/12]
513
514   Crystals Colours:
515    - Decrypted the tile matrix / video RAM.
516   - Wrote proper memory map and inputs from the scratch.
517   - Bypassed the program data channels protection.
518    - Decrypted the colors / color RAM.
519    - Added button-lamps support.
520    - Created a default NVRAM.
521    - Promoted to working state.
522   - Added technical and encryption notes...
523
524    Snooker 10:
525   - Fixed NVRAM size.
526    - Added default NVRAM.
527
528    Apple 10:
529   - Fixed NVRAM size.
530    - Added default NVRAM.
531
532    Ten Balls:
533   - Fixed NVRAM size.
534    - Added default NVRAM.
535
536
537    [2013/05/04]
538
539    - Added Crystals Colours (Ver 1.01).
540
541
300542    [2008/10/09]
543
301544    - Reworked the button-lamps matrix system.
302545    - Documented both output ports.
303546    - Connected coin in, key in and payout counters.
304547    - Improved the lamps layout to be more realistic.
305548    - Updated technical notes.
306549
550
307551    [2008/06/09]
552
308553    - Fixed the tilemap size.
309554    - Fixed the screen size.
310555    - Updated technical notes.
311556
557
312558    [2008/05/29]
559
313560    - Switched the color system to RESNET calculations.
314561    - Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1.
315562      This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5.
r22813r22814
317564    - Added lamps support, but is still imperfect.
318565    - Updated technical notes.
319566
567
320568    [2008/05/22]
569
321570    - Confirmed the CPU clock after some PCB measurements.
322571    - Changed the SND clock to 1MHz to match the PCB measurement.
323572    - Corrected the internal OKI6295 frequency turning the pin 7 state to HIGH.
r22813r22814
325574      Affected buttons have a rattled sound in the real thing too.
326575    - Updated technical notes.
327576
577
328578    [2008/04/28]
579
329580    - Created a new machine driver for tenballs due to different memory map.
330581    - Worked all the input ports from the scratch.
331582    - Fixed the sound ROM_REGION.
r22813r22814
341592    - Added game instructions & notes.
342593    - Updated encryption & technical notes.
343594
595
344596    [2008/04/24]
597
345598    - Decrypted the apple10 tile matrix.
346599    - Partially decrypted the apple10 color codes.
347600    - Added encryption notes.
348601    - Updated technical notes.
349602
603
350604    [2008/04/18]
605
351606    - Initial release. Support for snookr10, apple10 and tenballs.
352607    - Added technical/general notes.
353608
354    [2013/05/04]
355    - Added Crystals Colors (Ver 1.01).
356609
357
358610    *** TO DO ***
359611
360    - Decrypt Crystals Colors...
612    - Nothing... :)
361613
362614
363615***********************************************************************************/
r22813r22814
494746}
495747
496748
749READ8_MEMBER(snookr10_state::port2000_8_r)
750{
751/*
752    Ports 2000-2008 expect data, otherwise the program trigger
753   a sort of service-text mode, sets 300000 points and starts
754   to decrease the amount one by one, triggering a sound each
755   time the amount is decremented.
756*/
757   return 0xff;
758}
759
497760/*************************
498761* Memory map information *
499762*************************/
500763
501764static ADDRESS_MAP_START( snookr10_map, AS_PROGRAM, 8, snookr10_state )
502   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("nvram")
765   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")   /* battery backed 6116 */
503766   AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
504767   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0")        /* IN0 */
505768   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("IN1")        /* IN1 */
r22813r22814
514777ADDRESS_MAP_END
515778
516779static ADDRESS_MAP_START( tenballs_map, AS_PROGRAM, 8, snookr10_state )
517   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("nvram")
780   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")   /* battery backed 6116 */
518781   AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
519782   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("IN0")        /* IN0 */
520783   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("IN1")        /* IN1 */
r22813r22814
527790   AM_RANGE(0x8000, 0xffff) AM_ROM
528791ADDRESS_MAP_END
529792
793static ADDRESS_MAP_START( crystalc_map, AS_PROGRAM, 8, snookr10_state )
794   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")   /* battery backed 6116 */
795   AM_RANGE(0x1000, 0x1000) AM_WRITE(output_port_0_w)  /* OUT0 */
796   AM_RANGE(0x1001, 0x1001) AM_WRITE(output_port_1_w)  /* OUT1 */
797   AM_RANGE(0x2000, 0x2008) AM_READ(port2000_8_r)      /* unknown... protection or data channels? */
798   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0")        /* IN0 */
799   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("IN1")        /* IN1 */
800   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("IN2")        /* IN2 */
801   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("SW1")        /* DS1 */
802   AM_RANGE(0x5000, 0x5000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
803   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(snookr10_videoram_w) AM_SHARE("videoram")
804   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(snookr10_colorram_w) AM_SHARE("colorram")
805   AM_RANGE(0x8000, 0xffff) AM_ROM
806ADDRESS_MAP_END
530807
808
531809/*************************
532810*      Input ports       *
533811*************************/
r22813r22814
659937   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
660938INPUT_PORTS_END
661939
940static INPUT_PORTS_START( crystalc )
941   PORT_START("IN0")
942   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Remote x100") PORT_CODE(KEYCODE_Q)
943   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )    PORT_NAME("Stop 1")
944   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_CANCEL )   PORT_NAME("Cancella (Cancel) / Play / Bet")
945   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )         PORT_NAME("Start (Deal) / Raddoppio (Double-Up)")
946   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )    PORT_NAME("Stop 5 / Risk (Half Gamble) / Super Game")
947   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )    PORT_NAME("Statistica (Stats)")
948   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Management")
949   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )    PORT_NAME("Stop 4 / Alta (High)")
662950
951   PORT_START("IN1")
952   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Stop 2 / Bassa (Low)")
953   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Stop 3")
954   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER )       PORT_NAME("Ticket") PORT_CODE(KEYCODE_T)
955   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER )       PORT_NAME("Hopper") PORT_CODE(KEYCODE_H)
956   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
957   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
958   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
959   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Scarica (Payout)")
960
961   PORT_START("IN2")
962   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
963   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
964   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
965   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
966   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   // SG vs real value in paytable.
967   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
968   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
969   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
970
971   PORT_START("SW1")
972   PORT_DIPNAME( 0x03, 0x00, "Pool Value" )      PORT_DIPLOCATION("SW1:7,8")
973   PORT_DIPSETTING(    0x03, "100" )
974   PORT_DIPSETTING(    0x02, "200" )
975   PORT_DIPSETTING(    0x01, "500" )
976   PORT_DIPSETTING(    0x00, "1000" )
977   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:6")
978   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
979   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
980   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:5")
981   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
982   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
983   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:4")
984   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
985   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
986   PORT_DIPNAME( 0x60, 0x60, "Payment Type" )      PORT_DIPLOCATION("SW1:3,2")
987   PORT_DIPSETTING(    0x00, "Ticket + Coins" )
988   PORT_DIPSETTING(    0x20, "Ticket only" )
989   PORT_DIPSETTING(    0x40, "Coins only" )
990   PORT_DIPSETTING(    0x60, "Ticket + Coins" )
991   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:1")
992   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
993   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
994INPUT_PORTS_END
995
996
663997/*************************
664998*    Graphics Layouts    *
665999*************************/
r22813r22814
7081042   MCFG_SCREEN_UPDATE_DRIVER(snookr10_state, screen_update_snookr10)
7091043
7101044   MCFG_GFXDECODE(snookr10)
711
7121045   MCFG_PALETTE_LENGTH(256)
7131046
7141047   /* sound hardware */
r22813r22814
7241057   MCFG_CPU_MODIFY("maincpu")
7251058
7261059   /* video hardware */
727   MCFG_PALETTE_INIT_OVERRIDE(snookr10_state,apple10)
728   MCFG_VIDEO_START_OVERRIDE(snookr10_state,apple10)
1060   MCFG_PALETTE_INIT_OVERRIDE(snookr10_state, apple10)
1061   MCFG_VIDEO_START_OVERRIDE(snookr10_state, apple10)
7291062
7301063MACHINE_CONFIG_END
7311064
r22813r22814
7371070
7381071MACHINE_CONFIG_END
7391072
1073static MACHINE_CONFIG_DERIVED( crystalc, snookr10 )
7401074
1075   /* basic machine hardware */
1076   MCFG_CPU_MODIFY("maincpu")
1077   MCFG_CPU_PROGRAM_MAP(crystalc_map)
1078
1079   MCFG_PALETTE_INIT_OVERRIDE(snookr10_state, crystalc)
1080   MCFG_VIDEO_START_OVERRIDE(snookr10_state, crystalc)
1081
1082MACHINE_CONFIG_END
1083
1084
7411085/*************************
7421086*        Rom Load        *
7431087*************************/
r22813r22814
7511095   ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(3009faaa) SHA1(d1cda455b270cb9afa65b9701735a3a1f2a48df2) )
7521096
7531097   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
754   ROM_LOAD( "4.u18", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
1098   ROM_LOAD( "4.u18", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
7551099
1100   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
1101   ROM_LOAD( "snooker_10_nvram.bin", 0x0000, 0x0800, CRC(d383363b) SHA1(88f0d9e53b0bd276d01cefd817f0edcd753322dc) )
1102
7561103   /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */
7571104   ROM_REGION( 0x8000, "proms", 0 )
7581105   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(f3d7d640) SHA1(f78060f4603e316fa3c2ec4ba6d7edf261cf6d8a) )
r22813r22814
7671114   ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(afc535dc) SHA1(ed2d65f3154c6d80b7b22bfef1f30232e4496128) )
7681115
7691116   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
770   ROM_LOAD( "4.u18", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
1117   ROM_LOAD( "4.u18", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
7711118
1119   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
1120   ROM_LOAD( "apple_10_nvram.bin", 0x0000, 0x0800, CRC(00069b55) SHA1(378ca25dc3173252548bc27e80909e1b2b4d58db) )
1121
7721122   /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */
7731123   ROM_REGION( 0x8000, "proms", 0 )
7741124   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(3510d705) SHA1(2190c8199d29bf89e3007eb771cc6b0e2b58f6cd) )
r22813r22814
7831133   ROM_LOAD( "2.u15", 0x8000, 0x8000, CRC(a5091583) SHA1(c0775d9b77cb634d3702b6c08cdf73c867b6169a) )
7841134
7851135   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
786   ROM_LOAD( "1.u28", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
1136   ROM_LOAD( "1.u28", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
7871137
1138   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
1139   ROM_LOAD( "ten_balls_nvram.bin", 0x0000, 0x0800, CRC(42a5803f) SHA1(2c8c9ec0f26a947cf9cfa2e91e9127725becdef5) )
1140
7881141   ROM_REGION( 0x0200, "proms", 0 )
7891142   ROM_LOAD( "82s147.u17", 0x0000, 0x0200, CRC(20234dcc) SHA1(197937bbec0201888467e250bdba49e39aa4204a) )
7901143ROM_END
7911144
7921145ROM_START( crystalc )
7931146   ROM_REGION( 0x10000, "maincpu", 0 )
794   ROM_LOAD( "crystals-colours1.u2", 0x8000, 0x8000, CRC(ee7a6f62) SHA1(bb3f438ca563eeb4b365d344066b10b9aedb77bb) )
1147   ROM_LOAD( "crystals_colours_1.u2", 0x8000, 0x8000, CRC(ee7a6f62) SHA1(bb3f438ca563eeb4b365d344066b10b9aedb77bb) )
7951148
7961149   ROM_REGION( 0x10000, "gfx1", 0 )
797   ROM_LOAD( "crystals-colours2.u16", 0x0000, 0x8000, CRC(527c07f6) SHA1(53ceb1d0267e1d76fa1a9325c9a1d2e8e034958d) )
798   ROM_LOAD( "crystals-colours3.u15", 0x8000, 0x8000, CRC(e1003ab7) SHA1(a78bb2e1dc9d578d6a38072e2087f382cffa9f99) )
1150   ROM_LOAD( "crystals_colours_2.u16", 0x0000, 0x8000, CRC(527c07f6) SHA1(53ceb1d0267e1d76fa1a9325c9a1d2e8e034958d) )
1151   ROM_LOAD( "crystals_colours_3.u15", 0x8000, 0x8000, CRC(e1003ab7) SHA1(a78bb2e1dc9d578d6a38072e2087f382cffa9f99) )
7991152
8001153   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
801   ROM_LOAD( "crystals-colours4.u28", 0x00000, 0x40000 , CRC(ecc6b575) SHA1(f6032e89b30aebeab9ad721608277430084256bc) )
1154   ROM_LOAD( "crystals_colours_4.u28", 0x00000, 0x40000, CRC(ecc6b575) SHA1(f6032e89b30aebeab9ad721608277430084256bc) )
8021155
1156   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
1157   ROM_LOAD( "crystals_colours_nvram.bin", 0x0000, 0x0800, CRC(907d8828) SHA1(ffd302996bee81277c2280fc212d910e0801d81d) )
1158
8031159   ROM_REGION( 0x0200, "proms", 0 )
804   ROM_LOAD( "27s29.u17", 0x0000, 0x0200, CRC(1af53eab) SHA1(1cac837aed75a77a0b93a294b07f2a8de6fcffef) )
1160   ROM_LOAD( "am27s29pc.u17", 0x0000, 0x0200, CRC(1af53eab) SHA1(1cac837aed75a77a0b93a294b07f2a8de6fcffef) )
8051161ROM_END
8061162
8071163
r22813r22814
8091165*      Game Drivers      *
8101166*************************/
8111167
812/*     YEAR  NAME      PARENT    MACHINE   INPUT     STATE          INIT ROT    COMPANY      FULLNAME                     FLAGS     LAYOUT */
813GAMEL( 1998, snookr10, 0,        snookr10, snookr10, driver_device, 0,   ROT0, "Sandii'",   "Snooker 10 (Ver 1.11)",      0,        layout_snookr10 )
814GAMEL( 1998, apple10,  0,        apple10,  apple10,  driver_device, 0,   ROT0, "Sandii'",   "Apple 10 (Ver 1.21)",        0,        layout_snookr10 )
815GAMEL( 1997, tenballs, snookr10, tenballs, tenballs, driver_device, 0,   ROT0, "<unknown>", "Ten Balls (Ver 1.05)",       0,        layout_snookr10 )
816GAME(  199?, crystalc, 0,        snookr10, snookr10, driver_device, 0,   ROT0, "<unknown>", "Crystals Colors (Ver 1.01)", GAME_NOT_WORKING )
1168/*     YEAR  NAME      PARENT    MACHINE   INPUT     STATE          INIT ROT    COMPANY      FULLNAME                      FLAGS   LAYOUT */
1169GAMEL( 1998, snookr10, 0,        snookr10, snookr10, driver_device, 0,   ROT0, "Sandii'",   "Snooker 10 (Ver 1.11)",       0,      layout_snookr10 )
1170GAMEL( 1998, apple10,  0,        apple10,  apple10,  driver_device, 0,   ROT0, "Sandii'",   "Apple 10 (Ver 1.21)",         0,      layout_snookr10 )
1171GAMEL( 1997, tenballs, snookr10, tenballs, tenballs, driver_device, 0,   ROT0, "<unknown>", "Ten Balls (Ver 1.05)",        0,      layout_snookr10 )
1172GAMEL( 1998, crystalc, 0,        crystalc, crystalc, driver_device, 0,   ROT0, "JCD srl",   "Crystals Colours (Ver 1.01)", 0,      layout_snookr10 )
trunk/src/mame/video/snookr10.c
r22813r22814
11/**********************************************************************************
22
3
43    SNOOKER 10 / SANDII'
54
6    Driver by Roberto Fresca.
5    Video Hardware.
6    Written by Roberto Fresca.
77
88
9    Games running on this hardware:
10
11    * Snooker 10 (Ver 1.11), Sandii', 1998.
12    * Apple 10 (Ver 1.21),   Sandii', 1998.
13    * Ten Balls (Ver 1.05),  unknown, 1997.
14
15
169***********************************************************************************
1710
18
1911    Resistor Network for all PCBs:
2012
21
2213     74LS373
23    +-------+
14    .-------.
2415    |     02|--> 1  KOhms resistor --> \
2516    |     05|--> 470 Ohms resistor -->  > 100 Ohms pull-down resistor --> RED
2617    |     06|--> 220 Ohms resistor --> /
r22813r22814
3122    |       |
3223    |     16|--> 470 Ohms resistor --> \  100 Ohms pull-down resistor --> GREEN
3324    |     19|--> 220 Ohms resistor --> /
34    +-------+
25    '-------'
3526
36
3727**********************************************************************************/
3828
39
4029#include "emu.h"
4130#include "video/resnet.h"
4231#include "includes/snookr10.h"
r22813r22814
8069      bit1 = (color_prom[i] >> 1) & 0x01;
8170      bit2 = (color_prom[i] >> 2) & 0x01;
8271      r = combine_3_weights(weights_r, bit0, bit1, bit2);
72
8373      /* blue component */
8474      bit0 = (color_prom[i] >> 3) & 0x01;
8575      bit1 = (color_prom[i] >> 4) & 0x01;
8676      bit2 = (color_prom[i] >> 5) & 0x01;
8777      b = combine_3_weights(weights_b, bit0, bit1, bit2);
78
8879      /* green component */
8980      bit0 = (color_prom[i] >> 6) & 0x01;
9081      bit1 = (color_prom[i] >> 7) & 0x01;
r22813r22814
111102
112103
113104/**********************************************************
114* Apple10 colors and tile matrix are encrypted/scrambled. *
115*     For more information, see the driver notes.         *
105
106  Apple 10 palette and tile matrix / video RAM
107  are encrypted/scrambled.
108
109  For more information, see the driver notes.
110
116111**********************************************************/
117112
118PALETTE_INIT_MEMBER(snookr10_state,apple10)
113PALETTE_INIT_MEMBER(snookr10_state, apple10)
119114{
120115   const UINT8 *color_prom = memregion("proms")->base();
121116   /* GGBBBRRR */
r22813r22814
140135      bit1 = (color_prom[i] >> 1) & 0x01;
141136      bit2 = (color_prom[i] >> 2) & 0x01;
142137      r = combine_3_weights(weights_r, bit0, bit1, bit2);
138
143139      /* blue component */
144140      bit0 = (color_prom[i] >> 3) & 0x01;
145141      bit1 = (color_prom[i] >> 4) & 0x01;
146142      bit2 = (color_prom[i] >> 5) & 0x01;
147143      b = combine_3_weights(weights_b, bit0, bit1, bit2);
144
148145      /* green component */
149146      bit0 = (color_prom[i] >> 6) & 0x01;
150147      bit1 = (color_prom[i] >> 7) & 0x01;
r22813r22814
173170}
174171
175172
173/**********************************************************
174
175  Crystals Colours palette and tile matrix / video RAM
176  are encrypted/scrambled.
177
178  For more information, see the driver notes.
179
180**********************************************************/
181
182PALETTE_INIT_MEMBER(snookr10_state, crystalc)
183{
184   const UINT8 *color_prom = memregion("proms")->base();
185   /* GGBBBRRR */
186
187   int i, cn;
188   static const int resistances_rb[3] = { 1000, 470, 220 };
189   static const int resistances_g [2] = { 470, 220 };
190   double weights_r[3], weights_b[3], weights_g[2];
191
192   compute_resistor_weights(0, 255,    -1.0,
193         3,  resistances_rb, weights_r,  100,    0,
194         3,  resistances_rb, weights_b,  100,    0,
195         2,  resistances_g,  weights_g,  100,    0);
196
197
198   for (i = 0; i < machine().total_colors(); i++)
199   {
200      int bit0, bit1, bit2, r, g, b;
201
202      /* red component */
203      bit0 = (color_prom[i] >> 0) & 0x01;
204      bit1 = (color_prom[i] >> 1) & 0x01;
205      bit2 = (color_prom[i] >> 2) & 0x01;
206      r = combine_3_weights(weights_r, bit0, bit1, bit2);
207
208      /* blue component */
209      bit0 = (color_prom[i] >> 3) & 0x01;
210      bit1 = (color_prom[i] >> 4) & 0x01;
211      bit2 = (color_prom[i] >> 5) & 0x01;
212      b = combine_3_weights(weights_b, bit0, bit1, bit2);
213
214      /* green component */
215      bit0 = (color_prom[i] >> 6) & 0x01;
216      bit1 = (color_prom[i] >> 7) & 0x01;
217      g = combine_2_weights(weights_g, bit0, bit1);
218
219      /* encrypted color matrix */
220      cn = BITSWAP8(i,7,5,6,4,3,2,1,0);
221
222      palette_set_color(machine(), cn, MAKE_RGB(r,g,b));
223   }
224}
225
226TILE_GET_INFO_MEMBER(snookr10_state::crystalc_get_bg_tile_info)
227{
228/*  - bits -
229    7654 3210
230    xxxx ----   tiles color.
231    ---- xxxx   seems unused.
232*/
233   int offs = tile_index;
234   int attr = m_videoram[offs] + (m_colorram[offs] << 8);
235   int code = BITSWAP16((attr & 0xfff),15,14,13,12,0,10,5,1,7,6,9,4,3,2,8,11); /* encrypted tile matrix */
236   int color = m_colorram[offs] >> 4;
237
238   SET_TILE_INFO_MEMBER(0, code, color, 0);
239}
240
241
176242void snookr10_state::video_start()
177243{
178244   m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
179245}
180246
181VIDEO_START_MEMBER(snookr10_state,apple10)
247VIDEO_START_MEMBER(snookr10_state, apple10)
182248{
183249   m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::apple10_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
184250}
185251
252VIDEO_START_MEMBER(snookr10_state, crystalc)
253{
254   m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::crystalc_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
255}
256
186257UINT32 snookr10_state::screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
187258{
188259   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
trunk/src/mame/includes/snookr10.h
r22813r22814
1919   required_shared_ptr<UINT8> m_colorram;
2020   tilemap_t *m_bg_tilemap;
2121   DECLARE_READ8_MEMBER(dsw_port_1_r);
22   DECLARE_READ8_MEMBER(port2000_8_r);
2223   DECLARE_WRITE8_MEMBER(output_port_0_w);
2324   DECLARE_WRITE8_MEMBER(output_port_1_w);
2425   DECLARE_WRITE8_MEMBER(snookr10_videoram_w);
2526   DECLARE_WRITE8_MEMBER(snookr10_colorram_w);
2627   TILE_GET_INFO_MEMBER(get_bg_tile_info);
2728   TILE_GET_INFO_MEMBER(apple10_get_bg_tile_info);
29   TILE_GET_INFO_MEMBER(crystalc_get_bg_tile_info);
2830   virtual void video_start();
2931   virtual void palette_init();
3032   DECLARE_VIDEO_START(apple10);
33   DECLARE_VIDEO_START(crystalc);
3134   DECLARE_PALETTE_INIT(apple10);
35   DECLARE_PALETTE_INIT(crystalc);
3236   UINT32 screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3337   required_device<cpu_device> m_maincpu;
3438};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team