Fixed some mess in io.c, should be able to compile with IO_TRACE enabled now.

This commit is contained in:
OBattler
2019-09-23 16:04:58 +02:00
parent dbdf5c2501
commit c3f2240a1f

View File

@@ -8,7 +8,7 @@
* *
* Implement I/O ports and their operations. * Implement I/O ports and their operations.
* *
* Version: @(#)io.c 1.0.6 2019/03/21 * Version: @(#)io.c 1.0.4 2019/09/23
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -330,14 +330,12 @@ inb(uint16_t port)
#ifdef ENABLE_IO_LOG #ifdef ENABLE_IO_LOG
if (CS == IO_TRACE) if (CS == IO_TRACE)
io_log("IOTRACE(%04X): inb(%04x)=%02x\n", IO_TRACE, port, r); io_log("IOTRACE(%04X): inb(%04x)=%02x\n", IO_TRACE, port, ret);
#endif #endif
if (!found) if (!found)
sub_cycles(io_delay); sub_cycles(io_delay);
// pclog("[%04X:%08X] inb(%04X) = %02X\n", CS, cpu_state.pc, port, ret);
return(ret); return(ret);
} }
@@ -367,8 +365,6 @@ outb(uint16_t port, uint8_t val)
if (!found) if (!found)
sub_cycles(io_delay); sub_cycles(io_delay);
// pclog("[%04X:%08X] outb(%04X) = %02X\n", CS, cpu_state.pc, port, val);
return; return;
} }
@@ -393,8 +389,6 @@ inw(uint16_t port)
if (!found) if (!found)
ret = (inb(port) | (inb(port + 1) << 8)); ret = (inb(port) | (inb(port + 1) << 8));
// else
// pclog("[%04X:%08X] inw(%04X) = %04X\n", CS, cpu_state.pc, port, ret);
return ret; return ret;
} }
@@ -410,8 +404,6 @@ outw(uint16_t port, uint16_t val)
while(p) { while(p) {
if (p->outw) { if (p->outw) {
p->outw(port, val, p->priv); p->outw(port, val, p->priv);
// pclog("[%04X:%08X] outw(%04X) = %04X\n", CS, cpu_state.pc, port, val);
return; return;
} }
p = p->next; p = p->next;
@@ -445,8 +437,6 @@ inl(uint16_t port)
if (!found) if (!found)
ret = (inw(port) | (inw(port + 2) << 16)); ret = (inw(port) | (inw(port + 2) << 16));
// else
// pclog("[%04X:%08X] inl(%04X) = %08X\n", CS, cpu_state.pc, port, ret);
return ret; return ret;
} }
@@ -462,8 +452,6 @@ outl(uint16_t port, uint32_t val)
while(p) { while(p) {
if (p->outl) { if (p->outl) {
p->outl(port, val, p->priv); p->outl(port, val, p->priv);
// pclog("[%04X:%08X] outl(%04X) = %08X\n", CS, cpu_state.pc, port, val);
return; return;
} }
p = p->next; p = p->next;