From c69760a0546723c8295d5ea6b46edd91dbf16f6e Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 13 Feb 2018 19:03:28 +0100 Subject: sm510: cleanup memmap declarations (nw) --- src/devices/cpu/sm510/sm500.h | 6 ++++++ src/devices/cpu/sm510/sm500core.cpp | 4 ++-- src/devices/cpu/sm510/sm510.h | 19 +++++++++---------- src/devices/cpu/sm510/sm510core.cpp | 4 ++-- src/devices/cpu/sm510/sm511core.cpp | 12 +++++++++--- src/devices/cpu/sm510/sm590.h | 3 +++ src/devices/cpu/sm510/sm590core.cpp | 4 ++-- src/devices/cpu/sm510/sm5acore.cpp | 4 ++-- 8 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/devices/cpu/sm510/sm500.h b/src/devices/cpu/sm510/sm500.h index 25349ecb1f2..36e361eecdb 100644 --- a/src/devices/cpu/sm510/sm500.h +++ b/src/devices/cpu/sm510/sm500.h @@ -85,6 +85,9 @@ public: protected: sm500_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + void program_1_2k(address_map &map); + void data_4x10x4(address_map &map); + virtual void device_start() override; virtual void device_reset() override; virtual util::disasm_interface *create_disassembler() override; @@ -155,6 +158,9 @@ public: protected: sm5a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + void program_1_8k(address_map &map); + void data_5x13x4(address_map &map); + virtual util::disasm_interface *create_disassembler() override; virtual void execute_one() override; virtual int get_trs_field() override { return 1; } diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp index b276e70e197..a4edbc7d3a4 100644 --- a/src/devices/cpu/sm510/sm500core.cpp +++ b/src/devices/cpu/sm510/sm500core.cpp @@ -21,11 +21,11 @@ DEFINE_DEVICE_TYPE(SM500, sm500_device, "sm500", "SM500") // 1.2K ROM, 4x10x4 RA // internal memory maps -ADDRESS_MAP_START(sm510_base_device::program_1_2k) +ADDRESS_MAP_START(sm500_device::program_1_2k) AM_RANGE(0x000, 0x4bf) AM_ROM ADDRESS_MAP_END -ADDRESS_MAP_START(sm510_base_device::data_4x10x4) +ADDRESS_MAP_START(sm500_device::data_4x10x4) AM_RANGE(0x00, 0x09) AM_RAM AM_RANGE(0x10, 0x19) AM_RAM AM_RANGE(0x20, 0x29) AM_RAM diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h index c5d76d124be..e4805188f75 100644 --- a/src/devices/cpu/sm510/sm510.h +++ b/src/devices/cpu/sm510/sm510.h @@ -138,16 +138,6 @@ public: template static devcb_base &set_write_segc_callback(device_t &device, Object &&cb) { return downcast(device).m_write_segc.set_callback(std::forward(cb)); } template static devcb_base &set_write_segbs_callback(device_t &device, Object &&cb) { return downcast(device).m_write_segbs.set_callback(std::forward(cb)); } - void data_16x2x4(address_map &map); - void data_4x10x4(address_map &map); - void data_5x13x4(address_map &map); - void data_80_48x4(address_map &map); - void data_96_32x4(address_map &map); - void program_1_2k(address_map &map); - void program_1_8k(address_map &map); - void program_1x128x4(address_map &map); - void program_2_7k(address_map &map); - void program_4k(address_map &map); protected: // device-level overrides virtual void device_start() override; @@ -330,6 +320,9 @@ public: sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + void program_2_7k(address_map &map); + void data_96_32x4(address_map &map); + virtual util::disasm_interface *create_disassembler() override; virtual void execute_one() override; virtual void get_opcode_param() override; @@ -348,6 +341,9 @@ public: protected: sm511_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + void program_4k(address_map &map); + void data_96_32x4(address_map &map); + virtual void device_post_load() override { notify_clock_changed(); } virtual void device_reset() override; @@ -363,6 +359,9 @@ class sm512_device : public sm511_device { public: sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + void data_80_48x4(address_map &map); }; diff --git a/src/devices/cpu/sm510/sm510core.cpp b/src/devices/cpu/sm510/sm510core.cpp index e42a9d3ecc7..e09d591a8cd 100644 --- a/src/devices/cpu/sm510/sm510core.cpp +++ b/src/devices/cpu/sm510/sm510core.cpp @@ -20,14 +20,14 @@ DEFINE_DEVICE_TYPE(SM510, sm510_device, "sm510", "SM510") // 2.7Kx8 ROM, 128x4 R // internal memory maps -ADDRESS_MAP_START(sm510_base_device::program_2_7k) +ADDRESS_MAP_START(sm510_device::program_2_7k) AM_RANGE(0x0000, 0x02bf) AM_ROM AM_RANGE(0x0400, 0x06bf) AM_ROM AM_RANGE(0x0800, 0x0abf) AM_ROM AM_RANGE(0x0c00, 0x0ebf) AM_ROM ADDRESS_MAP_END -ADDRESS_MAP_START(sm510_base_device::data_96_32x4) +ADDRESS_MAP_START(sm510_device::data_96_32x4) AM_RANGE(0x00, 0x5f) AM_RAM AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a") AM_RANGE(0x70, 0x7f) AM_RAM AM_SHARE("lcd_ram_b") diff --git a/src/devices/cpu/sm510/sm511core.cpp b/src/devices/cpu/sm510/sm511core.cpp index adb127eb899..02526f925a6 100644 --- a/src/devices/cpu/sm510/sm511core.cpp +++ b/src/devices/cpu/sm510/sm511core.cpp @@ -25,11 +25,17 @@ DEFINE_DEVICE_TYPE(SM512, sm512_device, "sm512", "SM512") // 4Kx8 ROM, 128x4 RAM // internal memory maps -ADDRESS_MAP_START(sm510_base_device::program_4k) +ADDRESS_MAP_START(sm511_device::program_4k) AM_RANGE(0x0000, 0x0fff) AM_ROM ADDRESS_MAP_END -ADDRESS_MAP_START(sm510_base_device::data_80_48x4) +ADDRESS_MAP_START(sm511_device::data_96_32x4) + AM_RANGE(0x00, 0x5f) AM_RAM + AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a") + AM_RANGE(0x70, 0x7f) AM_RAM AM_SHARE("lcd_ram_b") +ADDRESS_MAP_END + +ADDRESS_MAP_START(sm512_device::data_80_48x4) AM_RANGE(0x00, 0x4f) AM_RAM AM_RANGE(0x50, 0x5f) AM_RAM AM_SHARE("lcd_ram_c") AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a") @@ -56,7 +62,7 @@ sm511_device::sm511_device(const machine_config &mconfig, device_type type, cons } sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm511_device(mconfig, SM512, tag, owner, clock, 2, 12, address_map_constructor(FUNC(sm511_device::program_4k), this), 7, address_map_constructor(FUNC(sm511_device::data_80_48x4), this)) + : sm511_device(mconfig, SM512, tag, owner, clock, 2, 12, address_map_constructor(FUNC(sm512_device::program_4k), this), 7, address_map_constructor(FUNC(sm512_device::data_80_48x4), this)) { } diff --git a/src/devices/cpu/sm510/sm590.h b/src/devices/cpu/sm510/sm590.h index c91b9287d63..fa777436aa9 100644 --- a/src/devices/cpu/sm510/sm590.h +++ b/src/devices/cpu/sm510/sm590.h @@ -100,6 +100,9 @@ public: protected: sm590_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + void program_1x128x4(address_map &map); + void data_16x2x4(address_map &map); + virtual void device_reset() override; virtual util::disasm_interface *create_disassembler() override; virtual bool wake_me_up() override; diff --git a/src/devices/cpu/sm510/sm590core.cpp b/src/devices/cpu/sm510/sm590core.cpp index 2ef65f59cd0..9293c2cefd2 100644 --- a/src/devices/cpu/sm510/sm590core.cpp +++ b/src/devices/cpu/sm510/sm590core.cpp @@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(SM590, sm590_device, "sm590", "SM590") // 512x8 ROM, 32x4 RAM //DEFINE_DEVICE_TYPE(SM595, sm595_device, "sm595", "SM595") // 768x8 ROM, 32x4 RAM // internal memory maps -ADDRESS_MAP_START(sm510_base_device::program_1x128x4) +ADDRESS_MAP_START(sm590_device::program_1x128x4) AM_RANGE(0x000, 0x1ff) AM_ROM ADDRESS_MAP_END @@ -35,7 +35,7 @@ static ADDRESS_MAP_START(program_1x128x4_1x128x2, AS_PROGRAM, 8, sm510_base_devi AM_RANGE(0x000, 0x2ff) AM_ROM ADDRESS_MAP_END*/ -ADDRESS_MAP_START(sm510_base_device::data_16x2x4) +ADDRESS_MAP_START(sm590_device::data_16x2x4) AM_RANGE(0x00, 0x0f) AM_RAM AM_RANGE(0x10, 0x1f) AM_RAM ADDRESS_MAP_END diff --git a/src/devices/cpu/sm510/sm5acore.cpp b/src/devices/cpu/sm510/sm5acore.cpp index 561ff81b61e..bbb3dfe02a5 100644 --- a/src/devices/cpu/sm510/sm5acore.cpp +++ b/src/devices/cpu/sm510/sm5acore.cpp @@ -22,12 +22,12 @@ DEFINE_DEVICE_TYPE(KB1013VK12, kb1013vk12_device, "kb1013vk1_2", "KB1013VK1-2") // internal memory maps -ADDRESS_MAP_START(sm510_base_device::program_1_8k) +ADDRESS_MAP_START(sm5a_device::program_1_8k) AM_RANGE(0x000, 0x6ff) AM_ROM AM_RANGE(0x700, 0x73f) AM_ROM AM_MIRROR(0x0c0) ADDRESS_MAP_END -ADDRESS_MAP_START(sm510_base_device::data_5x13x4) +ADDRESS_MAP_START(sm5a_device::data_5x13x4) AM_RANGE(0x00, 0x0b) AM_RAM AM_RANGE(0x0c, 0x0c) AM_RAM AM_MIRROR(0x03) AM_RANGE(0x10, 0x1b) AM_RAM -- cgit v1.2.3