Added a TF Cutscene when getting the TF item

This commit is contained in:
codemann8
2023-05-13 02:07:40 -05:00
parent 3497bd6514
commit 9c08588d92
7 changed files with 211 additions and 14 deletions

View File

@@ -623,6 +623,9 @@ Sprite_PrepAndDrawSingleLargeLong:
org $06DC00
Sprite_PrepAndDrawSingleSmallLong:
org $06E41C
Sprite_PrepOAMCoordLong:
org $06EA18
Sprite_ApplySpeedTowardsPlayerLong:

View File

@@ -93,3 +93,12 @@ OverridePaletteHeader:
iny : rtl
+ rep #$20 : iny : lda [$0D], Y ; what we wrote over
rtl
Sprite_ConditionalPrepOAMCoord:
LDA.w $0E20,X : CMP.b #$62 : BNE .notMasterSword
LDA.w $0D90,X : BNE .specialCutscene
.notMasterSword
JML Sprite_PrepOAMCoordLong ; what we wrote over
.specialCutscene
SEC ; this prevents MasterSword sprite from drawing if it is a special cutscene
RTL

150
elder.asm
View File

@@ -12,7 +12,7 @@ JSR Elder_Code
PLB
RTL
}
Elder_Draw:
{
@@ -60,7 +60,7 @@ RTL
LDA.l GoalCounter
CMP.l GoalItemRequirement : !BLT +
SEP #$20
JSL.l ActivateGoal
JSL ActivateTriforceCutscene
+
.dont_show
@@ -69,3 +69,149 @@ RTL
LDA.b $1A : LSR #5 : AND.b #$01 : STA.w $0DC0, X
RTS
}
;--------------------------------------------------------------------------------
; Triforce (Pedestal) Cutscene
;--------------------------------------------------------------------------------
ActivateTriforceCutscene:
; despawn other sprites
LDY.b #$0F
- LDA.w $0E20,Y : CMP.b #$16 : BNE +
CPY.b #$00 : BEQ .next
; move Murahdahla to slot 0 for draw priority reasons
LDA.w $0E20,Y : STA.w $0E20
LDA.w $0D00,Y : STA.w $0D00
LDA.w $0D10,Y : STA.w $0D10
LDA.w $0D20,Y : STA.w $0D20
LDA.w $0D30,Y : STA.w $0D30
LDA.w $0D40,Y : STA.w $0D40
LDA.w $0F50,Y : STA.w $0F50
LDA.w $0E40,Y : STA.w $0E40
LDA.w $0E60,Y : STA.w $0E60
LDA.w $0DD0,Y : STA.w $0DD0
LDA.b #$02 : STA.w $0F20
+ LDA.b #$00 : STA.w $0DD0,Y
.next
DEY : BPL -
LDA.b #$62 ; MasterSword Sprite
JSL Sprite_SpawnDynamically
; set up coords
LDA.b $22 : STA.w $0D10,Y
LDA.b $23 : STA.w $0D30,Y
LDA.b $20 : CLC : ADC.b #$08 : STA.w $0D00,Y
LDA.b $21 : ADC.b #$00 : STA.w $0D20,Y
LDA.b #$01 : STA.w $0D90,Y ; our indicator this is a special cutscene sprite
INC : STA.b $2F ; makes Link face downward
; reset modules
LDA.b $1B : BEQ +
LDA.b #$07
BRA ++
+ LDA.b #$09
++ STA.b $10
STZ.b $11 : STZ.b $B0
RTL
pushpc
org $058928
MasterSword_InPedestal_DoCutscene:
org $0589B1
MasterSword_ConditionalHandleReceipt_DoReceipt:
org $05890E
JSL MasterSword_ConditionalActivateCutscene
org $05895F
JSL MasterSword_ConditionalGrabPose : NOP
org $058994
JSL MasterSword_ConditionalGrabPose : NOP
org $058D1C
JML MasterSword_SpawnPendantProp_ChangePalette
MasterSword_SpawnPendantProp_ChangePalette_return:
org $0589A3
JSL MasterSword_ConditionalHandleReceipt : NOP #2
pullpc
MasterSword_ConditionalActivateCutscene:
LDA.w $0D90,X : BNE .specialCutscene
JML Sprite_CheckDamageToPlayerSameLayerLong ; what we wrote over
.specialCutscene
LDA.b #$02 : STA.w $02DA ; Link's 2-hands-up pose
STA.b $EE ; draw Link on top
LDA.b #$6A : JSL RequestSlottedTile ; draw Triforce piece in VRAM
PLA : PLA : PLA : JML MasterSword_InPedestal_DoCutscene ; do cutscene
MasterSword_ConditionalGrabPose:
PHA
LDA.w $0D90,X : BNE .specialCutscene
PLA
STA.w $0377 : LDA.b #$01 ; what we wrote over
RTL
.specialCutscene
PLA
LDA.b #$01
RTL
MasterSword_SpawnPendantProp_ChangePalette:
STA.w $0D40,Y : PLX ; what we wrote over
LDA.w $0D90,X : BNE .specialCutscene
BRA .done
.specialCutscene
LDA.b #$08 : STA.w $0F50,Y ; change palette
LDA.b #$02 : STA.w $0F20,Y ; change layer
.done
JML MasterSword_SpawnPendantProp_ChangePalette_return
MasterSword_ConditionalHandleReceipt:
LDA.w $0D90,X : BNE .specialCutscene
LDX.b $8A : LDA.l $7EF280,X ; what we wrote over
RTL
.specialCutscene
PLA : PLA : PEA.w MasterSword_ConditionalHandleReceipt_DoReceipt-1
LDA.b 4,S : TAX
LDY.b #$6A
RTL
pushpc
org $058AB6
MasterSword_SpawnLightWell:
org $058AD0
MasterSword_SpawnLightFountain:
org $058B62
MasterSword_SpawnLightBeam:
org $058941
JSL MasterSword_ConditionalSpawnLightWell : NOP #2
MasterSword_SpawnLightWell_return:
org $058952
JSL MasterSword_ConditionalSpawnLightFountain : NOP #2
MasterSword_SpawnLightFountain_return:
org $058B64
JSL MasterSword_ConditionalSpawnLightBeam : NOP #2
pullpc
MasterSword_ConditionalSpawnLightWell:
INC.w $0D80,X ; part of what we wrote over
LDA.w $0D90,X : BNE .specialCutscene
PLA : PLA : PLA : PEA.w MasterSword_SpawnLightWell_return-1
JML MasterSword_SpawnLightWell ; part of what we wrote over
.specialCutscene
RTL
MasterSword_ConditionalSpawnLightFountain:
INC.w $0D80,X ; part of what we wrote over
LDA.w $0D90,X : BNE .specialCutscene
PLA : PLA : PLA : PEA.w MasterSword_SpawnLightFountain_return-1
JML MasterSword_SpawnLightFountain ; part of what we wrote over
.specialCutscene
RTL
MasterSword_ConditionalSpawnLightBeam:
LDA.w $0D90,X : BNE .specialCutscene
LDA.b #$62 : JSL Sprite_SpawnDynamically ; what we wrote over
RTL
.specialCutscene
LDY.b #$FF
RTL

