diff options
Diffstat (limited to 'src/mame/drivers/rex6000.cpp')
-rw-r--r-- | src/mame/drivers/rex6000.cpp | 100 |
1 files changed, 56 insertions, 44 deletions
diff --git a/src/mame/drivers/rex6000.cpp b/src/mame/drivers/rex6000.cpp index 243388292b9..df2a32b70a1 100644 --- a/src/mame/drivers/rex6000.cpp +++ b/src/mame/drivers/rex6000.cpp @@ -67,20 +67,61 @@ public: m_uart(*this, "ns16550"), m_bankdev0(*this, "bank0"), m_bankdev1(*this, "bank1"), + m_flash0a(*this, "flash0a"), m_flash0b(*this, "flash0b"), + m_flash1a(*this, "flash1a"), + m_flash1b(*this, "flash1b"), m_nvram(*this, "nvram"), m_battery(*this, "BATTERY"), m_pen_x(*this, "PENX"), m_pen_y(*this, "PENY") { } + void rex6000(machine_config &config); + + DECLARE_PALETTE_INIT(rex6000); + DECLARE_QUICKLOAD_LOAD_MEMBER(rex6000); + DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); + DECLARE_WRITE_LINE_MEMBER(serial_irq); + DECLARE_WRITE_LINE_MEMBER(alarm_irq); + + TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1); + TIMER_DEVICE_CALLBACK_MEMBER(irq_timer2); + TIMER_DEVICE_CALLBACK_MEMBER(sec_timer); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_READ8_MEMBER(bankswitch_r); + DECLARE_WRITE8_MEMBER(bankswitch_w); + DECLARE_READ8_MEMBER(lcd_base_r); + DECLARE_WRITE8_MEMBER(lcd_base_w); + DECLARE_READ8_MEMBER(beep_r); + DECLARE_WRITE8_MEMBER(beep_w); + DECLARE_READ8_MEMBER(lcd_io_r); + DECLARE_WRITE8_MEMBER(lcd_io_w); + DECLARE_READ8_MEMBER(irq_r); + DECLARE_WRITE8_MEMBER(irq_w); + DECLARE_READ8_MEMBER(touchscreen_r); + DECLARE_WRITE8_MEMBER(touchscreen_w); + + void rex6000_banked_map(address_map &map); + void rex6000_io(address_map &map); + void rex6000_mem(address_map &map); + required_device<cpu_device> m_maincpu; required_device<ram_device> m_ram; required_device<beep_device> m_beep; required_device<ns16550_device> m_uart; required_device<address_map_bank_device> m_bankdev0; required_device<address_map_bank_device> m_bankdev1; + optional_device<intelfsh8_device> m_flash0a; optional_device<intelfsh8_device> m_flash0b; + optional_device<intelfsh8_device> m_flash1a; + optional_device<intelfsh8_device> m_flash1b; required_shared_ptr<uint8_t> m_nvram; required_ioport m_battery; optional_ioport m_pen_x; @@ -99,35 +140,6 @@ public: uint8_t m_beep_mode; uint8_t m_power_on; - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - DECLARE_READ8_MEMBER( bankswitch_r ); - DECLARE_WRITE8_MEMBER( bankswitch_w ); - DECLARE_READ8_MEMBER( lcd_base_r ); - DECLARE_WRITE8_MEMBER( lcd_base_w ); - DECLARE_READ8_MEMBER( beep_r ); - DECLARE_WRITE8_MEMBER( beep_w ); - DECLARE_READ8_MEMBER( lcd_io_r ); - DECLARE_WRITE8_MEMBER( lcd_io_w ); - DECLARE_READ8_MEMBER( irq_r ); - DECLARE_WRITE8_MEMBER( irq_w ); - DECLARE_READ8_MEMBER( touchscreen_r ); - DECLARE_WRITE8_MEMBER( touchscreen_w ); - DECLARE_WRITE_LINE_MEMBER( alarm_irq ); - DECLARE_WRITE_LINE_MEMBER( serial_irq ); - - DECLARE_PALETTE_INIT(rex6000); - DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); - TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1); - TIMER_DEVICE_CALLBACK_MEMBER(irq_timer2); - TIMER_DEVICE_CALLBACK_MEMBER(sec_timer); - DECLARE_QUICKLOAD_LOAD_MEMBER(rex6000); - void rex6000(machine_config &config); - void rex6000_banked_map(address_map &map); - void rex6000_io(address_map &map); - void rex6000_mem(address_map &map); }; @@ -373,19 +385,19 @@ WRITE8_MEMBER( oz750_state::kb_mask_w ) void rex6000_state::rex6000_banked_map(address_map &map) { - map(0x0000000, 0x00fffff).rw("flash0a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0000000, 0x00fffff).rw(m_flash0a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); map(0x0100000, 0x01fffff).rw(m_flash0b, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); - map(0x0c00000, 0x0cfffff).rw("flash1a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); - map(0x0d00000, 0x0dfffff).rw("flash1b", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); - map(0x1600000, 0x16fffff).rw("flash1a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); - map(0x1700000, 0x17fffff).rw("flash1b", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0c00000, 0x0cfffff).rw(m_flash1a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0d00000, 0x0dfffff).rw(m_flash1b, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x1600000, 0x16fffff).rw(m_flash1a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x1700000, 0x17fffff).rw(m_flash1b, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); map(0x2000000, 0x2007fff).ram().share("nvram"); } void oz750_state::oz750_banked_map(address_map &map) { - map(0x0000000, 0x01fffff).rw("flash0a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); - map(0x0200000, 0x02fffff).mirror(0x100000).rw("flash1a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0000000, 0x01fffff).rw(m_flash0a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0200000, 0x02fffff).mirror(0x100000).rw(m_flash1a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); map(0x0600000, 0x07fffff).rw(FUNC(oz750_state::lcd_io_r), FUNC(oz750_state::lcd_io_w)); map(0x0800000, 0x083ffff).mirror(0x1c0000).ram().share("nvram"); map(0x0a00000, 0x0a3ffff).mirror(0x1c0000).ram(); @@ -395,7 +407,7 @@ void oz750_state::oz750_banked_map(address_map &map) void rex6000_state::rex6000_mem(address_map &map) { map.unmap_value_high(); - map(0x0000, 0x7fff).rw("flash0a", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); + map(0x0000, 0x7fff).rw(m_flash0a, FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)); map(0x8000, 0x9fff).rw(m_bankdev0, FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8)); map(0xa000, 0xbfff).rw(m_bankdev1, FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8)); map(0xc000, 0xffff).bankrw("ram"); //system RAM @@ -771,7 +783,7 @@ int oz750_state::oz_wzd_extract_tag(const std::vector<uint8_t> &data, const char QUICKLOAD_LOAD_MEMBER(oz750_state,oz750) { - address_space* flash = &machine().device("flash0a")->memory().space(0); + address_space* flash = &m_flash0a->memory().space(0); std::vector<uint8_t> data(image.length()); image.fread(&data[0], image.length()); @@ -946,10 +958,10 @@ MACHINE_CONFIG_START(rex6000_state::rex6000) by the flash emulation and I have splitted every bank into a separate device for have a similar behavior. */ - MCFG_FUJITSU_29DL16X_ADD("flash0a") //bank 0 of first flash - MCFG_FUJITSU_29DL16X_ADD("flash0b") //bank 1 of first flash - MCFG_FUJITSU_29DL16X_ADD("flash1a") //bank 0 of second flash - MCFG_FUJITSU_29DL16X_ADD("flash1b") //bank 1 of second flash + MCFG_FUJITSU_29DL16X_ADD(m_flash0a) //bank 0 of first flash + MCFG_FUJITSU_29DL16X_ADD(m_flash0b) //bank 1 of first flash + MCFG_FUJITSU_29DL16X_ADD(m_flash1a) //bank 0 of second flash + MCFG_FUJITSU_29DL16X_ADD(m_flash1b) //bank 1 of second flash /* internal ram */ MCFG_RAM_ADD(RAM_TAG) @@ -1015,8 +1027,8 @@ MACHINE_CONFIG_START(oz750_state::oz750) MCFG_DEVICE_ADD(TC8521_TAG, TC8521, XTAL(32'768)) MCFG_RP5C01_OUT_ALARM_CB(WRITELINE(*this, rex6000_state, alarm_irq)) - MCFG_SHARP_LH28F016S_ADD("flash0a") - MCFG_SHARP_LH28F016S_ADD("flash1a") + MCFG_SHARP_LH28F016S_ADD(m_flash0a) + MCFG_SHARP_LH28F016S_ADD(m_flash1a) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) |