diff options
Diffstat (limited to 'src/devices/bus/ekara/rom.cpp')
-rw-r--r-- | src/devices/bus/ekara/rom.cpp | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/src/devices/bus/ekara/rom.cpp b/src/devices/bus/ekara/rom.cpp index cf244a5c4f0..b957fb7b048 100644 --- a/src/devices/bus/ekara/rom.cpp +++ b/src/devices/bus/ekara/rom.cpp @@ -10,6 +10,7 @@ DEFINE_DEVICE_TYPE(EKARA_ROM_PLAIN, ekara_rom_plain_device, "ekara_rom_plain", "EKARA Cartridge") DEFINE_DEVICE_TYPE(EKARA_ROM_I2C_BASE, ekara_rom_i2c_base_device, "ekara_rom_i2c_base", "EKARA Cartridge with I2C") +DEFINE_DEVICE_TYPE(EKARA_ROM_I2C_24C08_EPITCH, ekara_rom_i2c_24c08_epitch_device, "ekara_rom_i2c_24c08", "EKARA Cartridge with I2C 24C08 (e-pitch)") DEFINE_DEVICE_TYPE(EKARA_ROM_I2C_24LC04, ekara_rom_i2c_24lc04_device, "ekara_rom_i2c_24lc04", "EKARA Cartridge with I2C 24LC04") DEFINE_DEVICE_TYPE(EKARA_ROM_I2C_24LC02, ekara_rom_i2c_24lc02_device, "ekara_rom_i2c_24lc02", "EKARA Cartridge with I2C 24LC02") @@ -24,18 +25,24 @@ ekara_rom_plain_device::ekara_rom_plain_device(const machine_config &mconfig, co { } -ekara_rom_i2c_base_device::ekara_rom_i2c_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - ekara_rom_plain_device(mconfig, EKARA_ROM_I2C_BASE, tag, owner, clock), - m_i2cmem(*this, "i2cmem") -{ -} + ekara_rom_i2c_base_device::ekara_rom_i2c_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : ekara_rom_plain_device(mconfig, type, tag, owner, clock), m_i2cmem(*this, "i2cmem") { + m_buscontrol[0] = m_buscontrol[1] = m_buscontrol[2] = 0x00; +} + +ekara_rom_i2c_base_device::ekara_rom_i2c_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + ekara_rom_i2c_base_device(mconfig, EKARA_ROM_I2C_BASE, tag, owner, clock) +{ } +ekara_rom_i2c_24c08_epitch_device::ekara_rom_i2c_24c08_epitch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + ekara_rom_i2c_base_device(mconfig, EKARA_ROM_I2C_24C08_EPITCH, tag, owner, clock) +{ +} ekara_rom_i2c_24lc04_device::ekara_rom_i2c_24lc04_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ekara_rom_i2c_base_device(mconfig, EKARA_ROM_I2C_24LC04, tag, owner, clock) @@ -75,6 +82,22 @@ WRITE8_MEMBER(ekara_rom_plain_device::write_rom) // i2c base +bool ekara_rom_i2c_base_device::is_read_access_not_rom(void) +{ + return (m_buscontrol[1] & 0x08) ? true : false; +} + +bool ekara_rom_i2c_base_device::is_write_access_not_rom(void) +{ + return (m_buscontrol[0] & 0x08) ? true : false; +} + +WRITE8_MEMBER(ekara_rom_i2c_base_device::write_bus_control) +{ + logerror("ekara_rom_i2c_base_device::write_bus_control %08x %02x\n", offset, data); + m_buscontrol[offset] = data; +} + WRITE8_MEMBER(ekara_rom_i2c_base_device::write_rom) { logerror("ekara_rom_i2c_base_device::write_rom %08x %02x\n", offset, data); @@ -100,6 +123,26 @@ WRITE8_MEMBER(ekara_rom_i2c_base_device::write_extra) m_i2cmem->write_scl((data & 0x02) >> 1); } +// i2c 24c08 (for epitch carts) + +bool ekara_rom_i2c_24c08_epitch_device::is_read_access_not_rom(void) +{ + // write 0x08 before reading from SEEPROM + // reads from 005fffff, cart does no accress decoding + return (m_buscontrol[1] & 0x08) ? true : false; +} + +bool ekara_rom_i2c_24c08_epitch_device::is_write_access_not_rom(void) +{ + // writes 0x05 before writing to SEEPROM + // actually writes to address 3fffff which is where a mirror of the base ROM sits, but clearly all signals route through the cartridge too + // cart does no accress decoding + return (m_buscontrol[1] & 0x04) ? true : false; +} + +MACHINE_CONFIG_START(ekara_rom_i2c_24c08_epitch_device::device_add_mconfig) + I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x400); // 24C08 +MACHINE_CONFIG_END // i2c 24lc04 @@ -121,6 +164,7 @@ MACHINE_CONFIG_END void ekara_cart(device_slot_interface &device) { device.option_add_internal("plain", EKARA_ROM_PLAIN); + device.option_add_internal("rom_24c08_epitch", EKARA_ROM_I2C_24C08_EPITCH); device.option_add_internal("rom_24lc04", EKARA_ROM_I2C_24LC04); device.option_add_internal("rom_24lc02", EKARA_ROM_I2C_24LC02); } |