View File

@@ -995,9 +995,15 @@ org $00D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL.l GetAnimatedSpriteBufferPointer
NOP
org $05FA50
JSL Sprite_ConditionalPrepOAMCoord
org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL.l AddReceivedItemExpanded
org $08C505
JSL Ancilla22_ItemReceipt_ContinueB : NOP #2
org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML.l Multiworld_AddReceivedItem_notCrystal
NOP

View File

@@ -69,15 +69,23 @@ RequestSlottedTile:
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFX,X
+++ INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$B1 : BNE + ; if apple, use apple OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFX,X
+++ INC : INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$6A : BNE + ; if triforce, use cutscene OAM slot
PHA
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFX,X
JMP .initRequest ; don't jump to end, we need the TF GFX to draw at $E7
+
PHA
@@ -210,6 +218,7 @@ FreeUWGraphics:
dw $9DC0>>1
; add new slots above this line
.end
dw $9CE0>>1
; above this line, add slots that we want to draw to specific slots
FreeOWGraphics:
@@ -221,6 +230,7 @@ FreeOWGraphics:
;dw $9DC0>>1 ; Whirlpool
; add new slots above this line
.end
dw $9CE0>>1
; above this line, add slots that we want to draw to specific slots
;===================================================================================================
@@ -374,7 +384,8 @@ DynamicOAMTileUW_full:
; add new rotating slots above this line
; <none>
dw -4, -1 : db $E7, $00, $20, $02 ; triforce
dd 0, 0
; above this line, add slots that we want to draw to specific slots
@@ -439,7 +450,8 @@ DynamicOAMTileOW_full:
; add new slots above this line
; <none>
dw 0, 0 : db $E7, $00, $20, $02 ; triforce
dd 0, 0
; above this line, add slots that we want to draw to specific slots

View File

@@ -240,7 +240,10 @@ Multiworld_MasterSword_GrantToPlayer:
LDA PedestalSword_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
CPY.b #$6A : BEQ +
JSL Link_ReceiveItem ; thing we wrote over
RTL
+ JSL ActivateGoal
RTL
}

View File

@@ -186,7 +186,11 @@ ProcessEventItems:
LDA GoalCounter : INC : STA GoalCounter
CMP GoalItemRequirement : !BLT ++
LDA TurnInGoalItems : AND.w #$00FF : BNE ++
SEP #$20 ; set 8-bit accumulator
LDA.b $8A : CMP.b #$80 : BNE +++
LDA.b $23 : BNE +++
JSL.l ActivateGoal
+++
++
SEP #$20 ; set 8-bit accumulator
LDX.b #$01 : BRA .done
@@ -330,7 +334,10 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$65 : BNE + ; Progressive Bow
JMP .done
+ CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce)
LDA.b $8A : CMP.b #$80 : BNE ++
LDA.b $23 : BNE ++
JSL.l ActivateGoal
++
JMP .done
+ CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star)
BRA .multi_collect
@@ -341,7 +348,11 @@ AddReceivedItemExpandedGetItem:
LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.w GoalItemRequirement : !BLT ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++
SEP #$20 ; set 8-bit accumulator
LDA.b $8A : CMP.b #$80 : BNE +++
LDA.b $23 : BNE +++
JSL.l ActivateGoal
+++
++
SEP #$20 ; set 8-bit accumulator
JMP .done
@@ -1263,6 +1274,13 @@ ChestPrep:
SEC
RTL
;--------------------------------------------------------------------------------
Ancilla22_ItemReceipt_ContinueB:
CMP.b #$6A : BNE .return
JSL ActivateTriforceCutscene
.return
STZ.w $0C4A,X : STZ.w $0FC1 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
; Set a flag in SRAM if we pick up a compass in its own dungeon with HUD compass
; counts on
MaybeFlagCompassTotalPickup: