From d919f3865c33a0002cd3b78081720bdb12eed24b Mon Sep 17 00:00:00 2001 From: toxieainc Date: Mon, 18 Jul 2022 22:45:23 +0200 Subject: [PATCH] port some changes from MAME/MESS --- Src/CPU/Z80/Z80.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Src/CPU/Z80/Z80.cpp b/Src/CPU/Z80/Z80.cpp index 370f94c..3967ffd 100644 --- a/Src/CPU/Z80/Z80.cpp +++ b/Src/CPU/Z80/Z80.cpp @@ -2698,7 +2698,7 @@ int CZ80::Run(int numCycles) break; case 0x71: /* OUT (C),0 */ cycles -= cycleTables[2][0x71]; - OUTPUT(lreg(BC), 0); + OUTPUT(lreg(BC), lreg(0)); break; case 0x72: /* SBC HL,SP */ cycles -= cycleTables[2][0x72]; @@ -2821,6 +2821,8 @@ int CZ80::Run(int numCycles) cycles -= cycleTables[2][0xB0]; acu = hreg(AF); BC &= 0xffff; + if (BC == 0) + BC = 0x10000; do { acu = GetBYTE_pp(HL); PutBYTE_pp(DE, acu); @@ -2832,6 +2834,8 @@ int CZ80::Run(int numCycles) cycles -= cycleTables[2][0xB1]; acu = hreg(AF); BC &= 0xffff; + if (BC == 0) + BC = 0x10000; do { temp = GetBYTE_pp(HL); op = --BC != 0; @@ -2868,6 +2872,8 @@ int CZ80::Run(int numCycles) case 0xB8: /* LDDR */ cycles -= cycleTables[2][0xB8]; BC &= 0xffff; + if (BC == 0) + BC = 0x10000; do { acu = GetBYTE_mm(HL); PutBYTE_mm(DE, acu); @@ -2879,6 +2885,8 @@ int CZ80::Run(int numCycles) cycles -= cycleTables[2][0xB9]; acu = hreg(AF); BC &= 0xffff; + if (BC == 0) + BC = 0x10000; do { temp = GetBYTE_mm(HL); op = --BC != 0; @@ -3505,7 +3513,7 @@ int CZ80::Run(int numCycles) break; case 0xCB: /* CB prefix */ adr = IY + (signed char) GetBYTE_pp(pc); - adr = adr; + //adr = adr; op = GetBYTE(pc); cycles -= cycleTables[4][op]; switch (op & 7) {