trunk/src/mame/drivers/gts3.c
r32821 | r32822 | |
3 | 3 | PINBALL |
4 | 4 | Gottlieb System 3 |
5 | 5 | |
| 6 | Status: |
| 7 | - Display works |
| 8 | - Attract mode works |
| 9 | |
6 | 10 | *****************************************************************************************************/ |
7 | 11 | |
8 | 12 | #include "machine/genpin.h" |
r32821 | r32822 | |
21 | 25 | { } |
22 | 26 | |
23 | 27 | DECLARE_DRIVER_INIT(gts3); |
| 28 | DECLARE_WRITE8_MEMBER(segbank_w); |
| 29 | DECLARE_WRITE8_MEMBER(u4b_w); |
| 30 | DECLARE_WRITE_LINE_MEMBER(nmi_w); |
24 | 31 | private: |
| 32 | bool m_dispclk; |
| 33 | UINT32 m_digit; |
| 34 | UINT8 m_segment[4]; |
25 | 35 | virtual void machine_reset(); |
26 | 36 | required_device<m65c02_device> m_maincpu; |
27 | 37 | required_device<via6522_device> m_u4; |
r32821 | r32822 | |
33 | 43 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram") |
34 | 44 | AM_RANGE(0x2000, 0x200f) AM_DEVREADWRITE("u4", via6522_device, read, write) |
35 | 45 | AM_RANGE(0x2010, 0x201f) AM_DEVREADWRITE("u5", via6522_device, read, write) |
| 46 | AM_RANGE(0x2020, 0x2023) AM_MIRROR(0x0c) AM_WRITE(segbank_w) |
36 | 47 | AM_RANGE(0x4000, 0xffff) AM_ROM |
37 | 48 | ADDRESS_MAP_END |
38 | 49 | |
39 | 50 | static INPUT_PORTS_START( gts3 ) |
40 | 51 | INPUT_PORTS_END |
41 | 52 | |
| 53 | // This trampoline needed - DEVWRITELINE("maincpu", m65c02_device, nmi_line) does not work |
| 54 | WRITE_LINE_MEMBER( gts3_state::nmi_w ) |
| 55 | { |
| 56 | m_maincpu->set_input_line(INPUT_LINE_NMI, (state) ? CLEAR_LINE : HOLD_LINE); |
| 57 | } |
| 58 | |
| 59 | WRITE8_MEMBER( gts3_state::segbank_w ) |
| 60 | { |
| 61 | m_segment[offset] = data; |
| 62 | UINT8 i; |
| 63 | UINT32 seg1,seg2; |
| 64 | offset &= 2; |
| 65 | for (i = 0;i < 20; i++) |
| 66 | { |
| 67 | if BIT(m_digit, i) |
| 68 | { |
| 69 | seg1 = m_segment[offset] | (m_segment[offset+1] << 8); |
| 70 | seg2 = BITSWAP32(seg1, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,14,9,7,13,11,10,6,8,12,5,4,3,3,2,1,0,0); |
| 71 | output_set_digit_value(i+(offset ? 0 : 20), seg2); |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | WRITE8_MEMBER( gts3_state::u4b_w ) |
| 77 | { |
| 78 | bool dispclk = BIT(data, 6); |
| 79 | if ((!m_dispclk) && dispclk) // 0->1 is valid |
| 80 | { |
| 81 | m_digit = (m_digit << 1) | BIT(data, 5); |
| 82 | } |
| 83 | m_dispclk = dispclk; |
| 84 | |
| 85 | |
| 86 | // printf("B=%s=%X ",machine().describe_context(),data&0xe0); |
| 87 | } |
| 88 | |
42 | 89 | void gts3_state::machine_reset() |
43 | 90 | { |
| 91 | m_digit = 0; |
| 92 | m_dispclk = 0; |
44 | 93 | } |
45 | 94 | |
46 | 95 | DRIVER_INIT_MEMBER( gts3_state, gts3 ) |
r32821 | r32822 | |
62 | 111 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m65c02_device, irq_line)) |
63 | 112 | //MCFG_VIA6522_READPA_HANDLER(WRITE8(gts3_state, u4a_r)) |
64 | 113 | //MCFG_VIA6522_READPB_HANDLER(WRITE8(gts3_state, u4b_r)) |
65 | | //MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(gts3_state, u4b_w)) |
| 114 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(gts3_state, u4b_w)) |
66 | 115 | //MCFG_VIA6522_CA2_HANDLER(WRITELINE(gts3_state, u4ca2_w)) |
67 | | MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE("maincpu", m65c02_device, nmi_line)) |
| 116 | MCFG_VIA6522_CB2_HANDLER(WRITELINE(gts3_state, nmi_w)) |
68 | 117 | |
69 | 118 | MCFG_DEVICE_ADD("u5", VIA6522, 0) |
70 | 119 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m65c02_device, irq_line)) |
r32821 | r32822 | |
330 | 379 | |
331 | 380 | /*------------------------------------------------------------------- |
332 | 381 | / Unnamed game? by Toptronic HGmbH, Germany |
| 382 | / Shows as "GAME NAME" in display, (#7**) |
333 | 383 | /-------------------------------------------------------------------*/ |
334 | 384 | ROM_START(tt_game) |
335 | 385 | ROM_REGION(0x10000, "maincpu", 0) |
r32821 | r32822 | |
352 | 402 | ROM_LOAD("yrom1.bin", 0x8000, 0x8000, NO_DUMP) |
353 | 403 | ROM_END |
354 | 404 | |
355 | | GAME(1989, lca, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Lights...Camera...Action!", GAME_IS_SKELETON_MECHANICAL) |
356 | | GAME(1989, lca2, lca, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Lights...Camera...Action! (rev.2)", GAME_IS_SKELETON_MECHANICAL) |
357 | | GAME(1990, silvslug, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Silver Slugger", GAME_IS_SKELETON_MECHANICAL) |
358 | | GAME(1990, vegas, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Vegas", GAME_IS_SKELETON_MECHANICAL) |
359 | | GAME(1990, deadweap, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Deadly Weapon", GAME_IS_SKELETON_MECHANICAL) |
360 | | GAME(1990, tfight, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Title Fight", GAME_IS_SKELETON_MECHANICAL) |
361 | | GAME(1990, nudgeit, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Nudge-It", GAME_IS_SKELETON_MECHANICAL) |
362 | | GAME(1990, bellring, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Bell Ringer", GAME_IS_SKELETON_MECHANICAL) |
363 | | GAME(1991, carhop, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Car Hop", GAME_IS_SKELETON_MECHANICAL) |
364 | | GAME(1991, hoops, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Hoops", GAME_IS_SKELETON_MECHANICAL) |
365 | | GAME(1991, cactjack, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Cactus Jack's", GAME_IS_SKELETON_MECHANICAL) |
366 | | GAME(1991, clas1812, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Class of 1812", GAME_IS_SKELETON_MECHANICAL) |
367 | | GAME(1991, surfnsaf, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Surf'n Safari", GAME_IS_SKELETON_MECHANICAL) |
368 | | GAME(1992, opthund, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Operation: Thunder", GAME_IS_SKELETON_MECHANICAL) |
369 | | GAME(19??, tt_game, 0, gts3, gts3, gts3_state, gts3, ROT0, "Toptronic", "unknown Toptronic pinball game", GAME_IS_SKELETON_MECHANICAL) |
370 | | GAME(1989, ccruise, 0, gts3, gts3, gts3_state, gts3, ROT0, "International Concepts","Caribbean Cruise", GAME_IS_SKELETON_MECHANICAL) |
| 405 | GAME(1989, lca, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Lights...Camera...Action!", GAME_IS_SKELETON_MECHANICAL) |
| 406 | GAME(1989, lca2, lca, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Lights...Camera...Action! (rev.2)", GAME_IS_SKELETON_MECHANICAL) |
| 407 | GAME(1990, silvslug, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Silver Slugger", GAME_IS_SKELETON_MECHANICAL) |
| 408 | GAME(1990, vegas, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Vegas", GAME_IS_SKELETON_MECHANICAL) |
| 409 | GAME(1990, deadweap, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Deadly Weapon", GAME_IS_SKELETON_MECHANICAL) |
| 410 | GAME(1990, tfight, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Title Fight", GAME_IS_SKELETON_MECHANICAL) |
| 411 | GAME(1990, nudgeit, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Nudge-It", GAME_IS_SKELETON_MECHANICAL) |
| 412 | GAME(1990, bellring, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Bell Ringer", GAME_IS_SKELETON_MECHANICAL) |
| 413 | GAME(1991, carhop, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Car Hop", GAME_IS_SKELETON_MECHANICAL) |
| 414 | GAME(1991, hoops, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Hoops", GAME_IS_SKELETON_MECHANICAL) |
| 415 | GAME(1991, cactjack, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Cactus Jack's", GAME_IS_SKELETON_MECHANICAL) |
| 416 | GAME(1991, clas1812, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Class of 1812", GAME_IS_SKELETON_MECHANICAL) |
| 417 | GAME(1991, surfnsaf, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Surf'n Safari", GAME_IS_SKELETON_MECHANICAL) |
| 418 | GAME(1992, opthund, 0, gts3, gts3, gts3_state, gts3, ROT0, "Gottlieb", "Operation: Thunder", GAME_IS_SKELETON_MECHANICAL) |
| 419 | GAME(19??, tt_game, 0, gts3, gts3, gts3_state, gts3, ROT0, "Toptronic", "unknown Toptronic pinball game", GAME_IS_SKELETON_MECHANICAL) |
| 420 | GAME(1989, ccruise, 0, gts3, gts3, gts3_state, gts3, ROT0, "International Concepts","Caribbean Cruise", GAME_IS_SKELETON_MECHANICAL) |