Added READ/WRITE_MEMBER to the intelfsh device and removed some trampolines. (nw)

This commit is contained in:
Sandro Ronco 2013-02-20 19:43:23 +00:00
parent 1ef9da1b98
commit 24987390dc
5 changed files with 9 additions and 35 deletions

View file

@ -165,6 +165,8 @@ public:
// public interface
UINT8 read(offs_t offset) { return read_full(offset); }
void write(offs_t offset, UINT8 data) { write_full(offset, data); }
DECLARE_READ8_MEMBER(read) { return read_full(offset); }
DECLARE_WRITE8_MEMBER(write) { write_full(offset, data); }
UINT8 read_raw(offs_t offset) { return m_addrspace[0]->read_byte(offset); }
void write_raw(offs_t offset, UINT8 data) { m_addrspace[0]->write_byte(offset, data); }
@ -183,6 +185,8 @@ public:
// public interface
UINT16 read(offs_t offset) { return read_full(offset); }
void write(offs_t offset, UINT16 data) { write_full(offset, data); }
DECLARE_READ16_MEMBER(read) { return read_full(offset); }
DECLARE_WRITE16_MEMBER(write) { write_full(offset, data); }
UINT16 read_raw(offs_t offset) { return m_addrspace[0]->read_word(offset * 2); }
void write_raw(offs_t offset, UINT16 data) { m_addrspace[0]->write_word(offset * 2, data); }

View file

@ -80,7 +80,7 @@ ADDRESS_MAP_END
// 256 kbyte ram + 256 kbyte memory mapped flash
static ADDRESS_MAP_START( cybikov2_mem, AS_PROGRAM, 16, cybiko_state )
AM_RANGE( 0x000000, 0x007fff ) AM_ROM
AM_RANGE( 0x100000, 0x13ffff ) AM_READ8(cybikov2_flash_r, 0xffff) AM_MIRROR( 0x0c0000 )
AM_RANGE( 0x100000, 0x13ffff ) AM_DEVREAD8("flash2", sst_39vf020_device, read, 0xffff) AM_MIRROR( 0x0c0000 )
AM_RANGE( 0x600000, 0x600001 ) AM_READWRITE( cybiko_lcd_r, cybiko_lcd_w ) AM_MIRROR( 0x1ffffe )
AM_RANGE( 0xe00000, 0xffdbff ) AM_READ( cybikov2_key_r )
ADDRESS_MAP_END
@ -90,7 +90,7 @@ static ADDRESS_MAP_START( cybikoxt_mem, AS_PROGRAM, 16, cybiko_state )
AM_RANGE( 0x000000, 0x007fff ) AM_ROM AM_MIRROR( 0x038000 )
AM_RANGE( 0x100000, 0x100001 ) AM_READWRITE( cybiko_lcd_r, cybiko_lcd_w )
AM_RANGE( 0x200000, 0x200003 ) AM_WRITE( cybiko_usb_w )
AM_RANGE( 0x600000, 0x67ffff ) AM_READ(cybikoxt_flash_r) AM_MIRROR( 0x180000 )
AM_RANGE( 0x600000, 0x67ffff ) AM_DEVREAD("flashxt", sst_39vf400a_device, read) AM_MIRROR( 0x180000 )
AM_RANGE( 0xe00000, 0xefffff ) AM_READ( cybikoxt_key_r )
ADDRESS_MAP_END

View file

