Re: Press Ctrl+V or Cmd+V or whatever and post
Posted by: Sherkel
Date: 2018-09-06 12:42:44
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.
Although the 'in-built GameShark' normally only writes to a
memory address without locking it like a physical GameShark
would, you can lock values by first writing C9 (x201) to address
FF80 (Carbos x255, X Accuracy x128), followed by hex:22 at FF81,
hex:D3 at FF82. Afterwards, replacing FF80 with C3 (x195) will run
your code from item slot 3 every frame, however overworld
sprites will be broken.
This technique is known as "OAM DMA hijacking".
For each value to be locked, repeat
3E, value to lock at, EA, low byte of address to lock, high byte of address to lock
End repeat
Then 3E, C3, 0E, 46, C9
(This can also be written backwards, then you'd be able to toss items after each write.)
Then 00 at FF81, DF at FF82, E2 at FF83, CD at FF80.
(This can also be written backwards; all that matters is that FF80 is written last.)