Pseudoflute

This commit is contained in:
2025-12-13 19:06:11 -06:00
parent 18a73e3b88
commit 74d9c72cc8
7 changed files with 152 additions and 3 deletions

View File

@@ -208,6 +208,7 @@ incsrc mimicdash.asm
incsrc gloom.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc pseudoflute.asm
warnpc $BA8000
org $A38000

View File

@@ -277,6 +277,7 @@ OnOWTransition:
RTL
;--------------------------------------------------------------------------------
OnLoadDuckMap:
JSL SelectFirstFluteSpot
LDA.l DuckMapFlag
BNE +
INC : STA.l DuckMapFlag

View File

@@ -2779,3 +2779,31 @@ NOP
org $0DD677 ; Bank0D.asm@1303 (JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckBeeVulnerability
;--------------------------------------------------------------------------------
;================================================================================
; PseudoFlute
;--------------------------------------------------------------------------------
org $8AB7D5 ; bank_0A.asm@5655 (DEC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFlutePrev
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB7E3 ; bank_0A.asm@5665 (INC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFluteNext
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB877 ; bank_0A.asm@5758 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $8AB8BF ; bank_0A.asm@5800 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $82AFBE ; bank_02.asm@8776 (LDA.l $7EC213 : STA.b $8A)
JSL CheckEnterOverworld
NOP #2
;--------------------------------------------------------------------------------
org $82A9A1 ; bank_02.asm@7655 (STA.b $8A : STA.w $040A)
JSL CheckTransitionOverworld
NOP
;--------------------------------------------------------------------------------

View File

@@ -114,7 +114,10 @@ StartingGenericKeys: skip 1 ; PC 0x18338B
InitInventoryTracking: skip 2 ; PC 0x18338C \ Need to set bits here for silver arrows,
InitBowTracking: skip 2 ; PC 0x18338E / boomerangs, powder/mushroom, etc
InitItemLimitCounts: skip 16 ; PC 0x183390
skip 37 ;
skip 34 ;
InitFluteBitfield: db $FF ;
InitSpecialWeaponLevel: db $00 ;
InitItemOnB: db $00 ;
InitProgressIndicator: db $02 ; PC 0x1833C5 - Set to $80 for instant post-aga with standard
InitProgressFlags: db $14 ; PC 0x1833C6 - Set to $00 for standard
InitMapIcons: skip 1 ; PC 0x1833C7

View File

@@ -320,6 +320,7 @@ OWLightWorldOrCrossed:
OWFluteCancel:
{
lda.l FluteBitfield : beq +
lda.l OWFlags+1 : and.b #$01 : bne +
jsl FluteMenu_LoadTransport : rtl
+ lda.w RandoOverworldTargetEdge : bne +
@@ -331,8 +332,10 @@ OWFluteCancel2:
lda.b Joy1B_All : ora.b Joy1A_All : and.b #$c0 : bne +
jml FluteMenu_HandleSelection_NoSelection
+ inc.w SubModuleInterface
lda.l FluteBitfield : beq .cancel
lda.l OWFlags+1 : and.b #$01 : beq +
lda.b Joy1B_All : cmp.b #$40 : bne +
.cancel
lda.b #$01 : sta.w RandoOverworldTargetEdge
+ rtl
}
@@ -1836,4 +1839,4 @@ db $18, $0A, $D8 ; yx:{ 0x180, 0x0A0 }
db $18, $0F, $45 ; yx:{ 0x180, 0x0F0 }
db $FF ; END
org $89CA55
dw Overworld_Sprites_Screen1A_2&$FFFF
dw Overworld_Sprites_Screen1A_2&$FFFF

112
pseudoflute.asm Normal file
View File

@@ -0,0 +1,112 @@
SelectFirstFluteSpot:
LDA.l FluteBitfield
BNE .try_next
RTL
.try_next
LDA.w $1AF0
INC A
AND.b #$07
STA.w $1AF0
TAX
LDA.l FluteBitfield
AND.l $8AB7A3, X
BEQ .try_next
RTL
SelectFluteNext:
LDA.l FluteBitfield
BEQ InvalidBeep
.try_next
LDA.w $1AF0
INC A
AND.b #$07
STA.w $1AF0
TAX
LDA.l FluteBitfield
AND.l $8AB7A3, X
BEQ .try_next
LDA.b #$20
STA.w $012F
RTL
SelectFlutePrev:
LDA.l FluteBitfield
BEQ InvalidBeep
.try_next
LDA.w $1AF0
DEC A
AND.b #$07
STA.w $1AF0
TAX
LDA.l FluteBitfield
AND.l $8AB7A3, X
BEQ .try_next
LDA.b #$20
STA.w $012F
RTL
InvalidBeep:
LDA.b #$3C
STA.w $012E
RTL
SetFluteSpotPalette:
XBA
LDA.l FluteBitfield
AND.l $8AB7A3, X
BEQ .disabled
.enabled
XBA
STA.b $0C
BRA .done
.disabled
LDA.b #$30
STA.b $0C
.done
LDA.b #$00
STA.b $0B
RTL
MaybeMarkFluteSpotVisited:
; don't ever allow the portal in desert/mire to be marked visited
CMP.b #$30 : BEQ .done
CMP.b #$70 : BEQ .done
LDX.b #$0E
.next
CMP.l $02E849, X
BEQ .mark
DEX : DEX
BPL .next
BRA .done
.mark
TXA
LSR A
TAX
LDA.l FluteBitfield
ORA.l $8AB7A3, X
STA.l FluteBitfield
.done
RTL
CheckEnterOverworld:
LDA.l $7EC213
STA.b $8A ; what we wrote over
SEP #$20
JSL MaybeMarkFluteSpotVisited
REP #$20
RTL
CheckTransitionOverworld:
STA.b $8A
STA.w $040A ; what we wrote over
JML MaybeMarkFluteSpotVisited

View File

@@ -190,7 +190,8 @@ ItemLimitCounts: skip 16 ; Keeps track of limited non-progressive items s
; See: ItemSubstitutionRules in tables.asm
; Right now this is only used for three items but extra space is
; reserved
skip 35 ; Unused
skip 34 ; Unused
FluteBitfield: skip 1 ;
SpecialWeaponLevel: skip 1 ; keeps track of level in special weapon modes
ItemOnB: skip 1 ; NYI
ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued