This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is the code in Tetris which infinitely resets if you return 0 from the joypad register | |
Evil: ; CODE XREF: sub_20C+E9↓j | |
ROM:02C4 call pollJOYP ; stores inverted joypad state into 0xFF80 (upper nibble = dpad, low nibble = buttons) | |
ROM:02C7 call sub_2F8 | |
ROM:02CA call sub_7FF0 | |
ROM:02CD ld a, [$FF80] ; read the joypad state that pollJOYP previously cached | |
ROM:02CF and $F ; only keep the buttons, dump the dpad | |
ROM:02D1 cp $F ; see if all buttons are pressed | |
ROM:02D3 jp z, reset ; if yes reset lmfao |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LD SP,$fffe ; $0000 Setup Stack | |
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM) | |
LD HL,$9fff ; $0004 | |
Addr_0007: | |
LD (HL-),A ; $0007 | |
BIT 7,H ; $0008 | |
JR NZ, Addr_0007 ; $000a | |
LD HL,$ff26 ; $000c Setup Audio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LD SP,$fffe ; $0000 Setup Stack | |
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM) | |
LD HL,$9fff ; $0004 | |
Addr_0007: | |
LD (HL-),A ; $0007 | |
BIT 7,H ; $0008 | |
JR NZ, Addr_0007 ; $000a | |
LD HL,$ff26 ; $000c Setup Audio |
NewerOlder