Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Emulation & ROM Hacking

Is it possible to create an emulator that ignores unknown op-codes like VC? - Page 1

Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: 4 4
Date: 2018-10-13 09:04:12
I was wondering, because I would love to be able to try and use 8F without the game crashing. I really love seeing the game break!  :) Also, if there is one that ignores unknown op-codes, what is it called?

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Parzival
Date: 2018-10-13 09:48:45
BGB has a bunch of stuff that's togglable, try seeing if it'll ignore unknown ops. If not, you could probably mod Gambatte to do that very easily.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: 4 4
Date: 2018-10-13 17:23:26

BGB has a bunch of stuff that's togglable, try seeing if it'll ignore unknown ops. If not, you could probably mod Gambatte to do that very easily.


I already tried BGB, but the only option related to that is making the game hang instead of having an unknown op-code error. Also, the way VC works is that the VC emulator hooks unknown op-codes, and repurposes them for internal use. I've learned that from TheZZAZZGlitch. I recommend you check out his video on it. https://www.youtube.com/watch?v=oQZMVo_Fmrs

Basically, if an emulator similar to that is created, we could possibly be able to discover more glitches in red/blue/yellow, and maybe some other pokemon games.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: ISSOtm
Date: 2018-10-13 17:56:39
You can't discover more glitches in the games with that.
At best you'd discover glitches with the emulator you've made, but then you just made the emulator to do taht.

Why bother making the emulator any accurate, then? Just make a program that takes the ROM as input, and spews random garbage to the screen; what does make it different from the "bugs" you're describing?
If the emulated game has bugs that don't occur on an actual console, then they're not glitches. End of the story.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Sherkel
Date: 2018-10-14 14:05:57
As Isso said, you're essentially asking for a less accurate emulator. The only way to correctly emulate unknown opcodes is to have the game crash when they're executed. Not all of them are as in-your-face about it as BGB, making you restart the .exe and all, but any other good emulator will at least make you reload the ROM, as would be necessary on a console.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: ISSOtm
Date: 2018-10-14 14:13:36
What!? BGB doesn't require anything from you other than resetting the emulator, which is right-clicking the screen, and choosing "Reset Gameboy".

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Sherkel
Date: 2018-10-14 14:22:30
You're right. Not sure what caused me to think that.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Torchickens
Date: 2018-10-14 14:27:40
Some glitches actually function different on 3DS Virtual Console because VC treats the unknown opcodes as nops. The best way to simulate it like on 3DS Virtual Console is to right click on the instruction after the unknown opcode in the debugger and choose 'jump to cursor'. You could also replace the unknown opcode with a nop, but you would either have to edit the ROM slightly (for how many unknown opcodes the game encounters), or use a Game Genie code to temporarily achieve the effects of that until power off, which depending on the context could be a minor or more significant change to the game's engine.

Note for Game Genie each code would have to be different for avoiding each case's invalid opcode.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Sherkel
Date: 2018-10-14 14:34:45
Chickasaurus to the rescue again! Do you know if VC reads them all (D3, DB, DD, E3, E4, etc.) as nops, or just particular ones?

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: ISSOtm
Date: 2018-10-15 02:12:37
Using Game Genie or modifying the ROM won't work properly; if it's in the ROM (and it's an invalid op), then it has to be some other data; modifying the game's data will have it malfunction, eventually. Skippiing invalid ops with Jump to cursor (protip: shortcut is $F6) is a viable, albeit tedious solution.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Torchickens
Date: 2018-11-03 18:24:07

Chickasaurus to the rescue again! Do you know if VC reads them all (D3, DB, DD, E3, E4, etc.) as nops, or just particular ones?


It would seem it's all of them as nops. :)

TheZZAZZGlitch also has a thread on emulation accuracy that talks about it, but not sure if there is video confirmation (e.g. using 8F to run each opcode followed by a ret) to be 100% sure it's all of them that are ignored yet.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: ISSOtm
Date: 2018-11-05 02:38:02
VC doesn't read all of those as NOPs; it internally hooks some of them for internal purposes (for example, triggering the trade screen in Pokémon games). Although Wack0 suggested that this only occurred for certain games and/or PC values.

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: Torchickens
Date: 2018-11-05 03:40:59

VC doesn't read all of those as NOPs; it internally hooks some of them for internal purposes (for example, triggering the trade screen in Pokémon games). Although Wack0 suggested that this only occurred for certain games and/or PC values.


Ah OK, thanks.

If you run all of the normally unused ones in Pokémon RBY/GSC directly followed by the ret will it still do effectively nothing? Can you do cool, different things if a certain byte (or bytes) follows it, or another detail like if the byte appears in a certain location of the memory, etc.?

Also, do you mean the touch screen menu (in which you can invite or join a partner) or original trade menu (which lists your Pokémon and the other player's Pokémon)? Is it possible to replicate something like the touch screen menu or another emulator interface with in-game (so with the raw Pokémon game, not a bug with what the game is contained in) ACE somehow?

Re: Is it possible to create an emulator that ignores unknown op-codes like VC?

Posted by: ISSOtm
Date: 2018-11-05 08:34:21
I do not know what are the conditions for the invalid instruction to do something special.
I mean the touch-screen menu, which obviously cannot be done by the game itself.
ACE is limited to the upper screen itself, unless an emulator escape exploit is found - Wack0 found one, but it might be too limited to do anything with it; and if it's at all possible, it's gonna be tedious.