Previous 199869 Revisions Next

r17778 Monday 10th September, 2012 at 13:22:49 UTC by Robbbert
rotation: wip (sound works, nothing else does)
[src/mame/drivers]g627.c

trunk/src/mame/drivers/g627.c
r17777r17778
77
88    Only one of its kind
99
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
18ToDo:
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
1026*******************************************************************************/
1127
1228
1329#include "emu.h"
1430#include "cpu/z80/z80.h"
31#include "machine/i8155.h"
32#include "sound/astrocde.h"
1533
34
1635class g627_state : public driver_device
1736{
1837public:
1938   g627_state(const machine_config &mconfig, device_type type, const char *tag)
2039      : driver_device(mconfig, type, tag),
21        m_maincpu(*this, "maincpu")
40   m_maincpu(*this, "maincpu")
2241   { }
2342
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
2448protected:
2549
2650   // devices
r17777r17778
2852
2953   // driver_device overrides
3054   virtual void machine_reset();
31public:
32   DECLARE_DRIVER_INIT(g627);
55private:
56   UINT8 m_seg[6];
3357};
3458
3559
3660static 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
3964ADDRESS_MAP_END
4065
4166static ADDRESS_MAP_START( g627_io, AS_IO, 8, g627_state )
4267   ADDRESS_MAP_GLOBAL_MASK(0xff)
43   //AM_RANGE(0x00, 0x02) AM_WRITE(disp_w)
68   AM_RANGE(0x00, 0x02) AM_WRITE(disp_w)
4469   //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)
4872ADDRESS_MAP_END
4973
5074static INPUT_PORTS_START( g627 )
r17777r17778
5478{
5579}
5680
57DRIVER_INIT_MEMBER(g627_state,g627)
81READ8_MEMBER( g627_state::porta_r )
5882{
83   return 0;
5984}
6085
86READ8_MEMBER( g627_state::portb_r )
87{
88   return 0;
89}
90
91// write the 6 digits of 1 display panel
92WRITE8_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
100WRITE8_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
108static 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
61119static MACHINE_CONFIG_START( g627, g627_state )
62120   /* basic machine hardware */
63121   MCFG_CPU_ADD("maincpu", Z80, 14138000/8)
64122   MCFG_CPU_PROGRAM_MAP(g627_map)
65123   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)
66128MACHINE_CONFIG_END
67129
68130/*-------------------------------------------------------------------
69131/ Rotation VIII (09/1978)
70132/-------------------------------------------------------------------*/
71133ROM_START(rotation)
72   ROM_REGION(0x10000, "maincpu", 0)
134   ROM_REGION(0x10000, "maincpu", 0) // schematic shows 4x 2716 roms
73135   ROM_LOAD("rot-a117.dat", 0x0000, 0x0800, CRC(7bb6beb3) SHA1(5ee62246032158c68d426c11a4a9a889ee7655d7))
74136   ROM_LOAD("rot-b117.dat", 0x0800, 0x0800, CRC(538e37b2) SHA1(d283ac4d0024388b92b6494fcde63957b705bf48))
75137   ROM_LOAD("rot-c117.dat", 0x1000, 0x0800, CRC(3321ff08) SHA1(d6d94fea27ef58ca648b2829b32d62fcec108c9b))
76138ROM_END
77139
78140
79GAME(1978,  rotation,  0,  g627,  g627, g627_stateg627,  ROT0,  "Midway",    "Rotation VIII",      GAME_IS_SKELETON_MECHANICAL)
141GAME(1978,  rotation,  0,  g627,  g627, driver_device0,  ROT0,  "Midway", "Rotation VIII", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_IMPERFECT_KEYBOARD)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team