From: Wouter V. <m97...@us...> - 2001-12-31 12:43:13
|
Update of /cvsroot/openmsx/openMSX/src In directory usw-pr-cvs1:/tmp/cvs-serv11665/src Modified Files: Z80.cc Z80.ii Log Message: fixed DDCB timing Index: Z80.cc =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/Z80.cc,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- Z80.cc 2001/12/30 23:20:50 1.37 +++ Z80.cc 2001/12/31 12:43:10 1.38 @@ -154,7 +154,13 @@ // normal instructions targetChanged = false; while (!targetChanged && (currentTime < targetTime)) { + #ifdef Z80DEBUG + EmuTime before(currentTime); + executeInstruction(Z80_RDOP(R.PC.w++)); + PRT_DEBUG("CPU: Took "<<currentTime.subtract(before)/24<<"T-States"); + #else executeInstruction(Z80_RDOP(R.PC.w++)); + #endif } } } @@ -4390,32 +4396,33 @@ void Z80::dd_cb() { - currentTime++; offset n = Z80_RDMEM_OPCODE(); byte opcode = Z80_RDOP(R.PC.w++); currentTime+=2; (this->*opcode_dd_cb[opcode])(n); } void Z80::fd_cb() { - currentTime++; offset n = Z80_RDMEM_OPCODE(); byte opcode = Z80_RDOP(R.PC.w++); currentTime+=2; (this->*opcode_fd_cb[opcode])(n); } void Z80::cb() { - M1Cycle(); byte opcode = Z80_RDOP(R.PC.w++); + M1Cycle(); (this->*opcode_cb[opcode])(); } void Z80::ed() { - M1Cycle(); byte opcode = Z80_RDOP(R.PC.w++); + M1Cycle(); (this->*opcode_ed[opcode])(); } void Z80::dd() { - M1Cycle(); byte opcode = Z80_RDOP(R.PC.w++); + if (opcode != 0xcb) + M1Cycle(); + else + currentTime++; (this->*opcode_dd[opcode])(); } void Z80::dd2() { @@ -4424,8 +4431,11 @@ (this->*opcode_dd[opcode])(); } void Z80::fd() { - M1Cycle(); byte opcode = Z80_RDOP(R.PC.w++); + if (opcode != 0xcb) + M1Cycle(); + else + currentTime++; (this->*opcode_fd[opcode])(); } void Z80::fd2() { Index: Z80.ii =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/Z80.ii,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Z80.ii 2001/12/30 22:38:55 1.8 +++ Z80.ii 2001/12/31 12:43:10 1.9 @@ -139,12 +139,10 @@ return result; } inline word Z80::M_XIX(offset n) { - word result = R.IX.w+n; - return result; + return R.IX.w+n; } inline word Z80::M_XIY(offset n) { - word result = R.IY.w+n; - return result; + return R.IY.w+n; } inline byte Z80::M_RD_XHL() { return Z80_RDMEM(R.HL.w); } inline byte Z80::M_RD_XIX() { return Z80_RDMEM(M_XIX()); } |