summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/gba
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
commitddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch)
treea70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/devices/bus/gba
parent333bff8de64dfaeb98134000412796b4fdef970b (diff)
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/devices/bus/gba')
-rw-r--r--src/devices/bus/gba/gba_slot.cpp36
-rw-r--r--src/devices/bus/gba/gba_slot.h38
-rw-r--r--src/devices/bus/gba/rom.cpp80
-rw-r--r--src/devices/bus/gba/rom.h100
4 files changed, 127 insertions, 127 deletions
diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp
index ad03df06299..bfedecb9d0a 100644
--- a/src/devices/bus/gba/gba_slot.cpp
+++ b/src/devices/bus/gba/gba_slot.cpp
@@ -46,17 +46,17 @@ device_gba_cart_interface::~device_gba_cart_interface()
// rom_alloc - alloc the space for the cart
//-------------------------------------------------
-void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag)
+void device_gba_cart_interface::rom_alloc(uint32_t size, const char *tag)
{
if (m_rom == nullptr)
{
if (size < 0x4000000)
// we always alloc 32MB of rom region!
- m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
+ m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
else
{
- m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base();
- m_romhlp = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
+ m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base();
+ m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
}
m_rom_size = size;
}
@@ -67,9 +67,9 @@ void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag)
// nvram_alloc - alloc the space for the ram
//-------------------------------------------------
-void device_gba_cart_interface::nvram_alloc(UINT32 size)
+void device_gba_cart_interface::nvram_alloc(uint32_t size)
{
- m_nvram.resize(size/sizeof(UINT32));
+ m_nvram.resize(size/sizeof(uint32_t));
}
@@ -80,7 +80,7 @@ void device_gba_cart_interface::nvram_alloc(UINT32 size)
//-------------------------------------------------
// gba_cart_slot_device - constructor
//-------------------------------------------------
-gba_cart_slot_device::gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+gba_cart_slot_device::gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, GBA_CART_SLOT, "Game Boy Advance Cartridge Slot", tag, owner, clock, "gba_cart_slot", __FILE__),
device_image_interface(mconfig, *this),
device_slot_interface(mconfig, *this),
@@ -180,8 +180,8 @@ image_init_result gba_cart_slot_device::call_load()
{
if (m_cart)
{
- UINT8 *ROM;
- UINT32 size = (software_entry() != nullptr) ? get_software_region_length("rom") : length();
+ uint8_t *ROM;
+ uint32_t size = (software_entry() != nullptr) ? get_software_region_length("rom") : length();
if (size > 0x4000000)
{
seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a cart larger than 64MB");
@@ -189,7 +189,7 @@ image_init_result gba_cart_slot_device::call_load()
}
m_cart->rom_alloc(size, tag());
- ROM = (UINT8 *)m_cart->get_rom_base();
+ ROM = (uint8_t *)m_cart->get_rom_base();
if (software_entry() == nullptr)
{
@@ -230,7 +230,7 @@ image_init_result gba_cart_slot_device::call_load()
break;
}
if (size == 0x4000000)
- memcpy((UINT8 *)m_cart->get_romhlp_base(), ROM, 0x2000000);
+ memcpy((uint8_t *)m_cart->get_romhlp_base(), ROM, 0x2000000);
if (m_cart->get_nvram_size())
battery_load(m_cart->get_nvram_base(), m_cart->get_nvram_size(), 0x00);
@@ -259,7 +259,7 @@ void gba_cart_slot_device::call_unload()
fullpath
-------------------------------------------------*/
-static inline std::string gba_chip_string( UINT32 chip )
+static inline std::string gba_chip_string( uint32_t chip )
{
std::string str;
if (chip == 0) str += "NONE ";
@@ -276,7 +276,7 @@ static inline std::string gba_chip_string( UINT32 chip )
}
-static inline int gba_chip_has_conflict( UINT32 chip )
+static inline int gba_chip_has_conflict( uint32_t chip )
{
int count1 = 0, count2 = 0;
if (chip & GBA_CHIP_EEPROM) count1++;
@@ -290,9 +290,9 @@ static inline int gba_chip_has_conflict( UINT32 chip )
}
-int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
+int gba_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len)
{
- UINT32 chip = 0;
+ uint32_t chip = 0;
int type = GBA_STD;
bool has_rtc = false;
bool has_rumble = false;
@@ -432,8 +432,8 @@ std::string gba_cart_slot_device::get_default_card_software()
if (open_image_file(mconfig().options()))
{
const char *slot_string;
- UINT32 len = m_file->size();
- std::vector<UINT8> rom(len);
+ uint32_t len = m_file->size();
+ std::vector<uint8_t> rom(len);
int type;
m_file->read(&rom[0], len);
@@ -500,6 +500,6 @@ WRITE32_MEMBER(gba_cart_slot_device::write_gpio)
Internal header logging
-------------------------------------------------*/
-void gba_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
+void gba_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len)
{
}
diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h
index f9918744d97..b78e29b6a7a 100644
--- a/src/devices/bus/gba/gba_slot.h
+++ b/src/devices/bus/gba/gba_slot.h
@@ -51,24 +51,24 @@ public:
virtual DECLARE_WRITE32_MEMBER(write_tilt) {};
virtual DECLARE_WRITE32_MEMBER(write_mapper) {};
- void rom_alloc(UINT32 size, const char *tag);
- void nvram_alloc(UINT32 size);
- UINT32* get_rom_base() { return m_rom; }
- UINT32* get_romhlp_base() { return m_romhlp; }
- UINT32* get_nvram_base() { return &m_nvram[0]; }
- UINT32 get_rom_size() { return m_rom_size; }
- UINT32 get_romhlp_size() { return m_romhlp_size; }
- UINT32 get_nvram_size() { return m_nvram.size()*sizeof(UINT32); }
- void set_rom_size(UINT32 val) { m_rom_size = val; }
+ void rom_alloc(uint32_t size, const char *tag);
+ void nvram_alloc(uint32_t size);
+ uint32_t* get_rom_base() { return m_rom; }
+ uint32_t* get_romhlp_base() { return m_romhlp; }
+ uint32_t* get_nvram_base() { return &m_nvram[0]; }
+ uint32_t get_rom_size() { return m_rom_size; }
+ uint32_t get_romhlp_size() { return m_romhlp_size; }
+ uint32_t get_nvram_size() { return m_nvram.size()*sizeof(uint32_t); }
+ void set_rom_size(uint32_t val) { m_rom_size = val; }
void save_nvram() { device().save_item(NAME(m_nvram)); }
// internal state
- UINT32 *m_rom; // this points to the cart rom region
- UINT32 m_rom_size; // this is the actual game size, not the rom region size!
- UINT32 *m_romhlp;
- UINT32 m_romhlp_size;
- std::vector<UINT32> m_nvram;
+ uint32_t *m_rom; // this points to the cart rom region
+ uint32_t m_rom_size; // this is the actual game size, not the rom region size!
+ uint32_t *m_romhlp;
+ uint32_t m_romhlp_size;
+ std::vector<uint32_t> m_nvram;
};
@@ -80,7 +80,7 @@ class gba_cart_slot_device : public device_t,
{
public:
// construction/destruction
- gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~gba_cart_slot_device();
// device-level overrides
@@ -93,12 +93,12 @@ public:
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
int get_type() { return m_type; }
- int get_cart_type(UINT8 *ROM, UINT32 len);
+ int get_cart_type(uint8_t *ROM, uint32_t len);
- void internal_header_logging(UINT8 *ROM, UINT32 len);
+ void internal_header_logging(uint8_t *ROM, uint32_t len);
void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
- UINT32 get_rom_size() { if (m_cart) return m_cart->get_rom_size(); return 0; }
+ uint32_t get_rom_size() { if (m_cart) return m_cart->get_rom_size(); return 0; }
virtual iodevice_t image_type() const override { return IO_CARTSLOT; }
virtual bool is_readable() const override { return 1; }
@@ -168,7 +168,7 @@ extern const device_type GBA_CART_SLOT;
struct gba_chip_fix_conflict_item
{
char game_code[5];
- UINT32 chip;
+ uint32_t chip;
};
static const gba_chip_fix_conflict_item gba_chip_fix_conflict_list[] =
diff --git a/src/devices/bus/gba/rom.cpp b/src/devices/bus/gba/rom.cpp
index 4f10bbb0733..7080a60dc01 100644
--- a/src/devices/bus/gba/rom.cpp
+++ b/src/devices/bus/gba/rom.cpp
@@ -36,111 +36,111 @@ const device_type GBA_ROM_FLASH1M_RTC = &device_creator<gba_rom_flash1m_rtc_devi
const device_type GBA_ROM_3DMATRIX = &device_creator<gba_rom_3dmatrix_device>;
-gba_rom_device::gba_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)
+gba_rom_device::gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_gba_cart_interface( mconfig, *this )
{
}
-gba_rom_device::gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_device::gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, GBA_ROM_STD, "GBA Carts", tag, owner, clock, "gba_rom", __FILE__),
device_gba_cart_interface( mconfig, *this )
{
}
-gba_rom_sram_device::gba_rom_sram_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)
+gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
{
}
-gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_SRAM, "GBA Carts + SRAM", tag, owner, clock, "gba_sram", __FILE__)
{
}
-gba_rom_drilldoz_device::gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_drilldoz_device::gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_sram_device(mconfig, GBA_ROM_DRILLDOZ, "GBA Carts + SRAM + Rumble", tag, owner, clock, "gba_drilldoz", __FILE__)
{
}
-gba_rom_wariotws_device::gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_wariotws_device::gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_sram_device(mconfig, GBA_ROM_WARIOTWS, "GBA Carts + SRAM + Rumble + Gyroscope", tag, owner, clock, "gba_wariotws", __FILE__),
m_gyro_z(*this, "GYROZ")
{
}
-gba_rom_eeprom_device::gba_rom_eeprom_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)
+gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
{
}
-gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_EEPROM, "GBA Carts + EEPROM", tag, owner, clock, "gba_eeprom", __FILE__)
{
}
-gba_rom_yoshiug_device::gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_yoshiug_device::gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_eeprom_device(mconfig, GBA_ROM_YOSHIUG, "GBA Carts + EEPROM + Tilt Sensor", tag, owner, clock, "gba_yoshiug", __FILE__),
m_tilt_x(*this, "TILTX"),
m_tilt_y(*this, "TILTY")
{
}
-gba_rom_eeprom64_device::gba_rom_eeprom64_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)
+gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
{
}
-gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_EEPROM64, "GBA Carts + EEPROM 64K", tag, owner, clock, "gba_eeprom64", __FILE__)
{
}
-gba_rom_boktai_device::gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_boktai_device::gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_eeprom64_device(mconfig, GBA_ROM_BOKTAI, "GBA Carts + EEPROM 64K + RTC", tag, owner, clock, "gba_boktai", __FILE__),
m_sensor(*this, "LIGHTSENSE")
{
}
-gba_rom_flash_device::gba_rom_flash_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)
+gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_flash_mask(0),
m_flash(*this, "flash")
{
}
-gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_FLASH, "GBA Carts + Panasonic Flash", tag, owner, clock, "gba_flash", __FILE__),
m_flash_mask(0),
m_flash(*this, "flash")
{
}
-gba_rom_flash_rtc_device::gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_flash_rtc_device::gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_flash_device(mconfig, GBA_ROM_FLASH_RTC, "GBA Carts + Panasonic Flash + RTC", tag, owner, clock, "gba_flash_rtc", __FILE__)
{
}
-gba_rom_flash1m_device::gba_rom_flash1m_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)
+gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_flash_mask(0),
m_flash(*this, "flash")
{
}
-gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_FLASH1M, "GBA Carts + Sanyo Flash", tag, owner, clock, "gba_flash1m", __FILE__),
m_flash_mask(0),
m_flash(*this, "flash")
{
}
-gba_rom_flash1m_rtc_device::gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_flash1m_rtc_device::gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_flash1m_device(mconfig, GBA_ROM_FLASH1M_RTC, "GBA Carts + Sanyo Flash + RTC", tag, owner, clock, "gba_flash1m_rtc", __FILE__)
{
}
-gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: gba_rom_device(mconfig, GBA_ROM_3DMATRIX, "GBA Carts + 3D Matrix Memory Mapper", tag, owner, clock, "gba_3dmatrix", __FILE__)
{
}
@@ -194,7 +194,7 @@ void gba_rom_eeprom_device::device_start()
{
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
nvram_alloc(0x200);
- m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 6);
+ m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (uint8_t*)get_nvram_base(), get_nvram_size(), 6);
}
void gba_rom_yoshiug_device::device_start()
@@ -217,7 +217,7 @@ void gba_rom_eeprom64_device::device_start()
{
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
nvram_alloc(0x2000);
- m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14);
+ m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (uint8_t*)get_nvram_base(), get_nvram_size(), 14);
}
void gba_rom_boktai_device::device_start()
@@ -287,7 +287,7 @@ READ32_MEMBER(gba_rom_device::read_gpio)
default:
if (ACCESSING_BITS_0_15)
{
- UINT16 ret = gpio_dev_read(m_gpio_dirs);
+ uint16_t ret = gpio_dev_read(m_gpio_dirs);
return ret;
}
if (ACCESSING_BITS_16_31)
@@ -355,7 +355,7 @@ WRITE32_MEMBER(gba_rom_sram_device::write_ram)
// SRAM cart variant with additional Rumble motor (used by Drill Dozer)
-void gba_rom_drilldoz_device::gpio_dev_write(UINT16 data, int gpio_dirs)
+void gba_rom_drilldoz_device::gpio_dev_write(uint16_t data, int gpio_dirs)
{
if ((gpio_dirs & 0x08))
{
@@ -377,7 +377,7 @@ ioport_constructor gba_rom_wariotws_device::device_input_ports() const
return INPUT_PORTS_NAME( wariotws_gyroscope );
}
-UINT16 gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs)
+uint16_t gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs)
{
int gyro = 0;
if (gpio_dirs == 0x0b)
@@ -385,7 +385,7 @@ UINT16 gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs)
return (gyro << 2);
}
-void gba_rom_wariotws_device::gpio_dev_write(UINT16 data, int gpio_dirs)
+void gba_rom_wariotws_device::gpio_dev_write(uint16_t data, int gpio_dirs)
{
if ((gpio_dirs & 0x08))
{
@@ -423,7 +423,7 @@ machine_config_constructor gba_rom_flash_device::device_mconfig_additions() cons
READ32_MEMBER(gba_rom_flash_device::read_ram)
{
- UINT32 rv = 0;
+ uint32_t rv = 0;
offset &= m_flash_mask;
@@ -474,7 +474,7 @@ machine_config_constructor gba_rom_flash1m_device::device_mconfig_additions() co
READ32_MEMBER(gba_rom_flash1m_device::read_ram)
{
- UINT32 rv = 0;
+ uint32_t rv = 0;
offset &= m_flash_mask;
@@ -515,23 +515,23 @@ WRITE32_MEMBER(gba_rom_flash1m_device::write_ram)
// cart variants with additional S3511 RTC
-UINT16 gba_rom_flash_rtc_device::gpio_dev_read(int gpio_dirs)
+uint16_t gba_rom_flash_rtc_device::gpio_dev_read(int gpio_dirs)
{
return 5 | (m_rtc->read_line() << 1);
}
-void gba_rom_flash_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs)
+void gba_rom_flash_rtc_device::gpio_dev_write(uint16_t data, int gpio_dirs)
{
m_rtc->write(data, gpio_dirs);
}
-UINT16 gba_rom_flash1m_rtc_device::gpio_dev_read(int gpio_dirs)
+uint16_t gba_rom_flash1m_rtc_device::gpio_dev_read(int gpio_dirs)
{
return 5 | (m_rtc->read_line() << 1);
}
-void gba_rom_flash1m_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs)
+void gba_rom_flash1m_rtc_device::gpio_dev_write(uint16_t data, int gpio_dirs)
{
m_rtc->write(data, gpio_dirs);
}
@@ -687,13 +687,13 @@ ioport_constructor gba_rom_boktai_device::device_input_ports() const
return INPUT_PORTS_NAME( boktai_sensor );
}
-UINT16 gba_rom_boktai_device::gpio_dev_read(int gpio_dirs)
+uint16_t gba_rom_boktai_device::gpio_dev_read(int gpio_dirs)
{
int light = (gpio_dirs == 7 && m_counter >= m_sensor->read()) ? 1 : 0;
return 5 | (m_rtc->read_line() << 1) | (light << 3);
}
-void gba_rom_boktai_device::gpio_dev_write(UINT16 data, int gpio_dirs)
+void gba_rom_boktai_device::gpio_dev_write(uint16_t data, int gpio_dirs)
{
m_rtc->write(data, gpio_dirs);
if (gpio_dirs == 7)
@@ -750,7 +750,7 @@ WRITE32_MEMBER(gba_rom_3dmatrix_device::write_mapper)
{
case 0:
if (data == 0x1) // transfer data
- memcpy((UINT8 *)m_romhlp + m_dst, (UINT8 *)m_rom + m_src, m_nblock * 0x200);
+ memcpy((uint8_t *)m_romhlp + m_dst, (uint8_t *)m_rom + m_src, m_nblock * 0x200);
else
printf("Unknown mapper command 0x%X\n", data);
break;
@@ -799,7 +799,7 @@ gba_s3511_device::gba_s3511_device(running_machine &machine) :
}
-UINT8 gba_s3511_device::convert_to_bcd(int val)
+uint8_t gba_s3511_device::convert_to_bcd(int val)
{
return (((val % 100) / 10) << 4) | (val % 10);
}
@@ -850,7 +850,7 @@ int gba_s3511_device::read_line()
}
-void gba_s3511_device::write(UINT16 data, int gpio_dirs)
+void gba_s3511_device::write(uint16_t data, int gpio_dirs)
{
// printf("gpio_dev_write data %X\n", data);
if (m_phase == S3511_RTC_IDLE && (m_last_val & 5) == 1 && (data & 5) == 5)
@@ -947,7 +947,7 @@ void gba_s3511_device::write(UINT16 data, int gpio_dirs)
//
-gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits) :
+gba_eeprom_device::gba_eeprom_device(running_machine &machine, uint8_t *eeprom, uint32_t size, int addr_bits) :
m_state(EEP_IDLE),
m_machine(machine)
{
@@ -963,9 +963,9 @@ gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UI
m_machine.save().save_item(m_eep_data, "GBA_EEPROM/m_eep_data");
}
-UINT32 gba_eeprom_device::read()
+uint32_t gba_eeprom_device::read()
{
- UINT32 out;
+ uint32_t out;
switch (m_state)
{
@@ -1017,7 +1017,7 @@ UINT32 gba_eeprom_device::read()
return 0;
}
-void gba_eeprom_device::write(UINT32 data)
+void gba_eeprom_device::write(uint32_t data)
{
// printf("eeprom_w: %x @ %x (state %d) (PC=%x)\n", data, offset, m_state, space.device().safe_pc());
switch (m_state)
diff --git a/src/devices/bus/gba/rom.h b/src/devices/bus/gba/rom.h
index 13a69c44a65..a7886c79c59 100644
--- a/src/devices/bus/gba/rom.h
+++ b/src/devices/bus/gba/rom.h
@@ -22,16 +22,16 @@ public:
running_machine &machine() const { return m_machine; }
void update_time(int len);
- UINT8 convert_to_bcd(int val);
+ uint8_t convert_to_bcd(int val);
int read_line();
- void write(UINT16 data, int gpio_dirs);
+ void write(uint16_t data, int gpio_dirs);
protected:
int m_phase;
- UINT8 m_last_val, m_bits, m_command;
+ uint8_t m_last_val, m_bits, m_command;
int m_data_len;
- UINT8 m_data[7];
+ uint8_t m_data[7];
running_machine& m_machine;
};
@@ -56,22 +56,22 @@ enum
class gba_eeprom_device
{
public:
- gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits);
+ gba_eeprom_device(running_machine &machine, uint8_t *eeprom, uint32_t size, int addr_bits);
running_machine &machine() const { return m_machine; }
- UINT32 read();
- void write(UINT32 data);
+ uint32_t read();
+ void write(uint32_t data);
protected:
- UINT8 *m_data;
- UINT32 m_data_size;
+ uint8_t *m_data;
+ uint32_t m_data_size;
int m_state;
int m_command;
int m_count;
int m_addr;
int m_bits;
int m_addr_bits;
- UINT8 m_eep_data;
+ uint8_t m_eep_data;
running_machine& m_machine;
};
@@ -85,8 +85,8 @@ class gba_rom_device : public device_t,
{
public:
// construction/destruction
- gba_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);
- gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
@@ -98,12 +98,12 @@ public:
virtual DECLARE_READ32_MEMBER(read_gpio) override;
virtual DECLARE_WRITE32_MEMBER(write_gpio) override;
- virtual UINT16 gpio_dev_read(int gpio_dirs) { return 0; }
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) {}
+ virtual uint16_t gpio_dev_read(int gpio_dirs) { return 0; }
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) {}
private:
- UINT16 m_gpio_regs[4];
- UINT8 m_gpio_write_only, m_gpio_dirs;
+ uint16_t m_gpio_regs[4];
+ uint8_t m_gpio_write_only, m_gpio_dirs;
};
@@ -113,8 +113,8 @@ class gba_rom_sram_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_sram_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);
- gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_sram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram) override;
@@ -128,10 +128,10 @@ class gba_rom_drilldoz_device : public gba_rom_sram_device
{
public:
// construction/destruction
- gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override;
};
@@ -141,7 +141,7 @@ class gba_rom_wariotws_device : public gba_rom_sram_device
{
public:
// construction/destruction
- gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ioport_constructor device_input_ports() const override;
@@ -149,11 +149,11 @@ public:
virtual void device_start() override;
virtual void device_reset() override;
- virtual UINT16 gpio_dev_read(int gpio_dirs) override;
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
+ virtual uint16_t gpio_dev_read(int gpio_dirs) override;
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override;
private:
- UINT8 m_last_val;
+ uint8_t m_last_val;
int m_counter;
required_ioport m_gyro_z;
};
@@ -165,8 +165,8 @@ class gba_rom_flash_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_flash_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);
- gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_flash_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const override;
@@ -177,8 +177,8 @@ public:
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
protected:
- //UINT32 m_flash_size;
- UINT32 m_flash_mask;
+ //uint32_t m_flash_size;
+ uint32_t m_flash_mask;
required_device<intelfsh8_device> m_flash;
};
@@ -189,12 +189,12 @@ class gba_rom_flash_rtc_device : public gba_rom_flash_device
{
public:
// construction/destruction
- gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
- virtual UINT16 gpio_dev_read(int gpio_dirs) override;
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
+ virtual uint16_t gpio_dev_read(int gpio_dirs) override;
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override;
private:
std::unique_ptr<gba_s3511_device> m_rtc;
@@ -207,8 +207,8 @@ class gba_rom_flash1m_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_flash1m_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);
- gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_flash1m_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const override;
@@ -219,8 +219,8 @@ public:
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
protected:
- //UINT32 m_flash_size;
- UINT32 m_flash_mask;
+ //uint32_t m_flash_size;
+ uint32_t m_flash_mask;
required_device<intelfsh8_device> m_flash;
};
@@ -231,12 +231,12 @@ class gba_rom_flash1m_rtc_device : public gba_rom_flash1m_device
{
public:
// construction/destruction
- gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
- virtual UINT16 gpio_dev_read(int gpio_dirs) override;
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
+ virtual uint16_t gpio_dev_read(int gpio_dirs) override;
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override;
private:
std::unique_ptr<gba_s3511_device> m_rtc;
@@ -249,8 +249,8 @@ class gba_rom_eeprom_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_eeprom_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);
- gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
@@ -270,7 +270,7 @@ class gba_rom_yoshiug_device : public gba_rom_eeprom_device
{
public:
// construction/destruction
- gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
@@ -283,7 +283,7 @@ public:
private:
int m_tilt_ready;
- UINT16 m_xpos, m_ypos;
+ uint16_t m_xpos, m_ypos;
required_ioport m_tilt_x;
required_ioport m_tilt_y;
};
@@ -295,8 +295,8 @@ class gba_rom_eeprom64_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_eeprom64_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);
- gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_eeprom64_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
@@ -316,20 +316,20 @@ class gba_rom_boktai_device : public gba_rom_eeprom64_device
{
public:
// construction/destruction
- gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual ioport_constructor device_input_ports() const override;
- virtual UINT16 gpio_dev_read(int gpio_dirs) override;
- virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
+ virtual uint16_t gpio_dev_read(int gpio_dirs) override;
+ virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override;
private:
std::unique_ptr<gba_s3511_device> m_rtc;
required_ioport m_sensor;
- UINT8 m_last_val;
+ uint8_t m_last_val;
int m_counter;
};
@@ -340,7 +340,7 @@ class gba_rom_3dmatrix_device : public gba_rom_device
{
public:
// construction/destruction
- gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
@@ -350,7 +350,7 @@ public:
virtual DECLARE_WRITE32_MEMBER(write_mapper) override;
private:
- UINT32 m_src, m_dst, m_nblock;
+ uint32_t m_src, m_dst, m_nblock;
};