Intro Cutscene Sequence and Sprite Movement

This commit is contained in:
scawful
2023-05-10 11:39:16 -05:00
parent 2e0a82f549
commit 905dab92b4
3 changed files with 92 additions and 54 deletions

View File

@@ -26,13 +26,13 @@ org $01FF28
Player_CacheStatePriorToHandler: Player_CacheStatePriorToHandler:
org $09912C org $09912C
AddTransformationCloud: AddTransformationCloud:
org $07B073 org $07B073
Link_CheckNewY_ButtonPress: Link_CheckNewY_ButtonPress:
org $078028 org $078028
Player_DoSfx2: Player_DoSfx2:
; ============================================================================= ; =============================================================================

View File

@@ -34,27 +34,30 @@
;============================================================================== ;==============================================================================
Sprite_Kydrog_Long: Sprite_Kydrog_Long:
PHB : PHK : PLB {
PHB : PHK : PLB
JSR Sprite_Kydrog_Draw ; Call the draw code JSR Sprite_Kydrog_Draw ; Call the draw code
JSL Sprite_CheckActive ; Check if game is not paused JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_Kydrog_Main ; Call the main sprite code JSR Sprite_Kydrog_Main ; Call the main sprite code
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
}
;============================================================================== ;==============================================================================
Sprite_Kydrog_Prep: Sprite_Kydrog_Prep:
PHB : PHK : PLB {
PHB : PHK : PLB
; Add more code here to initialize data
; Add more code here to initialize data
PLB PLB
RTL RTL
}
;============================================================================== ;==============================================================================
@@ -92,7 +95,7 @@ Sprite_Kydrog_Main:
{ {
LDA.w SprTimerA, X : BNE + LDA.w SprTimerA, X : BNE +
%ShowUnconditionalMessage($21) %ShowUnconditionalMessage($21)
LDA.b #$00 : STA.b $49 ; Stop Link's auto-movement LDA.b #$02 : STA.b $B6 ; Update story flag for Farore
%GotoAction(2) %GotoAction(2)
+ +
RTS RTS
@@ -100,18 +103,30 @@ Sprite_Kydrog_Main:
Kydrog_SpawnOffspring: Kydrog_SpawnOffspring:
{ {
STZ.b $49 ; Stop Link from moving
%GotoAction(3) %GotoAction(3)
RTS RTS
} }
Kydrog_TurnPlayerToDeku: Kydrog_TurnPlayerToDeku:
{ {
; LDA.b #$03 : STA.b $B6
; JSL AddTransformationCloud
; LDA.b #$14 : JSR Player_DoSfx2
; JSL Palette_ArmorAndGloves
LDA #$35 : STA $BC
%GotoAction(4) %GotoAction(4)
RTS RTS
} }
Kydrog_WarpPlayerAway: Kydrog_WarpPlayerAway:
{ {
LDA #$29
JSL $02B40F
RTS RTS
} }
} }
@@ -190,4 +205,7 @@ Sprite_Kydrog_Draw:
db $3B, $3B, $3B, $3B, $3B, $3B db $3B, $3B, $3B, $3B, $3B, $3B
.sizes .sizes
db $02, $02, $02, $02, $02, $02 db $02, $02, $02, $02, $02, $02
} }
org $02ECF8
dw $0029

View File

