SilverlineDev / bizhawk

Automatically exported from code.google.com/p/bizhawk
0 stars 0 forks source link

gambatte_getregs reporting incorrect PC and A register values #375

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Lua script that hooks memory execution and prints register values
2. Open a Gameboy game
3. Open trace logger
4. Compare trace logger PC and A values to those reported by the script
5. Be disappointed because they don't match

Cause (numbers refer to line numbers in libgambatte/cpu.cpp):
The reported variables (PC_ and A_) are copied before emulating a number of 
cycles (491 & 495) and not updated until emulation finishes (2834 & 2838). As 
such, calling CPU::GetRegs (2842) during emulation causes the wrong values to 
be reported.

Original issue reported on code.google.com by Scepheo on 20 Jan 2015 at 4:03

GoogleCodeExporter commented 9 years ago
See http://tasvideos.org/forum/viewtopic.php?p=399363#399363 for original 
report.

Original comment by Scepheo on 20 Jan 2015 at 4:08