Jump to content

Guides:SRAM Glitch ACE Setups (EN): Difference between revisions

m
no edit summary
mNo edit summary
Line 447:
.loop
2A ldi a, (hl)
03 inc bc ; Filler, no effect on flags
87 add a
0B dec bc ; Filler, compensates previous inc bc, no effect on flags
30 04 jp nc, .notChar ; Aside from space (should not be used), "add a" will only give nc if value read is not a text char
86 add a, (hl)
12 ld (de), a
2C inc l ; Affects z flag
13 inc de
.notChar
20 F4 jp nz, .loop ; loop unless l rolled over to $00 or value read was $00
C9 ret ; Due to previous push de, this ret will cause execution to resume from $D66A onward, immediately running the newly written code
</pre>
 
Line 486:
 
<pre>
AF xor a ; a = $00
EA CE D5 ld (wMissableObjectList), a ; Misaligns which objects are made invisible
C9 ret
Line 505:
21 1E D3 ld hl, wBagItems ; item #1's ID
22 ldi (hl), a
AF xor a ; a = $00
22 ldi (hl), a
22 ldi (hl), a
22 ldi (hl), a
22 ldi (hl), a ; clears a bunch of $FF values placed by swapping party pokémon
21 65 DA ld hl, 4F_Execution_Pointer
3E 21 ld a, $21
Line 555:
 
<pre>
11 9C D8 ld de, $D89C ; location written to
D5 push de
.newMail
Line 561:
06 01 ld b, 01
21 5C 65 ld hl, DisplayNameRaterScreen
CD D6 35 call BankSwitch ; Change rom banks and call b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4B CF ld hl, wStringBuffer ; Address where new name gets written to
D1 pop de ; Continue writing from last saved de
.newChar
2A ld a, (hli)
87 add a
30 09 jp nc, .terminator ; If blank space as first character of pair, only terminator $50 will result in a nc result
86 add a, (hl)
12 ld (de), a
13 inc de
23 inc hl
81 add a, c ; Current checksum total is buffered in c
12 ld (de), a
4F ld c, a
18 F3 jp .newChar
.terminator
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
Line 586:
F0 B5 ld a, (hJoy5)
A7 and a ; Check if no buttons are pressed
28 EE jp z, .terminator ; If no buttons pressed, keep displaying checksum
1F rra ; Shift all bits to the right, transfer former bit 7 to bit 1 and store status of this bit in c flag
38 CF jp c, .loop ; Is A is pressed, start new nickname
1B dec de ; If another button outside of A is pressed, either we're using the correction function, executing or stopping
1F rra ; is B pressed?
38 E7 jp c, .terminator If B is pressed, de has been decremented once so continue just displaying the new value de points towards
1F rra
1F rra ; Is START pressed?
D8 ret c ; Jump to $D89C, which was pushed to the stack at the start of the code and execute newly written code
1B dec de
1B dec de
1B dec de
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
17 rla ; Shift all bits to the left, transfer former bit 7 to bit 1 and store status of this bit in c flag. Is SELECT pressed?
30 C1 jp nc, loop ; If SELECT NOT pressed and dpad pressed instead, start new mail after de has been decremented a total of 5 times. Basically undoes a full nickname's worth of data
E1 pop hl ; Otherwise, pop the stored address of $D89C from the stack
C9 ret ; Since $D89C was popped, return to normal execution without executing newly written code
</pre>
 
Line 641:
 
<pre>
21 AE D5 ld hl, $D5AE ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
EA 56 D3 ld (wObtainedBadges), a ; Reset badges
21 80 DA ld hl, wBoxCount
22 ldi (hl), a ; Set amount of pokémon in box to 0
3D dec a ; a = $FF
22 ldi (hl), a ; Add proper terminator to wBoxSpecies
AF xor a ; a = $00
01 26 00 ld bc, 0026
21 F7 D2 ld hl, wPokedexOwned
Line 655:
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B1 ld l, $B1 ; hl = $D3B1, within wWarpEntries
22 ldi (hl), a
22 ldi (hl), a
Line 662:
23 inc hl
22 ldi (hl), a
22 ldi (hl), a ; Changes first two warp tiles to lead to Pallet Town instead
EA 63 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 1D D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 2E 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA ld hl, $DA66 ; Part of 4F bootstrap
36 6A ld (hl), $6A
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
Line 705:
 
<pre>
21 AE D5 ld hl, $D5AE ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 80 DA ld hl, wBoxCount
22 ldi (hl), a ; Set amount of pokémon in box to 0
3D dec a ; a = $FF
22 ldi (hl), a ; Add proper terminator to wBoxSpecies
AF xor a ; a = $00
EA 1D D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5900
CD 2E 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA ld hl, $DA66 ; Part of 4F bootstrap
36 6A ld (hl), $6A
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 2E 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>
 
1,540

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.