-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Interpreter] Unused opcode handling needs fixing #193
Comments
Unfortunately invalid opcodes cannot be just "skipped" or ignored. Theoretically, an invalid instruction should generate an INVALID IRQ that can be handled by the BIOS. (Also note that the definition of invalid is quite open since the GBA accepts some opcodes that are theoretically forbidden by the ARM spec). |
No problem, and again, thanks for the explanations, it helps greatly for my understanding. My observation was that the invalid ARM opcode was issued during an Interrupt, but when I get back to it I'll actually get the PC and Opcode |
Didn't mean to close - clumsy phone fingers! |
gpsp/cpu.c
Line 3190 in 541adc9
In the Interpreter, the handling of these ARM opcodes can only be included if HAVE_UNUSED is specified at compile time. Even then, the handling doesn't work because there is no code to move on to the next instruction. It should be something like this -
case 0xC0 ... 0xEF:
{
/* coprocessor instructions, reserved on GBA */
arm_next_instruction();
break;
}
@davidgfnet do you agree? The dynarecs don't have this issue because they don't process the instructions in a loop, and the program counter is moved forward regardless at the end of the Switch/Case.
I'm still debugging DemiKids Light at the moment and found this issue whilst working on it - unfortunately changing it doesn't fix DemiKids but it does stop an endless loop when DemiKids issues an invalid ARM instruction!
The text was updated successfully, but these errors were encountered: