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 org $06DC00
Sprite_PrepAndDrawSingleSmallLong: Sprite_PrepAndDrawSingleSmallLong:
org $06E41C
Sprite_PrepOAMCoordLong:
org $06EA18 org $06EA18
Sprite_ApplySpeedTowardsPlayerLong: Sprite_ApplySpeedTowardsPlayerLong:

View File

@@ -92,4 +92,13 @@ OverridePaletteHeader:
lda.l PaletteTable, x lda.l PaletteTable, x
iny : rtl iny : rtl
+ rep #$20 : iny : lda [$0D], Y ; what we wrote over + rep #$20 : iny : lda [$0D], Y ; what we wrote over
rtl 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 PLB
RTL RTL
}
Elder_Draw: Elder_Draw:
{ {
@@ -60,7 +60,7 @@ RTL
LDA.l GoalCounter LDA.l GoalCounter
CMP.l GoalItemRequirement : !BLT + CMP.l GoalItemRequirement : !BLT +
SEP #$20 SEP #$20
JSL.l ActivateGoal JSL ActivateTriforceCutscene
+ +
.dont_show .dont_show
@@ -69,3 +69,149 @@ RTL
LDA.b $1A : LSR #5 : AND.b #$01 : STA.w $0DC0, X LDA.b $1A : LSR #5 : AND.b #$01 : STA.w $0DC0, X
RTS 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 JSL.l GetAnimatedSpriteBufferPointer
NOP NOP
org $05FA50
JSL Sprite_ConditionalPrepOAMCoord
org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem) org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL.l AddReceivedItemExpanded JSL.l AddReceivedItemExpanded
org $08C505
JSL Ancilla22_ItemReceipt_ContinueB : NOP #2
org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX) org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML.l Multiworld_AddReceivedItem_notCrystal JML.l Multiworld_AddReceivedItem_notCrystal
NOP NOP

View File

@@ -69,15 +69,23 @@ RequestSlottedTile:
LDA.b #!DynamicDropGFXSlotCount_UW LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++ BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW ++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFX,X +++ INC : STA.w SprItemGFX,X
JMP .success JMP .success
+ CMP.b #$B1 : BNE + ; if apple, use apple OAM slot + CMP.b #$B1 : BNE + ; if apple, use apple OAM slot
LDA.b $1B : BEQ ++ LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++ BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW ++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFX,X +++ INC : INC : STA.w SprItemGFX,X
JMP .success 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 PHA
@@ -210,6 +218,7 @@ FreeUWGraphics:
dw $9DC0>>1 dw $9DC0>>1
; add new slots above this line ; add new slots above this line
.end .end
dw $9CE0>>1
; above this line, add slots that we want to draw to specific slots ; above this line, add slots that we want to draw to specific slots
FreeOWGraphics: FreeOWGraphics:
@@ -221,6 +230,7 @@ FreeOWGraphics:
;dw $9DC0>>1 ; Whirlpool ;dw $9DC0>>1 ; Whirlpool
; add new slots above this line ; add new slots above this line
.end .end
dw $9CE0>>1
; above this line, add slots that we want to draw to specific slots ; 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 ; 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 ; 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 ; 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 ; 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 LDA PedestalSword_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over CPY.b #$6A : BEQ +
JSL Link_ReceiveItem ; thing we wrote over
RTL
+ JSL ActivateGoal
RTL RTL
} }

View File

@@ -181,14 +181,18 @@ ProcessEventItems:
LDA RNGItem : INC : STA RNGItem LDA RNGItem : INC : STA RNGItem
SEP #$10 ; set 8-bit index registers SEP #$10 ; set 8-bit index registers
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA GoalItemRequirement : BEQ ++ LDA GoalItemRequirement : BEQ ++
LDA GoalCounter : INC : STA GoalCounter LDA GoalCounter : INC : STA GoalCounter
CMP GoalItemRequirement : !BLT ++ CMP GoalItemRequirement : !BLT ++
LDA TurnInGoalItems : AND.w #$00FF : BNE ++ LDA TurnInGoalItems : AND.w #$00FF : BNE ++
JSL.l ActivateGoal 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 SEP #$20 ; set 8-bit accumulator
LDX.b #$01 : BRA .done LDX.b #$01 : BRA .done
+ +
LDX.b #$00 LDX.b #$00
@@ -330,20 +334,27 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$65 : BNE + ; Progressive Bow + CMP.b #$65 : BNE + ; Progressive Bow
JMP .done JMP .done
+ CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce) + CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce)
JSL.l ActivateGoal LDA.b $8A : CMP.b #$80 : BNE ++
LDA.b $23 : BNE ++
JSL.l ActivateGoal
++
JMP .done JMP .done
+ CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star) + CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star)
BRA .multi_collect BRA .multi_collect
+ CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic + CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic
.multi_collect .multi_collect
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.l GoalItemRequirement : BEQ ++ LDA.l GoalItemRequirement : BEQ ++
LDA.l GoalCounter : INC : STA.l GoalCounter LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.w GoalItemRequirement : !BLT ++ CMP.w GoalItemRequirement : !BLT ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++ 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 JSL.l ActivateGoal
+++
++ ++
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
JMP .done JMP .done
+ CMP.b #$6D : BNE + ; Server Request F0 + CMP.b #$6D : BNE + ; Server Request F0
JSL.l ItemGetServiceRequest_F0 JSL.l ItemGetServiceRequest_F0
@@ -1263,6 +1274,13 @@ ChestPrep:
SEC SEC
RTL 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 ; Set a flag in SRAM if we pick up a compass in its own dungeon with HUD compass
; counts on ; counts on
MaybeFlagCompassTotalPickup: MaybeFlagCompassTotalPickup: