summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/gba/rom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/gba/rom.cpp')
-rw-r--r--src/devices/bus/gba/rom.cpp80
1 files changed, 40 insertions, 40 deletions
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)