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.cpp52
1 files changed, 34 insertions, 18 deletions
diff --git a/src/devices/bus/gba/rom.cpp b/src/devices/bus/gba/rom.cpp
index e1c61ec0f49..643432b8433 100644
--- a/src/devices/bus/gba/rom.cpp
+++ b/src/devices/bus/gba/rom.cpp
@@ -59,11 +59,13 @@ gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const ch
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, tag, owner, clock)
+ , m_rumble(*this, "Rumble")
{
}
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, tag, owner, clock)
+ , m_rumble(*this, "Rumble")
, m_gyro_z(*this, "GYROZ")
{
}
@@ -162,8 +164,16 @@ void gba_rom_device::device_reset()
m_gpio_dirs = 0;
}
+void gba_rom_drilldoz_device::device_start()
+{
+ gba_rom_device::device_start();
+ m_rumble.resolve();
+}
+
void gba_rom_wariotws_device::device_start()
{
+ gba_rom_device::device_start();
+ m_rumble.resolve();
save_item(NAME(m_last_val));
save_item(NAME(m_counter));
}
@@ -187,6 +197,8 @@ void gba_rom_flash1m_device::device_reset()
void gba_rom_eeprom_device::device_start()
{
+ gba_rom_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_t*)get_nvram_base(), get_nvram_size(), 6);
@@ -232,16 +244,19 @@ void gba_rom_boktai_device::device_reset()
void gba_rom_flash_rtc_device::device_start()
{
+ gba_rom_device::device_start();
m_rtc = std::make_unique<gba_s3511_device>(machine());
}
void gba_rom_flash1m_rtc_device::device_start()
{
+ gba_rom_device::device_start();
m_rtc = std::make_unique<gba_s3511_device>(machine());
}
void gba_rom_3dmatrix_device::device_start()
{
+ gba_rom_device::device_start();
save_item(NAME(m_src));
save_item(NAME(m_dst));
save_item(NAME(m_nblock));
@@ -271,7 +286,7 @@ void gba_rom_3dmatrix_device::device_reset()
cart types.
-------------------------------------------------*/
-READ32_MEMBER(gba_rom_device::read_gpio)
+uint32_t gba_rom_device::read_gpio(offs_t offset, uint32_t mem_mask)
{
if (!m_gpio_write_only)
{
@@ -286,6 +301,7 @@ READ32_MEMBER(gba_rom_device::read_gpio)
}
if (ACCESSING_BITS_16_31)
return m_gpio_regs[1] << 16;
+ [[fallthrough]];
case 1:
if (ACCESSING_BITS_0_15)
return m_gpio_regs[2];
@@ -298,7 +314,7 @@ READ32_MEMBER(gba_rom_device::read_gpio)
return m_rom[offset + 0xc4/4];
}
-WRITE32_MEMBER(gba_rom_device::write_gpio)
+void gba_rom_device::write_gpio(offs_t offset, uint32_t data, uint32_t mem_mask)
{
switch (offset)
{
@@ -331,7 +347,7 @@ WRITE32_MEMBER(gba_rom_device::write_gpio)
Carts with SRAM
-------------------------------------------------*/
-READ32_MEMBER(gba_rom_sram_device::read_ram)
+uint32_t gba_rom_sram_device::read_ram(offs_t offset, uint32_t mem_mask)
{
if (!m_nvram.empty() && offset < m_nvram.size())
return m_nvram[offset];
@@ -339,7 +355,7 @@ READ32_MEMBER(gba_rom_sram_device::read_ram)
return 0xffffffff;
}
-WRITE32_MEMBER(gba_rom_sram_device::write_ram)
+void gba_rom_sram_device::write_ram(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (!m_nvram.empty() && offset < m_nvram.size())
COMBINE_DATA(&m_nvram[offset]);
@@ -353,7 +369,7 @@ void gba_rom_drilldoz_device::gpio_dev_write(uint16_t data, int gpio_dirs)
if ((gpio_dirs & 0x08))
{
// send impulse to Rumble sensor
- machine().output().set_value("Rumble", BIT(data, 3));
+ m_rumble = BIT(data, 3);
}
}
@@ -383,7 +399,7 @@ void gba_rom_wariotws_device::gpio_dev_write(uint16_t data, int gpio_dirs)
if ((gpio_dirs & 0x08))
{
// send impulse to Rumble sensor
- machine().output().set_value("Rumble", BIT(data, 3));
+ m_rumble = BIT(data, 3);
}
if (gpio_dirs == 0x0b)
@@ -410,7 +426,7 @@ void gba_rom_flash_device::device_add_mconfig(machine_config &config)
}
-READ32_MEMBER(gba_rom_flash_device::read_ram)
+uint32_t gba_rom_flash_device::read_ram(offs_t offset, uint32_t mem_mask)
{
uint32_t rv = 0;
@@ -428,7 +444,7 @@ READ32_MEMBER(gba_rom_flash_device::read_ram)
return rv;
}
-WRITE32_MEMBER(gba_rom_flash_device::write_ram)
+void gba_rom_flash_device::write_ram(offs_t offset, uint32_t data, uint32_t mem_mask)
{
offset &= m_flash_mask;
@@ -457,7 +473,7 @@ void gba_rom_flash1m_device::device_add_mconfig(machine_config &config)
}
-READ32_MEMBER(gba_rom_flash1m_device::read_ram)
+uint32_t gba_rom_flash1m_device::read_ram(offs_t offset, uint32_t mem_mask)
{
uint32_t rv = 0;
@@ -475,7 +491,7 @@ READ32_MEMBER(gba_rom_flash1m_device::read_ram)
return rv;
}
-WRITE32_MEMBER(gba_rom_flash1m_device::write_ram)
+void gba_rom_flash1m_device::write_ram(offs_t offset, uint32_t data, uint32_t mem_mask)
{
offset &= m_flash_mask;
@@ -526,7 +542,7 @@ void gba_rom_flash1m_rtc_device::gpio_dev_write(uint16_t data, int gpio_dirs)
Carts with EEPROM
-------------------------------------------------*/
-READ32_MEMBER(gba_rom_eeprom_device::read_ram)
+uint32_t gba_rom_eeprom_device::read_ram(offs_t offset, uint32_t mem_mask)
{
// Larger games have smaller access to EERPOM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
@@ -535,7 +551,7 @@ READ32_MEMBER(gba_rom_eeprom_device::read_ram)
return m_eeprom->read();
}
-WRITE32_MEMBER(gba_rom_eeprom_device::write_ram)
+void gba_rom_eeprom_device::write_ram(offs_t offset, uint32_t data, uint32_t mem_mask)
{
// Larger games have smaller access to EEPROM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
@@ -547,7 +563,7 @@ WRITE32_MEMBER(gba_rom_eeprom_device::write_ram)
m_eeprom->write(data);
}
-READ32_MEMBER(gba_rom_eeprom64_device::read_ram)
+uint32_t gba_rom_eeprom64_device::read_ram(offs_t offset, uint32_t mem_mask)
{
// Larger games have smaller access to EERPOM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
@@ -556,7 +572,7 @@ READ32_MEMBER(gba_rom_eeprom64_device::read_ram)
return m_eeprom->read();
}
-WRITE32_MEMBER(gba_rom_eeprom64_device::write_ram)
+void gba_rom_eeprom64_device::write_ram(offs_t offset, uint32_t data, uint32_t mem_mask)
{
// Larger games have smaller access to EEPROM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
@@ -599,7 +615,7 @@ ioport_constructor gba_rom_yoshiug_device::device_input_ports() const
}
-READ32_MEMBER(gba_rom_yoshiug_device::read_tilt)
+uint32_t gba_rom_yoshiug_device::read_tilt(offs_t offset, uint32_t mem_mask)
{
switch (offset)
{
@@ -625,7 +641,7 @@ READ32_MEMBER(gba_rom_yoshiug_device::read_tilt)
return 0xffffffff;
}
-WRITE32_MEMBER(gba_rom_yoshiug_device::write_tilt)
+void gba_rom_yoshiug_device::write_tilt(offs_t offset, uint32_t data)
{
switch (offset)
{
@@ -728,7 +744,7 @@ void gba_rom_boktai_device::gpio_dev_write(uint16_t data, int gpio_dirs)
the cart "range" is accessible...)
-------------------------------------------------*/
-WRITE32_MEMBER(gba_rom_3dmatrix_device::write_mapper)
+void gba_rom_3dmatrix_device::write_mapper(offs_t offset, uint32_t data)
{
//printf("mapper write 0x%.8X - 0x%X\n", offset, data); fflush(stdout);
switch (offset & 3)
@@ -1060,7 +1076,7 @@ void gba_eeprom_device::write(uint32_t data)
if (m_bits == 0)
{
- osd_printf_verbose("%s: EEPROM: %02x to %x\n", machine().describe_context().c_str(), m_eep_data, m_addr);
+ osd_printf_verbose("%s: EEPROM: %02x to %x\n", machine().describe_context(), m_eep_data, m_addr);
if (m_addr >= m_data_size)
fatalerror("eeprom: invalid address (%x)\n", m_addr);