Guides:Fast 0x1500 ACE: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
Line 488: Line 488:
E1 pop hl ; hl = $F500
E1 pop hl ; hl = $F500
E6 EF and $F5 ; a = $E5
E6 EF and $F5 ; a = $E5
84 add a, h ; af = $DA10
84 add a, h ; af = $DA10
F5 push af
F5 push af
50 ld d, b
50 ld d, b
Line 497: Line 497:
D0 ret nc ; On first pass, ignored. Taken whenever $DB7F is called
D0 ret nc ; On first pass, ignored. Taken whenever $DB7F is called
D6 B9 sub $B9 ; a = $21
D6 B9 sub $B9 ; a = $21
EA 81 FB ld ($FB81), a
EA 81 FB ld ($FB81), a
50 ld d, b
50 ld d, b


Box 3: $DB87
Box 3: $DB87
D6 FF sub $FF ; a = $22
D6 FF sub $FF ; a = $22
EA 7F FB ld ($FB7F), a
EA 7F FB ld ($FB7F), a
D6 F4 sub $F4 ; a = $2E
D6 F4 sub $F4 ; a = $2E
85 add a, l ; a = $3E, reset carry flag
85 add a, l ; a = $3E, reset carry flag
50 ld d, b
50 ld d, b


Box 4: $DB90
Box 4: $DB90
D4 7F FB call nc, $FB7F
D4 7F FB call nc, $FB7F
E6 84 and $84 ; a = $04
E6 84 and $84 ; a = $04
D4 7F FB call nc, $FB7F
D4 7F FB call nc, $FB7F
50 ld d, b
50 ld d, b


Box 5: $DB99
Box 5: $DB99
D6 D4 sub $D4 ; a = $30
D6 D4 sub $D4 ; a = $30
EA 89 FB ld ($FB89), a
EA 89 FB ld ($FB89), a
D6 FE sub $FE ; a = $32
D6 FE sub $FE ; a = $32
FB ei
FB ei
Line 521: Line 521:


Box 6: $DBA2
Box 6: $DBA2
EA 85 FB ld ($FB85), a
EA 85 FB ld ($FB85), a
D6 F1 sub $F1 ; a = $41
D6 F1 sub $F1 ; a = $41
EA 88 FB ld ($FB88), a
EA 88 FB ld ($FB88), a
50 ld d, b
50 ld d, b


Box 7: $DBAB
Box 7: $DBAB
F6 82 or $82 ; a = $C3, reset carry flag
F6 82 or $82 ; a = $C3, reset carry flag
D4 7F FB call nc, $FB7F
D4 7F FB call nc, $FB7F
EA 87 FB ld ($FB87), a
EA 87 FB ld ($FB87), a
50 ld d, b
50 ld d, b


Box 8: $DBB4
Box 8: $DBB4
AF xor a ; a = $00
AF xor a ; a = $00
EA 86 FB ld ($FB86), a
EA 86 FB ld ($FB86), a
F5 push af
F5 push af
D6 A7 sub $A7 ; a = $59
D6 A7 sub $A7 ; a = $59
Line 541: Line 541:


Box 9: $DBBD
Box 9: $DBBD
D4 7F FB call nc, $FB7F
D4 7F FB call nc, $FB7F
EA 82 FB ld ($FB82), a
EA 82 FB ld ($FB82), a
D6 81 sub $81 ; a = $D8
D6 81 sub $81 ; a = $D8
50 ld d, b
50 ld d, b
Line 548: Line 548:
Box 10: $DBC6
Box 10: $DBC6
A7 and a ; Reset carry flag
A7 and a ; Reset carry flag
D4 7F FB call nc, $FB7F
D4 7F FB call nc, $FB7F
EA 83 FB ld ($FB83), a
EA 83 FB ld ($FB83), a
F1 pop af ; a = $00
F1 pop af ; a = $00
50 ld d, b
50 ld d, b
Line 555: Line 555:
Box 11: $DBCF
Box 11: $DBCF
D6 FF sub $FF ; a = $01
D6 FF sub $FF ; a = $01
EA 84 FB ld ($FB84), a
EA 84 FB ld ($FB84), a
E1 pop hl ; first of two pops to prevent side effects of 0x1500 ACE
E1 pop hl ; first of two pops to prevent side effects of 0x1500 ACE
F6 FF or $FF ; a = $FF
F6 FF or $FF ; a = $FF
Line 561: Line 561:


Box 12: $DBD8
Box 12: $DBD8
D4 81 FB call nc, $FB81 ; $FB81 was rewritten to 21 59 D8 01 32 00 C3 41 30
D4 81 FB call nc, $FB81 ; $FB81 was rewritten to 21 59 D8 01 32 00 C3 41 30
EA 82 FB ld ($FB82), a ; Replace $59 by $FF to prevent possible crash when viewing $59 as text
EA 82 FB ld ($FB82), a ; Replace $59 by $FF to prevent possible crash when viewing $59 as text
E1 pop hl ; second of two pops to prevent side effects of 0x1500 ACE
E1 pop hl ; second of two pops to prevent side effects of 0x1500 ACE
D6 50 sub $50 a = $AF
D6 50 sub $50 ; a = $AF


Box 13: $DBE1
Box 13: $DBE1
D6 E1 sub $E1 a = $CE
D6 E1 sub $E1 ; a = $CE
EA 93 F8 ld (wItems), a ; Replace first item in item pocket with TM15
EA 93 F8 ld (wItems), a ; Replace first item in item pocket with TM15
A7 and a ; Reset carry flag
A7 and a ; Reset carry flag
D0 ret nc
D0 ret nc