diff options
Diffstat (limited to 'src/devices/bus/neogeo/slot.h')
-rw-r--r-- | src/devices/bus/neogeo/slot.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index 9d1c3cc7424..a90c529eea9 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:S. Smith,David Haywood,Fabio Priuli -#ifndef __NEOGEO_SLOT_H -#define __NEOGEO_SLOT_H +#ifndef MAME_BUS_NEOGEO_SLOT_H +#define MAME_BUS_NEOGEO_SLOT_H + +#pragma once #include "softlist_dev.h" @@ -86,7 +88,6 @@ class device_neogeo_cart_interface : public device_slot_card_interface { public: // construction/destruction - device_neogeo_cart_interface(const machine_config &mconfig, device_t &device); virtual ~device_neogeo_cart_interface(); // reading from ROM @@ -102,7 +103,7 @@ public: virtual uint16_t get_helper() { return 0; } virtual void decrypt_all(DECRYPT_ALL_PARAMS) { }; - virtual int get_fixed_bank_type(void) { return 0; } + virtual int get_fixed_bank_type() { return 0; } void rom_alloc(uint32_t size) { m_rom.resize(size/sizeof(uint16_t)); } uint16_t* get_rom_base() { return m_rom.size() > 0 ? &m_rom[0] : nullptr; } @@ -154,6 +155,8 @@ public: void optimize_sprites(uint8_t* region_sprites, uint32_t region_sprites_size); protected: + device_neogeo_cart_interface(const machine_config &mconfig, device_t &device); + // these are allocated when loading from softlist std::vector<uint16_t> m_rom; std::vector<uint8_t> m_fixed; @@ -189,9 +192,6 @@ public: neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); virtual ~neogeo_cart_slot_device(); - // device-level overrides - virtual void device_start() override; - // image-level overrides virtual image_init_result call_load() override; virtual void call_unload() override; @@ -306,17 +306,13 @@ public: return 0; } - uint8_t* get_sprites_opt_base() { - if (m_cart) return m_cart->get_sprites_opt_base(); else return nullptr; - } - uint32_t get_sprites_opt_size() { - if (m_cart) return m_cart->get_sprites_opt_size(); else return 0; - } + uint8_t* get_sprites_opt_base() { return m_cart ? m_cart->get_sprites_opt_base() : nullptr; } + uint32_t get_sprites_opt_size() { return m_cart ? m_cart->get_sprites_opt_size() : 0; } - int get_fixed_bank_type(void) { if (m_cart) return m_cart->get_fixed_bank_type(); return 0; } - uint32_t get_bank_base(uint16_t sel) { if (m_cart) return m_cart->get_bank_base(sel); return 0; } - uint32_t get_special_bank() { if (m_cart) return m_cart->get_special_bank(); return 0; } - uint16_t get_helper() { if (m_cart) return m_cart->get_helper(); return 0; } + int get_fixed_bank_type() { return m_cart ? m_cart->get_fixed_bank_type() : 0; } + uint32_t get_bank_base(uint16_t sel) { return m_cart ? m_cart->get_bank_base(sel) : 0; } + uint32_t get_special_bank() { return m_cart ? m_cart->get_special_bank() : 0; } + uint16_t get_helper() { return m_cart ? m_cart->get_helper() : 0; } void late_decrypt_all() { if (m_cart) m_cart->decrypt_all( (uint8_t*)get_rom_base(), get_rom_size(), @@ -328,6 +324,10 @@ public: get_audiocrypt_base(), get_audiocrypt_size()); } +protected: + // device-level overrides + virtual void device_start() override; + private: int m_type; device_neogeo_cart_interface* m_cart; @@ -335,7 +335,7 @@ private: // device type definition -extern const device_type NEOGEO_CART_SLOT; +DECLARE_DEVICE_TYPE(NEOGEO_CART_SLOT, neogeo_cart_slot_device) /*************************************************************************** @@ -348,4 +348,4 @@ extern const device_type NEOGEO_CART_SLOT; MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) -#endif +#endif // MAME_BUS_NEOGEO_SLOT_H |