Merge branch 'OWMain' into overworld_kara

This commit is contained in:
2021-10-30 09:56:26 -07:00
9 changed files with 92 additions and 35 deletions

View File

@@ -18,6 +18,14 @@ DoWorldFix:
LDA #$00
.noMirror
STA $7EF3CA ; set flag to light world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA $7EF3CC
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA $7EF3CC : BRA .done ; clear follower
.transform
LDA $7EF3CC : CMP #$07 : BNE .done : INC : STA $7EF3CC ; convert frog to dwarf
.done
RTL
@@ -52,12 +60,15 @@ DoWorldFix_Inverted:
.noMirror
.aga1Alive
LDA #$40 : STA $7EF3CA ; set flag to dark world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA $7EF3CC
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA $7EF3CC ; clear follower
LDA.b #$00 : STA $7EF3CC : BRA .done ; clear follower
.transform
LDA $7EF3CC : CMP #$07 : BNE .done : INC : STA $7EF3CC ; convert frog to dwarf
.done
RTL
;--------------------------------------------------------------------------------

View File

@@ -125,6 +125,11 @@ org $07a955 ; <- Bank07.asm : around 6564 (JP is a bit different) (STZ $05FC : S
jsl BlockEraseFix
nop #2
org $02A0A8
Mirror_SaveRoomData:
org $07A95B ; < bank_07.asm ; #_07A95B: JSL Mirror_SaveRoomData
jsl EGFixOnMirror
org $02b82a
jsl FixShopCode

View File

@@ -198,8 +198,17 @@ RTL
;--------------------------------------------------------------------------------
OnLinkDamagedFromPit:
JSL.l OHKOTimer
LDA.b #$14 : STA $11 ; thing we wrote over
RTL
LDA.l AllowAccidentalMajorGlitch
BEQ ++
-- LDA.b #$14 : STA $11 ; thing we wrote over
RTL
++ LDA.b $10 : CMP.b #$12 : BNE --
STZ.b $11
RTL
;--------------------------------------------------------------------------------
OnLinkDamagedFromPitOutdoors:
JML.l OHKOTimer ; make sure this is last

View File

@@ -2787,8 +2787,8 @@ org $0AEEF2
org $008BE5 ; hijack stripes for boss GFX transfer
JSL DoDungeonMapBossIcon
;================================================================================
; Terrorpin AI fix
;================================================================================
; Terrorpin AI fix
;--------------------------------------------------------------------------------
org $1EB2B1 ; sprite_terrorpin.asm(57) : AND.b #$03 : STA $0DE0, X ; 5 bytes
JSL FixTerrorpin ; 4 bytes

View File

@@ -861,7 +861,7 @@ RTS
map051:
{
LDA #$0034 : STA $22A8
LDA #$037D : STA $22A8
RTS
}

View File

@@ -73,8 +73,9 @@ TrapDoorFixer:
rts
Cleanup:
lda.l DRFlags : and #$10 : beq +
stz $047a
inc $11
+ inc $11
lda $ef
rts

View File

@@ -48,6 +48,12 @@ MirrorCheckOverride:
rtl
+ lda.l DRScroll : rtl
EGFixOnMirror:
lda.l DRFlags : and #$10 : beq +
stz $047a
+ jsl Mirror_SaveRoomData
rtl
BlockEraseFix:
lda $7ef353 : and #$02 : beq +
stz $05fc : stz $05fd

View File

@@ -12,6 +12,10 @@ dw 0
org $02a999
jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA
; whirlpool shuffle cross world change
org $02b3bd
jsl OWWhirlpoolUpdate ;JSL $02EA6C
; flute menu cancel
org $0ab7af ;LDA $F2 : ORA $F0 : AND #$C0
jml OWFluteCancel2 : nop
@@ -121,6 +125,16 @@ OWWorldCheck16:
plx : and.w #$00ff : rtl
}
OWWhirlpoolUpdate:
{
jsl $02ea6c ; what we wrote over
lda.l OWFlags : and #$01 : bne +
lda.l OWMode+1 : and #$02 : beq .return
+ ldx $8a : jsr OWWorldUpdate
.return
rtl
}
OWFluteCancel:
{
lda.l OWFlags+1 : and #$01 : bne +
@@ -338,8 +352,16 @@ OWNewDestination:
sep #$30 : lda OWOppSlotOffset,y : !add $04 : asl : and #$7f : sta $700
; crossed OW shuffle
LDA.l OWMode+1 : AND.b #!FLAG_OW_CROSSED : beq .return
ldx $05 : lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return
lda.l OWMode+1 : and.b #!FLAG_OW_CROSSED : beq .return
ldx $05 : jsr OWWorldUpdate
.return
lda $05 : sta $8a
rep #$30 : rts
}
OWWorldUpdate: ; x = owid of destination screen
{
lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return
sta.l $7ef3ca ; change world
lda #$38 : sta $012f ; play sfx - #$3b is an alternative
@@ -361,8 +383,7 @@ OWNewDestination:
+ stz $02e0 : stz $56
.return
lda $05 : sta $8a
rep #$30 : rts
rts
}
;Data
@@ -523,7 +544,7 @@ OWNorthEdges:
; Min Max Width Mid OW Slot/OWID VRAM *FREE* Dest Index
dw $00a0, $00a0, $0000, $00a0, $0000, $0000, $0000, $0040 ;Lost Woods
dw $0458, $0540, $00e8, $04cc, $0a0a, $0000, $0000, $0000
dw $0f70, $0f90, $0020, $0f80, $0f0f, $0000, $0000, $0041
dw $0f38, $0f60, $0028, $0f4c, $0f0f, $0000, $0000, $0041
dw $0058, $0058, $0000, $0058, $1010, $0000, $0000, $0001
dw $0178, $0178, $0000, $0178, $1010, $0000, $0000, $0002
dw $0388, $0388, $0000, $0388, $1111, $0000, $0000, $0003

View File

@@ -270,6 +270,10 @@ CrystalPendantFlags_2:
;Pendant: $00
;Crystal: $40
;--------------------------------------------------------------------------------
org $30805D ; PC 0x18005D
SmithDeleteOnSave:
db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith gets deleted on S+Q)
;--------------------------------------------------------------------------------
org $30805E ; PC 0x18005E - Number of crystals required to enter GT
NumberOfCrystalsRequiredForTower:
db #$07 ; #$07 = 7 Crystals