Jump to content

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

Line 646:
 
<pre>
3E 59 ld a, $59 ; 4F's item ID
21 22 D3 ld hl, wBagItems ; item #1's ID
2236 59 ldild (hl), a$59 ; 4F's item ID
AF7C xorld a, h ; a = $00D3
21 66 DA ld hl, 4F_Execution_Pointer +2
22 ldi (hl), a
2232 ldildd (hl), a
22 ldi (hl), a
22 ldi (hl), a ; clears a bunch of $FF values placed by swapping party pokémon
21 64 DA ld hl, 4F_Execution_Pointer
3E 21 ld a, $21
22 ldi (hl), a
3E 2E ld a, $2E
22 ldi (hl), a
3E36 D3C3 ld a(hl), $D3C3
22 ldi (hl), a
36 E9 ld hl, $E9
; The contents of the first nickname (see previous section) are written right after this, ensuring safe return.
</pre>
Line 668 ⟶ 660:
 
<pre>
3E 59 21 22 D3 36 59
227C AF21 2266 22DA 2232
223E 212E 6432 DA36 3EC3
21 22 3E 2E 22
3E D3 22 36 E9
</pre>
 
Line 682 ⟶ 672:
 
<pre>
21C3 2E D3 ldjp hl, ITEM_6_IDITEM_7_ID
E9 jp hl
</pre>
 
===Raw Assembly===
 
<pre>21C3 2E D3 E9</pre>
 
==Nickname Writer==
Line 705 ⟶ 694:
.newMail
D5 push de
06 01 ld b, 01
21 56 63 ld hl, DisplayNameRaterScreen
CD 871A 3E39 call BankSwitch$391A ; Changesets romb banksto and01, callthen jumps to Bankswitch, calling b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F CF ld hl, wStringBuffer ; Address where new name gets written to
Line 724 ⟶ 712:
18 F3 jp .newChar
.terminator
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
21 01 C4 ld hl, $C401 ; Corresponds to screen tile
CD BC 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
4D ld c, l ; How many bytes printed as numbers?
CD BC 13 call PrintBCDNumber.loop
.numLoop
2D dec l
CB FE set 7, (hl)
20 FB jp nz, .numLoop ; Repeat until hl == $C400
75 ld (hl), l ; Nulls out $C400
.inputLoop
CD 21 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5 ld a, (hJoy5)
E6 0F and $0F ; Set z flag if A, B, START, SELECT not pressed
28 F7 jp z, .inputLoop
1F rra ; Is A pressed? If yes, set c flag
D1 pop de
F038 B5CB ldjr ac, (hJoy5).newMail
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
1F rra ; Is B pressed? If yes, set c flag
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
38 E1 jr c, .terminator
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?
1F rra ; Is SELECT pressed? If yes, set c flag
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 storedstarting address of $D89C from theto stackhl
C9D8 ret c ; SinceIf $D89CSELECT was poppedpressed, simply return to normal execution without executing newly written codeoperations
E9 jp hl ; If START pressed, jump to hl to execute newly written code
</pre>
 
Line 758 ⟶ 745:
.newMail
D5 push de
06 01 ld b, 01
21 E2 62 ld hl, DisplayNameRaterScreen
CD 891C 3E39 call BankSwitch$391C ; Changesets romb banksto and01, callthen jumps to Bankswitch, calling b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F CF ld hl, wStringBuffer ; Address where new name gets written to
Line 777 ⟶ 763:
18 F3 jp .newChar
.terminator
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
21 01 C4 ld hl, $C401 ; Corresponds to screen tile
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
4D ld c, l ; How many bytes printed as numbers?
CD BF 13 call PrintBCDNumber.loop
.numLoop
2D dec l
CB FE set 7, (hl)
20 FB jp nz, .numLoop ; Repeat until hl == $C400
75 ld (hl), l ; Nulls out $C400
.inputLoop
CD 23 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5 ld a, (hJoy5)
E6 0F and $0F ; Set z flag if A, B, START, SELECT not pressed
28 F7 jp z, .inputLoop
1F rra ; Is A pressed? If yes, set c flag
D1 pop de
F038 B5CB ldjr ac, (hJoy5).newMail
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
1F rra ; Is B pressed? If yes, set c flag
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
38 E1 jr c, .terminator
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?
1F rra ; Is SELECT pressed? If yes, set c flag
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 storedstarting address of $D89C from theto stackhl
C9D8 ret c ; SinceIf $D89CSELECT was poppedpressed, simply return to normal execution without executing newly written codeoperations
E9 jp hl ; If START pressed, jump to hl to execute newly written code
</pre>
 
