Z8001 has 16-bit wide I/O ports [R. Belmont, Christian Grössler]

This commit is contained in:
R. Belmont 2012-05-16 01:18:05 +00:00
parent 7e791c91c5
commit 55e0629fba

View File

@ -245,10 +245,17 @@ INLINE UINT8 RDPORT_B(z8000_state *cpustate, int mode, UINT16 addr)
INLINE UINT16 RDPORT_W(z8000_state *cpustate, int mode, UINT16 addr) INLINE UINT16 RDPORT_W(z8000_state *cpustate, int mode, UINT16 addr)
{ {
if(mode == 0) if(mode == 0)
{
if (cpustate->device->type() == Z8001)
{
return cpustate->io->read_word((UINT16)addr);
}
else
{ {
return cpustate->io->read_byte((UINT16)(addr)) + return cpustate->io->read_byte((UINT16)(addr)) +
(cpustate->io->read_byte((UINT16)(addr+1)) << 8); (cpustate->io->read_byte((UINT16)(addr+1)) << 8);
} }
}
else else
{ {
/* how to handle MMU reads? */ /* how to handle MMU reads? */
@ -271,10 +278,17 @@ INLINE void WRPORT_B(z8000_state *cpustate, int mode, UINT16 addr, UINT8 value)
INLINE void WRPORT_W(z8000_state *cpustate, int mode, UINT16 addr, UINT16 value) INLINE void WRPORT_W(z8000_state *cpustate, int mode, UINT16 addr, UINT16 value)
{ {
if(mode == 0) if(mode == 0)
{
if (cpustate->device->type() == Z8001)
{
cpustate->io->write_word((UINT16)addr, value);
}
else
{ {
cpustate->io->write_byte((UINT16)(addr),value & 0xff); cpustate->io->write_byte((UINT16)(addr),value & 0xff);
cpustate->io->write_byte((UINT16)(addr+1),(value >> 8) & 0xff); cpustate->io->write_byte((UINT16)(addr+1),(value >> 8) & 0xff);
} }
}
else else
{ {
/* how to handle MMU writes? */ /* how to handle MMU writes? */
@ -795,7 +809,7 @@ CPU_GET_INFO( z8001 )
{ {
case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; case DEVINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break;
case DEVINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 20; break; case DEVINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 20; break;
case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 8; break; case DEVINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break;
case DEVINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 16; break; case DEVINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 16; break;
/* --- the following bits of info are returned as pointers to data or functions --- */ /* --- the following bits of info are returned as pointers to data or functions --- */