refactor reveal secrets with book code
This commit is contained in:
@@ -1,19 +1,26 @@
|
|||||||
;this is for making BG2 disappear when pressing X+R and having the book of mudora (modified parallel worlds x button secret), i use bank 0x3C for the whole code
|
;===========================================================
|
||||||
;WRITTEN: by XaserLE
|
; Reveal Secrets with Book of Mudora
|
||||||
;THANKS TO: -MathOnNapkins' Zelda Doc's
|
; Makes BG2 Disappear when pressing X+R
|
||||||
; -wiiqwertyuiop for his Zelda Disassembly
|
; Based on the Parallel Worlds feature
|
||||||
|
;
|
||||||
|
; Bank 0x3C used for whole code
|
||||||
; Layer Flags: xxxsabcd (i count BG from 1 to 4 - MathOnNapkins RAM-Map counts from 0 to 3)
|
; Layer Flags: xxxsabcd (i count BG from 1 to 4 - MathOnNapkins RAM-Map counts from 0 to 3)
|
||||||
; s - Sprite layer enabled
|
; s - Sprite layer enabled
|
||||||
; a - BG4 enabled
|
; a - BG4 enabled
|
||||||
; b - BG3 enabled
|
; b - BG3 enabled
|
||||||
; c - BG2 enabled
|
; c - BG2 enabled
|
||||||
; d - (BG1 disabled) --> only works properly if the room uses the feature "BG2 on Top"
|
; d - (BG1 disabled) --> only works properly if the room uses the feature "BG2 on Top"
|
||||||
|
;
|
||||||
|
; WRITTEN: by XaserLE
|
||||||
|
; THANKS TO: -MathOnNapkins' Zelda Doc's
|
||||||
|
; -wiiqwertyuiop for his Zelda Disassembly
|
||||||
|
;===========================================================
|
||||||
|
|
||||||
|
Reveal_Secrets:
|
||||||
|
{
|
||||||
header
|
header
|
||||||
lorom
|
lorom
|
||||||
|
|
||||||
|
|
||||||
ORG $0288FD ; go to the code that branches behind the dungeon map load if player didn't press X
|
ORG $0288FD ; go to the code that branches behind the dungeon map load if player didn't press X
|
||||||
BRA $1C ; make it always branch, so map isn't loaded anymore
|
BRA $1C ; make it always branch, so map isn't loaded anymore
|
||||||
|
|
||||||
@@ -23,8 +30,9 @@ JSL $3CA600 ; overwrite it (originally JSL $099F91)
|
|||||||
ORG $3CA600 ; go to expanded space to write our routine (keep EveryFrame.asm in mind for the right adresses)
|
ORG $3CA600 ; go to expanded space to write our routine (keep EveryFrame.asm in mind for the right adresses)
|
||||||
LDA $1B ; load data that tells us whether we are in a building or not
|
LDA $1B ; load data that tells us whether we are in a building or not
|
||||||
AND #$01 ; are we in a building?
|
AND #$01 ; are we in a building?
|
||||||
BEQ END_XBUTTONSECRET ; if not, don't use the x-button-secret
|
BEQ END ; if not, don't use the x-button-secret
|
||||||
;BG2 disable on pressing R
|
|
||||||
|
; ----------
|
||||||
LDA $7EF34D ; load book of mudora slot
|
LDA $7EF34D ; load book of mudora slot
|
||||||
CMP #$01 ; do we have the moon pearl?
|
CMP #$01 ; do we have the moon pearl?
|
||||||
BNE $0F ; if not, go to enable BG2
|
BNE $0F ; if not, go to enable BG2
|
||||||
@@ -39,6 +47,9 @@ BEQ END_XBUTTONSECRET ; if not, don't use the x-button-secret
|
|||||||
LDA $1C ; load layer flags
|
LDA $1C ; load layer flags
|
||||||
ORA #$02 ; enable BG2 (0x02 = 00000010)
|
ORA #$02 ; enable BG2 (0x02 = 00000010)
|
||||||
STA $1C ; store layer flags
|
STA $1C ; store layer flags
|
||||||
END_XBUTTONSECRET:
|
; ----------
|
||||||
|
|
||||||
|
END:
|
||||||
JSL $099F91 ; at least execute original code
|
JSL $099F91 ; at least execute original code
|
||||||
RTL
|
RTL
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user