diff options
| author | 2013-11-05 04:48:30 +0000 | |
|---|---|---|
| committer | 2013-11-05 04:48:30 +0000 | |
| commit | e0f1c2478fcb6790025d63c7986415e3bdab8593 (patch) | |
| tree | 8fd53e17027a34adefef7629a170498dbcea885a | |
| parent | 75eaf393e6a5b7c251cb3174e19a44382a479582 (diff) | |
NeoGeo improvements: [Alex Jackson]
* Cleaned up large amounts of duplicated code between the MAME and MESS (AES/NeoCD) drivers
* Removed MVS-only ROMs and devices (SM1 ROM, SFIX ROM, upd4990a RTC, etc.) from AES/NeoCD
* Replaced legacy NVRAM in MVS and NeoCD with NVRAM devices
* Correctly hooked up SM1 ROM bankswitching; the BIOS sound test works now
* Corrected VRAM size
* Sorted the Universe BIOS versions and unified them between MAME and MESS
* Fixed kf10thep ROM loading and decryption which was a horrible hack (and not endian safe)
* Replaced svcplus protection hack ROM patch with a less invasive one, based on FBA
* Started marking code and data that should be moved out into devices
* Various other code and comment cleanups
New clones added
----------------
Kizuna Encounter - Super Tag Battle 4 Way Battle Version / Fu'un Super Tag Battle Special Version [Alex Jackson]
| -rw-r--r-- | hash/neogeo.xml | 8 | ||||
| -rw-r--r-- | src/mame/drivers/neogeo.c | 393 | ||||
| -rw-r--r-- | src/mame/drivers/neogeo.inc | 262 | ||||
| -rw-r--r-- | src/mame/includes/neogeo.h | 311 | ||||
| -rw-r--r-- | src/mame/machine/neoboot.c | 91 | ||||
| -rw-r--r-- | src/mame/machine/neocrypt.c | 10 | ||||
| -rw-r--r-- | src/mame/machine/neoprot.c | 51 | ||||
| -rw-r--r-- | src/mame/mame.lst | 2 | ||||
| -rw-r--r-- | src/mame/video/neogeo.c | 51 | ||||
| -rw-r--r-- | src/mess/drivers/ng_aes.c | 396 |
10 files changed, 631 insertions, 944 deletions
diff --git a/hash/neogeo.xml b/hash/neogeo.xml index 9498b707a11..d99dc24f4e8 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -9075,11 +9075,9 @@ <!-- this is a hack of kof2002 much like the various korean hacks / bootlegs of games --> <feature name="crypt" value="kf10thep_prot" /> <dataarea name="maincpu" size="0x800000"> - <rom loadflag="load16_word_swap" name="5008-p2.bin" offset="0x100000" size="0x400000" crc="a649ec38" sha1="5c63ed5e5c848940f587c966da4908d04cf1293c" /> - <rom loadflag="load16_word_swap" name="5008-p3.bin" offset="0x500000" size="0x200000" crc="e629e13c" sha1="6ebe080ce01c51064cb2f4d89315ba98a45ae727" /> - </dataarea> - <dataarea name="audiocrypt" size="0x200000"> - <rom name="5008-p1.bin" offset="0x000000" size="0x200000" crc="bf5469ba" sha1="f05236d8fffab5836c0d27becdeeb80def32ee49" /> + <rom loadflag="load16_word_swap" name="5008-p1.bin" offset="0x000000" size="0x200000" crc="bf5469ba" sha1="f05236d8fffab5836c0d27becdeeb80def32ee49" /> + <rom loadflag="load16_word_swap" name="5008-p2.bin" offset="0x200000" size="0x400000" crc="a649ec38" sha1="5c63ed5e5c848940f587c966da4908d04cf1293c" /> + <rom loadflag="load16_word_swap" name="5008-p3.bin" offset="0x600000" size="0x200000" crc="e629e13c" sha1="6ebe080ce01c51064cb2f4d89315ba98a45ae727" /> </dataarea> <dataarea name="fixed" size="0x040000"> <rom offset="0x000000" size="0x020000" name="5008-s1.bin" crc="92410064" sha1="1fb800b46341858207d3b6961a760289fbec7faa" /> diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index cecd021f114..31c28e0bd72 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -108,8 +108,8 @@ are incomplete / buggy? * Graphical Glitches caused by incorrect timing? - Some raster effects are imperfect (off by a couple of lines) - * Mult-cart support not implementd - the MVS can take up to 6 carts - depending on the board being used + * Multi-cart support not implemented - the MVS can take up to + 6 cartridges depending on the board being used Confirmed non-bugs: @@ -118,7 +118,7 @@ if you try and use the normal bios with a pcb set, it looks like the bootleggers didn't care. * Glitches at the edges of the screen - the real hardware - can display 320x240 but most of the games seem designed + can display 320x224 but most of the games seem designed to work with a width of 304, some less. * Distorted jumping sound in Nightmare in the Dark * Ninja Combat sometimes glitches @@ -139,7 +139,7 @@ H = right (for options) * These only work with Japanese BIOS, but I think it's not a bug: I - doubt other bios were programmed to be compatible with mahjong panels + doubt other BIOS were programmed to be compatible with mahjong panels ****************************************************************************/ @@ -155,26 +155,12 @@ #define LOG_VIDEO_SYSTEM (0) -#define LOG_CPU_COMM (0) #define LOG_MAIN_CPU_BANKING (0) #define LOG_AUDIO_CPU_BANKING (0) /************************************* * - * Global variables - * - *************************************/ - -static UINT8 *memcard_data; - -static const char *audio_banks[4] = -{ - NEOGEO_BANK_AUDIO_CPU_CART_BANK0, NEOGEO_BANK_AUDIO_CPU_CART_BANK1, NEOGEO_BANK_AUDIO_CPU_CART_BANK2, NEOGEO_BANK_AUDIO_CPU_CART_BANK3 -}; - -/************************************* - * * Main CPU interrupt generation * *************************************/ @@ -283,8 +269,9 @@ TIMER_CALLBACK_MEMBER(neogeo_state::vblank_interrupt_callback) { if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", m_screen->vpos(), m_screen->hpos()); - /* add a timer tick to the pd4990a */ - m_upd4990a->addretrace(); + /* add a timer tick to the upd4990a */ + /* FIXME: upd4990a being clocked by vblank is nonsense; it has its own xtal */ + if (m_type == NEOGEO_MVS) m_upd4990a->addretrace(); m_vblank_interrupt_pending = 1; @@ -317,18 +304,12 @@ void neogeo_state::start_interrupt_timers() * *************************************/ -WRITE_LINE_MEMBER(neogeo_state::audio_cpu_irq) -{ - m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); -} - - void neogeo_state::audio_cpu_assert_nmi() { m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } -WRITE8_MEMBER(neogeo_state::audio_cpu_clear_nmi_w) +void neogeo_state::audio_cpu_clear_nmi() { m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } @@ -359,6 +340,26 @@ CUSTOM_INPUT_MEMBER(neogeo_state::multiplexed_controller_r) return ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00); } +CUSTOM_INPUT_MEMBER(neogeo_state::kizuna4p_controller_r) +{ + int port = (FPTR)param; + + static const char *const cntrl[2][2] = + { + { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" } + }; + + int ret = ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00); + if (m_controller_select & 0x04) ret &= ((m_controller_select & 0x01) ? ~0x20 : ~0x10); + + return ret; +} + +CUSTOM_INPUT_MEMBER(neogeo_state::kizuna4p_start_r) +{ + return (ioport("START")->read() >> (m_controller_select & 0x01)) | ~0x05; +} + #if 1 // this needs to be added dynamically somehow CUSTOM_INPUT_MEMBER(neogeo_state::mahjong_controller_r) { @@ -390,9 +391,9 @@ WRITE16_MEMBER(neogeo_state::io_control_w) switch (offset) { case 0x00: select_controller(data & 0x00ff); break; - case 0x18: if (m_is_mvs) set_output_latch(data & 0x00ff); break; - case 0x20: if (m_is_mvs) set_output_data(data & 0x00ff); break; - case 0x28: m_upd4990a->control_16_w(space, 0, data, mem_mask); break; + case 0x18: if (m_type == NEOGEO_MVS) set_output_latch(data & 0x00ff); break; + case 0x20: if (m_type == NEOGEO_MVS) set_output_data(data & 0x00ff); break; + case 0x28: if (m_type == NEOGEO_MVS) m_upd4990a->control_16_w(space, 0, data, mem_mask); break; // case 0x30: break; // coin counters // case 0x31: break; // coin counters // case 0x32: break; // coin lockout @@ -423,11 +424,10 @@ READ16_MEMBER(neogeo_state::neogeo_unmapped_r) ret = 0xffff; else { - m_recurse = 1; + m_recurse = true; ret = space.read_word(space.device().safe_pc()); - m_recurse = 0; + m_recurse = false; } - return ret; } @@ -478,8 +478,8 @@ WRITE16_MEMBER(neogeo_state::save_ram_w) CUSTOM_INPUT_MEMBER(neogeo_state::get_memcard_status) { - /* D0 and D1 are memcard presence indicators, D2 indicates memcard - write protect status (we are always write enabled) */ + // D0 and D1 are memcard presence indicators, D2 indicates memcard + // write protect status (we are always write enabled) return (memcard_present(machine()) == -1) ? 0x07 : 0x00; } @@ -489,7 +489,7 @@ READ16_MEMBER(neogeo_state::memcard_r) UINT16 ret; if (memcard_present(machine()) != -1) - ret = memcard_data[offset] | 0xff00; + ret = m_memcard_data[offset] | 0xff00; else ret = 0xffff; @@ -502,26 +502,27 @@ WRITE16_MEMBER(neogeo_state::memcard_w) if (ACCESSING_BITS_0_7) { if (memcard_present(machine()) != -1) - memcard_data[offset] = data; + m_memcard_data[offset] = data; } } -static MEMCARD_HANDLER( neogeo ) +MEMCARD_HANDLER( neogeo ) { + neogeo_state *state = machine.driver_data<neogeo_state>(); switch (action) { case MEMCARD_CREATE: - memset(memcard_data, 0, MEMCARD_SIZE); - file.write(memcard_data, MEMCARD_SIZE); + memset(state->m_memcard_data, 0, MEMCARD_SIZE); + file.write(state->m_memcard_data, MEMCARD_SIZE); break; case MEMCARD_INSERT: - file.read(memcard_data, MEMCARD_SIZE); + file.read(state->m_memcard_data, MEMCARD_SIZE); break; case MEMCARD_EJECT: - file.write(memcard_data, MEMCARD_SIZE); + file.write(state->m_memcard_data, MEMCARD_SIZE); break; } } @@ -537,16 +538,14 @@ static MEMCARD_HANDLER( neogeo ) WRITE16_MEMBER(neogeo_state::audio_command_w) { /* accessing the LSB only is not mapped */ - if (mem_mask != 0x00ff) + if (ACCESSING_BITS_8_15) { - soundlatch_byte_w(space, 0, data >> 8); + soundlatch_write(data >> 8); audio_cpu_assert_nmi(); /* boost the interleave to let the audio CPU read the command */ machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); - - if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", space.device().safe_pc(), data, mem_mask); } } @@ -556,30 +555,17 @@ WRITE16_MEMBER(neogeo_state::audio_command_w) READ8_MEMBER(neogeo_state::audio_command_r) { - UINT8 ret = soundlatch_byte_r(space, 0); - - if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", space.device().safe_pc(), ret); + UINT8 ret = soundlatch_read(); - /* this is a guess */ - audio_cpu_clear_nmi_w(space, 0, 0); + audio_cpu_clear_nmi(); return ret; } -WRITE8_MEMBER(neogeo_state::audio_result_w) -{ - if (LOG_CPU_COMM && (m_audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", space.device().safe_pc(), data); - - m_audio_result = data; -} - - CUSTOM_INPUT_MEMBER(neogeo_state::get_audio_result) { - UINT32 ret = m_audio_result; - -// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", m_maincpu->pc(), ret); + UINT8 ret = soundlatch_read(1); // soundlatch2_byte_r return ret; } @@ -592,24 +578,9 @@ CUSTOM_INPUT_MEMBER(neogeo_state::get_audio_result) * *************************************/ -void neogeo_state::_set_main_cpu_vector_table_source() -{ - m_bank_vectors->set_entry(m_main_cpu_vector_table_source); -} - - - -void neogeo_state::neogeo_set_main_cpu_vector_table_source( UINT8 data ) -{ - m_main_cpu_vector_table_source = data; - - _set_main_cpu_vector_table_source(); -} - - void neogeo_state::_set_main_cpu_bank_address() { - if (!m_is_cartsys) return; + if (m_type == NEOGEO_CD) return; m_bank_cartridge->set_base(m_region_maincpu->base() + m_main_cpu_bank_address); } @@ -625,7 +596,6 @@ void neogeo_state::neogeo_set_main_cpu_bank_address( UINT32 bank_address ) } - WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w) { UINT32 bank_address; @@ -648,15 +618,14 @@ WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w) } - - void neogeo_state::neogeo_main_cpu_banking_init() { /* create vector banks */ - m_bank_vectors->configure_entry(0, memregion("mainbios")->base()); m_bank_vectors->configure_entry(1, m_region_maincpu->base()); + m_bank_vectors->configure_entry(0, memregion("mainbios")->base()); + m_bank_vectors->set_entry(0); - if (m_is_cartsys) + if (m_type != NEOGEO_CD) { /* set initial main CPU bank */ if (m_region_maincpu->bytes() > 0x100000) @@ -673,99 +642,17 @@ void neogeo_state::neogeo_main_cpu_banking_init() * *************************************/ -void neogeo_state::set_audio_cpu_banking() +READ8_MEMBER(neogeo_state::audio_cpu_bank_select_r) { - if (!m_has_audio_banking) return; - - int region; - - for (region = 0; region < 4; region++) - m_bank_audio_cart[region]->set_entry(m_audio_cpu_banks[region]); -} - - - -void neogeo_state::audio_cpu_bank_select( int region, UINT8 bank ) -{ - if (!m_has_audio_banking) return; - - if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", m_audiocpu->pc(), region, bank); - - m_audio_cpu_banks[region] = bank; - - set_audio_cpu_banking(); -} - - - -READ8_MEMBER(neogeo_state::audio_cpu_bank_select_f000_f7ff_r) -{ - audio_cpu_bank_select(0, offset >> 8); - - return 0; -} - - -READ8_MEMBER(neogeo_state::audio_cpu_bank_select_e000_efff_r) -{ - audio_cpu_bank_select(1, offset >> 8); - - return 0; -} - - -READ8_MEMBER(neogeo_state::audio_cpu_bank_select_c000_dfff_r) -{ - audio_cpu_bank_select(2, offset >> 8); + m_bank_audio_cart[offset & 3]->set_entry(offset >> 8); return 0; } -READ8_MEMBER(neogeo_state::audio_cpu_bank_select_8000_bfff_r) -{ - audio_cpu_bank_select(3, offset >> 8); - - return 0; -} - - -void neogeo_state::_set_audio_cpu_rom_source() -{ - if (!m_has_audio_banking) return; - -/* if (!memregion("audiobios")->base()) */ - m_audio_cpu_rom_source = 1; - - m_bank_audio_main->set_entry(m_audio_cpu_rom_source); - - /* reset CPU if the source changed -- this is a guess */ - if (m_audio_cpu_rom_source != m_audio_cpu_rom_source_last) - { - m_audio_cpu_rom_source_last = m_audio_cpu_rom_source; - - m_audiocpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); - - if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selecting %s ROM\n", m_audiocpu->pc(), m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); - } -} - - - - -void neogeo_state::set_audio_cpu_rom_source( UINT8 data ) -{ - m_audio_cpu_rom_source = data; - _set_audio_cpu_rom_source(); -} - - - - - void neogeo_state::neogeo_audio_cpu_banking_init() { - if (!m_has_audio_banking) return; + if (m_type == NEOGEO_CD) return; int region; int bank; @@ -773,35 +660,37 @@ void neogeo_state::neogeo_audio_cpu_banking_init() UINT32 address_mask; /* audio bios/cartridge selection */ - if (memregion("audiobios")->base()) - m_bank_audio_main->configure_entry(0, memregion("audiobios")->base()); m_bank_audio_main->configure_entry(1, memregion("audiocpu")->base()); + if (memregion("audiobios")) + m_bank_audio_main->configure_entry(0, memregion("audiobios")->base()); + else /* on hardware with no SM1 ROM, the cart ROM is always enabled */ + m_bank_audio_main->configure_entry(0, memregion("audiocpu")->base()); + m_bank_audio_main->set_entry(0); /* audio banking */ - address_mask = memregion("audiocpu")->bytes() - 0x10000 - 1; - + m_bank_audio_cart[0] = membank("audio_f000"); + m_bank_audio_cart[1] = membank("audio_e000"); + m_bank_audio_cart[2] = membank("audio_c000"); + m_bank_audio_cart[3] = membank("audio_8000"); + + address_mask = (memregion("audiocpu")->bytes() - 0x10000 - 1) & 0x3ffff; rgn = memregion("audiocpu")->base(); + for (region = 0; region < 4; region++) { - m_bank_audio_cart[region] = membank(audio_banks[region]); - for (bank = 0; bank < 0x100; bank++) + for (bank = 0xff; bank >= 0; bank--) { - UINT32 bank_address = 0x10000 + (((bank << (11 + region)) & 0x3ffff) & address_mask); + UINT32 bank_address = 0x10000 + ((bank << (11 + region)) & address_mask); m_bank_audio_cart[region]->configure_entry(bank, &rgn[bank_address]); } } /* set initial audio banks -- how does this really work, or is it even necessary? */ - m_audio_cpu_banks[0] = 0x1e; - m_audio_cpu_banks[1] = 0x0e; - m_audio_cpu_banks[2] = 0x06; - m_audio_cpu_banks[3] = 0x02; - - set_audio_cpu_banking(); - - m_audio_cpu_rom_source_last = 0; - set_audio_cpu_rom_source(0); + m_bank_audio_cart[0]->set_entry(0x1e); + m_bank_audio_cart[1]->set_entry(0x0e); + m_bank_audio_cart[2]->set_entry(0x06); + m_bank_audio_cart[3]->set_entry(0x02); } @@ -824,28 +713,18 @@ WRITE16_MEMBER(neogeo_state::system_control_w) { default: case 0x00: neogeo_set_screen_dark(bit); break; - case 0x01: - if (m_is_cartsys) - { - neogeo_set_main_cpu_vector_table_source(bit); // NeoCD maps the vector swap elsewhere - } + case 0x01: if (m_type == NEOGEO_CD) + printf("NeoCD: write to regular vector change address? %d\n", bit); // what IS going on with "neocdz doubledr" and why do games write here if it's hooked up to nothing? else + m_bank_vectors->set_entry(bit); + break; + case 0x05: if (m_type == NEOGEO_MVS) { -#if 0 - if (bit) - { - if (m_main_cpu_vector_table_source) - neogeo_set_main_cpu_vector_table_source(0); - else - neogeo_set_main_cpu_vector_table_source(1); - } -#endif - printf("NeoCD: write to regular vector change address? %d\n", bit); // what IS going on with "neocdz doubledr" and why do games write here if it's hooked up to nothing? + neogeo_set_fixed_layer_source(bit); + m_bank_audio_main->set_entry(bit); } - if (m_has_audio_banking) set_audio_cpu_rom_source(bit); /* this is a guess */ break; - case 0x05: neogeo_set_fixed_layer_source(bit); break; - case 0x06: if (m_is_mvs) set_save_ram_unlock(bit); break; + case 0x06: if (m_type == NEOGEO_MVS) set_save_ram_unlock(bit); break; case 0x07: neogeo_set_palette_bank(bit); break; case 0x02: /* unknown - HC32 middle pin 1 */ @@ -969,10 +848,7 @@ void neogeo_state::set_output_data( UINT8 data ) void neogeo_state::neogeo_postload() { _set_main_cpu_bank_address(); - _set_main_cpu_vector_table_source(); - set_audio_cpu_banking(); - _set_audio_cpu_rom_source(); - if (m_is_mvs) set_outputs(); + if (m_type == NEOGEO_MVS) set_outputs(); } @@ -982,11 +858,7 @@ void neogeo_state::neogeo_postload() void neogeo_state::machine_start() { - /* configure NVRAM */ - machine().device<nvram_device>("saveram")->set_base(m_save_ram, 0x10000); - - /* set the BIOS bank */ - m_bank_bios->set_base(memregion("mainbios")->base()); + m_type = NEOGEO_MVS; /* set the initial main CPU bank */ neogeo_main_cpu_banking_init(); @@ -997,7 +869,7 @@ void neogeo_state::machine_start() create_interrupt_timers(); /* initialize the memcard data structure */ - memcard_data = auto_alloc_array_clear(machine(), UINT8, MEMCARD_SIZE); + m_memcard_data = auto_alloc_array_clear(machine(), UINT8, MEMCARD_SIZE); /* irq levels for MVS / AES */ m_vblank_level = 1; @@ -1012,21 +884,15 @@ void neogeo_state::machine_start() save_item(NAME(m_vblank_interrupt_pending)); save_item(NAME(m_display_position_interrupt_pending)); save_item(NAME(m_irq3_pending)); - save_item(NAME(m_audio_result)); save_item(NAME(m_controller_select)); save_item(NAME(m_main_cpu_bank_address)); - save_item(NAME(m_main_cpu_vector_table_source)); - save_item(NAME(m_audio_cpu_banks)); - save_item(NAME(m_audio_cpu_rom_source)); - save_item(NAME(m_audio_cpu_rom_source_last)); save_item(NAME(m_save_ram_unlocked)); - save_pointer(NAME(memcard_data), 0x800); + save_pointer(NAME(m_memcard_data), 0x800); save_item(NAME(m_output_data)); save_item(NAME(m_output_latch)); save_item(NAME(m_el_value)); save_item(NAME(m_led1_value)); save_item(NAME(m_led2_value)); - save_item(NAME(m_recurse)); machine().save().register_postload(save_prepost_delegate(FUNC(neogeo_state::neogeo_postload), this)); } @@ -1050,18 +916,15 @@ void neogeo_state::machine_reset() m_maincpu->reset(); - neogeo_reset_rng(); + // FIXME: this doesn't belong in the base system + reset_sma_rng(); start_interrupt_timers(); /* trigger the IRQ3 that was set by MACHINE_START */ update_interrupts(); - m_recurse = 0; - - /* AES apparently always uses the cartridge's fixed bank mode */ - // neogeo_set_fixed_layer_source(machine(),1); - + m_recurse = false; } @@ -1073,11 +936,11 @@ void neogeo_state::machine_reset() *************************************/ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, neogeo_state ) - AM_RANGE(0x000000, 0x00007f) AM_ROMBANK(NEOGEO_BANK_VECTORS) + AM_RANGE(0x000000, 0x00007f) AM_ROMBANK("vectors") AM_RANGE(0x000080, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x0f0000) AM_RAM /* some games have protection devices in the 0x200000 region, it appears to map to cart space, not surprising, the ROM is read here too */ - AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK(NEOGEO_BANK_CARTRIDGE) + AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK("cartridge") AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ_PORT("P1/DSW") AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("TEST") @@ -1093,8 +956,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, neogeo_state ) AM_RANGE(0x3e0000, 0x3fffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w) AM_RANGE(0x800000, 0x800fff) AM_READWRITE(memcard_r, memcard_w) - AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROMBANK(NEOGEO_BANK_BIOS) - AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_RAM_WRITE(save_ram_w) AM_SHARE("save_ram") + AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROM AM_REGION("mainbios", 0) + AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_RAM_WRITE(save_ram_w) AM_SHARE("saveram") AM_RANGE(0xe00000, 0xffffff) AM_READ(neogeo_unmapped_r) ADDRESS_MAP_END @@ -1108,11 +971,11 @@ ADDRESS_MAP_END *************************************/ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, neogeo_state ) - AM_RANGE(0x0000, 0x7fff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK) - AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK3) - AM_RANGE(0xc000, 0xdfff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK2) - AM_RANGE(0xe000, 0xefff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK1) - AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK0) + AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("audio_main") + AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("audio_8000") + AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("audio_c000") + AM_RANGE(0xe000, 0xefff) AM_ROMBANK("audio_e000") + AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("audio_f000") AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -1125,16 +988,12 @@ ADDRESS_MAP_END *************************************/ static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, neogeo_state ) - /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/ /* may not and NMI clear */ - AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r) + AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, soundlatch_clear_byte_w) AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write) - AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */ - AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r) - AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r) - AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_c000_dfff_r) - AM_RANGE(0x0b, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_8000_bfff_r) - AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(audio_result_w) - AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) /* write - NMI disable? (the data written doesn't matter) */ + // AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */ + AM_RANGE(0x08, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xff03) AM_READ(audio_cpu_bank_select_r) + AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(soundlatch2_byte_w) + // AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) /* write - NMI disable? (the data written doesn't matter) */ ADDRESS_MAP_END @@ -1148,13 +1007,15 @@ ADDRESS_MAP_END static INPUT_PORTS_START( neogeo ) PORT_START("P1/DSW") - PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW:1" ) - PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") - PORT_DIPSETTING( 0x0000, "1?" ) - PORT_DIPSETTING( 0x0002, "2?" ) - PORT_DIPNAME( 0x0004, 0x0004, "Autofire (in some games)" ) PORT_DIPLOCATION("SW:3") - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPNAME( 0x0001, 0x0001, "Setting Mode" ) PORT_DIPLOCATION("SW:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0000, "VS Mode" ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Controller ) ) PORT_DIPLOCATION("SW:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Mahjong Panel" ) PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") PORT_DIPSETTING( 0x0018, "1" ) PORT_DIPSETTING( 0x0010, "2" ) @@ -1192,31 +1053,27 @@ static INPUT_PORTS_START( neogeo ) PORT_START("SYSTEM") PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_3) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8) - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* In AES 'mode' nitd, kof2000, sengoku3, matrim and mslug5 check if this is ACTIVE_HIGH */ + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_4) + PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state, get_memcard_status, NULL) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL ) /* Hardware type (AES=0, MVS=1) Some games check this and show */ + /* a piracy warning screen if the hardware and BIOS don't match */ PORT_START("AUDIO/COIN") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN3 ) /* What is this? "us-e" BIOS uses it as a coin input; Universe BIOS uses it to detect MVS or AES hardware */ + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN4 ) /* What is this? "us-e" BIOS uses it as a coin input; Universe BIOS uses it to detect MVS or AES hardware */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? When ACTIVE_HIGH + IN4 bit 6 ACTIVE_LOW MVS-4 slot is detected */ - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) + PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) PORT_START("TEST") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x003f, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* what is this? If ACTIVE_LOW, MVS-6 slot detected, when ACTIVE_HIGH MVS-1 slot (AES) detected */ - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) + PORT_SERVICE_NO_TOGGLE( 0x0080, IP_ACTIVE_LOW ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -1339,19 +1196,19 @@ MACHINE_CONFIG_START( neogeo_base, neogeo_state ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_SOUND_ADD("ymsnd", YM2610, NEOGEO_YM2610_CLOCK) - MCFG_YM2610_IRQ_HANDLER(WRITELINE(neogeo_state, audio_cpu_irq)) + MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.60) MCFG_SOUND_ROUTE(0, "rspeaker", 0.60) MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) MCFG_SOUND_ROUTE(2, "rspeaker", 1.0) - - /* NEC uPD4990A RTC */ - MCFG_UPD4990A_OLD_ADD("upd4990a") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( neogeo, neogeo_base ) MCFG_WATCHDOG_TIME_INIT(attotime::from_usec(128762)) + /* NEC uPD4990A RTC */ + MCFG_UPD4990A_OLD_ADD("upd4990a") + MCFG_NVRAM_ADD_0FILL("saveram") MCFG_MEMCARD_HANDLER(neogeo) MACHINE_CONFIG_END diff --git a/src/mame/drivers/neogeo.inc b/src/mame/drivers/neogeo.inc index ba05e3ffc69..fbadecc582b 100644 --- a/src/mame/drivers/neogeo.inc +++ b/src/mame/drivers/neogeo.inc @@ -703,37 +703,30 @@ ROM_LOAD16_WORD_SWAP_BIOS( 9, "japan-j3.bin",0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) /* Latest Japan bios; correct chip label unknown */ \ ROM_SYSTEM_BIOS( 10, "japan-hotel","Custom Japanese Hotel" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 10, "sp-1v1_3db8c.bin",0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \ - ROM_SYSTEM_BIOS( 11, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 11, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \ - ROM_SYSTEM_BIOS( 12, "uni-bios_2_3o","Universe Bios (Hack, Ver. 2.3, older?)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 12, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \ - ROM_SYSTEM_BIOS( 13, "uni-bios_2_2","Universe Bios (Hack, Ver. 2.2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 13, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \ - ROM_SYSTEM_BIOS( 14, "uni-bios_2_1","Universe Bios (Hack, Ver. 2.1)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 14, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \ - ROM_SYSTEM_BIOS( 15, "uni-bios_2_0","Universe Bios (Hack, Ver. 2.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 15, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \ - ROM_SYSTEM_BIOS( 16, "uni-bios_1_3","Universe Bios (Hack, Ver. 1.3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 16, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \ - ROM_SYSTEM_BIOS( 17, "uni-bios_1_2","Universe Bios (Hack, Ver. 1.2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 17, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \ - ROM_SYSTEM_BIOS( 18, "uni-bios_1_2o","Universe Bios (Hack, Ver. 1.2, older)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 18, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \ - ROM_SYSTEM_BIOS( 19, "uni-bios_1_1","Universe Bios (Hack, Ver. 1.1)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 19, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \ - ROM_SYSTEM_BIOS( 20, "uni-bios_1_0","Universe Bios (Hack, Ver. 1.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 20, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ \ - ROM_SYSTEM_BIOS( 21, "uni-bios_3_0","Universe Bios (Hack, Ver. 3.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 21, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \ + ROM_SYSTEM_BIOS( 11, "unibios30","Universe Bios (Hack, Ver. 3.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 11, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \ + ROM_SYSTEM_BIOS( 12, "unibios23","Universe Bios (Hack, Ver. 2.3)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 12, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \ + ROM_SYSTEM_BIOS( 13, "unibios23o","Universe Bios (Hack, Ver. 2.3, older?)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 13, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \ + ROM_SYSTEM_BIOS( 14, "unibios22","Universe Bios (Hack, Ver. 2.2)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 14, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \ + ROM_SYSTEM_BIOS( 15, "unibios21","Universe Bios (Hack, Ver. 2.1)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 15, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \ + ROM_SYSTEM_BIOS( 16, "unibios20","Universe Bios (Hack, Ver. 2.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 16, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \ + ROM_SYSTEM_BIOS( 17, "unibios13","Universe Bios (Hack, Ver. 1.3)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 17, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \ + ROM_SYSTEM_BIOS( 18, "unibios12","Universe Bios (Hack, Ver. 1.2)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 18, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \ + ROM_SYSTEM_BIOS( 19, "unibios12o","Universe Bios (Hack, Ver. 1.2, older)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 19, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \ + ROM_SYSTEM_BIOS( 20, "unibios11","Universe Bios (Hack, Ver. 1.1)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 20, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \ + ROM_SYSTEM_BIOS( 21, "unibios10","Universe Bios (Hack, Ver. 1.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 21, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ // ROM_SYSTEM_BIOS( 22, "debug", "Debug MVS (Hack?)" ) // ROM_LOAD16_WORD_SWAP_BIOS( 22, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Debug (Development) Bios */ -// ROM_SYSTEM_BIOS( 23, "asia-aes", "Asia AES" ) -// ROM_LOAD16_WORD_SWAP_BIOS( 23, "neo-epo.sp1", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */ -// ROM_SYSTEM_BIOS( 24, "japan-aes", "Japan AES" ) -// ROM_LOAD16_WORD_SWAP_BIOS( 24, "neo-po.sp1", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */ - -/* Note you'll have to modify the last for lines of each block to use the extra bios roms, - they're hacks / homebrew / console bios roms so MAME doesn't list them by default. */ #define NEO_BIOS_AUDIO_64K(name, hash) \ @@ -1911,6 +1904,8 @@ ROM_START( minasan ) /* MVS AND AES VERSION */ NEO_BIOS_AUDIO_128K( "027-m1.m1", CRC(add5a226) SHA1(99995bef2584abbba16777bac52f55523f7aa97d) ) /* HN62321AP */ + ROM_DEFAULT_BIOS( "japan" ) /* so the mahjong panel will work in the service menu */ + ROM_REGION( 0x100000, "ymsnd", 0 ) ROM_LOAD( "027-v11.v11", 0x000000, 0x100000, CRC(59ad4459) SHA1(bbb8ba8a8e337dd2946eefda4757e80d0547d54a) ) /* HN62308BPC */ @@ -2213,6 +2208,8 @@ ROM_START( bakatono ) /* MVS AND AES VERSION */ NEO_BIOS_AUDIO_128K( "036-m1.m1", CRC(f1385b96) SHA1(e7e3d1484188a115e262511116aaf466b8b1f428) ) /* CXK381003 */ + ROM_DEFAULT_BIOS( "japan" ) /* so the mahjong panel will work in the service menu */ + ROM_REGION( 0x200000, "ymsnd", 0 ) ROM_LOAD( "036-v1.v1", 0x000000, 0x100000, CRC(1c335dce) SHA1(493c273fa71bf81861a20af4c4eaae159e169f39) ) /* CXK388000 */ ROM_LOAD( "036-v2.v2", 0x100000, 0x100000, CRC(bbf79342) SHA1(45a4f40e415cdf35c3073851506648c8f7d53958) ) /* CXK388000 */ @@ -2674,6 +2671,8 @@ ROM_START( janshin ) /* MVS ONLY RELEASE */ NEO_BIOS_AUDIO_128K( "048-m1.m1", CRC(310467c7) SHA1(c529961195c9bdf5d1ce70a38ad129002d1f3b5f) ) /* mask rom TC531001 */ + ROM_DEFAULT_BIOS( "japan" ) /* so the mahjong panel will work in the service menu */ + ROM_REGION( 0x200000, "ymsnd", 0 ) ROM_LOAD( "048-v1.v1", 0x000000, 0x200000, CRC(f1947d2b) SHA1(955ff91ab24eb2a7ec51ff46c9f9f2ec060456b2) ) /* mask rom TC5316200 */ @@ -4847,6 +4846,47 @@ ROM_START( kizuna ) ROM_LOAD16_BYTE( "059-c8.c8", 0x1800001, 0x200000, CRC(484ce3ba) SHA1(4f21ed20ce6e2b67e2b079404599310c94f591ff) ) /* Plane 2,3 */ /* TC538200 */ ROM_END + +ROM_START( kizuna4p ) /* same cartridge as kizuna - 4-player mode is enabled by an extension board that plugs into a compatible MVS */ + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "216-p1.p1", 0x100000, 0x100000, CRC(75d2b3de) SHA1(ee778656c26828935ee2a2bfd0ce5a22aa681c10) ) /* mask rom TC5316200 */ + ROM_CONTINUE( 0x000000, 0x100000 ) + + NEO_SFIX_128K( "216-s1.s1", CRC(efdc72d7) SHA1(be37cbf1852e2e4c907cc799b754b538544b6703) ) /* mask rom TC531000 */ + + ROM_REGION16_BE( 0x80000, "mainbios", 0 ) + /* these two BIOSes are the only ones we have that are compatible with the 4-player extension board */ + ROM_SYSTEM_BIOS( 0, "asia", "NEO-MVH MV1C" ) + ROM_LOAD16_WORD_SWAP_BIOS( 0, "sp-45.sp1",0x00000, 0x080000, CRC(03cc9f6a) SHA1(cdf1f49e3ff2bac528c21ed28449cf35b7957dc1) ) + ROM_SYSTEM_BIOS( 1, "japan", "Japan MVS (J3)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 1, "japan-j3.bin",0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) + + ROM_REGION( 0x30000, "audiocpu", 0 ) + ROM_LOAD( "216-m1.m1", 0x00000, 0x20000, CRC(1b096820) SHA1(72852e78c620038f8dafde5e54e02e418c31be9c) ) /* mask rom TC531001 */ + ROM_RELOAD( 0x10000, 0x20000 ) + + ROM_REGION( 0x800000, "ymsnd", 0 ) + ROM_LOAD( "059-v1.v1", 0x000000, 0x200000, CRC(530c50fd) SHA1(29401cee7f7d2c199c7cb58092e86b28205e81ad) ) /* TC5316200 */ + ROM_LOAD( "216-v2.v2", 0x200000, 0x200000, CRC(03667a8d) SHA1(3b0475e553a49f8788f32b0c84f82645cc6b4273) ) /* mask rom TC5316200 */ + ROM_LOAD( "059-v3.v3", 0x400000, 0x200000, CRC(7038c2f9) SHA1(c1d6f86b24feba03fe009b58199d2eeabe572f4e) ) /* TC5316200 */ + ROM_LOAD( "216-v4.v4", 0x600000, 0x200000, CRC(31b99bd6) SHA1(5871751f8e9e6b98337472c22b5e1c7ede0a9311) ) /* mask rom TC5316200 */ + + NO_DELTAT_REGION + + ROM_REGION( 0x1c00000, "sprites", 0 ) + ROM_LOAD16_BYTE( "059-c1.c1", 0x0000000, 0x200000, CRC(763ba611) SHA1(d3262e0332c894ee149c5963f882cc5e5562ee57) ) /* Plane 0,1 */ /* TC5316200 */ + ROM_LOAD16_BYTE( "059-c2.c2", 0x0000001, 0x200000, CRC(e05e8ca6) SHA1(986a9b16ff92bc101ab567d2d01348e093abea9a) ) /* Plane 2,3 */ /* TC5316200 */ + /* 400000-7fffff empty */ + ROM_LOAD16_BYTE( "216-c3.c3", 0x0800000, 0x400000, CRC(665c9f16) SHA1(7ec781a49a462f395b450460b29493f55134eac2) ) /* Plane 0,1 */ /* mask rom TC5332205 */ + ROM_LOAD16_BYTE( "216-c4.c4", 0x0800001, 0x400000, CRC(7f5d03db) SHA1(365ed266c121f4df0bb76898955a8ae0e668a216) ) /* Plane 2,3 */ /* mask rom TC5332205 */ + ROM_LOAD16_BYTE( "059-c5.c5", 0x1000000, 0x200000, CRC(59013f9e) SHA1(5bf48fcc450da72a8c4685f6e3887e67eae49988) ) /* Plane 0,1 */ /* TC5316200 */ + ROM_LOAD16_BYTE( "059-c6.c6", 0x1000001, 0x200000, CRC(1c8d5def) SHA1(475d89a5c4922a9f6bd756d23c2624d57b6e9d62) ) /* Plane 2,3 */ /* TC5316200 */ + /* 1400000-17fffff empty */ + ROM_LOAD16_BYTE( "059-c7.c7", 0x1800000, 0x200000, CRC(c88f7035) SHA1(c29a428b741f4fe7b71a3bc23c87925b6bc1ca8f) ) /* Plane 0,1 */ /* TC538200 */ + ROM_LOAD16_BYTE( "059-c8.c8", 0x1800001, 0x200000, CRC(484ce3ba) SHA1(4f21ed20ce6e2b67e2b079404599310c94f591ff) ) /* Plane 2,3 */ /* TC538200 */ +ROM_END + + /**************************************** ID-0217 . ADM-012 @@ -5555,11 +5595,8 @@ ROM_START( irrmaze ) /* MVS ONLY RELEASE */ /* special BIOS with trackball support, we only have one Irritating Maze bios and thats asia */ ROM_LOAD16_WORD_SWAP("236-bios.sp1", 0x00000, 0x020000, CRC(853e6b96) SHA1(de369cb4a7df147b55168fa7aaf0b98c753b735e) ) - ROM_REGION( 0x20000, "audiobios", 0 ) - ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) - - ROM_REGION( 0x50000, "audiocpu", 0 ) - ROM_LOAD( "236-m1.m1", 0x00000, 0x20000, CRC(880a1abd) SHA1(905afa157aba700e798243b842792e50729b19a0) ) /* so overwrite it with the real thing */ + ROM_REGION( 0x30000, "audiocpu", 0 ) + ROM_LOAD( "236-m1.m1", 0x00000, 0x20000, CRC(880a1abd) SHA1(905afa157aba700e798243b842792e50729b19a0) ) ROM_RELOAD( 0x10000, 0x20000 ) ROM_REGION( 0x200000, "ymsnd", 0 ) @@ -8466,11 +8503,9 @@ ROM_END ROM_START( kf10thep ) /* this is a hack of kof2002 much like the various korean hacks / bootlegs of games */ ROM_REGION( 0x800000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "5008-p2.bin", 0x100000, 0x400000, CRC(a649ec38) SHA1(5c63ed5e5c848940f587c966da4908d04cf1293c) ) - ROM_LOAD16_WORD_SWAP( "5008-p3.bin", 0x500000, 0x200000, CRC(e629e13c) SHA1(6ebe080ce01c51064cb2f4d89315ba98a45ae727) ) - - ROM_REGION( 0x200000, "audiocrypt", 0 ) - ROM_LOAD( "5008-p1.bin", 0x000000, 0x200000, CRC(bf5469ba) SHA1(f05236d8fffab5836c0d27becdeeb80def32ee49) ) + ROM_LOAD16_WORD_SWAP( "5008-p1.bin", 0x000000, 0x200000, CRC(bf5469ba) SHA1(f05236d8fffab5836c0d27becdeeb80def32ee49) ) + ROM_LOAD16_WORD_SWAP( "5008-p2.bin", 0x200000, 0x400000, CRC(a649ec38) SHA1(5c63ed5e5c848940f587c966da4908d04cf1293c) ) + ROM_LOAD16_WORD_SWAP( "5008-p3.bin", 0x600000, 0x200000, CRC(e629e13c) SHA1(6ebe080ce01c51064cb2f4d89315ba98a45ae727) ) NEO_SFIX_128K( "5008-s1.bin", CRC(92410064) SHA1(1fb800b46341858207d3b6961a760289fbec7faa) ) @@ -8986,27 +9021,14 @@ ROM_END ****************************************************************************/ -static INPUT_PORTS_START( ms5pcb ) +static INPUT_PORTS_START( dualbios ) PORT_INCLUDE( neogeo ) - PORT_MODIFY("SYSTEM") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) - - /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */ - PORT_START("HARDDIP") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3") - PORT_DIPSETTING( 0x00, DEF_STR( Asia ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Japan ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( kf2k3pcb ) - PORT_INCLUDE( neogeo ) - - PORT_MODIFY("SYSTEM") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) + /* the rom banking seems to be tied directly to the dipswitch */ + PORT_MODIFY("P1/DSW") + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Region ) ) PORT_DIPLOCATION("SW:3") PORT_CHANGED_MEMBER(DEVICE_SELF, neogeo_state, select_bios, 0) + PORT_DIPSETTING( 0x0000, DEF_STR( Asia ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Japan ) ) INPUT_PORTS_END @@ -9027,10 +9049,10 @@ static INPUT_PORTS_START( mjneogeo ) PORT_INCLUDE( neogeo ) PORT_MODIFY("P1/DSW") - PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel" ) PORT_DIPLOCATION("SW:3") - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,mahjong_controller_r, NULL) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Controller ) ) PORT_DIPLOCATION("SW:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Mahjong Panel" ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,mahjong_controller_r, NULL) PORT_START("MAHJONG1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) @@ -9077,12 +9099,74 @@ static INPUT_PORTS_START( mjneogeo ) PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( kizuna4p ) + PORT_INCLUDE( neogeo ) + + PORT_MODIFY("P1/DSW") + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Players ) ) PORT_DIPLOCATION("SW:2") + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPSETTING( 0x0000, "4" ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state, kizuna4p_controller_r, (void *)0) + + PORT_MODIFY("P2") + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state, kizuna4p_controller_r, (void *)1) + + PORT_MODIFY("SYSTEM") + PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state, kizuna4p_start_r, NULL) + + /* Fake inputs read by CUSTOM_INPUT handlers */ + PORT_START("IN0-0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) + + PORT_START("IN0-1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) + + PORT_START("IN1-0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) + + PORT_START("IN1-1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) + + PORT_START("START") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) +INPUT_PORTS_END static INPUT_PORTS_START( irrmaze ) PORT_INCLUDE( neogeo ) PORT_MODIFY("P1/DSW") - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) PORT_MODIFY("P2") PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -9094,8 +9178,6 @@ static INPUT_PORTS_START( irrmaze ) PORT_MODIFY("SYSTEM") PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN0-0") PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE @@ -9109,10 +9191,10 @@ static INPUT_PORTS_START( popbounc ) PORT_INCLUDE( neogeo ) PORT_MODIFY("P1/DSW") - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) PORT_MODIFY("P2") - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)1) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)1) /* Fake inputs read by CUSTOM_INPUT handlers */ PORT_START("IN0-0") @@ -9459,7 +9541,8 @@ DRIVER_INIT_MEMBER(neogeo_state,kof10th) DRIVER_INIT_MEMBER(neogeo_state,kf10thep) { DRIVER_INIT_CALL(neogeo); - decrypt_kf10thep(); + kf10thep_px_decrypt(); + neogeo_bootleg_sx_decrypt(1); } DRIVER_INIT_MEMBER(neogeo_state,kf2k5uni) @@ -9513,20 +9596,22 @@ DRIVER_INIT_MEMBER(neogeo_state,mslug5) install_pvc_protection(); } -TIMER_CALLBACK_MEMBER(neogeo_state::ms5pcb_bios_timer_callback) +void neogeo_state::install_banked_bios() { - int harddip3 = ioport("HARDDIP")->read() & 1; - membank(NEOGEO_BANK_BIOS)->set_base(memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000); + m_maincpu->space(AS_PROGRAM).install_read_bank(0xc00000, 0xc1ffff, 0, 0x0e0000, "bankedbios"); + membank("bankedbios")->configure_entries(0, 2, memregion("mainbios")->base(), 0x20000); + membank("bankedbios")->set_entry(1); +} + +INPUT_CHANGED_MEMBER(neogeo_state::select_bios) +{ + membank("bankedbios")->set_entry(newval ? 0 : 1); } DRIVER_INIT_MEMBER(neogeo_state,ms5pcb) { DRIVER_INIT_CALL(neogeo); - /* start a timer that will check the BIOS select DIP every second */ - machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(neogeo_state::ms5pcb_bios_timer_callback),this)); - machine().scheduler().timer_pulse(attotime::from_msec(1000), timer_expired_delegate(FUNC(neogeo_state::ms5pcb_bios_timer_callback),this)); - mslug5_decrypt_68k(); svcpcb_gfx_decrypt(); neogeo_cmc50_m1_decrypt(); @@ -9535,6 +9620,7 @@ DRIVER_INIT_MEMBER(neogeo_state,ms5pcb) svcpcb_s1data_decrypt(); neo_pcm2_swap(2); install_pvc_protection(); + install_banked_bios(); } DRIVER_INIT_MEMBER(neogeo_state,ms5plus) @@ -9548,20 +9634,10 @@ DRIVER_INIT_MEMBER(neogeo_state,ms5plus) install_ms5plus_protection(); } -TIMER_CALLBACK_MEMBER(neogeo_state::svcpcb_bios_timer_callback) -{ - int harddip3 = ioport("HARDDIP")->read() & 1; - membank(NEOGEO_BANK_BIOS)->set_base(memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000); -} - DRIVER_INIT_MEMBER(neogeo_state,svcpcb) { DRIVER_INIT_CALL(neogeo); - /* start a timer that will check the BIOS select DIP every second */ - machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(neogeo_state::svcpcb_bios_timer_callback),this)); - machine().scheduler().timer_pulse(attotime::from_msec(1000), timer_expired_delegate(FUNC(neogeo_state::svcpcb_bios_timer_callback),this)); - svc_px_decrypt(); svcpcb_gfx_decrypt(); neogeo_cmc50_m1_decrypt(); @@ -9570,6 +9646,7 @@ DRIVER_INIT_MEMBER(neogeo_state,svcpcb) neo_pcm2_swap(3); m_fixed_layer_bank_type = 2; install_pvc_protection(); + install_banked_bios(); } DRIVER_INIT_MEMBER(neogeo_state,svc) @@ -9662,7 +9739,7 @@ DRIVER_INIT_MEMBER(neogeo_state,kf2k3pcb) neo_pcm2_swap(5); m_fixed_layer_bank_type = 2; install_pvc_protection(); - m_maincpu->space(AS_PROGRAM).install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios + m_maincpu->space(AS_PROGRAM).install_rom(0xc00000, 0xc7ffff, 0, 0x080000, memregion("mainbios")->base()); // 512k bios } DRIVER_INIT_MEMBER(neogeo_state,kof2003) @@ -9713,7 +9790,7 @@ DRIVER_INIT_MEMBER(neogeo_state,kf2k3upl) neo_pcm2_swap(5); kf2k3upl_px_decrypt(); neogeo_bootleg_sx_decrypt(2); - kf2k3upl_install_protection(); + kf2k3bl_install_protection(); } DRIVER_INIT_MEMBER(neogeo_state,samsh5sp) @@ -9937,7 +10014,7 @@ GAME( 1990, nam1975, neogeo, neogeo, neogeo, neogeo_state, neogeo, RO GAME( 1990, bstars, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Baseball Stars Professional (NGM-002)", GAME_SUPPORTS_SAVE ) GAME( 1990, bstarsh, bstars, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Baseball Stars Professional (NGH-002)", GAME_SUPPORTS_SAVE ) GAME( 1990, tpgolf, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Top Player's Golf (NGM-003)(NGH-003)", GAME_SUPPORTS_SAVE ) -GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo, neogeo_state, neogeo, ROT0, "SNK", "Mahjong Kyo Retsuden (NGM-004)(NGH-004)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mahretsu, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Mahjong Kyo Retsuden (NGM-004)(NGH-004)", GAME_SUPPORTS_SAVE ) // does not support mahjong panel in MVS mode GAME( 1990, ridhero, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Riding Hero (NGM-006)(NGH-006)", GAME_SUPPORTS_SAVE ) GAME( 1990, ridheroh, ridhero, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Riding Hero (set 2)", GAME_SUPPORTS_SAVE ) GAME( 1991, alpham2, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian (NGM-007)(NGH-007)", GAME_SUPPORTS_SAVE ) @@ -10007,6 +10084,7 @@ GAME( 1996, kof96, neogeo, neogeo, neogeo, neogeo_state, neogeo, RO GAME( 1996, kof96h, kof96, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "The King of Fighters '96 (NGH-214)", GAME_SUPPORTS_SAVE ) GAME( 1996, ssideki4, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "The Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero", GAME_SUPPORTS_SAVE ) GAME( 1996, kizuna, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", GAME_SUPPORTS_SAVE ) +GAME( 1996, kizuna4p, kizuna, neogeo, kizuna4p, neogeo_state, neogeo, ROT0, "SNK", "Kizuna Encounter - Super Tag Battle 4 Way Battle Version / Fu'un Super Tag Battle Special Version", GAME_SUPPORTS_SAVE ) GAME( 1996, samsho4, neogeo, neogeo, neogeo, neogeo_state, neogeo, ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin (NGM-222)(NGH-222)", GAME_SUPPORTS_SAVE ) GAME( 1996, samsho4k, samsho4, neogeo, neogeo, neogeo_state, 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_state, neogeo, ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", GAME_SUPPORTS_SAVE ) @@ -10065,10 +10143,10 @@ GAME( 2004, kf2k5uni, kof2002, neogeo, neogeo, neogeo_state, kf2k5uni, RO GAME( 2004, kof2k4se, kof2002, neogeo, neogeo, neogeo_state, 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, neogeo_state, mslug5, ROT0, "SNK Playmore", "Metal Slug 5 (NGM-2680)", GAME_SUPPORTS_SAVE ) GAME( 2003, mslug5h, mslug5, neogeo, neogeo, neogeo_state, mslug5, ROT0, "SNK Playmore", "Metal Slug 5 (NGH-2680)", GAME_SUPPORTS_SAVE ) /* Also found in later MVS carts */ -GAME( 2003, ms5pcb, 0, neogeo, ms5pcb, neogeo_state, ms5pcb, ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", GAME_SUPPORTS_SAVE ) +GAME( 2003, ms5pcb, 0, neogeo, dualbios, neogeo_state, ms5pcb, ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", GAME_SUPPORTS_SAVE ) GAME( 2003, ms5plus, mslug5, neogeo, neogeo, neogeo_state, ms5plus, ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)", GAME_SUPPORTS_SAVE ) -GAME( 2003, svcpcb, 0, neogeo, ms5pcb, neogeo_state, 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, ms5pcb, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code */ +GAME( 2003, svcpcb, 0, neogeo, dualbios, neogeo_state, 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, dualbios, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code */ GAME( 2003, svc, neogeo, neogeo, neogeo, neogeo_state, svc, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (NGM-2690)(NGH-2690)", GAME_SUPPORTS_SAVE ) GAME( 2003, svcboot, svc, neogeo, neogeo, neogeo_state, svcboot, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos (bootleg)", GAME_SUPPORTS_SAVE ) GAME( 2003, svcplus, svc, neogeo, neogeo, neogeo_state, svcplus, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos Plus (bootleg set 1)", GAME_SUPPORTS_SAVE ) @@ -10077,7 +10155,7 @@ GAME( 2003, svcsplus, svc, neogeo, neogeo, neogeo_state, svcsplus, RO GAME( 2003, samsho5, neogeo, neogeo, neogeo, neogeo_state, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (NGM-2700)", GAME_SUPPORTS_SAVE ) GAME( 2003, samsho5h, samsho5, neogeo, neogeo, neogeo_state, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (NGH-2700)", GAME_SUPPORTS_SAVE ) GAME( 2003, samsho5b, samsho5, neogeo, neogeo, neogeo_state, samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", GAME_SUPPORTS_SAVE ) // different program scrambling -GAME( 2003, kf2k3pcb, 0, neogeo, kf2k3pcb, neogeo_state, 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, kf2k3pcb, 0, neogeo, neogeo, neogeo_state, 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, neogeo_state, kof2003, ROT0, "SNK Playmore", "The King of Fighters 2003 (NGM-2710)", GAME_SUPPORTS_SAVE ) GAME( 2003, kof2003h, kof2003, neogeo, neogeo, neogeo_state, kof2003h, ROT0, "SNK Playmore", "The King of Fighters 2003 (NGH-2710)", GAME_SUPPORTS_SAVE ) GAME( 2003, kf2k3bl, kof2003, neogeo, neogeo, neogeo_state, 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?) diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 3f3224c1c96..8355656448e 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -20,17 +20,6 @@ #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_BANK0 "audio_cart0" -#define NEOGEO_BANK_AUDIO_CPU_CART_BANK1 "audio_cart1" -#define NEOGEO_BANK_AUDIO_CPU_CART_BANK2 "audio_cart2" -#define NEOGEO_BANK_AUDIO_CPU_CART_BANK3 "audio_cart3" -/* 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" - class neogeo_state : public driver_device @@ -38,136 +27,36 @@ class neogeo_state : public driver_device public: neogeo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_save_ram(*this, "save_ram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_upd4990a(*this, "upd4990a"), + m_region_maincpu(*this, "maincpu"), m_region_sprites(*this, "sprites"), m_region_fixed(*this, "fixed"), m_region_fixedbios(*this, "fixedbios"), - m_bank_vectors(*this, NEOGEO_BANK_VECTORS), - m_bank_bios(*this, NEOGEO_BANK_BIOS), - m_bank_cartridge(*this, NEOGEO_BANK_CARTRIDGE), - m_bank_audio_main(*this, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK) { - m_has_audio_banking = true; - m_is_mvs = true; - m_is_cartsys = true; - m_has_sprite_bus = true; - m_has_text_bus = true; - m_has_ymrom_bus = true; - m_has_z80_bus = true; - m_bank_audio_cart[0] = NULL; - m_bank_audio_cart[1] = NULL; - m_bank_audio_cart[2] = NULL; - m_bank_audio_cart[3] = NULL; - } - - /* memory pointers */ -// UINT8 *memcard_data; // this currently uses generic handlers - required_shared_ptr<UINT16> m_save_ram; // this currently uses generic handlers - - /* video-related */ - UINT8 *m_sprite_gfx; - UINT32 m_sprite_gfx_address_mask; - UINT16 *m_videoram; - UINT16 *m_palettes[2]; /* 0x100*16 2 byte palette entries */ - pen_t *m_pens; - UINT8 m_palette_bank; - UINT8 m_screen_dark; - UINT16 m_videoram_read_buffer; - UINT16 m_videoram_modulo; - UINT16 m_videoram_offset; - - UINT8 m_fixed_layer_source; - - UINT8 m_auto_animation_speed; - UINT8 m_auto_animation_disabled; - UINT8 m_auto_animation_counter; - UINT8 m_auto_animation_frame_counter; - - const UINT8 *m_region_zoomy; - - - /* palette */ - double m_rgb_weights_normal[5]; - double m_rgb_weights_normal_bit15[5]; - double m_rgb_weights_dark[5]; - double m_rgb_weights_dark_bit15[5]; - - /* timers */ - emu_timer *m_display_position_interrupt_timer; - emu_timer *m_display_position_vblank_timer; - emu_timer *m_vblank_interrupt_timer; - emu_timer *m_auto_animation_timer; - emu_timer *m_sprite_line_timer; - UINT8 m_display_position_interrupt_control; - UINT32 m_display_counter; - UINT32 m_vblank_interrupt_pending; - UINT32 m_display_position_interrupt_pending; - UINT32 m_irq3_pending; - - /* misc */ - UINT8 m_controller_select; - - UINT32 m_main_cpu_bank_address; - UINT8 m_main_cpu_vector_table_source; - - UINT8 m_audio_result; - UINT8 m_audio_cpu_banks[4]; - UINT8 m_audio_cpu_rom_source; - UINT8 m_audio_cpu_rom_source_last; - - UINT8 m_save_ram_unlocked; - - UINT8 m_output_data; - UINT8 m_output_latch; - UINT8 m_el_value; - UINT8 m_led1_value; - UINT8 m_led2_value; - UINT8 m_recurse; - - UINT8 m_vblank_level; - UINT8 m_raster_level; - - /* protection */ - UINT32 m_fatfury2_prot_data; - UINT16 m_neogeo_rng; - UINT16 *m_pvc_cartridge_ram; - int m_fixed_layer_bank_type; - UINT16 m_mslugx_counter; - UINT16 m_mslugx_command; - - /* devices */ - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<upd4990a_old_device> m_upd4990a; + m_bank_vectors(*this, "vectors"), + m_bank_cartridge(*this, "cartridge"), + m_bank_audio_main(*this, "audio_main"), + m_upd4990a(*this, "upd4990a"), + m_save_ram(*this, "saveram") { } - DECLARE_WRITE8_MEMBER(audio_cpu_clear_nmi_w); DECLARE_WRITE16_MEMBER(io_control_w); - DECLARE_WRITE16_MEMBER(save_ram_w); DECLARE_READ16_MEMBER(memcard_r); DECLARE_WRITE16_MEMBER(memcard_w); DECLARE_WRITE16_MEMBER(audio_command_w); DECLARE_READ8_MEMBER(audio_command_r); - DECLARE_WRITE8_MEMBER(audio_result_w); DECLARE_WRITE16_MEMBER(main_cpu_bank_select_w); - DECLARE_READ8_MEMBER(audio_cpu_bank_select_f000_f7ff_r); - DECLARE_READ8_MEMBER(audio_cpu_bank_select_e000_efff_r); - DECLARE_READ8_MEMBER(audio_cpu_bank_select_c000_dfff_r); - DECLARE_READ8_MEMBER(audio_cpu_bank_select_8000_bfff_r); + DECLARE_READ8_MEMBER(audio_cpu_bank_select_r); DECLARE_WRITE16_MEMBER(system_control_w); - DECLARE_WRITE16_MEMBER(watchdog_w); DECLARE_READ16_MEMBER(neogeo_unmapped_r); DECLARE_READ16_MEMBER(neogeo_paletteram_r); DECLARE_WRITE16_MEMBER(neogeo_paletteram_w); DECLARE_READ16_MEMBER(neogeo_video_register_r); DECLARE_WRITE16_MEMBER(neogeo_video_register_w); - DECLARE_CUSTOM_INPUT_MEMBER(multiplexed_controller_r); - DECLARE_CUSTOM_INPUT_MEMBER(mahjong_controller_r); - DECLARE_CUSTOM_INPUT_MEMBER(get_calendar_status); + DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status); DECLARE_CUSTOM_INPUT_MEMBER(get_audio_result); + DECLARE_DRIVER_INIT(neogeo); DECLARE_DRIVER_INIT(fatfury2); DECLARE_DRIVER_INIT(zupapa); @@ -234,75 +123,44 @@ public: DECLARE_DRIVER_INIT(sbp); DECLARE_DRIVER_INIT(mvs); void mvs_install_protection(device_image_interface& image); - virtual void machine_start(); - virtual void machine_reset(); - virtual void video_start(); - virtual void video_reset(); - UINT32 screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void update_interrupts(); - void create_interrupt_timers(); - void start_interrupt_timers(); + TIMER_CALLBACK_MEMBER(display_position_interrupt_callback); TIMER_CALLBACK_MEMBER(display_position_vblank_callback); TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); TIMER_CALLBACK_MEMBER(auto_animation_timer_callback); TIMER_CALLBACK_MEMBER(sprite_line_timer_callback); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(neo_cartridge); - void neogeo_postload(); - void regenerate_pens(); - DECLARE_WRITE_LINE_MEMBER(audio_cpu_irq); - bool m_has_audio_banking; // does the system use Audio Banking (the NeoCD doesn't?) - bool m_is_mvs; // is the system an MVS (watchdog, SRAM etc.) - bool m_is_cartsys; // does the system use Cartridges? (MVS and AES) + // MVS-specific + DECLARE_WRITE16_MEMBER(watchdog_w); + DECLARE_WRITE16_MEMBER(save_ram_w); + DECLARE_CUSTOM_INPUT_MEMBER(get_calendar_status); + DECLARE_CUSTOM_INPUT_MEMBER(mahjong_controller_r); + DECLARE_CUSTOM_INPUT_MEMBER(multiplexed_controller_r); + DECLARE_CUSTOM_INPUT_MEMBER(kizuna4p_controller_r); + DECLARE_CUSTOM_INPUT_MEMBER(kizuna4p_start_r); + DECLARE_INPUT_CHANGED_MEMBER(select_bios); - // the NeoCD can steal the bus during uploads - bool m_has_sprite_bus; - bool m_has_text_bus; - bool m_has_ymrom_bus; - bool m_has_z80_bus; + UINT32 screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void neogeo_set_main_cpu_bank_address( UINT32 bank_address ); - - // protection data - UINT16 kof2003_tbl[4096]; - UINT16 kof10thExtraRAMB[0x01000]; - const UINT8 *type0_t03; - const UINT8 *type0_t12; - const UINT8 *type1_t03; - const UINT8 *type1_t12; - const UINT8 *address_8_15_xor1; - const UINT8 *address_8_15_xor2; - const UINT8 *address_16_23_xor1; - const UINT8 *address_16_23_xor2; - const UINT8 *address_0_7_xor; + // this has to be public for the legacy MEMCARD_HANDLER + UINT8 *m_memcard_data; protected: - required_memory_region m_region_maincpu; - required_memory_region m_region_sprites; - required_memory_region m_region_fixed; - required_memory_region m_region_fixedbios; - required_memory_bank m_bank_vectors; - required_memory_bank m_bank_bios; - optional_memory_bank m_bank_cartridge; // optional because of neocd - optional_memory_bank m_bank_audio_main; // optional because of neocd - memory_bank *m_bank_audio_cart[4]; - + void neogeo_postload(); + void update_interrupts(); + void create_interrupt_timers(); + void start_interrupt_timers(); void neogeo_acknowledge_interrupt(UINT16 data); + void neogeo_set_main_cpu_bank_address( UINT32 bank_address ); void _set_main_cpu_bank_address(); void neogeo_main_cpu_banking_init(); void neogeo_audio_cpu_banking_init(); - void set_audio_cpu_banking(); - void audio_cpu_bank_select( int region, UINT8 bank ); void adjust_display_position_interrupt_timer(); void neogeo_set_display_position_interrupt_control(UINT16 data); void neogeo_set_display_counter_msb(UINT16 data); void neogeo_set_display_counter_lsb(UINT16 data); - void neogeo_set_main_cpu_vector_table_source( UINT8 data ); void set_video_control( UINT16 data ); - void _set_audio_cpu_rom_source(); - void set_audio_cpu_rom_source( UINT8 data ); - void _set_main_cpu_vector_table_source(); void optimize_sprite_data(); void draw_fixed_layer( bitmap_rgb32 &bitmap, int scanline ); void set_videoram_offset( UINT16 data ); @@ -311,6 +169,7 @@ protected: void set_videoram_modulo( UINT16 data); UINT16 get_videoram_modulo( ); void compute_rgb_weights( ); + void regenerate_pens(); pen_t get_pen( UINT16 data ); void neogeo_set_palette_bank( UINT8 data ); void neogeo_set_screen_dark( UINT8 data ); @@ -328,13 +187,13 @@ protected: void start_sprite_line_timer( ); UINT16 get_video_control( ); void audio_cpu_assert_nmi(); + void audio_cpu_clear_nmi(); void select_controller( UINT8 data ); void set_save_ram_unlock( UINT8 data ); void set_outputs( ); void set_output_latch( UINT8 data ); void set_output_data( UINT8 data ); - TIMER_CALLBACK_MEMBER( ms5pcb_bios_timer_callback ); - TIMER_CALLBACK_MEMBER( svcpcb_bios_timer_callback ); + void install_banked_bios(); // protections implementation DECLARE_READ16_MEMBER( sbp_lowerrom_r ); @@ -354,7 +213,7 @@ protected: DECLARE_WRITE16_MEMBER( kof2000_bankswitch_w ); DECLARE_READ16_MEMBER( prot_9a37_r ); DECLARE_READ16_MEMBER( sma_random_r ); - void neogeo_reset_rng(); + void reset_sma_rng(); void sma_install_random_read_handler( int addr1, int addr2 ); void kof99_install_protection(); void garou_install_protection(); @@ -377,7 +236,7 @@ protected: DECLARE_WRITE16_MEMBER( kof10th_bankswitch_w ); void install_kof10th_protection (); void decrypt_kof10th(); - void decrypt_kf10thep(); + void kf10thep_px_decrypt(); void kf2k5uni_px_decrypt(); void kf2k5uni_sx_decrypt(); void kf2k5uni_mx_decrypt(); @@ -416,7 +275,6 @@ protected: void kf2k3pl_px_decrypt(); void kf2k3pl_install_protection(); void kf2k3upl_px_decrypt(); - void kf2k3upl_install_protection(); void samsho5b_px_decrypt(); void samsho5b_vx_decrypt(); void matrimbl_decrypt(); @@ -452,9 +310,114 @@ protected: void neo_pcm2_snk_1999(int value); void neo_pcm2_swap(int value); void kf2k3pcb_sp1_decrypt(); + + // device overrides + virtual void machine_start(); + virtual void machine_reset(); + + // devices + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + + // memory + required_memory_region m_region_maincpu; + required_memory_region m_region_sprites; + required_memory_region m_region_fixed; + optional_memory_region m_region_fixedbios; + required_memory_bank m_bank_vectors; + optional_memory_bank m_bank_cartridge; // optional because of neocd + optional_memory_bank m_bank_audio_main; // optional because of neocd + memory_bank *m_bank_audio_cart[4]; + + // MVS-specific devices + optional_device<upd4990a_old_device> m_upd4990a; + optional_shared_ptr<UINT16> m_save_ram; + + // configuration + enum {NEOGEO_MVS, NEOGEO_AES, NEOGEO_CD} m_type; + + // internal state + UINT32 m_main_cpu_bank_address; + UINT8 m_controller_select; + bool m_recurse; + + // MVS-specific state + UINT8 m_save_ram_unlocked; + UINT8 m_output_data; + UINT8 m_output_latch; + UINT8 m_el_value; + UINT8 m_led1_value; + UINT8 m_led2_value; + + // video hardware, including maincpu interrupts + // TODO: make into a device + virtual void video_start(); + virtual void video_reset(); + + emu_timer *m_display_position_interrupt_timer; + emu_timer *m_display_position_vblank_timer; + emu_timer *m_vblank_interrupt_timer; + emu_timer *m_auto_animation_timer; + emu_timer *m_sprite_line_timer; + UINT32 m_display_counter; + UINT8 m_vblank_interrupt_pending; + UINT8 m_display_position_interrupt_pending; + UINT8 m_irq3_pending; + UINT8 m_display_position_interrupt_control; + UINT8 m_vblank_level; + UINT8 m_raster_level; + + UINT16 *m_videoram; + UINT16 m_vram_offset; + UINT16 m_vram_read_buffer; + UINT16 m_vram_modulo; + + const UINT8 *m_region_zoomy; + + dynamic_array<UINT8> m_sprite_gfx; + UINT32 m_sprite_gfx_address_mask; + + UINT8 m_auto_animation_speed; + UINT8 m_auto_animation_disabled; + UINT8 m_auto_animation_counter; + UINT8 m_auto_animation_frame_counter; + + UINT8 m_fixed_layer_source; + UINT8 m_fixed_layer_bank_type; + + // color/palette related + // TODO: disentangle from the rest of the video emulation + double m_rgb_weights_normal[5]; + double m_rgb_weights_normal_bit15[5]; + double m_rgb_weights_dark[5]; + double m_rgb_weights_dark_bit15[5]; + UINT16 *m_palettes[2]; /* 0x100*16 2 byte palette entries */ + pen_t *m_pens; + UINT8 m_palette_bank; + UINT8 m_screen_dark; + + // cartridge-specific hardware + // TODO: move into separate devices + UINT32 m_fatfury2_prot_data; + UINT16 m_sma_rng; + UINT16 m_mslugx_counter; + UINT16 m_mslugx_command; + + const UINT8 *type0_t03; + const UINT8 *type0_t12; + const UINT8 *type1_t03; + const UINT8 *type1_t12; + const UINT8 *address_8_15_xor1; + const UINT8 *address_8_15_xor2; + const UINT8 *address_16_23_xor1; + const UINT8 *address_16_23_xor2; + const UINT8 *address_0_7_xor; + + UINT16 m_cartridge_ram[0x1000]; }; /*----------- defined in drivers/neogeo.c -----------*/ MACHINE_CONFIG_EXTERN( neogeo_base ); +MEMCARD_HANDLER( neogeo ); diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c index a92b8b8d8fa..fa09f88f6d5 100644 --- a/src/mame/machine/neoboot.c +++ b/src/mame/machine/neoboot.c @@ -1,9 +1,9 @@ /*************************************************************************** - Neo-Geo hardware + Neo-Geo hardware encryption and protection used on bootleg cartridges Many of the NeoGeo bootlegs use their own form of encryption and - protection, presumably to make them harder for other bootleggser to + protection, presumably to make them harder for other bootleggers to copy. This encryption often involves non-trivial scrambling of the program roms and the games are protected using an Altera chip which provides some kind of rom overlay, patching parts of the code. @@ -165,12 +165,12 @@ void neogeo_state::kof10thBankswitch(address_space &space, UINT16 nBank) READ16_MEMBER( neogeo_state::kof10th_RAMB_r ) { - return kof10thExtraRAMB[offset]; + return m_cartridge_ram[offset]; } WRITE16_MEMBER( neogeo_state::kof10th_custom_w ) { - if (!kof10thExtraRAMB[0xFFE]) { // Write to RAM bank A + if (!m_cartridge_ram[0xFFE]) { // Write to RAM bank A UINT16 *prom = (UINT16*)memregion( "maincpu" )->base(); COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]); } else { // Write S data on-the-fly @@ -184,16 +184,18 @@ WRITE16_MEMBER( neogeo_state::kof10th_bankswitch_w ) if (offset >= 0x5F000) { if (offset == 0x5FFF8) { // Standard bankswitch kof10thBankswitch(space, data); - } else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch + } else if (offset == 0x5FFFC && m_cartridge_ram[0xFFC] != data) { // Special bankswitch UINT8 *src = memregion( "maincpu" )->base(); memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff); } - COMBINE_DATA(&kof10thExtraRAMB[offset & 0xFFF]); + COMBINE_DATA(&m_cartridge_ram[offset & 0xFFF]); } } void neogeo_state::install_kof10th_protection () { + save_item(NAME(m_cartridge_ram)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x2fe000, 0x2fffff, read16_delegate(FUNC(neogeo_state::kof10th_RAMB_r),this)); m_maincpu->space(AS_PROGRAM).install_write_handler(0x200000, 0x23ffff, write16_delegate(FUNC(neogeo_state::kof10th_custom_w),this)); m_maincpu->space(AS_PROGRAM).install_write_handler(0x240000, 0x2fffff, write16_delegate(FUNC(neogeo_state::kof10th_bankswitch_w),this)); @@ -228,41 +230,32 @@ void neogeo_state::decrypt_kof10th() /* The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg) */ -void neogeo_state::decrypt_kf10thep() +void neogeo_state::kf10thep_px_decrypt() { - int i; UINT16 *rom = (UINT16*)memregion("maincpu")->base(); - UINT8 *src = memregion("maincpu")->base(); - UINT16 *buf = (UINT16*)memregion("audiocrypt")->base(); - UINT8 *srom = (UINT8*)memregion("fixed")->base(); - UINT8 *sbuf = auto_alloc_array(machine(), UINT8, 0x20000); - - UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x200000); - - memcpy(dst,buf,0x200000); - memcpy(src+0x000000,dst+0x060000,0x20000); - memcpy(src+0x020000,dst+0x100000,0x20000); - memcpy(src+0x040000,dst+0x0e0000,0x20000); - memcpy(src+0x060000,dst+0x180000,0x20000); - memcpy(src+0x080000,dst+0x020000,0x20000); - memcpy(src+0x0a0000,dst+0x140000,0x20000); - memcpy(src+0x0c0000,dst+0x0c0000,0x20000); - memcpy(src+0x0e0000,dst+0x1a0000,0x20000); - memcpy(src+0x0002e0,dst+0x0402e0,0x6a); // copy banked code to a new memory region - memcpy(src+0x0f92bc,dst+0x0492bc,0xb9e); // copy banked code to a new memory region - for (i=0xf92bc/2;i < 0xf9e58/2 ;i++) + UINT16 *buf = auto_alloc_array(machine(), UINT16, 0x100000/2); + + memcpy(&buf[0x000000/2], &rom[0x060000/2], 0x20000); + memcpy(&buf[0x020000/2], &rom[0x100000/2], 0x20000); + memcpy(&buf[0x040000/2], &rom[0x0e0000/2], 0x20000); + memcpy(&buf[0x060000/2], &rom[0x180000/2], 0x20000); + memcpy(&buf[0x080000/2], &rom[0x020000/2], 0x20000); + memcpy(&buf[0x0a0000/2], &rom[0x140000/2], 0x20000); + memcpy(&buf[0x0c0000/2], &rom[0x0c0000/2], 0x20000); + memcpy(&buf[0x0e0000/2], &rom[0x1a0000/2], 0x20000); + memcpy(&buf[0x0002e0/2], &rom[0x0402e0/2], 0x6a); // copy banked code to a new memory region + memcpy(&buf[0x0f92bc/2], &rom[0x0492bc/2], 0xb9e); // copy banked code to a new memory region + memcpy(rom, buf, 0x100000); + auto_free(machine(), buf); + + for (int i = 0xf92bc/2; i < 0xf9e58/2; i++) { if (rom[i+0] == 0x4eb9 && rom[i+1] == 0x0000) rom[i+1] = 0x000F; // correct JSR in moved code if (rom[i+0] == 0x4ef9 && rom[i+1] == 0x0000) rom[i+1] = 0x000F; // correct JMP in moved code } rom[0x00342/2] = 0x000f; - auto_free(machine(), dst); - for (i=0;i<0x20000;i++) - sbuf[i]=srom[i^0x8]; - - memcpy(srom,sbuf,0x20000); - auto_free(machine(), sbuf); + memmove(&rom[0x100000/2], &rom[0x200000/2], 0x600000); } @@ -321,7 +314,7 @@ void neogeo_state::decrypt_kf2k5uni() void neogeo_state::kof2002b_gfx_decrypt(UINT8 *src, int size) { int i, j; - int t[ 8 ][ 10 ] = + static const UINT8 t[ 8 ][ 6 ] = { { 0, 8, 7, 6, 2, 1 }, { 1, 0, 8, 7, 6, 2 }, @@ -836,15 +829,8 @@ void neogeo_state::svcplus_px_decrypt() void neogeo_state::svcplus_px_hack() { /* patched by the protection chip? */ - UINT8 *src = memregion( "maincpu" )->base(); - src[ 0x0f8010 ] = 0x40; - src[ 0x0f8011 ] = 0x04; - src[ 0x0f8012 ] = 0x00; - src[ 0x0f8013 ] = 0x10; - src[ 0x0f8014 ] = 0x40; - src[ 0x0f8015 ] = 0x46; - src[ 0x0f8016 ] = 0xc1; - src[ 0x0f802c ] = 0x16; + UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + mem16[0x0f8016/2] = 0x33c1; } @@ -926,14 +912,14 @@ WRITE16_MEMBER( neogeo_state::mv0_bankswitch_w ) READ16_MEMBER( neogeo_state::kof2003_r) { - return kof2003_tbl[offset]; + return m_cartridge_ram[offset]; } WRITE16_MEMBER( neogeo_state::kof2003_w ) { - data = COMBINE_DATA(&kof2003_tbl[offset]); + data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)kof2003_tbl; + UINT8* cr = (UINT8 *)m_cartridge_ram; UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)]; UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; UINT8* mem = (UINT8 *)memregion("maincpu")->base(); @@ -949,9 +935,9 @@ WRITE16_MEMBER( neogeo_state::kof2003_w ) WRITE16_MEMBER( neogeo_state::kof2003p_w ) { - data = COMBINE_DATA(&kof2003_tbl[offset]); + data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)kof2003_tbl; + UINT8* cr = (UINT8 *)m_cartridge_ram; UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)]; UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; UINT8* mem = (UINT8 *)memregion("maincpu")->base(); @@ -984,6 +970,8 @@ void neogeo_state::kf2k3bl_px_decrypt() void neogeo_state::kf2k3bl_install_protection() { + save_item(NAME(m_cartridge_ram)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fe000, 0x2fffff, read16_delegate(FUNC(neogeo_state::kof2003_r),this), write16_delegate(FUNC(neogeo_state::kof2003_w),this) ); } @@ -1012,6 +1000,8 @@ void neogeo_state::kf2k3pl_px_decrypt() void neogeo_state::kf2k3pl_install_protection() { + save_item(NAME(m_cartridge_ram)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fe000, 0x2fffff, read16_delegate(FUNC(neogeo_state::kof2003_r),this), write16_delegate(FUNC(neogeo_state::kof2003p_w),this) ); } @@ -1040,11 +1030,6 @@ void neogeo_state::kf2k3upl_px_decrypt() } } -void neogeo_state::kf2k3upl_install_protection() -{ - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fe000, 0x2fffff, read16_delegate(FUNC(neogeo_state::kof2003_r),this), write16_delegate(FUNC(neogeo_state::kof2003_w),this) ); -} - /* Samurai Shodown V / Samurai Spirits Zero (bootleg) */ diff --git a/src/mame/machine/neocrypt.c b/src/mame/machine/neocrypt.c index 89357edab52..6ab24123c6b 100644 --- a/src/mame/machine/neocrypt.c +++ b/src/mame/machine/neocrypt.c @@ -1,14 +1,6 @@ /*************************************************************************** - Neo-Geo hardware - - Many of the NeoGeo bootlegs use their own form of encryption and - protection, presumably to make them harder for other bootleggser to - copy. This encryption often involves non-trivial scrambling of the - program roms and the games are protected using an Altera chip which - provides some kind of rom overlay, patching parts of the code. - The graphics roms are usually scrambled in a different way to the - official SNK cartridges too. + Neo-Geo hardware encryption devices NeoGeo 'C' (Graphics) Rom encryption CMC42 and CMC50 protection chips diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c index 36a5a94c1d6..e914dd2366e 100644 --- a/src/mame/machine/neoprot.c +++ b/src/mame/machine/neoprot.c @@ -405,32 +405,32 @@ READ16_MEMBER( neogeo_state::prot_9a37_r ) READ16_MEMBER( neogeo_state::sma_random_r ) { - UINT16 old = m_neogeo_rng; + UINT16 old = m_sma_rng; - UINT16 newbit = ((m_neogeo_rng >> 2) ^ - (m_neogeo_rng >> 3) ^ - (m_neogeo_rng >> 5) ^ - (m_neogeo_rng >> 6) ^ - (m_neogeo_rng >> 7) ^ - (m_neogeo_rng >>11) ^ - (m_neogeo_rng >>12) ^ - (m_neogeo_rng >>15)) & 1; + UINT16 newbit = ((m_sma_rng >> 2) ^ + (m_sma_rng >> 3) ^ + (m_sma_rng >> 5) ^ + (m_sma_rng >> 6) ^ + (m_sma_rng >> 7) ^ + (m_sma_rng >>11) ^ + (m_sma_rng >>12) ^ + (m_sma_rng >>15)) & 1; - m_neogeo_rng = (m_neogeo_rng << 1) | newbit; + m_sma_rng = (m_sma_rng << 1) | newbit; return old; } -void neogeo_state::neogeo_reset_rng() +void neogeo_state::reset_sma_rng() { - m_neogeo_rng = 0x2345; + m_sma_rng = 0x2345; } void neogeo_state::sma_install_random_read_handler(int addr1, int addr2 ) { - save_item(NAME(m_neogeo_rng)); + save_item(NAME(m_sma_rng)); m_maincpu->space(AS_PROGRAM).install_read_handler(addr1, addr1 + 1, read16_delegate(FUNC(neogeo_state::sma_random_r),this)); m_maincpu->space(AS_PROGRAM).install_read_handler(addr2, addr2 + 1, read16_delegate(FUNC(neogeo_state::sma_random_r),this)); @@ -489,24 +489,24 @@ void neogeo_state::kof2000_install_protection() void neogeo_state::pvc_write_unpack_color() { - UINT16 pen = m_pvc_cartridge_ram[0xff0]; + UINT16 pen = m_cartridge_ram[0xff0]; UINT8 b = ((pen & 0x000f) << 1) | ((pen & 0x1000) >> 12); UINT8 g = ((pen & 0x00f0) >> 3) | ((pen & 0x2000) >> 13); UINT8 r = ((pen & 0x0f00) >> 7) | ((pen & 0x4000) >> 14); UINT8 s = (pen & 0x8000) >> 15; - m_pvc_cartridge_ram[0xff1] = (g << 8) | b; - m_pvc_cartridge_ram[0xff2] = (s << 8) | r; + m_cartridge_ram[0xff1] = (g << 8) | b; + m_cartridge_ram[0xff2] = (s << 8) | r; } void neogeo_state::pvc_write_pack_color() { - UINT16 gb = m_pvc_cartridge_ram[0xff4]; - UINT16 sr = m_pvc_cartridge_ram[0xff5]; + UINT16 gb = m_cartridge_ram[0xff4]; + UINT16 sr = m_cartridge_ram[0xff5]; - m_pvc_cartridge_ram[0xff6] = ((gb & 0x001e) >> 1) | + m_cartridge_ram[0xff6] = ((gb & 0x001e) >> 1) | ((gb & 0x1e00) >> 5) | ((sr & 0x001e) << 7) | ((gb & 0x0001) << 12) | @@ -520,22 +520,22 @@ void neogeo_state::pvc_write_bankswitch( address_space &space ) { UINT32 bankaddress; - bankaddress = ((m_pvc_cartridge_ram[0xff8] >> 8)|(m_pvc_cartridge_ram[0xff9] << 8)); - m_pvc_cartridge_ram[0xff8] = (m_pvc_cartridge_ram[0xff8] & 0xfe00) | 0x00a0; - m_pvc_cartridge_ram[0xff9] &= 0x7fff; + bankaddress = ((m_cartridge_ram[0xff8] >> 8)|(m_cartridge_ram[0xff9] << 8)); + m_cartridge_ram[0xff8] = (m_cartridge_ram[0xff8] & 0xfe00) | 0x00a0; + m_cartridge_ram[0xff9] &= 0x7fff; neogeo_set_main_cpu_bank_address(bankaddress + 0x100000); } READ16_MEMBER( neogeo_state::pvc_prot_r ) { - return m_pvc_cartridge_ram[offset]; + return m_cartridge_ram[offset]; } WRITE16_MEMBER( neogeo_state::pvc_prot_w ) { - COMBINE_DATA(&m_pvc_cartridge_ram[offset] ); + COMBINE_DATA(&m_cartridge_ram[offset] ); if (offset == 0xff0) pvc_write_unpack_color(); else if(offset >= 0xff4 && offset <= 0xff5) @@ -547,8 +547,7 @@ WRITE16_MEMBER( neogeo_state::pvc_prot_w ) void neogeo_state::install_pvc_protection() { - m_pvc_cartridge_ram = auto_alloc_array(machine(), UINT16, 0x2000 / 2); - save_pointer(NAME(m_pvc_cartridge_ram), 0x2000 / 2); + save_item(NAME(m_cartridge_ram)); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fe000, 0x2fffff, read16_delegate(FUNC(neogeo_state::pvc_prot_r),this), write16_delegate(FUNC(neogeo_state::pvc_prot_w),this)); } diff --git a/src/mame/mame.lst b/src/mame/mame.lst index afc0d44706e..7eacb5a6a9c 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -7338,7 +7338,7 @@ kof96 // 0214 (c) 1996 SNK kof96h // 0214 (c) 1996 SNK ssideki4 // 0215 (c) 1996 SNK kizuna // 0216 (c) 1996 SNK - // Fu-un Super Tag Battle Special Version (4-player battle available) exists +kizuna4p // 0216 (c) 1996 SNK - same cartridge as kizuna, needs extension board and a compatible MVS to enable 4p mode ninjamas // 0217 (c) 1996 ADK / SNK ragnagrd // 0218 (c) 1996 Saurus pgoal // 0219 (c) 1996 Saurus diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index 48254a5be53..4f0a3f4066e 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -20,40 +20,37 @@ void neogeo_state::set_videoram_offset( UINT16 data ) { - m_videoram_offset = data; + m_vram_offset = (data & 0x8000 ? data & 0x87ff : data); /* the read happens right away */ - m_videoram_read_buffer = m_videoram[m_videoram_offset]; + m_vram_read_buffer = m_videoram[m_vram_offset]; } UINT16 neogeo_state::get_videoram_data( ) { - return m_videoram_read_buffer; + return m_vram_read_buffer; } void neogeo_state::set_videoram_data( UINT16 data) { - m_videoram[m_videoram_offset] = data; + m_videoram[m_vram_offset] = data; - /* auto increment/decrement the current offset - A15 is NOT effected */ - m_videoram_offset = (m_videoram_offset & 0x8000) | ((m_videoram_offset + m_videoram_modulo) & 0x7fff); - - /* read next value right away */ - m_videoram_read_buffer = m_videoram[m_videoram_offset]; + /* auto increment/decrement the current offset - A15 is NOT affected */ + set_videoram_offset((m_vram_offset & 0x8000) | ((m_vram_offset + m_vram_modulo) & 0x7fff)); } void neogeo_state::set_videoram_modulo( UINT16 data) { - m_videoram_modulo = data; + m_vram_modulo = data; } UINT16 neogeo_state::get_videoram_modulo( ) { - return m_videoram_modulo; + return m_vram_modulo; } @@ -674,13 +671,8 @@ void neogeo_state::optimize_sprite_data() mask >>= 1; } - if (mask > m_sprite_gfx_address_mask) - { - if (m_sprite_gfx != NULL) - auto_free(machine(), m_sprite_gfx); - m_sprite_gfx = auto_alloc_array_clear(machine(), UINT8, mask + 1); - m_sprite_gfx_address_mask = mask; - } + m_sprite_gfx.resize(mask + 1); + m_sprite_gfx_address_mask = mask; src = m_region_sprites->base(); dest = m_sprite_gfx; @@ -828,26 +820,25 @@ void neogeo_state::video_start() m_palettes[0] = auto_alloc_array(machine(), UINT16, NUM_PENS); m_palettes[1] = auto_alloc_array(machine(), UINT16, NUM_PENS); m_pens = auto_alloc_array(machine(), pen_t, NUM_PENS); - m_videoram = auto_alloc_array(machine(), UINT16, 0x20000/2); + m_videoram = auto_alloc_array(machine(), UINT16, 0x8000 + 0x800); /* clear allocated memory */ memset(m_palettes[0], 0x00, NUM_PENS * sizeof(UINT16)); memset(m_palettes[1], 0x00, NUM_PENS * sizeof(UINT16)); memset(m_pens, 0x00, NUM_PENS * sizeof(pen_t)); - memset(m_videoram, 0x00, 0x20000); + memset(m_videoram, 0x00, (0x8000 + 0x800) * 2); compute_rgb_weights(); create_sprite_line_timer(); create_auto_animation_timer(); - m_sprite_gfx = NULL; m_sprite_gfx_address_mask = 0; optimize_sprite_data(); /* initialize values that are not modified on a reset */ - m_videoram_read_buffer = 0; - m_videoram_offset = 0; - m_videoram_modulo = 0; + m_vram_offset = 0; + m_vram_read_buffer = 0; + m_vram_modulo = 0; m_auto_animation_speed = 0; m_auto_animation_disabled = 0; m_auto_animation_counter = 0; @@ -857,9 +848,9 @@ void neogeo_state::video_start() save_pointer(NAME(m_palettes[0]), NUM_PENS); save_pointer(NAME(m_palettes[1]), NUM_PENS); save_pointer(NAME(m_videoram), 0x20000/2); - save_item(NAME(m_videoram_read_buffer)); - save_item(NAME(m_videoram_modulo)); - save_item(NAME(m_videoram_offset)); + save_item(NAME(m_vram_offset)); + save_item(NAME(m_vram_read_buffer)); + save_item(NAME(m_vram_modulo)); save_item(NAME(m_fixed_layer_source)); save_item(NAME(m_screen_dark)); save_item(NAME(m_palette_bank)); @@ -897,12 +888,12 @@ void neogeo_state::video_reset() UINT32 neogeo_state::screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - /* fill with background color first */ + // fill with background color first bitmap.fill(m_pens[0x0fff], cliprect); - if (m_has_sprite_bus) draw_sprites(bitmap, cliprect.min_y); + draw_sprites(bitmap, cliprect.min_y); - if (m_has_text_bus) draw_fixed_layer(bitmap, cliprect.min_y); + draw_fixed_layer(bitmap, cliprect.min_y); return 0; } diff --git a/src/mess/drivers/ng_aes.c b/src/mess/drivers/ng_aes.c index 9f69baef4c4..4f76ea53cdb 100644 --- a/src/mess/drivers/ng_aes.c +++ b/src/mess/drivers/ng_aes.c @@ -21,11 +21,9 @@ Current status: - Cartridges run. - - Riding Hero runs in slow-mo (probably related to comms HW / IO port handling) - - ToDo : - - Change input code to allow selection of the mahjong panel in PORT_CATEGORY. - - Clean up code, to reduce duplication of MAME source + - Riding Hero runs in slow-mo due to the unemulated comm link MCU in the cartridge. + In MAME if dip SW6 is set to ON to enable link play, it runs the same way! + On AES there are no dipswitches, and so it always tries to talk to the MCU. Neo-Geo CD hardware @@ -52,7 +50,7 @@ #include "emu.h" #include "cpu/m68000/m68000.h" #include "includes/neogeo.h" -#include "machine/pd4990a.h" +#include "machine/nvram.h" #include "cpu/z80/z80.h" #include "sound/2610intf.h" #include "imagedev/cartslot.h" @@ -84,8 +82,6 @@ UINT8* NeoZ80ROMActive; UINT8 NeoSystem = NEOCD_REGION_JAPAN; -INT32 nNeoCDZ80ProgWriteWordCancelHack = 0; - @@ -101,8 +97,6 @@ public: : neogeo_state(mconfig, type, tag) , m_tempcdc(*this,"tempcdc") , m_io_in2(*this, "IN2") - , m_io_in3(*this, "IN3") - , m_io_in4(*this, "IN4") , m_io_in0(*this, "IN0") , m_io_in1(*this, "IN1") , m_io_mj01_p1(*this, "MJ01_P1") @@ -124,7 +118,10 @@ public: nIRQAcknowledge = ~0; nNeoCDIRQVectorAck = 0; nNeoCDIRQVector = 0; - + m_has_sprite_bus = true; + m_has_text_bus = true; + m_has_ymrom_bus = true; + m_has_z80_bus = true; } optional_device<lc89510_temp_device> m_tempcdc; @@ -134,10 +131,6 @@ public: void NeoCDDoDMA(address_space& curr_space); void set_DMA_regs(int offset, UINT16 wordValue); - UINT8 *m_memcard_data; - DECLARE_WRITE16_MEMBER(save_ram_w); - DECLARE_READ16_MEMBER(memcard_r); - DECLARE_WRITE16_MEMBER(memcard_w); DECLARE_READ16_MEMBER(neocd_memcard_r); DECLARE_WRITE16_MEMBER(neocd_memcard_w); DECLARE_READ16_MEMBER(neocd_control_r); @@ -153,8 +146,6 @@ public: DECLARE_MACHINE_RESET(neogeo); DECLARE_MACHINE_RESET(neocd); - DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status); - // neoCD UINT8 neogeoReadTransfer(UINT32 sekAddress, int is_byte_transfer); @@ -173,6 +164,11 @@ public: int nNeoCDIRQVectorAck; int nNeoCDIRQVector; + bool m_has_sprite_bus; + bool m_has_text_bus; + bool m_has_ymrom_bus; + bool m_has_z80_bus; + int get_nNeoCDIRQVectorAck(void) { return nNeoCDIRQVectorAck; } void set_nNeoCDIRQVectorAck(int val) { nNeoCDIRQVectorAck = val; } int get_nNeoCDIRQVector(void) { return nNeoCDIRQVector; } @@ -187,6 +183,8 @@ public: bool prohibit_cdc_irq; // hack? + UINT32 screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_DRIVER_INIT(neogeo); DECLARE_DRIVER_INIT(neocdz); @@ -196,8 +194,6 @@ public: protected: required_ioport m_io_in2; - required_ioport m_io_in3; - required_ioport m_io_in4; required_ioport m_io_in0; required_ioport m_io_in1; required_ioport m_io_mj01_p1; @@ -215,26 +211,6 @@ protected: }; -/************************************* - * - * Global variables - * - *************************************/ - -//static UINT16 *save_ram; - -//UINT16* neocd_work_ram; - -/************************************* - * - * Forward declarations - * - *************************************/ - -//static void set_output_latch(running_machine &machine, UINT8 data); -//static void set_output_data(running_machine &machine, UINT8 data); - - @@ -247,37 +223,6 @@ protected: #define MEMCARD_SIZE 0x0800 -CUSTOM_INPUT_MEMBER(ng_aes_state::get_memcard_status) -{ - /* D0 and D1 are memcard presence indicators, D2 indicates memcard - write protect status (we are always write enabled) */ - if(strcmp((char*)machine().system().name,"aes") != 0) - return 0x00; // On the Neo Geo CD, the memory card is internal and therefore always present. - else - return (memcard_present(machine()) == -1) ? 0x07 : 0x00; -} - -READ16_MEMBER(ng_aes_state::memcard_r) -{ - UINT16 ret; - - if (memcard_present(machine()) != -1) - ret = m_memcard_data[offset] | 0xff00; - else - ret = 0xffff; - - return ret; -} - - -WRITE16_MEMBER(ng_aes_state::memcard_w) -{ - if (ACCESSING_BITS_0_7) - { - if (memcard_present(machine()) != -1) - m_memcard_data[offset] = data; - } -} /* The NeoCD has an 8kB internal memory card, instead of memcard slots like the MVS and AES */ READ16_MEMBER(ng_aes_state::neocd_memcard_r) @@ -294,26 +239,6 @@ WRITE16_MEMBER(ng_aes_state::neocd_memcard_w) } } -static MEMCARD_HANDLER( neogeo_aes ) -{ - ng_aes_state *state = machine.driver_data<ng_aes_state>(); - switch (action) - { - case MEMCARD_CREATE: - memset(state->m_memcard_data, 0, MEMCARD_SIZE); - file.write(state->m_memcard_data, MEMCARD_SIZE); - break; - - case MEMCARD_INSERT: - file.read(state->m_memcard_data, MEMCARD_SIZE); - break; - - case MEMCARD_EJECT: - file.write(state->m_memcard_data, MEMCARD_SIZE); - break; - } -} - @@ -327,11 +252,6 @@ static MEMCARD_HANDLER( neogeo_aes ) - - - - - READ16_MEMBER(ng_aes_state::neocd_control_r) { UINT32 sekAddress = 0xff0000+ (offset*2); @@ -489,9 +409,7 @@ WRITE16_MEMBER(ng_aes_state::neocd_control_w) // writes 00 / 01 / ff printf("MapVectorTable? %04x %04x\n",data,mem_mask); - if (!data) neogeo_set_main_cpu_vector_table_source(0); // bios vectors - else neogeo_set_main_cpu_vector_table_source(1); // ram (aka cart) vectors - + m_bank_vectors->set_entry(data == 0 ? 0 : 1); } //extern INT32 bRunPause; @@ -687,8 +605,6 @@ void ng_aes_state::set_DMA_regs(int offset, UINT16 wordValue) - - INT32 ng_aes_state::SekIdle(INT32 nCycles) { return nCycles; @@ -1072,9 +988,6 @@ READ16_MEMBER(ng_aes_state::aes_in2_r) void ng_aes_state::common_machine_start() { - /* set the BIOS bank */ - m_bank_bios->set_base(memregion("mainbios")->base()); - /* set the initial main CPU bank */ neogeo_main_cpu_banking_init(); @@ -1096,41 +1009,26 @@ void ng_aes_state::common_machine_start() save_item(NAME(m_vblank_interrupt_pending)); save_item(NAME(m_display_position_interrupt_pending)); save_item(NAME(m_irq3_pending)); - save_item(NAME(m_audio_result)); save_item(NAME(m_controller_select)); save_item(NAME(m_main_cpu_bank_address)); - save_item(NAME(m_main_cpu_vector_table_source)); - save_item(NAME(m_audio_cpu_banks)); - save_item(NAME(m_audio_cpu_rom_source)); - save_item(NAME(m_audio_cpu_rom_source_last)); - save_item(NAME(m_save_ram_unlocked)); - save_item(NAME(m_output_data)); - save_item(NAME(m_output_latch)); - save_item(NAME(m_el_value)); - save_item(NAME(m_led1_value)); - save_item(NAME(m_led2_value)); - save_item(NAME(m_recurse)); - - machine().save().register_postload(save_prepost_delegate(FUNC(neogeo_state::neogeo_postload), this)); + + machine().save().register_postload(save_prepost_delegate(FUNC(ng_aes_state::neogeo_postload), this)); } MACHINE_START_MEMBER(ng_aes_state,neogeo) { + m_type = NEOGEO_AES; common_machine_start(); - m_is_mvs = false; /* initialize the memcard data structure */ m_memcard_data = auto_alloc_array_clear(machine(), UINT8, MEMCARD_SIZE); - save_pointer(NAME(m_memcard_data), 0x0800); + save_pointer(NAME(m_memcard_data), 0x800); } MACHINE_START_MEMBER(ng_aes_state,neocd) { - m_has_audio_banking = false; - m_is_cartsys = false; - + m_type = NEOGEO_CD; common_machine_start(); - m_is_mvs = false; /* irq levels for NEOCD (swapped compared to MVS / AES) */ m_vblank_level = 2; @@ -1140,25 +1038,18 @@ MACHINE_START_MEMBER(ng_aes_state,neocd) /* initialize the memcard data structure */ /* NeoCD doesn't have memcard slots, rather, it has a larger internal memory which works the same */ m_memcard_data = auto_alloc_array_clear(machine(), UINT8, 0x2000); + machine().device<nvram_device>("saveram")->set_base(m_memcard_data, 0x2000); save_pointer(NAME(m_memcard_data), 0x2000); // for custom vectors m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ng_aes_state::neocd_int_callback),this)); - neogeo_set_main_cpu_vector_table_source(0); // default to the BIOS vectors + m_bank_vectors->set_entry(0); // default to the BIOS vectors m_tempcdc->reset_cd(); } -//static DEVICE_IMAGE_LOAD(aes_cart) -//{ -// else -// return IMAGE_INIT_FAIL; - -// return IMAGE_INIT_PASS; -//} - /************************************* * * Machine reset @@ -1176,16 +1067,17 @@ MACHINE_RESET_MEMBER(ng_aes_state,neogeo) m_maincpu->reset(); - neogeo_reset_rng(); + // FIXME: this doesn't belong in the base system + reset_sma_rng(); start_interrupt_timers(); /* trigger the IRQ3 that was set by MACHINE_START */ update_interrupts(); - m_recurse = 0; + m_recurse = false; - /* AES apparently always uses the cartridge's fixed bank mode */ + /* AES has no SFIX ROM and always uses the cartridge's */ neogeo_set_fixed_layer_source(1); NeoSpriteRAM = memregion("sprites")->base(); @@ -1214,16 +1106,14 @@ MACHINE_RESET_MEMBER(ng_aes_state,neocd) *************************************/ static ADDRESS_MAP_START( aes_main_map, AS_PROGRAM, 16, ng_aes_state ) - AM_RANGE(0x000000, 0x00007f) AM_ROMBANK(NEOGEO_BANK_VECTORS) + AM_RANGE(0x000000, 0x00007f) AM_ROMBANK("vectors") AM_RANGE(0x000080, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x0f0000) AM_RAM /* some games have protection devices in the 0x200000 region, it appears to map to cart space, not surprising, the ROM is read here too */ - AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK(NEOGEO_BANK_CARTRIDGE) + AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK("cartridge") AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ(aes_in0_r) - AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN4") - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_WRITENOP // AES has no watchdog - AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN3") AM_WRITE(audio_command_w) + AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_READ(aes_in0_r) + AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("AUDIO") AM_WRITE(audio_command_w) AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ(aes_in1_r) AM_RANGE(0x360000, 0x37ffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ(aes_in2_r) @@ -1234,22 +1124,19 @@ static ADDRESS_MAP_START( aes_main_map, AS_PROGRAM, 16, ng_aes_state ) AM_RANGE(0x3e0000, 0x3fffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w) AM_RANGE(0x800000, 0x800fff) AM_READWRITE(memcard_r, memcard_w) - AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROMBANK(NEOGEO_BANK_BIOS) - AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) AM_SHARE("save_ram") //AM_RAM_WRITE(save_ram_w) - AM_RANGE(0xe00000, 0xffffff) AM_READ(neogeo_unmapped_r) + AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROM AM_REGION("mainbios", 0) + AM_RANGE(0xd00000, 0xffffff) AM_READ(neogeo_unmapped_r) ADDRESS_MAP_END static ADDRESS_MAP_START( neocd_main_map, AS_PROGRAM, 16, ng_aes_state ) - AM_RANGE(0x000000, 0x00007f) AM_READ_BANK(NEOGEO_BANK_VECTORS) // writes will fall through to area below + AM_RANGE(0x000000, 0x00007f) AM_READ_BANK("vectors") // writes will fall through to area below AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_REGION("maincpu", 0x00000) - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ(aes_in0_r) - AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN4") - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_READ(neogeo_unmapped_r) AM_WRITENOP // AES has no watchdog - AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN3") AM_WRITE(audio_command_w) + AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_READ(aes_in0_r) + AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("AUDIO") AM_WRITE(audio_command_w) AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ(aes_in1_r) AM_RANGE(0x360000, 0x37ffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ(aes_in2_r) @@ -1260,8 +1147,8 @@ static ADDRESS_MAP_START( neocd_main_map, AS_PROGRAM, 16, ng_aes_state ) AM_RANGE(0x3e0000, 0x3fffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w) AM_RANGE(0x800000, 0x803fff) AM_READWRITE(neocd_memcard_r, neocd_memcard_w) - AM_RANGE(0xc00000, 0xcfffff) AM_ROMBANK(NEOGEO_BANK_BIOS) - AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_READ(neogeo_unmapped_r) AM_SHARE("save_ram") //AM_RAM_WRITE(save_ram_w) + AM_RANGE(0xc00000, 0xc7ffff) AM_MIRROR(0x080000) AM_ROM AM_REGION("mainbios", 0) + AM_RANGE(0xd00000, 0xdfffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0xe00000, 0xefffff) AM_READWRITE8(neocd_transfer_r,neocd_transfer_w, 0xffff) AM_RANGE(0xf00000, 0xfeffff) AM_READ(neogeo_unmapped_r) AM_RANGE(0xff0000, 0xff01ff) AM_READWRITE(neocd_control_r, neocd_control_w) // CDROM / DMA @@ -1285,16 +1172,12 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( neocd_audio_io_map, AS_IO, 8, ng_aes_state ) - /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/ /* may not and NMI clear */ - AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r) + AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, soundlatch_clear_byte_w) AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write) AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */ // banking reads are actually NOP on NeoCD? but some games still access them - AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r) - AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r) - AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_c000_dfff_r) - AM_RANGE(0x0b, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_8000_bfff_r) - AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(audio_result_w) +// AM_RANGE(0x08, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xff03) AM_READ(audio_cpu_bank_select_r) + AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(soundlatch2_byte_w) AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) /* write - NMI disable? (the data written doesn't matter) */ // ?? @@ -1306,42 +1189,10 @@ ADDRESS_MAP_END /************************************* * - * Standard Neo-Geo DIPs and - * input port definition + * Input port definitions * *************************************/ -#define STANDARD_IN2 \ - PORT_START("IN2") \ - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) \ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(1) \ - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) \ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(2) \ - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ng_aes_state, get_memcard_status, NULL) \ - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Matrimelee expects this bit to be active high when on an AES */ - -#define STANDARD_IN3 \ - PORT_START("IN3") \ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) /* Coin 1 - AES has no coin slots, it's a console */ \ - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED ) /* Coin 2 - AES has no coin slots, it's a console */ \ - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Service Coin - not used, AES is a console */ \ - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */ \ - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */ \ - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? */ \ - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) \ - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) -#define STANDARD_IN4 \ - PORT_START("IN4") \ - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* what is this? - is 0 for 1 or 2 slot MVS (and AES?)*/ \ - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2) \ - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) static INPUT_PORTS_START( controller ) PORT_START("IN0") @@ -1459,34 +1310,6 @@ static INPUT_PORTS_START( mjpanel ) INPUT_PORTS_END static INPUT_PORTS_START( aes ) -// was there anyting in place of dipswitch in the home console? -/* PORT_START("IN0") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) -// PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") -// PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -// PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") -// PORT_DIPSETTING( 0x0000, "1?" ) -// PORT_DIPSETTING( 0x0002, "2?" ) -// PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel (or Auto Fire)" ) PORT_DIPLOCATION("SW:3") -// PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -// PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") -// PORT_DIPSETTING( 0x0018, "1" ) -// PORT_DIPSETTING( 0x0008, "2" ) -// PORT_DIPSETTING( 0x0010, "3" ) -// PORT_DIPSETTING( 0x0000, "4" ) -// PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") -// PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -// PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") -// PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -// PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") -// PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(aes_controller_r, NULL) */ - PORT_START("CTRLSEL") /* Select Controller Type */ PORT_CONFNAME( 0x0f, 0x01, "P1 Controller") PORT_CONFSETTING( 0x00, "Unconnected" ) @@ -1501,14 +1324,30 @@ static INPUT_PORTS_START( aes ) PORT_INCLUDE( mjpanel ) -// were some of these present in the AES?!? - STANDARD_IN2 + PORT_START("IN2") + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(2) + PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state, get_memcard_status, NULL) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Hardware type (AES=0, MVS=1) Some games check this and show */ + /* a piracy warning screen if the hardware and BIOS don't match */ + + PORT_START("AUDIO") + PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED ) /* AES has no coin slots, it's a console */ + PORT_BIT( 0x0018, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* what is this? Universe BIOS uses these bits to detect MVS or AES hardware */ + PORT_BIT( 0x00e0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* AES has no upd4990a */ + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) +INPUT_PORTS_END - STANDARD_IN3 - STANDARD_IN4 -INPUT_PORTS_END +static INPUT_PORTS_START( neocd ) + PORT_INCLUDE( aes ) + PORT_MODIFY("IN2") + PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_UNUSED ) // the NeoCD memcard is internal +INPUT_PORTS_END /************************************* @@ -1520,9 +1359,9 @@ INPUT_PORTS_END static MACHINE_CONFIG_DERIVED_CLASS( aes, neogeo_base, ng_aes_state ) MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(aes_main_map) // some different input handling, probably also responsible for Riding Hero not running properly + MCFG_CPU_PROGRAM_MAP(aes_main_map) - MCFG_MEMCARD_HANDLER(neogeo_aes) + MCFG_MEMCARD_HANDLER(neogeo) MCFG_MACHINE_START_OVERRIDE(ng_aes_state, neogeo) MCFG_MACHINE_RESET_OVERRIDE(ng_aes_state, neogeo) @@ -1600,6 +1439,20 @@ void ng_aes_state::NeoCDIRQUpdate(UINT8 byteValue) } } + +UINT32 ng_aes_state::screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + // fill with background color first + bitmap.fill(m_pens[0x0fff], cliprect); + + if (m_has_sprite_bus) draw_sprites(bitmap, cliprect.min_y); + + if (m_has_text_bus) draw_fixed_layer(bitmap, cliprect.min_y); + + return 0; +} + + struct cdrom_interface neocd_cdrom = { "neocd_cdrom", @@ -1607,23 +1460,6 @@ struct cdrom_interface neocd_cdrom = }; -static NVRAM_HANDLER( neocd ) -{ - ng_aes_state *state = machine.driver_data<ng_aes_state>(); - if (read_or_write) - file->write(state->m_memcard_data,0x2000); - else - { - if (file) - file->read(state->m_memcard_data,0x2000); - else - { - memset(state->m_memcard_data,0x00,0x2000); - } - } -} - - static MACHINE_CONFIG_DERIVED_CLASS( neocd, neogeo_base, ng_aes_state ) MCFG_CPU_MODIFY("maincpu") @@ -1633,6 +1469,9 @@ static MACHINE_CONFIG_DERIVED_CLASS( neocd, neogeo_base, ng_aes_state ) MCFG_CPU_PROGRAM_MAP(neocd_audio_map) MCFG_CPU_IO_MAP(neocd_audio_io_map) + MCFG_SCREEN_MODIFY("screen") + MCFG_SCREEN_UPDATE_DRIVER(ng_aes_state, screen_update_neocd) + // temporary until things are cleaned up MCFG_DEVICE_ADD("tempcdc", LC89510_TEMP, 0) // cd controller MCFG_SEGACD_HACK_SET_NEOCD @@ -1640,8 +1479,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( neocd, neogeo_base, ng_aes_state ) MCFG_SET_TYPE2_INTERRUPT_CALLBACK( ng_aes_state, interrupt_callback_type2 ) MCFG_SET_TYPE3_INTERRUPT_CALLBACK( ng_aes_state, interrupt_callback_type3 ) - - MCFG_NVRAM_HANDLER(neocd) + MCFG_NVRAM_ADD_0FILL("saveram") MCFG_MACHINE_START_OVERRIDE(ng_aes_state,neocd) MCFG_MACHINE_RESET_OVERRIDE(ng_aes_state,neocd) @@ -1656,45 +1494,38 @@ MACHINE_CONFIG_END * *************************************/ +#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ + ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */ ROM_START( aes ) - ROM_REGION16_BE( 0x80000, "mainbios", 0 ) - ROM_SYSTEM_BIOS( 0, "jap-aes", "Japan AES" ) - ROMX_LOAD("neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1)) /* AES Console (Japan) Bios */ - ROM_SYSTEM_BIOS( 1, "asia-aes", "Asia AES" ) - ROMX_LOAD("neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2)) /* AES Console (Asia?) Bios */ - ROM_SYSTEM_BIOS( 2, "uni-bios23", "Universe Bios (Ver. 2.3)" ) - ROMX_LOAD( "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(3) ) /* Universe Bios v2.3 (hack) */ - ROM_SYSTEM_BIOS( 3, "uni-bios30", "Universe Bios (Ver. 3.0)" ) - ROMX_LOAD("uni-bios-30.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(4)) /* Universe Bios v3.0 */ - ROM_SYSTEM_BIOS( 4, "uni-bios10", "Universe Bios (Ver. 1.0)" ) - ROMX_LOAD("uni-bios-10.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(5)) /* Universe Bios v1.0 */ - ROM_SYSTEM_BIOS( 5, "uni-bios11", "Universe Bios (Ver. 1.1)" ) - ROMX_LOAD("uni-bios-11.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(6)) /* Universe Bios v1.1 */ - ROM_SYSTEM_BIOS( 6, "uni-bios12", "Universe Bios (Ver. 1.2)" ) - ROMX_LOAD("uni-bios-12.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(7)) /* Universe Bios v1.2 */ - ROM_SYSTEM_BIOS( 7, "uni-bios13", "Universe Bios (Ver. 1.3)" ) - ROMX_LOAD("uni-bios-13.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(8)) /* Universe Bios v1.3 */ - ROM_SYSTEM_BIOS( 8, "uni-bios20", "Universe Bios (Ver. 2.0)" ) - ROMX_LOAD("uni-bios-20.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(9)) /* Universe Bios v2.0 */ - ROM_SYSTEM_BIOS( 9, "uni-bios21", "Universe Bios (Ver. 2.1)" ) - ROMX_LOAD("uni-bios-21.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(10)) /* Universe Bios v2.1 */ - ROM_SYSTEM_BIOS( 10, "uni-bios22", "Universe Bios (Ver. 2.2)" ) - ROMX_LOAD("uni-bios-22.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(11)) /* Universe Bios v2.2 */ + ROM_REGION16_BE( 0x20000, "mainbios", 0 ) + ROM_SYSTEM_BIOS( 0, "asia", "Asia AES" ) + ROM_LOAD16_WORD_SWAP_BIOS( 0, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */ + ROM_SYSTEM_BIOS( 1, "japan", "Japan AES" ) + ROM_LOAD16_WORD_SWAP_BIOS( 1, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */ + ROM_SYSTEM_BIOS( 2, "unibios30","Universe Bios (Hack, Ver. 3.0)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 2, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ + ROM_SYSTEM_BIOS( 3, "unibios23","Universe Bios (Hack, Ver. 2.3)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 3, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ + ROM_SYSTEM_BIOS( 4, "unibios23o","Universe Bios (Hack, Ver. 2.3, older?)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 4, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ + ROM_SYSTEM_BIOS( 5, "unibios22","Universe Bios (Hack, Ver. 2.2)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 5, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ + ROM_SYSTEM_BIOS( 6, "unibios21","Universe Bios (Hack, Ver. 2.1)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 6, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ + ROM_SYSTEM_BIOS( 7, "unibios20","Universe Bios (Hack, Ver. 2.0)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 7, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ + ROM_SYSTEM_BIOS( 8, "unibios13","Universe Bios (Hack, Ver. 1.3)" ) + ROM_LOAD16_WORD_SWAP_BIOS( 8, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ + // Universe BIOS versions older than 1.3 don't support AES hardware ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF ) - ROM_REGION( 0x20000, "audiobios", 0 ) - ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) - ROM_REGION( 0x90000, "audiocpu", ROMREGION_ERASEFF ) ROM_REGION( 0x20000, "zoomy", 0 ) ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) ) - ROM_REGION( 0x20000, "fixedbios", 0 ) - ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) - ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) ROM_REGION( 0x1000000, "ymsnd", ROMREGION_ERASEFF ) @@ -1705,7 +1536,7 @@ ROM_START( aes ) ROM_END ROM_START( neocd ) - ROM_REGION16_BE( 0x100000, "mainbios", 0 ) + ROM_REGION16_BE( 0x80000, "mainbios", 0 ) ROM_SYSTEM_BIOS( 0, "top", "Top loading NeoGeo CD" ) ROMX_LOAD( "top-sp1.bin", 0x00000, 0x80000, CRC(c36a47c0) SHA1(235f4d1d74364415910f73c10ae5482d90b4274f), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1)) ROM_SYSTEM_BIOS( 1, "front", "Front loading NeoGeo CD" ) @@ -1726,16 +1557,12 @@ ROM_START( neocd ) ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) /* 128KB of Text Tile RAM */ - - - ROM_REGION( 0x20000, "audiobios", ROMREGION_ERASEFF ) - ROM_REGION( 0x20000, "fixedbios", ROMREGION_ERASEFF ) ROM_REGION( 0x20000, "zoomy", 0 ) ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) ) ROM_END ROM_START( neocdz ) - ROM_REGION16_BE( 0x100000, "mainbios", 0 ) + ROM_REGION16_BE( 0x80000, "mainbios", 0 ) ROM_LOAD16_WORD_SWAP( "neocd.bin", 0x00000, 0x80000, CRC(df9de490) SHA1(7bb26d1e5d1e930515219cb18bcde5b7b23e2eda) ) ROM_REGION( 0x100000, "ymsnd", ROMREGION_ERASEFF ) @@ -1753,9 +1580,6 @@ ROM_START( neocdz ) ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) /* 128KB of Text Tile RAM */ - ROM_REGION( 0x20000, "audiobios", ROMREGION_ERASEFF ) - ROM_REGION( 0x20000, "fixedbios", ROMREGION_ERASEFF ) - ROM_REGION( 0x20000, "zoomy", 0 ) ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) ) ROM_END @@ -1781,8 +1605,8 @@ DRIVER_INIT_MEMBER(ng_aes_state,neocdzj) } -CONS( 1996, neocdz, 0, 0, neocd, aes, ng_aes_state, neocdz, "SNK", "Neo-Geo CDZ (US)", 0 ) // the CDZ is the newer model -CONS( 1996, neocdzj, neocdz, 0, neocd, aes, ng_aes_state, neocdzj, "SNK", "Neo-Geo CDZ (Japan)", 0 ) +CONS( 1996, neocdz, 0, 0, neocd, neocd, ng_aes_state, neocdz, "SNK", "Neo-Geo CDZ (US)", 0 ) // the CDZ is the newer model +CONS( 1996, neocdzj, neocdz, 0, neocd, neocd, ng_aes_state, neocdzj, "SNK", "Neo-Geo CDZ (Japan)", 0 ) -CONS( 1994, neocd, neocdz, 0, neocd, aes, ng_aes_state, neogeo, "SNK", "Neo-Geo CD", GAME_NOT_WORKING ) // older model, ignores disc protections? +CONS( 1994, neocd, neocdz, 0, neocd, neocd, ng_aes_state, neogeo, "SNK", "Neo-Geo CD", GAME_NOT_WORKING ) // older model, ignores disc protections? |
