Refactor book code, close namespaces, housekeeping

This commit is contained in:
scawful
2023-02-05 01:28:35 -06:00
parent d114a90fd2
commit 41fa5a5ec7
11 changed files with 116 additions and 110 deletions

View File

@@ -17,37 +17,31 @@
; HM x and y value of the position of the key block must end with: 0, 2, 4, 6, 8, A, C, E.
;===========================================================
namespace KeyBlock
{
Main: {
lorom
lorom
ORG $01EB8C ; go to the code that loads the big key holding variable
LDA $7EF36F ; load the small key counter
AND #$00FF ; check if we have at least one small key (AND will not be zero)
BEQ $4C ; if not (AND is zero), don't do anything and especially don't give this "Eh? It's locked..." - message
; otherwise we will decrement the small key counter and branch to the code that opens the prison door
LDA $7EF36F ; reload small key counter
DEC A ; remove one key
STA $7EF36F ; save the new value at small key counter position
BRA $05 ; branch to the code that opens the prison door
ORG $01EB8C ; go to the code that loads the big key holding variable
LDA $7EF36F ; load the small key counter
AND #$00FF ; check if we have at least one small key (AND will not be zero)
BEQ $4C ; if not (AND is zero), don't do anything and especially don't give this "Eh? It's locked..." - message
; otherwise we will decrement the small key counter and branch to the code that opens the prison door
LDA $7EF36F ; reload small key counter
DEC A ; remove one key
STA $7EF36F ; save the new value at small key counter position
BRA $05 ; branch to the code that opens the prison door
; now correct a drawing bug in the original game that causes the floor tile under the door drawed odd
ORG $01EBC8
LDA.w $9B5A,y
ORG $01EBD1
LDA.w $9B54,y
ORG $01EBDA
LDA.w $9B5C,y
; draw values representation
; 50- /
; 52- normal
; 54- x mirror
; 56- normal
; 58- x mirror
; 5A- y mirror
; 5C- xy mirror
; 5E- y mirror
} ; label Main
} ; namespace KeyBlock
namespace off
; now correct a drawing bug in the original game that causes the floor tile under the door drawed odd
ORG $01EBC8
LDA.w $9B5A,y
ORG $01EBD1
LDA.w $9B54,y
ORG $01EBDA
LDA.w $9B5C,y
; draw values representation
; 50- /
; 52- normal
; 54- x mirror
; 56- normal
; 58- x mirror
; 5A- y mirror
; 5C- xy mirror
; 5E- y mirror