1
1
/***************************************************************************
3
Multipede (c) 1980-2 Infogrames / 199x CosmoDog
3
Centipede, Millipede, Missile Command, Let's Go Bowling "Multipede"
4
(c) 1980-2 / 2002 - Infogrames / CosmoDog
5
6
preliminary driver by Angelo Salese
8
Earlier revisions of this cabinet did not include the bowling game.
9
12
- finish video emulation;
15
- change the CPU when a G658C02 core will be available;
16
- driver probably needs rewriting, at least the i/o part;
18
Probably on the CPLD (CY39100V208B) - Quoted from Cosmodog's website:
19
"Instead, we used a programmable chip that we could reconfigure very
20
quickly while the game is running. So, during that 1/8th of a second
21
or so when the screen goes black while it switches games, it's actually
22
reloading the hardware with a whole new design to run the next game."
13
24
============================================================================
49
static VIDEO_UPDATE( cmmb )
61
static SCREEN_UPDATE( cmmb )
51
cmmb_state *state = screen->machine->driver_data<cmmb_state>();
52
UINT8 *videoram = state->videoram;
53
const gfx_element *gfx = screen->machine->gfx[0];
63
cmmb_state *state = screen->machine().driver_data<cmmb_state>();
64
UINT8 *videoram = state->m_videoram;
65
const gfx_element *gfx = screen->machine().gfx[0];
54
66
int count = 0x00000;
74
86
static READ8_HANDLER( cmmb_charram_r )
76
UINT8 *GFX = space->machine->region("gfx")->base();
88
UINT8 *GFX = space->machine().region("gfx")->base();
78
90
return GFX[offset];
81
93
static WRITE8_HANDLER( cmmb_charram_w )
83
UINT8 *GFX = space->machine->region("gfx")->base();
95
UINT8 *GFX = space->machine().region("gfx")->base();
85
97
GFX[offset] = data;
90
gfx_element_mark_dirty(space->machine->gfx[0], offset >> 4);
91
gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
102
gfx_element_mark_dirty(space->machine().gfx[0], offset >> 4);
103
gfx_element_mark_dirty(space->machine().gfx[1], offset >> 5);
103
115
//printf("%02x R\n",offset);
106
case 0x00: return input_port_read(space->machine, "IN2");
118
case 0x00: return input_port_read(space->machine(), "IN2");
107
119
case 0x03: return 4; //eeprom?
108
case 0x0e: return input_port_read(space->machine, "IN0");
109
case 0x0f: return input_port_read(space->machine, "IN1");
120
case 0x0e: return input_port_read(space->machine(), "IN0");
121
case 0x0f: return input_port_read(space->machine(), "IN1");
115
static UINT8 irq_mask;
119
UINT8 *ROM = space->machine->region("maincpu")->base();
130
UINT8 *ROM = space->machine().region("maincpu")->base();
120
131
UINT32 bankaddress;
122
133
bankaddress = 0x10000 + (0x10000 * (data & 0x03));
123
memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
134
memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
127
138
static WRITE8_HANDLER( cmmb_output_w )
140
cmmb_state *state = space->machine().driver_data<cmmb_state>();
129
141
//printf("%02x -> [%02x] W\n",data,offset);
134
UINT8 *ROM = space->machine->region("maincpu")->base();
146
UINT8 *ROM = space->machine().region("maincpu")->base();
135
147
UINT32 bankaddress;
137
149
bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
138
memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
150
memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
142
irq_mask = data & 0x80;
154
state->m_irq_mask = data & 0x80;
149
161
static READ8_HANDLER( kludge_r )
151
return space->machine->rand();
163
return space->machine().rand();
154
166
/* overlap empty addresses */
155
static ADDRESS_MAP_START( cmmb_map, ADDRESS_SPACE_PROGRAM, 8 )
167
static ADDRESS_MAP_START( cmmb_map, AS_PROGRAM, 8 )
168
ADDRESS_MAP_GLOBAL_MASK(0xffff)
156
169
AM_RANGE(0x0000, 0x01ff) AM_RAM /* zero page address */
157
170
// AM_RANGE(0x13c0, 0x13ff) AM_RAM //spriteram
158
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(cmmb_state, videoram)
171
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(cmmb_state, m_videoram)
159
172
AM_RANGE(0x2480, 0x249f) AM_RAM_WRITE(cmmb_paletteram_w) AM_BASE_GENERIC(paletteram)
160
173
AM_RANGE(0x4000, 0x400f) AM_READWRITE(cmmb_input_r,cmmb_output_w) //i/o
161
174
AM_RANGE(0x4900, 0x4900) AM_READ(kludge_r)
276
289
static INTERRUPT_GEN( cmmb_irq )
278
//if(input_code_pressed_once(device->machine, KEYCODE_Z))
279
// cpu_set_input_line(device, 0, HOLD_LINE);
291
//if(input_code_pressed_once(device->machine(), KEYCODE_Z))
292
// device_set_input_line(device, 0, HOLD_LINE);
282
295
static MACHINE_RESET( cmmb )
286
299
static MACHINE_CONFIG_START( cmmb, cmmb_state )
288
301
/* basic machine hardware */
289
MCFG_CPU_ADD("maincpu",M65C02,8000000/2) // unknown clock
302
MCFG_CPU_ADD("maincpu",G65816,8000000/2) // G658C02 (a G65816 with 64k of address line space), unknown clock
290
303
MCFG_CPU_PROGRAM_MAP(cmmb_map)
291
304
MCFG_CPU_VBLANK_INT("screen",cmmb_irq)
297
310
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298
311
MCFG_SCREEN_SIZE(32*8, 32*8)
299
312
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
313
MCFG_SCREEN_UPDATE(cmmb)
300
315
MCFG_GFXDECODE(cmmb)
301
316
MCFG_PALETTE_LENGTH(512)
303
318
MCFG_VIDEO_START(cmmb)
304
MCFG_VIDEO_UPDATE(cmmb)
306
320
MCFG_MACHINE_RESET(cmmb)
325
339
ROM_REGION( 0x1000, "gfx", ROMREGION_ERASE00 )
328
GAME( 199?, cmmb162, 0, cmmb, cmmb, 0, ROT270, "Infogrames / Cosmodog", "Multipede (V1.00)", GAME_NO_SOUND|GAME_NOT_WORKING )
342
GAME( 2002, cmmb162, 0, cmmb, cmmb, 0, ROT270, "Infogrames / Cosmodog", "Multipede (rev 1.62)", GAME_NO_SOUND|GAME_NOT_WORKING )