summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--z80_decode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/z80_decode.c b/z80_decode.c
index e78206c..ced7fbd 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -2329,7 +2329,13 @@ void Z80_Decode(Z80 *cpu, Z80Byte opcode)
case 0xdb: /* IN A,(n) */
TSTATE(11);
if (cpu->pread)
- cpu->AF.b[HI]=cpu->pread(cpu,FETCH_BYTE);
+ {
+ Z80Word port;
+
+ port=FETCH_BYTE;
+ port|=(Z80Word)cpu->AF.b[HI]<<8;
+ cpu->AF.b[HI]=cpu->pread(cpu,port);
+ }
else
cpu->PC++;
break;