mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Fixed regression in peps0615 introduced in 635f469c7d
, the game writes to the page buffer then sends a spurious start condition before the stop condition that writes the buffer. [smf]
Created i2cmem sub classes for all used device types, fixed the buffer sizes that were wrong, removed the methods for modifying the data & buffer sizes and changed the drivers to use the correct types. [smf] Switched aa310 & ertictac over to use device/machine/pcf8583.cpp, which is not currently based on i2cmem.cpp but might be worth merging in the future. [smf]
This commit is contained in:
parent
505e8a4310
commit
d3196bd991
@ -82,8 +82,7 @@ void bbc_datacentre_device::device_add_mconfig(machine_config &config)
|
|||||||
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", "hdd", false);
|
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", "hdd", false);
|
||||||
m_ide->irq_handler().set(FUNC(bbc_datacentre_device::irq_w));
|
m_ide->irq_handler().set(FUNC(bbc_datacentre_device::irq_w));
|
||||||
|
|
||||||
/* 24LC512 - 512Kb I2C Serial EEPROM */
|
I2C_24C512(config, m_nvram); // 24LC512
|
||||||
I2CMEM(config, m_nvram).set_page_size(128).set_data_size(0x10000);
|
|
||||||
|
|
||||||
/* import floppy images - delayed to allow RAMFS to initialise before import */
|
/* import floppy images - delayed to allow RAMFS to initialise before import */
|
||||||
QUICKLOAD(config, "import0", "ssd,dsd,img", attotime::from_seconds(1)).set_load_callback(FUNC(bbc_datacentre_device::quickload_cb<0>));
|
QUICKLOAD(config, "import0", "ssd,dsd,img", attotime::from_seconds(1)).set_load_callback(FUNC(bbc_datacentre_device::quickload_cb<0>));
|
||||||
|
@ -148,21 +148,21 @@ bool ekara_rom_i2c_24c08_epitch_device::is_write_access_not_rom(void)
|
|||||||
|
|
||||||
void ekara_rom_i2c_24c08_epitch_device::device_add_mconfig(machine_config &config)
|
void ekara_rom_i2c_24c08_epitch_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x400); // 24C08
|
I2C_24C08(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// i2c 24lc04
|
// i2c 24lc04
|
||||||
|
|
||||||
void ekara_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config)
|
void ekara_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24LC04
|
I2C_24C04(config, "i2cmem", 0); // 24LC04
|
||||||
}
|
}
|
||||||
|
|
||||||
// i2c 24lc02
|
// i2c 24lc02
|
||||||
|
|
||||||
void ekara_rom_i2c_24lc02_device::device_add_mconfig(machine_config &config)
|
void ekara_rom_i2c_24lc02_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02
|
I2C_24C02(config, "i2cmem", 0); // 24LC02
|
||||||
}
|
}
|
||||||
|
|
||||||
// i2c 24lc02 with direct IO port access
|
// i2c 24lc02 with direct IO port access
|
||||||
@ -206,7 +206,7 @@ READ_LINE_MEMBER(ekara_rom_i2c_24lc02_gc0010_device::read_sda )
|
|||||||
|
|
||||||
void ekara_rom_i2c_24lc02_gc0010_device::device_add_mconfig(machine_config &config)
|
void ekara_rom_i2c_24lc02_gc0010_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x100); // 24LC02
|
I2C_24C02(config, "i2cmem", 0); // 24LC02
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ WRITE16_MEMBER(jakks_gamekey_rom_i2c_base_device::write_cart_seeprom)
|
|||||||
|
|
||||||
void jakks_gamekey_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config)
|
void jakks_gamekey_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x200); // 24LC04
|
I2C_24C04(config, "i2cmem", 0); // 24LC04
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void md_seprom_codemast_device::device_add_mconfig(machine_config &config)
|
|||||||
|
|
||||||
void md_seprom_mm96_device::device_add_mconfig(machine_config &config)
|
void md_seprom_mm96_device::device_add_mconfig(machine_config &config)
|
||||||
{
|
{
|
||||||
I2C_24C16A(config, m_i2cmem);
|
I2C_24C16(config, m_i2cmem); // 24C16A
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
I2C Memory
|
I2C Memory
|
||||||
|
|
||||||
Generic ram/rom/eeprom/flash on an i2c bus. Supports specifying the slave address,
|
ram/rom/eeprom/flash on an i2c bus.
|
||||||
the data size & the page size for writing.
|
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
e0,e1,e2 lower 3 bits of the slave address
|
e0,e1,e2 lower 3 bits of the slave address
|
||||||
@ -16,9 +15,11 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
sda serial data
|
sda serial data
|
||||||
|
|
||||||
The memory address is only 8 bits, devices larger than this have multiple slave addresses.
|
The memory address is only 8 bits for devices up to 2048 bytes,
|
||||||
The top five address bits are set at manufacture time, two values are standard.
|
devices from 512 to 2048 bytes occupy multiple slave addresses.
|
||||||
|
|
||||||
|
The top five address bits are set at manufacture time,
|
||||||
|
there are two standard values.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
@ -59,15 +60,16 @@ static inline void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory")
|
|
||||||
DEFINE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device, "x2404p", "X2404P I2C Memory")
|
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device, "24c01", "24C01 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device, "24c01", "24C01 I2C Memory")
|
||||||
|
DEFINE_DEVICE_TYPE(I2C_PCD8572, i2c_pcd8572_device, "pcd8572", "PCD8572 I2C Memory")
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device, "24c02", "24C02 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device, "24c02", "24C02 I2C Memory")
|
||||||
|
DEFINE_DEVICE_TYPE(I2C_M24C02, i2c_m24c02_device, "m24c02", "M24C02 I2C Memory")
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device, "24c04", "24C04 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device, "24c04", "24C04 I2C Memory")
|
||||||
|
DEFINE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device, "x2404p", "X2404P I2C Memory")
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device, "24c08", "24C08 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device, "24c08", "24C08 I2C Memory")
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device, "24c16", "24C16 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device, "24c16", "24C16 I2C Memory")
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C16A, i2c_24c16a_device, "24c16a", "24C16A I2C Memory")
|
|
||||||
DEFINE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device, "24c64", "24C64 I2C Memory")
|
DEFINE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device, "24c64", "24C64 I2C Memory")
|
||||||
|
DEFINE_DEVICE_TYPE(I2C_24C512, i2c_24c512_device, "24c512", "24C512 I2C Memory")
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// LIVE DEVICE
|
// LIVE DEVICE
|
||||||
@ -83,13 +85,15 @@ i2cmem_device::i2cmem_device(
|
|||||||
const char *tag,
|
const char *tag,
|
||||||
device_t *owner,
|
device_t *owner,
|
||||||
uint32_t clock,
|
uint32_t clock,
|
||||||
int page_size,
|
int read_page_size,
|
||||||
|
int write_page_size,
|
||||||
int data_size) :
|
int data_size) :
|
||||||
device_t(mconfig, type, tag, owner, clock),
|
device_t(mconfig, type, tag, owner, clock),
|
||||||
device_nvram_interface(mconfig, *this),
|
device_nvram_interface(mconfig, *this),
|
||||||
m_region(*this, DEVICE_SELF),
|
m_region(*this, DEVICE_SELF),
|
||||||
m_slave_address(I2CMEM_SLAVE_ADDRESS),
|
m_slave_address(I2CMEM_SLAVE_ADDRESS),
|
||||||
m_page_size(page_size),
|
m_read_page_size(read_page_size),
|
||||||
|
m_write_page_size(write_page_size),
|
||||||
m_data_size(data_size),
|
m_data_size(data_size),
|
||||||
m_scl(0),
|
m_scl(0),
|
||||||
m_sdaw(0),
|
m_sdaw(0),
|
||||||
@ -110,48 +114,53 @@ i2cmem_device::i2cmem_device(
|
|||||||
assert(!clock);
|
assert(!clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
i2cmem_device::i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
|
||||||
i2cmem_device(mconfig, I2CMEM, tag, owner, clock, 0, 0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
i2c_x2404p_device::i2c_x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
|
||||||
i2cmem_device(mconfig, I2C_X2404P, tag, owner, clock, 8, 0x200)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
i2c_24c01_device::i2c_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
i2c_24c01_device::i2c_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C01, tag, owner, clock, 4, 0x80)
|
i2cmem_device(mconfig, I2C_24C01, tag, owner, clock, 0, 8, 0x80)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_pcd8572_device::i2c_pcd8572_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
||||||
|
i2cmem_device(mconfig, I2C_PCD8572, tag, owner, clock, 0, 0, 0x80)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_24c02_device::i2c_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
i2c_24c02_device::i2c_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C02, tag, owner, clock, 4, 0x100)
|
i2cmem_device(mconfig, I2C_24C02, tag, owner, clock, 0, 8, 0x100)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_m24c02_device::i2c_m24c02_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
||||||
|
i2cmem_device(mconfig, I2C_M24C02, tag, owner, clock, 0, 16, 0x100)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_24c04_device::i2c_24c04_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
i2c_24c04_device::i2c_24c04_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C04, tag, owner, clock, 8, 0x200)
|
i2cmem_device(mconfig, I2C_24C04, tag, owner, clock, 0, 16, 0x200)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_x2404p_device::i2c_x2404p_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
||||||
|
i2cmem_device(mconfig, I2C_X2404P, tag, owner, clock, 0x100, 8, 0x200)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_24c08_device::i2c_24c08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
i2c_24c08_device::i2c_24c08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C08, tag, owner, clock, 0, 0x400)
|
i2cmem_device(mconfig, I2C_24C08, tag, owner, clock, 0, 16, 0x400)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_24c16_device::i2c_24c16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
i2c_24c16_device::i2c_24c16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C16, tag, owner, clock, 8, 0x800)
|
i2cmem_device(mconfig, I2C_24C16, tag, owner, clock, 0, 16, 0x800)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
i2c_24c16a_device::i2c_24c16a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
|
||||||
i2cmem_device(mconfig, I2C_24C16A, tag, owner, clock, 0, 0x800)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
i2cmem_device(mconfig, I2C_24C64, tag, owner, clock, 8, 0x2000)
|
i2cmem_device(mconfig, I2C_24C64, tag, owner, clock, 0, 32, 0x2000)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_24c512_device::i2c_24c512_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
|
||||||
|
i2cmem_device(mconfig, I2C_24C512, tag, owner, clock, 0, 128, 0x10000)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +171,7 @@ i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *ta
|
|||||||
void i2cmem_device::device_start()
|
void i2cmem_device::device_start()
|
||||||
{
|
{
|
||||||
m_data = std::make_unique<uint8_t []>(m_data_size);
|
m_data = std::make_unique<uint8_t []>(m_data_size);
|
||||||
m_page.resize( m_page_size );
|
m_page.resize( m_write_page_size );
|
||||||
|
|
||||||
save_item( NAME(m_scl) );
|
save_item( NAME(m_scl) );
|
||||||
save_item( NAME(m_sdaw) );
|
save_item( NAME(m_sdaw) );
|
||||||
@ -181,7 +190,7 @@ void i2cmem_device::device_start()
|
|||||||
save_item( NAME(m_page_offset) );
|
save_item( NAME(m_page_offset) );
|
||||||
save_item( NAME(m_page_written_size) );
|
save_item( NAME(m_page_written_size) );
|
||||||
save_pointer( &m_data[0], "m_data", m_data_size );
|
save_pointer( &m_data[0], "m_data", m_data_size );
|
||||||
if ( m_page_size > 0 )
|
if ( m_write_page_size > 0 )
|
||||||
{
|
{
|
||||||
save_item( NAME(m_page) );
|
save_item( NAME(m_page) );
|
||||||
}
|
}
|
||||||
@ -286,13 +295,15 @@ WRITE_LINE_MEMBER( i2cmem_device::write_sda )
|
|||||||
{
|
{
|
||||||
if( m_sdaw )
|
if( m_sdaw )
|
||||||
{
|
{
|
||||||
if( m_state == STATE_DATAIN && m_page_size > 0 )
|
if( m_page_written_size > 0 )
|
||||||
{
|
{
|
||||||
int base = data_offset();
|
int base = data_offset();
|
||||||
int root = base & ~( m_page_size - 1);
|
int root = base & ~( m_write_page_size - 1 );
|
||||||
for( int i=0; i < m_page_written_size; i++)
|
for( int i = 0; i < m_page_written_size; i++ )
|
||||||
m_data[root | ((base + i) & (m_page_size - 1))] = m_page[i];
|
m_data[root | ((base + i) & (m_write_page_size - 1))] = m_page[i];
|
||||||
verboselog( this, 1, "data[ %04x to %04x ] = %x bytes\n", base, root | ((base + m_page_written_size - 1) & (m_page_size - 1)), m_page_written_size );
|
verboselog( this, 1, "data[ %04x to %04x ] = %x bytes\n", base, root | ((base + m_page_written_size - 1) & (m_write_page_size - 1)), m_page_written_size );
|
||||||
|
|
||||||
|
m_page_written_size = 0;
|
||||||
}
|
}
|
||||||
verboselog( this, 1, "stop\n" );
|
verboselog( this, 1, "stop\n" );
|
||||||
m_state = STATE_IDLE;
|
m_state = STATE_IDLE;
|
||||||
@ -373,7 +384,7 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_ADDRESSLOW:
|
case STATE_ADDRESSLOW:
|
||||||
m_byteaddr = m_shift | (skip_addresshigh() ? (m_devsel & DEVSEL_ADDRESS) << 7 : m_addresshigh << 8);
|
m_byteaddr = m_shift | (skip_addresshigh() ? ((m_devsel & DEVSEL_ADDRESS) << 7) & address_mask() : m_addresshigh << 8);
|
||||||
m_page_offset = 0;
|
m_page_offset = 0;
|
||||||
m_page_written_size = 0;
|
m_page_written_size = 0;
|
||||||
|
|
||||||
@ -388,17 +399,17 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl )
|
|||||||
verboselog( this, 0, "write not enabled\n" );
|
verboselog( this, 0, "write not enabled\n" );
|
||||||
m_state = STATE_IDLE;
|
m_state = STATE_IDLE;
|
||||||
}
|
}
|
||||||
else if( m_page_size > 0 )
|
else if( m_write_page_size > 0 )
|
||||||
{
|
{
|
||||||
m_page[ m_page_offset ] = m_shift;
|
m_page[ m_page_offset ] = m_shift;
|
||||||
verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] );
|
verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] );
|
||||||
|
|
||||||
m_page_offset++;
|
m_page_offset++;
|
||||||
if( m_page_offset == m_page_size )
|
if( m_page_offset == m_write_page_size )
|
||||||
m_page_offset = 0;
|
m_page_offset = 0;
|
||||||
m_page_written_size++;
|
m_page_written_size++;
|
||||||
if( m_page_written_size > m_page_size)
|
if( m_page_written_size > m_write_page_size)
|
||||||
m_page_written_size = m_page_size;
|
m_page_written_size = m_write_page_size;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -440,7 +451,7 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl )
|
|||||||
|
|
||||||
m_shift = m_data[offset];
|
m_shift = m_data[offset];
|
||||||
verboselog( this, 1, "data[ %04x ] -> %02x\n", offset, m_shift );
|
verboselog( this, 1, "data[ %04x ] -> %02x\n", offset, m_shift );
|
||||||
m_byteaddr++;
|
m_byteaddr = (m_byteaddr & ~(m_read_page_size - 1)) | ((m_byteaddr + 1) & (m_read_page_size - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sdar = ( m_shift >> 7 ) & 1;
|
m_sdar = ( m_shift >> 7 ) & 1;
|
||||||
|
@ -33,12 +33,7 @@ class i2cmem_device :
|
|||||||
public device_nvram_interface
|
public device_nvram_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
|
||||||
i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
|
||||||
|
|
||||||
i2cmem_device & set_address(int address) { m_slave_address = address; return *this; }
|
i2cmem_device & set_address(int address) { m_slave_address = address; return *this; }
|
||||||
i2cmem_device & set_page_size(int page_size) { m_page_size = page_size; return *this; }
|
|
||||||
i2cmem_device & set_data_size(int data_size) { m_data_size = data_size; return *this; }
|
|
||||||
i2cmem_device & set_e0(int e0) { m_e0 = e0; return *this; }
|
i2cmem_device & set_e0(int e0) { m_e0 = e0; return *this; }
|
||||||
i2cmem_device & set_e1(int e1) { m_e1 = e1; return *this; }
|
i2cmem_device & set_e1(int e1) { m_e1 = e1; return *this; }
|
||||||
i2cmem_device & set_e2(int e2) { m_e2 = e2; return *this; }
|
i2cmem_device & set_e2(int e2) { m_e2 = e2; return *this; }
|
||||||
@ -55,7 +50,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int page_size, int data_size);
|
i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int read_page_size, int write_page_size, int data_size);
|
||||||
|
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
@ -76,7 +71,8 @@ protected:
|
|||||||
// internal state
|
// internal state
|
||||||
std::unique_ptr<uint8_t[]> m_data;
|
std::unique_ptr<uint8_t[]> m_data;
|
||||||
int m_slave_address;
|
int m_slave_address;
|
||||||
int m_page_size;
|
int m_read_page_size;
|
||||||
|
int m_write_page_size;
|
||||||
int m_data_size;
|
int m_data_size;
|
||||||
int m_scl;
|
int m_scl;
|
||||||
int m_sdaw;
|
int m_sdaw;
|
||||||
@ -103,24 +99,27 @@ protected:
|
|||||||
i2c_##name##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); \
|
i2c_##name##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); \
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_I2C_DEVICE(x2404p)
|
DECLARE_I2C_DEVICE(24c01);
|
||||||
DECLARE_I2C_DEVICE(24c01)
|
DECLARE_I2C_DEVICE(pcd8572);
|
||||||
DECLARE_I2C_DEVICE(24c02)
|
DECLARE_I2C_DEVICE(24c02);
|
||||||
DECLARE_I2C_DEVICE(24c04)
|
DECLARE_I2C_DEVICE(m24c02);
|
||||||
DECLARE_I2C_DEVICE(24c08)
|
DECLARE_I2C_DEVICE(24c04);
|
||||||
|
DECLARE_I2C_DEVICE(x2404p);
|
||||||
|
DECLARE_I2C_DEVICE(24c08);
|
||||||
DECLARE_I2C_DEVICE(24c16);
|
DECLARE_I2C_DEVICE(24c16);
|
||||||
DECLARE_I2C_DEVICE(24c16a);
|
|
||||||
DECLARE_I2C_DEVICE(24c64);
|
DECLARE_I2C_DEVICE(24c64);
|
||||||
|
DECLARE_I2C_DEVICE(24c512);
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
DECLARE_DEVICE_TYPE(I2CMEM, i2cmem_device)
|
|
||||||
DECLARE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device)
|
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device)
|
DECLARE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device)
|
||||||
|
DECLARE_DEVICE_TYPE(I2C_PCD8572, i2c_pcd8572_device)
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device)
|
DECLARE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device)
|
||||||
|
DECLARE_DEVICE_TYPE(I2C_M24C02, i2c_m24c02_device)
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device)
|
DECLARE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device)
|
||||||
|
DECLARE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device)
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device)
|
DECLARE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device)
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device)
|
DECLARE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device)
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C16A, i2c_24c16a_device)
|
|
||||||
DECLARE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device)
|
DECLARE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device)
|
||||||
|
DECLARE_DEVICE_TYPE(I2C_24C512, i2c_24c512_device)
|
||||||
|
|
||||||
#endif // MAME_MACHINE_I2CMEM_H
|
#endif // MAME_MACHINE_I2CMEM_H
|
||||||
|
@ -614,7 +614,7 @@ void _4enlinea_state::_4enlinea(machine_config &config)
|
|||||||
audiocpu.set_addrmap(AS_PROGRAM, &_4enlinea_state::audio_map);
|
audiocpu.set_addrmap(AS_PROGRAM, &_4enlinea_state::audio_map);
|
||||||
audiocpu.set_periodic_int(FUNC(_4enlinea_state::_4enlinea_audio_irq), attotime::from_hz(60)); //TODO
|
audiocpu.set_periodic_int(FUNC(_4enlinea_state::_4enlinea_audio_irq), attotime::from_hz(60)); //TODO
|
||||||
|
|
||||||
I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800); // X24C16P
|
I2C_24C16(config, m_eeprom); // X24C16P
|
||||||
|
|
||||||
// FIXME: determine ISA bus clock
|
// FIXME: determine ISA bus clock
|
||||||
isa8_device &isa(ISA8(config, "isa", 0));
|
isa8_device &isa(ISA8(config, "isa", 0));
|
||||||
@ -650,7 +650,7 @@ void _4enlinea_state::k7_olym(machine_config &config)
|
|||||||
|
|
||||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // D4464C-15L (6264) + battery
|
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // D4464C-15L (6264) + battery
|
||||||
|
|
||||||
I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800); // X24C16P
|
I2C_24C16(config, m_eeprom); // X24C16P
|
||||||
|
|
||||||
isa8_device &isa(ISA8(config, "isa", 0));
|
isa8_device &isa(ISA8(config, "isa", 0));
|
||||||
isa.set_memspace("maincpu", AS_PROGRAM);
|
isa.set_memspace("maincpu", AS_PROGRAM);
|
||||||
|
@ -91,7 +91,6 @@
|
|||||||
#include "formats/apd_dsk.h"
|
#include "formats/apd_dsk.h"
|
||||||
#include "formats/jfd_dsk.h"
|
#include "formats/jfd_dsk.h"
|
||||||
#include "formats/pc_dsk.h"
|
#include "formats/pc_dsk.h"
|
||||||
#include "machine/i2cmem.h"
|
|
||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
#include "machine/wd_fdc.h"
|
#include "machine/wd_fdc.h"
|
||||||
#include "sound/volt_reg.h"
|
#include "sound/volt_reg.h"
|
||||||
@ -427,7 +426,7 @@ void aa310_state::aa310(machine_config &config)
|
|||||||
m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w));
|
m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w));
|
||||||
m_kart->out_rx_callback().set(FUNC(archimedes_state::a310_kart_rx_w));
|
m_kart->out_rx_callback().set(FUNC(archimedes_state::a310_kart_rx_w));
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_data_size(0x100);
|
PCF8583(config, "i2cmem", 0);
|
||||||
|
|
||||||
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
|
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
|
||||||
|
|
||||||
|
@ -2123,7 +2123,7 @@ void cd32_state::cd32(machine_config &config)
|
|||||||
|
|
||||||
ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000);
|
ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024);
|
I2C_24C08(config, "i2cmem", 0); // AT24C08N
|
||||||
|
|
||||||
akiko_device &akiko(AKIKO(config, "akiko", 0));
|
akiko_device &akiko(AKIKO(config, "akiko", 0));
|
||||||
akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
|
akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
|
||||||
|
@ -1786,8 +1786,7 @@ void bbcm_state::bbcmc(machine_config &config)
|
|||||||
FLOPPY_CONNECTOR(config, "wd1772:0", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
|
FLOPPY_CONNECTOR(config, "wd1772:0", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
|
||||||
FLOPPY_CONNECTOR(config, "wd1772:1", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
|
FLOPPY_CONNECTOR(config, "wd1772:1", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
|
||||||
|
|
||||||
/* eeprom pcd8572 */
|
I2C_PCD8572(config, "i2cmem", 0);
|
||||||
I2CMEM(config, "i2cmem", 0).set_data_size(0x80);
|
|
||||||
config.device_remove("rtc");
|
config.device_remove("rtc");
|
||||||
|
|
||||||
/* user via */
|
/* user via */
|
||||||
|
@ -1042,7 +1042,7 @@ void cubo_state::cubo(machine_config &config)
|
|||||||
|
|
||||||
ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000);
|
ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024);
|
I2C_24C08(config, "i2cmem", 0); // AT24C08N
|
||||||
|
|
||||||
akiko_device &akiko(AKIKO(config, "akiko", 0));
|
akiko_device &akiko(AKIKO(config, "akiko", 0));
|
||||||
akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
|
akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
|
||||||
|
@ -1062,7 +1062,7 @@ void cxhumax_state::cxhumax(machine_config &config)
|
|||||||
|
|
||||||
|
|
||||||
INTEL_28F320J3D(config, "flash");
|
INTEL_28F320J3D(config, "flash");
|
||||||
I2CMEM(config, "eeprom", 0).set_data_size(0x2000);
|
I2C_24C64(config, "eeprom", 0); // 24LC64
|
||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||||
|
@ -26,7 +26,6 @@ PCB has a single OSC at 24MHz
|
|||||||
#include "includes/archimds.h"
|
#include "includes/archimds.h"
|
||||||
#include "cpu/arm/arm.h"
|
#include "cpu/arm/arm.h"
|
||||||
#include "machine/aakart.h"
|
#include "machine/aakart.h"
|
||||||
#include "machine/i2cmem.h"
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
|
||||||
@ -219,17 +218,13 @@ INTERRUPT_GEN_MEMBER(ertictac_state::ertictac_podule_irq)
|
|||||||
archimedes_request_irq_b(ARCHIMEDES_IRQB_PODULE_IRQ);
|
archimedes_request_irq_b(ARCHIMEDES_IRQB_PODULE_IRQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Are we sure that this HW have I2C device? */
|
|
||||||
#define NVRAM_SIZE 256
|
|
||||||
#define NVRAM_PAGE_SIZE 0 /* max size of one write request */
|
|
||||||
|
|
||||||
void ertictac_state::ertictac(machine_config &config)
|
void ertictac_state::ertictac(machine_config &config)
|
||||||
{
|
{
|
||||||
ARM(config, m_maincpu, 24_MHz_XTAL/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */
|
ARM(config, m_maincpu, 24_MHz_XTAL/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */
|
||||||
m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map);
|
m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map);
|
||||||
m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this
|
m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(NVRAM_PAGE_SIZE).set_data_size(NVRAM_SIZE);
|
PCF8583(config, "i2cmem", 0); // TODO: Are we sure that this HW have I2C device?
|
||||||
|
|
||||||
// AAKART(config, m_kart, 24_MHz_XTAL/3); // TODO: frequency
|
// AAKART(config, m_kart, 24_MHz_XTAL/3); // TODO: frequency
|
||||||
|
|
||||||
|
@ -3123,9 +3123,7 @@ void funworld_state::saloon(machine_config &config)
|
|||||||
config.device_remove("pia1");
|
config.device_remove("pia1");
|
||||||
|
|
||||||
/* Serial Memory */
|
/* Serial Memory */
|
||||||
i2cmem_device &m_i2cmem(I2CMEM(config, "i2cmem", 0));
|
I2C_24C02(config, "i2cmem", 0).set_e0(1); // ? or maybe 2nd half of 24C04?
|
||||||
m_i2cmem.set_data_size(256);
|
|
||||||
m_i2cmem.set_e0(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ void ghosteo_state::ghosteo(machine_config &config)
|
|||||||
// nand.set_nand_type(nand_device::chip::K9F5608U0D); // or another variant with ID 0xEC 0x75 ?
|
// nand.set_nand_type(nand_device::chip::K9F5608U0D); // or another variant with ID 0xEC 0x75 ?
|
||||||
// nand.rnb_wr_callback().set(m_s3c2410, FUNC(s3c2410_device::s3c24xx_pin_frnb_w));
|
// nand.rnb_wr_callback().set(m_s3c2410, FUNC(s3c2410_device::s3c24xx_pin_frnb_w));
|
||||||
|
|
||||||
// I2CMEM(config, "i2cmem", 0, 0xA0, 0, 0x100, nullptr);
|
I2C_24C16(config, "i2cmem", 0); // M24CL16-S
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
SPEAKER(config, "lspeaker").front_left();
|
SPEAKER(config, "lspeaker").front_left();
|
||||||
@ -659,14 +659,12 @@ void ghosteo_state::bballoon(machine_config &config)
|
|||||||
{
|
{
|
||||||
ghosteo(config);
|
ghosteo(config);
|
||||||
m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::bballoon_map);
|
m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::bballoon_map);
|
||||||
I2CMEM(config, "i2cmem", 0).set_data_size(256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ghosteo_state::touryuu(machine_config &config)
|
void ghosteo_state::touryuu(machine_config &config)
|
||||||
{
|
{
|
||||||
ghosteo(config);
|
ghosteo(config);
|
||||||
m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::touryuu_map);
|
m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::touryuu_map);
|
||||||
I2CMEM(config, "i2cmem", 0).set_data_size(1024);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ void hotblock_state::hotblock(machine_config &config)
|
|||||||
m_maincpu->set_addrmap(AS_PROGRAM, &hotblock_state::hotblock_map);
|
m_maincpu->set_addrmap(AS_PROGRAM, &hotblock_state::hotblock_map);
|
||||||
m_maincpu->set_addrmap(AS_IO, &hotblock_state::hotblock_io);
|
m_maincpu->set_addrmap(AS_IO, &hotblock_state::hotblock_io);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04A
|
I2C_24C04(config, "i2cmem", 0); // 24C04A
|
||||||
|
|
||||||
ADDRESS_MAP_BANK(config, m_video_bank).set_map(&hotblock_state::banked_video_map).set_options(ENDIANNESS_LITTLE, 8, 24, 0x10000);
|
ADDRESS_MAP_BANK(config, m_video_bank).set_map(&hotblock_state::banked_video_map).set_options(ENDIANNESS_LITTLE, 8, 24, 0x10000);
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ void microdar_state::microdar(machine_config &config)
|
|||||||
|
|
||||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // GM76C88ALK-15 + battery
|
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // GM76C88ALK-15 + battery
|
||||||
|
|
||||||
I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800);
|
I2C_24C16(config, m_eeprom); // 24LC16B
|
||||||
|
|
||||||
// Code also references some sort of serial RTC?
|
// Code also references some sort of serial RTC?
|
||||||
}
|
}
|
||||||
|
@ -1770,7 +1770,7 @@ void pokemini_state::pokemini(machine_config &config)
|
|||||||
|
|
||||||
config.set_maximum_quantum(attotime::from_hz(60));
|
config.set_maximum_quantum(attotime::from_hz(60));
|
||||||
|
|
||||||
I2CMEM(config, m_i2cmem, 0).set_data_size(0x2000);
|
I2C_24C64(config, m_i2cmem, 0); // ?
|
||||||
|
|
||||||
/* This still needs to be improved to actually match the hardware */
|
/* This still needs to be improved to actually match the hardware */
|
||||||
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
|
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
|
||||||
|
@ -124,7 +124,7 @@ void jakks_state::base_config(machine_config& config)
|
|||||||
m_maincpu->portc_in().set_ioport("P3");
|
m_maincpu->portc_in().set_ioport("P3");
|
||||||
m_maincpu->portc_out().set(FUNC(jakks_state::portc_w));
|
m_maincpu->portc_out().set(FUNC(jakks_state::portc_w));
|
||||||
|
|
||||||
I2CMEM(config, m_i2cmem, 0).set_data_size(0x200);
|
I2C_24C04(config, m_i2cmem, 0); // ?
|
||||||
}
|
}
|
||||||
|
|
||||||
void jakks_state::batman(machine_config &config)
|
void jakks_state::batman(machine_config &config)
|
||||||
|
@ -447,7 +447,7 @@ void jakks_gkr_state::jakks_gkr(machine_config &config)
|
|||||||
void jakks_gkr_state::jakks_gkr_i2c(machine_config &config)
|
void jakks_gkr_state::jakks_gkr_i2c(machine_config &config)
|
||||||
{
|
{
|
||||||
jakks_gkr(config);
|
jakks_gkr(config);
|
||||||
I2CMEM(config, m_i2cmem, 0).set_data_size(0x200);
|
I2C_24C04(config, m_i2cmem, 0); // ?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1115,7 +1115,7 @@ void twinkle_state::twinklex(machine_config &config)
|
|||||||
void twinkle_state::twinklei(machine_config &config)
|
void twinkle_state::twinklei(machine_config &config)
|
||||||
{
|
{
|
||||||
twinkle(config);
|
twinkle(config);
|
||||||
I2CMEM(config, "security", 0).set_data_size(0x100);
|
I2C_M24C02(config, "security", 0); // M24C02-W
|
||||||
}
|
}
|
||||||
|
|
||||||
static INPUT_PORTS_START( twinkle )
|
static INPUT_PORTS_START( twinkle )
|
||||||
|
@ -1562,25 +1562,18 @@ void xavix_guru_state::xavix_guru(machine_config &config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void xavix_i2c_state::xavix_i2c_24lc02(machine_config &config)
|
|
||||||
{
|
|
||||||
xavix(config);
|
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02 (taiko)
|
|
||||||
}
|
|
||||||
|
|
||||||
void xavix_i2c_state::xavix_i2c_24c02(machine_config &config)
|
void xavix_i2c_state::xavix_i2c_24c02(machine_config &config)
|
||||||
{
|
{
|
||||||
xavix(config);
|
xavix(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02
|
I2C_24C02(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_i2c_state::xavix_i2c_24lc04(machine_config &config)
|
void xavix_i2c_state::xavix_i2c_24lc04(machine_config &config)
|
||||||
{
|
{
|
||||||
xavix(config);
|
xavix(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24LC04 on Nostalgia games, 24C04 on others
|
I2C_24C04(config, "i2cmem", 0); // 24LC04 on Nostalgia games, 24C04 on others
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_i2c_ltv_tam_state::xavix_i2c_24lc04_tam(machine_config &config)
|
void xavix_i2c_ltv_tam_state::xavix_i2c_24lc04_tam(machine_config &config)
|
||||||
@ -1597,7 +1590,7 @@ void xavix_i2c_state::xavix_i2c_24c08(machine_config &config)
|
|||||||
{
|
{
|
||||||
xavix(config);
|
xavix(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x400); // 24C08 (Excite Fishing DX)
|
I2C_24C08(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_state::xavixp(machine_config &config)
|
void xavix_state::xavixp(machine_config &config)
|
||||||
@ -1654,9 +1647,7 @@ void xavix_state::xavix2002(machine_config &config)
|
|||||||
|
|
||||||
void xavix_i2c_jmat_state::xavix2002_i2c_jmat(machine_config &config)
|
void xavix_i2c_jmat_state::xavix2002_i2c_jmat(machine_config &config)
|
||||||
{
|
{
|
||||||
xavix2002(config);
|
xavix2002_i2c_24c04(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // ?
|
|
||||||
|
|
||||||
m_xavix2002io->read_0_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io0));
|
m_xavix2002io->read_0_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io0));
|
||||||
m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0));
|
m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0));
|
||||||
@ -1688,14 +1679,14 @@ void xavix_i2c_state::xavix2000_i2c_24c04(machine_config &config)
|
|||||||
{
|
{
|
||||||
xavix2000(config);
|
xavix2000(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04
|
I2C_24C04(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_i2c_state::xavix2000_i2c_24c02(machine_config &config)
|
void xavix_i2c_state::xavix2000_i2c_24c02(machine_config &config)
|
||||||
{
|
{
|
||||||
xavix2000(config);
|
xavix2000(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02
|
I2C_24C02(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_mtrk_state::xavix_mtrk(machine_config &config)
|
void xavix_mtrk_state::xavix_mtrk(machine_config &config)
|
||||||
@ -1733,7 +1724,7 @@ void xavix_i2c_cart_state::xavix_i2c_taiko(machine_config &config)
|
|||||||
{
|
{
|
||||||
xavix_cart(config);
|
xavix_cart(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02
|
I2C_24C02(config, "i2cmem", 0); // 24LC02
|
||||||
|
|
||||||
SOFTWARE_LIST(config, "cart_list_japan_d").set_original("ekara_japan_d");
|
SOFTWARE_LIST(config, "cart_list_japan_d").set_original("ekara_japan_d");
|
||||||
SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp");
|
SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp");
|
||||||
@ -1745,7 +1736,7 @@ void xavix_i2c_cart_state::xavix_i2c_jpopira(machine_config &config)
|
|||||||
|
|
||||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02
|
I2C_24C02(config, "i2cmem", 0); // 24LC02
|
||||||
|
|
||||||
SOFTWARE_LIST(config, "cart_list_jpopira_jp").set_original("jpopira_jp"); // NOTE, these are for Jumping Popira only, they don't work with the karaoke or regular popira units
|
SOFTWARE_LIST(config, "cart_list_jpopira_jp").set_original("jpopira_jp"); // NOTE, these are for Jumping Popira only, they don't work with the karaoke or regular popira units
|
||||||
SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp");
|
SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp");
|
||||||
@ -1856,14 +1847,14 @@ void xavix_i2c_state::xavix2002_i2c_24c04(machine_config &config)
|
|||||||
{
|
{
|
||||||
xavix2002(config);
|
xavix2002(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04
|
I2C_24C04(config, "i2cmem", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xavix_i2c_state::xavix2002_i2c_mrangbat(machine_config &config)
|
void xavix_i2c_state::xavix2002_i2c_mrangbat(machine_config &config)
|
||||||
{
|
{
|
||||||
xavix2002(config);
|
xavix2002(config);
|
||||||
|
|
||||||
I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02?
|
I2C_24C02(config, "i2cmem", 0); // 24C02?
|
||||||
|
|
||||||
m_xavix2002io->read_0_callback().set_ioport("EX0");
|
m_xavix2002io->read_0_callback().set_ioport("EX0");
|
||||||
//m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0));
|
//m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0));
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "cpu/arm/arm.h"
|
#include "cpu/arm/arm.h"
|
||||||
#include "imagedev/floppy.h"
|
#include "imagedev/floppy.h"
|
||||||
#include "machine/aakart.h"
|
#include "machine/aakart.h"
|
||||||
#include "machine/i2cmem.h"
|
#include "machine/pcf8583.h"
|
||||||
#include "machine/wd_fdc.h"
|
#include "machine/wd_fdc.h"
|
||||||
#include "machine/acorn_vidc.h"
|
#include "machine/acorn_vidc.h"
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
required_device<arm_cpu_device> m_maincpu;
|
required_device<arm_cpu_device> m_maincpu;
|
||||||
optional_device<i2cmem_device> m_i2cmem;
|
optional_device<pcf8583_device> m_i2cmem;
|
||||||
required_device<acorn_vidc10_device> m_vidc;
|
required_device<acorn_vidc10_device> m_vidc;
|
||||||
optional_device<wd1772_device> m_fdc;
|
optional_device<wd1772_device> m_fdc;
|
||||||
optional_device<floppy_connector> m_floppy0;
|
optional_device<floppy_connector> m_floppy0;
|
||||||
|
@ -626,7 +626,6 @@ public:
|
|||||||
hackaddress2(-1)
|
hackaddress2(-1)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void xavix_i2c_24lc02(machine_config &config);
|
|
||||||
void xavix_i2c_24lc04(machine_config &config);
|
void xavix_i2c_24lc04(machine_config &config);
|
||||||
void xavix_i2c_24c02(machine_config &config);
|
void xavix_i2c_24c02(machine_config &config);
|
||||||
void xavix_i2c_24c08(machine_config &config);
|
void xavix_i2c_24c08(machine_config &config);
|
||||||
|
@ -462,7 +462,7 @@ READ32_MEMBER( archimedes_state::ioc_ctrl_r )
|
|||||||
|
|
||||||
if ( m_i2cmem )
|
if ( m_i2cmem )
|
||||||
{
|
{
|
||||||
i2c_data = (m_i2cmem->read_sda() & 1);
|
i2c_data = (m_i2cmem->sda_r() & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
floppy_ready_state = check_floppy_ready();
|
floppy_ready_state = check_floppy_ready();
|
||||||
@ -532,8 +532,8 @@ WRITE32_MEMBER( archimedes_state::ioc_ctrl_w )
|
|||||||
//logerror("IOC I2C: CLK %d DAT %d\n", (data>>1)&1, data&1);
|
//logerror("IOC I2C: CLK %d DAT %d\n", (data>>1)&1, data&1);
|
||||||
if ( m_i2cmem )
|
if ( m_i2cmem )
|
||||||
{
|
{
|
||||||
m_i2cmem->write_sda(data & 0x01);
|
m_i2cmem->sda_w(data & 0x01);
|
||||||
m_i2cmem->write_scl((data & 0x02) >> 1);
|
m_i2cmem->scl_w((data & 0x02) >> 1);
|
||||||
}
|
}
|
||||||
m_i2c_clk = (data & 2) >> 1;
|
m_i2c_clk = (data & 2) >> 1;
|
||||||
//TODO: does writing bit 2 here causes a fdc force ready?
|
//TODO: does writing bit 2 here causes a fdc force ready?
|
||||||
|
Loading…
Reference in New Issue
Block a user