@ -206,14 +206,12 @@ public:
geniusiq_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_flash(*this, "flash"),
m_vram(*this, "vram"),
m_mouse_gfx(*this, "mouse_gfx"),
m_cart_state(IQ128_NO_CART)
{ }
required_device<cpu_device> m_maincpu;
required_device<intelfsh8_device> m_flash;
required_shared_ptr<UINT16> m_vram;
required_shared_ptr<UINT16> m_mouse_gfx;
@ -222,8 +220,6 @@ public:
virtual void palette_init();
virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(flash_r);
DECLARE_WRITE8_MEMBER(flash_w);
DECLARE_READ16_MEMBER(input_r);
DECLARE_WRITE16_MEMBER(mouse_pos_w);
DECLARE_INPUT_CHANGED_MEMBER(send_input);
@ -338,16 +334,6 @@ UINT32 geniusiq_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
return 0;
}
READ8_MEMBER(geniusiq_state::flash_r)
{
return m_flash->read(offset);
}
WRITE8_MEMBER(geniusiq_state::flash_w)
{
m_flash->write(offset, data);
}
READ16_MEMBER( geniusiq_state::cart_state_r )
{
return m_cart_state;
@ -478,7 +464,7 @@ static ADDRESS_MAP_START(geniusiq_mem, AS_PROGRAM, 16, geniusiq_state)
AM_RANGE(0x200000, 0x23FFFF) AM_RAM
AM_RANGE(0x300000, 0x30FFFF) AM_RAM AM_SHARE("vram")
AM_RANGE(0x310000, 0x31FFFF) AM_RAM
AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x0e0000) AM_READWRITE8(flash_r, flash_w, 0x00ff)
AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x0e0000) AM_DEVREADWRITE8("flash", intelfsh8_device, read, write, 0x00ff)
AM_RANGE(0x600300, 0x600301) AM_READ(input_r)
//AM_RANGE(0x600500, 0x60050f) // read during IRQ 5
//AM_RANGE(0x600600, 0x600605) // sound ??

View file

@ -52,9 +52,7 @@ public:
m_speaker(*this, SPEAKER_TAG),
m_rtc(*this, "rtc"),
m_ram(*this, RAM_TAG),
m_flash1(*this, "flash1"),
m_flash2(*this, "flash2"),
m_flashxt(*this, "flashxt")
m_flash1(*this, "flash1")
{ }
CYBIKO_RS232 m_rs232;
@ -70,8 +68,6 @@ public:
DECLARE_WRITE8_MEMBER(cybikov1_io_reg_w);
DECLARE_WRITE8_MEMBER(cybikov2_io_reg_w);
DECLARE_WRITE8_MEMBER(cybikoxt_io_reg_w);
DECLARE_READ8_MEMBER(cybikov2_flash_r);
DECLARE_READ16_MEMBER(cybikoxt_flash_r);
int cybiko_key_r( offs_t offset, int mem_mask);
void cybiko_rs232_write_byte(int data);
void cybiko_rs232_pin_sck(int data);
@ -88,8 +84,6 @@ public:
required_device<pcf8593_device> m_rtc;
required_device<ram_device> m_ram;
optional_device<at45db041_device> m_flash1;
optional_device<intelfsh8_device> m_flash2;
optional_device<intelfsh16_device> m_flashxt;
DECLARE_DRIVER_INIT(cybikoxt);
DECLARE_DRIVER_INIT(cybiko);
virtual void machine_start();

View file

@ -49,7 +49,7 @@ QUICKLOAD_LOAD( cybikoxt )
running_machine &machine = image.device().machine();
cybiko_state *state = machine.driver_data<cybiko_state>();
address_space &dest = state->m_maincpu->space(AS_PROGRAM);
UINT32 size = MIN(image.length(), 0x84000);
UINT32 size = MIN(image.length(), RAMDISK_SIZE);
UINT8 *buffer = global_alloc_array(UINT8, size);
image.fread(buffer, size);
@ -196,16 +196,6 @@ int cybiko_state::cybiko_rs232_rx_queue()
// READ/WRITE HANDLERS //
/////////////////////////
READ8_MEMBER( cybiko_state::cybikov2_flash_r )
{
return m_flash2->read(offset);
}
READ16_MEMBER( cybiko_state::cybikoxt_flash_r )
{
return m_flashxt->read(offset);
}
READ16_MEMBER( cybiko_state::cybiko_lcd_r )
{
UINT16 data = 0;