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 |
r22813 | r22814 | |
---|---|---|
8 | 8 | |
9 | 9 | Games running on this hardware: |
10 | 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 | * 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. | |
15 | 15 | |
16 | 16 | |
17 | 17 | *********************************************************************************** |
r22813 | r22814 | |
26 | 26 | 1x LM358N |
27 | 27 | 1x TDA2003 |
28 | 28 | |
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 | |
31 | 32 | |
32 | 33 | RAM: 1x 76C88AL-15, SRAM 8Kx8 |
33 | 34 | NVRAM: 1x 76C88AL-15, SRAM 8Kx8 (battery backed) |
r22813 | r22814 | |
40 | 41 | Clock: 1x Crystal: 16MHz. |
41 | 42 | |
42 | 43 | Other: 1x 28x2 edge connector. |
43 | 1x 15 | |
44 | 1x 15-pins connector. | |
44 | 45 | 1x trimmer (volume). |
45 | 46 | 1x 8 DIP switches. |
46 | 47 | 1x 3.5 Volt, 55-80 mAh battery. |
r22813 | r22814 | |
116 | 117 | *************************************************************************************** |
117 | 118 | |
118 | 119 | |
119 | Issues / Protection | |
120 | ------------------- | |
120 | Encryption schemes... | |
121 | --------------------- | |
121 | 122 | |
122 | 123 | * Apple 10 |
123 | 124 | |
124 | - Tile matrix and color | |
125 | - Tile matrix and color data (video & color RAM) are totally encrypted/scrambled. | |
125 | 126 | |
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: | |
128 | 129 | |
129 | 130 | Normal | Scrambled |
130 | 131 | tile # | tile # |
r22813 | r22814 | |
207 | 208 | To properly decrypt the thing 'on the fly' as the hardware does, I applied a bitswap into TILE_GET_INFO. |
208 | 209 | This method rearrange the tile number for each tile called to be drawn. |
209 | 210 | |
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 | |
218 | 219 | |
219 | 220 | Colors are scrambled in the following way: |
220 | 221 | |
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 | |
241 | 242 | |
242 | 243 | And each one of these segments are internally scrambled too. |
243 | 244 | |
244 | 245 | So, the algorithm to properly decrypt the color codes is very different here: |
245 | 246 | |
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 | |
253 | 254 | |
254 | Scary, huh?... ;) | |
255 | Scary, huh?... ;-) | |
255 | 256 | |
256 | 257 | |
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 | ||
257 | 453 | *********************************************************************************** |
258 | 454 | |
259 | 455 | |
r22813 | r22814 | |
262 | 458 | |
263 | 459 | (Old hardware) |
264 | 460 | |
265 | $0000 - $0FF | |
461 | $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. | |
266 | 462 | $1000 - $1000 OKI6295 ;R/W, sound. |
267 | 463 | $4000 - $4000 Input Port 0 ;R |
268 | 464 | $4001 - $4001 Input Port 1 ;R |
269 | 465 | $4002 - $4002 Input Port 2 ;R |
270 | 466 | $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. | |
273 | 469 | $6000 - $6FFF Video RAM |
274 | 470 | $7000 - $7FFF Color RAM |
275 | 471 | $8000 - $FFFF ROM Space |
r22813 | r22814 | |
277 | 473 | |
278 | 474 | (New hardware) |
279 | 475 | |
280 | $0000 - $0FF | |
476 | $0000 - $07FF NVRAM (battery backed 6116) ;R/W, all registers and settings. | |
281 | 477 | $1000 - $1000 OKI6295 ;R/W, sound. |
282 | 478 | $3000 - $3000 Input Port 0 ;R |
283 | 479 | $3001 - $3001 Input Port 1 ;R |
284 | 480 | $3002 - $3002 Input Port 2 ;R |
285 | 481 | $3003 - $3003 Input Port 3 ;R , DIP switches. |
286 | 482 | $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. | |
289 | 485 | $6000 - $6FFF Video RAM |
290 | 486 | $7000 - $7FFF Color RAM |
291 | 487 | $8000 - $FFFF ROM Space |
292 | 488 | |
293 | 489 | |
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 | ||
294 | 506 | *********************************************************************************** |
295 | 507 | |
296 | 508 | |
297 | 509 | *** Driver Updates *** |
298 | 510 | |
299 | 511 | |
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 | ||
300 | 542 | [2008/10/09] |
543 | ||
301 | 544 | - Reworked the button-lamps matrix system. |
302 | 545 | - Documented both output ports. |
303 | 546 | - Connected coin in, key in and payout counters. |
304 | 547 | - Improved the lamps layout to be more realistic. |
305 | 548 | - Updated technical notes. |
306 | 549 | |
550 | ||
307 | 551 | [2008/06/09] |
552 | ||
308 | 553 | - Fixed the tilemap size. |
309 | 554 | - Fixed the screen size. |
310 | 555 | - Updated technical notes. |
311 | 556 | |
557 | ||
312 | 558 | [2008/05/29] |
559 | ||
313 | 560 | - Switched the color system to RESNET calculations. |
314 | 561 | - Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1. |
315 | 562 | This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5. |
r22813 | r22814 | |
317 | 564 | - Added lamps support, but is still imperfect. |
318 | 565 | - Updated technical notes. |
319 | 566 | |
567 | ||
320 | 568 | [2008/05/22] |
569 | ||
321 | 570 | - Confirmed the CPU clock after some PCB measurements. |
322 | 571 | - Changed the SND clock to 1MHz to match the PCB measurement. |
323 | 572 | - Corrected the internal OKI6295 frequency turning the pin 7 state to HIGH. |
r22813 | r22814 | |
325 | 574 | Affected buttons have a rattled sound in the real thing too. |
326 | 575 | - Updated technical notes. |
327 | 576 | |
577 | ||
328 | 578 | [2008/04/28] |
579 | ||
329 | 580 | - Created a new machine driver for tenballs due to different memory map. |
330 | 581 | - Worked all the input ports from the scratch. |
331 | 582 | - Fixed the sound ROM_REGION. |
r22813 | r22814 | |
341 | 592 | - Added game instructions & notes. |
342 | 593 | - Updated encryption & technical notes. |
343 | 594 | |
595 | ||
344 | 596 | [2008/04/24] |
597 | ||
345 | 598 | - Decrypted the apple10 tile matrix. |
346 | 599 | - Partially decrypted the apple10 color codes. |
347 | 600 | - Added encryption notes. |
348 | 601 | - Updated technical notes. |
349 | 602 | |
603 | ||
350 | 604 | [2008/04/18] |
605 | ||
351 | 606 | - Initial release. Support for snookr10, apple10 and tenballs. |
352 | 607 | - Added technical/general notes. |
353 | 608 | |
354 | [2013/05/04] | |
355 | - Added Crystals Colors (Ver 1.01). | |
356 | 609 | |
357 | ||
358 | 610 | *** TO DO *** |
359 | 611 | |
360 | - | |
612 | - Nothing... :) | |
361 | 613 | |
362 | 614 | |
363 | 615 | ***********************************************************************************/ |
r22813 | r22814 | |
494 | 746 | } |
495 | 747 | |
496 | 748 | |
749 | READ8_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 | ||
497 | 760 | /************************* |
498 | 761 | * Memory map information * |
499 | 762 | *************************/ |
500 | 763 | |
501 | 764 | static ADDRESS_MAP_START( snookr10_map, AS_PROGRAM, 8, snookr10_state ) |
502 | AM_RANGE(0x0000, 0x0ff | |
765 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* battery backed 6116 */ | |
503 | 766 | AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
504 | 767 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") /* IN0 */ |
505 | 768 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("IN1") /* IN1 */ |
r22813 | r22814 | |
514 | 777 | ADDRESS_MAP_END |
515 | 778 | |
516 | 779 | static ADDRESS_MAP_START( tenballs_map, AS_PROGRAM, 8, snookr10_state ) |
517 | AM_RANGE(0x0000, 0x0ff | |
780 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* battery backed 6116 */ | |
518 | 781 | AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
519 | 782 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("IN0") /* IN0 */ |
520 | 783 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("IN1") /* IN1 */ |
r22813 | r22814 | |
527 | 790 | AM_RANGE(0x8000, 0xffff) AM_ROM |
528 | 791 | ADDRESS_MAP_END |
529 | 792 | |
793 | static 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 | |
806 | ADDRESS_MAP_END | |
530 | 807 | |
808 | ||
531 | 809 | /************************* |
532 | 810 | * Input ports * |
533 | 811 | *************************/ |
r22813 | r22814 | |
659 | 937 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
660 | 938 | INPUT_PORTS_END |
661 | 939 | |
940 | static 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)") | |
662 | 950 | |
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 ) ) | |
994 | INPUT_PORTS_END | |
995 | ||
996 | ||
663 | 997 | /************************* |
664 | 998 | * Graphics Layouts * |
665 | 999 | *************************/ |
r22813 | r22814 | |
708 | 1042 | MCFG_SCREEN_UPDATE_DRIVER(snookr10_state, screen_update_snookr10) |
709 | 1043 | |
710 | 1044 | MCFG_GFXDECODE(snookr10) |
711 | ||
712 | 1045 | MCFG_PALETTE_LENGTH(256) |
713 | 1046 | |
714 | 1047 | /* sound hardware */ |
r22813 | r22814 | |
724 | 1057 | MCFG_CPU_MODIFY("maincpu") |
725 | 1058 | |
726 | 1059 | /* 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) | |
729 | 1062 | |
730 | 1063 | MACHINE_CONFIG_END |
731 | 1064 | |
r22813 | r22814 | |
737 | 1070 | |
738 | 1071 | MACHINE_CONFIG_END |
739 | 1072 | |
1073 | static MACHINE_CONFIG_DERIVED( crystalc, snookr10 ) | |
740 | 1074 | |
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 | ||
1082 | MACHINE_CONFIG_END | |
1083 | ||
1084 | ||
741 | 1085 | /************************* |
742 | 1086 | * Rom Load * |
743 | 1087 | *************************/ |
r22813 | r22814 | |
751 | 1095 | ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(3009faaa) SHA1(d1cda455b270cb9afa65b9701735a3a1f2a48df2) ) |
752 | 1096 | |
753 | 1097 | ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ |
754 | ROM_LOAD( "4.u18", 0x00000, 0x40000 | |
1098 | ROM_LOAD( "4.u18", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) ) | |
755 | 1099 | |
1100 | ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */ | |
1101 | ROM_LOAD( "snooker_10_nvram.bin", 0x0000, 0x0800, CRC(d383363b) SHA1(88f0d9e53b0bd276d01cefd817f0edcd753322dc) ) | |
1102 | ||
756 | 1103 | /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */ |
757 | 1104 | ROM_REGION( 0x8000, "proms", 0 ) |
758 | 1105 | ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(f3d7d640) SHA1(f78060f4603e316fa3c2ec4ba6d7edf261cf6d8a) ) |
r22813 | r22814 | |
767 | 1114 | ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(afc535dc) SHA1(ed2d65f3154c6d80b7b22bfef1f30232e4496128) ) |
768 | 1115 | |
769 | 1116 | ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ |
770 | ROM_LOAD( "4.u18", 0x00000, 0x40000 | |
1117 | ROM_LOAD( "4.u18", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) ) | |
771 | 1118 | |
1119 | ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */ | |
1120 | ROM_LOAD( "apple_10_nvram.bin", 0x0000, 0x0800, CRC(00069b55) SHA1(378ca25dc3173252548bc27e80909e1b2b4d58db) ) | |
1121 | ||
772 | 1122 | /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */ |
773 | 1123 | ROM_REGION( 0x8000, "proms", 0 ) |
774 | 1124 | ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(3510d705) SHA1(2190c8199d29bf89e3007eb771cc6b0e2b58f6cd) ) |
r22813 | r22814 | |
783 | 1133 | ROM_LOAD( "2.u15", 0x8000, 0x8000, CRC(a5091583) SHA1(c0775d9b77cb634d3702b6c08cdf73c867b6169a) ) |
784 | 1134 | |
785 | 1135 | ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ |
786 | ROM_LOAD( "1.u28", 0x00000, 0x40000 | |
1136 | ROM_LOAD( "1.u28", 0x00000, 0x40000, CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) ) | |
787 | 1137 | |
1138 | ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */ | |
1139 | ROM_LOAD( "ten_balls_nvram.bin", 0x0000, 0x0800, CRC(42a5803f) SHA1(2c8c9ec0f26a947cf9cfa2e91e9127725becdef5) ) | |
1140 | ||
788 | 1141 | ROM_REGION( 0x0200, "proms", 0 ) |
789 | 1142 | ROM_LOAD( "82s147.u17", 0x0000, 0x0200, CRC(20234dcc) SHA1(197937bbec0201888467e250bdba49e39aa4204a) ) |
790 | 1143 | ROM_END |
791 | 1144 | |
792 | 1145 | ROM_START( crystalc ) |
793 | 1146 | ROM_REGION( 0x10000, "maincpu", 0 ) |
794 | ROM_LOAD( "crystals | |
1147 | ROM_LOAD( "crystals_colours_1.u2", 0x8000, 0x8000, CRC(ee7a6f62) SHA1(bb3f438ca563eeb4b365d344066b10b9aedb77bb) ) | |
795 | 1148 | |
796 | 1149 | 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) ) | |
799 | 1152 | |
800 | 1153 | ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ |
801 | ROM_LOAD( "crystals | |
1154 | ROM_LOAD( "crystals_colours_4.u28", 0x00000, 0x40000, CRC(ecc6b575) SHA1(f6032e89b30aebeab9ad721608277430084256bc) ) | |
802 | 1155 | |
1156 | ROM_REGION( 0x0800, "nvram", 0 ) /* default NVRAM */ | |
1157 | ROM_LOAD( "crystals_colours_nvram.bin", 0x0000, 0x0800, CRC(907d8828) SHA1(ffd302996bee81277c2280fc212d910e0801d81d) ) | |
1158 | ||
803 | 1159 | 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) ) | |
805 | 1161 | ROM_END |
806 | 1162 | |
807 | 1163 | |
r22813 | r22814 | |
809 | 1165 | * Game Drivers * |
810 | 1166 | *************************/ |
811 | 1167 | |
812 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ | |
813 | GAMEL( 1998, snookr10, 0, snookr10, snookr10, driver_device, 0, ROT0, "Sandii'", "Snooker 10 (Ver 1.11)", 0, layout_snookr10 ) | |
814 | GAMEL( 1998, apple10, 0, apple10, apple10, driver_device, 0, ROT0, "Sandii'", "Apple 10 (Ver 1.21)", 0, layout_snookr10 ) | |
815 | GAMEL( 1997, tenballs, snookr10, tenballs, tenballs, driver_device, 0, ROT0, "<unknown>", "Ten Balls (Ver 1.05)", 0, layout_snookr10 ) | |
816 | GAME( 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 */ | |
1169 | GAMEL( 1998, snookr10, 0, snookr10, snookr10, driver_device, 0, ROT0, "Sandii'", "Snooker 10 (Ver 1.11)", 0, layout_snookr10 ) | |
1170 | GAMEL( 1998, apple10, 0, apple10, apple10, driver_device, 0, ROT0, "Sandii'", "Apple 10 (Ver 1.21)", 0, layout_snookr10 ) | |
1171 | GAMEL( 1997, tenballs, snookr10, tenballs, tenballs, driver_device, 0, ROT0, "<unknown>", "Ten Balls (Ver 1.05)", 0, layout_snookr10 ) | |
1172 | GAMEL( 1998, crystalc, 0, crystalc, crystalc, driver_device, 0, ROT0, "JCD srl", "Crystals Colours (Ver 1.01)", 0, layout_snookr10 ) |
r22813 | r22814 | |
---|---|---|
1 | 1 | /********************************************************************************** |
2 | 2 | |
3 | ||
4 | 3 | SNOOKER 10 / SANDII' |
5 | 4 | |
6 | Driver by Roberto Fresca. | |
5 | Video Hardware. | |
6 | Written by Roberto Fresca. | |
7 | 7 | |
8 | 8 | |
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 | ||
16 | 9 | *********************************************************************************** |
17 | 10 | |
18 | ||
19 | 11 | Resistor Network for all PCBs: |
20 | 12 | |
21 | ||
22 | 13 | 74LS373 |
23 | | |
14 | .-------. | |
24 | 15 | | 02|--> 1 KOhms resistor --> \ |
25 | 16 | | 05|--> 470 Ohms resistor --> > 100 Ohms pull-down resistor --> RED |
26 | 17 | | 06|--> 220 Ohms resistor --> / |
r22813 | r22814 | |
31 | 22 | | | |
32 | 23 | | 16|--> 470 Ohms resistor --> \ 100 Ohms pull-down resistor --> GREEN |
33 | 24 | | 19|--> 220 Ohms resistor --> / |
34 | | |
25 | '-------' | |
35 | 26 | |
36 | ||
37 | 27 | **********************************************************************************/ |
38 | 28 | |
39 | ||
40 | 29 | #include "emu.h" |
41 | 30 | #include "video/resnet.h" |
42 | 31 | #include "includes/snookr10.h" |
r22813 | r22814 | |
80 | 69 | bit1 = (color_prom[i] >> 1) & 0x01; |
81 | 70 | bit2 = (color_prom[i] >> 2) & 0x01; |
82 | 71 | r = combine_3_weights(weights_r, bit0, bit1, bit2); |
72 | ||
83 | 73 | /* blue component */ |
84 | 74 | bit0 = (color_prom[i] >> 3) & 0x01; |
85 | 75 | bit1 = (color_prom[i] >> 4) & 0x01; |
86 | 76 | bit2 = (color_prom[i] >> 5) & 0x01; |
87 | 77 | b = combine_3_weights(weights_b, bit0, bit1, bit2); |
78 | ||
88 | 79 | /* green component */ |
89 | 80 | bit0 = (color_prom[i] >> 6) & 0x01; |
90 | 81 | bit1 = (color_prom[i] >> 7) & 0x01; |
r22813 | r22814 | |
111 | 102 | |
112 | 103 | |
113 | 104 | /********************************************************** |
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 | ||
116 | 111 | **********************************************************/ |
117 | 112 | |
118 | PALETTE_INIT_MEMBER(snookr10_state,apple10) | |
113 | PALETTE_INIT_MEMBER(snookr10_state, apple10) | |
119 | 114 | { |
120 | 115 | const UINT8 *color_prom = memregion("proms")->base(); |
121 | 116 | /* GGBBBRRR */ |
r22813 | r22814 | |
140 | 135 | bit1 = (color_prom[i] >> 1) & 0x01; |
141 | 136 | bit2 = (color_prom[i] >> 2) & 0x01; |
142 | 137 | r = combine_3_weights(weights_r, bit0, bit1, bit2); |
138 | ||
143 | 139 | /* blue component */ |
144 | 140 | bit0 = (color_prom[i] >> 3) & 0x01; |
145 | 141 | bit1 = (color_prom[i] >> 4) & 0x01; |
146 | 142 | bit2 = (color_prom[i] >> 5) & 0x01; |
147 | 143 | b = combine_3_weights(weights_b, bit0, bit1, bit2); |
144 | ||
148 | 145 | /* green component */ |
149 | 146 | bit0 = (color_prom[i] >> 6) & 0x01; |
150 | 147 | bit1 = (color_prom[i] >> 7) & 0x01; |
r22813 | r22814 | |
173 | 170 | } |
174 | 171 | |
175 | 172 | |
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 | ||
182 | PALETTE_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 | ||
226 | TILE_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 | ||
176 | 242 | void snookr10_state::video_start() |
177 | 243 | { |
178 | 244 | 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); |
179 | 245 | } |
180 | 246 | |
181 | VIDEO_START_MEMBER(snookr10_state,apple10) | |
247 | VIDEO_START_MEMBER(snookr10_state, apple10) | |
182 | 248 | { |
183 | 249 | 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); |
184 | 250 | } |
185 | 251 | |
252 | VIDEO_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 | ||
186 | 257 | UINT32 snookr10_state::screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
187 | 258 | { |
188 | 259 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
r22813 | r22814 | |
---|---|---|
19 | 19 | required_shared_ptr<UINT8> m_colorram; |
20 | 20 | tilemap_t *m_bg_tilemap; |
21 | 21 | DECLARE_READ8_MEMBER(dsw_port_1_r); |
22 | DECLARE_READ8_MEMBER(port2000_8_r); | |
22 | 23 | DECLARE_WRITE8_MEMBER(output_port_0_w); |
23 | 24 | DECLARE_WRITE8_MEMBER(output_port_1_w); |
24 | 25 | DECLARE_WRITE8_MEMBER(snookr10_videoram_w); |
25 | 26 | DECLARE_WRITE8_MEMBER(snookr10_colorram_w); |
26 | 27 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
27 | 28 | TILE_GET_INFO_MEMBER(apple10_get_bg_tile_info); |
29 | TILE_GET_INFO_MEMBER(crystalc_get_bg_tile_info); | |
28 | 30 | virtual void video_start(); |
29 | 31 | virtual void palette_init(); |
30 | 32 | DECLARE_VIDEO_START(apple10); |
33 | DECLARE_VIDEO_START(crystalc); | |
31 | 34 | DECLARE_PALETTE_INIT(apple10); |
35 | DECLARE_PALETTE_INIT(crystalc); | |
32 | 36 | UINT32 screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
33 | 37 | required_device<cpu_device> m_maincpu; |
34 | 38 | }; |
Previous | 199869 Revisions | Next |