OAM DMA hijacking: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
Line 33: Line 33:


OAM DMA hijacking is useful as a form of 'real-time' arbitrary code execution, allowing the player to perform exploits such as walk through walls in Generation II or writing a [[0x50 sub-tile]] permanently to the beginning of the screen data for Generation I.
OAM DMA hijacking is useful as a form of 'real-time' arbitrary code execution, allowing the player to perform exploits such as walk through walls in Generation II or writing a [[0x50 sub-tile]] permanently to the beginning of the screen data for Generation I.


This glitch works by hijacking the "OAM DMA" process associated with sprites. {{elaborate}}

An easy means to perform OAM DMA hijacking in both {{RB}} and {{GS}} is to write to the HRAM region FF80, however care must be taken as this region will be executed every frame. For this reason it is safe to place a ret (0xC9) opcode at the beginning of this region, write the code after it and replace the ret with a nop (0x00) byte afterwards. This exploit was documented by Crystal_.

{{YouTube|1w2iQdAHPh4|Crystal_}}


==Setup (OAM sprite manipulation)==
==Setup (OAM sprite manipulation)==