trunk/src/mame/drivers/g627.c
| r17777 | r17778 | |
| 7 | 7 | |
| 8 | 8 | Only one of its kind |
| 9 | 9 | |
| 10 | This is a cocktail pinball game, for up to 4 players. The board is round. |
| 11 | When it is another player's turn, the playboard will turn around to face |
| 12 | him. And so, the system has a motor and an infrared shaft-locating system. |
| 13 | If this system does not return the expected data, the machine will refuse |
| 14 | to start. |
| 15 | |
| 16 | Schematic and PinMAME used as references |
| 17 | |
| 18 | ToDo: |
| 19 | - Battery backup |
| 20 | - Inputs |
| 21 | - Outputs |
| 22 | - Displays / Layout |
| 23 | - Diagnostic keyboard |
| 24 | - Possibility of a rom missing (most likely it is optional) |
| 25 | |
| 10 | 26 | *******************************************************************************/ |
| 11 | 27 | |
| 12 | 28 | |
| 13 | 29 | #include "emu.h" |
| 14 | 30 | #include "cpu/z80/z80.h" |
| 31 | #include "machine/i8155.h" |
| 32 | #include "sound/astrocde.h" |
| 15 | 33 | |
| 34 | |
| 16 | 35 | class g627_state : public driver_device |
| 17 | 36 | { |
| 18 | 37 | public: |
| 19 | 38 | g627_state(const machine_config &mconfig, device_type type, const char *tag) |
| 20 | 39 | : driver_device(mconfig, type, tag), |
| 21 | | m_maincpu(*this, "maincpu") |
| 40 | m_maincpu(*this, "maincpu") |
| 22 | 41 | { } |
| 23 | 42 | |
| 43 | DECLARE_READ8_MEMBER(porta_r); |
| 44 | DECLARE_READ8_MEMBER(portb_r); |
| 45 | DECLARE_WRITE8_MEMBER(portc_w); |
| 46 | DECLARE_WRITE8_MEMBER(disp_w); |
| 47 | |
| 24 | 48 | protected: |
| 25 | 49 | |
| 26 | 50 | // devices |
| r17777 | r17778 | |
| 28 | 52 | |
| 29 | 53 | // driver_device overrides |
| 30 | 54 | virtual void machine_reset(); |
| 31 | | public: |
| 32 | | DECLARE_DRIVER_INIT(g627); |
| 55 | private: |
| 56 | UINT8 m_seg[6]; |
| 33 | 57 | }; |
| 34 | 58 | |
| 35 | 59 | |
| 36 | 60 | static ADDRESS_MAP_START( g627_map, AS_PROGRAM, 8, g627_state ) |
| 37 | | AM_RANGE(0x0000, 0x17ff) AM_ROM |
| 38 | | AM_RANGE(0xc000, 0xc0ff) AM_RAM |
| 61 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 62 | AM_RANGE(0xc000, 0xc0ff) AM_DEVREADWRITE("i8156", i8155_device, memory_r, memory_w) |
| 63 | AM_RANGE(0xe000, 0xe0ff) AM_RAM // battery backed |
| 39 | 64 | ADDRESS_MAP_END |
| 40 | 65 | |
| 41 | 66 | static ADDRESS_MAP_START( g627_io, AS_IO, 8, g627_state ) |
| 42 | 67 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 43 | | //AM_RANGE(0x00, 0x02) AM_WRITE(disp_w) |
| 68 | AM_RANGE(0x00, 0x02) AM_WRITE(disp_w) |
| 44 | 69 | //AM_RANGE(0x03, 0x07) AM_WRITE(port_0x_w) |
| 45 | | //AM_RANGE(0x10, 0x17) AM_WRITE(port_1x_w) |
| 46 | | //AM_RANGE(0x21, 0x22) AM_READ(port_2x_r) |
| 47 | | //AM_RANGE(0x20, 0x25) AM_WRITE(port_2x_w) |
| 70 | AM_RANGE(0x10, 0x17) AM_DEVWRITE_LEGACY("astrocade", astrocade_sound_w) |
| 71 | AM_RANGE(0x20, 0x27) AM_DEVREADWRITE("i8156", i8155_device, io_r, io_w) |
| 48 | 72 | ADDRESS_MAP_END |
| 49 | 73 | |
| 50 | 74 | static INPUT_PORTS_START( g627 ) |
| r17777 | r17778 | |
| 54 | 78 | { |
| 55 | 79 | } |
| 56 | 80 | |
| 57 | | DRIVER_INIT_MEMBER(g627_state,g627) |
| 81 | READ8_MEMBER( g627_state::porta_r ) |
| 58 | 82 | { |
| 83 | return 0; |
| 59 | 84 | } |
| 60 | 85 | |
| 86 | READ8_MEMBER( g627_state::portb_r ) |
| 87 | { |
| 88 | return 0; |
| 89 | } |
| 90 | |
| 91 | // write the 6 digits of 1 display panel |
| 92 | WRITE8_MEMBER( g627_state::portc_w ) |
| 93 | { |
| 94 | if (data < 7) |
| 95 | for (int i = 0; i < 6; i++) |
| 96 | output_set_digit_value(data * 10 + i, m_seg[i]); |
| 97 | } |
| 98 | |
| 99 | // save segments until we can write the digits |
| 100 | WRITE8_MEMBER( g627_state::disp_w ) |
| 101 | { |
| 102 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; |
| 103 | offset <<= 1; |
| 104 | m_seg[offset]=patterns[data>>4]; |
| 105 | m_seg[++offset]=patterns[data&15]; |
| 106 | } |
| 107 | |
| 108 | static I8156_INTERFACE(i8156_intf) |
| 109 | { |
| 110 | DEVCB_DRIVER_MEMBER(g627_state,porta_r), // Port A in |
| 111 | DEVCB_NULL, // Port A out |
| 112 | DEVCB_DRIVER_MEMBER(g627_state,portb_r), // Port B in |
| 113 | DEVCB_NULL, // Port B out |
| 114 | DEVCB_NULL, // Port C in |
| 115 | DEVCB_DRIVER_MEMBER(g627_state,portc_w), // Port C out |
| 116 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI) // timer out |
| 117 | }; |
| 118 | |
| 61 | 119 | static MACHINE_CONFIG_START( g627, g627_state ) |
| 62 | 120 | /* basic machine hardware */ |
| 63 | 121 | MCFG_CPU_ADD("maincpu", Z80, 14138000/8) |
| 64 | 122 | MCFG_CPU_PROGRAM_MAP(g627_map) |
| 65 | 123 | MCFG_CPU_IO_MAP(g627_io) |
| 124 | MCFG_I8156_ADD("i8156", 14138000/8, i8156_intf) |
| 125 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 126 | MCFG_SOUND_ADD("astrocade", ASTROCADE, 14138000/8) // 0066-117XX audio chip |
| 127 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 66 | 128 | MACHINE_CONFIG_END |
| 67 | 129 | |
| 68 | 130 | /*------------------------------------------------------------------- |
| 69 | 131 | / Rotation VIII (09/1978) |
| 70 | 132 | /-------------------------------------------------------------------*/ |
| 71 | 133 | ROM_START(rotation) |
| 72 | | ROM_REGION(0x10000, "maincpu", 0) |
| 134 | ROM_REGION(0x10000, "maincpu", 0) // schematic shows 4x 2716 roms |
| 73 | 135 | ROM_LOAD("rot-a117.dat", 0x0000, 0x0800, CRC(7bb6beb3) SHA1(5ee62246032158c68d426c11a4a9a889ee7655d7)) |
| 74 | 136 | ROM_LOAD("rot-b117.dat", 0x0800, 0x0800, CRC(538e37b2) SHA1(d283ac4d0024388b92b6494fcde63957b705bf48)) |
| 75 | 137 | ROM_LOAD("rot-c117.dat", 0x1000, 0x0800, CRC(3321ff08) SHA1(d6d94fea27ef58ca648b2829b32d62fcec108c9b)) |
| 76 | 138 | ROM_END |
| 77 | 139 | |
| 78 | 140 | |
| 79 | | GAME(1978, rotation, 0, g627, g627, g627_state, g627, ROT0, "Midway", "Rotation VIII", GAME_IS_SKELETON_MECHANICAL) |
| 141 | GAME(1978, rotation, 0, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_IMPERFECT_KEYBOARD) |