You are not logged in.
Is there a bank switch function like the one in Red/Blue/Yellow for Gold/Silver/Crystal? I'd like to know what the pointer for it is for US Gold. JP Gold and US Crystal would be useful too but I don't need all of them, I just want to play around with the Pokémon & Trainer color test menu, which apparently is less glitchy in the Japanese version, and I want to try and make a US Gold/Silver Coin Case arbitrary code execution cheat for it.
Thanks in advance!
Last edited by Torchickens (2014-08-01 18:13:00)
ld a,BANK ld hl,ADDRESS rst $08
Last edited by Tauwasser (2014-08-01 19:16:33)
Thanks. I found a bank switch pointer in the end. It was at 0010 in both Gold and Crystal, and I used it to activate the debug screen with Coin Case. :)
Code in Gold:
Code in Crystal:
Now all I need to do is try and make a version without glitched item quantities. (Thanks to Sanky and TheZZAZZGlitch you can bootstrap Coin Case code to stored item 2 quantity, http://glitchcity.info/wiki/index.php/Coin_Case_Glitch)
I don't exactly get the rst $08, wouldn't that make the game jump to 0008, where a jp 2E27 (in Gold) is? It works anyway, so I don't really care. Just interested.
Last edited by Torchickens (2014-08-01 19:55:48)
Yes, the game goes to rst $08, that's restart vector 0x08, at 0x08. There's a call to the actual bank switching code there. The actual bank switching code makes sure to jump to a:hl preserving de and bc and preserves de and bc when the function returns.
You should usually never need to use rst $10 (the code you posted) outside of RB 0x00.
Most game functions expect the shadow rom bank register (0xFF9F in Gold) to be preserved. If you don't preserve it beforehand, you might not safely return from your sub-function, e.g. in case it gets called from code residing in two different rom banks.