diff options
Diffstat (limited to 'src/emu/bus/generic')
| -rw-r--r-- | src/emu/bus/generic/carts.c | 4 | ||||
| -rw-r--r-- | src/emu/bus/generic/ram.c | 15 | ||||
| -rw-r--r-- | src/emu/bus/generic/ram.h | 12 | ||||
| -rw-r--r-- | src/emu/bus/generic/rom.c | 9 | ||||
| -rw-r--r-- | src/emu/bus/generic/rom.h | 8 | ||||
| -rw-r--r-- | src/emu/bus/generic/slot.c | 21 | ||||
| -rw-r--r-- | src/emu/bus/generic/slot.h | 10 |
7 files changed, 37 insertions, 42 deletions
diff --git a/src/emu/bus/generic/carts.c b/src/emu/bus/generic/carts.c index 244f9a28b70..91f53077054 100644 --- a/src/emu/bus/generic/carts.c +++ b/src/emu/bus/generic/carts.c @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:etabeta /********************************************************************** - + Generic ROM / RAM socket slots - + **********************************************************************/ diff --git a/src/emu/bus/generic/ram.c b/src/emu/bus/generic/ram.c index 2750cd5de7e..4632c614cbc 100644 --- a/src/emu/bus/generic/ram.c +++ b/src/emu/bus/generic/ram.c @@ -1,21 +1,21 @@ // license:BSD-3-Clause // copyright-holders:etabeta /*********************************************************************************************************** - - + + Generic RAM socket emulation - + This offers generic access to RAM - + generic_ram_plain : returns 0xff when the system reads beyond the end of the RAM - generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with + generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with (RAM size - 1) ) - + TODO: - support variable RAM size - possibly support linear mapping when non-power of 2 RAMs are mapped - add support for 16bit & 32bit RAM access - + ***********************************************************************************************************/ @@ -121,4 +121,3 @@ WRITE8_MEMBER(generic_ram_linear_device::write_ram) { m_ram[offset % m_ram.bytes()] = data; } - diff --git a/src/emu/bus/generic/ram.h b/src/emu/bus/generic/ram.h index be777167a6a..7d5637286f3 100644 --- a/src/emu/bus/generic/ram.h +++ b/src/emu/bus/generic/ram.h @@ -14,14 +14,14 @@ class generic_ram_plain_device : public device_t, public: // construction/destruction generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source); - + // device-level overrides virtual void device_start(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); - + private: UINT32 m_size; }; @@ -35,14 +35,14 @@ class generic_ram_linear_device : public device_t, public: // construction/destruction generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source); - + // device-level overrides virtual void device_start(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); - + private: UINT32 m_size; }; diff --git a/src/emu/bus/generic/rom.c b/src/emu/bus/generic/rom.c index 352acc4c141..fd2107eb798 100644 --- a/src/emu/bus/generic/rom.c +++ b/src/emu/bus/generic/rom.c @@ -4,18 +4,18 @@ Generic ROM emulation (for carts and ROM sockets) - + This offers generic access to a ROM - + generic_rom_plain : returns 0xff when the system reads beyond the end of the ROM generic_rom_linear : maps linearly the ROM in the accessed area (i.e., read offset is masked with (ROM size - 1) ) generic_romram_plain : allows support for carts always containing ROM + RAM (e.g. X07) - + TODO: - possibly support linear mapping when non-power of 2 ROMs are mapped - + ***********************************************************************************************************/ @@ -120,4 +120,3 @@ WRITE8_MEMBER(generic_romram_plain_device::write_ram) if (offset < m_ram.bytes()) m_ram[offset] = data; } - diff --git a/src/emu/bus/generic/rom.h b/src/emu/bus/generic/rom.h index c41fc427018..1a9b0bd1883 100644 --- a/src/emu/bus/generic/rom.h +++ b/src/emu/bus/generic/rom.h @@ -14,7 +14,7 @@ class generic_rom_device : public device_t, public: // construction/destruction generic_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-level overrides virtual void device_start() {} }; @@ -28,7 +28,7 @@ public: // construction/destruction generic_rom_plain_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); generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ16_MEMBER(read16_rom); @@ -43,7 +43,7 @@ class generic_romram_plain_device : public generic_rom_plain_device public: // construction/destruction generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); @@ -57,7 +57,7 @@ class generic_rom_linear_device : public generic_rom_device public: // construction/destruction generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ16_MEMBER(read16_rom); diff --git a/src/emu/bus/generic/slot.c b/src/emu/bus/generic/slot.c index 119478fe38e..40f959e404e 100644 --- a/src/emu/bus/generic/slot.c +++ b/src/emu/bus/generic/slot.c @@ -3,7 +3,7 @@ /*********************************************************************************************************** Generic ROM / RAM Socket and Cartslot device - + This device offers basic RAM / ROM allocation and access The available handlers are suited for any situation where a system opens a @@ -12,12 +12,12 @@ This device is not suited whenever the system exposes additional lines to the socket/slot: e.g. whenever input/output lines are present, whenever there are lines controlling bankswitch / paging, and whenever different - cart configurations have to be supported (like some PCBs containing ROM + cart configurations have to be supported (like some PCBs containing ROM only, and other containing both ROM and RAM) In the latter situations, per-system slot devices have to be created (see e.g. APF cart slot device for an example of a simple device with multiple pcbs supported) - + ***********************************************************************************************************/ @@ -136,15 +136,15 @@ void generic_slot_device::device_config_complete() bool generic_slot_device::call_load() { if (m_cart) - { + { if (!m_device_image_load.isnull()) return m_device_image_load(*this); else { UINT32 len = common_get_size("rom"); - + rom_alloc(len, m_width, m_endianness); - common_load_rom(get_rom_base(), len, "rom"); + common_load_rom(get_rom_base(), len, "rom"); return IMAGE_INIT_PASS; } @@ -189,13 +189,13 @@ void generic_slot_device::get_default_card_software(astring &result) /************************************************** - Implementation - + Implementation + **************************************************/ /*------------------------------------------------- - common_get_size - it gets image file size both + common_get_size - it gets image file size both for fullpath and for softlist -------------------------------------------------*/ @@ -208,7 +208,7 @@ UINT32 generic_slot_device::common_get_size(const char *region) } /*------------------------------------------------- - common_load_rom - it loads from image file both + common_load_rom - it loads from image file both for fullpath and for softlist -------------------------------------------------*/ @@ -283,4 +283,3 @@ WRITE8_MEMBER(generic_slot_device::write_ram) if (m_cart) m_cart->write_ram(space, offset, data); } - diff --git a/src/emu/bus/generic/slot.h b/src/emu/bus/generic/slot.h index 9d90d3a2253..a93d7d8904e 100644 --- a/src/emu/bus/generic/slot.h +++ b/src/emu/bus/generic/slot.h @@ -93,14 +93,14 @@ public: static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_load = callback; } static void static_set_device_unload(device_t &device, device_image_func_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_unload = callback; } - + void set_interface(const char * interface) { m_interface = interface; } void set_default_card(const char * def) { m_default_card = def; } void set_extensions(const char * exts) { m_extensions = exts; } void set_must_be_loaded(bool mandatory) { m_must_be_loaded = mandatory; } void set_width(int width) { m_width = width; } void set_endian(endianness_t end) { m_endianness = end; } - + // device-level overrides virtual void device_start(); virtual void device_config_complete(); @@ -168,11 +168,9 @@ extern const device_type GENERIC_SOCKET; #define MCFG_GENERIC_CARTSLOT_ADD(_tag, _slot_intf, _dev_intf) \ MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \ - MCFG_GENERIC_INTERFACE(_dev_intf) \ - + MCFG_GENERIC_INTERFACE(_dev_intf) #define MCFG_GENERIC_SOCKET_ADD(_tag, _slot_intf, _dev_intf) \ MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \ - MCFG_GENERIC_INTERFACE(_dev_intf) \ - + MCFG_GENERIC_INTERFACE(_dev_intf) #endif |
