Jump to content

OAM DMA hijacking: Difference between revisions

no edit summary
(→‎Setup (OAM sprite manipulation): mistake and confusion with cursor tile's corruption)
No edit summary
Line 40:
 
In this case, it may be possible to animate them with additional code to change the items. Animations of the OAM entries are normally done by other routines (such as the overworld loop which is meant to change C3XX), but the player could for instance use [[map script arbitrary code execution]] to run their own sprite animation routine.
 
==Taking over the joypad==
 
At FF86, write "jr FFF9".
At FFF9, write "dec a"
At FFFA, write "jr nz, FFF9"
At FFFC, write "jp [RAM]"
 
At the desired RAM address (e.g. D34A), write:
 
ld a,(FFD3) ; a=random "D-sum" byte 1 number.
ld (FFF8),a ; put a into FFF8, which controls what buttons are being pressed.
"ret" ; Don't execute any code after D350.
 
This example is a simulation of RNG Plays Pokémon, but the routine at D34A can be adjusted for different inputs into FFF8.
 
This technique was documented by luckytyphlosion, and a method of setting it up from scratch using TheZZAZZGlitch's coordinates memory editing method by ChickasaurusGL.
 
{{YouTube|2rIqARgv5LU|ChickasaurusGL}}
 
{{stub}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.