mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
resurrect some old MVS multi-slot code
this is mostly functional but about 2 years old now, and badly needs some modernizations. It's a bit ugly in places because I've had to make sure the legacy methods work too, although in other places simply because it's old code I never quite got around to cleaning up. basically the inits have been split into ones that need calling once on startup (decryptions etc.) and ones that need calling when a new slot is activated (custom banking / protection handlers) mame64 neogeo -cart1 kof98 -cart2 kof99 -cart3 kof2000 -cart4 kof2001 -cart5 kof2002 -cart6 kof2003 works, assuming you have the RAM. certain combinations / orders don't work, maybe the real system is like that, maybe there are flaws in the implementation. once loaded as multi-game the neogeo will run through the attracts of each game in order, if you insert a coin then you can select next / previous game with the '3' and '4' (which are mapped to those buttons on the system) just like real hardware. if you're low on memory try mame64 neogeo -cart1 lbowling -cart2 samsho -cart3 mutnat -cart4 pbobblen -cart5 neomrdo -cart6 turfmast instead if you want an example of where it fails right now then put -cart1 roboarmy in slot 1 instead, it hangs after cycling through the games (or moving through them with 3) it's possible something isn't reset properly. This might become clearer as I clean things up a bit. I've verified eas and neocdz work as before
This commit is contained in:
parent
f499244d53
commit
9592cff5b3
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4140,7 +4140,7 @@ src/mame/drivers/nbmj8991.c svneol=native#text/plain
|
||||
src/mame/drivers/nbmj9195.c svneol=native#text/plain
|
||||
src/mame/drivers/nemesis.c svneol=native#text/plain
|
||||
src/mame/drivers/neogeo.c svneol=native#text/plain
|
||||
src/mame/drivers/neogeo.inc svneol=native#text/plain
|
||||
src/mame/drivers/neogeomvs.c svneol=native#text/plain
|
||||
src/mame/drivers/neoprint.c svneol=native#text/plain
|
||||
src/mame/drivers/neptunp2.c svneol=native#text/plain
|
||||
src/mame/drivers/news.c svneol=native#text/plain
|
||||
|
3589
hash/neogeo.xml
3589
hash/neogeo.xml
File diff suppressed because it is too large
Load Diff
@ -215,6 +215,11 @@ WRITE8_MEMBER( ym2610_device::write )
|
||||
ym2610_write(m_chip, offset & 3, data);
|
||||
}
|
||||
|
||||
void ym2610_device::set_pcmbufs(const UINT8 *buf, size_t size, UINT8* bufdt, size_t sizedt)
|
||||
{
|
||||
ym2610_set_pcmbufs(m_chip, buf, size, bufdt, sizedt);
|
||||
}
|
||||
|
||||
|
||||
const device_type YM2610 = &device_creator<ym2610_device>;
|
||||
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
void _IRQHandler(int irq);
|
||||
void _timer_handler(int c,int count,int clock);
|
||||
void _ym2610_update_request();
|
||||
void set_pcmbufs(const UINT8 *buf, size_t size, UINT8* bufdt, size_t sizedt);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
|
@ -3665,6 +3665,22 @@ void ym2610_shutdown(void *chip)
|
||||
auto_free(F2610->OPN.ST.device->machine(), F2610);
|
||||
}
|
||||
|
||||
void ym2610_set_pcmbufs(void *chip, const UINT8 *buf, size_t size, UINT8* bufdt, size_t sizedt)
|
||||
{
|
||||
YM2610 *F2610 = (YM2610 *)chip;
|
||||
|
||||
F2610->pcmbuf = buf;
|
||||
F2610->pcm_size = size;
|
||||
F2610->deltaT.memory = bufdt;
|
||||
if(F2610->deltaT.memory == NULL)
|
||||
{
|
||||
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
|
||||
F2610->deltaT.memory_size = F2610->pcm_size;
|
||||
}
|
||||
else
|
||||
F2610->deltaT.memory_size = sizedt;
|
||||
}
|
||||
|
||||
/* reset one of chip */
|
||||
void ym2610_reset_chip(void *chip)
|
||||
{
|
||||
@ -3674,21 +3690,23 @@ void ym2610_reset_chip(void *chip)
|
||||
YM_DELTAT *DELTAT = &F2610->deltaT;
|
||||
|
||||
astring name;
|
||||
astring name2;
|
||||
device_t* dev = F2610->OPN.ST.device;
|
||||
|
||||
/* setup PCM buffers again */
|
||||
name.printf("%s",dev->tag());
|
||||
F2610->pcmbuf = (const UINT8 *)dev->machine().root_device().memregion(name)->base();
|
||||
F2610->pcm_size = dev->machine().root_device().memregion(name)->bytes();
|
||||
name.printf("%s.deltat",dev->tag());
|
||||
F2610->deltaT.memory = (UINT8 *)dev->machine().root_device().memregion(name)->base();
|
||||
if(F2610->deltaT.memory == NULL)
|
||||
{
|
||||
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
|
||||
F2610->deltaT.memory_size = F2610->pcm_size;
|
||||
}
|
||||
else
|
||||
F2610->deltaT.memory_size = dev->machine().root_device().memregion(name)->bytes();
|
||||
name2.printf("%s.deltat",dev->tag());
|
||||
|
||||
ym2610_set_pcmbufs(chip,
|
||||
(const UINT8 *)dev->machine().root_device().memregion(name)->base(),
|
||||
|
||||
dev->machine().root_device().memregion(name)->bytes(),
|
||||
|
||||
(UINT8 *)dev->machine().root_device().memregion(name2)->base(),
|
||||
|
||||
dev->machine().root_device().memregion(name2)->bytes()
|
||||
|
||||
);
|
||||
|
||||
/* Reset Prescaler */
|
||||
OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */
|
||||
|
@ -190,6 +190,8 @@ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length);
|
||||
void ym2610b_update_one(void *chip, FMSAMPLE **buffer, int length);
|
||||
#endif /* BUILD_YM2610B */
|
||||
|
||||
void ym2610_set_pcmbufs(void *chip, const UINT8 *buf, size_t size, UINT8* bufdt, size_t sizedt);
|
||||
|
||||
int ym2610_write(void *chip, int a,unsigned char v);
|
||||
unsigned char ym2610_read(void *chip,int a);
|
||||
int ym2610_timer_over(void *chip, int c );
|
||||
|
@ -386,11 +386,69 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF
|
||||
}
|
||||
#endif
|
||||
|
||||
void neogeo_state::select_slot(UINT16 data, UINT16 mem_mask)
|
||||
{
|
||||
if (mem_mask & 0x00ff)
|
||||
{
|
||||
int newslot = data & 0x7;
|
||||
|
||||
if (newslot < 6)
|
||||
{
|
||||
// m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x000080, 0x0fffff); // unmap the cart (but not the vectors)
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x200000, 0x2fffff); // unmap the bank region
|
||||
m_maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x2fffff, "cartridge");
|
||||
install_bankswitch();
|
||||
|
||||
|
||||
|
||||
if (neogeo_cart_table[newslot].regions.maincpu_region != 0)
|
||||
{
|
||||
current_slot = newslot;
|
||||
|
||||
current_maincpu_region = neogeo_cart_table[current_slot].regions.maincpu_region;
|
||||
current_maincpu_region_size = neogeo_cart_table[current_slot].regions.maincpu_region_size;
|
||||
current_audiocpu_region = neogeo_cart_table[current_slot].regions.audiocpu_region;
|
||||
current_audiocpu_region_size = neogeo_cart_table[current_slot].regions.audiocpu_region_size;
|
||||
current_fixed_region = neogeo_cart_table[current_slot].regions.fixed_region;
|
||||
current_fixed_region_size = neogeo_cart_table[current_slot].regions.fixed_region_size;
|
||||
current_ymsnd_region = neogeo_cart_table[current_slot].regions.ymsnd_region;
|
||||
current_ymsnd_region_size = neogeo_cart_table[current_slot].regions.ymsnd_region_size;
|
||||
current_ymdelta_region = neogeo_cart_table[current_slot].regions.ymdelta_region;
|
||||
current_ymdelta_region_size = neogeo_cart_table[current_slot].regions.ymdelta_region_size;
|
||||
current_audiocrypt_region = neogeo_cart_table[current_slot].regions.audiocrypt_region;
|
||||
current_audiocrypt_region_size = neogeo_cart_table[current_slot].regions.audiocrypt_region_size;
|
||||
current_sprites_region = neogeo_cart_table[current_slot].regions.sprites_region;
|
||||
current_sprites_region_size = neogeo_cart_table[current_slot].regions.sprites_region_size;
|
||||
|
||||
|
||||
// setup cartridge ROM area
|
||||
m_maincpu->space(AS_PROGRAM).install_read_bank(0x000080, 0x0fffff, "cart_rom");
|
||||
membank("cart_rom")->set_base(current_maincpu_region + 0x80);
|
||||
neogeo_main_cpu_banking_init();
|
||||
ym2610_device* ym = (ym2610_device*)machine().device("ymsnd");
|
||||
ym->reset();
|
||||
ym->set_pcmbufs(current_ymsnd_region, current_ymsnd_region_size, current_ymdelta_region, current_ymdelta_region_size);
|
||||
neogeo_audio_cpu_banking_init(0);
|
||||
|
||||
// install any protection handlers etc. for the slot we just enabled
|
||||
neogeo_cart_table[current_slot].slot_enable((void*)this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(neogeo_state::io_control_w)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00: select_controller(data & 0x00ff); break;
|
||||
case 0x10: if (m_type == NEOGEO_MVS) select_slot(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;
|
||||
@ -582,7 +640,7 @@ void neogeo_state::_set_main_cpu_bank_address()
|
||||
{
|
||||
if (m_type == NEOGEO_CD) return;
|
||||
|
||||
m_bank_cartridge->set_base(m_region_maincpu->base() + m_main_cpu_bank_address);
|
||||
m_bank_cartridge->set_base(current_maincpu_region + m_main_cpu_bank_address);
|
||||
}
|
||||
|
||||
|
||||
@ -599,7 +657,7 @@ void neogeo_state::neogeo_set_main_cpu_bank_address( UINT32 bank_address )
|
||||
WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w)
|
||||
{
|
||||
UINT32 bank_address;
|
||||
UINT32 len = m_region_maincpu->bytes();
|
||||
UINT32 len = current_maincpu_region_size;
|
||||
|
||||
if ((len <= 0x100000) && (data & 0x07))
|
||||
logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", space.device().safe_pc(), data);
|
||||
@ -621,14 +679,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(1, m_region_maincpu->base());
|
||||
m_bank_vectors->configure_entry(1, current_maincpu_region);
|
||||
m_bank_vectors->configure_entry(0, memregion("mainbios")->base());
|
||||
m_bank_vectors->set_entry(0);
|
||||
|
||||
if (m_type != NEOGEO_CD)
|
||||
{
|
||||
/* set initial main CPU bank */
|
||||
if (m_region_maincpu->bytes() > 0x100000)
|
||||
if (current_maincpu_region_size > 0x100000)
|
||||
neogeo_set_main_cpu_bank_address(0x100000);
|
||||
else
|
||||
neogeo_set_main_cpu_bank_address(0x000000);
|
||||
@ -650,7 +708,7 @@ READ8_MEMBER(neogeo_state::audio_cpu_bank_select_r)
|
||||
}
|
||||
|
||||
|
||||
void neogeo_state::neogeo_audio_cpu_banking_init()
|
||||
void neogeo_state::neogeo_audio_cpu_banking_init(int set_entry)
|
||||
{
|
||||
if (m_type == NEOGEO_CD) return;
|
||||
|
||||
@ -660,12 +718,12 @@ void neogeo_state::neogeo_audio_cpu_banking_init()
|
||||
UINT32 address_mask;
|
||||
|
||||
/* audio bios/cartridge selection */
|
||||
m_bank_audio_main->configure_entry(1, memregion("audiocpu")->base());
|
||||
m_bank_audio_main->configure_entry(1, current_audiocpu_region);
|
||||
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);
|
||||
m_bank_audio_main->configure_entry(0, current_audiocpu_region);
|
||||
if (set_entry) m_bank_audio_main->set_entry(0); // if this is allowed when the game slot changes garou, zupapa etc. have no proper sounds, check.
|
||||
|
||||
/* audio banking */
|
||||
m_bank_audio_cart[0] = membank("audio_f000");
|
||||
@ -673,8 +731,8 @@ void neogeo_state::neogeo_audio_cpu_banking_init()
|
||||
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();
|
||||
address_mask = (current_audiocpu_region_size - 0x10000 - 1) & 0x3ffff;
|
||||
rgn = current_audiocpu_region;
|
||||
|
||||
for (region = 0; region < 4; region++)
|
||||
{
|
||||
@ -864,7 +922,7 @@ void neogeo_state::machine_start()
|
||||
neogeo_main_cpu_banking_init();
|
||||
|
||||
/* set the initial audio CPU ROM banks */
|
||||
neogeo_audio_cpu_banking_init();
|
||||
neogeo_audio_cpu_banking_init(1);
|
||||
|
||||
create_interrupt_timers();
|
||||
|
||||
@ -907,6 +965,7 @@ void neogeo_state::machine_start()
|
||||
|
||||
void neogeo_state::machine_reset()
|
||||
{
|
||||
|
||||
offs_t offs;
|
||||
address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
@ -1005,7 +1064,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static INPUT_PORTS_START( neogeo )
|
||||
INPUT_PORTS_START( neogeo )
|
||||
PORT_START("P1/DSW")
|
||||
PORT_DIPNAME( 0x0001, 0x0001, "Setting Mode" ) PORT_DIPLOCATION("SW:1")
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
|
||||
@ -1072,7 +1131,7 @@ static INPUT_PORTS_START( neogeo )
|
||||
|
||||
PORT_START("TEST")
|
||||
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( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? If ACTIVE_LOW, MVS-6 slot detected, when ACTIVE_HIGH MVS-1 slot (AES) detected */
|
||||
PORT_SERVICE_NO_TOGGLE( 0x0080, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
INPUT_PORTS_END
|
||||
@ -1080,48 +1139,145 @@ INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
struct neogeo_cart_region neogeo_cart_table[] =
|
||||
{
|
||||
{ ":cart1", 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ ":cart2", 1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ ":cart3", 2, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ ":cart4", 3, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ ":cart5", 4, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ ":cart6", 5, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, neogeo_state::slot_enable_default, 0 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
DEVICE_IMAGE_LOAD_MEMBER( neogeo_state, neo_cartridge )
|
||||
{
|
||||
struct neogeo_cart_region *mt_cart = &neogeo_cart_table[0], *this_cart;
|
||||
|
||||
/* First, determine where this cart has to be loaded */
|
||||
while (mt_cart->tag)
|
||||
{
|
||||
if (strcmp(mt_cart->tag, image.device().tag()) == 0)
|
||||
break;
|
||||
|
||||
mt_cart++;
|
||||
}
|
||||
|
||||
this_cart = mt_cart;
|
||||
|
||||
int slot = this_cart->slot;
|
||||
|
||||
|
||||
|
||||
UINT32 size;
|
||||
device_t* ym = machine().device("ymsnd");
|
||||
|
||||
// first check software list
|
||||
if(image.software_entry() != NULL)
|
||||
{
|
||||
// create memory regions
|
||||
// create memory regions
|
||||
size = image.get_software_region_length("maincpu");
|
||||
machine().memory().region_free(":maincpu");
|
||||
machine().memory().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG);
|
||||
// Reset the reference to the region
|
||||
m_region_maincpu.findit();
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
|
||||
machine().memory().region_free(":maincpu");
|
||||
machine().memory().region_alloc(":maincpu", size, 2, ENDIANNESS_BIG);
|
||||
|
||||
current_maincpu_region = memregion("maincpu")->base();
|
||||
current_maincpu_region_size = memregion("maincpu")->bytes();
|
||||
|
||||
|
||||
// Reset the reference to the region
|
||||
//m_region_maincpu.findit();
|
||||
|
||||
#ifdef LSB_FIRST
|
||||
// software list ROM loading currently does not fix up endianness for us, so we need to do it by hand
|
||||
UINT16 *src = (UINT16 *)image.get_software_region("maincpu");
|
||||
UINT16 *dst = (UINT16 *)memregion("maincpu")->base();
|
||||
for (int i=0; i<size/2; i++)
|
||||
{
|
||||
dst[i] = FLIPENDIAN_INT16(src[i]);
|
||||
}
|
||||
// software list ROM loading currently does not fix up endianness for us, so we need to do it by hand
|
||||
UINT16 *src = (UINT16 *)image.get_software_region("maincpu");
|
||||
UINT16 *dst = (UINT16 *)current_maincpu_region;
|
||||
for (int i = 0; i < size / 2; i++)
|
||||
{
|
||||
dst[i] = FLIPENDIAN_INT16(src[i]);
|
||||
}
|
||||
#else
|
||||
memcpy(memregion("maincpu")->base(),image.get_software_region("maincpu"),size);
|
||||
memcpy(current_maincpu_region, image.get_software_region("maincpu"), size);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.maincpu_region = auto_alloc_array(machine(), UINT8, size);
|
||||
#ifdef LSB_FIRST
|
||||
// software list ROM loading currently does not fix up endianness for us, so we need to do it by hand
|
||||
UINT16 *src = (UINT16 *)image.get_software_region("maincpu");
|
||||
UINT16 *dst = (UINT16 *)this_cart->regions.maincpu_region;
|
||||
for (int i = 0; i < size / 2; i++)
|
||||
{
|
||||
dst[i] = FLIPENDIAN_INT16(src[i]);
|
||||
}
|
||||
#else
|
||||
memcpy(this_cart->regions.maincpu_region, image.get_software_region("maincpu"), size);
|
||||
#endif
|
||||
|
||||
size = image.get_software_region_length("fixed");
|
||||
machine().memory().region_free(":fixed");
|
||||
machine().memory().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("fixed")->base(),image.get_software_region("fixed"),size);
|
||||
m_region_fixed.findit();
|
||||
current_maincpu_region = this_cart->regions.maincpu_region;
|
||||
current_maincpu_region_size = size;
|
||||
|
||||
if(image.get_software_region("audiocpu") != NULL)
|
||||
}
|
||||
|
||||
size = image.get_software_region_length("fixed");
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":fixed");
|
||||
machine().memory().region_alloc(":fixed", size, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_fixed_region = memregion("fixed")->base();
|
||||
current_fixed_region_size = memregion("fixed")->bytes();
|
||||
|
||||
memcpy(current_fixed_region, image.get_software_region("fixed"), size);
|
||||
//m_region_fixed.findit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.fixed_region = auto_alloc_array(machine(), UINT8, size);
|
||||
memcpy(this_cart->regions.fixed_region, image.get_software_region("fixed"), size);
|
||||
|
||||
current_fixed_region = this_cart->regions.fixed_region;
|
||||
current_fixed_region_size = size;
|
||||
|
||||
}
|
||||
|
||||
if (image.get_software_region("audiocpu") != NULL)
|
||||
{
|
||||
size = image.get_software_region_length("audiocpu");
|
||||
machine().memory().region_free(":audiocpu");
|
||||
machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("audiocpu")->base(),image.get_software_region("audiocpu"),size);
|
||||
memcpy(memregion("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho?
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":audiocpu");
|
||||
machine().memory().region_alloc(":audiocpu", size + 0x10000, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_audiocpu_region = memregion("audiocpu")->base();
|
||||
current_audiocpu_region_size = memregion("audiocpu")->bytes();
|
||||
|
||||
memcpy(current_audiocpu_region, image.get_software_region("audiocpu"), size);
|
||||
memcpy(current_audiocpu_region + 0x10000, image.get_software_region("audiocpu"), size); // avoid reloading in XML, should just improve banking instead tho?
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.audiocpu_region = auto_alloc_array(machine(), UINT8, size + 0x10000);
|
||||
memcpy(this_cart->regions.audiocpu_region + 0x00000, image.get_software_region("audiocpu"), size);
|
||||
memcpy(this_cart->regions.audiocpu_region + 0x10000, image.get_software_region("audiocpu"), size); // avoid reloading in XML, should just improve banking instead tho?
|
||||
|
||||
|
||||
current_audiocpu_region = this_cart->regions.audiocpu_region;
|
||||
current_audiocpu_region_size = size + 0x10000;;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1130,43 +1286,169 @@ DEVICE_IMAGE_LOAD_MEMBER( neogeo_state, neo_cartridge )
|
||||
Thus we preemptively reset it here while the old pointers are still valid so it's up to date and
|
||||
doesn't generate samples below when we reset it for the new pointers.
|
||||
*/
|
||||
|
||||
|
||||
ym->reset();
|
||||
size = image.get_software_region_length("ymsnd");
|
||||
machine().memory().region_free(":ymsnd");
|
||||
machine().memory().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("ymsnd")->base(),image.get_software_region("ymsnd"),size);
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":ymsnd");
|
||||
machine().memory().region_alloc(":ymsnd", size, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_ymsnd_region = memregion("ymsnd")->base();
|
||||
current_ymsnd_region_size = memregion("ymsnd")->bytes();
|
||||
|
||||
memcpy(current_ymsnd_region, image.get_software_region("ymsnd"), size);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.ymsnd_region = auto_alloc_array(machine(), UINT8, size);
|
||||
memcpy(this_cart->regions.ymsnd_region, image.get_software_region("ymsnd"), size);
|
||||
|
||||
current_ymsnd_region = this_cart->regions.ymsnd_region;
|
||||
current_ymsnd_region_size = size;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(image.get_software_region("ymsnd.deltat") != NULL)
|
||||
{
|
||||
size = image.get_software_region_length("ymsnd.deltat");
|
||||
machine().memory().region_free(":ymsnd.deltat");
|
||||
machine().memory().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size);
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":ymsnd.deltat");
|
||||
machine().memory().region_alloc(":ymsnd.deltat", size, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_ymdelta_region = memregion("ymsnd.deltat")->base();
|
||||
current_ymdelta_region_size = memregion("ymsnd.deltat")->bytes();
|
||||
|
||||
memcpy(current_ymdelta_region, image.get_software_region("ymsnd.deltat"), size);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.ymdelta_region = auto_alloc_array(machine(), UINT8, size);
|
||||
memcpy(this_cart->regions.ymdelta_region, image.get_software_region("ymsnd.deltat"), size);
|
||||
current_ymdelta_region = this_cart->regions.ymdelta_region;
|
||||
current_ymdelta_region_size = size;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
machine().memory().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
|
||||
{
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW
|
||||
this_cart->regions.ymdelta_region = 0;
|
||||
current_ymdelta_region = 0;
|
||||
current_ymdelta_region_size = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
ym->reset(); // and this makes the new pointers take effect
|
||||
|
||||
size = image.get_software_region_length("sprites");
|
||||
machine().memory().region_free(":sprites");
|
||||
machine().memory().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("sprites")->base(),image.get_software_region("sprites"),size);
|
||||
// Reset the reference to the region
|
||||
m_region_sprites.findit();
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_free(":sprites");
|
||||
machine().memory().region_alloc(":sprites", size, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_sprites_region = memregion("sprites")->base();
|
||||
current_sprites_region_size = memregion("sprites")->bytes();
|
||||
|
||||
|
||||
memcpy(current_sprites_region, image.get_software_region("sprites"), size);
|
||||
// Reset the reference to the region
|
||||
//m_region_sprites.findit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.sprites_region = auto_alloc_array(machine(), UINT8, size);
|
||||
memcpy(this_cart->regions.sprites_region, image.get_software_region("sprites"), size);
|
||||
current_sprites_region = this_cart->regions.sprites_region;
|
||||
current_sprites_region_size = size;
|
||||
}
|
||||
|
||||
if(image.get_software_region("audiocrypt") != NULL) // encrypted Z80 code
|
||||
{
|
||||
size = image.get_software_region_length("audiocrypt");
|
||||
machine().memory().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE);
|
||||
memcpy(memregion("audiocrypt")->base(),image.get_software_region("audiocrypt"),size);
|
||||
// allocate the audiocpu region to decrypt data into
|
||||
machine().memory().region_free(":audiocpu");
|
||||
machine().memory().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE);
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
machine().memory().region_alloc(":audiocrypt", size, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_audiocrypt_region = memregion("audiocrypt")->base();
|
||||
current_audiocrypt_region_size = memregion("audiocrypt")->bytes();
|
||||
|
||||
memcpy(current_audiocrypt_region, image.get_software_region("audiocrypt"), size);
|
||||
// allocate the audiocpu region to decrypt data into
|
||||
machine().memory().region_free(":audiocpu");
|
||||
machine().memory().region_alloc(":audiocpu", size + 0x10000, 1, ENDIANNESS_LITTLE);
|
||||
|
||||
current_audiocpu_region = memregion("audiocpu")->base();
|
||||
current_audiocpu_region_size = memregion("audiocpu")->bytes();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// NEW...
|
||||
this_cart->regions.audiocrypt_region = auto_alloc_array(machine(), UINT8, size);
|
||||
current_audiocrypt_region = this_cart->regions.audiocrypt_region;
|
||||
current_audiocrypt_region_size = size;
|
||||
|
||||
|
||||
memcpy(this_cart->regions.audiocrypt_region, image.get_software_region("audiocrypt"), size);
|
||||
this_cart->regions.audiocpu_region = auto_alloc_array(machine(), UINT8, size + 0x10000);
|
||||
current_audiocpu_region = this_cart->regions.audiocpu_region;
|
||||
current_audiocpu_region_size = size + 0x10000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// setup cartridge ROM area
|
||||
m_maincpu->space(AS_PROGRAM).install_read_bank(0x000080,0x0fffff,"cart_rom");
|
||||
membank("cart_rom")->set_base(m_region_maincpu->base() + 0x80);
|
||||
neogeo_cart_table[slot].regions.maincpu_region = current_maincpu_region;
|
||||
neogeo_cart_table[slot].regions.maincpu_region_size = current_maincpu_region_size;
|
||||
neogeo_cart_table[slot].regions.audiocpu_region = current_audiocpu_region;
|
||||
neogeo_cart_table[slot].regions.audiocpu_region_size = current_audiocpu_region_size;
|
||||
neogeo_cart_table[slot].regions.fixed_region = current_fixed_region;
|
||||
neogeo_cart_table[slot].regions.fixed_region_size = current_fixed_region_size;
|
||||
neogeo_cart_table[slot].regions.ymsnd_region = current_ymsnd_region;
|
||||
neogeo_cart_table[slot].regions.ymsnd_region_size = current_ymsnd_region_size;
|
||||
neogeo_cart_table[slot].regions.ymdelta_region = current_ymdelta_region;
|
||||
neogeo_cart_table[slot].regions.ymdelta_region_size = current_ymdelta_region_size;
|
||||
neogeo_cart_table[slot].regions.audiocrypt_region = current_audiocrypt_region;
|
||||
neogeo_cart_table[slot].regions.audiocrypt_region_size = current_audiocrypt_region_size;
|
||||
neogeo_cart_table[slot].regions.sprites_region = current_sprites_region;
|
||||
neogeo_cart_table[slot].regions.sprites_region_size = current_sprites_region_size;
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
// setup cartridge ROM area
|
||||
m_maincpu->space(AS_PROGRAM).install_read_bank(0x000080, 0x0fffff, "cart_rom");
|
||||
membank("cart_rom")->set_base(current_maincpu_region + 0x80);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// handle possible protection
|
||||
mvs_install_protection(image);
|
||||
mvs_install_protection(image, slot);
|
||||
|
||||
optimize_sprite_data(); // this takes a long time on big carts, so best use more memory and do it now rather than every time the active cart changes at runtime
|
||||
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
@ -1208,7 +1490,7 @@ MACHINE_CONFIG_START( neogeo_base, neogeo_state )
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( neogeo, neogeo_base )
|
||||
MACHINE_CONFIG_DERIVED( neogeo, neogeo_base )
|
||||
MCFG_WATCHDOG_TIME_INIT(attotime::from_usec(128762))
|
||||
|
||||
/* NEC uPD4990A RTC */
|
||||
@ -1218,10 +1500,21 @@ static MACHINE_CONFIG_DERIVED( neogeo, neogeo_base )
|
||||
MCFG_MEMCARD_HANDLER(neogeo)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( mvs, neogeo )
|
||||
MCFG_CARTSLOT_ADD("cart")
|
||||
|
||||
#define MCFG_NEOGEO_CARTSLOT_ADD(_tag) \
|
||||
MCFG_CARTSLOT_ADD(_tag) \
|
||||
MCFG_CARTSLOT_INTERFACE("neo_cart") \
|
||||
MCFG_CARTSLOT_LOAD(neogeo_state,neo_cartridge)
|
||||
MCFG_CARTSLOT_INTERFACE("neo_cart")
|
||||
|
||||
MACHINE_CONFIG_DERIVED( mvs, neogeo )
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart1")
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart2")
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart3")
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart4")
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart5")
|
||||
MCFG_NEOGEO_CARTSLOT_ADD("cart6")
|
||||
|
||||
|
||||
|
||||
MCFG_SOFTWARE_LIST_ADD("cart_list","neogeo")
|
||||
MACHINE_CONFIG_END
|
||||
@ -1235,8 +1528,32 @@ MACHINE_CONFIG_END
|
||||
|
||||
DRIVER_INIT_MEMBER(neogeo_state,neogeo)
|
||||
{
|
||||
// make sure legacy MAME style loading still works
|
||||
if (current_slot == 0)
|
||||
{
|
||||
current_maincpu_region = memregion("maincpu")->base();
|
||||
current_maincpu_region_size = memregion("maincpu")->bytes();
|
||||
current_ymsnd_region = memregion("ymsnd")->base();
|
||||
current_ymsnd_region_size = memregion("ymsnd")->bytes();
|
||||
current_sprites_region = memregion("sprites")->base();
|
||||
current_sprites_region_size = memregion("sprites")->bytes();
|
||||
current_fixed_region = memregion("fixed")->base();
|
||||
current_fixed_region_size = memregion("fixed")->bytes();
|
||||
current_audiocpu_region = memregion("audiocpu")->base();
|
||||
current_audiocpu_region_size = memregion("audiocpu")->bytes();
|
||||
current_audiocrypt_region = memregion("audiocrypt")->base();
|
||||
current_audiocrypt_region_size = memregion("audiocrypt")->bytes();
|
||||
current_ymdelta_region = memregion("ymsnd.deltat")->base();
|
||||
current_ymdelta_region_size = memregion("ymsnd.deltat")->bytes();
|
||||
}
|
||||
|
||||
neogeo_cart_table[current_slot].slot_enable = slot_enable_default;
|
||||
|
||||
m_fixed_layer_bank_type = 0;
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(neogeo_state, neogeo_postinit)
|
||||
{
|
||||
neogeo_cart_table[current_slot].slot_enable((void*)this);
|
||||
}
|
||||
|
||||
#include "neogeo.inc"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,38 @@
|
||||
#define NEOGEO_VSSTART (0x000)
|
||||
#define NEOGEO_VBLANK_RELOAD_HPOS (0x11f)
|
||||
|
||||
struct neogeo_regionptrs
|
||||
{
|
||||
UINT8* maincpu_region;
|
||||
size_t maincpu_region_size;
|
||||
UINT8* audiocpu_region;
|
||||
size_t audiocpu_region_size;
|
||||
UINT8* fixed_region;
|
||||
size_t fixed_region_size;
|
||||
UINT8* ymsnd_region;
|
||||
size_t ymsnd_region_size;
|
||||
UINT8* ymdelta_region;
|
||||
size_t ymdelta_region_size;
|
||||
UINT8* audiocrypt_region;
|
||||
size_t audiocrypt_region_size;
|
||||
UINT8* sprites_region;
|
||||
size_t sprites_region_size;
|
||||
};
|
||||
|
||||
typedef void (*neogeo_slot_enable_callback)(void *state);
|
||||
|
||||
struct neogeo_cart_region
|
||||
{
|
||||
const char *tag;
|
||||
int slot;
|
||||
neogeo_regionptrs regions;
|
||||
neogeo_slot_enable_callback slot_enable;
|
||||
UINT32 m_sprite_gfx_address_mask;
|
||||
dynamic_array<UINT8> m_sprite_gfx;
|
||||
|
||||
};
|
||||
|
||||
extern struct neogeo_cart_region neogeo_cart_table[];
|
||||
|
||||
class neogeo_state : public driver_device
|
||||
{
|
||||
@ -30,15 +61,18 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
|
||||
m_region_maincpu(*this, "maincpu"),
|
||||
m_region_sprites(*this, "sprites"),
|
||||
m_region_fixed(*this, "fixed"),
|
||||
m_region_fixedbios(*this, "fixedbios"),
|
||||
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") { }
|
||||
m_save_ram(*this, "saveram")
|
||||
{
|
||||
current_slot = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
DECLARE_WRITE16_MEMBER(io_control_w);
|
||||
DECLARE_READ16_MEMBER(memcard_r);
|
||||
@ -122,7 +156,35 @@ public:
|
||||
DECLARE_DRIVER_INIT(lans2004);
|
||||
DECLARE_DRIVER_INIT(sbp);
|
||||
DECLARE_DRIVER_INIT(mvs);
|
||||
void mvs_install_protection(device_image_interface& image);
|
||||
void mvs_install_protection(device_image_interface& image, int slot);
|
||||
void install_bankswitch();
|
||||
|
||||
// these get called when a cartridge is enabled, they're used to install
|
||||
// cartridge specific handlers
|
||||
static void slot_enable_default(void *state);
|
||||
static void slot_enable_cmc_bank1(void *state);
|
||||
static void slot_enable_cmc_bank2(void *state);
|
||||
static void slot_enable_garou(void *state);
|
||||
static void slot_enable_garouh(void *state);
|
||||
static void slot_enable_kof2000(void *state);
|
||||
static void slot_enable_mslug3(void *state);
|
||||
static void slot_enable_kof99(void *state);
|
||||
static void slot_enable_pvc_cmc2(void *state);
|
||||
static void slot_enable_pvc_cmc1(void *state);
|
||||
static void slot_enable_pvc_boot(void *state);
|
||||
static void slot_enable_fatfury2(void *state);
|
||||
static void slot_enable_kof98(void *state);
|
||||
static void slot_enable_mslugx(void *state);
|
||||
static void slot_enable_kof10th(void *state);
|
||||
static void slot_enable_ms5plus(void *state);
|
||||
static void slot_enable_kf2k3bl(void *state);
|
||||
static void slot_enable_kf2k3pl(void *state);
|
||||
static void slot_enable_jockeygp(void *state);
|
||||
static void slot_enable_vliner(void *state);
|
||||
static void slot_enable_kog(void *state);
|
||||
static void slot_enable_sbp(void *state);
|
||||
|
||||
DECLARE_DRIVER_INIT(neogeo_postinit);
|
||||
|
||||
TIMER_CALLBACK_MEMBER(display_position_interrupt_callback);
|
||||
TIMER_CALLBACK_MEMBER(display_position_vblank_callback);
|
||||
@ -146,6 +208,25 @@ public:
|
||||
// this has to be public for the legacy MEMCARD_HANDLER
|
||||
UINT8 *m_memcard_data;
|
||||
|
||||
int current_slot;
|
||||
|
||||
|
||||
UINT8* current_maincpu_region;
|
||||
size_t current_maincpu_region_size;
|
||||
UINT8* current_ymsnd_region;
|
||||
size_t current_ymsnd_region_size;
|
||||
UINT8* current_sprites_region;
|
||||
size_t current_sprites_region_size;
|
||||
UINT8* current_fixed_region;
|
||||
size_t current_fixed_region_size;
|
||||
UINT8* current_audiocpu_region;
|
||||
size_t current_audiocpu_region_size;
|
||||
UINT8* current_audiocrypt_region;
|
||||
size_t current_audiocrypt_region_size;
|
||||
UINT8* current_ymdelta_region;
|
||||
size_t current_ymdelta_region_size;
|
||||
|
||||
|
||||
protected:
|
||||
void neogeo_postload();
|
||||
void update_interrupts();
|
||||
@ -155,7 +236,7 @@ protected:
|
||||
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 neogeo_audio_cpu_banking_init(int set_entry);
|
||||
void adjust_display_position_interrupt_timer();
|
||||
void neogeo_set_display_position_interrupt_control(UINT16 data);
|
||||
void neogeo_set_display_counter_msb(UINT16 data);
|
||||
@ -194,6 +275,7 @@ protected:
|
||||
void set_output_latch( UINT8 data );
|
||||
void set_output_data( UINT8 data );
|
||||
void install_banked_bios();
|
||||
void select_slot(UINT16 data, UINT16 mem_mask);
|
||||
|
||||
// protections implementation
|
||||
DECLARE_READ16_MEMBER( sbp_lowerrom_r );
|
||||
@ -201,11 +283,15 @@ protected:
|
||||
DECLARE_READ16_MEMBER( fatfury2_protection_16_r );
|
||||
DECLARE_WRITE16_MEMBER( fatfury2_protection_16_w );
|
||||
void fatfury2_install_protection();
|
||||
void fatfury2_init_protection();
|
||||
|
||||
DECLARE_WRITE16_MEMBER ( kof98_prot_w );
|
||||
void install_kof98_protection();
|
||||
DECLARE_WRITE16_MEMBER( mslugx_protection_16_w );
|
||||
DECLARE_READ16_MEMBER( mslugx_protection_16_r );
|
||||
void mslugx_install_protection();
|
||||
void mslugx_init_protection();
|
||||
|
||||
DECLARE_WRITE16_MEMBER( kof99_bankswitch_w );
|
||||
DECLARE_WRITE16_MEMBER( garou_bankswitch_w );
|
||||
DECLARE_WRITE16_MEMBER( garouh_bankswitch_w );
|
||||
@ -215,6 +301,7 @@ protected:
|
||||
DECLARE_READ16_MEMBER( sma_random_r );
|
||||
void reset_sma_rng();
|
||||
void sma_install_random_read_handler( int addr1, int addr2 );
|
||||
void init_sma(void);
|
||||
void kof99_install_protection();
|
||||
void garou_install_protection();
|
||||
void garouh_install_protection();
|
||||
@ -226,6 +313,7 @@ protected:
|
||||
DECLARE_READ16_MEMBER( pvc_prot_r );
|
||||
DECLARE_WRITE16_MEMBER( pvc_prot_w );
|
||||
void install_pvc_protection();
|
||||
void init_pvc_protection();
|
||||
void neogeo_bootleg_cx_decrypt();
|
||||
void neogeo_bootleg_sx_decrypt(int value );
|
||||
void kog_px_decrypt();
|
||||
@ -320,9 +408,6 @@ protected:
|
||||
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
|
||||
@ -374,8 +459,6 @@ protected:
|
||||
|
||||
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;
|
||||
@ -420,4 +503,7 @@ protected:
|
||||
/*----------- defined in drivers/neogeo.c -----------*/
|
||||
|
||||
MACHINE_CONFIG_EXTERN( neogeo_base );
|
||||
MACHINE_CONFIG_EXTERN( neogeo );
|
||||
MACHINE_CONFIG_EXTERN( mvs );
|
||||
MEMCARD_HANDLER( neogeo );
|
||||
INPUT_PORTS_EXTERN( neogeo );
|
||||
|
@ -22,8 +22,8 @@
|
||||
void neogeo_state::neogeo_bootleg_cx_decrypt()
|
||||
{
|
||||
int i;
|
||||
int cx_size = memregion( "sprites" )->bytes();
|
||||
UINT8 *rom = memregion( "sprites" )->base();
|
||||
int cx_size = current_sprites_region_size;
|
||||
UINT8 *rom = current_sprites_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, cx_size );
|
||||
|
||||
memcpy( buf, rom, cx_size );
|
||||
@ -38,8 +38,8 @@ void neogeo_state::neogeo_bootleg_cx_decrypt()
|
||||
|
||||
void neogeo_state::neogeo_bootleg_sx_decrypt(int value )
|
||||
{
|
||||
int sx_size = memregion( "fixed" )->bytes();
|
||||
UINT8 *rom = memregion( "fixed" )->base();
|
||||
int sx_size = current_fixed_region_size;
|
||||
UINT8 *rom = current_fixed_region;
|
||||
int i;
|
||||
|
||||
if (value == 1)
|
||||
@ -71,9 +71,9 @@ void neogeo_state::neogeo_bootleg_sx_decrypt(int value )
|
||||
void neogeo_state::kog_px_decrypt()
|
||||
{
|
||||
/* the protection chip does some *very* strange things to the rom */
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x600000 );
|
||||
UINT16 *rom = (UINT16 *)memregion("maincpu")->base();
|
||||
UINT16 *rom = (UINT16 *)current_maincpu_region;
|
||||
int i;
|
||||
static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
|
||||
|
||||
@ -136,7 +136,7 @@ void neogeo_state::kof97oro_px_decode()
|
||||
{
|
||||
int i;
|
||||
UINT16 *tmp = auto_alloc_array(machine(), UINT16, 0x500000 );
|
||||
UINT16 *src = (UINT16*)memregion("maincpu")->base();
|
||||
UINT16 *src = (UINT16*)current_maincpu_region;
|
||||
|
||||
for (i = 0; i < 0x500000/2; i++) {
|
||||
tmp[i] = src[i ^ 0x7ffef];
|
||||
@ -171,10 +171,10 @@ READ16_MEMBER( neogeo_state::kof10th_RAMB_r )
|
||||
WRITE16_MEMBER( neogeo_state::kof10th_custom_w )
|
||||
{
|
||||
if (!m_cartridge_ram[0xFFE]) { // Write to RAM bank A
|
||||
UINT16 *prom = (UINT16*)memregion( "maincpu" )->base();
|
||||
UINT16 *prom = (UINT16*)current_maincpu_region;
|
||||
COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]);
|
||||
} else { // Write S data on-the-fly
|
||||
UINT8 *srom = memregion( "fixed" )->base();
|
||||
UINT8 *srom = current_fixed_region;
|
||||
srom[offset] = BITSWAP8(data,7,6,0,4,3,2,1,5);
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ WRITE16_MEMBER( neogeo_state::kof10th_bankswitch_w )
|
||||
if (offset == 0x5FFF8) { // Standard bankswitch
|
||||
kof10thBankswitch(space, data);
|
||||
} else if (offset == 0x5FFFC && m_cartridge_ram[0xFFC] != data) { // Special bankswitch
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
|
||||
}
|
||||
COMBINE_DATA(&m_cartridge_ram[offset & 0xFFF]);
|
||||
@ -194,8 +194,6 @@ WRITE16_MEMBER( neogeo_state::kof10th_bankswitch_w )
|
||||
|
||||
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));
|
||||
@ -205,7 +203,7 @@ void neogeo_state::decrypt_kof10th()
|
||||
{
|
||||
int i, j;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x900000);
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
|
||||
memcpy(dst + 0x000000, src + 0x700000, 0x100000); // Correct (Verified in Uni-bios)
|
||||
memcpy(dst + 0x100000, src + 0x000000, 0x800000);
|
||||
@ -232,7 +230,7 @@ void neogeo_state::decrypt_kof10th()
|
||||
|
||||
void neogeo_state::kf10thep_px_decrypt()
|
||||
{
|
||||
UINT16 *rom = (UINT16*)memregion("maincpu")->base();
|
||||
UINT16 *rom = (UINT16*)current_maincpu_region;
|
||||
UINT16 *buf = auto_alloc_array(machine(), UINT16, 0x100000/2);
|
||||
|
||||
memcpy(&buf[0x000000/2], &rom[0x060000/2], 0x20000);
|
||||
@ -265,7 +263,7 @@ void neogeo_state::kf10thep_px_decrypt()
|
||||
void neogeo_state::kf2k5uni_px_decrypt()
|
||||
{
|
||||
int i, j, ofst;
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x80);
|
||||
|
||||
for (i = 0; i < 0x800000; i+=0x80)
|
||||
@ -285,7 +283,7 @@ void neogeo_state::kf2k5uni_px_decrypt()
|
||||
void neogeo_state::kf2k5uni_sx_decrypt()
|
||||
{
|
||||
int i;
|
||||
UINT8 *srom = memregion( "fixed" )->base();
|
||||
UINT8 *srom = current_fixed_region;
|
||||
|
||||
for (i = 0; i < 0x20000; i++)
|
||||
srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3);
|
||||
@ -294,7 +292,7 @@ void neogeo_state::kf2k5uni_sx_decrypt()
|
||||
void neogeo_state::kf2k5uni_mx_decrypt()
|
||||
{
|
||||
int i;
|
||||
UINT8 *mrom = memregion( "audiocpu" )->base();
|
||||
UINT8 *mrom = current_audiocpu_region;
|
||||
|
||||
for (i = 0; i < 0x30000; i++)
|
||||
mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3);
|
||||
@ -350,7 +348,7 @@ void neogeo_state::kf2k2mp_decrypt()
|
||||
{
|
||||
int i,j;
|
||||
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x80);
|
||||
|
||||
memmove(src, src + 0x300000, 0x500000);
|
||||
@ -373,7 +371,7 @@ void neogeo_state::kf2k2mp_decrypt()
|
||||
|
||||
void neogeo_state::kf2k2mp2_px_decrypt()
|
||||
{
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x600000);
|
||||
|
||||
memcpy (dst + 0x000000, src + 0x1C0000, 0x040000);
|
||||
@ -395,7 +393,7 @@ void neogeo_state::cthd2003_neogeo_gfx_address_fix_do(int start, int end, int bi
|
||||
int tilesize=128;
|
||||
|
||||
UINT8* rom = auto_alloc_array(machine(), UINT8, 16*tilesize); // 16 tiles buffer
|
||||
UINT8* realrom = memregion("sprites")->base() + start*tilesize;
|
||||
UINT8* realrom = current_sprites_region + start*tilesize;
|
||||
|
||||
for (i = 0; i < (end-start)/16; i++) {
|
||||
for (j = 0; j < 16; j++) {
|
||||
@ -448,7 +446,7 @@ void neogeo_state::cthd2003_c(int pow)
|
||||
|
||||
void neogeo_state::decrypt_cthd2003()
|
||||
{
|
||||
UINT8 *romdata = memregion("fixed")->base();
|
||||
UINT8 *romdata = current_fixed_region;
|
||||
UINT8 *tmp = auto_alloc_array(machine(), UINT8, 8*128*128);
|
||||
|
||||
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
|
||||
@ -457,7 +455,7 @@ void neogeo_state::decrypt_cthd2003()
|
||||
memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128);
|
||||
memcpy(romdata, tmp, 8*128*128);
|
||||
|
||||
romdata = memregion("audiocpu")->base()+0x10000;
|
||||
romdata = current_audiocpu_region+0x10000;
|
||||
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
|
||||
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
|
||||
memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128);
|
||||
@ -489,7 +487,7 @@ void neogeo_state::patch_cthd2003()
|
||||
{
|
||||
/* patches thanks to razoola */
|
||||
int i;
|
||||
UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base();
|
||||
UINT16 *mem16 = (UINT16 *)current_maincpu_region;
|
||||
|
||||
/* special ROM banking handler */
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x2ffff0, 0x2fffff, write16_delegate(FUNC(neogeo_state::cthd2003_bankswitch_w),this));
|
||||
@ -532,8 +530,8 @@ void neogeo_state::patch_cthd2003()
|
||||
|
||||
void neogeo_state::ct2k3sp_sx_decrypt()
|
||||
{
|
||||
int rom_size = memregion( "fixed" )->bytes();
|
||||
UINT8 *rom = memregion( "fixed" )->base();
|
||||
int rom_size = current_fixed_region_size;
|
||||
UINT8 *rom = current_fixed_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
int i;
|
||||
int ofst;
|
||||
@ -562,7 +560,7 @@ void neogeo_state::ct2k3sp_sx_decrypt()
|
||||
|
||||
void neogeo_state::decrypt_ct2k3sp()
|
||||
{
|
||||
UINT8 *romdata = memregion("audiocpu")->base()+0x10000;
|
||||
UINT8 *romdata = current_audiocpu_region+0x10000;
|
||||
UINT8*tmp = auto_alloc_array(machine(), UINT8, 8*128*128);
|
||||
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
|
||||
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
|
||||
@ -582,7 +580,7 @@ void neogeo_state::decrypt_ct2k3sp()
|
||||
|
||||
void neogeo_state::decrypt_ct2k3sa()
|
||||
{
|
||||
UINT8 *romdata = memregion("audiocpu")->base()+0x10000;
|
||||
UINT8 *romdata = current_audiocpu_region+0x10000;
|
||||
UINT8*tmp = auto_alloc_array(machine(), UINT8, 8*128*128);
|
||||
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
|
||||
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
|
||||
@ -599,7 +597,7 @@ void neogeo_state::patch_ct2k3sa()
|
||||
{
|
||||
/* patches thanks to razoola - same as for cthd2003*/
|
||||
int i;
|
||||
UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base();
|
||||
UINT16 *mem16 = (UINT16 *)current_maincpu_region;
|
||||
|
||||
// theres still a problem on the character select screen but it seems to be related to cpu core timing issues,
|
||||
// overclocking the 68k prevents it.
|
||||
@ -640,7 +638,7 @@ void neogeo_state::patch_ct2k3sa()
|
||||
|
||||
void neogeo_state::decrypt_kof2k4se_68k()
|
||||
{
|
||||
UINT8 *src = memregion("maincpu")->base()+0x100000;
|
||||
UINT8 *src = current_maincpu_region+0x100000;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x400000);
|
||||
int i;
|
||||
static const int sec[] = {0x300000,0x200000,0x100000,0x000000};
|
||||
@ -660,7 +658,7 @@ void neogeo_state::decrypt_kof2k4se_68k()
|
||||
void neogeo_state::lans2004_vx_decrypt()
|
||||
{
|
||||
int i;
|
||||
UINT8 *rom = memregion( "ymsnd" )->base();
|
||||
UINT8 *rom = current_ymsnd_region;
|
||||
for (i = 0; i < 0xA00000; i++)
|
||||
rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7);
|
||||
}
|
||||
@ -669,8 +667,8 @@ void neogeo_state::lans2004_decrypt_68k()
|
||||
{
|
||||
/* Descrambling P ROMs - Thanks to Razoola for the info */
|
||||
int i;
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
UINT16 *rom = (UINT16*)memregion( "maincpu" )->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT16 *rom = (UINT16*)current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x600000);
|
||||
|
||||
{
|
||||
@ -749,8 +747,8 @@ void neogeo_state::svcboot_px_decrypt()
|
||||
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
|
||||
};
|
||||
int i;
|
||||
int size = memregion( "maincpu" )->bytes();
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
int size = current_maincpu_region_size;
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, size );
|
||||
int ofst;
|
||||
for( i = 0; i < size / 0x100000; i++ ){
|
||||
@ -778,8 +776,8 @@ void neogeo_state::svcboot_cx_decrypt()
|
||||
{ 3, 0, 2, 1 },
|
||||
};
|
||||
int i;
|
||||
int size = memregion( "sprites" )->bytes();
|
||||
UINT8 *src = memregion( "sprites" )->base();
|
||||
int size = current_sprites_region_size;
|
||||
UINT8 *src = current_sprites_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, size );
|
||||
int ofst;
|
||||
memcpy( dst, src, size );
|
||||
@ -805,8 +803,8 @@ void neogeo_state::svcplus_px_decrypt()
|
||||
static const int sec[] = {
|
||||
0x00, 0x03, 0x02, 0x05, 0x04, 0x01
|
||||
};
|
||||
int size = memregion( "maincpu" )->bytes();
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
int size = current_maincpu_region_size;
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, size );
|
||||
int i;
|
||||
int ofst;
|
||||
@ -829,7 +827,7 @@ void neogeo_state::svcplus_px_decrypt()
|
||||
void neogeo_state::svcplus_px_hack()
|
||||
{
|
||||
/* patched by the protection chip? */
|
||||
UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base();
|
||||
UINT16 *mem16 = (UINT16 *)current_maincpu_region;
|
||||
mem16[0x0f8016/2] = 0x33c1;
|
||||
}
|
||||
|
||||
@ -843,8 +841,8 @@ void neogeo_state::svcplusa_px_decrypt()
|
||||
static const int sec[] = {
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x00
|
||||
};
|
||||
int size = memregion( "maincpu" )->bytes();
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
int size = current_maincpu_region_size;
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, size );
|
||||
memcpy( dst, src, size );
|
||||
for( i = 0; i < 6; i++ ){
|
||||
@ -862,8 +860,8 @@ void neogeo_state::svcsplus_px_decrypt()
|
||||
static const int sec[] = {
|
||||
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
|
||||
};
|
||||
int size = memregion( "maincpu" )->bytes();
|
||||
UINT8 *src = memregion( "maincpu" )->base();
|
||||
int size = current_maincpu_region_size;
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, size );
|
||||
int i;
|
||||
int ofst;
|
||||
@ -882,7 +880,7 @@ void neogeo_state::svcsplus_px_decrypt()
|
||||
void neogeo_state::svcsplus_px_hack()
|
||||
{
|
||||
/* patched by the protection chip? */
|
||||
UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base();
|
||||
UINT16 *mem16 = (UINT16 *)current_maincpu_region;
|
||||
mem16[0x9e90/2] = 0x000f;
|
||||
mem16[0x9e92/2] = 0xc9c0;
|
||||
mem16[0xa10c/2] = 0x4eb9;
|
||||
@ -922,7 +920,7 @@ WRITE16_MEMBER( neogeo_state::kof2003_w )
|
||||
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();
|
||||
UINT8* mem = (UINT8 *)current_maincpu_region;
|
||||
|
||||
cr[BYTE_XOR_LE(0x1ff0)] = 0xa0;
|
||||
cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
|
||||
@ -940,7 +938,7 @@ WRITE16_MEMBER( neogeo_state::kof2003p_w )
|
||||
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();
|
||||
UINT8* mem = (UINT8 *)current_maincpu_region;
|
||||
|
||||
cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
|
||||
cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
|
||||
@ -958,7 +956,7 @@ void neogeo_state::kf2k3bl_px_decrypt()
|
||||
};
|
||||
|
||||
int rom_size = 0x800000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
memcpy( buf, rom, rom_size );
|
||||
|
||||
@ -970,8 +968,6 @@ 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) );
|
||||
}
|
||||
|
||||
@ -982,7 +978,7 @@ void neogeo_state::kf2k3bl_install_protection()
|
||||
void neogeo_state::kf2k3pl_px_decrypt()
|
||||
{
|
||||
UINT16*tmp = auto_alloc_array(machine(), UINT16, 0x100000/2);
|
||||
UINT16*rom = (UINT16*)memregion( "maincpu" )->base();
|
||||
UINT16*rom = (UINT16*)current_maincpu_region;
|
||||
int j;
|
||||
int i;
|
||||
|
||||
@ -1000,8 +996,6 @@ 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) );
|
||||
}
|
||||
|
||||
@ -1012,7 +1006,7 @@ void neogeo_state::kf2k3pl_install_protection()
|
||||
void neogeo_state::kf2k3upl_px_decrypt()
|
||||
{
|
||||
{
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
memmove(src+0x100000, src, 0x600000);
|
||||
memmove(src, src+0x700000, 0x100000);
|
||||
}
|
||||
@ -1020,8 +1014,8 @@ void neogeo_state::kf2k3upl_px_decrypt()
|
||||
{
|
||||
int ofst;
|
||||
int i;
|
||||
UINT8 *rom = memregion( "maincpu" )->base() + 0xfe000;
|
||||
UINT8 *buf = memregion( "maincpu" )->base() + 0xd0610;
|
||||
UINT8 *rom = current_maincpu_region + 0xfe000;
|
||||
UINT8 *buf = current_maincpu_region + 0xd0610;
|
||||
|
||||
for( i = 0; i < 0x2000 / 2; i++ ){
|
||||
ofst = (i & 0xff00) + BITSWAP8( (i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5 );
|
||||
@ -1036,8 +1030,8 @@ void neogeo_state::kf2k3upl_px_decrypt()
|
||||
|
||||
void neogeo_state::samsho5b_px_decrypt()
|
||||
{
|
||||
int px_size = memregion( "maincpu" )->bytes();
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
int px_size = current_maincpu_region_size;
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, px_size );
|
||||
int ofst;
|
||||
int i;
|
||||
@ -1063,8 +1057,8 @@ void neogeo_state::samsho5b_px_decrypt()
|
||||
|
||||
void neogeo_state::samsho5b_vx_decrypt()
|
||||
{
|
||||
int vx_size = memregion( "ymsnd" )->bytes();
|
||||
UINT8 *rom = memregion( "ymsnd" )->base();
|
||||
int vx_size = current_ymsnd_region_size;
|
||||
UINT8 *rom = current_ymsnd_region;
|
||||
int i;
|
||||
|
||||
for( i = 0; i < vx_size; i++ )
|
||||
@ -1080,7 +1074,7 @@ void neogeo_state::samsho5b_vx_decrypt()
|
||||
void neogeo_state::matrimbl_decrypt()
|
||||
{
|
||||
/* decrypt Z80 */
|
||||
UINT8 *rom = memregion( "audiocpu" )->base()+0x10000;
|
||||
UINT8 *rom = current_audiocpu_region+0x10000;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, 0x20000 );
|
||||
int i, j=0;
|
||||
memcpy( buf, rom, 0x20000 );
|
||||
|
@ -516,11 +516,11 @@ void neogeo_state::neogeo_gfx_decrypt(int extra_xor)
|
||||
UINT8 *rom;
|
||||
int rpos;
|
||||
|
||||
rom_size = memregion("sprites")->bytes();
|
||||
rom_size = current_sprites_region_size;
|
||||
|
||||
buf = auto_alloc_array(machine(), UINT8, rom_size);
|
||||
|
||||
rom = memregion("sprites")->base();
|
||||
rom = current_sprites_region;
|
||||
|
||||
// Data xor
|
||||
for (rpos = 0;rpos < rom_size/4;rpos++)
|
||||
@ -576,10 +576,10 @@ void neogeo_state::neogeo_gfx_decrypt(int extra_xor)
|
||||
void neogeo_state::neogeo_sfix_decrypt()
|
||||
{
|
||||
int i;
|
||||
int rom_size = memregion("sprites")->bytes();
|
||||
int tx_size = memregion("fixed")->bytes();
|
||||
UINT8 *src = memregion("sprites")->base()+rom_size-tx_size;
|
||||
UINT8 *dst = memregion("fixed")->base();
|
||||
int rom_size = current_sprites_region_size;
|
||||
int tx_size = current_fixed_region_size;
|
||||
UINT8 *src = current_sprites_region+rom_size-tx_size;
|
||||
UINT8 *dst = current_fixed_region;
|
||||
|
||||
for (i = 0;i < tx_size;i++)
|
||||
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
|
||||
@ -658,8 +658,8 @@ void neogeo_state::svcpcb_gfx_decrypt()
|
||||
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = memregion( "sprites" )->bytes();
|
||||
UINT8 *rom = memregion( "sprites" )->base();
|
||||
int rom_size = current_sprites_region_size;
|
||||
UINT8 *rom = current_sprites_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for( i = 0; i < rom_size; i++ )
|
||||
@ -690,8 +690,8 @@ void neogeo_state::svcpcb_gfx_decrypt()
|
||||
void neogeo_state::svcpcb_s1data_decrypt()
|
||||
{
|
||||
int i;
|
||||
UINT8 *s1 = memregion( "fixed" )->base();
|
||||
size_t s1_size = memregion( "fixed" )->bytes();
|
||||
UINT8 *s1 = current_fixed_region;
|
||||
size_t s1_size = current_fixed_region_size;
|
||||
|
||||
for( i = 0; i < s1_size; i++ ) // Decrypt S
|
||||
{
|
||||
@ -707,8 +707,8 @@ void neogeo_state::kf2k3pcb_gfx_decrypt()
|
||||
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = memregion( "sprites" )->bytes();
|
||||
UINT8 *rom = memregion( "sprites" )->base();
|
||||
int rom_size = current_sprites_region_size;
|
||||
UINT8 *rom = current_sprites_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for ( i = 0; i < rom_size; i++ )
|
||||
@ -741,26 +741,26 @@ void neogeo_state::kf2k3pcb_decrypt_s1data()
|
||||
UINT8 *src;
|
||||
UINT8 *dst;
|
||||
int i;
|
||||
int tx_size = memregion( "fixed" )->bytes();
|
||||
int srom_size = memregion( "sprites" )->bytes();
|
||||
int tx_size = current_fixed_region_size;
|
||||
int srom_size = current_sprites_region_size;
|
||||
|
||||
src = memregion( "sprites" )->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S
|
||||
dst = memregion( "fixed" )->base();
|
||||
src = current_sprites_region + srom_size - 0x1000000 - 0x80000; // Decrypt S
|
||||
dst = current_fixed_region;
|
||||
|
||||
for( i = 0; i < tx_size / 2; i++ )
|
||||
{
|
||||
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
|
||||
}
|
||||
|
||||
src = memregion( "sprites" )->base() + srom_size - 0x80000;
|
||||
dst = memregion( "fixed" )->base() + 0x80000;
|
||||
src = current_sprites_region + srom_size - 0x80000;
|
||||
dst = current_fixed_region + 0x80000;
|
||||
|
||||
for( i = 0; i < tx_size / 2; i++ )
|
||||
{
|
||||
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
|
||||
}
|
||||
|
||||
dst = memregion( "fixed" )->base();
|
||||
dst = current_fixed_region;
|
||||
|
||||
for( i = 0; i < tx_size; i++ )
|
||||
{
|
||||
@ -870,9 +870,9 @@ int neogeo_state::m1_address_scramble(int address, UINT16 key)
|
||||
|
||||
void neogeo_state::neogeo_cmc50_m1_decrypt()
|
||||
{
|
||||
UINT8* rom = memregion("audiocrypt")->base();
|
||||
UINT8* rom = current_audiocrypt_region;
|
||||
size_t rom_size = 0x80000;
|
||||
UINT8* rom2 = memregion("audiocpu")->base();
|
||||
UINT8* rom2 = current_audiocpu_region;
|
||||
|
||||
UINT8* buffer = auto_alloc_array(machine(), UINT8, rom_size);
|
||||
|
||||
@ -939,7 +939,7 @@ NeoGeo 'P' ROM encryption
|
||||
/* Kof98 uses an early encryption, quite different from the others */
|
||||
void neogeo_state::kof98_decrypt_68k()
|
||||
{
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x200000);
|
||||
int i, j, k;
|
||||
static const UINT32 sec[]={0x000000,0x100000,0x000004,0x100004,0x10000a,0x00000a,0x10000e,0x00000e};
|
||||
@ -989,7 +989,7 @@ void neogeo_state::kof99_decrypt_68k()
|
||||
UINT16 *rom;
|
||||
int i,j;
|
||||
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
/* swap data lines on the whole ROMs */
|
||||
for (i = 0;i < 0x800000/2;i++)
|
||||
{
|
||||
@ -1008,7 +1008,7 @@ void neogeo_state::kof99_decrypt_68k()
|
||||
}
|
||||
|
||||
/* swap address lines & relocate fixed part */
|
||||
rom = (UINT16 *)memregion("maincpu")->base();
|
||||
rom = (UINT16 *)current_maincpu_region;
|
||||
for (i = 0;i < 0x0c0000/2;i++)
|
||||
{
|
||||
rom[i] = rom[0x700000/2 + BITSWAP24(i,23,22,21,20,19,18,11,6,14,17,16,5,8,10,12,0,4,3,2,7,9,15,13,1)];
|
||||
@ -1022,7 +1022,7 @@ void neogeo_state::garou_decrypt_68k()
|
||||
int i,j;
|
||||
|
||||
/* thanks to Razoola and Mr K for the info */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
/* swap data lines on the whole ROMs */
|
||||
for (i = 0;i < 0x800000/2;i++)
|
||||
{
|
||||
@ -1030,14 +1030,14 @@ void neogeo_state::garou_decrypt_68k()
|
||||
}
|
||||
|
||||
/* swap address lines & relocate fixed part */
|
||||
rom = (UINT16 *)memregion("maincpu")->base();
|
||||
rom = (UINT16 *)current_maincpu_region;
|
||||
for (i = 0;i < 0x0c0000/2;i++)
|
||||
{
|
||||
rom[i] = rom[0x710000/2 + BITSWAP24(i,23,22,21,20,19,18,4,5,16,14,7,9,6,13,17,15,3,1,2,12,11,8,10,0)];
|
||||
}
|
||||
|
||||
/* swap address lines for the banked part */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
for (i = 0;i < 0x800000/2;i+=0x8000/2)
|
||||
{
|
||||
UINT16 buffer[0x8000/2];
|
||||
@ -1056,7 +1056,7 @@ void neogeo_state::garouh_decrypt_68k()
|
||||
int i,j;
|
||||
|
||||
/* thanks to Razoola and Mr K for the info */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
/* swap data lines on the whole ROMs */
|
||||
for (i = 0;i < 0x800000/2;i++)
|
||||
{
|
||||
@ -1064,14 +1064,14 @@ void neogeo_state::garouh_decrypt_68k()
|
||||
}
|
||||
|
||||
/* swap address lines & relocate fixed part */
|
||||
rom = (UINT16 *)memregion("maincpu")->base();
|
||||
rom = (UINT16 *)current_maincpu_region;
|
||||
for (i = 0;i < 0x0c0000/2;i++)
|
||||
{
|
||||
rom[i] = rom[0x7f8000/2 + BITSWAP24(i,23,22,21,20,19,18,5,16,11,2,6,7,17,3,12,8,14,4,0,9,1,10,15,13)];
|
||||
}
|
||||
|
||||
/* swap address lines for the banked part */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
for (i = 0;i < 0x800000/2;i+=0x8000/2)
|
||||
{
|
||||
UINT16 buffer[0x8000/2];
|
||||
@ -1090,7 +1090,7 @@ void neogeo_state::mslug3_decrypt_68k()
|
||||
int i,j;
|
||||
|
||||
/* thanks to Razoola and Mr K for the info */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
/* swap data lines on the whole ROMs */
|
||||
for (i = 0;i < 0x800000/2;i++)
|
||||
{
|
||||
@ -1098,14 +1098,14 @@ void neogeo_state::mslug3_decrypt_68k()
|
||||
}
|
||||
|
||||
/* swap address lines & relocate fixed part */
|
||||
rom = (UINT16 *)memregion("maincpu")->base();
|
||||
rom = (UINT16 *)current_maincpu_region;
|
||||
for (i = 0;i < 0x0c0000/2;i++)
|
||||
{
|
||||
rom[i] = rom[0x5d0000/2 + BITSWAP24(i,23,22,21,20,19,18,15,2,1,13,3,0,9,6,16,4,11,5,7,12,17,14,10,8)];
|
||||
}
|
||||
|
||||
/* swap address lines for the banked part */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
for (i = 0;i < 0x800000/2;i+=0x10000/2)
|
||||
{
|
||||
UINT16 buffer[0x10000/2];
|
||||
@ -1124,7 +1124,7 @@ void neogeo_state::kof2000_decrypt_68k()
|
||||
int i,j;
|
||||
|
||||
/* thanks to Razoola and Mr K for the info */
|
||||
rom = (UINT16 *)(memregion("maincpu")->base() + 0x100000);
|
||||
rom = (UINT16 *)(current_maincpu_region + 0x100000);
|
||||
/* swap data lines on the whole ROMs */
|
||||
for (i = 0;i < 0x800000/2;i++)
|
||||
{
|
||||
@ -1143,7 +1143,7 @@ void neogeo_state::kof2000_decrypt_68k()
|
||||
}
|
||||
|
||||
/* swap address lines & relocate fixed part */
|
||||
rom = (UINT16 *)memregion("maincpu")->base();
|
||||
rom = (UINT16 *)current_maincpu_region;
|
||||
for (i = 0;i < 0x0c0000/2;i++)
|
||||
{
|
||||
rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)];
|
||||
@ -1156,7 +1156,7 @@ void neogeo_state::kof2002_decrypt_68k()
|
||||
{
|
||||
int i;
|
||||
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
|
||||
UINT8 *src = memregion("maincpu")->base()+0x100000;
|
||||
UINT8 *src = current_maincpu_region+0x100000;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x400000);
|
||||
memcpy( dst, src, 0x400000 );
|
||||
for( i=0; i<8; ++i )
|
||||
@ -1171,7 +1171,7 @@ void neogeo_state::matrim_decrypt_68k()
|
||||
{
|
||||
int i;
|
||||
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
|
||||
UINT8 *src = memregion("maincpu")->base()+0x100000;
|
||||
UINT8 *src = current_maincpu_region+0x100000;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x400000);
|
||||
memcpy( dst, src, 0x400000);
|
||||
for( i=0; i<8; ++i )
|
||||
@ -1186,7 +1186,7 @@ void neogeo_state::samsho5_decrypt_68k()
|
||||
{
|
||||
int i;
|
||||
static const int sec[]={0x000000,0x080000,0x700000,0x680000,0x500000,0x180000,0x200000,0x480000,0x300000,0x780000,0x600000,0x280000,0x100000,0x580000,0x400000,0x380000};
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x800000);
|
||||
|
||||
memcpy( dst, src, 0x800000 );
|
||||
@ -1202,7 +1202,7 @@ void neogeo_state::samsh5sp_decrypt_68k()
|
||||
{
|
||||
int i;
|
||||
static const int sec[]={0x000000,0x080000,0x500000,0x480000,0x600000,0x580000,0x700000,0x280000,0x100000,0x680000,0x400000,0x780000,0x200000,0x380000,0x300000,0x180000};
|
||||
UINT8 *src = memregion("maincpu")->base();
|
||||
UINT8 *src = current_maincpu_region;
|
||||
UINT8 *dst = auto_alloc_array(machine(), UINT8, 0x800000);
|
||||
|
||||
memcpy( dst, src, 0x800000 );
|
||||
@ -1222,7 +1222,7 @@ void neogeo_state::mslug5_decrypt_68k()
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = 0x800000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for( i = 0; i < 0x100000; i++ )
|
||||
@ -1267,7 +1267,7 @@ void neogeo_state::svc_px_decrypt()
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = 0x800000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for( i = 0; i < 0x100000; i++ )
|
||||
@ -1311,7 +1311,7 @@ void neogeo_state::kf2k3pcb_decrypt_68k()
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = 0x900000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for (i = 0; i < 0x100000; i++)
|
||||
@ -1354,7 +1354,7 @@ void neogeo_state::kof2003_decrypt_68k()
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = 0x900000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for (i = 0; i < 0x100000; i++)
|
||||
@ -1401,7 +1401,7 @@ void neogeo_state::kof2003h_decrypt_68k()
|
||||
int i;
|
||||
int ofst;
|
||||
int rom_size = 0x900000;
|
||||
UINT8 *rom = memregion( "maincpu" )->base();
|
||||
UINT8 *rom = current_maincpu_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, rom_size );
|
||||
|
||||
for (i = 0; i < 0x100000; i++)
|
||||
@ -1451,8 +1451,8 @@ NeoGeo 'V' (PCM) ROM encryption
|
||||
/* Neo-Pcm2 Drivers for Encrypted V Roms */
|
||||
void neogeo_state::neo_pcm2_snk_1999(int value)
|
||||
{ /* thanks to Elsemi for the NEO-PCM2 info */
|
||||
UINT16 *rom = (UINT16 *)memregion("ymsnd")->base();
|
||||
int size = memregion("ymsnd")->bytes();
|
||||
UINT16 *rom = (UINT16 *)current_ymsnd_region;
|
||||
int size = current_ymsnd_region_size;
|
||||
int i, j;
|
||||
|
||||
if( rom != NULL )
|
||||
@ -1491,7 +1491,7 @@ void neogeo_state::neo_pcm2_swap(int value)
|
||||
{0xcb,0x29,0x7d,0x43,0xd2,0x3a,0xc2,0xb4},
|
||||
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62},
|
||||
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}};
|
||||
UINT8 *src = memregion("ymsnd")->base();
|
||||
UINT8 *src = current_ymsnd_region;
|
||||
UINT8 *buf = auto_alloc_array(machine(), UINT8, 0x1000000);
|
||||
int i, j, d;
|
||||
|
||||
|
@ -91,6 +91,13 @@ WRITE16_MEMBER( neogeo_state::fatfury2_protection_16_w )
|
||||
}
|
||||
}
|
||||
|
||||
void neogeo_state::fatfury2_init_protection()
|
||||
{
|
||||
// hack, if using multiple slots this ends up being called multiple times
|
||||
// it should be part of the cartridge, not global. For now only regster
|
||||
// it for slot 0 to keep legacy MAME use happy.
|
||||
if (current_slot == 0) save_item(NAME(m_fatfury2_prot_data));
|
||||
}
|
||||
|
||||
void neogeo_state::fatfury2_install_protection()
|
||||
{
|
||||
@ -100,7 +107,7 @@ void neogeo_state::fatfury2_install_protection()
|
||||
|
||||
m_fatfury2_prot_data = 0;
|
||||
|
||||
save_item(NAME(m_fatfury2_prot_data));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +121,7 @@ void neogeo_state::fatfury2_install_protection()
|
||||
WRITE16_MEMBER( neogeo_state::kof98_prot_w )
|
||||
{
|
||||
/* info from razoola */
|
||||
UINT16* mem16 = (UINT16*)memregion("maincpu")->base();
|
||||
UINT16* mem16 = (UINT16*)current_maincpu_region;
|
||||
|
||||
switch (data)
|
||||
{
|
||||
@ -205,13 +212,23 @@ READ16_MEMBER( neogeo_state::mslugx_protection_16_r )
|
||||
return res;
|
||||
}
|
||||
|
||||
void neogeo_state::mslugx_init_protection()
|
||||
{ // hack, if using multiple slots this ends up being called multiple times
|
||||
// it should be part of the cartridge, not global. For now only regster
|
||||
// it for slot 0 to keep legacy MAME use happy.
|
||||
if (current_slot == 0)
|
||||
{
|
||||
save_item(NAME(m_mslugx_command));
|
||||
save_item(NAME(m_mslugx_counter));
|
||||
}
|
||||
}
|
||||
|
||||
void neogeo_state::mslugx_install_protection()
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fffe0, 0x2fffef, read16_delegate(FUNC(neogeo_state::mslugx_protection_16_r),this), write16_delegate(FUNC(neogeo_state::mslugx_protection_16_w),this));
|
||||
|
||||
save_item(NAME(m_mslugx_command));
|
||||
save_item(NAME(m_mslugx_counter));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -428,9 +445,17 @@ void neogeo_state::reset_sma_rng()
|
||||
}
|
||||
|
||||
|
||||
void neogeo_state::init_sma(void)
|
||||
{
|
||||
// hack, if using multiple slots this ends up being called multiple times
|
||||
// it should be part of the cartridge, not global. For now only regster
|
||||
// it for slot 0 to keep legacy MAME use happy.
|
||||
if (current_slot == 0) save_item(NAME(m_sma_rng));
|
||||
}
|
||||
|
||||
void neogeo_state::sma_install_random_read_handler(int addr1, int addr2 )
|
||||
{
|
||||
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));
|
||||
@ -544,10 +569,15 @@ WRITE16_MEMBER( neogeo_state::pvc_prot_w )
|
||||
pvc_write_bankswitch(space);
|
||||
}
|
||||
|
||||
void neogeo_state::init_pvc_protection()
|
||||
{
|
||||
// hack, if using multiple slots this ends up being called multiple times
|
||||
// it should be part of the cartridge, not global. For now only regster
|
||||
// it for slot 0 to keep legacy MAME use happy.
|
||||
if (current_slot == 0) save_item(NAME(m_cartridge_ram));
|
||||
}
|
||||
|
||||
void neogeo_state::install_pvc_protection()
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
@ -1372,6 +1372,7 @@ $(MAMEOBJ)/nasco.a: \
|
||||
|
||||
$(MAMEOBJ)/neogeo.a: \
|
||||
$(DRIVERS)/neogeo.o $(VIDEO)/neogeo.o \
|
||||
$(DRIVERS)/neogeomvs.o \
|
||||
$(MACHINE)/neoboot.o \
|
||||
$(MACHINE)/neocrypt.o \
|
||||
$(MACHINE)/neoprot.o \
|
||||
@ -2699,7 +2700,6 @@ $(MACHINE)/megacd.o: $(LAYOUT)/megacd.lh
|
||||
# misc dependencies
|
||||
#-------------------------------------------------
|
||||
|
||||
$(DRIVERS)/neogeo.o: $(MAMESRC)/drivers/neogeo.inc
|
||||
$(VIDEO)/jaguar.o: $(MAMESRC)/video/jagobj.inc \
|
||||
$(MAMESRC)/video/jagblit.inc
|
||||
$(DRIVERS)/model1.o: $(MAMESRC)/includes/model1.h $(MAMESRC)/audio/dsbz80.h
|
||||
|
@ -250,8 +250,8 @@ void neogeo_state::draw_fixed_layer( bitmap_rgb32 &bitmap, int scanline )
|
||||
{
|
||||
int x;
|
||||
|
||||
UINT8* gfx_base = m_fixed_layer_source ? m_region_fixed->base() : m_region_fixedbios->base();
|
||||
UINT32 addr_mask = ( m_fixed_layer_source ? m_region_fixed->bytes() : m_region_fixedbios->bytes() ) - 1;
|
||||
UINT8* gfx_base = m_fixed_layer_source ? current_fixed_region : m_region_fixedbios->base();
|
||||
UINT32 addr_mask = ( m_fixed_layer_source ? current_fixed_region_size : m_region_fixedbios->bytes() ) - 1;
|
||||
UINT16 *video_data = &m_videoram[0x7000 | (scanline >> 3)];
|
||||
UINT32 *pixel_addr = &bitmap.pix32(scanline, NEOGEO_HBEND);
|
||||
|
||||
@ -498,7 +498,7 @@ void neogeo_state::draw_sprites( bitmap_rgb32 &bitmap, int scanline )
|
||||
zoom_x_table = zoom_x_tables[zoom_x];
|
||||
|
||||
/* compute offset in gfx ROM and mask it to the number of bits available */
|
||||
gfx = &m_sprite_gfx[((code << 8) | (sprite_y << 4)) & m_sprite_gfx_address_mask];
|
||||
gfx = &neogeo_cart_table[current_slot].m_sprite_gfx[((code << 8) | (sprite_y << 4)) & neogeo_cart_table[current_slot].m_sprite_gfx_address_mask];
|
||||
|
||||
line_pens = &m_pens[attr >> 8 << 4];
|
||||
|
||||
@ -661,7 +661,7 @@ void neogeo_state::optimize_sprite_data()
|
||||
power of 2 */
|
||||
mask = 0xffffffff;
|
||||
|
||||
len = m_region_sprites->bytes();
|
||||
len = current_sprites_region_size;
|
||||
|
||||
for (bit = 0x80000000; bit != 0; bit >>= 1)
|
||||
{
|
||||
@ -671,11 +671,11 @@ void neogeo_state::optimize_sprite_data()
|
||||
mask >>= 1;
|
||||
}
|
||||
|
||||
m_sprite_gfx.resize(mask + 1);
|
||||
m_sprite_gfx_address_mask = mask;
|
||||
neogeo_cart_table[current_slot].m_sprite_gfx.resize(mask + 1);
|
||||
neogeo_cart_table[current_slot].m_sprite_gfx_address_mask = mask;
|
||||
|
||||
src = m_region_sprites->base();
|
||||
dest = m_sprite_gfx;
|
||||
src = current_sprites_region;
|
||||
dest = neogeo_cart_table[current_slot].m_sprite_gfx;
|
||||
|
||||
for (unsigned i = 0; i < len; i += 0x80, src += 0x80)
|
||||
{
|
||||
@ -832,7 +832,6 @@ void neogeo_state::video_start()
|
||||
create_sprite_line_timer();
|
||||
create_auto_animation_timer();
|
||||
|
||||
m_sprite_gfx_address_mask = 0;
|
||||
optimize_sprite_data();
|
||||
|
||||
/* initialize values that are not modified on a reset */
|
||||
|
@ -191,6 +191,7 @@ public:
|
||||
DECLARE_DRIVER_INIT(neocdzj);
|
||||
|
||||
IRQ_CALLBACK_MEMBER(neocd_int_callback);
|
||||
void common_aes_init();
|
||||
|
||||
protected:
|
||||
required_ioport m_io_in2;
|
||||
@ -992,7 +993,7 @@ void ng_aes_state::common_machine_start()
|
||||
neogeo_main_cpu_banking_init();
|
||||
|
||||
/* set the initial audio CPU ROM banks */
|
||||
neogeo_audio_cpu_banking_init();
|
||||
neogeo_audio_cpu_banking_init(1);
|
||||
|
||||
create_interrupt_timers();
|
||||
|
||||
@ -1586,8 +1587,27 @@ ROM_END
|
||||
|
||||
#define rom_neocdzj rom_neocdz
|
||||
|
||||
void ng_aes_state::common_aes_init()
|
||||
{
|
||||
current_maincpu_region = memregion("maincpu")->base();
|
||||
current_maincpu_region_size = memregion("maincpu")->bytes();
|
||||
current_ymsnd_region = memregion("ymsnd")->base();
|
||||
current_ymsnd_region_size = memregion("ymsnd")->bytes();
|
||||
current_sprites_region = memregion("sprites")->base();
|
||||
current_sprites_region_size = memregion("sprites")->bytes();
|
||||
current_fixed_region = memregion("fixed")->base();
|
||||
current_fixed_region_size = memregion("fixed")->bytes();
|
||||
current_audiocpu_region = memregion("audiocpu")->base();
|
||||
current_audiocpu_region_size = memregion("audiocpu")->bytes();
|
||||
current_audiocrypt_region = memregion("audiocrypt")->base();
|
||||
current_audiocrypt_region_size = memregion("audiocrypt")->bytes();
|
||||
current_ymdelta_region = memregion("ymsnd.deltat")->base();
|
||||
current_ymdelta_region_size = memregion("ymsnd.deltat")->bytes();
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(ng_aes_state,neogeo)
|
||||
{
|
||||
common_aes_init();
|
||||
}
|
||||
|
||||
|
||||
@ -1596,11 +1616,13 @@ CONS( 1990, aes, 0, 0, aes, aes, ng_aes_state, neogeo, "SNK",
|
||||
|
||||
DRIVER_INIT_MEMBER(ng_aes_state,neocdz)
|
||||
{
|
||||
common_aes_init();
|
||||
NeoSystem = NEOCD_REGION_US;
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(ng_aes_state,neocdzj)
|
||||
{
|
||||
common_aes_init();
|
||||
NeoSystem = NEOCD_REGION_JAPAN;
|
||||
}
|
||||
|
||||
|
@ -1832,6 +1832,7 @@ $(MESSOBJ)/snk.a: \
|
||||
$(MAME_MACHINE)/neoprot.o \
|
||||
$(MAME_MACHINE)/neoboot.o \
|
||||
$(MAME_DRIVERS)/neogeo.o \
|
||||
$(MAME_DRIVERS)/neogeomvs.o \
|
||||
$(MESS_DRIVERS)/ngp.o \
|
||||
$(MESS_VIDEO)/k1ge.o \
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user