From 092edee31b7ff46f8916064defcde5fa190e0a78 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Sat, 12 Dec 2009 00:06:43 +0000 Subject: [PATCH] Let's see if we can put a bunch of nails in the coffin of hiscore.dat: * added driver data struct to neogeo.c and added GAME_SUPPORTS_SAVE flag to all sets, because save state support was already there * added driver data struct and save state support to cps1.c, cps2.c and fcrash.c --- src/mame/drivers/cps1.c | 427 ++++++------- src/mame/drivers/cps2.c | 729 ++++++++++++----------- src/mame/drivers/fcrash.c | 328 ++++++---- src/mame/drivers/neodrvr.c | 714 +++++++++++----------- src/mame/drivers/neogeo.c | 379 ++++++------ src/mame/includes/cps1.h | 210 +++++-- src/mame/includes/neogeo.h | 127 +++- src/mame/machine/cps2crpt.c | 2 - src/mame/machine/neoprot.c | 188 +++--- src/mame/video/cps1.c | 1125 ++++++++++++++++++----------------- src/mame/video/neogeo.c | 399 ++++++------- 11 files changed, 2517 insertions(+), 2111 deletions(-) diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index fb39cd74ea0..a0984e87919 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -239,8 +239,9 @@ Stephh's log (2006.09.20) : #include "sound/qsound.h" #include "sound/msm5205.h" +#include "includes/cps1.h" /* External CPS1 definitions */ + -#include "cps1.h" /* External CPS1 definitions */ READ16_HANDLER( cps1_dsw_r ) { @@ -256,26 +257,28 @@ static READ16_HANDLER( cps1_hack_dsw_r ) return (in << 8) | in; } -static int dial[2]; - static READ16_HANDLER( forgottn_dial_0_r ) { - return ((input_port_read(space->machine, "DIAL0") - dial[0]) >> (8*offset)) & 0xff; + cps_state *state = (cps_state *)space->machine->driver_data; + return ((input_port_read(space->machine, "DIAL0") - state->dial[0]) >> (8 * offset)) & 0xff; } static READ16_HANDLER( forgottn_dial_1_r ) { - return ((input_port_read(space->machine, "DIAL1") - dial[1]) >> (8*offset)) & 0xff; + cps_state *state = (cps_state *)space->machine->driver_data; + return ((input_port_read(space->machine, "DIAL1") - state->dial[1]) >> (8 * offset)) & 0xff; } static WRITE16_HANDLER( forgottn_dial_0_reset_w ) { - dial[0] = input_port_read(space->machine, "DIAL0"); + cps_state *state = (cps_state *)space->machine->driver_data; + state->dial[0] = input_port_read(space->machine, "DIAL0"); } static WRITE16_HANDLER( forgottn_dial_1_reset_w ) { - dial[1] = input_port_read(space->machine, "DIAL1"); + cps_state *state = (cps_state *)space->machine->driver_data; + state->dial[1] = input_port_read(space->machine, "DIAL1"); } @@ -296,23 +299,23 @@ static WRITE8_DEVICE_HANDLER( cps1_oki_pin7_w ) static WRITE16_HANDLER( cps1_soundlatch_w ) { if (ACCESSING_BITS_0_7) - soundlatch_w(space,0,data & 0xff); + soundlatch_w(space, 0, data & 0xff); } static WRITE16_HANDLER( cps1_soundlatch2_w ) { if (ACCESSING_BITS_0_7) - soundlatch2_w(space,0,data & 0xff); + soundlatch2_w(space, 0, data & 0xff); } WRITE16_HANDLER( cps1_coinctrl_w ) { if (ACCESSING_BITS_8_15) { - coin_counter_w(space->machine, 0,data & 0x0100); - coin_counter_w(space->machine, 1,data & 0x0200); - coin_lockout_w(space->machine, 0,~data & 0x0400); - coin_lockout_w(space->machine, 1,~data & 0x0800); + coin_counter_w(space->machine, 0, data & 0x0100); + coin_counter_w(space->machine, 1, data & 0x0200); + coin_lockout_w(space->machine, 0, ~data & 0x0400); + coin_lockout_w(space->machine, 1, ~data & 0x0800); // bit 15 = CPS-A custom reset? } @@ -322,10 +325,10 @@ static WRITE16_HANDLER( cpsq_coinctrl2_w ) { if (ACCESSING_BITS_0_7) { - coin_counter_w(space->machine, 2,data & 0x01); - coin_lockout_w(space->machine, 2,~data & 0x02); - coin_counter_w(space->machine, 3,data & 0x04); - coin_lockout_w(space->machine, 3,~data & 0x08); + coin_counter_w(space->machine, 2, data & 0x01); + coin_lockout_w(space->machine, 2, ~data & 0x02); + coin_counter_w(space->machine, 3, data & 0x04); + coin_lockout_w(space->machine, 3, ~data & 0x08); } } @@ -343,7 +346,6 @@ INTERRUPT_GEN( cps1_interrupt ) * ********************************************************************/ -static UINT8 *qsound_sharedram1,*qsound_sharedram2; static INTERRUPT_GEN( cps1_qsound_interrupt ) { @@ -355,34 +357,41 @@ static READ16_HANDLER( qsound_rom_r ) { UINT8 *rom = memory_region(space->machine, "user1"); - if (rom) return rom[offset] | 0xff00; + if (rom) + return rom[offset] | 0xff00; else { - popmessage("%06x: read sound ROM byte %04x",cpu_get_pc(space->cpu),offset); + popmessage("%06x: read sound ROM byte %04x", cpu_get_pc(space->cpu), offset); return 0; } } READ16_HANDLER( qsound_sharedram1_r ) { - return qsound_sharedram1[offset] | 0xff00; + cps_state *state = (cps_state *)space->machine->driver_data; + return state->qsound_sharedram1[offset] | 0xff00; } WRITE16_HANDLER( qsound_sharedram1_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; + if (ACCESSING_BITS_0_7) - qsound_sharedram1[offset] = data; + state->qsound_sharedram1[offset] = data; } static READ16_HANDLER( qsound_sharedram2_r ) { - return qsound_sharedram2[offset] | 0xff00; + cps_state *state = (cps_state *)space->machine->driver_data; + return state->qsound_sharedram2[offset] | 0xff00; } static WRITE16_HANDLER( qsound_sharedram2_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; + if (ACCESSING_BITS_0_7) - qsound_sharedram2[offset] = data; + state->qsound_sharedram2[offset] = data; } static WRITE8_HANDLER( qsound_banksw_w ) @@ -432,27 +441,6 @@ static const eeprom_interface pang3_eeprom_interface = }; #endif -// FIXME: these are still needed by pang3 -static READ16_HANDLER( cps1_eeprom_port_r ) -{ - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); - return eepromdev_read_bit(eeprom); -} - -static WRITE16_HANDLER( cps1_eeprom_port_w ) -{ - if (ACCESSING_BITS_0_7) - { - /* - bit 0 = data - bit 6 = clock - bit 7 = cs - */ - input_port_write(space->machine, "EEPROMOUT", data, 0xff); - } -} - - /* PAL PRG1 (16P8B @ 12H): @@ -569,13 +557,13 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x800020, 0x800021) AM_READNOP /* ? Used by Rockman ? not mapped according to PAL */ AM_RANGE(0x800030, 0x800037) AM_WRITE(cps1_coinctrl_w) /* Forgotten Worlds has dial controls on B-board mapped at 800040-80005f. See DRIVER_INIT */ - AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ /* CPS-B custom is mapped by a PAL on B-board. SF2 revision "E" US 910228 has it a a different address, see DRIVER_INIT */ - AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) + AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE_MEMBER(cps_state, cps_b_regs) AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w) /* Sound command */ AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) /* SF2CE executes code from here */ AM_RANGE(0xff0000, 0xffffff) AM_RAM ADDRESS_MAP_END @@ -620,9 +608,9 @@ static ADDRESS_MAP_START( qsound_main_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x800000, 0x800007) AM_READ_PORT("IN1") /* Player input ports */ AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */ AM_RANGE(0x800030, 0x800037) AM_WRITE(cps1_coinctrl_w) - AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ - AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) /* CPS-B custom (mapped by LWIO/IOB1 PAL on B-board) */ - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ + AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE_MEMBER(cps_state, cps_b_regs) /* CPS-B custom (mapped by LWIO/IOB1 PAL on B-board) */ + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) /* SF2CE executes code from here */ AM_RANGE(0xf00000, 0xf0ffff) AM_READ(qsound_rom_r) /* Slammasters protection */ AM_RANGE(0xf18000, 0xf19fff) AM_READWRITE(qsound_sharedram1_r, qsound_sharedram1_w) /* Q RAM */ AM_RANGE(0xf1c000, 0xf1c001) AM_READ_PORT("IN2") /* Player 3 controls (later games) */ @@ -636,11 +624,11 @@ ADDRESS_MAP_END ADDRESS_MAP_START( qsound_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) // used by cps2.c too AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") /* banked (contains music data) */ - AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&qsound_sharedram1) + AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE_MEMBER(cps_state, qsound_sharedram1) AM_RANGE(0xd000, 0xd002) AM_DEVWRITE("qsound", qsound_w) AM_RANGE(0xd003, 0xd003) AM_WRITE(qsound_banksw_w) AM_RANGE(0xd007, 0xd007) AM_DEVREAD("qsound", qsound_r) - AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&qsound_sharedram2) + AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE_MEMBER(cps_state, qsound_sharedram2) ADDRESS_MAP_END /*********************************************************** @@ -2758,7 +2746,8 @@ GFXDECODE_END static void cps1_irq_handler_mus(const device_config *device, int irq) { - cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); + cps_state *state = (cps_state *)device->machine->driver_data; + cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); } static const ym2151_interface ym2151_config = @@ -2777,8 +2766,20 @@ static const ym2151_interface ym2151_config = * ********************************************************************/ +static MACHINE_START( cps1 ) +{ + cps_state *state = (cps_state *)machine->driver_data; + + state->maincpu = devtag_get_device(machine, "maincpu"); + state->audiocpu = devtag_get_device(machine, "audiocpu"); +} + + static MACHINE_DRIVER_START( cps1_10MHz ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, XTAL_10MHz ) /* verified on pcb */ MDRV_CPU_PROGRAM_MAP(main_map) @@ -2787,6 +2788,8 @@ static MACHINE_DRIVER_START( cps1_10MHz ) MDRV_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ MDRV_CPU_PROGRAM_MAP(sub_map) + MDRV_MACHINE_START(cps1) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(59.61) /* verified on one of the input gates of the 74ls08@4J on GNG romboard 88620-b-2 */ @@ -2864,6 +2867,9 @@ MACHINE_DRIVER_END static MACHINE_DRIVER_START( cpspicb ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, 12000000) MDRV_CPU_PROGRAM_MAP(main_map) @@ -2872,6 +2878,8 @@ static MACHINE_DRIVER_START( cpspicb ) MDRV_CPU_ADD("audiocpu", PIC16C57, 12000000) MDRV_CPU_FLAGS(CPU_DISABLE) /* no valid dumps .. */ + MDRV_MACHINE_START(cps1) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(60) @@ -2939,6 +2947,9 @@ static const msm5205_interface msm5205_interface2 = static MACHINE_DRIVER_START( sf2mdt ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, 12000000) MDRV_CPU_PROGRAM_MAP(main_map) @@ -2947,6 +2958,8 @@ static MACHINE_DRIVER_START( sf2mdt ) MDRV_CPU_ADD("audiocpu", Z80, 3579545) MDRV_CPU_PROGRAM_MAP(sf2mdt_z80map) + MDRV_MACHINE_START(cps1) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(60) @@ -3022,6 +3035,9 @@ Note: static MACHINE_DRIVER_START( knightsb ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, 24000000 / 2) MDRV_CPU_PROGRAM_MAP(main_map) @@ -3030,6 +3046,8 @@ static MACHINE_DRIVER_START( knightsb ) MDRV_CPU_ADD("audiocpu", Z80, 29821000 / 8) MDRV_CPU_PROGRAM_MAP(sf2mdt_z80map) + MDRV_MACHINE_START(cps1) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(60) @@ -8603,12 +8621,19 @@ ROM_END static DRIVER_INIT( forgottn ) { + cps_state *state = (cps_state *)machine->driver_data; + /* Forgotten Worlds has a NEC uPD4701AC on the B-board handling dial inputs from the CN-MOWS connector. */ /* The memory mapping is handled by PAL LWIO */ memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w); memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w); - memory_install_read16_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800052, 0x800055, 0, 0, forgottn_dial_0_r); - memory_install_read16_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r); + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800052, 0x800055, 0, 0, forgottn_dial_0_r); + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r); + + state_save_register_global_array(machine, state->dial); + + state->dial[0] = 0; + state->dial[1] = 0; DRIVER_INIT_CALL(cps1); } @@ -8626,7 +8651,7 @@ static DRIVER_INIT( sf2ue ) static DRIVER_INIT( sf2hack ) { /* some SF2 hacks have some inputs wired to the LSB instead of MSB */ - memory_install_read16_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800018, 0x80001f, 0, 0, cps1_hack_dsw_r); + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x800018, 0x80001f, 0, 0, cps1_hack_dsw_r); DRIVER_INIT_CALL(cps1); } @@ -8659,7 +8684,7 @@ static DRIVER_INIT( pang3 ) { /* Pang 3 is the only non-QSound game to have an EEPROM. */ /* It is mapped in the CPS-B address range so probably is on the C-board. */ - memory_install_readwrite16_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w); + memory_install_readwrite_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x80017a, 0x80017b, 0, 0, "EEPROMIN", "EEPROMOUT"); DRIVER_INIT_CALL(cps1); } @@ -8667,12 +8692,12 @@ static DRIVER_INIT( pang3 ) static DRIVER_INIT( pang3j ) { UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); - int A,src,dst; + int A, src, dst; - for (A = 0x80000;A < 0x100000;A += 2) + for (A = 0x80000; A < 0x100000; A += 2) { /* only the low 8 bits of each word are encrypted */ - src = rom[A/2]; + src = rom[A / 2]; dst = src & 0xff00; if ( src & 0x01) dst ^= 0x04; if ( src & 0x02) dst ^= 0x21; @@ -8703,12 +8728,12 @@ static DRIVER_INIT( sf2mdt ) for( i = 0; i < gfx_size; i += 8 ) { - tmp = rom[i+1]; - rom[i+1] = rom[i+4]; - rom[i+4] = tmp; - tmp = rom[i+3]; - rom[i+3] = rom[i+6]; - rom[i+6] = tmp; + tmp = rom[i + 1]; + rom[i + 1] = rom[i + 4]; + rom[i + 4] = tmp; + tmp = rom[i + 3]; + rom[i + 3] = rom[i + 6]; + rom[i + 6] = tmp; } memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x70c01a, 0x70c01b, 0, 0, sf2mdt_r); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x70c01c, 0x70c01d, 0, 0, sf2mdt_r); @@ -8720,140 +8745,140 @@ static DRIVER_INIT( sf2mdt ) } -GAME( 1988, forgottn, 0, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Forgotten Worlds (World)", 0 ) -GAME( 1988, forgottnu,forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Forgotten Worlds (US)", 0 ) -GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Lost Worlds (Japan)", 0 ) -GAME( 1988, lostwrldo,forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Lost Worlds (Japan Old Ver.)", 0 ) -GAME( 1988, ghouls, 0, cps1_10MHz, ghouls, cps1, ROT0, "Capcom", "Ghouls'n Ghosts (World)" , 0) // Wed.26.10.1988 in the ROMS -GAME( 1988, ghoulsu, ghouls, cps1_10MHz, ghoulsu, cps1, ROT0, "Capcom", "Ghouls'n Ghosts (US)" , 0) // Wed.26.10.1988 in the ROMS -GAME( 1988, daimakai, ghouls, cps1_10MHz, daimakai, cps1, ROT0, "Capcom", "Dai Makai-Mura (Japan)" , 0) // Wed.26.10.1988 in the ROMS -GAME( 1988, daimakair,ghouls, cps1_10MHz, daimakai, cps1, ROT0, "Capcom", "Dai Makai-Mura (Japan Resale Ver.)" , 0) // still Wed.26.10.1988 in the ROMS... -GAME( 1989, strider, 0, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider (US set 1)", 0 ) -GAME( 1989, striderua,strider, cps1_10MHz, stridrua, cps1, ROT0, "Capcom", "Strider (US set 2)", 0 ) -GAME( 1989, striderj, strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan)", 0 ) -GAME( 1989, striderjr,strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan Resale Ver.)", 0 ) -GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars (US set 1)", 0 ) // (c) Capcom U.S.A. -GAME( 1989, dynwaru, dynwar, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars (US set 2)", 0 ) // (c) Capcom U.S.A. -GAME( 1989, dynwarj, dynwar, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan)", 0 ) -GAME( 1989, willow, 0, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (US)", 0 ) -GAME( 1989, willowj, willow, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (Japan, Japanese)" , 0) // Japan "warning" -GAME( 1989, willowje, willow, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (Japan, English)", 0 ) // (c) Capcom U.S.A. but Japan "warning" -GAME( 1989, unsquad, 0, cps1_10MHz, unsquad, cps1, ROT0, "Capcom", "U.N. Squadron (US)", 0 ) -GAME( 1989, area88, unsquad, cps1_10MHz, unsquad, cps1, ROT0, "Capcom", "Area 88 (Japan)", 0 ) -GAME( 1989, ffight, 0, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (World)", 0 ) -GAME( 1989, ffightu, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US)", 0 ) -GAME( 1989, ffightua, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US 900112)", 0 ) -GAME( 1989, ffightub, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US 900613)", 0 ) -GAME( 1989, ffightj, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan)", 0 ) -GAME( 1989, ffightj1, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan 900305)", 0 ) -GAME( 1989, ffightj2, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan 900112)", 0 ) -GAME( 1990, 1941, 0, cps1_10MHz, 1941, cps1, ROT270, "Capcom", "1941 - Counter Attack (World)", 0 ) -GAME( 1990, 1941j, 1941, cps1_10MHz, 1941, cps1, ROT270, "Capcom", "1941 - Counter Attack (Japan)", 0 ) -GAME( 1990, mercs, 0, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (World 900302)" , 0) // "ETC" -GAME( 1990, mercsu, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (US 900302)", 0 ) -GAME( 1990, mercsua, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (US 900608)", 0 ) -GAME( 1990, mercsj, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Senjou no Ookami II (Japan 900302)", 0 ) -GAME( 1990, mtwins, 0, cps1_10MHz, mtwins, cps1, ROT0, "Capcom", "Mega Twins (World 900619)", 0 ) // "ETC" - (c) Capcom U.S.A. with World "warning" -GAME( 1990, chikij, mtwins, cps1_10MHz, mtwins, cps1, ROT0, "Capcom", "Chiki Chiki Boys (Japan 900619)", 0 ) -GAME( 1990, msword, 0, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (World 900725)" , 0) // 25.07.1990 "Other Country" -GAME( 1990, mswordr1, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (World 900623)" , 0) // 23.06.1990 "Other Country" -GAME( 1990, mswordu, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (US 900725)" , 0) // 25.07.1990 "U.S.A." -GAME( 1990, mswordj, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword (Japan 900623)" , 0) // 23.06.1990 "Japan" -GAME( 1990, cawing, 0, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (World 901012)" , 0) // "ETC" -GAME( 1990, cawingr1, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (World 901009)" , 0) // "ETC" -GAME( 1990, cawingu, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (US 901012)", 0 ) -GAME( 1990, cawingj, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "U.S. Navy (Japan 901012)", 0 ) -GAME( 1990, nemo, 0, cps1_10MHz, nemo, cps1, ROT0, "Capcom", "Nemo (World 901130)" , 0) // "ETC" -GAME( 1990, nemoj, nemo, cps1_10MHz, nemo, cps1, ROT0, "Capcom", "Nemo (Japan 901120)", 0 ) -GAME( 1991, sf2, 0, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (World 910522)" , 0) // "ETC" -GAME( 1991, sf2eb, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (World 910214)" , 0) // "ETC" -GAME( 1992, sf2ebbl, sf2, cps1_10MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II - The World Warrior (World 910214, TAB Austria bootleg)", 0 ) -GAME( 1991, sf2ua, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910206)", 0 ) -GAME( 1991, sf2ub, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910214)", 0 ) -GAME( 1991, sf2ud, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910318)", 0 ) -GAME( 1991, sf2ue, sf2, cps1_10MHz, sf2, sf2ue, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910228)", 0 ) -GAME( 1991, sf2uf, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910411)", 0 ) -GAME( 1991, sf2ui, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910522)", 0 ) -GAME( 1991, sf2uk, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 911101)", 0 ) -GAME( 1991, sf2j, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 911210)", 0 ) -GAME( 1991, sf2ja, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 910214)", 0 ) -GAME( 1991, sf2jc, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 910306)", 0 ) -GAME( 1991, sf2qp1, sf2, cps1_10MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II - The World Warrior (Quicken Pt-I, bootleg)" , 0) // 910214 -GAME( 1991, 3wonders, 0, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Three Wonders (World 910520)" , 0) // "ETC" -GAME( 1991, 3wondersu,3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Three Wonders (US 910520)", 0 ) -GAME( 1991, wonder3, 3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Wonder 3 (Japan 910520)", 0 ) -GAME( 1991, 3wondersh,3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "bootleg","Three Wonders (hack?)", 0 ) -GAME( 1991, kod, 0, cps1_10MHz, kod, cps1, ROT0, "Capcom", "The King of Dragons (World 910711)" , 0) // "ETC" -GAME( 1991, kodu, kod, cps1_10MHz, kodj, cps1, ROT0, "Capcom", "The King of Dragons (US 910910)", 0 ) -GAME( 1991, kodj, kod, cps1_10MHz, kodj, cps1, ROT0, "Capcom", "The King of Dragons (Japan 910805)", 0 ) -GAME( 1991, captcomm, 0, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (World 911014)" , 0) // "OTHER COUNTRY" -GAME( 1991, captcommu,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (US 910928)", 0 ) -GAME( 1991, captcommj,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (Japan 911202)", 0 ) -GAME( 1991, captcommb,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "bootleg","Captain Commando (bootleg)", GAME_NOT_WORKING ) -GAME( 1991, knights, 0, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (World 911127)" , 0) // "ETC" -GAME( 1991, knightsu, knights, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (US 911127)", 0 ) -GAME( 1991, knightsj, knights, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (Japan 911127)", 0 ) -GAME( 1991, knightsb, knights, knightsb, knights, cps1, ROT0, "bootleg", "Knights of the Round (World 911127, bootleg)" , GAME_NOT_WORKING) -GAME( 1992, sf2ce, 0, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (World 920313)" , 0) // "ETC" -GAME( 1992, sf2ceua, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920313)", 0 ) -GAME( 1992, sf2ceub, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920513)", 0 ) -GAME( 1992, sf2ceuc, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920803)", 0 ) -GAME( 1992, sf2cej, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (Japan 920513)", 0 ) -GAME( 1992, sf2rb, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 1, bootleg)" , 0) // 920322 - based on World version -GAME( 1992, sf2rb2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 2, bootleg)" , 0) // 920322 - based on World version -GAME( 1992, sf2rb3, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 3, bootleg)" , 0) -GAME( 1992, sf2red, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Red Wave, bootleg)" , 0) // 920313 - based on World version -GAME( 1992, sf2v004, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II! - Champion Edition (V004, bootleg)", 0 ) // "102092" !!! - based on (heavily modified) World version -GAME( 1992, sf2acc, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Accelerator!, bootleg)" , 0) // 920313 - based on USA version -GAME( 1992, sf2accp2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Accelerator Pt.II, bootleg)" , 0) // 920313 - based on USA version -GAME( 1992, sf2dkot2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Double K.O. Turbo II, bootleg)" , 0) // 902140 - ??? -GAME( 1992, sf2m1, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M1, bootleg)", GAME_NOT_WORKING ) -GAME( 1992, sf2m2, sf2ce, cps1_12MHz, sf2m2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M2, bootleg)", 0 ) -GAME( 1992, sf2m3, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M3, bootleg)", GAME_NOT_WORKING ) -GAME( 1992, sf2m4, sf2ce, cps1_12MHz, sf2m4, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M4, bootleg)", 0 ) -GAME( 1992, sf2m5, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M5, bootleg)", 0 ) -GAME( 1992, sf2m6, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M6, bootleg)", 0 ) -GAME( 1992, sf2m7, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M7, bootleg)", 0 ) -GAME( 1992, sf2yyc, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (YYC, bootleg)", 0 ) -GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (Xiang Long, Chinese bootleg)", 0 ) -GAME( 1992, sf2mdt, sf2ce, sf2mdt, sf2hack, sf2mdt, ROT0, "bootleg","Street Fighter II' - Champion Edition (Magic Delta Turbo, bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND ); // heavily modified, different sound & gfx hardware -GAME( 1992, varth, 0, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)" , 0) // "ETC" 12MHz verified -GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)" , 0) // "ETC" -GAME( 1992, varthu, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", 0 ) -GAME( 1992, varthj, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (Japan 920714)", 0 ) -GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps1, ROT0, "Capcom", "Capcom World 2 (Japan 920611)", 0 ) -GAME( 1992, sf2hf, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Hyper Fighting (World 921209)", 0 ) -GAME( 1992, sf2t, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Hyper Fighting (US 921209)", 0 ) -GAME( 1992, sf2tj, sf2ce, cps1_12MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II' Turbo - Hyper Fighting (Japan 921209)", 0 ) -GAME( 1992, qad, 0, cps1_12MHz, qad, cps1, ROT0, "Capcom", "Quiz & Dragons (US 920701)", 0 ) // 12MHz verified -GAME( 1994, qadj, qad, cps1_12MHz, qadj, cps1, ROT0, "Capcom", "Quiz & Dragons (Japan 940921)", 0 ) -GAME( 1995, qtono2, 0, cps1_12MHz, qtono2, cps1, ROT0, "Capcom", "Quiz Tonosama no Yabou 2 Zenkoku-ban (Japan 950123)", 0 ) -GAME( 1995, megaman, 0, cps1_12MHz, megaman, cps1, ROT0, "Capcom", "Mega Man - The Power Battle (CPS1 Asia 951006)", 0 ) -GAME( 1995, rockmanj, megaman, cps1_12MHz, rockmanj, cps1, ROT0, "Capcom", "Rockman - The Power Battle (CPS1 Japan 950922)", 0 ) -GAME( 1992, wof, 0, qsound, wof, wof, ROT0, "Capcom", "Warriors of Fate (World 921002)" , 0) // "ETC" -GAME( 1992, wofa, wof, qsound, wof, wof, ROT0, "Capcom", "Sangokushi II (Asia 921005)" , 0) // World "warning" -GAME( 1992, wofu, wof, qsound, wof, wof, ROT0, "Capcom", "Warriors of Fate (US 921031)" , 0) // World "warning" -GAME( 1992, wofj, wof, qsound, wof, wof, ROT0, "Capcom", "Tenchi wo Kurau II - Sekiheki no Tatakai (Japan 921031)", 0 ) -GAME( 1999, wofhfh, wof, wofhfh, wofhfh, cps1, ROT0, "bootleg","Sangokushi II: Huo Fenghuang (Chinese bootleg)", 0 ) -GAME( 1993, dino, 0, qsound, dino, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (World 930201)" , 0) // "ETC" -GAME( 1993, dinou, dino, qsound, dino, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (US 930201)", 0 ) -GAME( 1993, dinoj, dino, qsound, dino, dino, ROT0, "Capcom", "Cadillacs Kyouryuu-Shinseiki (Japan 930201)", 0 ) -GAME( 1993, dinopic, dino, cpspicb, dinopic, dino, ROT0, "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 1)", GAME_NOT_WORKING ) -GAME( 1993, dinopic2, dino, cpspicb, dinopic, dino, ROT0, "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 2)", GAME_NOT_WORKING ) -GAME( 1993, punisher, 0, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (World 930422)" , 0) // "ETC" -GAME( 1993, punisheru,punisher, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (US 930422)", 0 ) -GAME( 1993, punisherj,punisher, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (Japan 930422)", 0 ) -GAME( 1993, punipic, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 1)" , GAME_NOT_WORKING) -GAME( 1993, punipic2, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 2)" , GAME_NOT_WORKING) -GAME( 1993, punipic3, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 3)" , GAME_NOT_WORKING) +GAME( 1988, forgottn, 0, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Forgotten Worlds (World)", GAME_SUPPORTS_SAVE ) +GAME( 1988, forgottnu,forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Forgotten Worlds (US)", GAME_SUPPORTS_SAVE ) +GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Lost Worlds (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1988, lostwrldo,forgottn, cps1_10MHz, forgottn, forgottn, ROT0, "Capcom", "Lost Worlds (Japan Old Ver.)", GAME_SUPPORTS_SAVE ) +GAME( 1988, ghouls, 0, cps1_10MHz, ghouls, cps1, ROT0, "Capcom", "Ghouls'n Ghosts (World)", GAME_SUPPORTS_SAVE ) // Wed.26.10.1988 in the ROMS +GAME( 1988, ghoulsu, ghouls, cps1_10MHz, ghoulsu, cps1, ROT0, "Capcom", "Ghouls'n Ghosts (US)", GAME_SUPPORTS_SAVE ) // Wed.26.10.1988 in the ROMS +GAME( 1988, daimakai, ghouls, cps1_10MHz, daimakai, cps1, ROT0, "Capcom", "Dai Makai-Mura (Japan)", GAME_SUPPORTS_SAVE ) // Wed.26.10.1988 in the ROMS +GAME( 1988, daimakair,ghouls, cps1_10MHz, daimakai, cps1, ROT0, "Capcom", "Dai Makai-Mura (Japan Resale Ver.)", GAME_SUPPORTS_SAVE ) // still Wed.26.10.1988 in the ROMS... +GAME( 1989, strider, 0, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider (US set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1989, striderua,strider, cps1_10MHz, stridrua, cps1, ROT0, "Capcom", "Strider (US set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1989, striderj, strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, striderjr,strider, cps1_10MHz, strider, cps1, ROT0, "Capcom", "Strider Hiryu (Japan Resale Ver.)", GAME_SUPPORTS_SAVE ) +GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars (US set 1)", GAME_SUPPORTS_SAVE ) // (c) Capcom U.S.A. +GAME( 1989, dynwaru, dynwar, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Dynasty Wars (US set 2)", GAME_SUPPORTS_SAVE ) // (c) Capcom U.S.A. +GAME( 1989, dynwarj, dynwar, cps1_10MHz, dynwar, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, willow, 0, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (US)", GAME_SUPPORTS_SAVE ) +GAME( 1989, willowj, willow, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (Japan, Japanese)", GAME_SUPPORTS_SAVE ) // Japan "warning" +GAME( 1989, willowje, willow, cps1_10MHz, willow, cps1, ROT0, "Capcom", "Willow (Japan, English)", GAME_SUPPORTS_SAVE ) // (c) Capcom U.S.A. but Japan "warning" +GAME( 1989, unsquad, 0, cps1_10MHz, unsquad, cps1, ROT0, "Capcom", "U.N. Squadron (US)", GAME_SUPPORTS_SAVE ) +GAME( 1989, area88, unsquad, cps1_10MHz, unsquad, cps1, ROT0, "Capcom", "Area 88 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffight, 0, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (World)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightu, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightua, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US 900112)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightub, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (US 900613)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightj, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightj1, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan 900305)", GAME_SUPPORTS_SAVE ) +GAME( 1989, ffightj2, ffight, cps1_10MHz, ffight, cps1, ROT0, "Capcom", "Final Fight (Japan 900112)", GAME_SUPPORTS_SAVE ) +GAME( 1990, 1941, 0, cps1_10MHz, 1941, cps1, ROT270, "Capcom", "1941 - Counter Attack (World)", GAME_SUPPORTS_SAVE ) +GAME( 1990, 1941j, 1941, cps1_10MHz, 1941, cps1, ROT270, "Capcom", "1941 - Counter Attack (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mercs, 0, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (World 900302)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1990, mercsu, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (US 900302)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mercsua, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Mercs (US 900608)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mercsj, mercs, cps1_10MHz, mercs, cps1, ROT270, "Capcom", "Senjou no Ookami II (Japan 900302)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mtwins, 0, cps1_10MHz, mtwins, cps1, ROT0, "Capcom", "Mega Twins (World 900619)", GAME_SUPPORTS_SAVE ) // "ETC" - (c) Capcom U.S.A. with World "warning" +GAME( 1990, chikij, mtwins, cps1_10MHz, mtwins, cps1, ROT0, "Capcom", "Chiki Chiki Boys (Japan 900619)", GAME_SUPPORTS_SAVE ) +GAME( 1990, msword, 0, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (World 900725)", GAME_SUPPORTS_SAVE ) // 25.07.1990 "Other Country" +GAME( 1990, mswordr1, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (World 900623)", GAME_SUPPORTS_SAVE ) // 23.06.1990 "Other Country" +GAME( 1990, mswordu, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword - Heroic Fantasy (US 900725)", GAME_SUPPORTS_SAVE ) // 25.07.1990 "U.S.A." +GAME( 1990, mswordj, msword, cps1_10MHz, msword, cps1, ROT0, "Capcom", "Magic Sword (Japan 900623)", GAME_SUPPORTS_SAVE ) // 23.06.1990 "Japan" +GAME( 1990, cawing, 0, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (World 901012)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1990, cawingr1, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (World 901009)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1990, cawingu, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "Carrier Air Wing (US 901012)", GAME_SUPPORTS_SAVE ) +GAME( 1990, cawingj, cawing, cps1_10MHz, cawing, cps1, ROT0, "Capcom", "U.S. Navy (Japan 901012)", GAME_SUPPORTS_SAVE ) +GAME( 1990, nemo, 0, cps1_10MHz, nemo, cps1, ROT0, "Capcom", "Nemo (World 901130)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1990, nemoj, nemo, cps1_10MHz, nemo, cps1, ROT0, "Capcom", "Nemo (Japan 901120)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2, 0, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (World 910522)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1991, sf2eb, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (World 910214)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1992, sf2ebbl, sf2, cps1_10MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II - The World Warrior (World 910214, TAB Austria bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ua, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910206)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ub, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910214)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ud, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910318)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ue, sf2, cps1_10MHz, sf2, sf2ue, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910228)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2uf, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910411)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ui, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 910522)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2uk, sf2, cps1_10MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (US 911101)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2j, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 911210)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2ja, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 910214)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2jc, sf2, cps1_10MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II - The World Warrior (Japan 910306)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sf2qp1, sf2, cps1_10MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II - The World Warrior (Quicken Pt-I, bootleg)", GAME_SUPPORTS_SAVE ) // 910214 +GAME( 1991, 3wonders, 0, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Three Wonders (World 910520)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1991, 3wondersu,3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Three Wonders (US 910520)", GAME_SUPPORTS_SAVE ) +GAME( 1991, wonder3, 3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "Capcom", "Wonder 3 (Japan 910520)", GAME_SUPPORTS_SAVE ) +GAME( 1991, 3wondersh,3wonders, cps1_10MHz, 3wonders, cps1, ROT0, "bootleg","Three Wonders (hack?)", GAME_SUPPORTS_SAVE ) +GAME( 1991, kod, 0, cps1_10MHz, kod, cps1, ROT0, "Capcom", "The King of Dragons (World 910711)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1991, kodu, kod, cps1_10MHz, kodj, cps1, ROT0, "Capcom", "The King of Dragons (US 910910)", GAME_SUPPORTS_SAVE ) +GAME( 1991, kodj, kod, cps1_10MHz, kodj, cps1, ROT0, "Capcom", "The King of Dragons (Japan 910805)", GAME_SUPPORTS_SAVE ) +GAME( 1991, captcomm, 0, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (World 911014)", GAME_SUPPORTS_SAVE ) // "OTHER COUNTRY" +GAME( 1991, captcommu,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (US 910928)", GAME_SUPPORTS_SAVE ) +GAME( 1991, captcommj,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "Capcom", "Captain Commando (Japan 911202)", GAME_SUPPORTS_SAVE ) +GAME( 1991, captcommb,captcomm, cps1_10MHz, captcomm, cps1, ROT0, "bootleg","Captain Commando (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1991, knights, 0, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (World 911127)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1991, knightsu, knights, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (US 911127)", GAME_SUPPORTS_SAVE ) +GAME( 1991, knightsj, knights, cps1_10MHz, knights, cps1, ROT0, "Capcom", "Knights of the Round (Japan 911127)", GAME_SUPPORTS_SAVE ) +GAME( 1991, knightsb, knights, knightsb, knights, cps1, ROT0, "bootleg", "Knights of the Round (World 911127, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2ce, 0, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (World 920313)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1992, sf2ceua, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920313)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2ceub, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920513)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2ceuc, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (US 920803)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2cej, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Champion Edition (Japan 920513)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2rb, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 1, bootleg)", GAME_SUPPORTS_SAVE ) // 920322 - based on World version +GAME( 1992, sf2rb2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 2, bootleg)", GAME_SUPPORTS_SAVE ) // 920322 - based on World version +GAME( 1992, sf2rb3, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Rainbow set 3, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2red, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Red Wave, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on World version +GAME( 1992, sf2v004, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II! - Champion Edition (V004, bootleg)", GAME_SUPPORTS_SAVE ) // "102092" !!! - based on (heavily modified) World version +GAME( 1992, sf2acc, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Accelerator!, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on USA version +GAME( 1992, sf2accp2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Accelerator Pt.II, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on USA version +GAME( 1992, sf2dkot2, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (Double K.O. Turbo II, bootleg)", GAME_SUPPORTS_SAVE ) // 902140 - ??? +GAME( 1992, sf2m1, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M1, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m2, sf2ce, cps1_12MHz, sf2m2, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M2, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m3, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "bootleg","Street Fighter II' - Champion Edition (M3, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m4, sf2ce, cps1_12MHz, sf2m4, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M4, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m5, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M5, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m6, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M6, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2m7, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (M7, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2yyc, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (YYC, bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, sf2hack, ROT0, "bootleg","Street Fighter II' - Champion Edition (Xiang Long, Chinese bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2mdt, sf2ce, sf2mdt, sf2hack, sf2mdt, ROT0, "bootleg","Street Fighter II' - Champion Edition (Magic Delta Turbo, bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ); // heavily modified, different sound & gfx hardware +GAME( 1992, varth, 0, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE ) // "ETC" 12MHz verified +GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1992, varthu, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", GAME_SUPPORTS_SAVE ) +GAME( 1992, varthj, varth, cps1_12MHz, varth, cps1, ROT270, "Capcom", "Varth - Operation Thunderstorm (Japan 920714)", GAME_SUPPORTS_SAVE ) +GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps1, ROT0, "Capcom", "Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2hf, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Hyper Fighting (World 921209)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2t, sf2ce, cps1_12MHz, sf2, cps1, ROT0, "Capcom", "Street Fighter II' - Hyper Fighting (US 921209)", GAME_SUPPORTS_SAVE ) +GAME( 1992, sf2tj, sf2ce, cps1_12MHz, sf2j, cps1, ROT0, "Capcom", "Street Fighter II' Turbo - Hyper Fighting (Japan 921209)", GAME_SUPPORTS_SAVE ) +GAME( 1992, qad, 0, cps1_12MHz, qad, cps1, ROT0, "Capcom", "Quiz & Dragons (US 920701)", GAME_SUPPORTS_SAVE ) // 12MHz verified +GAME( 1994, qadj, qad, cps1_12MHz, qadj, cps1, ROT0, "Capcom", "Quiz & Dragons (Japan 940921)", GAME_SUPPORTS_SAVE ) +GAME( 1995, qtono2, 0, cps1_12MHz, qtono2, cps1, ROT0, "Capcom", "Quiz Tonosama no Yabou 2 Zenkoku-ban (Japan 950123)", GAME_SUPPORTS_SAVE ) +GAME( 1995, megaman, 0, cps1_12MHz, megaman, cps1, ROT0, "Capcom", "Mega Man - The Power Battle (CPS1 Asia 951006)", GAME_SUPPORTS_SAVE ) +GAME( 1995, rockmanj, megaman, cps1_12MHz, rockmanj, cps1, ROT0, "Capcom", "Rockman - The Power Battle (CPS1 Japan 950922)", GAME_SUPPORTS_SAVE ) +GAME( 1992, wof, 0, qsound, wof, wof, ROT0, "Capcom", "Warriors of Fate (World 921002)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1992, wofa, wof, qsound, wof, wof, ROT0, "Capcom", "Sangokushi II (Asia 921005)", GAME_SUPPORTS_SAVE ) // World "warning" +GAME( 1992, wofu, wof, qsound, wof, wof, ROT0, "Capcom", "Warriors of Fate (US 921031)", GAME_SUPPORTS_SAVE ) // World "warning" +GAME( 1992, wofj, wof, qsound, wof, wof, ROT0, "Capcom", "Tenchi wo Kurau II - Sekiheki no Tatakai (Japan 921031)", GAME_SUPPORTS_SAVE ) +GAME( 1999, wofhfh, wof, wofhfh, wofhfh, cps1, ROT0, "bootleg","Sangokushi II: Huo Fenghuang (Chinese bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1993, dino, 0, qsound, dino, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (World 930201)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1993, dinou, dino, qsound, dino, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (US 930201)", GAME_SUPPORTS_SAVE ) +GAME( 1993, dinoj, dino, qsound, dino, dino, ROT0, "Capcom", "Cadillacs Kyouryuu-Shinseiki (Japan 930201)", GAME_SUPPORTS_SAVE ) +GAME( 1993, dinopic, dino, cpspicb, dinopic, dino, ROT0, "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 1)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1993, dinopic2, dino, cpspicb, dinopic, dino, ROT0, "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1993, punisher, 0, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (World 930422)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1993, punisheru,punisher, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (US 930422)", GAME_SUPPORTS_SAVE ) +GAME( 1993, punisherj,punisher, qsound, punisher, punisher, ROT0, "Capcom", "The Punisher (Japan 930422)", GAME_SUPPORTS_SAVE ) +GAME( 1993, punipic, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 1)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1993, punipic2, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1993, punipic3, punisher, cpspicb, punipic, punisher, ROT0, "Capcom", "The Punisher (bootleg with PIC16c57, set 3)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) -GAME( 1993, slammast, 0, qsound, slammast, slammast, ROT0, "Capcom", "Saturday Night Slam Masters (World 930713)" , 0) // "ETC" -GAME( 1993, slammastu,slammast, qsound, slammast, slammast, ROT0, "Capcom", "Saturday Night Slam Masters (US 930713)", 0 ) -GAME( 1993, mbomberj, slammast, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber - The Body Explosion (Japan 930713)", 0 ) -GAME( 1993, mbombrd, 0, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber Duo - Ultimate Team Battle (World 931206)" , 0) // "ETC" -GAME( 1993, mbombrdj, mbombrd, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber Duo - Heat Up Warriors (Japan 931206)", 0 ) +GAME( 1993, slammast, 0, qsound, slammast, slammast, ROT0, "Capcom", "Saturday Night Slam Masters (World 930713)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1993, slammastu,slammast, qsound, slammast, slammast, ROT0, "Capcom", "Saturday Night Slam Masters (US 930713)", GAME_SUPPORTS_SAVE ) +GAME( 1993, mbomberj, slammast, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber - The Body Explosion (Japan 930713)", GAME_SUPPORTS_SAVE ) +GAME( 1993, mbombrd, 0, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber Duo - Ultimate Team Battle (World 931206)", GAME_SUPPORTS_SAVE ) // "ETC" +GAME( 1993, mbombrdj, mbombrd, qsound, slammast, slammast, ROT0, "Capcom", "Muscle Bomber Duo - Heat Up Warriors (Japan 931206)", GAME_SUPPORTS_SAVE ) -GAME( 1994, pnickj, 0, cps1_12MHz, pnickj, cps1, ROT0, "Compile (Capcom license)", "Pnickies (Japan 940608)", 0 ) +GAME( 1994, pnickj, 0, cps1_12MHz, pnickj, cps1, ROT0, "Compile (Capcom license)", "Pnickies (Japan 940608)", GAME_SUPPORTS_SAVE ) /* Japanese version of Pang 3 is encrypted, Euro version is not */ -GAME( 1995, pang3, 0, pang3, pang3, pang3, ROT0, "Mitchell", "Pang! 3 (Euro 950511)", 0 ) -GAME( 1995, pang3j, pang3, pang3, pang3, pang3j, ROT0, "Mitchell", "Pang! 3 (Japan 950511)", 0 ) +GAME( 1995, pang3, 0, pang3, pang3, pang3, ROT0, "Mitchell", "Pang! 3 (Euro 950511)", GAME_SUPPORTS_SAVE ) +GAME( 1995, pang3j, pang3, pang3, pang3, pang3j, ROT0, "Mitchell", "Pang! 3 (Japan 950511)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c index a92e2edff53..5bb318b148f 100644 --- a/src/mame/drivers/cps2.c +++ b/src/mame/drivers/cps2.c @@ -591,18 +591,7 @@ Stephh's inputs notes (based on some tests on the "parent" set) : #include "sound/qsound.h" #include "sound/okim6295.h" // gigamn2 bootleg -#include "cps1.h" /* External CPS1 definitions */ - -/* -Export this function so that the video routine can drive the -Q-Sound hardware -*/ -#ifdef UNUSED_FUNCTION -WRITE16_HANDLER( cps2_qsound_sharedram_w ) -{ - qsound_sharedram1_w(offset/2, data, 0xff00); -} -#endif +#include "includes/cps1.h" /* External CPS1 definitions */ /************************************* @@ -619,16 +608,6 @@ WRITE16_HANDLER( cps2_qsound_sharedram_w ) #define CODE_SIZE 0x0400000 -/************************************* - * - * Global variables - * - *************************************/ - -static int readpaddle; -static int cps2networkpresent; - - /************************************* * * Interrupt generation @@ -637,59 +616,59 @@ static int cps2networkpresent; static INTERRUPT_GEN( cps2_interrupt ) { - static int scancount; + cps_state *state = (cps_state *)device->machine->driver_data; /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */ - - if(scancount >= 258) + if (state->scancount >= 258) { - scancount = -1; - cps1_scancalls = 0; + state->scancount = -1; + state->scancalls = 0; } - scancount++; + state->scancount++; - if (cps1_cps_b_regs[0x10/2] & 0x8000) - cps1_cps_b_regs[0x10/2] = cps1_cps_b_regs[0x10/2] & 0x1ff; - if (cps1_cps_b_regs[0x12/2] & 0x8000) - cps1_cps_b_regs[0x12/2] = cps1_cps_b_regs[0x12/2] & 0x1ff; + if (state->cps_b_regs[0x10 / 2] & 0x8000) + state->cps_b_regs[0x10 / 2] &= 0x1ff; -// popmessage("%04x %04x - %04x %04x",cps1_scanline1,cps1_scanline2,cps1_cps_b_regs[0x10/2],cps1_cps_b_regs[0x12/2]); + if (state->cps_b_regs[0x12 / 2] & 0x8000) + state->cps_b_regs[0x12 / 2] &= 0x1ff; + +// popmessage("%04x %04x - %04x %04x",state->scanline1,state->scanline2,state->cps_b_regs[0x10/2],state->cps_b_regs[0x12/2]); /* raster effects */ - if(cps1_scanline1 == scancount || (cps1_scanline1 < scancount && !cps1_scancalls)) + if (state->scanline1 == state->scancount || (state->scanline1 < state->scancount && !state->scancalls)) { - cps1_cps_b_regs[0x10/2] = 0; + state->cps_b_regs[0x10/2] = 0; cpu_set_input_line(device, 4, HOLD_LINE); - cps2_set_sprite_priorities(); - video_screen_update_partial(device->machine->primary_screen, 16 - 10 + scancount); /* visarea.min_y - [first visible line?] + scancount */ - cps1_scancalls++; -// popmessage("IRQ4 scancounter = %04i",scancount); + cps2_set_sprite_priorities(device->machine); + video_screen_update_partial(device->machine->primary_screen, 16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */ + state->scancalls++; +// popmessage("IRQ4 scancounter = %04i", state->scancount); } /* raster effects */ - if(cps1_scanline2 == scancount || (cps1_scanline2 < scancount && !cps1_scancalls)) + if(state->scanline2 == state->scancount || (state->scanline2 < state->scancount && !state->scancalls)) { - cps1_cps_b_regs[0x12/2] = 0; + state->cps_b_regs[0x12 / 2] = 0; cpu_set_input_line(device, 4, HOLD_LINE); - cps2_set_sprite_priorities(); - video_screen_update_partial(device->machine->primary_screen, 16 - 10 + scancount); /* visarea.min_y - [first visible line?] + scancount */ - cps1_scancalls++; + cps2_set_sprite_priorities(device->machine); + video_screen_update_partial(device->machine->primary_screen, 16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */ + state->scancalls++; // popmessage("IRQ4 scancounter = %04i",scancount); } - if(scancount == 240) /* VBlank */ + if (state->scancount == 240) /* VBlank */ { - cps1_cps_b_regs[0x10/2] = cps1_scanline1; - cps1_cps_b_regs[0x12/2] = cps1_scanline2; + state->cps_b_regs[0x10 / 2] = state->scanline1; + state->cps_b_regs[0x12 / 2] = state->scanline2; cpu_set_input_line(device, 2, HOLD_LINE); - if(cps1_scancalls) + if(state->scancalls) { - cps2_set_sprite_priorities(); + cps2_set_sprite_priorities(device->machine); video_screen_update_partial(device->machine->primary_screen, 256); } - cps2_objram_latch(); + cps2_objram_latch(device->machine); } - //popmessage("Raster calls = %i",cps1_scancalls); + //popmessage("Raster calls = %i", state->scancalls); } @@ -710,6 +689,8 @@ static const eeprom_interface cps2_eeprom_interface = static WRITE16_HANDLER( cps2_eeprom_port_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; + if (ACCESSING_BITS_8_15) { /* bit 0 - Unused */ @@ -737,40 +718,40 @@ static WRITE16_HANDLER( cps2_eeprom_port_w ) /* bit 7 - */ /* Z80 Reset */ - if (cputag_get_cpu(space->machine, "audiocpu")) - cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE); + if (state->audiocpu != NULL) + cpu_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE); coin_counter_w(space->machine, 0, data & 0x0001); - if( (strncmp(space->machine->gamedrv->name,"pzloop2",8)==0) || - (strncmp(space->machine->gamedrv->name,"pzloop2j",8)==0) ) + if ((strncmp(space->machine->gamedrv->name, "pzloop2", 8) == 0) || + (strncmp(space->machine->gamedrv->name, "pzloop2j", 8) == 0)) { // Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls - readpaddle = data & 0x0002; + state->readpaddle = data & 0x0002; } else { coin_counter_w(space->machine, 1, data & 0x0002); } - if(strncmp(space->machine->gamedrv->name,"mmatrix",7)==0) // Mars Matrix seems to require the coin lockout bit to be reversed + if (strncmp(space->machine->gamedrv->name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed { - coin_lockout_w(space->machine, 0,data & 0x0010); - coin_lockout_w(space->machine, 1,data & 0x0020); - coin_lockout_w(space->machine, 2,data & 0x0040); - coin_lockout_w(space->machine, 3,data & 0x0080); + coin_lockout_w(space->machine, 0, data & 0x0010); + coin_lockout_w(space->machine, 1, data & 0x0020); + coin_lockout_w(space->machine, 2, data & 0x0040); + coin_lockout_w(space->machine, 3, data & 0x0080); } else { - coin_lockout_w(space->machine, 0,~data & 0x0010); - coin_lockout_w(space->machine, 1,~data & 0x0020); - coin_lockout_w(space->machine, 2,~data & 0x0040); - coin_lockout_w(space->machine, 3,~data & 0x0080); + coin_lockout_w(space->machine, 0, ~data & 0x0010); + coin_lockout_w(space->machine, 1, ~data & 0x0020); + coin_lockout_w(space->machine, 2, ~data & 0x0040); + coin_lockout_w(space->machine, 3, ~data & 0x0080); } /* - set_led_status(space->machine, 0,data & 0x01); - set_led_status(space->machine, 1,data & 0x10); - set_led_status(space->machine, 2,data & 0x20); + set_led_status(space->machine, 0, data & 0x01); + set_led_status(space->machine, 1, data & 0x10); + set_led_status(space->machine, 2, data & 0x20); */ } } @@ -784,11 +765,13 @@ static WRITE16_HANDLER( cps2_eeprom_port_w ) static READ16_HANDLER( cps2_qsound_volume_r ) { + cps_state *state = (cps_state *)space->machine->driver_data; + /* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */ /* Network adapter (ssf2tb) present when bit 15 = 0 */ /* Only game known to use both these so far is SSF2TB */ - if(cps2networkpresent) + if (state->cps2networkpresent) return 0x2021; else return 0xe021; @@ -808,7 +791,9 @@ static READ16_HANDLER( kludge_r ) static READ16_HANDLER( joy_or_paddle_r ) { - if (readpaddle != 0) + cps_state *state = (cps_state *)space->machine->driver_data; + + if (state->readpaddle != 0) return (input_port_read(space->machine, "IN0")); else return (input_port_read(space->machine, "PADDLE1") & 0xff) | (input_port_read(space->machine, "PADDLE2") << 8); @@ -823,20 +808,20 @@ static READ16_HANDLER( joy_or_paddle_r ) static ADDRESS_MAP_START( cps2_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x3fffff) AM_ROM /* 68000 ROM */ - AM_RANGE(0x400000, 0x40000b) AM_RAM AM_BASE(&cps2_output) AM_SIZE(&cps2_output_size) /* CPS2 object output */ + AM_RANGE(0x400000, 0x40000b) AM_RAM AM_BASE_SIZE_MEMBER(cps_state, output, output_size) /* CPS2 object output */ AM_RANGE(0x618000, 0x619fff) AM_READWRITE(qsound_sharedram1_r, qsound_sharedram1_w) /* Q RAM */ AM_RANGE(0x662000, 0x662001) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x662008, 0x662009) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x662020, 0x662021) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x660000, 0x663fff) AM_RAM /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */ AM_RANGE(0x664000, 0x664001) AM_RAM /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */ - AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE(&cps2_objram1) /* Object RAM, no game seems to use it directly */ - AM_RANGE(0x708000, 0x709fff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* Object RAM */ - AM_RANGE(0x70a000, 0x70bfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x70c000, 0x70dfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x70e000, 0x70ffff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* mirror (sfa) */ - AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) /* mirror (sfa) */ + AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE_MEMBER(cps_state, objram1) /* Object RAM, no game seems to use it directly */ + AM_RANGE(0x708000, 0x709fff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* Object RAM */ + AM_RANGE(0x70a000, 0x70bfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x70c000, 0x70dfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x70e000, 0x70ffff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* mirror (sfa) */ + AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE_MEMBER(cps_state, cps_b_regs) /* mirror (sfa) */ AM_RANGE(0x804000, 0x804001) AM_READ_PORT("IN0") /* IN0 */ AM_RANGE(0x804010, 0x804011) AM_READ_PORT("IN1") /* IN1 */ AM_RANGE(0x804020, 0x804021) AM_READ_PORT("IN2") /* IN2 + EEPROM */ @@ -845,29 +830,29 @@ static ADDRESS_MAP_START( cps2_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x8040a0, 0x8040a1) AM_WRITENOP /* Unknown (reset once on startup) */ AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r) /* unknown (xmcotaj hangs if this is 0) */ AM_RANGE(0x8040e0, 0x8040e1) AM_WRITE(cps2_objram_bank_w) /* bit 0 = Object ram bank swap */ - AM_RANGE(0x804100, 0x80413f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x804100, 0x80413f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ AM_RANGE(0x804140, 0x80417f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) /* CPS-B custom */ - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* Video RAM */ + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) /* Video RAM */ AM_RANGE(0xff0000, 0xffffff) AM_RAM /* RAM */ ADDRESS_MAP_END static ADDRESS_MAP_START( dead_cps2_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x3fffff) AM_ROM /* 68000 ROM */ - AM_RANGE(0x400000, 0x40000b) AM_RAM AM_BASE(&cps2_output) AM_SIZE(&cps2_output_size) /* CPS2 object output */ + AM_RANGE(0x400000, 0x40000b) AM_RAM AM_BASE_SIZE_MEMBER(cps_state, output, output_size) /* CPS2 object output */ AM_RANGE(0x618000, 0x619fff) AM_READWRITE(qsound_sharedram1_r, qsound_sharedram1_w) /* Q RAM */ AM_RANGE(0x662000, 0x662001) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x662008, 0x662009) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x662020, 0x662021) AM_RAM /* Network adapter related, accessed in SSF2TB */ AM_RANGE(0x660000, 0x663fff) AM_RAM /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */ AM_RANGE(0x664000, 0x664001) AM_RAM /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */ - AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE(&cps2_objram1) /* Object RAM, no game seems to use it directly */ - AM_RANGE(0x708000, 0x709fff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* Object RAM */ - AM_RANGE(0x70a000, 0x70bfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x70c000, 0x70dfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x70e000, 0x70ffff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE(&cps2_objram2) /* mirror */ - AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* mirror (sfa) */ - AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) /* mirror (sfa) */ + AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE_MEMBER(cps_state, objram1) /* Object RAM, no game seems to use it directly */ + AM_RANGE(0x708000, 0x709fff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* Object RAM */ + AM_RANGE(0x70a000, 0x70bfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x70c000, 0x70dfff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x70e000, 0x70ffff) AM_READWRITE(cps2_objram2_r, cps2_objram2_w) AM_BASE_MEMBER(cps_state, objram2) /* mirror */ + AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* mirror (sfa) */ + AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE_MEMBER(cps_state, cps_b_regs) /* mirror (sfa) */ AM_RANGE(0x804000, 0x804001) AM_READ_PORT("IN0") /* IN0 */ AM_RANGE(0x804010, 0x804011) AM_READ_PORT("IN1") /* IN1 */ AM_RANGE(0x804020, 0x804021) AM_READ_PORT("IN2") /* IN2 + EEPROM */ @@ -876,11 +861,11 @@ static ADDRESS_MAP_START( dead_cps2_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x8040a0, 0x8040a1) AM_WRITENOP /* Unknown (reset once on startup) */ AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r) /* unknown (xmcotaj hangs if this is 0) */ AM_RANGE(0x8040e0, 0x8040e1) AM_WRITE(cps2_objram_bank_w) /* bit 0 = Object ram bank swap */ - AM_RANGE(0x804100, 0x80413f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x804100, 0x80413f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ AM_RANGE(0x804140, 0x80417f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) /* CPS-B custom */ - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* Video RAM */ + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) /* Video RAM */ AM_RANGE(0xff0000, 0xffffef) AM_RAM /* RAM */ - AM_RANGE(0xfffff0, 0xfffffb) AM_RAM AM_BASE(&cps2_output) AM_SIZE(&cps2_output_size) /* CPS2 output */ + AM_RANGE(0xfffff0, 0xfffffb) AM_RAM AM_BASE_SIZE_MEMBER(cps_state, output, output_size) /* CPS2 output */ ADDRESS_MAP_END @@ -892,7 +877,7 @@ ADDRESS_MAP_END /* 4 players and 4 buttons */ static INPUT_PORTS_START( cps2_4p4b ) - PORT_START("IN0") /* IN0 (0x00) */ + PORT_START("IN0") /* (0x00) */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -910,7 +895,7 @@ static INPUT_PORTS_START( cps2_4p4b ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) - PORT_START("IN1") /* IN1 (0x10) */ + PORT_START("IN1") /* (0x10) */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) @@ -928,7 +913,7 @@ static INPUT_PORTS_START( cps2_4p4b ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) - PORT_START("IN2") /* IN2 (0x20) */ + PORT_START("IN2") /* (0x20) */ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -1198,8 +1183,22 @@ GFXDECODE_END * *************************************/ +static MACHINE_START( cps2 ) +{ + cps_state *state = (cps_state *)machine->driver_data; + + state->maincpu = devtag_get_device(machine, "maincpu"); + state->audiocpu = devtag_get_device(machine, "audiocpu"); + + state_save_register_global(machine, state->scancount); +} + + static MACHINE_DRIVER_START( cps2 ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, XTAL_16MHz) MDRV_CPU_PROGRAM_MAP(cps2_map) @@ -1209,6 +1208,8 @@ static MACHINE_DRIVER_START( cps2 ) MDRV_CPU_PROGRAM_MAP(qsound_sub_map) MDRV_CPU_PERIODIC_INT(irq0_line_hold, 251) /* 251 is good (see 'mercy mercy mercy'section of sgemf attract mode for accurate sound sync */ + MDRV_MACHINE_START(cps2) + MDRV_EEPROM_NODEFAULT_ADD("eeprom", cps2_eeprom_interface) /* video hardware */ @@ -7550,52 +7551,80 @@ ROM_END /************************************* * - * Games initialisation + * Games initialization * *************************************/ static DRIVER_INIT( cps2 ) { + cps_state *state = (cps_state *)machine->driver_data; + /* Decrypt the game - see machine/cps2crpt.c */ DRIVER_INIT_CALL(cps2crpt); - cps2networkpresent = 0; + + /* Initialize some video elements */ + DRIVER_INIT_CALL(cps2_video); + + state->scancount = 0; + state->cps2networkpresent = 0; cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */ } static DRIVER_INIT( ssf2tb ) { + cps_state *state = (cps_state *)machine->driver_data; + DRIVER_INIT_CALL(cps2); - cps2networkpresent = 0; + + state->cps2networkpresent = 0; /* we don't emulate the network board, so don't say it's present for now, otherwise the game will attempt to boot in tournament mode and fail */ - //cps2networkpresent = 1; + //state->cps2networkpresent = 1; } static DRIVER_INIT ( pzloop2 ) { + cps_state *state = (cps_state *)machine->driver_data; + DRIVER_INIT_CALL(cps2); + + state->readpaddle = 0; + + state_save_register_global(machine, state->readpaddle); + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x804000, 0x804001, 0, 0, joy_or_paddle_r); } -static UINT16* gigamn2_dummyqsound_ram; -static READ16_HANDLER( gigamn2_dummyqsound_r ) { return gigamn2_dummyqsound_ram[offset]; }; -static WRITE16_HANDLER( gigamn2_dummyqsound_w ) { gigamn2_dummyqsound_ram[offset] = data; }; +static READ16_HANDLER( gigamn2_dummyqsound_r ) +{ + cps_state *state = (cps_state *)space->machine->driver_data; + return state->gigamn2_dummyqsound_ram[offset]; +}; + +static WRITE16_HANDLER( gigamn2_dummyqsound_w ) +{ + cps_state *state = (cps_state *)space->machine->driver_data; + state->gigamn2_dummyqsound_ram[offset] = data; +}; static DRIVER_INIT( gigamn2 ) { + cps_state *state = (cps_state *)machine->driver_data; const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); int length = memory_region_length(machine, "maincpu"); DRIVER_INIT_CALL(cps2); - gigamn2_dummyqsound_ram = auto_alloc_array(machine, UINT16, 0x20000/2); + state->gigamn2_dummyqsound_ram = auto_alloc_array(machine, UINT16, 0x20000 / 2); + state_save_register_global_pointer(machine, state->gigamn2_dummyqsound_ram, 0x20000 / 2); + memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x618000, 0x619fff, 0, 0, gigamn2_dummyqsound_r, gigamn2_dummyqsound_w); // no qsound.. memory_set_decrypted_region(space, 0x000000, (length) - 1, &rom[length/4]); - m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, "maincpu"), 0, length); + m68k_set_encrypted_opcode_range(state->maincpu, 0, length); } @@ -7605,234 +7634,234 @@ static DRIVER_INIT( gigamn2 ) * *************************************/ -GAME( 1993, ssf2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (World 930911)", 0 ) -GAME( 1993, ssf2u, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (USA 930911)", 0 ) -GAME( 1993, ssf2a, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Asia 931005)", 0 ) -GAME( 1993, ssf2ar1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Asia 930914)", 0 ) -GAME( 1993, ssf2j, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 931005)", 0 ) -GAME( 1993, ssf2jr1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 930911)", 0 ) -GAME( 1993, ssf2jr2, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 930910)", 0 ) -GAME( 1993, ssf2h, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Hispanic 930911)", 0 ) -GAME( 1993, ssf2tb, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 931119)", 0 ) // works, but not in tournament mode -GAME( 1993, ssf2tbr1, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 930911)", 0 ) // works, but not in tournament mode -GAME( 1993, ssf2tbj, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (Japan 930911)", 0 ) // works, but not in tournament mode -GAME( 1993, ecofghtr, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (World 931203)", 0 ) -GAME( 1993, ecofghtru,ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (USA 940215)", 0 ) -GAME( 1993, ecofghtru1,ecofghtr,cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (USA 931203)", 0 ) -GAME( 1993, uecology, ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Ultimate Ecology (Japan 931203)", 0 ) -GAME( 1993, ecofghtra,ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (Asia 931203)", 0 ) -GAME( 1993, ddtod, 0, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940412)", 0 ) -GAME( 1993, ddtodr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", 0 ) -GAME( 1993, ddtodu, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", 0 ) -GAME( 1993, ddtodur1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940113)", 0 ) -GAME( 1993, ddtodj, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940412)", 0 ) -GAME( 1993, ddtodjr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", 0 ) -GAME( 1993, ddtodjr2, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 ) -GAME( 1993, ddtoda, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", 0 ) -GAME( 1993, ddtodh, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940412)", 0 ) -GAME( 1993, ddtodhr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", 0 ) -GAME( 1994, ssf2t, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (World 940223)", 0 ) -GAME( 1994, ssf2ta, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (Asia 940223)", 0 ) -GAME( 1994, ssf2tu, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (USA 940323)", 0 ) -GAME( 1994, ssf2tur1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (USA 940223)", 0 ) -GAME( 1994, ssf2xj, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II X: Grand Master Challenge (Japan 940223)", 0 ) -GAME( 1994, avsp, 0, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Euro 940520)", 0 ) -GAME( 1994, avspu, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (USA 940520)", 0 ) -GAME( 1994, avspj, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Japan 940520)", 0 ) -GAME( 1994, avspa, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Asia 940520)", 0 ) -GAME( 1994, avsph, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Hispanic 940520)", 0 ) -GAME( 1994, dstlk, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Euro 940705)", 0 ) -GAME( 1994, dstlku, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (USA 940818)", 0 ) -GAME( 1994, dstlkur1, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (USA 940705)", 0 ) -GAME( 1994, dstlka, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Asia 940705)", 0 ) -GAME( 1994, dstlkh, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Hispanic 940818)", 0 ) -GAME( 1994, vampj, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940705)", 0 ) // partial update set? Only rom 04 is "B" revision -GAME( 1994, vampja, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940705 alt)", 0 ) -GAME( 1994, vampjr1, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940630)", 0 ) -GAME( 1994, ringdest, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", 0 ) -GAME( 1994, smbomb, ringdest, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940831)", 0 ) -GAME( 1994, smbombr1, ringdest, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940808)", 0 ) -GAME( 1994, armwar, 0, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Euro 941024)", 0 ) -GAME( 1994, armwarr1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Euro 941011)", 0 ) -GAME( 1994, armwaru, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (USA 941024)", 0 ) -GAME( 1994, armwaru1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (USA 940920)", 0 ) -GAME( 1994, pgear, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", 0 ) -GAME( 1994, pgearr1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", 0 ) -GAME( 1994, armwara, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Asia 940920)", 0 ) -GAME( 1994, xmcota, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Euro 950105)", 0 ) -GAME( 1994, xmcotau, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (USA 950105)", 0 ) -GAME( 1994, xmcotah, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", 0 ) -GAME( 1994, xmcotaj, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941222)", 0 ) -GAME( 1994, xmcotaj1, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941219)", 0 ) -GAME( 1994, xmcotaj2, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941217)", 0 ) -GAME( 1994, xmcotajr, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", 0 ) -GAME( 1994, xmcotaa, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Asia 941217)", 0 ) -GAME( 1995, nwarr, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", 0 ) -GAME( 1995, nwarru, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", 0 ) -GAME( 1995, nwarrh, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", 0 ) -GAME( 1995, nwarrb, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Brazil 950403)", 0 ) -GAME( 1995, nwarra, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Asia 950302)", 0 ) -GAME( 1995, vhuntj, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", 0 ) -GAME( 1995, vhuntjr1, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", 0 ) -GAME( 1995, vhuntjr2, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", 0 ) -GAME( 1995, cybots, 0, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", 0 ) -GAME( 1995, cybotsu, cybots, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", 0 ) -GAME( 1995, cybotsj, cybots, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", 0 ) -GAME( 1995, sfa, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950727)", 0 ) -GAME( 1995, sfar1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950718)", 0 ) -GAME( 1995, sfar2, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950627)", 0 ) -GAME( 1995, sfar3, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950605)", 0 ) -GAME( 1995, sfau, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (USA 950627)", 0 ) -GAME( 1995, sfza, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Asia 950627)", 0 ) -GAME( 1995, sfzj, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950727)", 0 ) -GAME( 1995, sfzjr1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950627)", 0 ) -GAME( 1995, sfzjr2, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950605)", 0 ) -GAME( 1995, sfzh, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Hispanic 950627)", 0 ) -GAME( 1995, sfzb, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Brazil 951109)", 0 ) -GAME( 1995, sfzbr1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Brazil 950727)", 0 ) -GAME( 1995, mmancp2u, megaman, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", 0 ) -GAME( 1995, rmancp2j, megaman, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Rockman: The Power Battle (CPS2, Japan 950922)", 0 ) -GAME( 1995, msh, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Euro 951024)", 0 ) -GAME( 1995, mshu, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (USA 951024)", 0 ) -GAME( 1995, mshj, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Japan 951117)", 0 ) -GAME( 1995, mshjr1, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Japan 951024)", 0 ) -GAME( 1995, msha, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Asia 951024)", 0 ) -GAME( 1995, mshh, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Hispanic 951117)", 0 ) -GAME( 1995, mshb, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Brazil 951117)", 0 ) -GAME( 1996, 19xx, 0, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (USA 951207)", 0 ) -GAME( 1996, 19xxa, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Asia 951207)", 0 ) -GAME( 1996, 19xxj, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951225)", 0 ) -GAME( 1996, 19xxjr1, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951207)", 0 ) -GAME( 1996, 19xxh, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Hispanic 951218)", 0 ) -GAME( 1996, 19xxb, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Brazil 951218)", 0 ) -GAME( 1996, ddsom, 0, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960619)", 0 ) -GAME( 1996, ddsomr1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960223)", 0 ) -GAME( 1996, ddsomr2, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960209)", 0 ) -GAME( 1996, ddsomr3, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960208)", 0 ) -GAME( 1996, ddsomu, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960619)", 0 ) -GAME( 1996, ddsomur1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960209)", 0 ) -GAME( 1996, ddsomj, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960619)", 0 ) -GAME( 1996, ddsomjr1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", 0 ) -GAME( 1996, ddsoma, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", 0 ) -GAME( 1996, ddsomh, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Hispanic 960223)", 0 ) -GAME( 1996, ddsomb, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Brazil 960223)", 0 ) -GAME( 1996, sfa2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 2 (Euro 960229)", 0 ) -GAME( 1996, sfa2u, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 2 (USA 960306)", 0 ) -GAME( 1996, sfz2j, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Japan 960227)", 0 ) -GAME( 1996, sfz2a, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Asia 960227)", 0 ) -GAME( 1996, sfz2b, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Brazil 960531)", 0 ) -GAME( 1996, sfz2br1, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Brazil 960304)", 0 ) -GAME( 1996, sfz2h, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Hispanic 960304)", 0 ) -GAME( 1996, sfz2n, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Oceania 960229)", 0 ) -GAME( 1996, sfz2al, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Asia 960826)", 0 ) -GAME( 1996, sfz2alj, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Japan 960805)", 0 ) -GAME( 1996, sfz2alh, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Hispanic 960813)", 0 ) -GAME( 1996, sfz2alb, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Brazil 960813)", 0 ) -GAME( 1996, spf2t, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", 0 ) -GAME( 1996, spf2xj, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II X (Japan 960531)", 0 ) -GAME( 1996, spf2ta, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", 0 ) -GAME( 1996, spf2th, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Hispanic 960531)", 0 ) -GAME( 1996, megaman2, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", 0 ) -GAME( 1996, megaman2a,megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", 0 ) -GAME( 1996, rockman2j,megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", 0 ) -GAME( 1996, megaman2h,megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (Hispanic 960712)", 0 ) -GAME( 1996, qndream, 0, cps2, qndream, cps2, ROT0, "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", 0 ) -GAME( 1996, xmvsf, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Euro 961004)", 0 ) -GAME( 1996, xmvsfr1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", 0 ) -GAME( 1996, xmvsfu, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961023)", 0 ) -GAME( 1996, xmvsfur1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961004)", 0 ) -GAME( 1996, xmvsfj, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 961004)", 0 ) -GAME( 1996, xmvsfjr1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960910)", 0 ) -GAME( 1996, xmvsfjr2, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960909)", 0 ) -GAME( 1996, xmvsfa, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Asia 961023)", 0 ) -GAME( 1996, xmvsfar1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Asia 960919)", 0 ) -GAME( 1996, xmvsfh, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Hispanic 961004)", 0 ) -GAME( 1996, xmvsfb, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Brazil 961023)", 0 ) -GAME( 1997, batcir, 0, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Euro 970319)", 0 ) -GAME( 1997, batcira, batcir, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Asia 970319)", 0 ) -GAME( 1997, batcirj, batcir, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Japan 970319)", 0 ) -GAME( 1997, vsav, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", 0 ) -GAME( 1997, vsavu, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", 0 ) -GAME( 1997, vsavj, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", 0 ) -GAME( 1997, vsava, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", 0 ) -GAME( 1997, vsavh, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", 0 ) -GAME( 1997, mshvsf, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Euro 970625)", 0 ) -GAME( 1997, mshvsfu, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970827)", 0 ) -GAME( 1997, mshvsfu1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970625)", 0 ) -GAME( 1997, mshvsfj, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970707)", 0 ) -GAME( 1997, mshvsfj1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970702)", 0 ) -GAME( 1997, mshvsfj2, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970625)", 0 ) -GAME( 1997, mshvsfh, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Hispanic 970625)", 0 ) -GAME( 1997, mshvsfa, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970625)", 0 ) -GAME( 1997, mshvsfa1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", 0 ) -GAME( 1997, mshvsfb, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", 0 ) -GAME( 1997, mshvsfb1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", 0 ) -GAME( 1997, csclub, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Euro 971017)", 0 ) -GAME( 1997, csclub1, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Euro 970722)", 0 ) -GAME( 1997, cscluba, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Asia 970722)", 0 ) -GAME( 1997, csclubj, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Japan 970722)", 0 ) -GAME( 1997, csclubh, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 ) -GAME( 1997, sgemf, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter Mini Mix (USA 970904)", 0 ) -GAME( 1997, pfghtj, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Pocket Fighter (Japan 970904)", 0 ) -GAME( 1997, sgemfa, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter: Mini Mix (Asia 970904)", 0 ) -GAME( 1997, sgemfh, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter: Mini Mix (Hispanic 970904)", 0 ) -GAME( 1997, vhunt2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", 0 ) -GAME( 1997, vhunt2r1, vhunt2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", 0 ) -GAME( 1997, vsav2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", 0 ) -GAME( 1998, mvsc, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980123)", 0 ) -GAME( 1998, mvscr1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 ) -GAME( 1998, mvscu, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", 0 ) -GAME( 1998, mvscj, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980123)", 0 ) -GAME( 1998, mvscjr1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980112)", 0 ) -GAME( 1998, mvsca, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980123)", 0 ) -GAME( 1998, mvscar1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980112)", 0 ) -GAME( 1998, mvsch, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Hispanic 980123)", 0 ) -GAME( 1998, mvscb, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Brazil 980123)", 0 ) -GAME( 1998, sfa3, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Euro 980904)", 0 ) -GAME( 1998, sfa3u, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980904)", 0 ) -GAME( 1998, sfa3ur1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980629)", 0 ) -GAME( 1998, sfa3b, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Brazil 980629)", 0 ) -GAME( 1998, sfz3j, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980904)", 0 ) -GAME( 1998, sfz3jr1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980727)", 0 ) -GAME( 1998, sfz3jr2, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980629)", 0 ) -GAME( 1998, sfz3a, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Asia 980904)", 0 ) -GAME( 1998, sfz3ar1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Asia 980701)", 0 ) -GAME( 1999, jyangoku, 0, cps2, cps2_1p2b, cps2, ROT0, "Capcom", "Jyangokushi: Haoh no Saihai (Japan 990527)", 0 ) -GAME( 2004, hsf2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Asia 040202)", 0 ) -GAME( 2004, hsf2j, hsf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Japan 031222)", 0 ) +GAME( 1993, ssf2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (World 930911)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2u, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (USA 930911)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2a, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Asia 931005)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2ar1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Asia 930914)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2j, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 931005)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2jr1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 930911)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2jr2, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Japan 930910)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2h, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II: The New Challengers (Hispanic 930911)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2tb, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 931119)", GAME_SUPPORTS_SAVE ) // works, but not in tournament mode +GAME( 1993, ssf2tbr1, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 930911)", GAME_SUPPORTS_SAVE ) // works, but not in tournament mode +GAME( 1993, ssf2tbj, ssf2, cps2, cps2_2p6b, ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (Japan 930911)", GAME_SUPPORTS_SAVE ) // works, but not in tournament mode +GAME( 1993, ecofghtr, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (World 931203)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ecofghtru, ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (USA 940215)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ecofghtru1, ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (USA 931203)", GAME_SUPPORTS_SAVE ) +GAME( 1993, uecology, ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Ultimate Ecology (Japan 931203)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ecofghtra, ecofghtr, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Eco Fighters (Asia 931203)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtod, 0, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940412)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodu, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodur1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940113)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodj, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940412)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodjr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodjr2, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtoda, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodh, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940412)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodhr1, ddtod, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2t, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (World 940223)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2ta, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (Asia 940223)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2tu, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (USA 940323)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2tur1, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II Turbo (USA 940223)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2xj, ssf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Street Fighter II X: Grand Master Challenge (Japan 940223)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avsp, 0, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Euro 940520)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avspu, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (USA 940520)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avspj, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Japan 940520)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avspa, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Asia 940520)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avsph, avsp, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Alien vs. Predator (Hispanic 940520)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlk, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Euro 940705)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlku, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (USA 940818)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlkur1, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (USA 940705)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlka, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Asia 940705)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlkh, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Darkstalkers: The Night Warriors (Hispanic 940818)", GAME_SUPPORTS_SAVE ) +GAME( 1994, vampj, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940705)", GAME_SUPPORTS_SAVE ) // partial update set? Only rom 04 is "B" revision +GAME( 1994, vampja, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940705 alt)", GAME_SUPPORTS_SAVE ) +GAME( 1994, vampjr1, dstlk, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire: The Night Warriors (Japan 940630)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ringdest, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", GAME_SUPPORTS_SAVE ) +GAME( 1994, smbomb, ringdest, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940831)", GAME_SUPPORTS_SAVE ) +GAME( 1994, smbombr1, ringdest, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940808)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwar, 0, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Euro 941024)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwarr1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Euro 941011)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwaru, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (USA 941024)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwaru1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (USA 940920)", GAME_SUPPORTS_SAVE ) +GAME( 1994, pgear, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", GAME_SUPPORTS_SAVE ) +GAME( 1994, pgearr1, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwara, armwar, cps2, cps2_3p3b, cps2, ROT0, "Capcom", "Armored Warriors (Asia 940920)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcota, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Euro 950105)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotau, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (USA 950105)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotah, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotaj, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941222)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotaj1, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941219)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotaj2, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941217)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotajr, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotaa, xmcota, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men: Children of the Atom (Asia 941217)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarr, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarru, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarrh, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarrb, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Brazil 950403)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarra, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Night Warriors: Darkstalkers' Revenge (Asia 950302)", GAME_SUPPORTS_SAVE ) +GAME( 1995, vhuntj, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", GAME_SUPPORTS_SAVE ) +GAME( 1995, vhuntjr1, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", GAME_SUPPORTS_SAVE ) +GAME( 1995, vhuntjr2, nwarr, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", GAME_SUPPORTS_SAVE ) +GAME( 1995, cybots, 0, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", GAME_SUPPORTS_SAVE ) +GAME( 1995, cybotsu, cybots, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", GAME_SUPPORTS_SAVE ) +GAME( 1995, cybotsj, cybots, cps2, cybots, cps2, ROT0, "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfa, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950727)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfar1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950718)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfar2, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950627)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfar3, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950605)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfau, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha: Warriors' Dreams (USA 950627)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfza, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Asia 950627)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzj, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950727)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzjr1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950627)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzjr2, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Japan 950605)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzh, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Hispanic 950627)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzb, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Brazil 951109)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfzbr1, sfa, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero (Brazil 950727)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mmancp2u, megaman, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", GAME_SUPPORTS_SAVE ) +GAME( 1995, rmancp2j, megaman, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Rockman: The Power Battle (CPS2, Japan 950922)", GAME_SUPPORTS_SAVE ) +GAME( 1995, msh, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Euro 951024)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshu, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (USA 951024)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshj, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Japan 951117)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshjr1, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Japan 951024)", GAME_SUPPORTS_SAVE ) +GAME( 1995, msha, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Asia 951024)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshh, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Hispanic 951117)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshb, msh, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes (Brazil 951117)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xx, 0, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (USA 951207)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxa, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Asia 951207)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxj, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951225)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxjr1, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951207)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxh, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Hispanic 951218)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxb, 19xx, cps2, cps2_2p2b, cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Brazil 951218)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsom, 0, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960619)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomr1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960223)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomr2, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960209)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomr3, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960208)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomu, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960619)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomur1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960209)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomj, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960619)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomjr1, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsoma, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomh, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Hispanic 960223)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomb, ddsom, cps2, cps2_4p4b, cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Brazil 960223)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfa2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 2 (Euro 960229)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfa2u, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 2 (USA 960306)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2j, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Japan 960227)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2a, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Asia 960227)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2b, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Brazil 960531)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2br1, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Brazil 960304)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2h, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Hispanic 960304)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2n, sfa2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 (Oceania 960229)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2al, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Asia 960826)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2alj, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Japan 960805)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2alh, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Hispanic 960813)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2alb, sfz2al, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Brazil 960813)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2t, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2xj, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II X (Japan 960531)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2ta, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2th, spf2t, cps2, cps2_2p2b, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Hispanic 960531)", GAME_SUPPORTS_SAVE ) +GAME( 1996, megaman2, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", GAME_SUPPORTS_SAVE ) +GAME( 1996, megaman2a, megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", GAME_SUPPORTS_SAVE ) +GAME( 1996, rockman2j, megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", GAME_SUPPORTS_SAVE ) +GAME( 1996, megaman2h, megaman2, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Mega Man 2: The Power Fighters (Hispanic 960712)", GAME_SUPPORTS_SAVE ) +GAME( 1996, qndream, 0, cps2, qndream, cps2, ROT0, "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsf, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Euro 961004)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfr1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfu, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961023)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfur1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961004)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfj, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 961004)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfjr1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960910)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfjr2, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960909)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfa, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Asia 961023)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfar1, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Asia 960919)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfh, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Hispanic 961004)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfb, xmvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Brazil 961023)", GAME_SUPPORTS_SAVE ) +GAME( 1997, batcir, 0, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Euro 970319)", GAME_SUPPORTS_SAVE ) +GAME( 1997, batcira, batcir, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Asia 970319)", GAME_SUPPORTS_SAVE ) +GAME( 1997, batcirj, batcir, cps2, cps2_4p2b, cps2, ROT0, "Capcom", "Battle Circuit (Japan 970319)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsav, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsavu, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsavj, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsava, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsavh, vsav, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsf, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Euro 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfu, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970827)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfu1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfj, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970707)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfj1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970702)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfj2, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfh, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Hispanic 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfa, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfa1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfb, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", GAME_SUPPORTS_SAVE ) +GAME( 1997, mshvsfb1, mshvsf, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", GAME_SUPPORTS_SAVE ) +GAME( 1997, csclub, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Euro 971017)", GAME_SUPPORTS_SAVE ) +GAME( 1997, csclub1, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Euro 970722)", GAME_SUPPORTS_SAVE ) +GAME( 1997, cscluba, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Asia 970722)", GAME_SUPPORTS_SAVE ) +GAME( 1997, csclubj, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Japan 970722)", GAME_SUPPORTS_SAVE ) +GAME( 1997, csclubh, csclub, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Capcom Sports Club (Hispanic 970722)", GAME_SUPPORTS_SAVE ) +GAME( 1997, sgemf, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter Mini Mix (USA 970904)", GAME_SUPPORTS_SAVE ) +GAME( 1997, pfghtj, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Pocket Fighter (Japan 970904)", GAME_SUPPORTS_SAVE ) +GAME( 1997, sgemfa, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter: Mini Mix (Asia 970904)", GAME_SUPPORTS_SAVE ) +GAME( 1997, sgemfh, sgemf, cps2, cps2_2p3b, cps2, ROT0, "Capcom", "Super Gem Fighter: Mini Mix (Hispanic 970904)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vhunt2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vhunt2r1, vhunt2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsav2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvsc, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscr1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscu, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscj, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscjr1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980112)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvsca, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscar1, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980112)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvsch, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Hispanic 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscb, mvsc, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Brazil 980123)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfa3, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Euro 980904)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfa3u, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980904)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfa3ur1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980629)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfa3b, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Brazil 980629)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfz3j, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980904)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfz3jr1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980727)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfz3jr2, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Japan 980629)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfz3a, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Asia 980904)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfz3ar1, sfa3, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Street Fighter Zero 3 (Asia 980701)", GAME_SUPPORTS_SAVE ) +GAME( 1999, jyangoku, 0, cps2, cps2_1p2b, cps2, ROT0, "Capcom", "Jyangokushi: Haoh no Saihai (Japan 990527)", GAME_SUPPORTS_SAVE ) +GAME( 2004, hsf2, 0, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Asia 040202)", GAME_SUPPORTS_SAVE ) +GAME( 2004, hsf2j, hsf2, cps2, cps2_2p6b, cps2, ROT0, "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Japan 031222)", GAME_SUPPORTS_SAVE ) /* Games released on CPS-2 hardware by Takumi */ -GAME( 1999, gigawing, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (USA 990222)", 0 ) -GAME( 1999, gigawingj,gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Japan 990223)", 0 ) -GAME( 1999, gigawinga,gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Asia 990222)", 0 ) -GAME( 1999, gigawingb,gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Brazil 990222)", 0 ) -GAME( 2000, mmatrix, 0, cps2, cps2_2p1b, cps2, ROT0, "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (USA 000412)", 0 ) -GAME( 2000, mmatrixj, mmatrix, cps2, cps2_2p1b, cps2, ROT0, "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (Japan 000412)", 0 ) +GAME( 1999, gigawing, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (USA 990222)", GAME_SUPPORTS_SAVE ) +GAME( 1999, gigawingj, gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Japan 990223)", GAME_SUPPORTS_SAVE ) +GAME( 1999, gigawinga, gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Asia 990222)", GAME_SUPPORTS_SAVE ) +GAME( 1999, gigawingb, gigawing, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Takumi", "Giga Wing (Brazil 990222)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mmatrix, 0, cps2, cps2_2p1b, cps2, ROT0, "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (USA 000412)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mmatrixj, mmatrix, cps2, cps2_2p1b, cps2, ROT0, "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (Japan 000412)", GAME_SUPPORTS_SAVE ) /* Games released on CPS-2 hardware by Mitchell */ -GAME( 2000, mpang, 0, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 001010)", 0 ) -GAME( 2000, mpangr1, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 000925)", 0 ) -GAME( 2000, mpangu, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (USA 001010)", 0 ) -GAME( 2000, mpangj, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Japan 001011)", 0 ) -GAME( 2001, pzloop2, 0, cps2, pzloop2, pzloop2, ROT0, "Mitchell, distributed by Capcom", "Puzz Loop 2 (Euro 010302)", 0 ) -GAME( 2001, pzloop2j, pzloop2, cps2, pzloop2, pzloop2, ROT0, "Mitchell, distributed by Capcom", "Puzz Loop 2 (Japan 010205)", 0 ) -GAME( 2001, choko, 0, cps2, choko, cps2, ROT0, "Mitchell, distributed by Capcom", "Janpai Puzzle Choukou (Japan 010820)", 0 ) +GAME( 2000, mpang, 0, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 001010)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mpangr1, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 000925)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mpangu, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (USA 001010)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mpangj, mpang, cps2, cps2_2p1b, cps2, ROT0, "Mitchell, distributed by Capcom", "Mighty! Pang (Japan 001011)", GAME_SUPPORTS_SAVE ) +GAME( 2001, pzloop2, 0, cps2, pzloop2, pzloop2, ROT0, "Mitchell, distributed by Capcom", "Puzz Loop 2 (Euro 010302)", GAME_SUPPORTS_SAVE ) +GAME( 2001, pzloop2j, pzloop2, cps2, pzloop2, pzloop2, ROT0, "Mitchell, distributed by Capcom", "Puzz Loop 2 (Japan 010205)", GAME_SUPPORTS_SAVE ) +GAME( 2001, choko, 0, cps2, choko, cps2, ROT0, "Mitchell, distributed by Capcom", "Janpai Puzzle Choukou (Japan 010820)", GAME_SUPPORTS_SAVE ) /* Games released on CPS-2 hardware by Eighting/Raizing */ -GAME( 2000, dimahoo, 0, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (Euro 000121)", 0 ) -GAME( 2000, dimahoou, dimahoo, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (USA 000121)", 0 ) -GAME( 2000, gmahou, dimahoo, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Great Mahou Daisakusen (Japan 000121)", 0 ) -GAME( 2000, 1944, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (USA 000620)", 0 ) -GAME( 2000, 1944j, 1944, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (Japan 000620)", 0 ) +GAME( 2000, dimahoo, 0, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (Euro 000121)", GAME_SUPPORTS_SAVE ) +GAME( 2000, dimahoou, dimahoo, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (USA 000121)", GAME_SUPPORTS_SAVE ) +GAME( 2000, gmahou, dimahoo, cps2, cps2_2p3b, cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Great Mahou Daisakusen (Japan 000121)", GAME_SUPPORTS_SAVE ) +GAME( 2000, 1944, 0, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (USA 000620)", GAME_SUPPORTS_SAVE ) +GAME( 2000, 1944j, 1944, cps2, cps2_2p2b, cps2, ROT0, "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (Japan 000620)", GAME_SUPPORTS_SAVE ) /* Games released on CPS-2 hardware by Cave */ -GAME( 2001, progear, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear (USA 010117)", 0 ) -GAME( 2001, progearj, progear, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear no Arashi (Japan 010117)", 0 ) -GAME( 2001, progeara, progear, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear (Asia 010117)", 0 ) +GAME( 2001, progear, 0, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear (USA 010117)", GAME_SUPPORTS_SAVE ) +GAME( 2001, progearj, progear, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear no Arashi (Japan 010117)", GAME_SUPPORTS_SAVE ) +GAME( 2001, progeara, progear, cps2, cps2_2p3b, cps2, ROT0, "Capcom, supported by Cave", "Progear (Asia 010117)", GAME_SUPPORTS_SAVE ) /* ------------------------ @@ -8783,34 +8812,34 @@ ROM_END -GAME( 1993, ssf2ud, ssf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Super Street Fighter II: The New Challengers (USA 930911 Phoenix Edition) (bootleg)", 0 ) -GAME( 1993, ddtodd, ddtod, dead_cps2, cps2_4p4b, cps2, ROT0, "bootleg", "Dungeons & Dragons: Tower of Doom (Euro 940412 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, armwar1d, armwar, dead_cps2, cps2_3p3b, cps2, ROT0, "bootleg", "Armored Warriors (Euro 941011 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, avspd, avsp, dead_cps2, cps2_3p3b, cps2, ROT0, "bootleg", "Alien vs. Predator (Euro 940520 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, dstlku1d, dstlk, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Darkstalkers: The Night Warriors (USA 940705 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, ringdstd, ringdest,dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Ring of Destruction: Slammasters II (Euro 940902 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, xmcotad, xmcota, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "X-Men: Children of the Atom (Euro 950105 Phoenix Edition) (bootleg)", 0 ) -GAME( 1995, nwarrud, nwarr, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Night Warriors: Darkstalkers' Revenge (USA 950406 Phoenix Edition) (bootleg)", 0 ) -GAME( 1995, sfad, sfa, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Alpha: Warriors' Dreams (Euro 950727 Phoenix Edition) (bootleg)", 0 ) -GAME( 1995, mshud, msh, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Marvel Super Heroes (US 951024 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, 19xxd, 19xx, dead_cps2, cps2_2p2b, cps2, ROT270, "bootleg", "19XX: The War Against Destiny (USA 951207 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, sfz2ad, sfa2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Zero 2 (Asia 960227 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, spf2xjd, spf2t, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "Super Puzzle Fighter II X (Japan 960531 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, ddsomud, ddsom, dead_cps2, cps2_4p4b, cps2, ROT0, "bootleg", "Dungeons & Dragons: Shadow over Mystara (USA 960619 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, gigamn2, megaman2, gigamn2, cps2_2p3b, gigamn2, ROT0, "bootleg", "Giga Man 2: The Power Fighters (bootleg of Mega Man 2: The Power Fighters)", GAME_NOT_WORKING ) // flash roms aren't dumped, layer offsets different, different sound system -GAME( 1996, megamn2d, megaman2,dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Mega Man 2: The Power Fighters (USA 960708 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, sfz2ald, sfz2al, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Zero 2 Alpha (Asia 960826 Phoenix Edition) (bootleg)", 0 ) -GAME( 1996, xmvsfu1d, xmvsf, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "X-Men Vs. Street Fighter (USA 961004 Phoenix Edition) (bootleg)", 0 ) -GAME( 1997, batcird, batcir, dead_cps2, cps2_4p2b, cps2, ROT0, "bootleg", "Battle Circuit (Euro 970319 Phoenix Edition) (bootleg)", 0 ) -GAME( 1997, vsavd, vsav, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Vampire Savior: The Lord of Vampire (Euro 970519 Phoenix Edition) (bootleg)", 0 ) -GAME( 1998, mvscud, mvsc, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123 Phoenix Edition) (bootleg)", 0 ) -GAME( 1998, sfa3ud, sfa3, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Alpha 3 (USA 980904 Phoenix Edition) (bootleg)", 0 ) -GAME( 1999, gwingjd, gigawing,dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "Giga Wing (Japan 990223 Phoenix Edition) (bootleg)", 0 ) -GAME( 2000, 1944d, 1944, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "1944: The Loop Master (USA 000620 Phoenix Edition) (bootleg)", 0 ) -GAME( 2001, progerjd, progear, dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Progear no Arashi (Japan 010117 Phoenix Edition) (bootleg)", 0 ) // doesn't display phoenix edition screen, hacked bootleg? -GAME( 2004, hsf2d, hsf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Hyper Street Fighter II: The Anniversary Edition (Asia 040202 Phoenix Edition) (bootleg)", 0 ) -GAME( 1993, ssf2tbd, ssf2, dead_cps2, cps2_2p6b, ssf2tb, ROT0, "bootleg", "Super Street Fighter II: The Tournament Battle (World 931119 Phoenix Edition) (bootleg)", 0 ) -GAME( 1994, ssf2xjd, ssf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Super Street Fighter II X: Grand Master Challenge (Japan 940223 Phoenix Edition) (bootleg)", 0 ) -GAME( 1997, sgemfd, sgemf, dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Super Gem Fighter Mini Mix (USA 970904 Phoenix Edition) (bootleg)", 0 ) -GAME( 2000, mmatrixd, mmatrix, dead_cps2, cps2_2p1b, cps2, ROT0, "bootleg", "Mars Matrix: Hyper Solid Shooting (Japan 000412 Phoenix Edition) (bootleg)", 0 ) -GAME( 2000, dimahoud, dimahoo, dead_cps2, cps2_2p3b, cps2, ROT270, "bootleg", "Dimahoo (USA 000121 Phoenix Edition) (bootleg)", 0 ) +GAME( 1993, ssf2ud, ssf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Super Street Fighter II: The New Challengers (USA 930911 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ddtodd, ddtod, dead_cps2, cps2_4p4b, cps2, ROT0, "bootleg", "Dungeons & Dragons: Tower of Doom (Euro 940412 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, armwar1d, armwar, dead_cps2, cps2_3p3b, cps2, ROT0, "bootleg", "Armored Warriors (Euro 941011 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, avspd, avsp, dead_cps2, cps2_3p3b, cps2, ROT0, "bootleg", "Alien vs. Predator (Euro 940520 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, dstlku1d, dstlk, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Darkstalkers: The Night Warriors (USA 940705 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ringdstd, ringdest, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Ring of Destruction: Slammasters II (Euro 940902 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, xmcotad, xmcota, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "X-Men: Children of the Atom (Euro 950105 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1995, nwarrud, nwarr, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Night Warriors: Darkstalkers' Revenge (USA 950406 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1995, sfad, sfa, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Alpha: Warriors' Dreams (Euro 950727 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1995, mshud, msh, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Marvel Super Heroes (US 951024 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, 19xxd, 19xx, dead_cps2, cps2_2p2b, cps2, ROT270, "bootleg", "19XX: The War Against Destiny (USA 951207 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2ad, sfa2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Zero 2 (Asia 960227 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2xjd, spf2t, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "Super Puzzle Fighter II X (Japan 960531 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ddsomud, ddsom, dead_cps2, cps2_4p4b, cps2, ROT0, "bootleg", "Dungeons & Dragons: Shadow over Mystara (USA 960619 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, gigamn2, megaman2, gigamn2, cps2_2p3b, gigamn2, ROT0, "bootleg", "Giga Man 2: The Power Fighters (bootleg of Mega Man 2: The Power Fighters)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // flash roms aren't dumped, layer offsets different, different sound system +GAME( 1996, megamn2d, megaman2, dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Mega Man 2: The Power Fighters (USA 960708 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, sfz2ald, sfz2al, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Zero 2 Alpha (Asia 960826 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1996, xmvsfu1d, xmvsf, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "X-Men Vs. Street Fighter (USA 961004 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1997, batcird, batcir, dead_cps2, cps2_4p2b, cps2, ROT0, "bootleg", "Battle Circuit (Euro 970319 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1997, vsavd, vsav, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Vampire Savior: The Lord of Vampire (Euro 970519 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1998, mvscud, mvsc, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1998, sfa3ud, sfa3, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Street Fighter Alpha 3 (USA 980904 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1999, gwingjd, gigawing, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "Giga Wing (Japan 990223 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2000, 1944d, 1944, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "1944: The Loop Master (USA 000620 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2001, progerjd, progear, dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Progear no Arashi (Japan 010117 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) // doesn't display phoenix edition screen, hacked bootleg? +GAME( 2004, hsf2d, hsf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Hyper Street Fighter II: The Anniversary Edition (Asia 040202 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1993, ssf2tbd, ssf2, dead_cps2, cps2_2p6b, ssf2tb, ROT0, "bootleg", "Super Street Fighter II: The Tournament Battle (World 931119 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssf2xjd, ssf2, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Super Street Fighter II X: Grand Master Challenge (Japan 940223 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1997, sgemfd, sgemf, dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Super Gem Fighter Mini Mix (USA 970904 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2000, mmatrixd, mmatrix, dead_cps2, cps2_2p1b, cps2, ROT0, "bootleg", "Mars Matrix: Hyper Solid Shooting (Japan 000412 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2000, dimahoud, dimahoo, dead_cps2, cps2_2p3b, cps2, ROT270, "bootleg", "Dimahoo (USA 000121 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index 467ca5a42bd..8839bfa5f37 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -35,60 +35,66 @@ from 2.bin to 9.bin program eproms #include "driver.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "cps1.h" +#include "includes/cps1.h" #include "sound/2203intf.h" #include "sound/msm5205.h" -static int sample_buffer1, sample_buffer2; -static int sample_select1, sample_select2; - static WRITE16_HANDLER( fcrash_soundlatch_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; + if (ACCESSING_BITS_0_7) { - soundlatch_w(space,0,data & 0xff); - cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE); + soundlatch_w(space, 0, data & 0xff); + cpu_set_input_line(state->audiocpu, 0, HOLD_LINE); } } static WRITE8_HANDLER( fcrash_snd_bankswitch_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; UINT8 *RAM = memory_region(space->machine, "soundcpu"); int bankaddr; - sound_set_output_gain(devtag_get_device(space->machine, "msm1"), 0, (data & 0x08) ? 0.0 : 1.0); - sound_set_output_gain(devtag_get_device(space->machine, "msm2"), 0, (data & 0x10) ? 0.0 : 1.0); + sound_set_output_gain(state->msm_1, 0, (data & 0x08) ? 0.0 : 1.0); + sound_set_output_gain(state->msm_2, 0, (data & 0x10) ? 0.0 : 1.0); bankaddr = ((data & 7) * 0x4000); memory_set_bankptr(space->machine, "bank1",&RAM[0x10000 + bankaddr]); } -static void m5205_int1(const device_config *device) +static void m5205_int1( const device_config *device ) { - msm5205_data_w(device, sample_buffer1 & 0x0F); - sample_buffer1 >>= 4; - sample_select1 ^= 1; - if (sample_select1 == 0) - cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); + cps_state *state = (cps_state *)device->machine->driver_data; + + msm5205_data_w(device, state->sample_buffer1 & 0x0f); + state->sample_buffer1 >>= 4; + state->sample_select1 ^= 1; + if (state->sample_select1 == 0) + cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); } -static void m5205_int2(const device_config *device) +static void m5205_int2( const device_config *device ) { - msm5205_data_w(device, sample_buffer2 & 0x0F); - sample_buffer2 >>= 4; - sample_select2 ^= 1; + cps_state *state = (cps_state *)device->machine->driver_data; + + msm5205_data_w(device, state->sample_buffer2 & 0x0f); + state->sample_buffer2 >>= 4; + state->sample_select2 ^= 1; } static WRITE8_HANDLER( fcrash_msm5205_0_data_w ) { - sample_buffer1 = data; + cps_state *state = (cps_state *)space->machine->driver_data; + state->sample_buffer1 = data; } static WRITE8_HANDLER( fcrash_msm5205_1_data_w ) { - sample_buffer2 = data; + cps_state *state = (cps_state *)space->machine->driver_data; + state->sample_buffer2 = data; } @@ -96,80 +102,87 @@ static WRITE8_HANDLER( fcrash_msm5205_1_data_w ) /* not verified */ #define CPS1_ROWSCROLL_OFFS (0x20/2) /* base of row scroll offsets in other RAM */ -static void fcrash_update_transmasks(void) +static void fcrash_update_transmasks( running_machine *machine ) { + cps_state *state = (cps_state *)machine->driver_data; int i; int priority[4]; - priority[0]=0x26; - priority[1]=0x30; - priority[2]=0x28; - priority[3]=0x32; + priority[0] = 0x26; + priority[1] = 0x30; + priority[2] = 0x28; + priority[3] = 0x32; - for (i = 0;i < 4;i++) + for (i = 0; i < 4; i++) { int mask; /* Get transparency registers */ if (priority[i]) - mask = cps1_cps_b_regs[priority[i]/2] ^ 0xffff; - else mask = 0xffff; /* completely transparent if priority masks not defined (mercs, qad) */ + mask = state->cps_b_regs[priority[i] / 2] ^ 0xffff; + else + mask = 0xffff; /* completely transparent if priority masks not defined (mercs, qad) */ - tilemap_set_transmask(cps1_bg_tilemap[0],i,mask,0x8000); - tilemap_set_transmask(cps1_bg_tilemap[1],i,mask,0x8000); - tilemap_set_transmask(cps1_bg_tilemap[2],i,mask,0x8000); + tilemap_set_transmask(state->bg_tilemap[0], i, mask, 0x8000); + tilemap_set_transmask(state->bg_tilemap[1], i, mask, 0x8000); + tilemap_set_transmask(state->bg_tilemap[2], i, mask, 0x8000); } } -static void fcrash_render_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) +static void fcrash_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { + cps_state *state = (cps_state *)machine->driver_data; int pos; - int base=0x50c8/2; + int base = 0x50c8 / 2; // sprite base registers need hooking up properly.. on fcrash it is NOT cps1_cps_a_regs[0] // on kodb, it might still be, unless that's just a leftover and it writes somewhere else too -// if (cps1_cps_a_regs[0] & 0x00ff) base=0x10c8/2; -// printf("cps1_cps_a_regs %04x\n", cps1_cps_a_regs[0]); +// if (state->cps_a_regs[0] & 0x00ff) base = 0x10c8/2; +// printf("cps1_cps_a_regs %04x\n", state->cps_a_regs[0]); - for (pos=0x1ffc;pos>=0x0000;pos-=4) + for (pos = 0x1ffc; pos >= 0x0000; pos -= 4) { int tileno; int xpos; int ypos; - int flipx,flipy; + int flipx, flipy; int colour; - tileno = cps1_gfxram[base+pos]; - xpos = cps1_gfxram[base+pos+2]; - ypos = cps1_gfxram[base+pos-1]&0xff; - flipx = cps1_gfxram[base+pos+1]&0x20; - flipy = cps1_gfxram[base+pos+1]&0x40; - colour = cps1_gfxram[base+pos+1]&0x1f; - ypos = 256-ypos; + tileno = state->gfxram[base +pos]; + xpos = state->gfxram[base +pos + 2]; + ypos = state->gfxram[base +pos - 1] & 0xff; + flipx = state->gfxram[base +pos + 1] & 0x20; + flipy = state->gfxram[base +pos + 1] & 0x40; + colour = state->gfxram[base +pos + 1] & 0x1f; + ypos = 256 - ypos; - pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],tileno,colour,flipx,flipy,xpos+49,ypos-16,machine->priority_bitmap,0x02,15); + pdrawgfx_transpen(bitmap, cliprect, machine->gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine->priority_bitmap, 0x02, 15); } } -static void fcrash_render_layer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int layer,int primask) +static void fcrash_render_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask ) { + cps_state *state = (cps_state *)machine->driver_data; + switch (layer) { case 0: - fcrash_render_sprites(machine,bitmap,cliprect); + fcrash_render_sprites(machine, bitmap, cliprect); break; case 1: case 2: case 3: - tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask); + tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer - 1], TILEMAP_DRAW_LAYER1, primask); break; } } -static void fcrash_render_high_layer(bitmap_t *bitmap, const rectangle *cliprect, int layer) +static void fcrash_render_high_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer ) { + cps_state *state = (cps_state *)machine->driver_data; + switch (layer) { case 0: @@ -178,28 +191,29 @@ static void fcrash_render_high_layer(bitmap_t *bitmap, const rectangle *cliprect case 1: case 2: case 3: - tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1); + tilemap_draw(NULL, cliprect, state->bg_tilemap[layer - 1], TILEMAP_DRAW_LAYER0, 1); break; } } -static void fcrash_build_palette(running_machine *machine) +static void fcrash_build_palette( running_machine *machine ) { + cps_state *state = (cps_state *)machine->driver_data; int offset; - for (offset = 0; offset < 32*6*16; offset++) + for (offset = 0; offset < 32 * 6 * 16; offset++) { - int palette = cps1_gfxram[0x14000/2 + offset]; + int palette = state->gfxram[0x14000 / 2 + offset]; int r, g, b, bright; // from my understanding of the schematics, when the 'brightness' // component is set to 0 it should reduce brightness to 1/3 - bright = 0x0f + ((palette>>12)<<1); + bright = 0x0f + ((palette >> 12) << 1); - r = ((palette>>8)&0x0f) * 0x11 * bright / 0x2d; - g = ((palette>>4)&0x0f) * 0x11 * bright / 0x2d; - b = ((palette>>0)&0x0f) * 0x11 * bright / 0x2d; + r = ((palette >> 8) & 0x0f) * 0x11 * bright / 0x2d; + g = ((palette >> 4) & 0x0f) * 0x11 * bright / 0x2d; + b = ((palette >> 0) & 0x0f) * 0x11 * bright / 0x2d; palette_set_color (machine, offset, MAKE_RGB(r, g, b)); } @@ -207,55 +221,57 @@ static void fcrash_build_palette(running_machine *machine) static VIDEO_UPDATE( fcrash ) { - int layercontrol,l0,l1,l2,l3; - int videocontrol=cps1_cps_a_regs[0x22/2]; + cps_state *state = (cps_state *)screen->machine->driver_data; + int layercontrol, l0, l1, l2, l3; + int videocontrol = state->cps_a_regs[0x22 / 2]; flip_screen_set(screen->machine, videocontrol & 0x8000); - layercontrol = cps1_cps_b_regs[0x20/2]; + layercontrol = state->cps_b_regs[0x20 / 2]; /* Get video memory base registers */ - cps1_get_video_base(); + cps1_get_video_base(screen->machine); /* Build palette */ fcrash_build_palette(screen->machine); - fcrash_update_transmasks(); + fcrash_update_transmasks(screen->machine); + + tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x - 62); + tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y); - tilemap_set_scrollx(cps1_bg_tilemap[0],0,cps1_scroll1x-62); - tilemap_set_scrolly(cps1_bg_tilemap[0],0,cps1_scroll1y); if (videocontrol & 0x01) /* linescroll enable */ { - int scrly=-cps1_scroll2y; + int scrly = -state->scroll2y; int i; int otheroffs; - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1024); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1024); - otheroffs = cps1_cps_a_regs[CPS1_ROWSCROLL_OFFS]; + otheroffs = state->cps_a_regs[CPS1_ROWSCROLL_OFFS]; - for (i = 0;i < 256;i++) - tilemap_set_scrollx(cps1_bg_tilemap[1],(i - scrly) & 0x3ff,cps1_scroll2x + cps1_other[(i + otheroffs) & 0x3ff]); + for (i = 0; i < 256; i++) + tilemap_set_scrollx(state->bg_tilemap[1], (i - scrly) & 0x3ff, state->scroll2x + state->other[(i + otheroffs) & 0x3ff]); } else { - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1); - tilemap_set_scrollx(cps1_bg_tilemap[1],0,cps1_scroll2x-60); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1); + tilemap_set_scrollx(state->bg_tilemap[1], 0, state->scroll2x - 60); } - tilemap_set_scrolly(cps1_bg_tilemap[1],0,cps1_scroll2y); - tilemap_set_scrollx(cps1_bg_tilemap[2],0,cps1_scroll3x-64); - tilemap_set_scrolly(cps1_bg_tilemap[2],0,cps1_scroll3y); + tilemap_set_scrolly(state->bg_tilemap[1], 0, state->scroll2y); + tilemap_set_scrollx(state->bg_tilemap[2], 0, state->scroll3x - 64); + tilemap_set_scrolly(state->bg_tilemap[2], 0, state->scroll3y); /* turn all tilemaps on regardless of settings in get_video_base() */ /* write a custom get_video_base for this bootleg hardware? */ - tilemap_set_enable(cps1_bg_tilemap[0],1); - tilemap_set_enable(cps1_bg_tilemap[1],1); - tilemap_set_enable(cps1_bg_tilemap[2],1); + tilemap_set_enable(state->bg_tilemap[0], 1); + tilemap_set_enable(state->bg_tilemap[1], 1); + tilemap_set_enable(state->bg_tilemap[2], 1); /* Blank screen */ - bitmap_fill(bitmap,cliprect,0xbff); + bitmap_fill(bitmap, cliprect, 0xbff); bitmap_fill(screen->machine->priority_bitmap,cliprect,0); l0 = (layercontrol >> 0x06) & 03; @@ -263,14 +279,22 @@ static VIDEO_UPDATE( fcrash ) l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - fcrash_render_layer(screen->machine,bitmap,cliprect,l0,0); - if (l1 == 0) fcrash_render_high_layer(bitmap,cliprect,l0); - fcrash_render_layer(screen->machine,bitmap,cliprect,l1,0); - if (l2 == 0) fcrash_render_high_layer(bitmap,cliprect,l1); - fcrash_render_layer(screen->machine,bitmap,cliprect,l2,0); - if (l3 == 0) fcrash_render_high_layer(bitmap,cliprect,l2); - fcrash_render_layer(screen->machine,bitmap,cliprect,l3,0); + fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0); + if (l1 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0); + + if (l2 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0); + + if (l3 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0); return 0; } @@ -278,70 +302,80 @@ static VIDEO_UPDATE( fcrash ) // doesn't have the scroll offsets like fcrash static VIDEO_UPDATE( kodb ) { - int layercontrol,l0,l1,l2,l3; - int videocontrol=cps1_cps_a_regs[0x22/2]; - + cps_state *state = (cps_state *)screen->machine->driver_data; + int layercontrol, l0, l1, l2, l3; + int videocontrol = state->cps_a_regs[0x22 / 2]; flip_screen_set(screen->machine, videocontrol & 0x8000); - layercontrol = cps1_cps_b_regs[0x20/2]; + layercontrol = state->cps_b_regs[0x20 / 2]; /* Get video memory base registers */ - cps1_get_video_base(); + cps1_get_video_base(screen->machine); /* Build palette */ fcrash_build_palette(screen->machine); - fcrash_update_transmasks(); + fcrash_update_transmasks(screen->machine); + + tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x); + tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y); - tilemap_set_scrollx(cps1_bg_tilemap[0],0,cps1_scroll1x); - tilemap_set_scrolly(cps1_bg_tilemap[0],0,cps1_scroll1y); if (videocontrol & 0x01) /* linescroll enable */ { - int scrly=-cps1_scroll2y; + int scrly= -state->scroll2y; int i; int otheroffs; - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1024); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1024); - otheroffs = cps1_cps_a_regs[CPS1_ROWSCROLL_OFFS]; + otheroffs = state->cps_a_regs[CPS1_ROWSCROLL_OFFS]; - for (i = 0;i < 256;i++) - tilemap_set_scrollx(cps1_bg_tilemap[1],(i - scrly) & 0x3ff,cps1_scroll2x + cps1_other[(i + otheroffs) & 0x3ff]); + for (i = 0; i < 256; i++) + tilemap_set_scrollx(state->bg_tilemap[1], (i - scrly) & 0x3ff, state->scroll2x + state->other[(i + otheroffs) & 0x3ff]); } else { - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1); - tilemap_set_scrollx(cps1_bg_tilemap[1],0,cps1_scroll2x); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1); + tilemap_set_scrollx(state->bg_tilemap[1], 0, state->scroll2x); } - tilemap_set_scrolly(cps1_bg_tilemap[1],0,cps1_scroll2y); - tilemap_set_scrollx(cps1_bg_tilemap[2],0,cps1_scroll3x); - tilemap_set_scrolly(cps1_bg_tilemap[2],0,cps1_scroll3y); + + tilemap_set_scrolly(state->bg_tilemap[1], 0, state->scroll2y); + tilemap_set_scrollx(state->bg_tilemap[2], 0, state->scroll3x); + tilemap_set_scrolly(state->bg_tilemap[2], 0, state->scroll3y); /* turn all tilemaps on regardless of settings in get_video_base() */ /* write a custom get_video_base for this bootleg hardware? */ - tilemap_set_enable(cps1_bg_tilemap[0],1); - tilemap_set_enable(cps1_bg_tilemap[1],1); - tilemap_set_enable(cps1_bg_tilemap[2],1); + tilemap_set_enable(state->bg_tilemap[0], 1); + tilemap_set_enable(state->bg_tilemap[1], 1); + tilemap_set_enable(state->bg_tilemap[2], 1); /* Blank screen */ - bitmap_fill(bitmap,cliprect,0xbff); + bitmap_fill(bitmap, cliprect, 0xbff); - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); l0 = (layercontrol >> 0x06) & 03; l1 = (layercontrol >> 0x08) & 03; l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - fcrash_render_layer(screen->machine,bitmap,cliprect,l0,0); - if (l1 == 0) fcrash_render_high_layer(bitmap,cliprect,l0); - fcrash_render_layer(screen->machine,bitmap,cliprect,l1,0); - if (l2 == 0) fcrash_render_high_layer(bitmap,cliprect,l1); - fcrash_render_layer(screen->machine,bitmap,cliprect,l2,0); - if (l3 == 0) fcrash_render_high_layer(bitmap,cliprect,l2); - fcrash_render_layer(screen->machine,bitmap,cliprect,l3,0); + fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0); + if (l1 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0); + + if (l2 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0); + + if (l3 == 0) + fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2); + + fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0); return 0; } @@ -350,13 +384,13 @@ static VIDEO_UPDATE( kodb ) static ADDRESS_MAP_START( fcrash_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x1fffff) AM_ROM AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w) - AM_RANGE(0x800100, 0x80013f) AM_RAM AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ - AM_RANGE(0x800140, 0x80017f) AM_RAM AM_BASE(&cps1_cps_b_regs) /* CPS-B custom */ + AM_RANGE(0x800100, 0x80013f) AM_RAM AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x800140, 0x80017f) AM_RAM AM_BASE_MEMBER(cps_state, cps_b_regs) /* CPS-B custom */ AM_RANGE(0x880000, 0x880001) AM_READ_PORT("IN1") /* Player input ports */ AM_RANGE(0x880006, 0x880007) AM_WRITE(fcrash_soundlatch_w) /* Sound command */ AM_RANGE(0x880008, 0x88000f) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */ AM_RANGE(0x890000, 0x890001) AM_WRITENOP // palette related? - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) AM_RANGE(0xff0000, 0xffffff) AM_RAM ADDRESS_MAP_END @@ -381,12 +415,12 @@ static ADDRESS_MAP_START( kodb_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x800020, 0x800021) AM_READNOP /* ? Used by Rockman ? not mapped according to PAL */ AM_RANGE(0x800030, 0x800037) AM_WRITE(cps1_coinctrl_w) /* Forgotten Worlds has dial controls on B-board mapped at 800040-80005f. See DRIVER_INIT */ - AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ - AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) /* CPS-B custom */ + AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE_MEMBER(cps_state, cps_a_regs) /* CPS-A custom */ + AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE_MEMBER(cps_state, cps_b_regs) /* CPS-B custom */ // AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w) /* Sound command */ // AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ AM_RANGE(0x8001c0, 0x8001ff) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) /* mirror (SF2 revision "E" US 910228) */ - AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ + AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE_SIZE_MEMBER(cps_state, gfxram, gfxram_size) /* SF2CE executes code from here */ AM_RANGE(0xff0000, 0xffffff) AM_RAM ADDRESS_MAP_END @@ -633,7 +667,7 @@ static INPUT_PORTS_START( kodb ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("IN2") /* Player 3 */ + PORT_START("IN2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) @@ -658,8 +692,44 @@ static const msm5205_interface msm5205_interface2 = }; +static MACHINE_START( fcrash ) +{ + cps_state *state = (cps_state *)machine->driver_data; + + state->maincpu = devtag_get_device(machine, "maincpu"); + state->audiocpu = devtag_get_device(machine, "soundcpu"); + state->msm_1 = devtag_get_device(machine, "msm1"); + state->msm_2 = devtag_get_device(machine, "msm2"); + + state_save_register_global(machine, state->sample_buffer1); + state_save_register_global(machine, state->sample_buffer2); + state_save_register_global(machine, state->sample_select1); + state_save_register_global(machine, state->sample_select2); +} + +static MACHINE_START( kodb ) +{ + cps_state *state = (cps_state *)machine->driver_data; + + state->maincpu = devtag_get_device(machine, "maincpu"); + state->audiocpu = devtag_get_device(machine, "soundcpu"); +} + +static MACHINE_RESET( fcrash ) +{ + cps_state *state = (cps_state *)machine->driver_data; + + state->sample_buffer1 = 0; + state->sample_buffer2 = 0; + state->sample_select1 = 0; + state->sample_select2 = 0; +} + static MACHINE_DRIVER_START( fcrash ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, 10000000) MDRV_CPU_PROGRAM_MAP(fcrash_map) @@ -668,6 +738,9 @@ static MACHINE_DRIVER_START( fcrash ) MDRV_CPU_ADD("soundcpu", Z80, 24000000/6) /* ? */ MDRV_CPU_PROGRAM_MAP(sound_map) + MDRV_MACHINE_START(fcrash) + MDRV_MACHINE_RESET(fcrash) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(60) @@ -709,14 +782,19 @@ MACHINE_DRIVER_END static MACHINE_DRIVER_START( kodb ) + /* driver data */ + MDRV_DRIVER_DATA(cps_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, 10000000) MDRV_CPU_PROGRAM_MAP(kodb_map) MDRV_CPU_VBLANK_INT("screen", cps1_interrupt) -// MDRV_CPU_ADD("audiocpu", Z80, 3579545) +// MDRV_CPU_ADD("soundcpu", Z80, 3579545) // MDRV_CPU_PROGRAM_MAP(sub_map) + MDRV_MACHINE_START(kodb) + /* video hardware */ MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_REFRESH_RATE(60) @@ -844,5 +922,5 @@ ROM_START( kodb ) ROM_LOAD( "2.ic19", 0x00000, 0x40000, CRC(a2db1575) SHA1(1a4a29e4b045af50700adf1665697feab12cc234) ) ROM_END -GAME( 1990, fcrash, ffight, fcrash, fcrash, cps1, ROT0, "[Capcom] (Playmark bootleg)", "Final Crash (bootleg of Final Fight)", 0 ) -GAME( 1991, kodb, kod, kodb, kodb, cps1, ROT0, "[Capcom] (Playmark bootleg)", "The King of Dragons (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND ) // 910731 "ETC" +GAME( 1990, fcrash, ffight, fcrash, fcrash, cps1, ROT0, "[Capcom] (Playmark bootleg)", "Final Crash (bootleg of Final Fight)", GAME_SUPPORTS_SAVE ) +GAME( 1991, kodb, kod, kodb, kodb, cps1, ROT0, "[Capcom] (Playmark bootleg)", "The King of Dragons (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // 910731 "ETC" diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c index 9539837aa3d..d7d91713605 100644 --- a/src/mame/drivers/neodrvr.c +++ b/src/mame/drivers/neodrvr.c @@ -7227,8 +7227,8 @@ static DRIVER_INIT( fatfury2 ) static DRIVER_INIT ( kof98 ) { - kof98_decrypt_68k(machine); DRIVER_INIT_CALL(neogeo); + kof98_decrypt_68k(machine); install_kof98_protection(machine); } @@ -7240,310 +7240,335 @@ static DRIVER_INIT( mslugx ) static DRIVER_INIT( kof99 ) { - kof99_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x00); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + kof99_decrypt_68k(machine); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x00); kof99_install_protection(machine); } static DRIVER_INIT( kof99n ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x00); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x00); } static DRIVER_INIT( garou ) { - garou_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x06); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + garou_decrypt_68k(machine); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x06); garou_install_protection(machine); } static DRIVER_INIT( garouo ) { - garouo_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x06); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + garouo_decrypt_68k(machine); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x06); garouo_install_protection(machine); } static DRIVER_INIT( garoubl ) { + DRIVER_INIT_CALL(neogeo); neogeo_bootleg_sx_decrypt(machine, 2); neogeo_bootleg_cx_decrypt(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( mslug3 ) { - mslug3_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xad); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + mslug3_decrypt_68k(machine); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xad); mslug3_install_protection(machine); } static DRIVER_INIT( mslug3h ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xad); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xad); } static DRIVER_INIT( mslug3b6 ) { + DRIVER_INIT_CALL(neogeo); neogeo_bootleg_sx_decrypt(machine, 2); cmc42_neogeo_gfx_decrypt(machine, 0xad); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kof2000 ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); kof2000_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x00); - DRIVER_INIT_CALL(neogeo); kof2000_install_protection(machine); } static DRIVER_INIT( kof2000n ) { - neogeo_fixed_layer_bank_type = 2; + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x00); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kof2001 ) { - neogeo_fixed_layer_bank_type = 1; + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; kof2000_neogeo_gfx_decrypt(machine, 0x1e); neogeo_cmc50_m1_decrypt(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( cthd2003 ) { + DRIVER_INIT_CALL(neogeo); decrypt_cthd2003(machine); - DRIVER_INIT_CALL(neogeo); patch_cthd2003(machine); } static DRIVER_INIT ( ct2k3sp ) { - decrypt_ct2k3sp(machine); DRIVER_INIT_CALL(neogeo); + decrypt_ct2k3sp(machine); patch_cthd2003(machine); } static DRIVER_INIT ( ct2k3sa ) { - decrypt_ct2k3sa(machine); DRIVER_INIT_CALL(neogeo); + decrypt_ct2k3sa(machine); patch_ct2k3sa(machine); } static DRIVER_INIT( mslug4 ) { - neogeo_fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */ + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */ neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x31); - DRIVER_INIT_CALL(neogeo); neo_pcm2_snk_1999(machine, 8); } static DRIVER_INIT( ms4plus ) { + DRIVER_INIT_CALL(neogeo); cmc50_neogeo_gfx_decrypt(machine, 0x31); neo_pcm2_snk_1999(machine, 8); neogeo_cmc50_m1_decrypt(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( ganryu ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x07); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x07); } static DRIVER_INIT( s1945p ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x05); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x05); } static DRIVER_INIT( preisle2 ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0x9f); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0x9f); } static DRIVER_INIT( bangbead ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xf8); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xf8); } static DRIVER_INIT( nitd ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xff); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xff); } static DRIVER_INIT( zupapa ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xbd); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xbd); } static DRIVER_INIT( sengoku3 ) { - neogeo_fixed_layer_bank_type = 1; - kof99_neogeo_gfx_decrypt(machine, 0xfe); + neogeo_state *state = (neogeo_state *)machine->driver_data; DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; + kof99_neogeo_gfx_decrypt(machine, 0xfe); } static DRIVER_INIT( rotd ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); neo_pcm2_snk_1999(machine, 16); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x3f); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kof2002 ) { + DRIVER_INIT_CALL(neogeo); kof2002_decrypt_68k(machine); neo_pcm2_swap(machine, 0); neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0xec); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kof2002b ) { + DRIVER_INIT_CALL(neogeo); kof2002_decrypt_68k(machine); neo_pcm2_swap(machine, 0); neogeo_cmc50_m1_decrypt(machine); kof2002b_gfx_decrypt(machine, memory_region(machine, "sprites"),0x4000000); kof2002b_gfx_decrypt(machine, memory_region(machine, "fixed"),0x20000); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kf2k2pls ) { + DRIVER_INIT_CALL(neogeo); kof2002_decrypt_68k(machine); neo_pcm2_swap(machine, 0); neogeo_cmc50_m1_decrypt(machine); cmc50_neogeo_gfx_decrypt(machine, 0xec); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kf2k2mp ) { + DRIVER_INIT_CALL(neogeo); kf2k2mp_decrypt(machine); neo_pcm2_swap(machine, 0); neogeo_cmc50_m1_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 2); cmc50_neogeo_gfx_decrypt(machine, 0xec); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kf2k2mp2 ) { + DRIVER_INIT_CALL(neogeo); kf2k2mp2_px_decrypt(machine); neo_pcm2_swap(machine, 0); neogeo_cmc50_m1_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 1); cmc50_neogeo_gfx_decrypt(machine, 0xec); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kof10th ) { - decrypt_kof10th(machine); DRIVER_INIT_CALL(neogeo); + decrypt_kof10th(machine); install_kof10th_protection(machine); } static DRIVER_INIT( kf10thep ) { - decrypt_kf10thep(machine); DRIVER_INIT_CALL(neogeo); + decrypt_kf10thep(machine); } static DRIVER_INIT( kf2k5uni ) { - decrypt_kf2k5uni(machine); DRIVER_INIT_CALL(neogeo); + decrypt_kf2k5uni(machine); } static DRIVER_INIT( kof2k4se ) { - decrypt_kof2k4se_68k(machine); DRIVER_INIT_CALL(neogeo); + decrypt_kof2k4se_68k(machine); } static DRIVER_INIT( matrim ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); matrim_decrypt_68k(machine); neo_pcm2_swap(machine, 1); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x6a); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( matrimbl ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); matrim_decrypt_68k(machine); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; matrimbl_decrypt(machine); neogeo_sfix_decrypt(machine); /* required for text layer */ - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( pnyaa ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); neo_pcm2_snk_1999(machine, 4); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x2e); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( mslug5 ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); mslug5_decrypt_68k(machine); neo_pcm2_swap(machine, 2); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x19); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static TIMER_CALLBACK( ms5pcb_bios_timer_callback ) { int harddip3 = input_port_read(machine, "HARDDIP") & 1; - memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios")+0x20000+harddip3*0x20000); + memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios") + 0x20000 + harddip3 * 0x20000); } static DRIVER_INIT( ms5pcb ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + /* start a timer that will check the BIOS select DIP every second */ timer_set(machine, attotime_zero, NULL, 0, ms5pcb_bios_timer_callback); timer_pulse(machine, ATTOTIME_IN_MSEC(1000), NULL, 0, ms5pcb_bios_timer_callback); @@ -7552,32 +7577,35 @@ static DRIVER_INIT( ms5pcb ) svcpcb_gfx_decrypt(machine); neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x19); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; svcpcb_s1data_decrypt(machine); neo_pcm2_swap(machine, 2); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( ms5plus ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); cmc50_neogeo_gfx_decrypt(machine, 0x19); neo_pcm2_swap(machine, 2); neogeo_bootleg_sx_decrypt(machine, 1); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); - DRIVER_INIT_CALL(neogeo); install_ms5plus_protection(machine); } static TIMER_CALLBACK( svcpcb_bios_timer_callback ) { int harddip3 = input_port_read(machine, "HARDDIP") & 1; - memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios")+0x20000+harddip3*0x20000); + memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios") + 0x20000 + harddip3 * 0x20000); } static DRIVER_INIT( svcpcb ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + /* start a timer that will check the BIOS select DIP every second */ timer_set(machine, attotime_zero, NULL, 0, svcpcb_bios_timer_callback); timer_pulse(machine, ATTOTIME_IN_MSEC(1000), NULL, 0, svcpcb_bios_timer_callback); @@ -7588,78 +7616,81 @@ static DRIVER_INIT( svcpcb ) kof2000_neogeo_gfx_decrypt(machine, 0x57); svcpcb_s1data_decrypt(machine); neo_pcm2_swap(machine, 3); - neogeo_fixed_layer_bank_type = 2; - DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 2; install_pvc_protection(machine); } static DRIVER_INIT( svc ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); svc_px_decrypt(machine); neo_pcm2_swap(machine, 3); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x57); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( svcboot ) { + DRIVER_INIT_CALL(neogeo); svcboot_px_decrypt(machine); svcboot_cx_decrypt(machine); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( svcplus ) { + DRIVER_INIT_CALL(neogeo); svcplus_px_decrypt(machine); svcboot_cx_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 1); svcplus_px_hack(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( svcplusa ) { + DRIVER_INIT_CALL(neogeo); svcplusa_px_decrypt(machine); svcboot_cx_decrypt(machine); svcplus_px_hack(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( svcsplus ) { + DRIVER_INIT_CALL(neogeo); svcsplus_px_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 2); svcboot_cx_decrypt(machine); svcsplus_px_hack(machine); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( samsho5 ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); samsho5_decrypt_68k(machine); neo_pcm2_swap(machine, 4); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x0f); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( samsho5b ) { + DRIVER_INIT_CALL(neogeo); samsho5b_px_decrypt(machine); samsho5b_vx_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 1); neogeo_bootleg_cx_decrypt(machine); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( kf2k3pcb ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); kf2k3pcb_decrypt_68k(machine); kf2k3pcb_gfx_decrypt(machine); kof2003biosdecode(machine); @@ -7671,7 +7702,7 @@ static DRIVER_INIT( kf2k3pcb ) { int i; UINT8* rom = memory_region(machine, "audiocpu"); - for (i=0;i<0x90000;i++) + for (i = 0; i < 0x90000; i++) { rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2); } @@ -7681,76 +7712,80 @@ static DRIVER_INIT( kf2k3pcb ) kof2000_neogeo_gfx_decrypt(machine, 0x9d); kf2k3pcb_decrypt_s1data(machine); neo_pcm2_swap(machine, 5); - neogeo_fixed_layer_bank_type = 2; - DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 2; install_pvc_protection(machine); memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc00000, 0xc7ffff, 0, 0, "bios" ); // 512k bios } static DRIVER_INIT( kof2003 ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); kof2003_decrypt_68k(machine); neo_pcm2_swap(machine, 5); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x9d); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( kof2003h ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); kof2003h_decrypt_68k(machine); neo_pcm2_swap(machine, 5); - neogeo_fixed_layer_bank_type = 2; + state->fixed_layer_bank_type = 2; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x9d); - DRIVER_INIT_CALL(neogeo); install_pvc_protection(machine); } static DRIVER_INIT( kf2k3bl ) { + DRIVER_INIT_CALL(neogeo); cmc50_neogeo_gfx_decrypt(machine, 0x9d); neo_pcm2_swap(machine, 5); neogeo_bootleg_sx_decrypt(machine, 1); - DRIVER_INIT_CALL(neogeo); kf2k3bl_install_protection(machine); } static DRIVER_INIT( kf2k3pl ) { + DRIVER_INIT_CALL(neogeo); cmc50_neogeo_gfx_decrypt(machine, 0x9d); neo_pcm2_swap(machine, 5); kf2k3pl_px_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 1); - DRIVER_INIT_CALL(neogeo); kf2k3pl_install_protection(machine); } static DRIVER_INIT( kf2k3upl ) { + DRIVER_INIT_CALL(neogeo); cmc50_neogeo_gfx_decrypt(machine, 0x9d); neo_pcm2_swap(machine, 5); kf2k3upl_px_decrypt(machine); neogeo_bootleg_sx_decrypt(machine, 2); - DRIVER_INIT_CALL(neogeo); kf2k3upl_install_protection(machine); } static DRIVER_INIT( samsh5sp ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); samsh5sp_decrypt_68k(machine); neo_pcm2_swap(machine, 6); - neogeo_fixed_layer_bank_type = 1; + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0x0d); - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( jockeygp ) { - neogeo_fixed_layer_bank_type = 1; + neogeo_state *state = (neogeo_state *)machine->driver_data; + DRIVER_INIT_CALL(neogeo); + state->fixed_layer_bank_type = 1; neogeo_cmc50_m1_decrypt(machine); kof2000_neogeo_gfx_decrypt(machine, 0xac); @@ -7759,8 +7794,6 @@ static DRIVER_INIT( jockeygp ) // memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x280000, 0x280001, 0, 0, "IN5"); // memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2c0000, 0x2c0001, 0, 0, "IN6"); - - DRIVER_INIT_CALL(neogeo); } static DRIVER_INIT( vliner ) @@ -7796,302 +7829,301 @@ static DRIVER_INIT( lans2004 ) /***********************************************************************/ -/* YEAR NAME PARENT MACHINE INPUT INIT MONITOR */ -GAME( 1990, neogeo, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT ) +/* YEAR NAME PARENT MACHINE INPUT INIT MONITOR */ +GAME( 1990, neogeo, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT | GAME_SUPPORTS_SAVE ) /* SNK */ -GAME( 1990, nam1975, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "NAM-1975", 0 ) -GAME( 1990, bstars, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 1)", 0 ) -GAME( 1990, bstarsh, bstars, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 2)", 0 ) -GAME( 1990, tpgolf, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Player's Golf", 0 ) -GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo, neogeo, ROT0, "SNK", "Mahjong Kyoretsuden", 0 ) -GAME( 1990, ridhero, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Riding Hero (set 1)", 0 ) -GAME( 1990, ridheroh, ridhero, neogeo, neogeo, neogeo, ROT0, "SNK", "Riding Hero (set 2)", 0 ) -GAME( 1991, alpham2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", 0 ) -GAME( 1990, cyberlip, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Cyber-Lip", 0 ) -GAME( 1990, superspy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The Super Spy", 0 ) -GAME( 1992, mutnat, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Mutation Nation", 0 ) -GAME( 1991, kotm, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters (set 1)", 0 ) -GAME( 1991, kotmh, kotm, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters (set 2)", 0 ) -GAME( 1991, sengoku, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku / Sengoku Denshou (set 1)", 0 ) -GAME( 1991, sengokh, sengoku, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku / Sengoku Denshou (set 2)", 0 ) -GAME( 1991, burningf, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Burning Fight (set 1)", 0 ) -GAME( 1991, burningfh,burningf, neogeo, neogeo, neogeo, ROT0, "SNK", "Burning Fight (set 2)", 0 ) -GAME( 1990, lbowling, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "League Bowling", 0 ) -GAME( 1991, gpilots, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Ghost Pilots (set 1)", 0 ) -GAME( 1991, gpilotsh, gpilots, neogeo, neogeo, neogeo, ROT0, "SNK", "Ghost Pilots (set 2)", 0 ) -GAME( 1990, joyjoy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 ) -GAME( 1991, quizdais, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 ) -GAME( 1992, lresort, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Resort", 0 ) -GAME( 1991, eightman, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "Eight Man", 0 ) -GAME( 1991, legendos, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", 0 ) -GAME( 1991, 2020bb, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", 0 ) -GAME( 1991, 2020bba, 2020bb, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", 0 ) -GAME( 1991, 2020bbh, 2020bb, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", 0 ) -GAME( 1991, socbrawl, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Soccer Brawl (set 1)", 0 ) -GAME( 1991, socbrawla, socbrawl, neogeo, neogeo, neogeo, ROT0, "SNK", "Soccer Brawl (set 2)", 0 ) -GAME( 1991, fatfury1, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", 0 ) -GAME( 1991, roboarmy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Robo Army", 0 ) -//GAME( 1991, roboarma, roboarmy, neogeo, neogeo, neogeo, ROT0, "SNK", "Robo Army (set 2)", 0 ) -GAME( 1992, fbfrenzy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Football Frenzy", 0 ) -GAME( 1992, kotm2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 ) -GAME( 1993, sengoku2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0 ) -GAME( 1992, bstars2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars 2", 0 ) -GAME( 1992, quizdai2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", 0 ) -GAME( 1993, 3countb, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "3 Count Bout / Fire Suplex", 0 ) -GAME( 1992, aof, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 ) -GAME( 1993, samsho, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 1)", 0 ) -GAME( 1993, samshoh, samsho, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 2)", 0 ) -GAME( 1994, tophuntr, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 ) -GAME( 1994, tophuntrh,tophuntr, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 ) -GAME( 1992, fatfury2, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 ) -GAME( 1992, ssideki, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 ) -GAME( 1994, kof94, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '94", 0 ) -GAME( 1994, aof2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", 0 ) -GAME( 1994, aof2a, aof2, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", 0 ) -GAME( 1993, fatfursp, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 1)", 0 ) -GAME( 1993, fatfursa, fatfursp, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 2)", 0 ) -GAME( 1995, savagere, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", 0 ) -GAME( 1994, ssideki2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football", 0 ) -GAME( 1994, samsho2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen", 0 ) -GAME( 1994, samsho2k, samsho2, neogeo, neogeo, neogeo, ROT0, "SNK", "Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II)", 0 ) // official or hack? -GAME( 1995, fatfury3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", 0 ) -GAME( 1995, ssideki3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", 0 ) -GAME( 1995, kof95, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 ) -GAME( 1995, kof95h, kof95, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 ) -GAME( 1995, samsho3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 ) -GAME( 1995, samsho3h, samsho3, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 ) -GAME( 1995, fswords, samsho3, neogeo, neogeo, neogeo, ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 ) -GAME( 1995, rbff1, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 ) -GAME( 1995, rbff1a, rbff1, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision)", 0 ) -GAME( 1996, aof3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 ) -GAME( 1996, aof3k, aof3, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode -GAME( 1996, kof96, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 ) -GAME( 1996, kof96h, kof96, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 2)", 0 ) -GAME( 1996, ssideki4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero, The", 0 ) -GAME( 1996, kizuna, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", 0 ) -GAME( 1996, samsho4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", 0 ) -GAME( 1996, samsho4k, samsho4, neogeo, neogeo, neogeo, ROT0, "SNK", "Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV)", 0 ) -GAME( 1996, rbffspec, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", 0 ) -GAME( 1997, kof97, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 ) -GAME( 1997, kof97h, kof97, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 ) -GAME( 1997, kof97pls, kof97, neogeo, neogeo, neogeo, ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 ) -GAME( 1997, kog, kof97, neogeo, kog, kog, ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING) // protected bootleg -GAME( 1997, lastblad, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", 0 ) -GAME( 1997, lastbladh,lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", 0 ) -GAME( 1997, lastsold, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", 0 ) -GAME( 1997, irrmaze, neogeo, neogeo, irrmaze, neogeo, ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", 0 ) -GAME( 1998, rbff2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", 0 ) -GAME( 1998, rbff2h, rbff2, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 2)", 0 ) -GAME( 1998, rbff2k, rbff2, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", 0 ) // no Japanese title / mode -GAME( 1998, mslug2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", 0 ) -GAME( 1998, kof98, neogeo, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", 0 ) -GAME( 1998, kof98k, kof98, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", 0 ) -GAME( 1998, kof98n, kof98, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", 0 ) -GAME( 1998, lastbld2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi, The", 0 ) -GAME( 1998, neocup98, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", 0 ) -GAME( 1999, mslugx, neogeo, neogeo, neogeo, mslugx, ROT0, "SNK", "Metal Slug X - Super Vehicle-001", 0 ) -GAME( 1999, kof99, neogeo, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , 0 ) /* Encrypted Code & GFX */ -GAME( 1999, kof99a, kof99, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , 0 ) /* Encrypted Code & GFX, crashes going into attract demo */ -GAME( 1999, kof99e, kof99, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , 0 ) /* Encrypted Code & GFX */ -GAME( 1999, kof99n, kof99, neogeo, neogeo, kof99n, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , 0 ) /* Encrypted GFX */ -GAME( 1999, kof99p, kof99, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", 0 ) -GAME( 1999, garou, neogeo, neogeo, neogeo, garou, ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , 0 ) /* Encrypted Code & GFX */ -GAME( 1999, garouo, garou, neogeo, neogeo, garouo, ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , 0 ) /* Encrypted Code & GFX */ -GAME( 1999, garoup, garou, neogeo, neogeo, neogeo, ROT0, "SNK", "Garou - Mark of the Wolves (prototype)", 0 ) -GAME( 1999, garoubl, garou, neogeo, neogeo, garoubl, ROT0, "bootleg", "Garou - Mark of the Wolves (bootleg)", 0 ) /* Bootleg of garoup */ -GAME( 2000, mslug3, neogeo, neogeo, neogeo, mslug3, ROT0, "SNK", "Metal Slug 3" , 0 ) /* Encrypted Code & GFX */ -GAME( 2000, mslug3h, mslug3, neogeo, neogeo, mslug3h, ROT0, "SNK", "Metal Slug 3 (not encrypted)" , 0 ) /* Encrypted GFX */ -GAME( 2000, mslug3b6, mslug3, neogeo, neogeo, mslug3b6, ROT0, "bootleg", "Metal Slug 6 (Metal Slug 3 bootleg)", 0 ) /* real Metal Slug 6 is an Atomiswave HW game, see atomswav.c ;-) */ -GAME( 2000, kof2000, neogeo, neogeo, neogeo, kof2000, ROT0, "SNK", "The King of Fighters 2000" , 0 ) /* Encrypted Code & GFX */ -GAME( 2000, kof2000n, kof2000, neogeo, neogeo, kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0 ) /* Encrypted GFX */ -GAME( 2001, zupapa, neogeo, neogeo, neogeo, zupapa, ROT0, "SNK", "Zupapa!" , 0 ) /* Encrypted GFX */ -GAME( 2001, sengoku3, neogeo, neogeo, neogeo, sengoku3, ROT0, "Noise Factory / SNK", "Sengoku 3 / Sengoku Densho 2001" , 0 ) /* Encrypted GFX */ -GAME( 2001, kof2001, neogeo, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0 ) /* Encrypted GFX */ -GAME( 2001, kof2001h, kof2001, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0 ) /* Encrypted GFX */ -GAME( 2003, cthd2003, kof2001, neogeo, neogeo, cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */ -GAME( 2003, ct2k3sp, kof2001, neogeo, neogeo, ct2k3sp, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */ -GAME( 2003, ct2k3sa, kof2001, neogeo, neogeo, ct2k3sa, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", 0 ) /* Hack / Bootleg of kof2001 */ -GAME( 2002, kof2002, neogeo, neogeo, neogeo, kof2002, ROT0, "Eolith / Playmore", "The King of Fighters 2002" , 0 ) /* Encrypted GFX */ -GAME( 2002, kof2002b, kof2002, neogeo, neogeo, kof2002b, ROT0, "bootleg", "The King of Fighters 2002 (bootleg)", 0 ) -GAME( 2002, kf2k2pls, kof2002, neogeo, neogeo, kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 1)" , 0 ) /* Encrypted GFX */ -GAME( 2002, kf2k2pla, kof2002, neogeo, neogeo, kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 2)" , 0 ) /* Encrypted GFX */ -GAME( 2002, kf2k2mp, kof2002, neogeo, neogeo, kf2k2mp, ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , 0 ) /* Encrypted GFX */ -GAME( 2002, kf2k2mp2, kof2002, neogeo, neogeo, kf2k2mp2, ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , 0 ) /* Encrypted GFX */ -GAME( 2002, kof10th, kof2002, neogeo, neogeo, kof10th, ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright -GAME( 2005, kf10thep, kof2002, neogeo, neogeo, kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright -GAME( 2004, kf2k5uni, kof2002, neogeo, neogeo, kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright -GAME( 2004, kof2k4se, kof2002, neogeo, neogeo, kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */ -GAME( 2003, mslug5, neogeo, neogeo, neogeo, mslug5, ROT0, "SNK Playmore", "Metal Slug 5", 0 ) -GAME( 2003, mslug5h, mslug5, neogeo, neogeo, mslug5, ROT0, "SNK Playmore", "Metal Slug 5 (AES Cart)", 0 ) /* Also found in later MVS carts */ -GAME( 2003, ms5pcb, 0, neogeo, ms5pcb, ms5pcb, ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 ) -GAME( 2003, ms5plus, mslug5, neogeo, neogeo, ms5plus, ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 ) -GAME( 2003, svcpcb, 0, neogeo, svcpcb, svcpcb, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 1)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart. -GAME( 2003, svcpcba, svcpcb, neogeo, svcpcb, svcpcb, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */ -GAME( 2003, svc, neogeo, neogeo, neogeo, svc, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", 0 ) -GAME( 2003, svcboot, svc, neogeo, neogeo, svcboot, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)", 0 ) -GAME( 2003, svcplus, svc, neogeo, neogeo, svcplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1)", 0 ) -GAME( 2003, svcplusa, svc, neogeo, neogeo, svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2)", 0 ) -GAME( 2003, svcsplus, svc, neogeo, neogeo, svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)", 0 ) -GAME( 2003, samsho5, neogeo, neogeo, neogeo, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", 0 ) -GAME( 2003, samsho5h, samsho5, neogeo, neogeo, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 ) -GAME( 2003, samsho5b, samsho5, neogeo, neogeo, samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling -GAME( 2003, kf2k3pcb, 0, neogeo, neogeo, kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart. -GAME( 2003, kof2003, neogeo, neogeo, neogeo, kof2003, ROT0, "SNK Playmore", "The King of Fighters 2003 (set 1)", 0 ) -GAME( 2003, kof2003h, kof2003, neogeo, neogeo, kof2003h, ROT0, "SNK Playmore", "The King of Fighters 2003 (set 2)", 0 ) -GAME( 2003, kf2k3bl, kof2003, neogeo, neogeo, kf2k3bl , ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?) -GAME( 2003, kf2k3bla, kof2003, neogeo, neogeo, kf2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart -GAME( 2003, kf2k3pl, kof2003, neogeo, neogeo, kf2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart -GAME( 2003, kf2k3upl, kof2003, neogeo, neogeo, kf2k3upl, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart -GAME( 2003, samsh5sp, neogeo, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", 0 ) -GAME( 2003, samsh5sph,samsh5sp, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", 0 ) -GAME( 2003, samsh5spn,samsh5sp, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", 0 ) +GAME( 1990, nam1975, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "NAM-1975", GAME_SUPPORTS_SAVE ) +GAME( 1990, bstars, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, bstarsh, bstars, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars Professional (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, tpgolf, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Player's Golf", GAME_SUPPORTS_SAVE ) +GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo, neogeo, ROT0, "SNK", "Mahjong Kyoretsuden", GAME_SUPPORTS_SAVE ) +GAME( 1990, ridhero, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Riding Hero (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, ridheroh, ridhero, neogeo, neogeo, neogeo, ROT0, "SNK", "Riding Hero (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, alpham2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", GAME_SUPPORTS_SAVE ) +GAME( 1990, cyberlip, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Cyber-Lip", GAME_SUPPORTS_SAVE ) +GAME( 1990, superspy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The Super Spy", GAME_SUPPORTS_SAVE ) +GAME( 1992, mutnat, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Mutation Nation", GAME_SUPPORTS_SAVE ) +GAME( 1991, kotm, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, kotmh, kotm, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sengoku, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku / Sengoku Denshou (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, sengokh, sengoku, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku / Sengoku Denshou (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, burningf, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Burning Fight (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, burningfh, burningf, neogeo, neogeo, neogeo, ROT0, "SNK", "Burning Fight (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, lbowling, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "League Bowling", GAME_SUPPORTS_SAVE ) +GAME( 1991, gpilots, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Ghost Pilots (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, gpilotsh, gpilots, neogeo, neogeo, neogeo, ROT0, "SNK", "Ghost Pilots (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, joyjoy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Puzzled / Joy Joy Kid", GAME_SUPPORTS_SAVE ) +GAME( 1991, quizdais, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", GAME_SUPPORTS_SAVE ) +GAME( 1992, lresort, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Resort", GAME_SUPPORTS_SAVE ) +GAME( 1991, eightman, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "Eight Man", GAME_SUPPORTS_SAVE ) +GAME( 1991, legendos, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", GAME_SUPPORTS_SAVE ) +GAME( 1991, 2020bb, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, 2020bba, 2020bb, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, 2020bbh, 2020bb, neogeo, neogeo, neogeo, ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", GAME_SUPPORTS_SAVE ) +GAME( 1991, socbrawl, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Soccer Brawl (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, socbrawla, socbrawl, neogeo, neogeo, neogeo, ROT0, "SNK", "Soccer Brawl (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, fatfury1, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", GAME_SUPPORTS_SAVE ) +GAME( 1991, roboarmy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Robo Army", GAME_SUPPORTS_SAVE ) +//GAME( 1991, roboarma, roboarmy, neogeo, neogeo, neogeo, ROT0, "SNK", "Robo Army (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1992, fbfrenzy, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Football Frenzy", GAME_SUPPORTS_SAVE ) +GAME( 1992, kotm2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "King of the Monsters 2 - The Next Thing", GAME_SUPPORTS_SAVE ) +GAME( 1993, sengoku2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", GAME_SUPPORTS_SAVE ) +GAME( 1992, bstars2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Baseball Stars 2", GAME_SUPPORTS_SAVE ) +GAME( 1992, quizdai2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", GAME_SUPPORTS_SAVE ) +GAME( 1993, 3countb, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "3 Count Bout / Fire Suplex", GAME_SUPPORTS_SAVE ) +GAME( 1992, aof, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", GAME_SUPPORTS_SAVE ) +GAME( 1993, samsho, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1993, samshoh, samsho, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1994, tophuntr, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, tophuntrh, tophuntr, neogeo, neogeo, neogeo, ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1992, fatfury2, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", GAME_SUPPORTS_SAVE ) +GAME( 1992, ssideki, neogeo, neogeo, neogeo, fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", GAME_SUPPORTS_SAVE ) +GAME( 1994, kof94, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '94", GAME_SUPPORTS_SAVE ) +GAME( 1994, aof2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, aof2a, aof2, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1993, fatfursp, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1993, fatfursa, fatfursp, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1995, savagere, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", GAME_SUPPORTS_SAVE ) +GAME( 1994, ssideki2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football", GAME_SUPPORTS_SAVE ) +GAME( 1994, samsho2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen", GAME_SUPPORTS_SAVE ) +GAME( 1994, samsho2k, samsho2, neogeo, neogeo, neogeo, ROT0, "SNK", "Saulabi Spirits / Jin Saulabi Tu Hon (Korean release of Samurai Shodown II)", GAME_SUPPORTS_SAVE ) // official or hack? +GAME( 1995, fatfury3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", GAME_SUPPORTS_SAVE ) +GAME( 1995, ssideki3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", GAME_SUPPORTS_SAVE ) +GAME( 1995, kof95, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '95 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1995, kof95h, kof95, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '95 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1995, samsho3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1995, samsho3h, samsho3, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1995, fswords, samsho3, neogeo, neogeo, neogeo, ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", GAME_SUPPORTS_SAVE ) +GAME( 1995, rbff1, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", GAME_SUPPORTS_SAVE ) +GAME( 1995, rbff1a, rbff1, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision)", GAME_SUPPORTS_SAVE ) +GAME( 1996, aof3, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", GAME_SUPPORTS_SAVE ) +GAME( 1996, aof3k, aof3, neogeo, neogeo, neogeo, ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", GAME_SUPPORTS_SAVE ) // no Japanese title / mode +GAME( 1996, kof96, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1996, kof96h, kof96, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '96 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1996, ssideki4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero, The", GAME_SUPPORTS_SAVE ) +GAME( 1996, kizuna, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", GAME_SUPPORTS_SAVE ) +GAME( 1996, samsho4, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", GAME_SUPPORTS_SAVE ) +GAME( 1996, samsho4k, samsho4, neogeo, neogeo, neogeo, ROT0, "SNK", "Pae Wang Jeon Seol / Legend of a Warrior (Korean censored Samurai Shodown IV)", GAME_SUPPORTS_SAVE ) +GAME( 1996, rbffspec, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", GAME_SUPPORTS_SAVE ) +GAME( 1997, kof97, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1997, kof97h, kof97, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '97 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1997, kof97pls, kof97, neogeo, neogeo, neogeo, ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1997, kog, kof97, neogeo, kog, kog, ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // protected bootleg +GAME( 1997, lastblad, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1997, lastbladh, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1997, lastsold, lastblad, neogeo, neogeo, neogeo, ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", GAME_SUPPORTS_SAVE ) +GAME( 1997, irrmaze, neogeo, neogeo, irrmaze, neogeo, ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", GAME_SUPPORTS_SAVE ) +GAME( 1998, rbff2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1998, rbff2h, rbff2, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1998, rbff2k, rbff2, neogeo, neogeo, neogeo, ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", GAME_SUPPORTS_SAVE ) // no Japanese title / mode +GAME( 1998, mslug2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", GAME_SUPPORTS_SAVE ) +GAME( 1998, kof98, neogeo, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", GAME_SUPPORTS_SAVE ) +GAME( 1998, kof98k, kof98, neogeo, neogeo, kof98, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", GAME_SUPPORTS_SAVE ) +GAME( 1998, kof98n, kof98, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", GAME_SUPPORTS_SAVE ) +GAME( 1998, lastbld2, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi, The", GAME_SUPPORTS_SAVE ) +GAME( 1998, neocup98, neogeo, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", GAME_SUPPORTS_SAVE ) +GAME( 1999, mslugx, neogeo, neogeo, neogeo, mslugx, ROT0, "SNK", "Metal Slug X - Super Vehicle-001", GAME_SUPPORTS_SAVE ) +GAME( 1999, kof99, neogeo, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 1999, kof99a, kof99, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX, crashes going into attract demo */ +GAME( 1999, kof99e, kof99, neogeo, neogeo, kof99, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 1999, kof99n, kof99, neogeo, neogeo, kof99n, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 1999, kof99p, kof99, neogeo, neogeo, neogeo, ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", GAME_SUPPORTS_SAVE ) +GAME( 1999, garou, neogeo, neogeo, neogeo, garou, ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 1999, garouo, garou, neogeo, neogeo, garouo, ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 1999, garoup, garou, neogeo, neogeo, neogeo, ROT0, "SNK", "Garou - Mark of the Wolves (prototype)", GAME_SUPPORTS_SAVE ) +GAME( 1999, garoubl, garou, neogeo, neogeo, garoubl, ROT0, "bootleg", "Garou - Mark of the Wolves (bootleg)", GAME_SUPPORTS_SAVE ) /* Bootleg of garoup */ +GAME( 2000, mslug3, neogeo, neogeo, neogeo, mslug3, ROT0, "SNK", "Metal Slug 3" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 2000, mslug3h, mslug3, neogeo, neogeo, mslug3h, ROT0, "SNK", "Metal Slug 3 (not encrypted)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2000, mslug3b6, mslug3, neogeo, neogeo, mslug3b6, ROT0, "bootleg", "Metal Slug 6 (Metal Slug 3 bootleg)", GAME_SUPPORTS_SAVE ) /* real Metal Slug 6 is an Atomiswave HW game, see atomswav.c ;-) */ +GAME( 2000, kof2000, neogeo, neogeo, neogeo, kof2000, ROT0, "SNK", "The King of Fighters 2000" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */ +GAME( 2000, kof2000n, kof2000, neogeo, neogeo, kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2001, zupapa, neogeo, neogeo, neogeo, zupapa, ROT0, "SNK", "Zupapa!" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2001, sengoku3, neogeo, neogeo, neogeo, sengoku3, ROT0, "Noise Factory / SNK", "Sengoku 3 / Sengoku Densho 2001" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2001, kof2001, neogeo, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2001, kof2001h, kof2001, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2003, cthd2003, kof2001, neogeo, neogeo, cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", GAME_SUPPORTS_SAVE ) /* Protected Hack / Bootleg of kof2001 */ +GAME( 2003, ct2k3sp, kof2001, neogeo, neogeo, ct2k3sp, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", GAME_SUPPORTS_SAVE ) /* Protected Hack / Bootleg of kof2001 */ +GAME( 2003, ct2k3sa, kof2001, neogeo, neogeo, ct2k3sa, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", GAME_SUPPORTS_SAVE ) /* Hack / Bootleg of kof2001 */ +GAME( 2002, kof2002, neogeo, neogeo, neogeo, kof2002, ROT0, "Eolith / Playmore", "The King of Fighters 2002" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2002, kof2002b, kof2002, neogeo, neogeo, kof2002b, ROT0, "bootleg", "The King of Fighters 2002 (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2002, kf2k2pls, kof2002, neogeo, neogeo, kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2002, kf2k2pla, kof2002, neogeo, neogeo, kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (bootleg set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2002, kf2k2mp, kof2002, neogeo, neogeo, kf2k2mp, ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2002, kf2k2mp2, kof2002, neogeo, neogeo, kf2k2mp2, ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2002, kof10th, kof2002, neogeo, neogeo, kof10th, ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", GAME_SUPPORTS_SAVE ) // fake SNK copyright +GAME( 2005, kf10thep, kof2002, neogeo, neogeo, kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", GAME_SUPPORTS_SAVE ) // fake SNK copyright +GAME( 2004, kf2k5uni, kof2002, neogeo, neogeo, kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", GAME_SUPPORTS_SAVE ) // fake SNK copyright +GAME( 2004, kof2k4se, kof2002, neogeo, neogeo, kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", GAME_SUPPORTS_SAVE ) /* Hack / Bootleg of kof2002 */ +GAME( 2003, mslug5, neogeo, neogeo, neogeo, mslug5, ROT0, "SNK Playmore", "Metal Slug 5", GAME_SUPPORTS_SAVE ) +GAME( 2003, mslug5h, mslug5, neogeo, neogeo, mslug5, ROT0, "SNK Playmore", "Metal Slug 5 (AES Cart)", GAME_SUPPORTS_SAVE ) /* Also found in later MVS carts */ +GAME( 2003, ms5pcb, 0, neogeo, ms5pcb, ms5pcb, ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", GAME_SUPPORTS_SAVE ) +GAME( 2003, ms5plus, mslug5, neogeo, neogeo, ms5plus, ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2003, svcpcb, 0, neogeo, svcpcb, svcpcb, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 1)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. +GAME( 2003, svcpcba, svcpcb, neogeo, svcpcb, svcpcb, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code */ +GAME( 2003, svc, neogeo, neogeo, neogeo, svc, ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", GAME_SUPPORTS_SAVE ) +GAME( 2003, svcboot, svc, neogeo, neogeo, svcboot, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2003, svcplus, svc, neogeo, neogeo, svcplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1)", GAME_SUPPORTS_SAVE ) +GAME( 2003, svcplusa, svc, neogeo, neogeo, svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2)", GAME_SUPPORTS_SAVE ) +GAME( 2003, svcsplus, svc, neogeo, neogeo, svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 2003, samsho5, neogeo, neogeo, neogeo, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 2003, samsho5h, samsho5, neogeo, neogeo, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 2003, samsho5b, samsho5, neogeo, neogeo, samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", GAME_SUPPORTS_SAVE ) // different program scrambling +GAME( 2003, kf2k3pcb, 0, neogeo, neogeo, kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. +GAME( 2003, kof2003, neogeo, neogeo, neogeo, kof2003, ROT0, "SNK Playmore", "The King of Fighters 2003 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 2003, kof2003h, kof2003, neogeo, neogeo, kof2003h, ROT0, "SNK Playmore", "The King of Fighters 2003 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 2003, kf2k3bl, kof2003, neogeo, neogeo, kf2k3bl , ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", GAME_SUPPORTS_SAVE ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?) +GAME( 2003, kf2k3bla, kof2003, neogeo, neogeo, kf2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 2)", GAME_SUPPORTS_SAVE ) // zooming is wrong because its a bootleg of the pcb version on a cart +GAME( 2003, kf2k3pl, kof2003, neogeo, neogeo, kf2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", GAME_SUPPORTS_SAVE ) // zooming is wrong because its a bootleg of the pcb version on a cart +GAME( 2003, kf2k3upl, kof2003, neogeo, neogeo, kf2k3upl, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)", GAME_SUPPORTS_SAVE ) // zooming is wrong because its a bootleg of the pcb version on a cart +GAME( 2003, samsh5sp, neogeo, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", GAME_SUPPORTS_SAVE ) +GAME( 2003, samsh5sph, samsh5sp, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", GAME_SUPPORTS_SAVE ) +GAME( 2003, samsh5spn, samsh5sp, neogeo, neogeo, samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", GAME_SUPPORTS_SAVE ) /* there are other bootlegs kof96ep, kf2k1pls etc.? -- work out which should be supported */ /* Alpha Denshi Co. / ADK (changed name in 1993) */ -GAME( 1990, maglord, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Magician Lord (set 1)", 0 ) -GAME( 1990, maglordh, maglord, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Magician Lord (set 2)", 0 ) -GAME( 1990, ncombat, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", 0 ) -GAME( 1990, ncombath, ncombat, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", 0 ) -GAME( 1990, bjourney, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Blue's Journey / Raguy", 0 ) -GAME( 1991, crsword, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Crossed Swords", 0 ) -GAME( 1991, trally, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Thrash Rally", 0 ) -GAME( 1992, ncommand, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Commando", 0 ) -GAME( 1992, wh1, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 1)", 0 ) -GAME( 1992, wh1h, wh1, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 2)", 0 ) -GAME( 1992, wh1ha, wh1, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 3)", 0 ) -GAME( 1993, wh2, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "World Heroes 2", 0 ) -GAME( 1994, wh2j, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes 2 Jet (set 1)", 0 ) -GAME( 1994, wh2jh, wh2j, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes 2 Jet (set 2)", 0 ) -GAME( 1994, aodk, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", 0 ) -GAME( 1995, whp, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes Perfect", 0 ) -GAME( 1995, mosyougi, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Syougi No Tatsujin - Master of Syougi", 0 ) -GAME( 1996, overtop, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "Over Top", 0 ) -GAME( 1996, ninjamas, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Ninja Master's - haoh-ninpo-cho", 0 ) -GAME( 1996, twinspri, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "Twinkle Star Sprites", 0 ) -GAME( 1996, zintrckb, neogeo, neogeo, neogeo, neogeo, ROT0, "hack / bootleg", "Zintrick / Oshidashi Zentrix (hack / bootleg)", 0 ) +GAME( 1990, maglord, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Magician Lord (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, maglordh, maglord, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Magician Lord (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, ncombat, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, ncombath, ncombat, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, bjourney, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Blue's Journey / Raguy", GAME_SUPPORTS_SAVE ) +GAME( 1991, crsword, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Crossed Swords", GAME_SUPPORTS_SAVE ) +GAME( 1991, trally, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Thrash Rally", GAME_SUPPORTS_SAVE ) +GAME( 1992, ncommand, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "Ninja Commando", GAME_SUPPORTS_SAVE ) +GAME( 1992, wh1, neogeo, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1992, wh1h, wh1, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1992, wh1ha, wh1, neogeo, neogeo, neogeo, ROT0, "Alpha Denshi Co.", "World Heroes (set 3)", GAME_SUPPORTS_SAVE ) +GAME( 1993, wh2, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "World Heroes 2", GAME_SUPPORTS_SAVE ) +GAME( 1994, wh2j, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes 2 Jet (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, wh2jh, wh2j, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes 2 Jet (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1994, aodk, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", GAME_SUPPORTS_SAVE ) +GAME( 1995, whp, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "World Heroes Perfect", GAME_SUPPORTS_SAVE ) +GAME( 1995, mosyougi, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Syougi No Tatsujin - Master of Syougi", GAME_SUPPORTS_SAVE ) +GAME( 1996, overtop, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "Over Top", GAME_SUPPORTS_SAVE ) +GAME( 1996, ninjamas, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK / SNK", "Ninja Master's - haoh-ninpo-cho", GAME_SUPPORTS_SAVE ) +GAME( 1996, twinspri, neogeo, neogeo, neogeo, neogeo, ROT0, "ADK", "Twinkle Star Sprites", GAME_SUPPORTS_SAVE ) +GAME( 1996, zintrckb, neogeo, neogeo, neogeo, neogeo, ROT0, "hack / bootleg", "Zintrick / Oshidashi Zentrix (hack / bootleg)", GAME_SUPPORTS_SAVE ) /* Aicom (was a part of Sammy) / Yumekobo (changed name in 1996) */ -GAME( 1992, viewpoin, neogeo, neogeo, neogeo, neogeo, ROT0, "Sammy / Aicom", "Viewpoint", 0 ) -GAME( 1994, janshin, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Aicom", "Jyanshin Densetsu - Quest of Jongmaster", 0 ) -GAME( 1995, pulstar, neogeo, neogeo, neogeo, neogeo, ROT0, "Aicom", "Pulstar", 0 ) -GAME( 1998, blazstar, neogeo, neogeo, neogeo, neogeo, ROT0, "Yumekobo", "Blazing Star", 0 ) -GAME( 1999, preisle2, neogeo, neogeo, neogeo, preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , 0 ) /* Encrypted GFX */ +GAME( 1992, viewpoin, neogeo, neogeo, neogeo, neogeo, ROT0, "Sammy / Aicom", "Viewpoint", GAME_SUPPORTS_SAVE ) +GAME( 1994, janshin, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Aicom", "Jyanshin Densetsu - Quest of Jongmaster", GAME_SUPPORTS_SAVE ) +GAME( 1995, pulstar, neogeo, neogeo, neogeo, neogeo, ROT0, "Aicom", "Pulstar", GAME_SUPPORTS_SAVE ) +GAME( 1998, blazstar, neogeo, neogeo, neogeo, neogeo, ROT0, "Yumekobo", "Blazing Star", GAME_SUPPORTS_SAVE ) +GAME( 1999, preisle2, neogeo, neogeo, neogeo, preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ /* Data East Corporation */ -GAME( 1993, spinmast, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", 0 ) -GAME( 1994, wjammers, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", 0 ) -GAME( 1994, karnovr, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", 0 ) -GAME( 1994, strhoop, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", 0 ) -GAME( 1996, ghostlop, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Ghostlop (prototype)", 0 ) -GAME( 1996, magdrop2, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Magical Drop II", 0 ) -GAME( 1997, magdrop3, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Magical Drop III", 0 ) +GAME( 1993, spinmast, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", GAME_SUPPORTS_SAVE ) +GAME( 1994, wjammers, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", GAME_SUPPORTS_SAVE ) +GAME( 1994, karnovr, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", GAME_SUPPORTS_SAVE ) +GAME( 1994, strhoop, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", GAME_SUPPORTS_SAVE ) +GAME( 1996, ghostlop, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Ghostlop (prototype)", GAME_SUPPORTS_SAVE ) +GAME( 1996, magdrop2, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Magical Drop II", GAME_SUPPORTS_SAVE ) +GAME( 1997, magdrop3, neogeo, neogeo, neogeo, neogeo, ROT0, "Data East Corporation", "Magical Drop III", GAME_SUPPORTS_SAVE ) /* Eleven */ -GAME( 2000, nitd, neogeo, neogeo, neogeo, nitd, ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , 0 ) /* Encrypted GFX */ -GAME( 2001, nitdbl, nitd, neogeo, neogeo, neogeo, ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , 0 ) +GAME( 2000, nitd, neogeo, neogeo, neogeo, nitd, ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2001, nitdbl, nitd, neogeo, neogeo, neogeo, ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , GAME_SUPPORTS_SAVE ) /* Face */ -GAME( 1994, gururin, neogeo, neogeo, neogeo, neogeo, ROT0, "Face", "Gururin", 0 ) -GAME( 1997, miexchng, neogeo, neogeo, neogeo, neogeo, ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", 0 ) +GAME( 1994, gururin, neogeo, neogeo, neogeo, neogeo, ROT0, "Face", "Gururin", GAME_SUPPORTS_SAVE ) +GAME( 1997, miexchng, neogeo, neogeo, neogeo, neogeo, ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", GAME_SUPPORTS_SAVE ) /* Hudson Soft */ -GAME( 1994, panicbom, neogeo, neogeo, neogeo, neogeo, ROT0, "Eighting / Hudson", "Panic Bomber", 0 ) -GAME( 1995, kabukikl, neogeo, neogeo, neogeo, neogeo, ROT0, "Hudson", "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den", 0 ) -GAME( 1997, neobombe, neogeo, neogeo, neogeo, neogeo, ROT0, "Hudson", "Neo Bomberman", 0 ) +GAME( 1994, panicbom, neogeo, neogeo, neogeo, neogeo, ROT0, "Eighting / Hudson", "Panic Bomber", GAME_SUPPORTS_SAVE ) +GAME( 1995, kabukikl, neogeo, neogeo, neogeo, neogeo, ROT0, "Hudson", "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den", GAME_SUPPORTS_SAVE ) +GAME( 1997, neobombe, neogeo, neogeo, neogeo, neogeo, ROT0, "Hudson", "Neo Bomberman", GAME_SUPPORTS_SAVE ) /* Monolith Corp. */ -GAME( 1990, minasan, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", 0 ) -GAME( 1991, bakatono, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", 0 ) +GAME( 1990, minasan, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", GAME_SUPPORTS_SAVE ) +GAME( 1991, bakatono, neogeo, neogeo, mjneogeo, neogeo, ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", GAME_SUPPORTS_SAVE ) /* Nazca (later acquired by SNK) */ -GAME( 1996, turfmast, neogeo, neogeo, neogeo, neogeo, ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", 0 ) -GAME( 1996, mslug, neogeo, neogeo, neogeo, neogeo, ROT0, "Nazca", "Metal Slug - Super Vehicle-001", 0 ) +GAME( 1996, turfmast, neogeo, neogeo, neogeo, neogeo, ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", GAME_SUPPORTS_SAVE ) +GAME( 1996, mslug, neogeo, neogeo, neogeo, neogeo, ROT0, "Nazca", "Metal Slug - Super Vehicle-001", GAME_SUPPORTS_SAVE ) /* NMK */ -GAME( 1994, zedblade, neogeo, neogeo, neogeo, neogeo, ROT0, "NMK", "Zed Blade / Operation Ragnarok", 0 ) +GAME( 1994, zedblade, neogeo, neogeo, neogeo, neogeo, ROT0, "NMK", "Zed Blade / Operation Ragnarok", GAME_SUPPORTS_SAVE ) /* Psikyo */ -GAME( 1999, s1945p, neogeo, neogeo, neogeo, s1945p, ROT0, "Psikyo", "Strikers 1945 Plus" , 0 ) /* Encrypted GFX */ +GAME( 1999, s1945p, neogeo, neogeo, neogeo, s1945p, ROT0, "Psikyo", "Strikers 1945 Plus" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ /* Saurus */ -GAME( 1995, quizkof, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Quiz King of Fighters", 0 ) -GAME( 1995, stakwin, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Stakes Winner / Stakes Winner - GI kinzen seihae no michi", 0 ) -GAME( 1996, ragnagrd, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Ragnagard / Shin-Oh-Ken", 0 ) -GAME( 1996, pgoal, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", 0 ) -GAME( 1996, stakwin2, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Stakes Winner 2", 0 ) -GAME( 1997, shocktro, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers (set 1)", 0 ) -GAME( 1997, shocktra, shocktro, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers (set 2)", 0 ) -GAME( 1998, shocktr2, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers - 2nd Squad", 0 ) -GAME( 1998, lans2004, shocktr2, neogeo, neogeo, lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", 0 ) +GAME( 1995, quizkof, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Quiz King of Fighters", GAME_SUPPORTS_SAVE ) +GAME( 1995, stakwin, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Stakes Winner / Stakes Winner - GI kinzen seihae no michi", GAME_SUPPORTS_SAVE ) +GAME( 1996, ragnagrd, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Ragnagard / Shin-Oh-Ken", GAME_SUPPORTS_SAVE ) +GAME( 1996, pgoal, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", GAME_SUPPORTS_SAVE ) +GAME( 1996, stakwin2, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Stakes Winner 2", GAME_SUPPORTS_SAVE ) +GAME( 1997, shocktro, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1997, shocktra, shocktro, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1998, shocktr2, neogeo, neogeo, neogeo, neogeo, ROT0, "Saurus", "Shock Troopers - 2nd Squad", GAME_SUPPORTS_SAVE ) +GAME( 1998, lans2004, shocktr2, neogeo, neogeo, lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", GAME_SUPPORTS_SAVE ) /* Sunsoft */ -GAME( 1995, galaxyfg, neogeo, neogeo, neogeo, neogeo, ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", 0 ) -GAME( 1996, wakuwak7, neogeo, neogeo, neogeo, neogeo, ROT0, "Sunsoft", "Waku Waku 7", 0 ) +GAME( 1995, galaxyfg, neogeo, neogeo, neogeo, neogeo, ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", GAME_SUPPORTS_SAVE ) +GAME( 1996, wakuwak7, neogeo, neogeo, neogeo, neogeo, ROT0, "Sunsoft", "Waku Waku 7", GAME_SUPPORTS_SAVE ) /* Taito */ -GAME( 1994, pbobblen, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", 0 ) -GAME( 1994, pbobblenb,pbobblen, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (bootleg)", 0 ) -GAME( 1999, pbobbl2n, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 ) -GAME( 2003, pnyaa, neogeo, neogeo, neogeo, pnyaa, ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 ) +GAME( 1994, pbobblen, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, pbobblenb, pbobblen, neogeo, neogeo, neogeo, ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1999, pbobbl2n, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", GAME_SUPPORTS_SAVE ) +GAME( 2003, pnyaa, neogeo, neogeo, neogeo, pnyaa, ROT0, "Aiky / Taito", "Pochi and Nyaa", GAME_SUPPORTS_SAVE ) /* Takara */ -GAME( 1995, marukodq, neogeo, neogeo, neogeo, neogeo, ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", 0 ) +GAME( 1995, marukodq, neogeo, neogeo, neogeo, neogeo, ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", GAME_SUPPORTS_SAVE ) /* Technos Japan */ -GAME( 1995, doubledr, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Double Dragon (Neo-Geo)", 0 ) -GAME( 1995, gowcaizr, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", 0 ) -GAME( 1996, sdodgeb, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", 0 ) +GAME( 1995, doubledr, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Double Dragon (Neo-Geo)", GAME_SUPPORTS_SAVE ) +GAME( 1995, gowcaizr, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", GAME_SUPPORTS_SAVE ) +GAME( 1996, sdodgeb, neogeo, neogeo, neogeo, neogeo, ROT0, "Technos Japan", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", GAME_SUPPORTS_SAVE ) /* Tecmo */ -GAME( 1996, tws96, neogeo, neogeo, neogeo, neogeo, ROT0, "Tecmo", "Tecmo World Soccer '96", 0 ) +GAME( 1996, tws96, neogeo, neogeo, neogeo, neogeo, ROT0, "Tecmo", "Tecmo World Soccer '96", GAME_SUPPORTS_SAVE ) /* Viccom */ -GAME( 1994, fightfev, neogeo, neogeo, neogeo, neogeo, ROT0, "Viccom", "Fight Fever (set 1)", 0 ) -GAME( 1994, fightfeva, fightfev, neogeo, neogeo, neogeo, ROT0, "Viccom", "Fight Fever (set 2)", 0 ) +GAME( 1994, fightfev, neogeo, neogeo, neogeo, neogeo, ROT0, "Viccom", "Fight Fever (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, fightfeva, fightfev, neogeo, neogeo, neogeo, ROT0, "Viccom", "Fight Fever (set 2)", GAME_SUPPORTS_SAVE ) /* Video System Co. */ -GAME( 1994, pspikes2, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Power Spikes II", 0 ) -GAME( 1994, sonicwi2, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Aero Fighters 2 / Sonic Wings 2", 0 ) -GAME( 1995, sonicwi3, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Aero Fighters 3 / Sonic Wings 3", 0 ) -GAME( 1997, popbounc, neogeo, neogeo, popbounc, neogeo, ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", 0 ) +GAME( 1994, pspikes2, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Power Spikes II", GAME_SUPPORTS_SAVE ) +GAME( 1994, sonicwi2, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Aero Fighters 2 / Sonic Wings 2", GAME_SUPPORTS_SAVE ) +GAME( 1995, sonicwi3, neogeo, neogeo, neogeo, neogeo, ROT0, "Video System Co.", "Aero Fighters 3 / Sonic Wings 3", GAME_SUPPORTS_SAVE ) +GAME( 1997, popbounc, neogeo, neogeo, popbounc, neogeo, ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", GAME_SUPPORTS_SAVE ) /* Visco */ -GAME( 1992, androdun, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Andro Dunos", 0 ) -GAME( 1995, puzzledp, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito (Visco license)", "Puzzle De Pon!", 0 ) -GAME( 1996, neomrdo, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Neo Mr. Do!", 0 ) -GAME( 1995, goalx3, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Goal! Goal! Goal!", 0 ) -GAME( 1996, neodrift, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Neo Drift Out - New Technology", 0 ) -GAME( 1996, breakers, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Breakers", 0 ) -GAME( 1997, puzzldpr, puzzledp, neogeo, neogeo, neogeo, ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", 0 ) -GAME( 1998, breakrev, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Breakers Revenge", 0 ) -GAME( 1998, flipshot, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Battle Flip Shot", 0 ) -GAME( 1999, ctomaday, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Captain Tomaday", 0 ) -GAME( 1999, ganryu, neogeo, neogeo, neogeo, ganryu, ROT0, "Visco", "Ganryu / Musashi Ganryuki" , 0 ) /* Encrypted GFX */ -GAME( 2000, bangbead, neogeo, neogeo, neogeo, bangbead, ROT0, "Visco", "Bang Bead", 0 ) -//GAME( 2000, bangbedp, bangbead, neogeo, neogeo, neogeo, ROT0, "Visco", "Bang Bead (prototype)", 0 ) +GAME( 1992, androdun, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Andro Dunos", GAME_SUPPORTS_SAVE ) +GAME( 1995, puzzledp, neogeo, neogeo, neogeo, neogeo, ROT0, "Taito (Visco license)", "Puzzle De Pon!", GAME_SUPPORTS_SAVE ) +GAME( 1996, neomrdo, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Neo Mr. Do!", GAME_SUPPORTS_SAVE ) +GAME( 1995, goalx3, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Goal! Goal! Goal!", GAME_SUPPORTS_SAVE ) +GAME( 1996, neodrift, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Neo Drift Out - New Technology", GAME_SUPPORTS_SAVE ) +GAME( 1996, breakers, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Breakers", GAME_SUPPORTS_SAVE ) +GAME( 1997, puzzldpr, puzzledp, neogeo, neogeo, neogeo, ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", GAME_SUPPORTS_SAVE ) +GAME( 1998, breakrev, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Breakers Revenge", GAME_SUPPORTS_SAVE ) +GAME( 1998, flipshot, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Battle Flip Shot", GAME_SUPPORTS_SAVE ) +GAME( 1999, ctomaday, neogeo, neogeo, neogeo, neogeo, ROT0, "Visco", "Captain Tomaday", GAME_SUPPORTS_SAVE ) +GAME( 1999, ganryu, neogeo, neogeo, neogeo, ganryu, ROT0, "Visco", "Ganryu / Musashi Ganryuki" , GAME_SUPPORTS_SAVE ) /* Encrypted GFX */ +GAME( 2000, bangbead, neogeo, neogeo, neogeo, bangbead, ROT0, "Visco", "Bang Bead", GAME_SUPPORTS_SAVE ) +//GAME( 2000, bangbedp, bangbead, neogeo, neogeo, neogeo, ROT0, "Visco", "Bang Bead (prototype)", GAME_SUPPORTS_SAVE ) /* Mega Enterprise */ -GAME( 2002, mslug4, neogeo, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 1)", 0 ) -GAME( 2002, mslug4h, mslug4, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 2)", 0 ) -GAME( 2002, ms4plus, mslug4, neogeo, neogeo, ms4plus, ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 ) +GAME( 2002, mslug4, neogeo, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 2002, mslug4h, mslug4, neogeo, neogeo, mslug4, ROT0, "Mega / Playmore", "Metal Slug 4 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 2002, ms4plus, mslug4, neogeo, neogeo, ms4plus, ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", GAME_SUPPORTS_SAVE ) /* Evoga */ -GAME( 2002, rotd, neogeo, neogeo, neogeo, rotd, ROT0, "Evoga / Playmore", "Rage of the Dragons", 0 ) +GAME( 2002, rotd, neogeo, neogeo, neogeo, rotd, ROT0, "Evoga / Playmore", "Rage of the Dragons", GAME_SUPPORTS_SAVE ) /* Atlus */ -GAME( 2002, matrim, neogeo, neogeo, neogeo, matrim, ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", 0 ) -GAME( 2002, matrimbl, matrim, neogeo, neogeo, matrimbl, ROT0, "bootleg", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)", 0 ) +GAME( 2002, matrim, neogeo, neogeo, neogeo, matrim, ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", GAME_SUPPORTS_SAVE ) +GAME( 2002, matrimbl, matrim, neogeo, neogeo, matrimbl, ROT0, "bootleg", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)", GAME_SUPPORTS_SAVE ) /* BrezzaSoft */ -GAME( 2001, jockeygp, neogeo, neogeo, jockeygp, jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 ) -GAME( 2001, vliner, neogeo, neogeo, vliner, vliner, ROT0, "Dyna / BrezzaSoft", "V-Liner (set 1)", 0 ) -GAME( 2001, vlinero, vliner, neogeo, vliner, vliner, ROT0, "Dyna / BrezzaSoft", "V-Liner (set 2)", 0 ) +GAME( 2001, jockeygp, neogeo, neogeo, jockeygp, jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", GAME_SUPPORTS_SAVE ) +GAME( 2001, vliner, neogeo, neogeo, vliner, vliner, ROT0, "Dyna / BrezzaSoft", "V-Liner (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 2001, vlinero, vliner, neogeo, vliner, vliner, ROT0, "Dyna / BrezzaSoft", "V-Liner (set 2)", GAME_SUPPORTS_SAVE ) /* Kyle Hodgetts */ -GAME( 2000, diggerma, neogeo, neogeo, neogeo, neogeo, ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 ) +GAME( 2000, diggerma, neogeo, neogeo, neogeo, neogeo, ROT0, "Kyle Hodgetts", "Digger Man (prototype)", GAME_SUPPORTS_SAVE ) /* Neo Print */ -GAME( 1998, 98best44, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "'98 NeoPri Best 44 (Neo Print)", GAME_NOT_WORKING ) - +GAME( 1998, 98best44, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "'98 NeoPri Best 44 (Neo Print)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index 2f41e7e032e..63aade4559c 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -193,7 +193,7 @@ NOTE: On CTRG2-B, The "A" lines start at "A1". If you trace this on an #include "driver.h" #include "cpu/m68000/m68000.h" -#include "neogeo.h" +#include "includes/neogeo.h" #include "machine/pd4990a.h" #include "cpu/z80/z80.h" #include "sound/2610intf.h" @@ -201,11 +201,10 @@ NOTE: On CTRG2-B, The "A" lines start at "A1". If you trace this on an #include "neogeo.lh" -#define LOG_VIDEO_SYSTEM (0) -#define LOG_CPU_COMM (0) -#define LOG_MAIN_CPU_BANKING (0) -#define LOG_AUDIO_CPU_BANKING (0) - +#define LOG_VIDEO_SYSTEM (0) +#define LOG_CPU_COMM (0) +#define LOG_MAIN_CPU_BANKING (0) +#define LOG_AUDIO_CPU_BANKING (0) /************************************* @@ -214,36 +213,8 @@ NOTE: On CTRG2-B, The "A" lines start at "A1". If you trace this on an * *************************************/ -static UINT8 display_position_interrupt_control; -static UINT32 display_counter; -static UINT32 vblank_interrupt_pending; -static UINT32 display_position_interrupt_pending; -static UINT32 irq3_pending; -static emu_timer *display_position_interrupt_timer; -static emu_timer *display_position_vblank_timer; -static emu_timer *vblank_interrupt_timer; - -static UINT8 controller_select; - static UINT8 *memcard_data; - -static UINT32 main_cpu_bank_address; -static UINT8 main_cpu_vector_table_source; - -static UINT8 audio_result; -static UINT8 audio_cpu_banks[4]; -static UINT8 audio_cpu_rom_source; -static UINT8 audio_cpu_rom_source_last; - static UINT16 *save_ram; -static UINT8 save_ram_unlocked; - -static UINT8 output_data; -static UINT8 output_latch; -static UINT8 el_value; -static UINT8 led1_value; -static UINT8 led2_value; - /************************************* @@ -253,8 +224,7 @@ static UINT8 led2_value; *************************************/ static void set_output_latch(running_machine *machine, UINT8 data); -static void set_output_data(UINT8 data); - +static void set_output_data(running_machine *machine, UINT8 data); /************************************* @@ -263,45 +233,52 @@ static void set_output_data(UINT8 data); * *************************************/ -#define IRQ2CTRL_ENABLE (0x10) -#define IRQ2CTRL_LOAD_RELATIVE (0x20) -#define IRQ2CTRL_AUTOLOAD_VBLANK (0x40) -#define IRQ2CTRL_AUTOLOAD_REPEAT (0x80) +#define IRQ2CTRL_ENABLE (0x10) +#define IRQ2CTRL_LOAD_RELATIVE (0x20) +#define IRQ2CTRL_AUTOLOAD_VBLANK (0x40) +#define IRQ2CTRL_AUTOLOAD_REPEAT (0x80) -static void adjust_display_position_interrupt_timer(running_machine *machine) +static void adjust_display_position_interrupt_timer( running_machine *machine ) { - if ((display_counter + 1) != 0) - { - attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), display_counter + 1); - if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen), (display_counter + 1) / NEOGEO_HTOTAL, (display_counter + 1) % NEOGEO_HTOTAL); + neogeo_state *state = (neogeo_state *)machine->driver_data; - timer_adjust_oneshot(display_position_interrupt_timer, period, 0); + if ((state->display_counter + 1) != 0) + { + attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), state->display_counter + 1); + if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen), (state->display_counter + 1) / NEOGEO_HTOTAL, (state->display_counter + 1) % NEOGEO_HTOTAL); + + timer_adjust_oneshot(state->display_position_interrupt_timer, period, 0); } } -void neogeo_set_display_position_interrupt_control(UINT16 data) +void neogeo_set_display_position_interrupt_control( running_machine *machine, UINT16 data ) { - display_position_interrupt_control = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->display_position_interrupt_control = data; } -void neogeo_set_display_counter_msb(const address_space *space, UINT16 data) +void neogeo_set_display_counter_msb( const address_space *space, UINT16 data ) { - display_counter = (display_counter & 0x0000ffff) | ((UINT32)data << 16); + neogeo_state *state = (neogeo_state *)space->machine->driver_data; - if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), display_counter); + state->display_counter = (state->display_counter & 0x0000ffff) | ((UINT32)data << 16); + + if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), state->display_counter); } -void neogeo_set_display_counter_lsb(const address_space *space, UINT16 data) +void neogeo_set_display_counter_lsb( const address_space *space, UINT16 data ) { - display_counter = (display_counter & 0xffff0000) | data; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; - if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), display_counter); + state->display_counter = (state->display_counter & 0xffff0000) | data; - if (display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE) + if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), state->display_counter); + + if (state->display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE) { if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_RELATIVE "); adjust_display_position_interrupt_timer(space->machine); @@ -309,19 +286,26 @@ void neogeo_set_display_counter_lsb(const address_space *space, UINT16 data) } -static void update_interrupts(running_machine *machine) +static void update_interrupts( running_machine *machine ) { - cputag_set_input_line(machine, "maincpu", 1, vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); - cputag_set_input_line(machine, "maincpu", 2, display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); - cputag_set_input_line(machine, "maincpu", 3, irq3_pending ? ASSERT_LINE : CLEAR_LINE); + neogeo_state *state = (neogeo_state *)machine->driver_data; + + cputag_set_input_line(machine, "maincpu", 1, state->vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 2, state->display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 3, state->irq3_pending ? ASSERT_LINE : CLEAR_LINE); } -void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data) +void neogeo_acknowledge_interrupt( running_machine *machine, UINT16 data ) { - if (data & 0x01) irq3_pending = 0; - if (data & 0x02) display_position_interrupt_pending = 0; - if (data & 0x04) vblank_interrupt_pending = 0; + neogeo_state *state = (neogeo_state *)machine->driver_data; + + if (data & 0x01) + state->irq3_pending = 0; + if (data & 0x02) + state->display_position_interrupt_pending = 0; + if (data & 0x04) + state->vblank_interrupt_pending = 0; update_interrupts(machine); } @@ -329,16 +313,19 @@ void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data) static TIMER_CALLBACK( display_position_interrupt_callback ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); - if (display_position_interrupt_control & IRQ2CTRL_ENABLE) + + if (state->display_position_interrupt_control & IRQ2CTRL_ENABLE) { if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); - display_position_interrupt_pending = 1; + state->display_position_interrupt_pending = 1; update_interrupts(machine); } - if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT) + if (state->display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT) { if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_REPEAT "); adjust_display_position_interrupt_timer(machine); @@ -348,47 +335,51 @@ static TIMER_CALLBACK( display_position_interrupt_callback ) static TIMER_CALLBACK( display_position_vblank_callback ) { - if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK) + neogeo_state *state = (neogeo_state *)machine->driver_data; + + if (state->display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK) { if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK "); adjust_display_position_interrupt_timer(machine); } /* set timer for next screen */ - timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); + timer_adjust_oneshot(state->display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); } static TIMER_CALLBACK( vblank_interrupt_callback ) { - const device_config *upd4990a = devtag_get_device(machine, "upd4990a"); + neogeo_state *state = (neogeo_state *)machine->driver_data; if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); /* add a timer tick to the pd4990a */ - upd4990a_addretrace(upd4990a); + upd4990a_addretrace(state->upd4990a); - vblank_interrupt_pending = 1; + state->vblank_interrupt_pending = 1; update_interrupts(machine); /* set timer for next screen */ - timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); + timer_adjust_oneshot(state->vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); } -static void create_interrupt_timers(running_machine *machine) +static void create_interrupt_timers( running_machine *machine ) { - display_position_interrupt_timer = timer_alloc(machine, display_position_interrupt_callback, NULL); - display_position_vblank_timer = timer_alloc(machine, display_position_vblank_callback, NULL); - vblank_interrupt_timer = timer_alloc(machine, vblank_interrupt_callback, NULL); + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->display_position_interrupt_timer = timer_alloc(machine, display_position_interrupt_callback, NULL); + state->display_position_vblank_timer = timer_alloc(machine, display_position_vblank_callback, NULL); + state->vblank_interrupt_timer = timer_alloc(machine, vblank_interrupt_callback, NULL); } -static void start_interrupt_timers(running_machine *machine) +static void start_interrupt_timers( running_machine *machine ) { - timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); - timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); + neogeo_state *state = (neogeo_state *)machine->driver_data; + timer_adjust_oneshot(state->vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); + timer_adjust_oneshot(state->display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); } @@ -401,19 +392,22 @@ static void start_interrupt_timers(running_machine *machine) static void audio_cpu_irq(const device_config *device, int assert) { - cputag_set_input_line(device->machine, "audiocpu", 0, assert ? ASSERT_LINE : CLEAR_LINE); + neogeo_state *state = (neogeo_state *)device->machine->driver_data; + cpu_set_input_line(state->audiocpu, 0, assert ? ASSERT_LINE : CLEAR_LINE); } static void audio_cpu_assert_nmi(running_machine *machine) { - cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); + neogeo_state *state = (neogeo_state *)machine->driver_data; + cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE); } static WRITE8_HANDLER( audio_cpu_clear_nmi_w ) { - cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); } @@ -424,14 +418,16 @@ static WRITE8_HANDLER( audio_cpu_clear_nmi_w ) * *************************************/ -static void select_controller(UINT8 data) +static void select_controller( running_machine *machine, UINT8 data ) { - controller_select = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->controller_select = data; } static CUSTOM_INPUT( multiplexed_controller_r ) { + neogeo_state *state = (neogeo_state *)field->port->machine->driver_data; int port = (FPTR)param; static const char *const cntrl[2][2] = @@ -439,12 +435,13 @@ static CUSTOM_INPUT( multiplexed_controller_r ) { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" } }; - return input_port_read_safe(field->port->machine, cntrl[port][controller_select & 0x01], 0x00); + return input_port_read_safe(field->port->machine, cntrl[port][state->controller_select & 0x01], 0x00); } static CUSTOM_INPUT( mahjong_controller_r ) { + neogeo_state *state = (neogeo_state *)field->port->machine->driver_data; UINT32 ret; /* @@ -454,7 +451,7 @@ cpu #0 (PC=00C18D54): unmapped memory word write to 00380000 = 0024 & 00FF cpu #0 (PC=00C18D6C): unmapped memory word write to 00380000 = 0009 & 00FF cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF */ - switch (controller_select) + switch (state->controller_select) { default: case 0x00: ret = 0x0000; break; /* nothing? */ @@ -470,14 +467,13 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF static WRITE16_HANDLER( io_control_w ) { - const device_config *upd4990a = devtag_get_device(space->machine, "upd4990a"); - + neogeo_state *state = (neogeo_state *)space->machine->driver_data; switch (offset) { - case 0x00: select_controller(data & 0x00ff); break; + case 0x00: select_controller(space->machine, data & 0x00ff); break; case 0x18: set_output_latch(space->machine, data & 0x00ff); break; - case 0x20: set_output_data(data & 0x00ff); break; - case 0x28: upd4990a_control_16_w(upd4990a, 0, data, mem_mask); break; + case 0x20: set_output_data(space->machine, data & 0x00ff); break; + case 0x28: upd4990a_control_16_w(state->upd4990a, 0, data, mem_mask); break; // case 0x30: break; // coin counters // case 0x31: break; // coin counters // case 0x32: break; // coin lockout @@ -499,20 +495,20 @@ static WRITE16_HANDLER( io_control_w ) READ16_HANDLER( neogeo_unmapped_r ) { - static UINT8 recurse = 0; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; UINT16 ret; /* unmapped memory returns the last word on the data bus, which is almost always the opcode of the next instruction due to prefetch */ /* prevent recursion */ - if (recurse) + if (state->recurse) ret = 0xffff; else { - recurse = 1; + state->recurse = 1; ret = memory_read_word(space, cpu_get_pc(space->cpu)); - recurse = 0; + state->recurse = 0; } return ret; @@ -528,8 +524,8 @@ READ16_HANDLER( neogeo_unmapped_r ) static CUSTOM_INPUT( get_calendar_status ) { - const device_config *upd4990a = devtag_get_device(field->port->machine, "upd4990a"); - return (upd4990a_databit_r(upd4990a, 0) << 1) | upd4990a_testbit_r(upd4990a, 0); + neogeo_state *state = (neogeo_state *)field->port->machine->driver_data; + return (upd4990a_databit_r(state->upd4990a, 0) << 1) | upd4990a_testbit_r(state->upd4990a, 0); } @@ -556,15 +552,18 @@ static NVRAM_HANDLER( neogeo ) } -static void set_save_ram_unlock(UINT8 data) +static void set_save_ram_unlock( running_machine *machine, UINT8 data ) { - save_ram_unlocked = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->save_ram_unlocked = data; } static WRITE16_HANDLER( save_ram_w ) { - if (save_ram_unlocked) + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + + if (state->save_ram_unlocked) COMBINE_DATA(&save_ram[offset]); } @@ -669,15 +668,18 @@ static READ8_HANDLER( audio_command_r ) static WRITE8_HANDLER( audio_result_w ) { - if (LOG_CPU_COMM && (audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(space->cpu), data); + neogeo_state *state = (neogeo_state *)space->machine->driver_data; - audio_result = data; + if (LOG_CPU_COMM && (state->audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(space->cpu), data); + + state->audio_result = data; } static CUSTOM_INPUT( get_audio_result ) { - UINT32 ret = audio_result; + neogeo_state *state = (neogeo_state *)field->port->machine->driver_data; + UINT32 ret = state->audio_result; // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(cputag_get_cpu(field->port->machine, "maincpu")), ret); @@ -692,31 +694,36 @@ static CUSTOM_INPUT( get_audio_result ) * *************************************/ -static void _set_main_cpu_vector_table_source(running_machine *machine) +static void _set_main_cpu_vector_table_source( running_machine *machine ) { - memory_set_bank(machine, NEOGEO_BANK_VECTORS, main_cpu_vector_table_source); + neogeo_state *state = (neogeo_state *)machine->driver_data; + memory_set_bank(machine, NEOGEO_BANK_VECTORS, state->main_cpu_vector_table_source); } -static void set_main_cpu_vector_table_source(running_machine *machine, UINT8 data) +static void set_main_cpu_vector_table_source( running_machine *machine, UINT8 data ) { - main_cpu_vector_table_source = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->main_cpu_vector_table_source = data; _set_main_cpu_vector_table_source(machine); } -static void _set_main_cpu_bank_address(running_machine *machine) +static void _set_main_cpu_bank_address( running_machine *machine ) { - memory_set_bankptr(machine, NEOGEO_BANK_CARTRIDGE, &memory_region(machine, "maincpu")[main_cpu_bank_address]); + neogeo_state *state = (neogeo_state *)machine->driver_data; + memory_set_bankptr(machine, NEOGEO_BANK_CARTRIDGE, &memory_region(machine, "maincpu")[state->main_cpu_bank_address]); } -void neogeo_set_main_cpu_bank_address(const address_space *space, UINT32 bank_address) +void neogeo_set_main_cpu_bank_address( const address_space *space, UINT32 bank_address ) { + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", cpu_get_pc(space->cpu), bank_address); - main_cpu_bank_address = bank_address; + state->main_cpu_bank_address = bank_address; _set_main_cpu_bank_address(space->machine); } @@ -744,7 +751,7 @@ static WRITE16_HANDLER( main_cpu_bank_select_w ) } -static void main_cpu_banking_init(running_machine *machine) +static void main_cpu_banking_init( running_machine *machine ) { const address_space *mainspace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); @@ -767,20 +774,23 @@ static void main_cpu_banking_init(running_machine *machine) * *************************************/ -static void set_audio_cpu_banking(running_machine *machine) +static void set_audio_cpu_banking( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int region; for (region = 0; region < 4; region++) - memory_set_bank(machine, NEOGEO_BANK_AUDIO_CPU_CART_BANK + region, audio_cpu_banks[region]); + memory_set_bank(machine, NEOGEO_BANK_AUDIO_CPU_CART_BANK + region, state->audio_cpu_banks[region]); } -static void audio_cpu_bank_select(const address_space *space, int region, UINT8 bank) +static void audio_cpu_bank_select( const address_space *space, int region, UINT8 bank ) { + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", cpu_get_pc(space->cpu), region, bank); - audio_cpu_banks[region] = bank; + state->audio_cpu_banks[region] = bank; set_audio_cpu_banking(space->machine); } @@ -818,35 +828,39 @@ static READ8_HANDLER( audio_cpu_bank_select_8000_bfff_r ) } -static void _set_audio_cpu_rom_source(const address_space *space) +static void _set_audio_cpu_rom_source( const address_space *space ) { -/* if (!memory_region(machine, "audiobios")) */ - audio_cpu_rom_source = 1; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; - memory_set_bank(space->machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, audio_cpu_rom_source); +/* if (!memory_region(machine, "audiobios")) */ + state->audio_cpu_rom_source = 1; + + memory_set_bank(space->machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, state->audio_cpu_rom_source); /* reset CPU if the source changed -- this is a guess */ - if (audio_cpu_rom_source != audio_cpu_rom_source_last) + if (state->audio_cpu_rom_source != state->audio_cpu_rom_source_last) { - audio_cpu_rom_source_last = audio_cpu_rom_source; + state->audio_cpu_rom_source_last = state->audio_cpu_rom_source; cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE); - if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", cpu_get_pc(space->cpu), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); + if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", cpu_get_pc(space->cpu), state->audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); } } -static void set_audio_cpu_rom_source(const address_space *space, UINT8 data) +static void set_audio_cpu_rom_source( const address_space *space, UINT8 data ) { - audio_cpu_rom_source = data; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + state->audio_cpu_rom_source = data; _set_audio_cpu_rom_source(space); } -static void audio_cpu_banking_init(running_machine *machine) +static void audio_cpu_banking_init( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int region; int bank; UINT8 *rgn; @@ -872,14 +886,14 @@ static void audio_cpu_banking_init(running_machine *machine) /* set initial audio banks -- how does this really work, or is it even neccessary? */ - audio_cpu_banks[0] = 0x1e; - audio_cpu_banks[1] = 0x0e; - audio_cpu_banks[2] = 0x06; - audio_cpu_banks[3] = 0x02; + state->audio_cpu_banks[0] = 0x1e; + state->audio_cpu_banks[1] = 0x0e; + state->audio_cpu_banks[2] = 0x06; + state->audio_cpu_banks[3] = 0x02; set_audio_cpu_banking(machine); - audio_cpu_rom_source_last = 0; + state->audio_cpu_rom_source_last = 0; set_audio_cpu_rom_source(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0); } @@ -904,8 +918,8 @@ static WRITE16_HANDLER( system_control_w ) case 0x01: set_main_cpu_vector_table_source(space->machine, bit); set_audio_cpu_rom_source(space, bit); /* this is a guess */ break; - case 0x05: neogeo_set_fixed_layer_source(bit); break; - case 0x06: set_save_ram_unlock(bit); break; + case 0x05: neogeo_set_fixed_layer_source(space->machine, bit); break; + case 0x06: set_save_ram_unlock(space->machine, bit); break; case 0x07: neogeo_set_palette_bank(space->machine, bit); break; case 0x02: /* unknown - HC32 middle pin 1 */ @@ -972,51 +986,55 @@ static WRITE16_HANDLER( watchdog_w ) * *************************************/ -static void set_outputs(void) +static void set_outputs( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; static const UINT8 led_map[0x10] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 }; /* EL */ - output_set_digit_value(0, led_map[el_value]); + output_set_digit_value(0, led_map[state->el_value]); /* LED1 */ - output_set_digit_value(1, led_map[led1_value >> 4]); - output_set_digit_value(2, led_map[led1_value & 0x0f]); + output_set_digit_value(1, led_map[state->led1_value >> 4]); + output_set_digit_value(2, led_map[state->led1_value & 0x0f]); /* LED2 */ - output_set_digit_value(3, led_map[led2_value >> 4]); - output_set_digit_value(4, led_map[led2_value & 0x0f]); + output_set_digit_value(3, led_map[state->led2_value >> 4]); + output_set_digit_value(4, led_map[state->led2_value & 0x0f]); } -static void set_output_latch(running_machine *machine, UINT8 data) +static void set_output_latch( running_machine *machine, UINT8 data ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + /* looks like the LEDs are set on the falling edge */ - UINT8 falling_bits = output_latch & ~data; + UINT8 falling_bits = state->output_latch & ~data; - if (falling_bits & 0x08) - el_value = 16 - (output_data & 0x0f); + if (falling_bits & 0x08) + state->el_value = 16 - (state->output_data & 0x0f); - if (falling_bits & 0x10) - led1_value = ~output_data; + if (falling_bits & 0x10) + state->led1_value = ~state->output_data; - if (falling_bits & 0x20) - led2_value = ~output_data; + if (falling_bits & 0x20) + state->led2_value = ~state->output_data; if (falling_bits & 0xc7) logerror("%s Unmaped LED write. Data: %x\n", cpuexec_describe_context(machine), falling_bits); - output_latch = data; + state->output_latch = data; - set_outputs(); + set_outputs(machine); } -static void set_output_data(UINT8 data) +static void set_output_data( running_machine *machine, UINT8 data ) { - output_data = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->output_data = data; } @@ -1033,11 +1051,13 @@ static STATE_POSTLOAD( neogeo_postload ) _set_main_cpu_vector_table_source(machine); set_audio_cpu_banking(machine); _set_audio_cpu_rom_source(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)); - set_outputs(); + set_outputs(machine); } static MACHINE_START( neogeo ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + /* set the BIOS bank */ memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios")); @@ -1053,28 +1073,34 @@ static MACHINE_START( neogeo ) memcard_data = auto_alloc_array_clear(machine, UINT8, MEMCARD_SIZE); /* start with an IRQ3 - but NOT on a reset */ - irq3_pending = 1; + state->irq3_pending = 1; + + /* get devices */ + state->maincpu = devtag_get_device(machine, "maincpu"); + state->audiocpu = devtag_get_device(machine, "audiocpu"); + state->upd4990a = devtag_get_device(machine, "upd4990a"); /* register state save */ - state_save_register_global(machine, display_position_interrupt_control); - state_save_register_global(machine, display_counter); - state_save_register_global(machine, vblank_interrupt_pending); - state_save_register_global(machine, display_position_interrupt_pending); - state_save_register_global(machine, irq3_pending); - state_save_register_global(machine, audio_result); - state_save_register_global(machine, controller_select); - state_save_register_global(machine, main_cpu_bank_address); - state_save_register_global(machine, main_cpu_vector_table_source); - state_save_register_global_array(machine, audio_cpu_banks); - state_save_register_global(machine, audio_cpu_rom_source); - state_save_register_global(machine, audio_cpu_rom_source_last); - state_save_register_global(machine, save_ram_unlocked); + state_save_register_global(machine, state->display_position_interrupt_control); + state_save_register_global(machine, state->display_counter); + state_save_register_global(machine, state->vblank_interrupt_pending); + state_save_register_global(machine, state->display_position_interrupt_pending); + state_save_register_global(machine, state->irq3_pending); + state_save_register_global(machine, state->audio_result); + state_save_register_global(machine, state->controller_select); + state_save_register_global(machine, state->main_cpu_bank_address); + state_save_register_global(machine, state->main_cpu_vector_table_source); + state_save_register_global_array(machine, state->audio_cpu_banks); + state_save_register_global(machine, state->audio_cpu_rom_source); + state_save_register_global(machine, state->audio_cpu_rom_source_last); + state_save_register_global(machine, state->save_ram_unlocked); state_save_register_global_pointer(machine, memcard_data, 0x800); - state_save_register_global(machine, output_data); - state_save_register_global(machine, output_latch); - state_save_register_global(machine, el_value); - state_save_register_global(machine, led1_value); - state_save_register_global(machine, led2_value); + state_save_register_global(machine, state->output_data); + state_save_register_global(machine, state->output_latch); + state_save_register_global(machine, state->el_value); + state_save_register_global(machine, state->led1_value); + state_save_register_global(machine, state->led2_value); + state_save_register_global(machine, state->recurse); state_save_register_postload(machine, neogeo_postload, NULL); } @@ -1089,20 +1115,24 @@ static MACHINE_START( neogeo ) static MACHINE_RESET( neogeo ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; offs_t offs; const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); /* reset system control registers */ for (offs = 0; offs < 8; offs++) system_control_w(space, offs, 0, 0x00ff); + device_reset(cputag_get_cpu(machine, "maincpu")); - neogeo_reset_rng(); + neogeo_reset_rng(machine); start_interrupt_timers(machine); /* trigger the IRQ3 that was set by MACHINE_START */ update_interrupts(machine); + + state->recurse = 0; } @@ -1309,6 +1339,9 @@ INPUT_PORTS_END static MACHINE_DRIVER_START( neogeo ) + /* driver data */ + MDRV_DRIVER_DATA(neogeo_state) + /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000, NEOGEO_MAIN_CPU_CLOCK) MDRV_CPU_PROGRAM_MAP(main_map) @@ -1356,6 +1389,8 @@ MACHINE_DRIVER_END static DRIVER_INIT( neogeo ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->fixed_layer_bank_type = 0; } diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 245f36cbcbe..f8b51fbdcd8 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -1,9 +1,138 @@ #ifndef _CPS1_H_ #define _CPS1_H_ +struct gfx_range +{ + // start and end are as passed by the game (shift adjusted to be all + // in the same scale a 8x8 tiles): they don't necessarily match the + // position in ROM. + int type; + int start; + int end; + int bank; +}; + +struct CPS1config +{ + const char *name; /* game driver name */ + + /* Some games interrogate a couple of registers on bootup. */ + /* These are CPS1 board B self test checks. They wander from game to */ + /* game. */ + int cpsb_addr; /* CPS board B test register address */ + int cpsb_value; /* CPS board B test register expected value */ + + /* some games use as a protection check the ability to do 16-bit multiplies */ + /* with a 32-bit result, by writing the factors to two ports and reading the */ + /* result from two other ports. */ + /* It looks like this feature was introduced with 3wonders (CPSB ID = 08xx) */ + int mult_factor1; + int mult_factor2; + int mult_result_lo; + int mult_result_hi; + + /* unknown registers which might be related to the multiply protection */ + int unknown1; + int unknown2; + int unknown3; + + int layer_control; + int priority[4]; + int palette_control; + + /* ideally, the layer enable masks should consist of only one bit, */ + /* but in many cases it is unknown which bit is which. */ + int layer_enable_mask[5]; + + /* these depend on the B-board model and PAL */ + int bank_sizes[4]; + const struct gfx_range *bank_mapper; + + /* some C-boards have additional I/O for extra buttons/extra players */ + int in2_addr; + int in3_addr; + int out2_addr; + + int bootleg_kludge; +}; + + +typedef struct _cps_state cps_state; +struct _cps_state +{ + /* memory pointers */ + // cps1 + UINT16 * gfxram; + UINT16 * cps_a_regs; + UINT16 * cps_b_regs; + UINT16 * scroll1; + UINT16 * scroll2; + UINT16 * scroll3; + UINT16 * obj; + UINT16 * other; + UINT16 * buffered_obj; + UINT8 * qsound_sharedram1; + UINT8 * qsound_sharedram2; + size_t gfxram_size; + // cps2 + UINT16 * objram1; + UINT16 * objram2; + UINT16 * output; + UINT16 * cps2_buffered_obj; + size_t output_size; + // game-specific + UINT16 * gigamn2_dummyqsound_ram; + + /* video-related */ + tilemap *bg_tilemap[3]; + int scanline1; + int scanline2; + int scancalls; + int scancount; + + int scroll1x, scroll1y; + int scroll2x, scroll2y; + int scroll3x, scroll3y; + + int stars_enabled[2]; /* Layer enabled [Y/N] */ + int stars1x, stars1y, stars2x, stars2y; + int last_sprite_offset; /* Offset of the last sprite */ + int cps2_last_sprite_offset; /* Offset of the last sprite */ + int pri_ctrl; /* Sprite layer priorities */ + int objram_bank; + + /* misc */ + int dial[2]; // forgottn + int readpaddle; // pzloop2 + int cps2networkpresent; + + /* fcrash sound hw */ + int sample_buffer1, sample_buffer2; + int sample_select1, sample_select2; + + /* video config (never changed after VIDEO_START) */ + const struct CPS1config *game_config; + int scroll_size; + int obj_size; + int cps2_obj_size; + int other_size; + int palette_align; + int palette_size; + int stars_rom_size; + UINT8 empty_tile8x8[8*8]; + UINT8 empty_tile[32*32/2]; + int cps_version; + + /* devices */ + const device_config *maincpu; + const device_config *audiocpu; + const device_config *msm_1; // fcrash + const device_config *msm_2; // fcrash +}; + /*----------- defined in drivers/cps1.c -----------*/ -ADDRESS_MAP_EXTERN(qsound_sub_map, 8); +ADDRESS_MAP_EXTERN( qsound_sub_map, 8 ); READ16_HANDLER( qsound_sharedram1_r ); WRITE16_HANDLER( qsound_sharedram1_w ); @@ -15,6 +144,36 @@ INTERRUPT_GEN( cps1_interrupt ); GFXDECODE_EXTERN( cps1 ); +/*----------- defined in video/cps1.c -----------*/ + +WRITE16_HANDLER( cps1_cps_a_w ); +WRITE16_HANDLER( cps1_cps_b_w ); +READ16_HANDLER( cps1_cps_b_r ); +WRITE16_HANDLER( cps1_gfxram_w ); + +DRIVER_INIT( cps1 ); +DRIVER_INIT( cps2_video ); + +WRITE16_HANDLER( cps2_objram_bank_w ); +READ16_HANDLER( cps2_objram1_r ); +READ16_HANDLER( cps2_objram2_r ); +WRITE16_HANDLER( cps2_objram1_w ); +WRITE16_HANDLER( cps2_objram2_w ); + +VIDEO_START( cps1 ); +VIDEO_START( cps2 ); +VIDEO_UPDATE( cps1 ); +VIDEO_EOF( cps1 ); + +void cps1_get_video_base(running_machine *machine); +void cps2_set_sprite_priorities(running_machine *machine); +void cps2_objram_latch(running_machine *machine); + + +/************************************* + * Encryption + *************************************/ + /*----------- defined in machine/cps2crpt.c -----------*/ DRIVER_INIT( cps2crpt ); @@ -39,53 +198,4 @@ void dino_decode(running_machine *machine); void punisher_decode(running_machine *machine); void slammast_decode(running_machine *machine); - -/*----------- defined in video/cps1.c -----------*/ - -extern int cps1_scanline1; -extern int cps1_scanline2; -extern int cps1_scancalls; - -extern UINT16 *cps1_gfxram; /* Video RAM */ -extern UINT16 *cps1_cps_a_regs; -extern UINT16 *cps1_cps_b_regs; -extern size_t cps1_gfxram_size; - -extern UINT16 *cps1_other; -extern tilemap *cps1_bg_tilemap[3]; - -extern int cps1_scroll1x, cps1_scroll1y; -extern int cps1_scroll2x, cps1_scroll2y; -extern int cps1_scroll3x, cps1_scroll3y; - -extern UINT16 *cps2_objram1,*cps2_objram2; -extern UINT16 *cps2_output; -extern size_t cps2_output_size; - -WRITE16_HANDLER( cps1_cps_a_w ); -WRITE16_HANDLER( cps1_cps_b_w ); -READ16_HANDLER( cps1_cps_b_r ); - -DRIVER_INIT( cps1 ); -DRIVER_INIT( cps2_video ); - -void cps1_get_video_base(void); - -WRITE16_HANDLER( cps1_gfxram_w ); - -VIDEO_START( cps1 ); -VIDEO_START( cps2 ); - -WRITE16_HANDLER( cps2_objram_bank_w ); -READ16_HANDLER( cps2_objram1_r ); -READ16_HANDLER( cps2_objram2_r ); -WRITE16_HANDLER( cps2_objram1_w ); -WRITE16_HANDLER( cps2_objram2_w ); - -VIDEO_UPDATE( cps1 ); -VIDEO_EOF( cps1 ); - -void cps2_set_sprite_priorities(void); -void cps2_objram_latch(void); - #endif diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 4157d01e5da..6bc7b7ad237 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -5,31 +5,112 @@ *************************************************************************/ -#define NEOGEO_MASTER_CLOCK (24000000) -#define NEOGEO_MAIN_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 2) -#define NEOGEO_AUDIO_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 6) -#define NEOGEO_YM2610_CLOCK (NEOGEO_MASTER_CLOCK / 3) -#define NEOGEO_PIXEL_CLOCK (NEOGEO_MASTER_CLOCK / 4) -#define NEOGEO_HTOTAL (0x180) -#define NEOGEO_HBEND (0x01e) /* this should really be 29.5 */ -#define NEOGEO_HBSTART (0x15e) /* this should really be 349.5 */ -#define NEOGEO_VTOTAL (0x108) -#define NEOGEO_VBEND (0x010) -#define NEOGEO_VBSTART (0x0f0) -#define NEOGEO_VSSTART (0x000) -#define NEOGEO_VBLANK_RELOAD_HPOS (0x11f) +#define NEOGEO_MASTER_CLOCK (24000000) +#define NEOGEO_MAIN_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 2) +#define NEOGEO_AUDIO_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 6) +#define NEOGEO_YM2610_CLOCK (NEOGEO_MASTER_CLOCK / 3) +#define NEOGEO_PIXEL_CLOCK (NEOGEO_MASTER_CLOCK / 4) +#define NEOGEO_HTOTAL (0x180) +#define NEOGEO_HBEND (0x01e) /* this should really be 29.5 */ +#define NEOGEO_HBSTART (0x15e) /* this should really be 349.5 */ +#define NEOGEO_VTOTAL (0x108) +#define NEOGEO_VBEND (0x010) +#define NEOGEO_VBSTART (0x0f0) +#define NEOGEO_VSSTART (0x000) +#define NEOGEO_VBLANK_RELOAD_HPOS (0x11f) -#define NEOGEO_BANK_AUDIO_CPU_CART_BANK "audio_cart" +#define NEOGEO_BANK_AUDIO_CPU_CART_BANK "audio_cart" /* do not use 2, 3 and 4 */ -#define NEOGEO_BANK_CARTRIDGE "cartridge" -#define NEOGEO_BANK_BIOS "bios" -#define NEOGEO_BANK_VECTORS "vectors" -#define NEOGEO_BANK_AUDIO_CPU_MAIN_BANK "audio_main" +#define NEOGEO_BANK_CARTRIDGE "cartridge" +#define NEOGEO_BANK_BIOS "bios" +#define NEOGEO_BANK_VECTORS "vectors" +#define NEOGEO_BANK_AUDIO_CPU_MAIN_BANK "audio_main" + + + +typedef struct _neogeo_state neogeo_state; +struct _neogeo_state +{ + /* memory pointers */ +// UINT8 *memcard_data; // this currently uses generic handlers +// UINT16 *save_ram; // this currently uses generic handlers + + /* video-related */ + UINT8 *sprite_gfx; + UINT32 sprite_gfx_address_mask; + UINT16 *videoram; + UINT16 *palettes[2]; /* 0x100*16 2 byte palette entries */ + pen_t *pens; + UINT8 palette_bank; + UINT8 screen_dark; + UINT16 videoram_read_buffer; + UINT16 videoram_modulo; + UINT16 videoram_offset; + + UINT8 fixed_layer_source; + + UINT8 auto_animation_speed; + UINT8 auto_animation_disabled; + UINT8 auto_animation_counter; + UINT8 auto_animation_frame_counter; + + const UINT8 *region_zoomy; + + + /* palette */ + double rgb_weights_normal[5]; + double rgb_weights_normal_bit15[5]; + double rgb_weights_dark[5]; + double rgb_weights_dark_bit15[5]; + + /* timers */ + emu_timer *display_position_interrupt_timer; + emu_timer *display_position_vblank_timer; + emu_timer *vblank_interrupt_timer; + emu_timer *auto_animation_timer; + emu_timer *sprite_line_timer; + UINT8 display_position_interrupt_control; + UINT32 display_counter; + UINT32 vblank_interrupt_pending; + UINT32 display_position_interrupt_pending; + UINT32 irq3_pending; + + /* misc */ + UINT8 controller_select; + + UINT32 main_cpu_bank_address; + UINT8 main_cpu_vector_table_source; + + UINT8 audio_result; + UINT8 audio_cpu_banks[4]; + UINT8 audio_cpu_rom_source; + UINT8 audio_cpu_rom_source_last; + + UINT8 save_ram_unlocked; + + UINT8 output_data; + UINT8 output_latch; + UINT8 el_value; + UINT8 led1_value; + UINT8 led2_value; + UINT8 recurse; + + /* protection */ + UINT32 fatfury2_prot_data; + UINT16 neogeo_rng; + UINT16 *pvc_cartridge_ram; + int fixed_layer_bank_type; + + /* devices */ + const device_config *maincpu; + const device_config *audiocpu; + const device_config *upd4990a; +}; /*----------- defined in drivers/neogeo.c -----------*/ -void neogeo_set_display_position_interrupt_control(UINT16 data); +void neogeo_set_display_position_interrupt_control(running_machine *machine, UINT16 data); void neogeo_set_display_counter_msb(const address_space *space, UINT16 data); void neogeo_set_display_counter_lsb(const address_space *space, UINT16 data); void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data); @@ -71,7 +152,7 @@ void samsh5sp_decrypt_68k(running_machine *machine); /*----------- defined in machine/neoprot.c -----------*/ -void neogeo_reset_rng(void); +void neogeo_reset_rng(running_machine *machine); void fatfury2_install_protection(running_machine *machine); void mslugx_install_protection(running_machine *machine); void kof99_install_protection(running_machine *machine); @@ -124,8 +205,6 @@ void matrimbl_decrypt(running_machine *machine); /*----------- defined in video/neogeo.c -----------*/ -extern int neogeo_fixed_layer_bank_type; - VIDEO_START( neogeo ); VIDEO_RESET( neogeo ); VIDEO_UPDATE( neogeo ); @@ -138,6 +217,6 @@ void neogeo_set_screen_dark(running_machine *machine, UINT8 data); READ16_HANDLER( neogeo_paletteram_r ); WRITE16_HANDLER( neogeo_paletteram_w ); -void neogeo_set_fixed_layer_source(UINT8 data); +void neogeo_set_fixed_layer_source(running_machine *machine, UINT8 data); -UINT8 neogeo_get_auto_animation_counter(void); +UINT8 neogeo_get_auto_animation_counter(running_machine *machine); diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c index c722f28cc09..fbcc39215db 100644 --- a/src/mame/machine/cps2crpt.c +++ b/src/mame/machine/cps2crpt.c @@ -989,6 +989,4 @@ DRIVER_INIT( cps2crpt ) } ++k; } - - DRIVER_INIT_CALL(cps2_video); } diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c index 682393b6da8..ef89c69e251 100644 --- a/src/mame/machine/neoprot.c +++ b/src/mame/machine/neoprot.c @@ -20,19 +20,12 @@ #include "driver.h" #include "neogeo.h" - - -static UINT32 fatfury2_prot_data; -static UINT16 neogeo_rng; - -static UINT16 *pvc_cartridge_ram; - - /************************ Fatal Fury 2 *************************/ static READ16_HANDLER( fatfury2_protection_16_r ) { - UINT16 res = fatfury2_prot_data >> 24; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + UINT16 res = state->fatfury2_prot_data >> 24; switch (offset) { @@ -49,7 +42,7 @@ static READ16_HANDLER( fatfury2_protection_16_r ) return ((res & 0xf0) >> 4) | ((res & 0x0f) << 4); default: -logerror("unknown protection read at pc %06x, offset %08x\n",cpu_get_pc(space->cpu),offset<<1); + logerror("unknown protection read at pc %06x, offset %08x\n", cpu_get_pc(space->cpu), offset << 1); return 0; } } @@ -57,30 +50,32 @@ logerror("unknown protection read at pc %06x, offset %08x\n",cpu_get_pc(space->c static WRITE16_HANDLER( fatfury2_protection_16_w ) { + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + switch (offset) { case 0x11112/2: /* data == 0x1111; expects 0xff000000 back */ - fatfury2_prot_data = 0xff000000; + state->fatfury2_prot_data = 0xff000000; break; case 0x33332/2: /* data == 0x3333; expects 0x0000ffff back */ - fatfury2_prot_data = 0x0000ffff; + state->fatfury2_prot_data = 0x0000ffff; break; case 0x44442/2: /* data == 0x4444; expects 0x00ff0000 back */ - fatfury2_prot_data = 0x00ff0000; + state->fatfury2_prot_data = 0x00ff0000; break; case 0x55552/2: /* data == 0x5555; read back from 55550, ffff0, 00000, ff000 */ - fatfury2_prot_data = 0xff00ff00; + state->fatfury2_prot_data = 0xff00ff00; break; case 0x56782/2: /* data == 0x1234; read back from 36000 *or* 36004 */ - fatfury2_prot_data = 0xf05a3601; + state->fatfury2_prot_data = 0xf05a3601; break; case 0x42812/2: /* data == 0x1824; read back from 36008 *or* 3600c */ - fatfury2_prot_data = 0x81422418; + state->fatfury2_prot_data = 0x81422418; break; case 0x55550/2: @@ -90,23 +85,27 @@ static WRITE16_HANDLER( fatfury2_protection_16_w ) case 0x36004/2: case 0x36008/2: case 0x3600c/2: - fatfury2_prot_data <<= 8; + state->fatfury2_prot_data <<= 8; break; default: - logerror("unknown protection write at pc %06x, offset %08x, data %02x\n",cpu_get_pc(space->cpu),offset,data); + logerror("unknown protection write at pc %06x, offset %08x, data %02x\n", cpu_get_pc(space->cpu), offset, data); break; } } -void fatfury2_install_protection(running_machine *machine) +void fatfury2_install_protection( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + /* the protection involves reading and writing addresses in the */ /* 0x2xxxxx range. There are several checks all around the code. */ memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x2fffff, 0, 0, fatfury2_protection_16_r, fatfury2_protection_16_w); - state_save_register_global(machine, fatfury2_prot_data); + state->fatfury2_prot_data = 0; + + state_save_register_global(machine, state->fatfury2_prot_data); } @@ -124,27 +123,28 @@ static WRITE16_HANDLER ( kof98_prot_w ) switch (data) { - case 0x0090: - logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n",cpu_get_pc(space->cpu), mem16[0x100/2], mem16[0x102/2]); - mem16[0x100/2] = 0x00c2; mem16[0x102/2] = 0x00fd; + case 0x0090: + logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n", cpu_get_pc(space->cpu), mem16[0x100/2], mem16[0x102/2]); + mem16[0x100/2] = 0x00c2; + mem16[0x102/2] = 0x00fd; break; - case 0x00f0: - logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n",cpu_get_pc(space->cpu), mem16[0x100/2], mem16[0x102/2]); - mem16[0x100/2] = 0x4e45; mem16[0x102/2] = 0x4f2d; + case 0x00f0: + logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n", cpu_get_pc(space->cpu), mem16[0x100/2], mem16[0x102/2]); + mem16[0x100/2] = 0x4e45; + mem16[0x102/2] = 0x4f2d; break; - default: // 00aa is written, but not needed? - logerror ("%06x kof98 - unknown protection write %04x\n",cpu_get_pc(space->cpu), data); + default: // 00aa is written, but not needed? + logerror ("%06x kof98 - unknown protection write %04x\n", cpu_get_pc(space->cpu), data); break; } } -void install_kof98_protection(running_machine *machine) +void install_kof98_protection( running_machine *machine ) { - /* when 0x20aaaa contains 0x0090 (word) then 0x100 (normally the neogeo header) should return 0x00c200fd - worked out using real hw */ + /* when 0x20aaaa contains 0x0090 (word) then 0x100 (normally the neogeo header) should return 0x00c200fd worked out using real hw */ memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x20aaaa, 0x20aaab, 0, 0, kof98_prot_w); } @@ -157,19 +157,19 @@ void install_kof98_protection(running_machine *machine) Also found on this special board is a QFP144 labeled with 0103 ***************************************************************/ -void mslugx_install_protection(running_machine *machine) +void mslugx_install_protection( running_machine *machine ) { int i; UINT16 *mem16 = (UINT16 *)memory_region(machine, "maincpu"); for (i = 0;i < (0x100000/2) - 4;i++) { - if (mem16[i+0] == 0x0243 && - mem16[i+1] == 0x0001 && /* andi.w #$1, D3 */ - mem16[i+2] == 0x6600) /* bne xxxx */ + if (mem16[i + 0] == 0x0243 && + mem16[i + 1] == 0x0001 && /* andi.w #$1, D3 */ + mem16[i + 2] == 0x6600) /* bne xxxx */ { - mem16[i+2] = 0x4e71; - mem16[i+3] = 0x4e71; + mem16[i + 2] = 0x4e71; + mem16[i + 3] = 0x4e71; } } mem16[0x3bdc/2] = 0x4e71; @@ -375,39 +375,42 @@ static READ16_HANDLER( prot_9a37_r ) static READ16_HANDLER( sma_random_r ) { - UINT16 old = neogeo_rng; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + UINT16 old = state->neogeo_rng; - UINT16 newbit = ((neogeo_rng >> 2) ^ - (neogeo_rng >> 3) ^ - (neogeo_rng >> 5) ^ - (neogeo_rng >> 6) ^ - (neogeo_rng >> 7) ^ - (neogeo_rng >>11) ^ - (neogeo_rng >>12) ^ - (neogeo_rng >>15)) & 1; + UINT16 newbit = ((state->neogeo_rng >> 2) ^ + (state->neogeo_rng >> 3) ^ + (state->neogeo_rng >> 5) ^ + (state->neogeo_rng >> 6) ^ + (state->neogeo_rng >> 7) ^ + (state->neogeo_rng >>11) ^ + (state->neogeo_rng >>12) ^ + (state->neogeo_rng >>15)) & 1; - neogeo_rng = (neogeo_rng << 1) | newbit; + state->neogeo_rng = (state->neogeo_rng << 1) | newbit; return old; } -void neogeo_reset_rng(void) +void neogeo_reset_rng( running_machine *machine ) { - neogeo_rng = 0x2345; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->neogeo_rng = 0x2345; } -static void sma_install_random_read_handler(running_machine *machine, int addr1, int addr2) +static void sma_install_random_read_handler( running_machine *machine, int addr1, int addr2 ) { - state_save_register_global(machine, neogeo_rng); + neogeo_state *state = (neogeo_state *)machine->driver_data; + state_save_register_global(machine, state->neogeo_rng); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), addr1, addr1 + 1, 0, 0, sma_random_r); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), addr2, addr2 + 1, 0, 0, sma_random_r); } -void kof99_install_protection(running_machine *machine) +void kof99_install_protection( running_machine *machine ) { memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2ffff0, 0x2ffff1, 0, 0, kof99_bankswitch_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); @@ -416,7 +419,7 @@ void kof99_install_protection(running_machine *machine) } -void garou_install_protection(running_machine *machine) +void garou_install_protection( running_machine *machine ) { memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fffc0, 0x2fffc1, 0, 0, garou_bankswitch_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); @@ -425,7 +428,7 @@ void garou_install_protection(running_machine *machine) } -void garouo_install_protection(running_machine *machine) +void garouo_install_protection( running_machine *machine ) { memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fffc0, 0x2fffc1, 0, 0, garouo_bankswitch_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); @@ -434,7 +437,7 @@ void garouo_install_protection(running_machine *machine) } -void mslug3_install_protection(running_machine *machine) +void mslug3_install_protection( running_machine *machine ) { memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fffe4, 0x2fffe5, 0, 0, mslug3_bankswitch_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); @@ -443,7 +446,7 @@ void mslug3_install_protection(running_machine *machine) } -void kof2000_install_protection(running_machine *machine) +void kof2000_install_protection( running_machine *machine ) { memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fffec, 0x2fffed, 0, 0, kof2000_bankswitch_w); memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe446, 0x2fe447, 0, 0, prot_9a37_r); @@ -457,72 +460,85 @@ void kof2000_install_protection(running_machine *machine) mslug5, svcchaos, kof2003 ***************************************************************/ -static void pvc_w8(offs_t offset, UINT8 data) +static void pvc_w8( running_machine *machine, offs_t offset, UINT8 data ) { - *(((UINT8*)pvc_cartridge_ram)+BYTE_XOR_LE(offset))=data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + *(((UINT8*)state->pvc_cartridge_ram) + BYTE_XOR_LE(offset)) = data; } -static UINT8 pvc_r8(offs_t offset) +static UINT8 pvc_r8( running_machine *machine, offs_t offset ) { - return *(((UINT8*)pvc_cartridge_ram)+BYTE_XOR_LE(offset)); + neogeo_state *state = (neogeo_state *)machine->driver_data; + return *(((UINT8*)state->pvc_cartridge_ram) + BYTE_XOR_LE(offset)); } -static void pvc_prot1( void ) +static void pvc_prot1( running_machine *machine ) { UINT8 b1, b2; - b1 = pvc_r8(0x1fe1); - b2 = pvc_r8(0x1fe0); - pvc_w8(0x1fe2,(((b2>>0)&0xf)<<1)|((b1>>4)&1)); - pvc_w8(0x1fe3,(((b2>>4)&0xf)<<1)|((b1>>5)&1)); - pvc_w8(0x1fe4,(((b1>>0)&0xf)<<1)|((b1>>6)&1)); - pvc_w8(0x1fe5, (b1>>7)); + + b1 = pvc_r8(machine, 0x1fe1); + b2 = pvc_r8(machine, 0x1fe0); + pvc_w8(machine, 0x1fe2, (((b2 >> 0) & 0xf) << 1) | ((b1 >> 4) & 1)); + pvc_w8(machine, 0x1fe3, (((b2 >> 4) & 0xf) << 1) | ((b1 >> 5) & 1)); + pvc_w8(machine, 0x1fe4, (((b1 >> 0) & 0xf) << 1) | ((b1 >> 6) & 1)); + pvc_w8(machine, 0x1fe5, (b1 >> 7)); } -static void pvc_prot2( void ) // on writes to e8/e9/ea/eb +static void pvc_prot2( running_machine *machine ) // on writes to e8/e9/ea/eb { UINT8 b1, b2, b3, b4; - b1 = pvc_r8(0x1fe9); - b2 = pvc_r8(0x1fe8); - b3 = pvc_r8(0x1feb); - b4 = pvc_r8(0x1fea); - pvc_w8(0x1fec,(b2>>1)|((b1>>1)<<4)); - pvc_w8(0x1fed,(b4>>1)|((b2&1)<<4)|((b1&1)<<5)|((b4&1)<<6)|((b3&1)<<7)); + + b1 = pvc_r8(machine, 0x1fe9); + b2 = pvc_r8(machine, 0x1fe8); + b3 = pvc_r8(machine, 0x1feb); + b4 = pvc_r8(machine, 0x1fea); + pvc_w8(machine, 0x1fec, (b2 >> 1) | ((b1 >> 1) << 4)); + pvc_w8(machine, 0x1fed, (b4 >> 1) | ((b2 & 1) << 4) | ((b1 & 1) << 5) | ((b4 & 1) << 6) | ((b3 & 1) << 7)); } static void pvc_write_bankswitch( const address_space *space ) { + neogeo_state *state = (neogeo_state *)space->machine->driver_data; UINT32 bankaddress; - bankaddress = ((pvc_cartridge_ram[0xff8]>>8)|(pvc_cartridge_ram[0xff9]<<8)); - *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff0)) = 0xa0; - *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff1)) &= 0xfe; - *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff3)) &= 0x7f; - neogeo_set_main_cpu_bank_address(space, bankaddress+0x100000); + + bankaddress = ((state->pvc_cartridge_ram[0xff8] >> 8)|(state->pvc_cartridge_ram[0xff9] << 8)); + *(((UINT8 *)state->pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff0)) = 0xa0; + *(((UINT8 *)state->pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff1)) &= 0xfe; + *(((UINT8 *)state->pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff3)) &= 0x7f; + neogeo_set_main_cpu_bank_address(space, bankaddress + 0x100000); } static READ16_HANDLER( pvc_prot_r ) { - return pvc_cartridge_ram[ offset ]; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + return state->pvc_cartridge_ram[offset]; } static WRITE16_HANDLER( pvc_prot_w ) { - COMBINE_DATA( &pvc_cartridge_ram[ offset ] ); - if (offset == 0xff0)pvc_prot1(); - else if(offset >= 0xff4 && offset <= 0xff5)pvc_prot2(); - else if(offset >= 0xff8)pvc_write_bankswitch(space); + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + + COMBINE_DATA(&state->pvc_cartridge_ram[offset] ); + if (offset == 0xff0) + pvc_prot1(space->machine); + else if(offset >= 0xff4 && offset <= 0xff5) + pvc_prot2(space->machine); + else if(offset >= 0xff8) + pvc_write_bankswitch(space); } void install_pvc_protection( running_machine *machine ) { - pvc_cartridge_ram = auto_alloc_array(machine, UINT16, 0x2000/2); - state_save_register_global_pointer(machine, pvc_cartridge_ram, 0x2000 / 2); + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->pvc_cartridge_ram = auto_alloc_array(machine, UINT16, 0x2000 / 2); + state_save_register_global_pointer(machine, state->pvc_cartridge_ram, 0x2000 / 2); memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2fe000, 0x2fffff, 0, 0, pvc_prot_r, pvc_prot_w); } diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index e47d89cdbb3..dbc9c334bda 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -318,7 +318,7 @@ The games seem to use them to mark platforms, kill zones and no-go areas. ***************************************************************************/ #include "driver.h" -#include "cps1.h" +#include "includes/cps1.h" #define VERBOSE 0 @@ -337,64 +337,6 @@ The games seem to use them to mark platforms, kill zones and no-go areas. #define GFXTYPE_STARS (1<<4) -struct gfx_range -{ - // start and end are as passed by the game (shift adjusted to be all - // in the same scale a 8x8 tiles): they don't necessarily match the - // position in ROM. - int type; - int start; - int end; - int bank; -}; - -struct CPS1config -{ - const char *name; /* game driver name */ - - /* Some games interrogate a couple of registers on bootup. */ - /* These are CPS1 board B self test checks. They wander from game to */ - /* game. */ - int cpsb_addr; /* CPS board B test register address */ - int cpsb_value; /* CPS board B test register expected value */ - - /* some games use as a protection check the ability to do 16-bit multiplies */ - /* with a 32-bit result, by writing the factors to two ports and reading the */ - /* result from two other ports. */ - /* It looks like this feature was introduced with 3wonders (CPSB ID = 08xx) */ - int mult_factor1; - int mult_factor2; - int mult_result_lo; - int mult_result_hi; - - /* unknown registers which might be related to the multiply protection */ - int unknown1; - int unknown2; - int unknown3; - - int layer_control; - int priority[4]; - int palette_control; - - /* ideally, the layer enable masks should consist of only one bit, */ - /* but in many cases it is unknown which bit is which. */ - int layer_enable_mask[5]; - - /* these depend on the B-board model and PAL */ - int bank_sizes[4]; - const struct gfx_range *bank_mapper; - - /* some C-boards have additional I/O for extra buttons/extra players */ - int in2_addr; - int in3_addr; - int out2_addr; - - int bootleg_kludge; -}; - -static const struct CPS1config *cps1_game_config; - - #define __not_applicable__ -1,-1,-1,-1,-1,-1,-1 /* CPSB ID multiply protection unknown ctrl priority masks palctrl layer enable masks */ @@ -1229,7 +1171,6 @@ static const struct gfx_range mapper_cps2_table[] = }; - static const struct CPS1config cps1_config_table[]= { /* name CPSB gfx mapper in2 in3 out2 kludge */ @@ -1381,41 +1322,10 @@ static const struct CPS1config cps1_config_table[]= -/* Public variables */ -UINT16 *cps1_gfxram; -UINT16 *cps1_cps_a_regs; -UINT16 *cps1_cps_b_regs; - -size_t cps1_gfxram_size; /* Offset of each palette entry */ #define cps1_palette_entries (32*6) /* Number colour schemes in palette */ -static const int cps1_scroll_size =0x4000; /* scroll1, scroll2, scroll3 */ -static const int cps1_obj_size =0x0800; -static const int cps1_other_size =0x0800; -static const int cps1_palette_align=0x0400; /* minimum alignment is a single palette page (512 colors). Verified on pcb. */ -static const int cps1_palette_size=cps1_palette_entries*32; /* Size of palette RAM */ - -static UINT16 *cps1_scroll1; -static UINT16 *cps1_scroll2; -static UINT16 *cps1_scroll3; -static UINT16 *cps1_obj; -static UINT16 *cps1_buffered_obj; -UINT16 *cps1_other; - -/* Working variables */ -static int cps1_last_sprite_offset; /* Offset of the last sprite */ -static int cps1_stars_enabled[2]; /* Layer enabled [Y/N] */ - -tilemap *cps1_bg_tilemap[3]; - - -int cps1_scroll1x, cps1_scroll1y; -int cps1_scroll2x, cps1_scroll2y; -int cps1_scroll3x, cps1_scroll3y; -static int stars1x, stars1y, stars2x, stars2y; - /* CPS-A registers */ #define CPS1_OBJ_BASE (0x00/2) /* Base address of objects */ @@ -1442,20 +1352,6 @@ static int stars1x, stars1y, stars2x, stars2y; CPS1 VIDEO RENDERER */ -/* first 0x4000 of gfx ROM are used, but 0x0000-0x1fff is == 0x2000-0x3fff */ -static const int stars_rom_size = 0x2000; - -/* PSL: CPS2 support */ -static const int cps2_obj_size =0x2000; -UINT16 *cps2_objram1,*cps2_objram2; -UINT16 *cps2_output; - -size_t cps2_output_size; -static UINT16 *cps2_buffered_obj; -static int pri_ctrl; /* Sprite layer priorities */ -static int cps2_objram_bank; -static int cps2_last_sprite_offset; /* Offset of the last sprite */ - #define CPS2_OBJ_BASE 0x00 /* Unknown (not base address of objects). Could be bass address of bank used when object swap bit set? */ #define CPS2_OBJ_UK1 0x02 /* Unknown (nearly always 0x807d, or 0x808e when screen flipped) */ #define CPS2_OBJ_PRI 0x04 /* Layers priorities */ @@ -1464,83 +1360,81 @@ static int cps2_last_sprite_offset; /* Offset of the last sprite */ #define CPS2_OBJ_YOFFS 0x0a /* Y offset (always 0x0010) */ -static int cps_version; -int cps1_scanline1; -int cps1_scanline2; -int cps1_scancalls; - - static void cps1_build_palette(running_machine *machine, const UINT16* const palette_base); static MACHINE_RESET( cps ) { + cps_state *state = (cps_state *)machine->driver_data; const char *gamename = machine->gamedrv->name; - const struct CPS1config *pCFG=&cps1_config_table[0]; + const struct CPS1config *pCFG = &cps1_config_table[0]; - while(pCFG->name) + while (pCFG->name) { if (strcmp(pCFG->name, gamename) == 0) - { break; - } + pCFG++; } - cps1_game_config=pCFG; - if (!cps1_game_config->name) - { - gamename="cps2"; - pCFG=&cps1_config_table[0]; - while(pCFG->name) - { - if (strcmp(pCFG->name, gamename) == 0) - { - break; - } - pCFG++; - } - cps1_game_config=pCFG; - } + state->game_config = pCFG; - if (strcmp(gamename, "sf2rb" )==0) + if (!state->game_config->name) { - /* Patch out protection check */ - UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); - rom[0xe5464/2] = 0x6012; + gamename = "cps2"; + pCFG = &cps1_config_table[0]; + + while(pCFG->name) + { + if (strcmp(pCFG->name, gamename) == 0) + break; + + pCFG++; + } + + state->game_config = pCFG; } - if (strcmp(gamename, "sf2rb2" )==0) + + if (strcmp(gamename, "sf2rb") == 0) { /* Patch out protection check */ UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); - rom[0xe5332/2] = 0x6014; + rom[0xe5464 / 2] = 0x6012; + } + + if (strcmp(gamename, "sf2rb2") == 0) + { + /* Patch out protection check */ + UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); + rom[0xe5332 / 2] = 0x6014; } #if 0 - if (strcmp(gamename, "sf2accp2" )==0) + if (strcmp(gamename, "sf2accp2") == 0) { /* Patch out a odd branch which would be incorrectly interpreted by the cpu core as a 32-bit branch. This branch would make the game crash (address error, since it would branch to an odd address) if location 180ca6 (outside ROM space) isn't 0. Protection check? */ UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); - rom[0x11756/2] = 0x4e71; + rom[0x11756 / 2] = 0x4e71; } - else if (strcmp(gamename, "ghouls" )==0) + else if (strcmp(gamename, "ghouls") == 0) { /* Patch out self-test... it takes forever */ UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu"); - rom[0x61964/2] = 0x4ef9; - rom[0x61966/2] = 0x0000; - rom[0x61968/2] = 0x0400; + rom[0x61964 / 2] = 0x4ef9; + rom[0x61966 / 2] = 0x0000; + rom[0x61968 / 2] = 0x0400; } #endif } -INLINE UINT16 *cps1_base(int offset,int boundary) +INLINE UINT16 *cps1_base( running_machine *machine, int offset, int boundary ) { - int base = cps1_cps_a_regs[offset]*256; + cps_state *state = (cps_state *)machine->driver_data; + int base = state->cps_a_regs[offset] * 256; /* The scroll RAM must start on a 0x4000 boundary. @@ -1550,15 +1444,16 @@ INLINE UINT16 *cps1_base(int offset,int boundary) Muscle bomber games - will animate garbage during gameplay Mask out the irrelevant bits. */ - base &= ~(boundary-1); - return &cps1_gfxram[(base&0x3ffff)/2]; + base &= ~(boundary - 1); + return &state->gfxram[(base & 0x3ffff) / 2]; } WRITE16_HANDLER( cps1_cps_a_w ) { - data = COMBINE_DATA(&cps1_cps_a_regs[offset]); + cps_state *state = (cps_state *)space->machine->driver_data; + data = COMBINE_DATA(&state->cps_a_regs[offset]); /* The main CPU writes the palette to gfxram, and the CPS-B custom copies it @@ -1569,55 +1464,56 @@ WRITE16_HANDLER( cps1_cps_a_w ) fixes glitches in the ghouls intro, but it might happen at next vblank. */ if (offset == CPS1_PALETTE_BASE) - cps1_build_palette(space->machine, cps1_base(CPS1_PALETTE_BASE,cps1_palette_align)); + cps1_build_palette(space->machine, cps1_base(space->machine, CPS1_PALETTE_BASE, state->palette_align)); // pzloop2 write to register 24 on startup. This is probably just a bug. - if (offset == 0x24/2 && cps_version == 2) + if (offset == 0x24 / 2 && state->cps_version == 2) return; if (offset > CPS1_VIDEOCONTROL) - popmessage("write to CPS-A register %02x contact MAMEDEV", offset*2); + popmessage("write to CPS-A register %02x contact MAMEDEV", offset * 2); } READ16_HANDLER( cps1_cps_b_r ) { + cps_state *state = (cps_state *)space->machine->driver_data; + /* Some games interrogate a couple of registers on bootup. */ /* These are CPS1 board B self test checks. They wander from game to */ /* game. */ - if (offset == cps1_game_config->cpsb_addr/2) - return cps1_game_config->cpsb_value; + if (offset == state->game_config->cpsb_addr / 2) + return state->game_config->cpsb_value; /* some games use as a protection check the ability to do 16-bit multiplications */ /* with a 32-bit result, by writing the factors to two ports and reading the */ /* result from two other ports. */ - if (offset == cps1_game_config->mult_result_lo/2) - return (cps1_cps_b_regs[cps1_game_config->mult_factor1/2] * - cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) & 0xffff; - if (offset == cps1_game_config->mult_result_hi/2) - return (cps1_cps_b_regs[cps1_game_config->mult_factor1/2] * - cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) >> 16; + if (offset == state->game_config->mult_result_lo / 2) + return (state->cps_b_regs[state->game_config->mult_factor1 / 2] * + state->cps_b_regs[state->game_config->mult_factor2 / 2]) & 0xffff; - if (offset == cps1_game_config->in2_addr/2) /* Extra input ports (on C-board) */ + if (offset == state->game_config->mult_result_hi / 2) + return (state->cps_b_regs[state->game_config->mult_factor1 / 2] * + state->cps_b_regs[state->game_config->mult_factor2 / 2]) >> 16; + + if (offset == state->game_config->in2_addr / 2) /* Extra input ports (on C-board) */ return input_port_read(space->machine, "IN2"); - if (offset == cps1_game_config->in3_addr/2) /* Player 4 controls (on C-board) ("Captain Commando") */ + if (offset == state->game_config->in3_addr / 2) /* Player 4 controls (on C-board) ("Captain Commando") */ return input_port_read(space->machine, "IN3"); - if (cps_version == 2) + if (state->cps_version == 2) { if (offset == 0x10/2) { // UNKNOWN--only mmatrix appears to read this, and I'm not sure if the result is actuallyused - return cps1_cps_b_regs[0x10/2]; + return state->cps_b_regs[0x10 / 2]; } if (offset == 0x12/2) - { - return cps1_cps_b_regs[0x12/2]; - } + return state->cps_b_regs[0x12 / 2]; } - popmessage("CPS-B read port %02x contact MAMEDEV", offset*2); + popmessage("CPS-B read port %02x contact MAMEDEV", offset * 2); return 0xffff; } @@ -1625,9 +1521,10 @@ READ16_HANDLER( cps1_cps_b_r ) WRITE16_HANDLER( cps1_cps_b_w ) { - data = COMBINE_DATA(&cps1_cps_b_regs[offset]); + cps_state *state = (cps_state *)space->machine->driver_data; + data = COMBINE_DATA(&state->cps_b_regs[offset]); - if (cps_version == 2) + if (state->cps_version == 2) { /* To mark scanlines for raster effects */ if (offset == 0x0e/2) @@ -1637,80 +1534,78 @@ WRITE16_HANDLER( cps1_cps_b_w ) } if (offset == 0x10/2) { - cps1_scanline1 = (data & 0x1ff); + state->scanline1 = (data & 0x1ff); return; } if (offset == 0x12/2) { - cps1_scanline2 = (data & 0x1ff); + state->scanline2 = (data & 0x1ff); return; } } // additional outputs on C-board - if (offset == cps1_game_config->out2_addr/2) + if (offset == state->game_config->out2_addr / 2) { if (ACCESSING_BITS_0_7) { - if (cps1_game_config->cpsb_value == 0x0402) // Mercs (CN2 connector) + if (state->game_config->cpsb_value == 0x0402) // Mercs (CN2 connector) { - coin_lockout_w(space->machine, 2,~data & 0x01); - set_led_status(space->machine, 0,data & 0x02); - set_led_status(space->machine, 1,data & 0x04); - set_led_status(space->machine, 2,data & 0x08); + coin_lockout_w(space->machine, 2, ~data & 0x01); + set_led_status(space->machine, 0, data & 0x02); + set_led_status(space->machine, 1, data & 0x04); + set_led_status(space->machine, 2, data & 0x08); } else // kod, captcomm, knights { - coin_lockout_w(space->machine, 2,~data & 0x02); - coin_lockout_w(space->machine, 3,~data & 0x08); + coin_lockout_w(space->machine, 2, ~data & 0x02); + coin_lockout_w(space->machine, 3, ~data & 0x08); } } } - if (offset != cps1_game_config->cpsb_addr/2 && // only varth writes here - offset != cps1_game_config->mult_factor1/2 && - offset != cps1_game_config->mult_factor2/2 && - offset != cps1_game_config->layer_control/2 && - offset != cps1_game_config->unknown1/2 && - offset != cps1_game_config->unknown2/2 && - offset != cps1_game_config->unknown3/2 && - offset != cps1_game_config->priority[0]/2 && - offset != cps1_game_config->priority[1]/2 && - offset != cps1_game_config->priority[2]/2 && - offset != cps1_game_config->priority[3]/2 && - offset != cps1_game_config->palette_control/2 && - offset != cps1_game_config->out2_addr/2 && - !cps1_game_config->bootleg_kludge) - popmessage("CPS-B write %04x to port %02x contact MAMEDEV", data, offset*2); + if (offset != state->game_config->cpsb_addr / 2 && // only varth writes here + offset != state->game_config->mult_factor1 / 2 && + offset != state->game_config->mult_factor2 / 2 && + offset != state->game_config->layer_control / 2 && + offset != state->game_config->unknown1 / 2 && + offset != state->game_config->unknown2 / 2 && + offset != state->game_config->unknown3 / 2 && + offset != state->game_config->priority[0] / 2 && + offset != state->game_config->priority[1] / 2 && + offset != state->game_config->priority[2] / 2 && + offset != state->game_config->priority[3] / 2 && + offset != state->game_config->palette_control / 2 && + offset != state->game_config->out2_addr / 2 && + !state->game_config->bootleg_kludge) + popmessage("CPS-B write %04x to port %02x contact MAMEDEV", data, offset * 2); } -INLINE int cps2_port(int offset) +INLINE int cps2_port( running_machine *machine, int offset ) { - return cps2_output[offset/2]; + cps_state *state = (cps_state *)machine->driver_data; + return state->output[offset / 2]; } - - -static void cps1_gfx_decode(running_machine *machine) +static void cps1_gfx_decode( running_machine *machine ) { - int size=memory_region_length(machine, "gfx"); - int i,j,gfxsize; + int size = memory_region_length(machine, "gfx"); + int i, j, gfxsize; UINT8 *cps1_gfx = memory_region(machine, "gfx"); + gfxsize = size / 4; - gfxsize=size/4; - - for (i = 0;i < gfxsize;i++) + for (i = 0; i < gfxsize; i++) { - UINT32 src = cps1_gfx[4*i] + (cps1_gfx[4*i+1]<<8) + (cps1_gfx[4*i+2]<<16) + (cps1_gfx[4*i+3]<<24); + UINT32 src = cps1_gfx[4 * i] + (cps1_gfx[4 * i + 1] << 8) + (cps1_gfx[4 * i + 2] << 16) + (cps1_gfx[4 * i + 3] << 24); UINT32 dwval = 0; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { int n = 0; UINT32 mask = (0x80808080 >> j) & src; @@ -1722,43 +1617,44 @@ static void cps1_gfx_decode(running_machine *machine) dwval |= n << (j * 4); } - cps1_gfx[4*i ] = dwval>>0; - cps1_gfx[4*i+1] = dwval>>8; - cps1_gfx[4*i+2] = dwval>>16; - cps1_gfx[4*i+3] = dwval>>24; + cps1_gfx[4 *i ] = dwval >> 0; + cps1_gfx[4 *i + 1] = dwval >> 8; + cps1_gfx[4 *i + 2] = dwval >> 16; + cps1_gfx[4 *i + 3] = dwval >> 24; } } -static void unshuffle(UINT64 *buf,int len) +static void unshuffle( UINT64 *buf, int len ) { int i; UINT64 t; - if (len == 2) return; + if (len == 2) + return; assert(len % 4 == 0); /* must not happen */ len /= 2; - unshuffle(buf,len); - unshuffle(buf + len,len); + unshuffle(buf, len); + unshuffle(buf + len, len); - for (i = 0;i < len/2;i++) + for (i = 0; i < len / 2; i++) { - t = buf[len/2 + i]; - buf[len/2 + i] = buf[len + i]; + t = buf[len / 2 + i]; + buf[len / 2 + i] = buf[len + i]; buf[len + i] = t; } } -static void cps2_gfx_decode(running_machine *machine) +static void cps2_gfx_decode( running_machine *machine ) { - const int banksize=0x200000; - int size=memory_region_length(machine, "gfx"); + const int banksize = 0x200000; + int size = memory_region_length(machine, "gfx"); int i; - for (i = 0;i < size;i += banksize) - unshuffle((UINT64 *)(memory_region(machine, "gfx") + i),banksize/8); + for (i = 0; i < size; i += banksize) + unshuffle((UINT64 *)(memory_region(machine, "gfx") + i), banksize / 8); cps1_gfx_decode(machine); } @@ -1766,103 +1662,123 @@ static void cps2_gfx_decode(running_machine *machine) DRIVER_INIT( cps1 ) { + cps_state *state = (cps_state *)machine->driver_data; + cps1_gfx_decode(machine); + + state->scanline1 = 0; + state->scanline2 = 0; + state->scancalls = 0; + state->last_sprite_offset = 0; + state->pri_ctrl = 0; + state->objram_bank = 0; } DRIVER_INIT( cps2_video ) { + cps_state *state = (cps_state *)machine->driver_data; + cps2_gfx_decode(machine); - cps1_scanline1 = 262; - cps1_scanline2 = 262; - cps1_scancalls = 0; + state->scanline1 = 262; + state->scanline2 = 262; + state->scancalls = 0; + state->last_sprite_offset = 0; + state->cps2_last_sprite_offset = 0; + state->pri_ctrl = 0; + state->objram_bank = 0; } -void cps1_get_video_base(void ) +void cps1_get_video_base( running_machine *machine ) { + cps_state *state = (cps_state *)machine->driver_data; int layercontrol, videocontrol, scroll1xoff, scroll2xoff, scroll3xoff; /* Re-calculate the VIDEO RAM base */ - if (cps1_scroll1 != cps1_base(CPS1_SCROLL1_BASE,cps1_scroll_size)) + if (state->scroll1 != cps1_base(machine, CPS1_SCROLL1_BASE, state->scroll_size)) { - cps1_scroll1 = cps1_base(CPS1_SCROLL1_BASE,cps1_scroll_size); - tilemap_mark_all_tiles_dirty(cps1_bg_tilemap[0]); + state->scroll1 = cps1_base(machine, CPS1_SCROLL1_BASE, state->scroll_size); + tilemap_mark_all_tiles_dirty(state->bg_tilemap[0]); } - if (cps1_scroll2 != cps1_base(CPS1_SCROLL2_BASE,cps1_scroll_size)) + if (state->scroll2 != cps1_base(machine, CPS1_SCROLL2_BASE, state->scroll_size)) { - cps1_scroll2 = cps1_base(CPS1_SCROLL2_BASE,cps1_scroll_size); - tilemap_mark_all_tiles_dirty(cps1_bg_tilemap[1]); + state->scroll2 = cps1_base(machine, CPS1_SCROLL2_BASE, state->scroll_size); + tilemap_mark_all_tiles_dirty(state->bg_tilemap[1]); } - if (cps1_scroll3 != cps1_base(CPS1_SCROLL3_BASE,cps1_scroll_size)) + if (state->scroll3 != cps1_base(machine, CPS1_SCROLL3_BASE, state->scroll_size)) { - cps1_scroll3 = cps1_base(CPS1_SCROLL3_BASE,cps1_scroll_size); - tilemap_mark_all_tiles_dirty(cps1_bg_tilemap[2]); + state->scroll3 = cps1_base(machine, CPS1_SCROLL3_BASE, state->scroll_size); + tilemap_mark_all_tiles_dirty(state->bg_tilemap[2]); } /* Some of the sf2 hacks use only sprite port 0x9100 and the scroll layers are offset */ - if (cps1_game_config->bootleg_kludge == 1) + if (state->game_config->bootleg_kludge == 1) { - cps1_cps_a_regs[CPS1_OBJ_BASE] = 0x9100; - cps1_obj = cps1_base(CPS1_OBJ_BASE, cps1_obj_size); + state->cps_a_regs[CPS1_OBJ_BASE] = 0x9100; + state->obj = cps1_base(machine, CPS1_OBJ_BASE, state->obj_size); scroll1xoff = -0x0c; scroll2xoff = -0x0e; scroll3xoff = -0x10; } else { - cps1_obj = cps1_base(CPS1_OBJ_BASE, cps1_obj_size); + state->obj = cps1_base(machine, CPS1_OBJ_BASE, state->obj_size); scroll1xoff = 0; scroll2xoff = 0; scroll3xoff = 0; } - cps1_other = cps1_base(CPS1_OTHER_BASE,cps1_other_size); + + state->other = cps1_base(machine, CPS1_OTHER_BASE, state->other_size); /* Get scroll values */ - cps1_scroll1x = cps1_cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; - cps1_scroll1y = cps1_cps_a_regs[CPS1_SCROLL1_SCROLLY]; - cps1_scroll2x = cps1_cps_a_regs[CPS1_SCROLL2_SCROLLX] + scroll2xoff; - cps1_scroll2y = cps1_cps_a_regs[CPS1_SCROLL2_SCROLLY]; - cps1_scroll3x = cps1_cps_a_regs[CPS1_SCROLL3_SCROLLX] + scroll3xoff; - cps1_scroll3y = cps1_cps_a_regs[CPS1_SCROLL3_SCROLLY]; - stars1x = cps1_cps_a_regs[CPS1_STARS1_SCROLLX]; - stars1y = cps1_cps_a_regs[CPS1_STARS1_SCROLLY]; - stars2x = cps1_cps_a_regs[CPS1_STARS2_SCROLLX]; - stars2y = cps1_cps_a_regs[CPS1_STARS2_SCROLLY]; + state->scroll1x = state->cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; + state->scroll1y = state->cps_a_regs[CPS1_SCROLL1_SCROLLY]; + state->scroll2x = state->cps_a_regs[CPS1_SCROLL2_SCROLLX] + scroll2xoff; + state->scroll2y = state->cps_a_regs[CPS1_SCROLL2_SCROLLY]; + state->scroll3x = state->cps_a_regs[CPS1_SCROLL3_SCROLLX] + scroll3xoff; + state->scroll3y = state->cps_a_regs[CPS1_SCROLL3_SCROLLY]; + state->stars1x = state->cps_a_regs[CPS1_STARS1_SCROLLX]; + state->stars1y = state->cps_a_regs[CPS1_STARS1_SCROLLY]; + state->stars2x = state->cps_a_regs[CPS1_STARS2_SCROLLX]; + state->stars2y = state->cps_a_regs[CPS1_STARS2_SCROLLY]; /* Get layer enable bits */ - layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2]; - videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL]; - tilemap_set_enable(cps1_bg_tilemap[0],layercontrol & cps1_game_config->layer_enable_mask[0]); - tilemap_set_enable(cps1_bg_tilemap[1],(layercontrol & cps1_game_config->layer_enable_mask[1]) && (videocontrol & 4)); - tilemap_set_enable(cps1_bg_tilemap[2],(layercontrol & cps1_game_config->layer_enable_mask[2]) && (videocontrol & 8)); - cps1_stars_enabled[0] = layercontrol & cps1_game_config->layer_enable_mask[3]; - cps1_stars_enabled[1] = layercontrol & cps1_game_config->layer_enable_mask[4]; + layercontrol = state->cps_b_regs[state->game_config->layer_control / 2]; + videocontrol = state->cps_a_regs[CPS1_VIDEOCONTROL]; + tilemap_set_enable(state->bg_tilemap[0],layercontrol & state->game_config->layer_enable_mask[0]); + tilemap_set_enable(state->bg_tilemap[1],(layercontrol & state->game_config->layer_enable_mask[1]) && (videocontrol & 4)); + tilemap_set_enable(state->bg_tilemap[2],(layercontrol & state->game_config->layer_enable_mask[2]) && (videocontrol & 8)); + state->stars_enabled[0] = layercontrol & state->game_config->layer_enable_mask[3]; + state->stars_enabled[1] = layercontrol & state->game_config->layer_enable_mask[4]; { - int enablemask; + int enablemask = 0; + + if (state->game_config->layer_enable_mask[0] == state->game_config->layer_enable_mask[1]) + enablemask = state->game_config->layer_enable_mask[0]; + + if (state->game_config->layer_enable_mask[0] == state->game_config->layer_enable_mask[2]) + enablemask = state->game_config->layer_enable_mask[0]; + + if (state->game_config->layer_enable_mask[1] == state->game_config->layer_enable_mask[2]) + enablemask = state->game_config->layer_enable_mask[1]; - enablemask = 0; - if (cps1_game_config->layer_enable_mask[0] == cps1_game_config->layer_enable_mask[1]) - enablemask = cps1_game_config->layer_enable_mask[0]; - if (cps1_game_config->layer_enable_mask[0] == cps1_game_config->layer_enable_mask[2]) - enablemask = cps1_game_config->layer_enable_mask[0]; - if (cps1_game_config->layer_enable_mask[1] == cps1_game_config->layer_enable_mask[2]) - enablemask = cps1_game_config->layer_enable_mask[1]; if (enablemask) { if (((layercontrol & enablemask) && (layercontrol & enablemask) != enablemask)) - popmessage("layer %02x contact MAMEDEV",layercontrol&0xc03f); + popmessage("layer %02x contact MAMEDEV", layercontrol & 0xc03f); } - enablemask = cps1_game_config->layer_enable_mask[0] | cps1_game_config->layer_enable_mask[1] - | cps1_game_config->layer_enable_mask[2] - | cps1_game_config->layer_enable_mask[3] | cps1_game_config->layer_enable_mask[4]; + enablemask = state->game_config->layer_enable_mask[0] | state->game_config->layer_enable_mask[1] + | state->game_config->layer_enable_mask[2] + | state->game_config->layer_enable_mask[3] | state->game_config->layer_enable_mask[4]; + if (((layercontrol & ~enablemask) & 0x003e) != 0) - popmessage("layer %02x contact MAMEDEV",layercontrol&0xc03f); + popmessage("layer %02x contact MAMEDEV", layercontrol & 0xc03f); } } @@ -1870,22 +1786,26 @@ void cps1_get_video_base(void ) WRITE16_HANDLER( cps1_gfxram_w ) { + cps_state *state = (cps_state *)space->machine->driver_data; int page = (offset >> 7) & 0x3c0; - COMBINE_DATA(&cps1_gfxram[offset]); + COMBINE_DATA(&state->gfxram[offset]); - if (page == (cps1_cps_a_regs[CPS1_SCROLL1_BASE] & 0x3c0)) - tilemap_mark_tile_dirty(cps1_bg_tilemap[0],offset/2 & 0x0fff); - if (page == (cps1_cps_a_regs[CPS1_SCROLL2_BASE] & 0x3c0)) - tilemap_mark_tile_dirty(cps1_bg_tilemap[1],offset/2 & 0x0fff); - if (page == (cps1_cps_a_regs[CPS1_SCROLL3_BASE] & 0x3c0)) - tilemap_mark_tile_dirty(cps1_bg_tilemap[2],offset/2 & 0x0fff); + if (page == (state->cps_a_regs[CPS1_SCROLL1_BASE] & 0x3c0)) + tilemap_mark_tile_dirty(state->bg_tilemap[0], offset / 2 & 0x0fff); + + if (page == (state->cps_a_regs[CPS1_SCROLL2_BASE] & 0x3c0)) + tilemap_mark_tile_dirty(state->bg_tilemap[1], offset / 2 & 0x0fff); + + if (page == (state->cps_a_regs[CPS1_SCROLL3_BASE] & 0x3c0)) + tilemap_mark_tile_dirty(state->bg_tilemap[2], offset / 2 & 0x0fff); } -static int gfxrom_bank_mapper(running_machine *machine, int type, int code) +static int gfxrom_bank_mapper( running_machine *machine, int type, int code ) { - const struct gfx_range *range = cps1_game_config->bank_mapper; + cps_state *state = (cps_state *)machine->driver_data; + const struct gfx_range *range = state->game_config->bank_mapper; int shift = 0; assert(range); @@ -1910,9 +1830,9 @@ static int gfxrom_bank_mapper(running_machine *machine, int type, int code) int i; for (i = 0; i < range->bank; ++i) - base += cps1_game_config->bank_sizes[i]; + base += state->game_config->bank_sizes[i]; - return (base + (code & (cps1_game_config->bank_sizes[range->bank] - 1))) >> shift; + return (base + (code & (state->game_config->bank_sizes[range->bank] - 1))) >> shift; } } @@ -1920,7 +1840,7 @@ static int gfxrom_bank_mapper(running_machine *machine, int type, int code) } #ifdef MAME_DEBUG -// popmessage("tile %02x/%04x out of range", type,code>>shift); +// popmessage("tile %02x/%04x out of range", type, code >> shift); #endif return -1; @@ -1951,13 +1871,11 @@ static TILEMAP_MAPPER( tilemap2_scan ) return (row & 0x07) + ((col & 0x3f) << 3) + ((row & 0x38) << 6); } -static UINT8 empty_tile8x8[8*8]; -static UINT8 empty_tile[32*32/2]; - static TILE_GET_INFO( get_tile0_info ) { - int code = cps1_scroll1[2*tile_index]; - int attr = cps1_scroll1[2*tile_index+1]; + cps_state *state = (cps_state *)machine->driver_data; + int code = state->scroll1[2 * tile_index]; + int attr = state->scroll1[2 * tile_index + 1]; int gfxset; code = gfxrom_bank_mapper(machine, GFXTYPE_SCROLL1, code); @@ -1977,13 +1895,14 @@ static TILE_GET_INFO( get_tile0_info ) // for out of range tiles, switch to fully transparent data // (but still call SET_TILE_INFO, otherwise problems might occur on boot e.g. unsquad) if (code == -1) - tileinfo->pen_data = empty_tile8x8; + tileinfo->pen_data = state->empty_tile8x8; } static TILE_GET_INFO( get_tile1_info ) { - int code = cps1_scroll2[2*tile_index]; - int attr = cps1_scroll2[2*tile_index+1]; + cps_state *state = (cps_state *)machine->driver_data; + int code = state->scroll2[2 * tile_index]; + int attr = state->scroll2[2 * tile_index + 1]; code = gfxrom_bank_mapper(machine, GFXTYPE_SCROLL2, code); @@ -1996,13 +1915,14 @@ static TILE_GET_INFO( get_tile1_info ) // for out of range tiles, switch to fully transparent data if (code == -1) - tileinfo->pen_data = empty_tile; + tileinfo->pen_data = state->empty_tile; } static TILE_GET_INFO( get_tile2_info ) { - int code = cps1_scroll3[2*tile_index] & 0x3fff; - int attr = cps1_scroll3[2*tile_index+1]; + cps_state *state = (cps_state *)machine->driver_data; + int code = state->scroll3[2 * tile_index] & 0x3fff; + int attr = state->scroll3[2 * tile_index + 1]; code = gfxrom_bank_mapper(machine, GFXTYPE_SCROLL3, code); @@ -2016,91 +1936,149 @@ static TILE_GET_INFO( get_tile2_info ) // for out of range tiles, switch to fully transparent data // (but still call SET_TILE_INFO, otherwise problems might occur on boot e.g. unsquad) if (code == -1) - tileinfo->pen_data = empty_tile; + tileinfo->pen_data = state->empty_tile; } -static void cps1_update_transmasks(void) +static void cps1_update_transmasks( running_machine *machine ) { + cps_state *state = (cps_state *)machine->driver_data; int i; - for (i = 0;i < 4;i++) + for (i = 0; i < 4; i++) { int mask; /* Get transparency registers */ - if (cps1_game_config->priority[i] != -1) - mask = cps1_cps_b_regs[cps1_game_config->priority[i]/2] ^ 0xffff; - else mask = 0xffff; /* completely transparent if priority masks not defined (qad) */ + if (state->game_config->priority[i] != -1) + mask = state->cps_b_regs[state->game_config->priority[i] / 2] ^ 0xffff; + else + mask = 0xffff; /* completely transparent if priority masks not defined (qad) */ - tilemap_set_transmask(cps1_bg_tilemap[0],i,mask,0x8000); - tilemap_set_transmask(cps1_bg_tilemap[1],i,mask,0x8000); - tilemap_set_transmask(cps1_bg_tilemap[2],i,mask,0x8000); + tilemap_set_transmask(state->bg_tilemap[0], i, mask, 0x8000); + tilemap_set_transmask(state->bg_tilemap[1], i, mask, 0x8000); + tilemap_set_transmask(state->bg_tilemap[2], i, mask, 0x8000); } } +static STATE_POSTLOAD( cps_postload ) +{ + cps1_get_video_base(machine); +} + static VIDEO_START( cps ) { + cps_state *state = (cps_state *)machine->driver_data; int i; MACHINE_RESET_CALL(cps); - cps1_bg_tilemap[0] = tilemap_create(machine, get_tile0_info,tilemap0_scan, 8, 8,64,64); - cps1_bg_tilemap[1] = tilemap_create(machine, get_tile1_info,tilemap1_scan,16,16,64,64); - cps1_bg_tilemap[2] = tilemap_create(machine, get_tile2_info,tilemap2_scan,32,32,64,64); + /* Put in some const */ + state->scroll_size = 0x4000; /* scroll1, scroll2, scroll3 */ + state->obj_size = 0x0800; + state->cps2_obj_size = 0x2000; + state->other_size = 0x0800; + state->palette_align = 0x0400; /* minimum alignment is a single palette page (512 colors). Verified on pcb. */ + state->palette_size = cps1_palette_entries * 32; /* Size of palette RAM */ + state->stars_rom_size = 0x2000; /* first 0x4000 of gfx ROM are used, but 0x0000-0x1fff is == 0x2000-0x3fff */ + + /* create tilemaps */ + state->bg_tilemap[0] = tilemap_create(machine, get_tile0_info, tilemap0_scan, 8, 8, 64, 64); + state->bg_tilemap[1] = tilemap_create(machine, get_tile1_info, tilemap1_scan, 16, 16, 64, 64); + state->bg_tilemap[2] = tilemap_create(machine, get_tile2_info, tilemap2_scan, 32, 32, 64, 64); + + /* create empty tiles */ + memset(state->empty_tile8x8, 0x0f, sizeof(state->empty_tile8x8)); + memset(state->empty_tile, 0xff, sizeof(state->empty_tile)); // 16x16 and 32x32 use packed graphics, 8x8 does not /* front masks will change at runtime to handle sprite occluding */ - cps1_update_transmasks(); + cps1_update_transmasks(machine); - memset(empty_tile8x8,0x0f,sizeof(empty_tile8x8)); - memset(empty_tile,0xff,sizeof(empty_tile)); // 16x16 and 32x32 use packed graphics, 8x8 does not + for (i = 0; i < cps1_palette_entries * 16; i++) + palette_set_color(machine, i, MAKE_RGB(0,0,0)); - for (i = 0;i < cps1_palette_entries*16;i++) + state->buffered_obj = auto_alloc_array_clear(machine, UINT16, state->obj_size / 2); + + if (state->cps_version == 2) + state->cps2_buffered_obj = auto_alloc_array_clear(machine, UINT16, state->cps2_obj_size / 2); + + /* clear RAM regions */ + memset(state->gfxram, 0, state->gfxram_size); /* Clear GFX RAM */ + memset(state->cps_a_regs, 0, 0x40); /* Clear CPS-A registers */ + memset(state->cps_b_regs, 0, 0x40); /* Clear CPS-B registers */ + + if (state->cps_version == 2) { - palette_set_color(machine,i,MAKE_RGB(0,0,0)); - } - - cps1_buffered_obj = auto_alloc_array_clear(machine, UINT16, cps1_obj_size/2); - - if (cps_version==2) - { - cps2_buffered_obj = auto_alloc_array_clear(machine, UINT16, cps2_obj_size/2); - } - - memset(cps1_gfxram, 0, cps1_gfxram_size); /* Clear GFX RAM */ - memset(cps1_cps_a_regs, 0, 0x40); /* Clear CPS-A registers */ - memset(cps1_cps_b_regs, 0, 0x40); /* Clear CPS-B registers */ - - if (cps_version == 2) - { - memset(cps2_objram1, 0, cps2_obj_size); - memset(cps2_objram2, 0, cps2_obj_size); + memset(state->objram1, 0, state->cps2_obj_size); + memset(state->objram2, 0, state->cps2_obj_size); } /* Put in some defaults */ - cps1_cps_a_regs[CPS1_OBJ_BASE] = 0x9200; - cps1_cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000; - cps1_cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040; - cps1_cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080; - cps1_cps_a_regs[CPS1_OTHER_BASE] = 0x9100; + state->cps_a_regs[CPS1_OBJ_BASE] = 0x9200; + state->cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000; + state->cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040; + state->cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080; + state->cps_a_regs[CPS1_OTHER_BASE] = 0x9100; + + /* This should never be hit, since game_config is set in MACHINE_RESET */ + assert_always(state->game_config, "state_game_config hasn't been set up yet"); - assert_always(cps1_game_config, "cps1_game_config hasn't been set up yet"); /* Set up old base */ - cps1_get_video_base(); /* Calculate base pointers */ - cps1_get_video_base(); /* Calculate old base pointers */ + state->scroll1 = NULL; + state->scroll2 = NULL; + state->scroll3 = NULL; + state->obj = NULL; + state->other = NULL; + cps1_get_video_base(machine); /* Calculate base pointers */ + cps1_get_video_base(machine); /* Calculate old base pointers */ + + /* state save register */ + state_save_register_global(machine, state->scanline1); + state_save_register_global(machine, state->scanline2); + state_save_register_global(machine, state->scancalls); +#if 0 + /* these do not need to be saved, because they are recovered from cps_a_regs in cps1_postload */ + state_save_register_global(machine, state->scroll1x); + state_save_register_global(machine, state->scroll1y); + state_save_register_global(machine, state->scroll2x); + state_save_register_global(machine, state->scroll2y); + state_save_register_global(machine, state->scroll3x); + state_save_register_global(machine, state->scroll3y); + state_save_register_global(machine, state->stars1x); + state_save_register_global(machine, state->stars1y); + state_save_register_global(machine, state->stars2x); + state_save_register_global(machine, state->stars2y); + state_save_register_global_array(machine, state->stars_enabled); +#endif + state_save_register_global(machine, state->last_sprite_offset); + state_save_register_global(machine, state->pri_ctrl); + state_save_register_global(machine, state->objram_bank); + + state_save_register_global_pointer(machine, state->buffered_obj, state->obj_size / 2); + if (state->cps_version == 2) + { + state_save_register_global(machine, state->cps2_last_sprite_offset); + state_save_register_global_pointer(machine, state->cps2_buffered_obj, state->cps2_obj_size / 2); + } + + state_save_register_postload(machine, cps_postload, NULL); } VIDEO_START( cps1 ) { - cps_version=1; + cps_state *state = (cps_state *)machine->driver_data; + + state->cps_version = 1; VIDEO_START_CALL(cps); } VIDEO_START( cps2 ) { - cps_version=2; + cps_state *state = (cps_state *)machine->driver_data; + + state->cps_version = 2; VIDEO_START_CALL(cps); } @@ -2112,12 +2090,12 @@ VIDEO_START( cps2 ) ***************************************************************************/ -static void cps1_build_palette(running_machine *machine, const UINT16* const palette_base) +static void cps1_build_palette( running_machine *machine, const UINT16* const palette_base ) { + cps_state *state = (cps_state *)machine->driver_data; int offset, page; const UINT16 *palette_ram = palette_base; - - int ctrl = cps1_cps_b_regs[cps1_game_config->palette_control/2]; + int ctrl = state->cps_b_regs[state->game_config->palette_control/2]; /* The palette is copied only for pages that are enabled in the ctrl @@ -2126,7 +2104,7 @@ static void cps1_build_palette(running_machine *machine, const UINT16* const pal */ for (page = 0; page < 6; ++page) { - if (BIT(ctrl,page)) + if (BIT(ctrl, page)) { for (offset = 0; offset < 0x200; ++offset) { @@ -2136,13 +2114,13 @@ static void cps1_build_palette(running_machine *machine, const UINT16* const pal // from my understanding of the schematics, when the 'brightness' // component is set to 0 it should reduce brightness to 1/3 - bright = 0x0f + ((palette>>12)<<1); + bright = 0x0f + ((palette >> 12) << 1); - r = ((palette>>8)&0x0f) * 0x11 * bright / 0x2d; - g = ((palette>>4)&0x0f) * 0x11 * bright / 0x2d; - b = ((palette>>0)&0x0f) * 0x11 * bright / 0x2d; + r = ((palette >> 8) & 0x0f) * 0x11 * bright / 0x2d; + g = ((palette >> 4) & 0x0f) * 0x11 * bright / 0x2d; + b = ((palette >> 0) & 0x0f) * 0x11 * bright / 0x2d; - palette_set_color (machine, 0x200*page + offset, MAKE_RGB(r, g, b)); + palette_set_color (machine, 0x200 * page + offset, MAKE_RGB(r, g, b)); } } else @@ -2190,28 +2168,32 @@ static void cps1_build_palette(running_machine *machine, const UINT16* const pal ***************************************************************************/ -static void cps1_find_last_sprite(void) /* Find the offset of last sprite */ +static void cps1_find_last_sprite( running_machine *machine ) /* Find the offset of last sprite */ { - int offset=0; + cps_state *state = (cps_state *)machine->driver_data; + int offset = 0; /* Locate the end of table marker */ - while (offset < cps1_obj_size/2) + while (offset < state->obj_size / 2) { - int colour=cps1_buffered_obj[offset+3]; + int colour = state->buffered_obj[offset + 3]; if ((colour & 0xff00) == 0xff00) { /* Marker found. This is the last sprite. */ - cps1_last_sprite_offset=offset-4; + state->last_sprite_offset = offset - 4; return; } - offset+=4; + + offset += 4; } /* Sprites must use full sprite RAM */ - cps1_last_sprite_offset=cps1_obj_size/2-4; + state->last_sprite_offset = state->obj_size / 2 - 4; } -static void cps1_render_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) +static void cps1_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { + cps_state *state = (cps_state *)machine->driver_data; + #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ { \ if (flip_screen_get(machine)) \ @@ -2220,24 +2202,24 @@ static void cps1_render_sprites(running_machine *machine, bitmap_t *bitmap, cons CODE, \ COLOR, \ !(FLIPX),!(FLIPY), \ - 511-16-(SX),255-16-(SY), machine->priority_bitmap,0x02,15); \ + 511-16-(SX),255-16-(SY), machine->priority_bitmap,0x02,15); \ else \ pdrawgfx_transpen(bitmap,\ cliprect,machine->gfx[2], \ CODE, \ COLOR, \ FLIPX,FLIPY, \ - SX,SY, machine->priority_bitmap,0x02,15); \ + SX,SY, machine->priority_bitmap,0x02,15); \ } int i, baseadd; - UINT16 *base=cps1_buffered_obj; + UINT16 *base = state->buffered_obj; /* some sf2 hacks draw the sprites in reverse order */ - if (cps1_game_config->bootleg_kludge == 1) + if (state->game_config->bootleg_kludge == 1) { - base += cps1_last_sprite_offset; + base += state->last_sprite_offset; baseadd = -4; } else @@ -2245,16 +2227,16 @@ static void cps1_render_sprites(running_machine *machine, bitmap_t *bitmap, cons baseadd = 4; } - for (i=cps1_last_sprite_offset; i>=0; i-=4) + for (i = state->last_sprite_offset; i >= 0; i -= 4) { - int x=*(base+0); - int y=*(base+1); - int code =*(base+2); - int colour=*(base+3); - int col=colour&0x1f; + int x = *(base + 0); + int y = *(base + 1); + int code = *(base + 2); + int colour = *(base + 3); + int col = colour & 0x1f; -// x-=0x20; -// y+=0x20; +// x -= 0x20; +// y += 0x20; code = gfxrom_bank_mapper(machine, GFXTYPE_SPRITES, code); @@ -2263,28 +2245,28 @@ static void cps1_render_sprites(running_machine *machine, bitmap_t *bitmap, cons if (colour & 0xff00 ) { /* handle blocked sprites */ - int nx=(colour & 0x0f00) >> 8; - int ny=(colour & 0xf000) >> 12; - int nxs,nys,sx,sy; + int nx = (colour & 0x0f00) >> 8; + int ny = (colour & 0xf000) >> 12; + int nxs, nys, sx, sy; nx++; ny++; if (colour & 0x40) { /* Y flip */ - if (colour &0x20) + if (colour & 0x20) { - for (nys=0; nysmachine->driver_data; + if (ACCESSING_BITS_0_7) - { - cps2_objram_bank = data & 1; - } + state->objram_bank = data & 1; } READ16_HANDLER( cps2_objram1_r ) { - if (cps2_objram_bank & 1) - return cps2_objram2[offset]; + cps_state *state = (cps_state *)space->machine->driver_data; + if (state->objram_bank & 1) + return state->objram2[offset]; else - return cps2_objram1[offset]; + return state->objram1[offset]; } READ16_HANDLER( cps2_objram2_r ) { - if (cps2_objram_bank & 1) - return cps2_objram1[offset]; + cps_state *state = (cps_state *)space->machine->driver_data; + if (state->objram_bank & 1) + return state->objram1[offset]; else - return cps2_objram2[offset]; + return state->objram2[offset]; } WRITE16_HANDLER( cps2_objram1_w ) { - if (cps2_objram_bank & 1) - COMBINE_DATA(&cps2_objram2[offset]); + cps_state *state = (cps_state *)space->machine->driver_data; + if (state->objram_bank & 1) + COMBINE_DATA(&state->objram2[offset]); else - COMBINE_DATA(&cps2_objram1[offset]); + COMBINE_DATA(&state->objram1[offset]); } WRITE16_HANDLER( cps2_objram2_w ) { - if (cps2_objram_bank & 1) - COMBINE_DATA(&cps2_objram1[offset]); + cps_state *state = (cps_state *)space->machine->driver_data; + if (state->objram_bank & 1) + COMBINE_DATA(&state->objram1[offset]); else - COMBINE_DATA(&cps2_objram2[offset]); + COMBINE_DATA(&state->objram2[offset]); } -static UINT16 *cps2_objbase(void) +static UINT16 *cps2_objbase( running_machine *machine ) { + cps_state *state = (cps_state *)machine->driver_data; int baseptr; baseptr = 0x7000; - if (cps2_objram_bank & 1) baseptr ^= 0x0080; + if (state->objram_bank & 1) + baseptr ^= 0x0080; -//popmessage("%04x %d",cps2_port(CPS2_OBJ_BASE),cps2_objram_bank&1); +//popmessage("%04x %d", cps2_port(machine, CPS2_OBJ_BASE), state->objram_bank & 1); if (baseptr == 0x7000) - return cps2_objram1; + return state->objram1; else //if (baseptr == 0x7080) - return cps2_objram2; + return state->objram2; } -static void cps2_find_last_sprite(void) /* Find the offset of last sprite */ +static void cps2_find_last_sprite( running_machine *machine ) /* Find the offset of last sprite */ { - int offset=0; - UINT16 *base=cps2_buffered_obj; + cps_state *state = (cps_state *)machine->driver_data; + int offset = 0; + UINT16 *base = state->cps2_buffered_obj; /* Locate the end of table marker */ - while (offset < cps2_obj_size/2) + while (offset < state->cps2_obj_size / 2) { - if (base[offset+1]>=0x8000 - || base[offset+3]>=0xff00) + if (base[offset + 1] >= 0x8000 || base[offset + 3] >= 0xff00) { /* Marker found. This is the last sprite. */ - cps2_last_sprite_offset=offset-4; + state->cps2_last_sprite_offset = offset - 4; return; } - offset+=4; + offset += 4; } /* Sprites must use full sprite RAM */ - cps2_last_sprite_offset=cps2_obj_size/2-4; -#undef DRAWSPRITE + state->cps2_last_sprite_offset = state->cps2_obj_size / 2 - 4; } -static void cps2_render_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int *primasks) +static void cps2_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks ) { + cps_state *state = (cps_state *)machine->driver_data; + #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ { \ if (flip_screen_get(machine)) \ @@ -2456,20 +2445,20 @@ static void cps2_render_sprites(running_machine *machine, bitmap_t *bitmap,const CODE, \ COLOR, \ !(FLIPX),!(FLIPY), \ - 511-16-(SX),255-16-(SY), machine->priority_bitmap,primasks[priority],15); \ + 511-16-(SX),255-16-(SY), machine->priority_bitmap,primasks[priority],15); \ else \ pdrawgfx_transpen(bitmap,\ cliprect,machine->gfx[2], \ CODE, \ COLOR, \ FLIPX,FLIPY, \ - SX,SY, machine->priority_bitmap,primasks[priority],15); \ + SX,SY, machine->priority_bitmap,primasks[priority],15); \ } int i; - UINT16 *base=cps2_buffered_obj; - int xoffs = 64-cps2_port(CPS2_OBJ_XOFFS); - int yoffs = 16-cps2_port(CPS2_OBJ_YOFFS); + UINT16 *base = state->cps2_buffered_obj; + int xoffs = 64 - cps2_port(machine, CPS2_OBJ_XOFFS); + int yoffs = 16 - cps2_port(machine, CPS2_OBJ_YOFFS); #ifdef MAME_DEBUG if (input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_R)) @@ -2478,44 +2467,44 @@ static void cps2_render_sprites(running_machine *machine, bitmap_t *bitmap,const } #endif - for (i=cps2_last_sprite_offset; i>=0; i-=4) + for (i = state->cps2_last_sprite_offset; i >= 0; i -= 4) { - int x=base[i+0]; - int y=base[i+1]; - int priority=(x>>13)&0x07; - int code = base[i+2]+((y & 0x6000) <<3); - int colour= base[i+3]; - int col=colour&0x1f; + int x = base[i + 0]; + int y = base[i + 1]; + int priority = (x >> 13) & 0x07; + int code = base[i + 2] + ((y & 0x6000) << 3); + int colour = base[i + 3]; + int col = colour & 0x1f; - if(colour & 0x80) + if (colour & 0x80) { - x += cps2_port(CPS2_OBJ_XOFFS); /* fix the offset of some games */ - y += cps2_port(CPS2_OBJ_YOFFS); /* like Marvel vs. Capcom ending credits */ + x += cps2_port(machine, CPS2_OBJ_XOFFS); /* fix the offset of some games */ + y += cps2_port(machine, CPS2_OBJ_YOFFS); /* like Marvel vs. Capcom ending credits */ } - if (colour & 0xff00 ) + if (colour & 0xff00) { /* handle blocked sprites */ - int nx=(colour & 0x0f00) >> 8; - int ny=(colour & 0xf000) >> 12; - int nxs,nys,sx,sy; + int nx = (colour & 0x0f00) >> 8; + int ny = (colour & 0xf000) >> 12; + int nxs, nys, sx, sy; nx++; ny++; if (colour & 0x40) { /* Y flip */ - if (colour &0x20) + if (colour & 0x20) { - for (nys=0; nysmachine->driver_data; int offs; UINT8 *stars_rom = memory_region(screen->machine, "stars"); - if (!stars_rom && (cps1_stars_enabled[0] || cps1_stars_enabled[1])) + if (!stars_rom && (state->stars_enabled[0] || state->stars_enabled[1])) { #ifdef MAME_DEBUG // popmessage("stars enabled but no stars ROM"); @@ -2606,24 +2596,24 @@ static void cps1_render_stars(const device_config *screen, bitmap_t *bitmap,cons return; } - if (cps1_stars_enabled[0]) + if (state->stars_enabled[0]) { - for (offs = 0;offs < stars_rom_size/2;offs++) + for (offs = 0; offs < state->stars_rom_size / 2; offs++) { - int col = stars_rom[8*offs+4]; + int col = stars_rom[8 * offs + 4]; if (col != 0x0f) { int sx = (offs / 256) * 32; int sy = (offs % 256); - sx = (sx - stars2x + (col & 0x1f)) & 0x1ff; - sy = (sy - stars2y) & 0xff; + sx = (sx - state->stars2x + (col & 0x1f)) & 0x1ff; + sy = (sy - state->stars2y) & 0xff; if (flip_screen_get(screen->machine)) { sx = 511 - sx; sy = 255 - sy; } - col = ((col & 0xe0) >> 1) + (video_screen_get_frame_number(screen)/16 & 0x0f); + col = ((col & 0xe0) >> 1) + (video_screen_get_frame_number(screen) / 16 & 0x0f); if (sx >= cliprect->min_x && sx <= cliprect->max_x && sy >= cliprect->min_y && sy <= cliprect->max_y) @@ -2632,24 +2622,24 @@ static void cps1_render_stars(const device_config *screen, bitmap_t *bitmap,cons } } - if (cps1_stars_enabled[1]) + if (state->stars_enabled[1]) { - for (offs = 0;offs < stars_rom_size/2;offs++) + for (offs = 0; offs < state->stars_rom_size / 2; offs++) { int col = stars_rom[8*offs]; if (col != 0x0f) { int sx = (offs / 256) * 32; int sy = (offs % 256); - sx = (sx - stars1x + (col & 0x1f)) & 0x1ff; - sy = (sy - stars1y) & 0xff; + sx = (sx - state->stars1x + (col & 0x1f)) & 0x1ff; + sy = (sy - state->stars1y) & 0xff; if (flip_screen_get(screen->machine)) { sx = 511 - sx; sy = 255 - sy; } - col = ((col & 0xe0) >> 1) + (video_screen_get_frame_number(screen)/16 & 0x0f); + col = ((col & 0xe0) >> 1) + (video_screen_get_frame_number(screen) / 16 & 0x0f); if (sx >= cliprect->min_x && sx <= cliprect->max_x && sy >= cliprect->min_y && sy <= cliprect->max_y) @@ -2660,23 +2650,25 @@ static void cps1_render_stars(const device_config *screen, bitmap_t *bitmap,cons } -static void cps1_render_layer(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int layer,int primask) +static void cps1_render_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask ) { + cps_state *state = (cps_state *)machine->driver_data; switch (layer) { case 0: - cps1_render_sprites(machine,bitmap,cliprect); + cps1_render_sprites(machine, bitmap, cliprect); break; case 1: case 2: case 3: - tilemap_draw(bitmap,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER1,primask); + tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer - 1], TILEMAP_DRAW_LAYER1, primask); break; } } -static void cps1_render_high_layer(bitmap_t *bitmap, const rectangle *cliprect, int layer) +static void cps1_render_high_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer ) { + cps_state *state = (cps_state *)machine->driver_data; switch (layer) { case 0: @@ -2685,7 +2677,7 @@ static void cps1_render_high_layer(bitmap_t *bitmap, const rectangle *cliprect, case 1: case 2: case 3: - tilemap_draw(NULL,cliprect,cps1_bg_tilemap[layer-1],TILEMAP_DRAW_LAYER0,1); + tilemap_draw(NULL, cliprect, state->bg_tilemap[layer - 1], TILEMAP_DRAW_LAYER0, 1); break; } } @@ -2699,57 +2691,59 @@ static void cps1_render_high_layer(bitmap_t *bitmap, const rectangle *cliprect, VIDEO_UPDATE( cps1 ) { - int layercontrol,l0,l1,l2,l3; - int videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL]; - + cps_state *state = (cps_state *)screen->machine->driver_data; + int layercontrol, l0, l1, l2, l3; + int videocontrol = state->cps_a_regs[CPS1_VIDEOCONTROL]; flip_screen_set(screen->machine, videocontrol & 0x8000); - layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2]; + layercontrol = state->cps_b_regs[state->game_config->layer_control / 2]; /* Get video memory base registers */ - cps1_get_video_base(); + cps1_get_video_base(screen->machine); /* Find the offset of the last sprite in the sprite table */ - cps1_find_last_sprite(); - if (cps_version == 2) + cps1_find_last_sprite(screen->machine); + + if (state->cps_version == 2) { - cps2_find_last_sprite(); + cps2_find_last_sprite(screen->machine); } - cps1_update_transmasks(); + cps1_update_transmasks(screen->machine); + + tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x); + tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y); - tilemap_set_scrollx(cps1_bg_tilemap[0],0,cps1_scroll1x); - tilemap_set_scrolly(cps1_bg_tilemap[0],0,cps1_scroll1y); if (videocontrol & 0x01) /* linescroll enable */ { - int scrly=-cps1_scroll2y; + int scrly = -state->scroll2y; int i; int otheroffs; - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1024); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1024); - otheroffs = cps1_cps_a_regs[CPS1_ROWSCROLL_OFFS]; + otheroffs = state->cps_a_regs[CPS1_ROWSCROLL_OFFS]; - for (i = 0;i < 256;i++) - tilemap_set_scrollx(cps1_bg_tilemap[1],(i - scrly) & 0x3ff,cps1_scroll2x + cps1_other[(i + otheroffs) & 0x3ff]); + for (i = 0; i < 256; i++) + tilemap_set_scrollx(state->bg_tilemap[1], (i - scrly) & 0x3ff, state->scroll2x + state->other[(i + otheroffs) & 0x3ff]); } else { - tilemap_set_scroll_rows(cps1_bg_tilemap[1],1); - tilemap_set_scrollx(cps1_bg_tilemap[1],0,cps1_scroll2x); + tilemap_set_scroll_rows(state->bg_tilemap[1], 1); + tilemap_set_scrollx(state->bg_tilemap[1], 0, state->scroll2x); } - tilemap_set_scrolly(cps1_bg_tilemap[1],0,cps1_scroll2y); - tilemap_set_scrollx(cps1_bg_tilemap[2],0,cps1_scroll3x); - tilemap_set_scrolly(cps1_bg_tilemap[2],0,cps1_scroll3y); + tilemap_set_scrolly(state->bg_tilemap[1], 0, state->scroll2y); + tilemap_set_scrollx(state->bg_tilemap[2], 0, state->scroll3x); + tilemap_set_scrolly(state->bg_tilemap[2], 0, state->scroll3y); /* Blank screen */ - if (cps_version == 1) + if (state->cps_version == 1) { // CPS1 games use pen 0xbff as background color; this is used in 3wonders, // mtwins (explosion during attract), mercs (intermission). - bitmap_fill(bitmap,cliprect,0xbff); + bitmap_fill(bitmap, cliprect, 0xbff); } else { @@ -2758,45 +2752,54 @@ VIDEO_UPDATE( cps1 ) // Maybe Capcom changed the background handling due to the problems that // it caused on several monitors (because the background extended into the // blanking area instead of going black, causing the monitor to clip). - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); + bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); } - cps1_render_stars(screen, bitmap,cliprect); + cps1_render_stars(screen, bitmap, cliprect); /* Draw layers (0 = sprites, 1-3 = tilemaps) */ l0 = (layercontrol >> 0x06) & 03; l1 = (layercontrol >> 0x08) & 03; l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - bitmap_fill(screen->machine->priority_bitmap,cliprect,0); + bitmap_fill(screen->machine->priority_bitmap, cliprect, 0); - if (cps_version == 1) + if (state->cps_version == 1) { - cps1_render_layer(screen->machine,bitmap,cliprect,l0,0); - if (l1 == 0) cps1_render_high_layer(bitmap,cliprect,l0); /* prepare mask for sprites */ - cps1_render_layer(screen->machine,bitmap,cliprect,l1,0); - if (l2 == 0) cps1_render_high_layer(bitmap,cliprect,l1); /* prepare mask for sprites */ - cps1_render_layer(screen->machine,bitmap,cliprect,l2,0); - if (l3 == 0) cps1_render_high_layer(bitmap,cliprect,l2); /* prepare mask for sprites */ - cps1_render_layer(screen->machine,bitmap,cliprect,l3,0); + cps1_render_layer(screen->machine, bitmap, cliprect, l0, 0); + + if (l1 == 0) + cps1_render_high_layer(screen->machine, bitmap, cliprect, l0); /* prepare mask for sprites */ + + cps1_render_layer(screen->machine, bitmap, cliprect, l1, 0); + + if (l2 == 0) + cps1_render_high_layer(screen->machine, bitmap, cliprect, l1); /* prepare mask for sprites */ + + cps1_render_layer(screen->machine, bitmap, cliprect, l2, 0); + + if (l3 == 0) + cps1_render_high_layer(screen->machine, bitmap, cliprect, l2); /* prepare mask for sprites */ + + cps1_render_layer(screen->machine, bitmap, cliprect, l3, 0); } else { - int l0pri,l1pri,l2pri,l3pri; - int primasks[8],i; - l0pri = (pri_ctrl >> 4*l0) & 0x0f; - l1pri = (pri_ctrl >> 4*l1) & 0x0f; - l2pri = (pri_ctrl >> 4*l2) & 0x0f; - l3pri = (pri_ctrl >> 4*l3) & 0x0f; + int l0pri, l1pri, l2pri, l3pri; + int primasks[8], i; + l0pri = (state->pri_ctrl >> 4 * l0) & 0x0f; + l1pri = (state->pri_ctrl >> 4 * l1) & 0x0f; + l2pri = (state->pri_ctrl >> 4 * l2) & 0x0f; + l3pri = (state->pri_ctrl >> 4 * l3) & 0x0f; #if 0 -if ( (cps2_port(CPS2_OBJ_BASE) != 0x7080 && cps2_port(CPS2_OBJ_BASE) != 0x7000) || - cps2_port(CPS2_OBJ_UK1) != 0x807d || - (cps2_port(CPS2_OBJ_UK2) != 0x0000 && cps2_port(CPS2_OBJ_UK2) != 0x1101 && cps2_port(CPS2_OBJ_UK2) != 0x0001) || +if ( (cps2_port(screen->machine, CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen->machine, CPS2_OBJ_BASE) != 0x7000) || + cps2_port(screen->machine, CPS2_OBJ_UK1) != 0x807d || + (cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x0001) || popmessage("base %04x uk1 %04x uk2 %04x", - cps2_port(CPS2_OBJ_BASE), - cps2_port(CPS2_OBJ_UK1), - cps2_port(CPS2_OBJ_UK2)); + cps2_port(screen->machine, CPS2_OBJ_BASE), + cps2_port(screen->machine, CPS2_OBJ_UK1), + cps2_port(screen->machine, CPS2_OBJ_UK2)); if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri); @@ -2810,12 +2813,12 @@ if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) { int mask0 = 0xaa; int mask1 = 0xcc; - if(l0pri>l1pri) mask0 &= ~0x88; - if(l0pri>l2pri) mask0 &= ~0xa0; - if(l1pri>l2pri) mask1 &= ~0xc0; + if (l0pri > l1pri) mask0 &= ~0x88; + if (l0pri > l2pri) mask0 &= ~0xa0; + if (l1pri > l2pri) mask1 &= ~0xc0; primasks[0] = 0xff; - for (i = 1;i < 8;i++) + for (i = 1; i < 8; i++) { if (i <= l0pri && i <= l1pri && i <= l2pri) { @@ -2829,10 +2832,10 @@ if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) } } - cps1_render_layer(screen->machine,bitmap,cliprect,l0,1); - cps1_render_layer(screen->machine,bitmap,cliprect,l1,2); - cps1_render_layer(screen->machine,bitmap,cliprect,l2,4); - cps2_render_sprites(screen->machine,bitmap,cliprect,primasks); + cps1_render_layer(screen->machine, bitmap, cliprect, l0, 1); + cps1_render_layer(screen->machine, bitmap, cliprect, l1, 2); + cps1_render_layer(screen->machine, bitmap, cliprect, l2, 4); + cps2_render_sprites(screen->machine, bitmap, cliprect, primasks); } return 0; @@ -2840,23 +2843,27 @@ if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) VIDEO_EOF( cps1 ) { - /* Get video memory base registers */ - cps1_get_video_base(); + cps_state *state = (cps_state *)machine->driver_data; - if (cps_version == 1) + /* Get video memory base registers */ + cps1_get_video_base(machine); + + if (state->cps_version == 1) { /* CPS1 sprites have to be delayed one frame */ - memcpy(cps1_buffered_obj, cps1_obj, cps1_obj_size); + memcpy(state->buffered_obj, state->obj, state->obj_size); } } -void cps2_set_sprite_priorities(void) +void cps2_set_sprite_priorities( running_machine *machine ) { - pri_ctrl = cps2_port(CPS2_OBJ_PRI); + cps_state *state = (cps_state *)machine->driver_data; + state->pri_ctrl = cps2_port(machine, CPS2_OBJ_PRI); } -void cps2_objram_latch(void) +void cps2_objram_latch( running_machine *machine ) { - cps2_set_sprite_priorities(); - memcpy(cps2_buffered_obj, cps2_objbase(), cps2_obj_size); + cps_state *state = (cps_state *)machine->driver_data; + cps2_set_sprite_priorities(machine); + memcpy(state->cps2_buffered_obj, cps2_objbase(machine), state->cps2_obj_size); } diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index d5b2e288062..52c1a0f3bca 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -8,78 +8,57 @@ #include "neogeo.h" #include "video/resnet.h" - #define NUM_PENS (0x1000) #define VERBOSE (0) -static UINT8 *sprite_gfx; -static UINT32 sprite_gfx_address_mask; -static UINT16 *neogeo_videoram; -static UINT16 *palettes[2]; /* 0x100*16 2 byte palette entries */ -static pen_t *pens; -static UINT8 palette_bank; -static UINT8 screen_dark; -static UINT16 videoram_read_buffer; -static UINT16 videoram_modulo; -static UINT16 videoram_offset; - -static UINT8 fixed_layer_source; -int neogeo_fixed_layer_bank_type; /* no need to state save */ - -static UINT8 auto_animation_speed; -static UINT8 auto_animation_disabled; -static UINT8 auto_animation_counter; -static UINT8 auto_animation_frame_counter; -static emu_timer *auto_animation_timer; - -static emu_timer *sprite_line_timer; - -static const UINT8 *region_zoomy; - - /************************************* * * Video RAM access * *************************************/ -static void set_videoram_offset(UINT16 data) +static void set_videoram_offset( running_machine *machine, UINT16 data ) { - videoram_offset = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->videoram_offset = data; /* the read happens right away */ - videoram_read_buffer = neogeo_videoram[videoram_offset]; + state->videoram_read_buffer = state->videoram[state->videoram_offset]; } -static UINT16 get_videoram_data(void) +static UINT16 get_videoram_data( running_machine *machine ) { - return videoram_read_buffer; + neogeo_state *state = (neogeo_state *)machine->driver_data; + return state->videoram_read_buffer; } -static void set_videoram_data(UINT16 data) +static void set_videoram_data( running_machine *machine, UINT16 data) { - neogeo_videoram[videoram_offset] = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->videoram[state->videoram_offset] = data; /* auto increment/decrement the current offset - A15 is NOT effected */ - videoram_offset = (videoram_offset & 0x8000) | ((videoram_offset + videoram_modulo) & 0x7fff); + state->videoram_offset = (state->videoram_offset & 0x8000) | ((state->videoram_offset + state->videoram_modulo) & 0x7fff); /* read next value right away */ - videoram_read_buffer = neogeo_videoram[videoram_offset]; + state->videoram_read_buffer = state->videoram[state->videoram_offset]; } -static void set_videoram_modulo(UINT16 data) +static void set_videoram_modulo( running_machine *machine, UINT16 data) { - videoram_modulo = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->videoram_modulo = data; } -static UINT16 get_videoram_modulo(void) +static UINT16 get_videoram_modulo( running_machine *machine ) { - return videoram_modulo; + neogeo_state *state = (neogeo_state *)machine->driver_data; + return state->videoram_modulo; } @@ -90,58 +69,55 @@ static UINT16 get_videoram_modulo(void) * *************************************/ -static double rgb_weights_normal[5]; -static double rgb_weights_normal_bit15[5]; -static double rgb_weights_dark[5]; -static double rgb_weights_dark_bit15[5]; - -static void compute_rgb_weights(void) +static void compute_rgb_weights( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; static const int resistances[] = { 220, 470, 1000, 2200, 3900 }; /* compute four sets of weights - with or without the pulldowns - ensuring that we use the same scaler for all */ double scaler = compute_resistor_weights(0, 0xff, -1, - 5, resistances, rgb_weights_normal, 0, 0, + 5, resistances, state->rgb_weights_normal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); compute_resistor_weights(0, 0xff, scaler, - 5, resistances, rgb_weights_normal_bit15, 8200, 0, + 5, resistances, state->rgb_weights_normal_bit15, 8200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); compute_resistor_weights(0, 0xff, scaler, - 5, resistances, rgb_weights_dark, 150, 0, + 5, resistances, state->rgb_weights_dark, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); compute_resistor_weights(0, 0xff, scaler, - 5, resistances, rgb_weights_dark_bit15, 1 / ((1.0 / 8200) + (1.0 / 150)), 0, + 5, resistances, state->rgb_weights_dark_bit15, 1 / ((1.0 / 8200) + (1.0 / 150)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } -static pen_t get_pen(UINT16 data) +static pen_t get_pen( running_machine *machine, UINT16 data ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; double *weights; UINT8 r, g, b; - if (screen_dark) + if (state->screen_dark) { if (data & 0x8000) - weights = rgb_weights_dark_bit15; + weights = state->rgb_weights_dark_bit15; else - weights = rgb_weights_dark; + weights = state->rgb_weights_dark; } else { if (data & 0x8000) - weights = rgb_weights_normal_bit15; + weights = state->rgb_weights_normal_bit15; else - weights = rgb_weights_normal; + weights = state->rgb_weights_normal; } r = combine_5_weights(weights, @@ -171,29 +147,32 @@ static pen_t get_pen(UINT16 data) static STATE_POSTLOAD( regenerate_pens ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int i; for (i = 0; i < NUM_PENS; i++) - pens[i] = get_pen(palettes[palette_bank][i]); + state->pens[i] = get_pen(machine, state->palettes[state->palette_bank][i]); } -void neogeo_set_palette_bank(running_machine *machine, UINT8 data) +void neogeo_set_palette_bank( running_machine *machine, UINT8 data ) { - if (data != palette_bank) + neogeo_state *state = (neogeo_state *)machine->driver_data; + if (data != state->palette_bank) { - palette_bank = data; + state->palette_bank = data; regenerate_pens(machine, NULL); } } -void neogeo_set_screen_dark(running_machine *machine, UINT8 data) +void neogeo_set_screen_dark( running_machine *machine, UINT8 data ) { - if (data != screen_dark) + neogeo_state *state = (neogeo_state *)machine->driver_data; + if (data != state->screen_dark) { - screen_dark = data; + state->screen_dark = data; regenerate_pens(machine, NULL); } @@ -202,17 +181,19 @@ void neogeo_set_screen_dark(running_machine *machine, UINT8 data) READ16_HANDLER( neogeo_paletteram_r ) { - return palettes[palette_bank][offset]; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + return state->palettes[state->palette_bank][offset]; } WRITE16_HANDLER( neogeo_paletteram_w ) { - UINT16 *addr = &palettes[palette_bank][offset]; + neogeo_state *state = (neogeo_state *)space->machine->driver_data; + UINT16 *addr = &state->palettes[state->palette_bank][offset]; COMBINE_DATA(addr); - pens[offset] = get_pen(*addr); + state->pens[offset] = get_pen(space->machine, *addr); } @@ -223,47 +204,53 @@ WRITE16_HANDLER( neogeo_paletteram_w ) * *************************************/ -static void set_auto_animation_speed(UINT8 data) +static void set_auto_animation_speed( running_machine *machine, UINT8 data) { - auto_animation_speed = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->auto_animation_speed = data; } -static void set_auto_animation_disabled(UINT8 data) +static void set_auto_animation_disabled( running_machine *machine, UINT8 data) { - auto_animation_disabled = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->auto_animation_disabled = data; } -UINT8 neogeo_get_auto_animation_counter(void) +UINT8 neogeo_get_auto_animation_counter( running_machine *machine ) { - return auto_animation_counter; + neogeo_state *state = (neogeo_state *)machine->driver_data; + return state->auto_animation_counter; } static TIMER_CALLBACK( auto_animation_timer_callback ) { - if (auto_animation_frame_counter == 0) + neogeo_state *state = (neogeo_state *)machine->driver_data; + if (state->auto_animation_frame_counter == 0) { - auto_animation_frame_counter = auto_animation_speed; - auto_animation_counter = auto_animation_counter + 1; + state->auto_animation_frame_counter = state->auto_animation_speed; + state->auto_animation_counter += 1; } else - auto_animation_frame_counter = auto_animation_frame_counter - 1; + state->auto_animation_frame_counter = state->auto_animation_frame_counter - 1; - timer_adjust_oneshot(auto_animation_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VSSTART, 0), 0); + timer_adjust_oneshot(state->auto_animation_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VSSTART, 0), 0); } -static void create_auto_animation_timer(running_machine *machine) +static void create_auto_animation_timer( running_machine *machine ) { - auto_animation_timer = timer_alloc(machine, auto_animation_timer_callback, NULL); + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->auto_animation_timer = timer_alloc(machine, auto_animation_timer_callback, NULL); } -static void start_auto_animation_timer(running_machine *machine) +static void start_auto_animation_timer( running_machine *machine ) { - timer_adjust_oneshot(auto_animation_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VSSTART, 0), 0); + neogeo_state *state = (neogeo_state *)machine->driver_data; + timer_adjust_oneshot(state->auto_animation_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VSSTART, 0), 0); } @@ -274,71 +261,71 @@ static void start_auto_animation_timer(running_machine *machine) * *************************************/ -void neogeo_set_fixed_layer_source(UINT8 data) +void neogeo_set_fixed_layer_source( running_machine *machine, UINT8 data ) { - fixed_layer_source = data; + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->fixed_layer_source = data; } -static void draw_fixed_layer(running_machine *machine, bitmap_t *bitmap, int scanline) +static void draw_fixed_layer( running_machine *machine, bitmap_t *bitmap, int scanline ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int x; - UINT8* gfx_base = memory_region(machine, fixed_layer_source ? "fixed" : "fixedbios"); - UINT32 addr_mask = memory_region_length(machine, fixed_layer_source ? "fixed" : "fixedbios") - 1; - UINT16 *video_data = &neogeo_videoram[0x7000 | (scanline >> 3)]; + UINT8* gfx_base = memory_region(machine, state->fixed_layer_source ? "fixed" : "fixedbios"); + UINT32 addr_mask = memory_region_length(machine, state->fixed_layer_source ? "fixed" : "fixedbios") - 1; + UINT16 *video_data = &state->videoram[0x7000 | (scanline >> 3)]; UINT32 *pixel_addr = BITMAP_ADDR32(bitmap, scanline, NEOGEO_HBEND); -int garouoffsets[32]; -int banked = fixed_layer_source && (addr_mask > 0x1ffff); -{ -/* thanks to Mr K for the garou & kof2000 banking info */ -/* Build line banking table for Garou & MS3 before starting render */ -if (banked && neogeo_fixed_layer_bank_type == 1) -{ - int garoubank = 0; - int k = 0; - int y = 0; - while (y < 32) + int garouoffsets[32]; + int banked = state->fixed_layer_source && (addr_mask > 0x1ffff); + + /* thanks to Mr K for the garou & kof2000 banking info */ + /* Build line banking table for Garou & MS3 before starting render */ + if (banked && state->fixed_layer_bank_type == 1) { - if (neogeo_videoram[0x7500+k] == 0x0200 && (neogeo_videoram[0x7580+k] & 0xff00) == 0xff00) + int garoubank = 0; + int k = 0; + int y = 0; + while (y < 32) { - garoubank = neogeo_videoram[0x7580+k] & 3; + if (state->videoram[0x7500 + k] == 0x0200 && (state->videoram[0x7580 + k] & 0xff00) == 0xff00) + { + garoubank = state->videoram[0x7580 + k] & 3; + garouoffsets[y++] = garoubank; + } garouoffsets[y++] = garoubank; + k += 2; } - garouoffsets[y++] = garoubank; - k += 2; } -} -} for (x = 0; x < 40; x++) { UINT16 code_and_palette = *video_data; - UINT16 code = code_and_palette & 0x0fff; -if (banked) -{ - int y = scanline >> 3; - switch (neogeo_fixed_layer_bank_type) - { - case 1: - /* Garou, MSlug 3 */ - code += 0x1000 * (garouoffsets[(y-2)&31] ^ 3); - break; - case 2: - code += 0x1000 * (((neogeo_videoram[0x7500 + ((y-1)&31) + 32 * (x/6)] >> (5-(x%6))*2) & 3) ^ 3); - break; - } -} + if (banked) + { + int y = scanline >> 3; + switch (state->fixed_layer_bank_type) + { + case 1: + /* Garou, MSlug 3 */ + code += 0x1000 * (garouoffsets[(y - 2) & 31] ^ 3); + break; + case 2: + code += 0x1000 * (((state->videoram[0x7500 + ((y - 1) & 31) + 32 * (x / 6)] >> (5 - (x % 6)) * 2) & 3) ^ 3); + break; + } + } { UINT8 data; int i; UINT8 *gfx = &gfx_base[((code << 5) | (scanline & 0x07)) & addr_mask]; - pen_t *char_pens = &pens[code_and_palette >> 12 << 4]; + pen_t *char_pens = &state->pens[code_and_palette >> 12 << 4]; for (i = 0; i < 4; i++) { @@ -368,8 +355,8 @@ if (banked) * *************************************/ -#define MAX_SPRITES_PER_SCREEN (381) -#define MAX_SPRITES_PER_LINE (96) +#define MAX_SPRITES_PER_SCREEN (381) +#define MAX_SPRITES_PER_LINE (96) /* horizontal zoom table - verified on real hardware */ @@ -414,8 +401,9 @@ INLINE int sprite_on_scanline(int scanline, int y, int rows) } -static void draw_sprites(bitmap_t *bitmap, int scanline) +static void draw_sprites( running_machine *machine, bitmap_t *bitmap, int scanline ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int sprite_index; int max_sprite_index; @@ -428,15 +416,15 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) /* select the active list */ if (scanline & 0x01) - sprite_list = &neogeo_videoram[0x8680]; + sprite_list = &state->videoram[0x8680]; else - sprite_list = &neogeo_videoram[0x8600]; + sprite_list = &state->videoram[0x8600]; /* optimization -- find last non-zero entry and only draw that many +1 sprite. This is not 100% correct as the hardware will keep drawing the #0 sprite over and over, but we need the speed */ - for (max_sprite_index = (MAX_SPRITES_PER_LINE - 1); max_sprite_index >= 0; max_sprite_index--) - { + for (max_sprite_index = (MAX_SPRITES_PER_LINE - 1); max_sprite_index >= 0; max_sprite_index--) + { if (sprite_list[max_sprite_index] != 0) break; } @@ -448,9 +436,8 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) for (sprite_index = 0; sprite_index <= max_sprite_index; sprite_index++) { UINT16 sprite_number = sprite_list[sprite_index] & 0x01ff; - - UINT16 y_control = neogeo_videoram[0x8200 | sprite_number]; - UINT16 zoom_control = neogeo_videoram[0x8000 | sprite_number]; + UINT16 y_control = state->videoram[0x8200 | sprite_number]; + UINT16 zoom_control = state->videoram[0x8000 | sprite_number]; /* if chained, go to next X coordinate and get new X zoom */ if (y_control & 0x40) @@ -462,7 +449,7 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) else { y = 0x200 - (y_control >> 7); - x = neogeo_videoram[0x8400 | sprite_number] >> 7; + x = state->videoram[0x8400 | sprite_number] >> 7; zoom_y = zoom_control & 0xff; zoom_x = (zoom_control >> 8) & 0x0f; rows = y_control & 0x3f; @@ -505,7 +492,7 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) } } - sprite_y_and_tile = region_zoomy[(zoom_y << 8) | zoom_line]; + sprite_y_and_tile = state->region_zoomy[(zoom_y << 8) | zoom_line]; sprite_y = sprite_y_and_tile & 0x0f; tile = sprite_y_and_tile >> 4; @@ -516,16 +503,16 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) } attr_and_code_offs = (sprite_number << 6) | (tile << 1); - attr = neogeo_videoram[attr_and_code_offs + 1]; - code = ((attr << 12) & 0x70000) | neogeo_videoram[attr_and_code_offs]; + attr = state->videoram[attr_and_code_offs + 1]; + code = ((attr << 12) & 0x70000) | state->videoram[attr_and_code_offs]; /* substitute auto animation bits */ - if (!auto_animation_disabled) + if (!state->auto_animation_disabled) { if (attr & 0x0008) - code = (code & ~0x07) | (auto_animation_counter & 0x07); + code = (code & ~0x07) | (state->auto_animation_counter & 0x07); else if (attr & 0x0004) - code = (code & ~0x03) | (auto_animation_counter & 0x03); + code = (code & ~0x03) | (state->auto_animation_counter & 0x03); } /* vertical flip? */ @@ -535,9 +522,9 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) zoom_x_table = zoom_x_tables[zoom_x]; /* compute offset in gfx ROM and mask it to the number of bits available */ - gfx = &sprite_gfx[((code << 8) | (sprite_y << 4)) & sprite_gfx_address_mask]; + gfx = &state->sprite_gfx[((code << 8) | (sprite_y << 4)) & state->sprite_gfx_address_mask]; - line_pens = &pens[attr >> 8 << 4]; + line_pens = &state->pens[attr >> 8 << 4]; /* horizontal flip? */ if (attr & 0x0001) @@ -603,8 +590,9 @@ static void draw_sprites(bitmap_t *bitmap, int scanline) } -static void parse_sprites(int scanline) +static void parse_sprites( running_machine *machine, int scanline ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; UINT16 sprite_number; int y = 0; int rows = 0; @@ -614,14 +602,14 @@ static void parse_sprites(int scanline) /* select the active list */ if (scanline & 0x01) - sprite_list = &neogeo_videoram[0x8680]; + sprite_list = &state->videoram[0x8680]; else - sprite_list = &neogeo_videoram[0x8600]; + sprite_list = &state->videoram[0x8600]; /* scan all sprites */ for (sprite_number = 0; sprite_number < MAX_SPRITES_PER_SCREEN; sprite_number++) { - UINT16 y_control = neogeo_videoram[0x8200 | sprite_number]; + UINT16 y_control = state->videoram[0x8200 | sprite_number]; /* if not chained, get Y position and height, otherwise use previous values */ if (~y_control & 0x40) @@ -650,43 +638,47 @@ static void parse_sprites(int scanline) } /* fill the rest of the sprite list with 0, including one extra entry */ - memset(sprite_list, 0, - sizeof(sprite_list[0]) * (MAX_SPRITES_PER_LINE - active_sprite_count + 1)); + memset(sprite_list, 0, sizeof(sprite_list[0]) * (MAX_SPRITES_PER_LINE - active_sprite_count + 1)); } static TIMER_CALLBACK( sprite_line_timer_callback ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; int scanline = param; /* we are at the beginning of a scanline - we need to draw the previous scanline and parse the sprites on the current one */ - if (scanline != 0) - video_screen_update_partial(machine->primary_screen, scanline - 1); + if (scanline != 0) + video_screen_update_partial(machine->primary_screen, scanline - 1); - parse_sprites(scanline); + parse_sprites(machine, scanline); /* let's come back at the beginning of the next line */ scanline = (scanline + 1) % NEOGEO_VTOTAL; - timer_adjust_oneshot(sprite_line_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline); + timer_adjust_oneshot(state->sprite_line_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline); } -static void create_sprite_line_timer(running_machine *machine) +static void create_sprite_line_timer( running_machine *machine ) { - sprite_line_timer = timer_alloc(machine, sprite_line_timer_callback, NULL); + neogeo_state *state = (neogeo_state *)machine->driver_data; + state->sprite_line_timer = timer_alloc(machine, sprite_line_timer_callback, NULL); } -static void start_sprite_line_timer(running_machine *machine) +static void start_sprite_line_timer( running_machine *machine ) { - timer_adjust_oneshot(sprite_line_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0); + neogeo_state *state = (neogeo_state *)machine->driver_data; + timer_adjust_oneshot(state->sprite_line_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0); } -static void optimize_sprite_data(running_machine *machine) +static void optimize_sprite_data( running_machine *machine ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + /* convert the sprite graphics data into a format that allows faster blitting */ int i; @@ -697,21 +689,22 @@ static void optimize_sprite_data(running_machine *machine) /* get mask based on the length rounded up to the nearest power of 2 */ - sprite_gfx_address_mask = 0xffffffff; + state->sprite_gfx_address_mask = 0xffffffff; len = memory_region_length(machine, "sprites"); + for (bit = 0x80000000; bit != 0; bit >>= 1) { if (((len * 2) - 1) & bit) break; - sprite_gfx_address_mask >>= 1; + state->sprite_gfx_address_mask >>= 1; } - sprite_gfx = auto_alloc_array_clear(machine, UINT8, sprite_gfx_address_mask + 1); + state->sprite_gfx = auto_alloc_array_clear(machine, UINT8, state->sprite_gfx_address_mask + 1); src = memory_region(machine, "sprites"); - dest = sprite_gfx; + dest = state->sprite_gfx; for (i = 0; i < len; i += 0x80, src += 0x80) { @@ -748,7 +741,7 @@ static void optimize_sprite_data(running_machine *machine) * *************************************/ -static UINT16 get_video_control(running_machine *machine) +static UINT16 get_video_control( running_machine *machine ) { UINT16 ret; UINT16 v_counter; @@ -780,7 +773,7 @@ static UINT16 get_video_control(running_machine *machine) if (v_counter >= 0x200) v_counter = v_counter - NEOGEO_VTOTAL; - ret = (v_counter << 7) | (neogeo_get_auto_animation_counter() & 0x0007); + ret = (v_counter << 7) | (neogeo_get_auto_animation_counter(machine) & 0x0007); if (VERBOSE) logerror("%s: video_control read (%04x)\n", cpuexec_describe_context(machine), ret); @@ -788,15 +781,15 @@ static UINT16 get_video_control(running_machine *machine) } -static void set_video_control(running_machine *machine, UINT16 data) +static void set_video_control( running_machine *machine, UINT16 data ) { /* this does much more than this, but I'm not sure exactly what */ if (VERBOSE) logerror("%s: video control write %04x\n", cpuexec_describe_context(machine), data); - set_auto_animation_speed(data >> 8); - set_auto_animation_disabled(data & 0x0008); + set_auto_animation_speed(machine, data >> 8); + set_auto_animation_disabled(machine, data & 0x0008); - neogeo_set_display_position_interrupt_control(data & 0x00f0); + neogeo_set_display_position_interrupt_control(machine, data & 0x00f0); } @@ -813,8 +806,8 @@ READ16_HANDLER( neogeo_video_register_r ) { default: case 0x00: - case 0x01: ret = get_videoram_data(); break; - case 0x02: ret = get_videoram_modulo(); break; + case 0x01: ret = get_videoram_data(space->machine); break; + case 0x02: ret = get_videoram_modulo(space->machine); break; case 0x03: ret = get_video_control(space->machine); break; } } @@ -834,9 +827,9 @@ WRITE16_HANDLER( neogeo_video_register_w ) switch (offset) { - case 0x00: set_videoram_offset(data); break; - case 0x01: set_videoram_data(data); break; - case 0x02: set_videoram_modulo(data); break; + case 0x00: set_videoram_offset(space->machine, data); break; + case 0x01: set_videoram_data(space->machine, data); break; + case 0x02: set_videoram_modulo(space->machine, data); break; case 0x03: set_video_control(space->machine, data); break; case 0x04: neogeo_set_display_counter_msb(space, data); break; case 0x05: neogeo_set_display_counter_lsb(space, data); break; @@ -856,50 +849,52 @@ WRITE16_HANDLER( neogeo_video_register_w ) VIDEO_START( neogeo ) { + neogeo_state *state = (neogeo_state *)machine->driver_data; + /* allocate memory not directly mapped */ - palettes[0] = auto_alloc_array(machine, UINT16, NUM_PENS); - palettes[1] = auto_alloc_array(machine, UINT16, NUM_PENS); - pens = auto_alloc_array(machine, pen_t, NUM_PENS); - neogeo_videoram = auto_alloc_array(machine, UINT16, 0x20000/2); + state->palettes[0] = auto_alloc_array(machine, UINT16, NUM_PENS); + state->palettes[1] = auto_alloc_array(machine, UINT16, NUM_PENS); + state->pens = auto_alloc_array(machine, pen_t, NUM_PENS); + state->videoram = auto_alloc_array(machine, UINT16, 0x20000/2); /* clear allocated memory */ - memset(palettes[0],0x00, NUM_PENS * sizeof(UINT16)); - memset(palettes[1],0x00, NUM_PENS * sizeof(UINT16)); - memset(pens,0x00, NUM_PENS * sizeof(pen_t)); - memset(neogeo_videoram,0x00, 0x20000); + memset(state->palettes[0], 0x00, NUM_PENS * sizeof(UINT16)); + memset(state->palettes[1], 0x00, NUM_PENS * sizeof(UINT16)); + memset(state->pens, 0x00, NUM_PENS * sizeof(pen_t)); + memset(state->videoram, 0x00, 0x20000); - compute_rgb_weights(); + compute_rgb_weights(machine); create_sprite_line_timer(machine); create_auto_animation_timer(machine); optimize_sprite_data(machine); /* initialize values that are not modified on a reset */ - videoram_read_buffer = 0; - videoram_offset = 0; - videoram_modulo = 0; - auto_animation_speed = 0; - auto_animation_disabled = 0; - auto_animation_counter = 0; - auto_animation_frame_counter = 0; + state->videoram_read_buffer = 0; + state->videoram_offset = 0; + state->videoram_modulo = 0; + state->auto_animation_speed = 0; + state->auto_animation_disabled = 0; + state->auto_animation_counter = 0; + state->auto_animation_frame_counter = 0; /* register for state saving */ - state_save_register_global_pointer(machine, palettes[0], NUM_PENS); - state_save_register_global_pointer(machine, palettes[1], NUM_PENS); - state_save_register_global_pointer(machine, neogeo_videoram, 0x20000/2); - state_save_register_global(machine, videoram_read_buffer); - state_save_register_global(machine, videoram_modulo); - state_save_register_global(machine, videoram_offset); - state_save_register_global(machine, fixed_layer_source); - state_save_register_global(machine, screen_dark); - state_save_register_global(machine, palette_bank); - state_save_register_global(machine, auto_animation_speed); - state_save_register_global(machine, auto_animation_disabled); - state_save_register_global(machine, auto_animation_counter); - state_save_register_global(machine, auto_animation_frame_counter); + state_save_register_global_pointer(machine, state->palettes[0], NUM_PENS); + state_save_register_global_pointer(machine, state->palettes[1], NUM_PENS); + state_save_register_global_pointer(machine, state->videoram, 0x20000/2); + state_save_register_global(machine, state->videoram_read_buffer); + state_save_register_global(machine, state->videoram_modulo); + state_save_register_global(machine, state->videoram_offset); + state_save_register_global(machine, state->fixed_layer_source); + state_save_register_global(machine, state->screen_dark); + state_save_register_global(machine, state->palette_bank); + state_save_register_global(machine, state->auto_animation_speed); + state_save_register_global(machine, state->auto_animation_disabled); + state_save_register_global(machine, state->auto_animation_counter); + state_save_register_global(machine, state->auto_animation_frame_counter); state_save_register_postload(machine, regenerate_pens, NULL); - region_zoomy = memory_region(machine, "zoomy"); + state->region_zoomy = memory_region(machine, "zoomy"); } @@ -926,10 +921,12 @@ VIDEO_RESET( neogeo ) VIDEO_UPDATE( neogeo ) { - /* fill with background color first */ - bitmap_fill(bitmap, cliprect, pens[0x0fff]); + neogeo_state *state = (neogeo_state *)screen->machine->driver_data; - draw_sprites(bitmap, cliprect->min_y); + /* fill with background color first */ + bitmap_fill(bitmap, cliprect, state->pens[0x0fff]); + + draw_sprites(screen->machine, bitmap, cliprect->min_y); draw_fixed_layer(screen->machine, bitmap, cliprect->min_y);