summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/generic/slot.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/generic/slot.h')
-rw-r--r--src/devices/bus/generic/slot.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h
index 014f6ba80fa..c7add69a8bd 100644
--- a/src/devices/bus/generic/slot.h
+++ b/src/devices/bus/generic/slot.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __GENERIC_SLOT_H
-#define __GENERIC_SLOT_H
+#ifndef MAME_BUS_GENERIC_SLOT_H
+#define MAME_BUS_GENERIC_SLOT_H
+
+#pragma once
#include "softlist_dev.h"
@@ -17,7 +19,6 @@ class device_generic_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- device_generic_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~device_generic_cart_interface();
// reading and writing
@@ -40,7 +41,10 @@ public:
uint8_t* get_ram_base() { return &m_ram[0]; }
uint32_t get_ram_size() { return m_ram.size(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
+
+protected:
+ device_generic_cart_interface(const machine_config &mconfig, device_t &device);
// internal state
uint8_t *m_rom;
@@ -144,7 +148,8 @@ public:
virtual void rom_alloc(size_t size, int width, endianness_t end) { if (m_cart) m_cart->rom_alloc(size, width, end, tag()); }
virtual void ram_alloc(uint32_t size) { if (m_cart) m_cart->ram_alloc(size); }
- uint8_t* get_rom_base() {
+ uint8_t* get_rom_base()
+ {
if (m_cart)
{
if (!user_loadable())
@@ -154,7 +159,8 @@ public:
}
return nullptr;
}
- uint32_t get_rom_size() {
+ uint32_t get_rom_size()
+ {
if (m_cart)
{
if (!user_loadable())
@@ -166,10 +172,9 @@ public:
}
uint8_t* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
protected:
-
const char *m_interface;
const char *m_default_card;
const char *m_extensions;
@@ -183,7 +188,7 @@ protected:
// device type definition
-extern const device_type GENERIC_SOCKET;
+DECLARE_DEVICE_TYPE(GENERIC_SOCKET, generic_slot_device)
/***************************************************************************
@@ -203,4 +208,5 @@ extern const device_type GENERIC_SOCKET;
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _default, false) \
MCFG_GENERIC_INTERFACE(_dev_intf)
-#endif
+
+#endif // MAME_BUS_GENERIC_SLOT_H