summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/pce/pce_rom.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/pce/pce_rom.h')
-rw-r--r--src/devices/bus/pce/pce_rom.h50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/devices/bus/pce/pce_rom.h b/src/devices/bus/pce/pce_rom.h
index 7521e764d03..714e891706f 100644
--- a/src/devices/bus/pce/pce_rom.h
+++ b/src/devices/bus/pce/pce_rom.h
@@ -19,7 +19,7 @@ public:
pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
- virtual DECLARE_READ8_MEMBER(read_cart) override;
+ virtual void install_memory_handlers(address_space &space) override;
protected:
pce_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -27,24 +27,10 @@ protected:
// device-level overrides
virtual void device_start() override { }
virtual void device_reset() override { }
-};
-
-// ======================> pce_cdsys3_device
-class pce_cdsys3_device : public pce_rom_device
-{
-public:
- // construction/destruction
- pce_cdsys3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // reading and writing
- virtual DECLARE_READ8_MEMBER(read_cart) override;
- virtual DECLARE_WRITE8_MEMBER(write_cart) override;
+ uint8_t rom_r(offs_t offset);
};
-
-// ======================> pce_populous_device
-
class pce_populous_device : public pce_rom_device
{
public:
@@ -52,11 +38,9 @@ public:
pce_populous_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
- virtual DECLARE_READ8_MEMBER(read_cart) override;
- virtual DECLARE_WRITE8_MEMBER(write_cart) override;
+ virtual void install_memory_handlers(address_space &space) override;
};
-
// ======================> pce_sf2_device
class pce_sf2_device : public pce_rom_device
@@ -66,16 +50,16 @@ public:
pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
- virtual DECLARE_READ8_MEMBER(read_cart) override;
- virtual DECLARE_WRITE8_MEMBER(write_cart) override;
+ virtual void install_memory_handlers(address_space &space) override;
protected:
// device-level overrides
- virtual void device_start() override;
virtual void device_reset() override;
private:
- uint8_t m_bank_base;
+ void bank_w(offs_t offset, uint8_t data);
+
+ memory_bank_creator m_rom_bank;
};
// ======================> pce_tennokoe_device
@@ -88,18 +72,21 @@ public:
pce_tennokoe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
- virtual DECLARE_READ8_MEMBER(read_cart) override;
- virtual DECLARE_WRITE8_MEMBER(write_cart) override;
+ virtual void install_memory_handlers(address_space &space) override;
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void nvram_default() override;
- virtual void nvram_read(emu_file &file) override;
- virtual void nvram_write(emu_file &file) override;
+ virtual bool nvram_read(util::read_stream &file) override;
+ virtual bool nvram_write(util::write_stream &file) override;
private:
+ uint8_t bram_r(offs_t offset);
+ void bram_w(offs_t offset, uint8_t data);
+ void bram_lock_w(offs_t offset, uint8_t data);
+
const uint32_t m_bram_size = 0x800*4;
uint8_t m_bram[0x800*4];
@@ -108,11 +95,10 @@ private:
// device type definition
-DECLARE_DEVICE_TYPE(PCE_ROM_STD, pce_rom_device)
-DECLARE_DEVICE_TYPE(PCE_ROM_CDSYS3, pce_cdsys3_device)
-DECLARE_DEVICE_TYPE(PCE_ROM_POPULOUS, pce_populous_device)
-DECLARE_DEVICE_TYPE(PCE_ROM_SF2, pce_sf2_device)
-DECLARE_DEVICE_TYPE(PCE_ROM_TENNOKOE, pce_tennokoe_device)
+DECLARE_DEVICE_TYPE(PCE_ROM_STD, pce_rom_device)
+DECLARE_DEVICE_TYPE(PCE_ROM_POPULOUS, pce_populous_device)
+DECLARE_DEVICE_TYPE(PCE_ROM_SF2, pce_sf2_device)
+DECLARE_DEVICE_TYPE(PCE_ROM_TENNOKOE, pce_tennokoe_device)
#endif // MAME_BUS_PCE_PCE_ROM_H