cleanup octoboss

This commit is contained in:
scawful
2024-06-17 11:47:39 -04:00
parent 570fa2a211
commit c35754d8a6

View File

@@ -1,13 +1,13 @@
; ========================================================= ; =========================================================
; Octoboss by Zarby89 ; Octoboss by Zarby89
; Replaces Sprite 0x3C KidInKak ; TODO: Find a sprite to inject this into
org $06C04E ; JSL Sprite_Octoboss_Long
JSL Sprite_Octoboss_Long
BrotherSpr = $0EB0 BrotherSpr = $0EB0
Sprite_Octoboss_Long: Sprite_Octoboss_Long:
{
PHB : PHK : PLB PHB : PHK : PLB
LDA.w SprMiscD, X : BNE + ; is the sprite already init LDA.w SprMiscD, X : BNE + ; is the sprite already init
@@ -75,10 +75,11 @@ JSR Sprite_Octoboss_Secondary ; Call the Secondary 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
}
Sprite_Octoboss_Main: Sprite_Octoboss_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 WaitForPlayerToApproach ; 00 dw WaitForPlayerToApproach ; 00
@@ -149,7 +150,6 @@ INC.w SprAction, X
RTS RTS
WaitDialog: WaitDialog:
RTS RTS
@@ -252,24 +252,11 @@ PLX
LDA.b #$01 LDA.b #$01
STA.b $14 STA.b $14
;------------------------------------------------------------- ;-------------------------------------------------------------
+ +
RTS RTS
IdlePhase: IdlePhase:
LDA.w SprTimerC, X : CMP.b #$08 : BNE + LDA.w SprTimerC, X : CMP.b #$08 : BNE +
JSL Sprite_SpawnFireball JSL Sprite_SpawnFireball
@@ -363,12 +350,6 @@ LDA.b #$09 : STA.w SprAction, X ; go to wait message action
RTS RTS
Moving2: Moving2:
LDA.w SprTimerC, X : BNE + LDA.w SprTimerC, X : BNE +
DEC.w SprAction, X DEC.w SprAction, X
@@ -419,9 +400,7 @@ JSL Sprite_CheckDamageFromPlayer
RTS RTS
WaitMessageBeforeSurrender: WaitMessageBeforeSurrender:
; display message 4A ; Wait! WAIT! please! ; display message 4A ; Wait! WAIT! please!
LDY.w BrotherSpr, X LDY.w BrotherSpr, X
LDA.b #$06 : STA.w SprAction, Y ; set brother to action 6 LDA.b #$06 : STA.w SprAction, Y ; set brother to action 6
@@ -566,13 +545,11 @@ STZ.w $0DD0, X
.noframereset .noframereset
LDA.b #2 : STA.w SprTimerB, X LDA.b #2 : STA.w SprTimerB, X
+ +
RTS RTS
IdleWait: IdleWait:
RTS RTS
@@ -584,17 +561,17 @@ LDA.w SprHealth, Y : STA.b $00
LDA.w SprHealth, X : CLC : ADC.b $00 LDA.w SprHealth, X : CLC : ADC.b $00
RTS RTS
}
; =========================================================
;==================================================================================================
; Sprite Draw code ; Sprite Draw code
; --------------------------------------------------------------------------------------------------
; Draw the tiles on screen with the data provided by the sprite maker editor ; Draw the tiles on screen with the data provided by the sprite maker editor
;================================================================================================== ; =========================================================
Sprite_Octoboss_Draw: Sprite_Octoboss_Draw:
{
JSL Sprite_PrepOamCoord JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer JSL Sprite_OAM_AllocateDeferToPlayer
@@ -650,11 +627,10 @@ PLX
RTS RTS
;================================================================================================== ; =========================================================
; Sprite Draw Generated Data ; Sprite Draw Generated Data
; --------------------------------------------------------------------------------------------------
; This is where the generated Data for the sprite go ; This is where the generated Data for the sprite go
;================================================================================================== ; =========================================================
.start_index .start_index
db $00, $04, $0A, $10, $16, $1C, $20, $24, $28, $2C, $30, $34, $38, $3C, $40, $44 db $00, $04, $0A, $10, $16, $1C, $20, $24, $28, $2C, $30, $34, $38, $3C, $40, $44
.nbr_of_tiles .nbr_of_tiles
@@ -745,16 +721,14 @@ db $02, $02, $02, $02
db $02, $02, $02, $02 db $02, $02, $02, $02
db $02 db $02
}
; =========================================================
;==================================================================================================
; Sprite Draw code ; Sprite Draw code
; --------------------------------------------------------------------------------------------------
; Draw the tiles on screen with the data provided by the sprite maker editor ; Draw the tiles on screen with the data provided by the sprite maker editor
;================================================================================================== ; =========================================================
Sprite_Octoboss_Draw2: Sprite_Octoboss_Draw2:
{
JSL Sprite_PrepOamCoord JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer JSL Sprite_OAM_AllocateDeferToPlayer
@@ -811,11 +785,11 @@ RTS
;================================================================================================== ; =========================================================
; Sprite Draw Generated Data ; Sprite Draw Generated Data
; --------------------------------------------------------------------------------------------------
; This is where the generated Data for the sprite go ; This is where the generated Data for the sprite go
;================================================================================================== ; =========================================================
.start_index .start_index
db $00, $04, $0A, $10, $16, $1C, $20, $24, $28, $2C, $30, $34, $38, $3C, $40, $44 db $00, $04, $0A, $10, $16, $1C, $20, $24, $28, $2C, $30, $34, $38, $3C, $40, $44
.nbr_of_tiles .nbr_of_tiles
@@ -905,10 +879,9 @@ db $02, $02, $02, $02
db $02, $02, $02, $02 db $02, $02, $02, $02
db $02, $02, $02, $02 db $02, $02, $02, $02
db $02 db $02
}
SpawnSplash: SpawnSplash:
LDA.b #$EC ; SPRITE EC LDA.b #$EC ; SPRITE EC
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
BMI .exit BMI .exit
@@ -1026,7 +999,7 @@ PLX
RTS RTS
;--------------------------------------------------------------------------------------------------- ; ---------------------------------------------------------
.slot_occupied .slot_occupied
DEX DEX
@@ -1038,7 +1011,6 @@ PLX
RTS RTS
SpawnMedallion: SpawnMedallion:
LDA.b #$C0 ; SPRITE C0 LDA.b #$C0 ; SPRITE C0
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
@@ -1086,7 +1058,6 @@ RTS
SpawnMedallionAlt: SpawnMedallionAlt:
LDA.b #$C0 ; SPRITE C0 LDA.b #$C0 ; SPRITE C0
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
BMI .exit BMI .exit