From f7cd2d14cabdce7571ced441f3d50a05ae320b36 Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 7 Jul 2015 22:29:10 +0200 Subject: [PATCH] Fixed SH-1 internal mem map, nw --- src/emu/cpu/sh2/sh2.c | 12 +++++------- src/emu/cpu/sh2/sh2.h | 3 +-- src/mame/drivers/coolridr.c | 14 +------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c index d826363a28b..6b913d1ef2c 100644 --- a/src/emu/cpu/sh2/sh2.c +++ b/src/emu/cpu/sh2/sh2.c @@ -147,8 +147,8 @@ static ADDRESS_MAP_START( sh2_internal_map, AS_PROGRAM, 32, sh2_device ) AM_RANGE(0xe0000000, 0xffffffff) AM_READWRITE(sh2_internal_r, sh2_internal_w) ADDRESS_MAP_END -static ADDRESS_MAP_START( sh7032_map, AS_PROGRAM, 32, sh2_device ) - +static ADDRESS_MAP_START( sh7032_map, AS_PROGRAM, 32, sh1_device ) + AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o ADDRESS_MAP_END sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -189,9 +189,9 @@ void sh2_device::device_stop() } -sh2_device::sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type) +sh2_device::sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type, address_map_constructor internal_map ) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) - , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(sh2_internal_map)) + , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, internal_map) , m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, 32, 0) , m_is_slave(0) , m_cpu_type(cpu_type) @@ -216,9 +216,7 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch } sh1_device::sh1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sh2_device(mconfig, SH1, "SH-1", tag, owner, clock, "sh1", __FILE__, CPU_TYPE_SH1 ), - m_program_config("program", ENDIANNESS_BIG, 32, 28, 0, ADDRESS_MAP_NAME(sh7032_map)), - m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, 28, 0) + : sh2_device(mconfig, SH1, "SH-1", tag, owner, clock, "sh1", __FILE__, CPU_TYPE_SH1, ADDRESS_MAP_NAME(sh7032_map) ) { } diff --git a/src/emu/cpu/sh2/sh2.h b/src/emu/cpu/sh2/sh2.h index 6f70030f6db..8908cb093f8 100644 --- a/src/emu/cpu/sh2/sh2.h +++ b/src/emu/cpu/sh2/sh2.h @@ -105,7 +105,7 @@ class sh2_device : public cpu_device public: // construction/destruction sh2_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); - sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type); + sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type,address_map_constructor internal_map); static void set_is_slave(device_t &device, int slave) { downcast(device).m_is_slave = slave; } static void set_dma_kludge_callback(device_t &device, sh2_dma_kludge_delegate callback) { downcast(device).m_dma_kludge_cb = callback; } @@ -505,7 +505,6 @@ public: DECLARE_WRITE16_MEMBER(sh7032_w); private: UINT16 m_sh7032_regs[0x200]; - address_space_config m_program_config, m_decrypted_program_config; }; diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c index b3f5474ba52..b420c04066a 100644 --- a/src/mame/drivers/coolridr.c +++ b/src/mame/drivers/coolridr.c @@ -421,9 +421,6 @@ public: DECLARE_WRITE_LINE_MEMBER(scsp1_to_sh1_irq); DECLARE_WRITE_LINE_MEMBER(scsp2_to_sh1_irq); DECLARE_WRITE8_MEMBER(sound_to_sh1_w); - DECLARE_READ16_MEMBER(sh7032_r); - DECLARE_WRITE16_MEMBER(sh7032_w); - UINT16 m_sh7032_regs[0x200]; DECLARE_DRIVER_INIT(coolridr); DECLARE_DRIVER_INIT(aquastge); virtual void machine_start(); @@ -3011,16 +3008,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_sound_dma_w) COMBINE_DATA(&m_sound_dma[offset]); } -/* TODO: place-holder, to be moved in the SH core ... */ -READ16_MEMBER(coolridr_state::sh7032_r) -{ - return m_sh7032_regs[offset]; -} -WRITE16_MEMBER(coolridr_state::sh7032_w) -{ - COMBINE_DATA(&m_sh7032_regs[offset]); -} static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state ) AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_SHARE("share2") // note: SH7032 only supports 64KB @@ -3038,7 +3026,7 @@ static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state ) AM_RANGE(0x05000000, 0x05000fff) AM_RAM AM_RANGE(0x05200000, 0x052001ff) AM_RAM AM_RANGE(0x05300000, 0x0530ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/ - AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o +// AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o AM_RANGE(0x06000000, 0x060001ff) AM_RAM AM_SHARE("nvram") // backup RAM AM_RANGE(0x06100000, 0x06100003) AM_READ_PORT("IN0") AM_WRITE8(lamps_w,0x000000ff) AM_RANGE(0x06100004, 0x06100007) AM_READ_PORT("IN1")