@@ -1,6 +1,7 @@
;============================================================================== ;==============================================================================
; Farore/Maku Tree - Sprite Uncle/Priest ; Farore/Maku Tree - Sprite Uncle/Priest
; ;
; STZ.w $0DD0, X ; Kill the sprite since it's not needed anymore
; ;
;============================================================================== ;==============================================================================
@@ -65,7 +66,7 @@ Sprite_Farore_Long:
JSR Sprite_Farore_Main ; Call the main sprite code JSR Sprite_Farore_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB ; Get back the databank we stored previously
RTL ; Go back to original code RTL ; Go back to original code
} }
@@ -81,6 +82,8 @@ Sprite_Farore_Prep:
; STZ.w $0DD0, X ; Kill the sprite ; STZ.w $0DD0, X ; Kill the sprite
; .PlayIntro ; .PlayIntro
LDA.b #$80 : STA $0CAA, X ; Don't kill Farore when she goes off screen
PLB PLB
RTL RTL
} }
@@ -89,25 +92,37 @@ Sprite_Farore_Prep:
; Movement key bitwise ---- udlr ; Movement key bitwise ---- udlr
WALKSPEED = 09 WALKSPEED = 14
STORY_STATE = $B6
Sprite_Farore_Main: Sprite_Farore_Main:
{ {
LDA.w SprAction, X; Load the SprAction LDA.w SprAction, X; Load the SprAction
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in JSL UseImplicitRegIndexedLocalJumpTable ; Goto the SprAction we are currently in
dw IntroStart dw IntroStart
dw MoveUpTowardsFarore dw MoveUpTowardsFarore
dw MoveLeftTowardsFarore dw MoveLeftTowardsFarore
dw WaitAndMessage dw WaitAndMessage
dw FaroreFollowPlayer dw FaroreFollowPlayer
dw MakuArea_FaroreFollowPlayer dw MakuArea_FaroreFollowPlayer
dw MakuArea_FaroreWaitForKydrog
IntroStart: IntroStart:
{ {
; JSR SetupMovieEffect
; JSR MovieEffect
LDA $B6 : CMP #$01 : BEQ .maku_area
CMP #$02 : BEQ .waiting
%GotoAction(1) %GotoAction(1)
.maku_area
JSR MakuArea_FaroreFollowPlayer
.waiting
JSR MakuArea_FaroreWaitForKydrog
RTS RTS
} }
@@ -119,7 +134,6 @@ Sprite_Farore_Main:
LDA.b $20 ; Link's Y Position LDA.b $20 ; Link's Y Position
CMP.b #$9C ; Y = 6C CMP.b #$9C ; Y = 6C
BCC .linkistoofar BCC .linkistoofar
%GotoAction(2) %GotoAction(2)
.linkistoofar .linkistoofar
@@ -149,59 +163,65 @@ Sprite_Farore_Main:
WaitAndMessage: WaitAndMessage:
{ {
%PlayAnimation(1, 2, 8) %PlayAnimation(1, 2, 8)
%MoveTowardPlayer(15) %MoveTowardPlayer(15)
LDA.w SprTimerA, X : BNE + LDA.w SprTimerA, X : BNE +
STZ $2F
%ShowUnconditionalMessage($24) %ShowUnconditionalMessage($24)
LDA.b #$01 : STA.l $7EF300 ; prevent intro from playing again with sram set
; STZ.w $0DD0, X ; Kill the sprite since it's not needed anymore
%GotoAction(4) %GotoAction(4)
+ +
RTS RTS
} }
; you could just squeeze it between link and the 1st follower ; 04
; by reusing the follow code but with lower delay
; $1A00[0x14] - (Tagalong)
; Low bytes of tagalong states' Y coordinates.
; $1A14[0x14] - (Tagalong)
; High bytes of tagalong states' Y coordinates.
; $1A28[0x14] - (Tagalong)
; Low bytes of tagalong states' X coordinates.
; $1A3C[0x14] - (Tagalong)
; High bytes of tagalong states' X coordinates.
; load current follower position divide it by 2
; and use that as index
FaroreFollowPlayer: FaroreFollowPlayer:
{ {
LDA WALKSPEED : STA.b $57 ; Slow Link down for the cutscene LDA WALKSPEED : STA.b $57 ; Slow Link down for the cutscene
LDA.b #$08 : STA.b $49 ; Auto-movement north LDA.b #$08 : STA.b $49 ; Auto-movement north
%PlayAnimation(3, 4, 8) %PlayAnimation(3, 4, 8)
%MoveTowardPlayer(9) %MoveTowardPlayer(16)
LDA #$02 : STA $7EF3C5 ; (0 - intro, 1 - pendants, 2 - crystals) LDA #$02 : STA $7EF3C5 ; (0 - intro, 1 - pendants, 2 - crystals)
LDA #$05 : STA $012D ; turn off rain sound LDA #$05 : STA $012D ; turn off rain sound
LDA #$01 : STA $0728 JSL $00FC41 ; fix monsters
LDA #$01 : STA $B6 ; Set Story State
%GotoAction(0)
RTS RTS
} }
; 05
MakuArea_FaroreFollowPlayer: MakuArea_FaroreFollowPlayer:
{ {
.keep_walking
%PlayAnimation(3, 4, 8) %PlayAnimation(3, 4, 8)
%MoveTowardPlayer(9) %MoveTowardPlayer(18)
LDA $B6 : CMP.b #$02 : BEQ .keep_walking
JSR MakuArea_FaroreWaitForKydrog
RTS RTS
} }
; 06
; Look at the RAM $0D00 to $0D60, the first few are the actual positions of the sprite that you can just set manually or $0D40 and $0D50 are the "speeds" of the sprites irrc
; You can set one of the speeds and then call the function called Sprite_Move
; And then that will handle it applying the speed for you
MakuArea_FaroreWaitForKydrog:
{
%PlayAnimation(5, 5, 8)
RTS
}
; 07
MakuArea_FaroreWalkToPosition:
{
%PlayAnimation(3, 4, 8)
RTS
}
} }
;============================================================================== ;==============================================================================
@@ -217,7 +237,7 @@ Sprite_Farore_Draw:
PHX PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1 LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00 LDY.b #$00
.nextTile .nextTile
PHX ; Save current Tile Index? PHX ; Save current Tile Index?
@@ -239,7 +259,7 @@ Sprite_Farore_Draw:
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
STA $0E STA $0E
.on_screen_y .on_screen_y
PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore) PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore)
INY INY