From a219ff2db0e710a7c0779020cd008bfa787579a4 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Fri, 22 Mar 2013 11:03:16 +0000 Subject: [PATCH] (MESS) speeding up slot implementation of the SVP add-on chip. nw. --- src/mess/machine/md_slot.c | 4 ++++ src/mess/machine/md_slot.h | 1 + src/mess/machine/md_svp.c | 19 +++++++++++++++---- src/mess/machine/md_svp.h | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/mess/machine/md_slot.c b/src/mess/machine/md_slot.c index 15ed8cfc401..e6e6976655f 100644 --- a/src/mess/machine/md_slot.c +++ b/src/mess/machine/md_slot.c @@ -335,6 +335,10 @@ bool base_md_cart_slot_device::call_load() if (res == IMAGE_INIT_PASS) { + //speed-up rom access from SVP add-on, if present + if (m_type == SEGA_SVP) + m_cart->set_bank_to_rom("cart_svp", 0x800/2); + // STEP 3: install memory handlers for this type of cart setup_custom_mappers(); diff --git a/src/mess/machine/md_slot.h b/src/mess/machine/md_slot.h index c559dc23caf..7aa79fcc7ce 100644 --- a/src/mess/machine/md_slot.h +++ b/src/mess/machine/md_slot.h @@ -109,6 +109,7 @@ public: virtual UINT16* get_nvram_base() { return m_nvram; }; virtual UINT32 get_rom_size() { return m_rom_size; }; virtual UINT32 get_nvram_size() { return m_nvram_size; }; + virtual void set_bank_to_rom(const char *banktag, UINT32 offset) {}; void rom_map_setup(UINT32 size); UINT32 get_padded_size(UINT32 size); diff --git a/src/mess/machine/md_svp.c b/src/mess/machine/md_svp.c index 8340ea2720e..b7b83277278 100644 --- a/src/mess/machine/md_svp.c +++ b/src/mess/machine/md_svp.c @@ -314,10 +314,10 @@ INPUT_PORTS_END //------------------------------------------------- ADDRESS_MAP_START( md_svp_ssp_map, AS_PROGRAM, 16, md_rom_svp_device ) - AM_RANGE(0x0000, 0x03ff) AM_READ(rom_read1) - AM_RANGE(0x0400, 0xffff) AM_READ(rom_read2) -// AM_RANGE(0x0000, 0x03ff) AM_ROMBANK("bank3") -// AM_RANGE(0x0400, 0xffff) AM_ROMBANK("bank4") +// AM_RANGE(0x0000, 0x03ff) AM_READ(rom_read1) +// AM_RANGE(0x0400, 0xffff) AM_READ(rom_read2) + AM_RANGE(0x0000, 0x03ff) AM_ROMBANK("iram_svp") + AM_RANGE(0x0400, 0xffff) AM_ROMBANK("cart_svp") ADDRESS_MAP_END //------------------------------------------------- @@ -361,6 +361,13 @@ ioport_constructor md_rom_svp_device::device_input_ports() const } +void md_rom_svp_device::set_bank_to_rom(const char *banktag, UINT32 offset) +{ + if (membank(banktag)) + membank(banktag)->set_base(m_rom + offset); +} + + void md_rom_svp_device::device_start() { memset(m_pmac_read, 0, ARRAY_LENGTH(m_pmac_read)); @@ -373,8 +380,12 @@ void md_rom_svp_device::device_start() m_xst2 = 0; /* SVP stuff */ + // DRAM m_dram = auto_alloc_array(machine(), UINT8, 0x20000); + // IRAM m_iram = auto_alloc_array(machine(), UINT8, 0x800); + this->membank("iram_svp")->set_base(m_iram); + // the other bank, "cart_svp", is setup at call_load } READ16_MEMBER(md_rom_svp_device::read) diff --git a/src/mess/machine/md_svp.h b/src/mess/machine/md_svp.h index f60e53ec0ea..48e50f8b48f 100644 --- a/src/mess/machine/md_svp.h +++ b/src/mess/machine/md_svp.h @@ -24,6 +24,7 @@ public: virtual void device_config_complete() { m_shortname = "md_rom_svp"; } virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; + virtual void set_bank_to_rom(const char *banktag, UINT32 offset); required_device m_svp; required_ioport m_test_ipt;