Line 811 ⟶ 796:
.newMail
D5 push de
06 01 ld b, 01
21 1C 63 ld hl, DisplayNameRaterScreen
CD 8215 3E39 call BankSwitch$3915 ; Changesets romb banksto and01, callthen jumps to Bankswitch, calling b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F CF ld hl, wStringBuffer ; Address where new name gets written to
Line 830 ⟶ 814:
18 F3 jp .newChar
.terminator
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
21 01 C4 ld hl, $C401 ; Corresponds to screen tile
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
4D ld c, l ; How many bytes printed as numbers?
CD BF 13 call PrintBCDNumber.loop
.numLoop
2D dec l
CB FE set 7, (hl)
20 FB jp nz, .numLoop ; Repeat until hl == $C400
75 ld (hl), l ; Nulls out $C400
.inputLoop
CD 1C 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5 ld a, (hJoy5)
E6 0F and $0F ; Set z flag if A, B, START, SELECT not pressed
28 F7 jp z, .inputLoop
1F rra ; Is A pressed? If yes, set c flag
D1 pop de
F038 B5CB ldjr ac, (hJoy5).newMail
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
1F rra ; Is B pressed? If yes, set c flag
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
38 E1 jr c, .terminator
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?
1F rra ; Is SELECT pressed? If yes, set c flag
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 storedstarting address of $D89C from theto stackhl
C9D8 ret c ; SinceIf $D89CSELECT was poppedpressed, simply return to normal execution without executing newly written codeoperations
E9 jp hl ; If START pressed, jump to hl to execute newly written code
</pre>
 
Line 864 ⟶ 847:
.newMail
D5 push de
06 01 ld b, 01
21 14 63 ld hl, DisplayNameRaterScreen
CD 891C 3E39 call BankSwitch$391C ; Changesets romb banksto and01, callthen jumps to Bankswitch, calling b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F CF ld hl, wStringBuffer ; Address where new name gets written to
Line 883 ⟶ 865:
18 F3 jp .newChar
.terminator
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
21 01 C4 ld hl, $C401 ; Corresponds to screen tile
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
4D ld c, l ; How many bytes printed as numbers?
CD BF 13 call PrintBCDNumber.loop
.numLoop
2D dec l
CB FE set 7, (hl)
20 FB jp nz, .numLoop ; Repeat until hl == $C400
75 ld (hl), l ; Nulls out $C400
.inputLoop
CD 23 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5 ld a, (hJoy5)
E6 0F and $0F ; Set z flag if A, B, START, SELECT not pressed
28 F7 jp z, .inputLoop
1F rra ; Is A pressed? If yes, set c flag
D1 pop de
F038 B5CB ldjr ac, (hJoy5).newMail
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
1F rra ; Is B pressed? If yes, set c flag
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
38 E1 jr c, .terminator
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?
1F rra ; Is SELECT pressed? If yes, set c flag
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 storedstarting address of $D89C from theto stackhl
C9D8 ret c ; SinceIf $D89CSELECT was poppedpressed, simply return to normal execution without executing newly written codeoperations
E9 jp hl ; If START pressed, jump to hl to execute newly written code
</pre>
 
Line 916 ⟶ 897:
<pre>
11 A0 D8 D5 D5
06 01 21 56 63 CD 1A
CD 87 3E39 0E 80 21 4F
21 4F CF D1 2A 87 30
87 30 09 86 12 13 23
13 23 81 12 4F 18 F3
18 F3D5 21 2901 C4 4D
0ECD 01BC D513 CD2D BCCB
13FE CD20 21FB 3875 D1CD
F021 B538 A7F0 28B5 EEE6
1F0F 3828 CFF7 1B1F 1FD1
38 E7CB 1F1B 1F D838
1BE1 1B1F 1BE1 1BD8 17E9
30 C1 E1 C9 00
</pre>
 
Line 935 ⟶ 915:
<pre>
11 A0 D8 D5 D5
06 01 21 E2 62 CD 1C
CD 89 3E39 0E 80 21 4F
21 4F CF D1 2A 87 30
87 30 09 86 12 13 23
13 23 81 12 4F 18 F3
18 F3D5 21 2901 C4 4D
0ECD 01BF D513 CD2D BFCB
13FE CD20 23FB 3875 D1CD
F023 B538 A7F0 28B5 EEE6
1F0F 3828 CFF7 1B1F 1FD1
38 E7CB 1F1B 1F D838
1BE1 1B1F 1BE1 1BD8 17E9
30 C1 E1 C9 00
</pre>
 
Line 954 ⟶ 933:
<pre>
11 A0 D8 D5 D5
06 01 21 1C 63 CD 15
CD 82 3E39 0E 80 21 4F
21 4F CF D1 2A 87 30
87 30 09 86 12 13 23
13 23 81 12 4F 18 F3
18 F3D5 21 2901 C4 4D
0ECD 01BF D513 CD2D BFCB
13FE CD20 1CFB 3875 D1CD
F01C B538 A7F0 28B5 EEE6
1F0F 3828 CFF7 1B1F 1FD1
38 E7CB 1F1B 1F D838
1BE1 1B1F 1BE1 1BD8 17E9
30 C1 E1 C9 00
</pre>
 
Line 973 ⟶ 951:
<pre>
11 A0 D8 D5 D5
06 01 21 14 63 CD 1C
CD 89 3E39 0E 80 21 4F
21 4F CF D1 2A 87 30
87 30 09 86 12 13 23
13 23 81 12 4F 18 F3
18 F3D5 21 2901 C4 4D
0ECD 01BF D513 CD2D BFCB
13FE CD20 23FB 3875 D1CD
F023 B538 A7F0 28B5 EEE6
1F0F 3828 CFF7 1B1F 1FD1
38 E7CB 1F1B 1F D838
1BE1 1B1F 1BE1 1BD8 17E9
30 C1 E1 C9 00
</pre>
 
1,527

edits

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