map & lamp fixes

This commit is contained in:
Karkat
2017-05-19 00:07:56 -04:00
parent f755a63925
commit e30814ad16
5 changed files with 49 additions and 11 deletions

View File

@@ -55,6 +55,7 @@ DrawDungeonCompassCounts:
+ : ++ + : ++
JSL.l HexToDec JSL.l HexToDec
;LDX.b #$00 ; check the width on this
LDA $7F5006 : AND.w #$00FF : ORA #$2400 : STA $7EC794 LDA $7F5006 : AND.w #$00FF : ORA #$2400 : STA $7EC794
LDA $7F5007 : AND.w #$00FF : ORA #$2400 : STA $7EC796 LDA $7F5007 : AND.w #$00FF : ORA #$2400 : STA $7EC796

View File

@@ -2,15 +2,32 @@
; Glitched Mode Fixes ; Glitched Mode Fixes
;================================================================================ ;================================================================================
GetAgahnimType: GetAgahnimType:
PHP LDA $A0 ; get room id
REP #$20 ; set 16-bit accumulator CMP.b #13 : BNE + ; Agahnim 2 room
LDA $A0 ; these are all decimal because i got them that way LDA.b #$0006 ; Use Agahnim 2
CMP.w #13 : BNE + ; Agahnim 2 room
LDA.w #$0006 ; Use Agahnim 2
BRA .done BRA .done
+ ; Elsewhere + ; Elsewhere
LDA.w #$0001 ; Use Agahnim 1 LDA.b #$0001 ; Use Agahnim 1
.done .done
PLP
RTL RTL
;--------------------------------------------------------------------------------
GetAgahnimPalette:
PHX
LDA $A0 ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$01 ; Use Agahnim 2
JML.l GetAgahnimPaletteReturn
+ ; Elsewhere
LDA.b #$00 ; Use Agahnim 1
JML.l GetAgahnimPaletteReturn
;--------------------------------------------------------------------------------
GetAgahnimLightning:
INC $0E30, X ; thing we wrote over
LDA $A0 ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$01 ; Use Agahnim 2
RTL
+ ; Elsewhere
LDA.b #$00 ; Use Agahnim 1
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -765,10 +765,18 @@ NOP
;================================================================================ ;================================================================================
; Glitched Mode Fixes ; Glitched Mode Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $1ED4E6 ; <- F54E6 org $1ED4E6 ; <- F54E6 - sprite_agahnim.asm:314 (LDY $0FFF)
JSL.l GetAgahnimType JSL.l GetAgahnimType
NOP #2 NOP #2
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $1ED577 ; <- F5577 - sprite_agahnim.asm:418 (PHX)
JML.l GetAgahnimPalette
GetAgahnimPaletteReturn:
;--------------------------------------------------------------------------------
org $1ED577 ; <- F5577 - sprite_agahnim.asm:587 (INC $0E30, X)
NOP #2
JSL.l GetAgahnimLightning
;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
; Half Magic Bat ; Half Magic Bat
@@ -918,6 +926,9 @@ JSL.l GetMapMode
org $0DC849 ; <- 6C849 org $0DC849 ; <- 6C849
JSL.l GetMapMode JSL.l GetMapMode
;================================================================================ ;================================================================================
org $0AC012 ; <- 54012 - Bank0A.asm:1039 (LDA $7EF2DB : AND.b #$20 : BNE BRANCH_DELTA)
NOP #8
;================================================================================
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA) org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA)
JSL.l CheckHeraObject : BNE + : NOP JSL.l CheckHeraObject : BNE + : NOP
LDX.b #$F1 : STX $012C LDX.b #$F1 : STX $012C
@@ -1552,4 +1563,7 @@ NOP #6 ; remove check
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $0DFA53 ; <- 6FA53 - hud check for lantern org $0DFA53 ; <- 6FA53 - hud check for lantern
JSL.l LampCheck JSL.l LampCheck
;--------------------------------------------------------------------------------
org $01F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D)
JSL.l SetOverlayIfLamp
;================================================================================ ;================================================================================

View File

@@ -30,4 +30,10 @@ CheckForZelda:
LDA $7EF3CC LDA $7EF3CC
RTL RTL
;================================================================================ ;================================================================================
;--------------------------------------------------------------------------------
SetOverlayIfLamp:
LDA $7EF34A ; check if lamp
STA $1D ; write it directly to the overlay, this isn't a terrible idea at all
RTL
;================================================================================
;LDA $7EF3CA : EOR #$40 : LSR #6 : AND #$01 ; return the same result as having the lantern in the light world ;LDA $7EF3CA : EOR #$40 : LSR #6 : AND #$01 ; return the same result as having the lantern in the light world

View File

@@ -131,7 +131,7 @@ org $30803B ; PC 0x18003B
MapMode: MapMode:
db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item
CompassMode: CompassMode:
db #$01 ; #$00 = Off (default) - #$01 = Display Dungeon Count db #$00 ; #$00 = Off (default) - #$01 = Display Dungeon Count
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308080 ; PC 0x180080 org $308080 ; PC 0x180080
Upgrade5BombsRefill: Upgrade5BombsRefill:
@@ -145,9 +145,9 @@ db #$00
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308084 ; PC 0x180084 org $308084 ; PC 0x180084
PotionHealthRefill: PotionHealthRefill:
db #$08 ; #$A0 - Full Refill (Default) db #$A0 ; #$A0 - Full Refill (Default)
PotionMagicRefill: PotionMagicRefill:
db #$08 ; #$80 - Full Refill (Default) db #$80 ; #$80 - Full Refill (Default)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308040 ; PC 0x180040 org $308040 ; PC 0x180040
UncleQuote: UncleQuote: