diff options
author | 2014-09-30 06:05:07 +0000 | |
---|---|---|
committer | 2014-09-30 06:05:07 +0000 | |
commit | 5f77979a2c8cd7e215574367cc18b17a521dcdbd (patch) | |
tree | 0cc7dc35c5841b74ea76fe420389bf6926eeee2a /src/emu/bus/vboy/rom.c | |
parent | bf5d2bcf28c9844c53c4b09d805f0c2dff4d69a5 (diff) |
(MESS) converted scv and vboy to use slot devices for
their carts. nw.
Diffstat (limited to 'src/emu/bus/vboy/rom.c')
-rw-r--r-- | src/emu/bus/vboy/rom.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/emu/bus/vboy/rom.c b/src/emu/bus/vboy/rom.c new file mode 100644 index 00000000000..a572c08c367 --- /dev/null +++ b/src/emu/bus/vboy/rom.c @@ -0,0 +1,59 @@ +/*********************************************************************************************************** + + + Nintendo Virtual Boy cart emulation + + + ***********************************************************************************************************/ + + +#include "emu.h" +#include "rom.h" + + +//------------------------------------------------- +// vboy_rom_device - constructor +//------------------------------------------------- + +const device_type VBOY_ROM_STD = &device_creator<vboy_rom_device>; +const device_type VBOY_ROM_EEPROM = &device_creator<vboy_eeprom_device>; + + +vboy_rom_device::vboy_rom_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) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_vboy_cart_interface( mconfig, *this ) +{ +} + +vboy_rom_device::vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, VBOY_ROM_STD, "Nintendo Virtual Boy Carts", tag, owner, clock, "vboy_rom", __FILE__), + device_vboy_cart_interface( mconfig, *this ) +{ +} + +vboy_eeprom_device::vboy_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : vboy_rom_device(mconfig, VBOY_ROM_EEPROM, "Nintendo Virtual Boy Carts + EEPROM", tag, owner, clock, "vboy_eeprom", __FILE__) +{ +} + + +/*------------------------------------------------- + mapper specific handlers + -------------------------------------------------*/ + +READ32_MEMBER(vboy_rom_device::read_cart) +{ + return m_rom[offset & m_rom_mask]; +} + + +READ32_MEMBER(vboy_eeprom_device::read_eeprom) +{ + return m_eeprom[offset]; +} + + +WRITE32_MEMBER(vboy_eeprom_device::write_eeprom) +{ + COMBINE_DATA(&m_eeprom[offset]); +} |