Sprites housekeeping
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
!DeathAnimation = 01 ; 00 = normal death, 01 = no death animation
|
!DeathAnimation = 01 ; 00 = normal death, 01 = no death animation
|
||||||
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
||||||
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
|
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
|
||||||
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
|
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
|
||||||
!Palette = 00 ; Unused in this template (can be 0 to 7)
|
!Palette = 00 ; Unused in this template (can be 0 to 7)
|
||||||
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
|
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
|
||||||
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
||||||
@@ -50,7 +50,7 @@ Sprite_Manhandla_Long:
|
|||||||
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
||||||
|
|
||||||
JSR Sprite_Manhandla_Main ; Call the main sprite code
|
JSR Sprite_Manhandla_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
|
||||||
@@ -70,7 +70,7 @@ pullpc
|
|||||||
Sprite_Manhandla_Prep:
|
Sprite_Manhandla_Prep:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA.b #$04 : STA $36 ; Stores initial movement speeds
|
LDA.b #$04 : STA $36 ; Stores initial movement speeds
|
||||||
LDA.b #$06 : STA $0428 ; Allows BG1 to move
|
LDA.b #$06 : STA $0428 ; Allows BG1 to move
|
||||||
LDA.b #$80 : STA.w SprDefl, X
|
LDA.b #$80 : STA.w SprDefl, X
|
||||||
@@ -103,12 +103,12 @@ Sprite_Manhandla_CheckForNextPhaseOrDeath:
|
|||||||
JMP .not_dead
|
JMP .not_dead
|
||||||
.offspring3_dead
|
.offspring3_dead
|
||||||
LDA.b #$07 : STA.w $36
|
LDA.b #$07 : STA.w $36
|
||||||
|
|
||||||
LDA.w SprMiscD, X : BNE .phase2
|
LDA.w SprMiscD, X : BNE .phase2
|
||||||
LDA.b #$01 : STA.w SprMiscD, X
|
LDA.b #$01 : STA.w SprMiscD, X
|
||||||
LDA.b #$40 : STA.w SprTimerA, X
|
LDA.b #$40 : STA.w SprTimerA, X
|
||||||
LDA.b #$40 : STA.w SprHealth, X ; Refill the health
|
LDA.b #$40 : STA.w SprHealth, X ; Refill the health
|
||||||
LDA.b #$08 : STA.w SprNbrOAM, X ; Give more OAM
|
LDA.b #$08 : STA.w SprNbrOAM, X ; Give more OAM
|
||||||
LDA.b #$07 : STA.w SprAction, X ; Chuchu Emerge
|
LDA.b #$07 : STA.w SprAction, X ; Chuchu Emerge
|
||||||
LDA.b #$0A : STA.w $36
|
LDA.b #$0A : STA.w $36
|
||||||
.not_dead
|
.not_dead
|
||||||
@@ -116,14 +116,14 @@ Sprite_Manhandla_CheckForNextPhaseOrDeath:
|
|||||||
.phase2
|
.phase2
|
||||||
LDA.w SprMiscD, X : CMP.b #$03 : BEQ +
|
LDA.w SprMiscD, X : CMP.b #$03 : BEQ +
|
||||||
LDA.w SprHealth, X : CMP.b #$04 : BCS .phase2_not_dead
|
LDA.w SprHealth, X : CMP.b #$04 : BCS .phase2_not_dead
|
||||||
LDA.b #$50 : STA.w SprTimerA, X
|
LDA.b #$50 : STA.w SprTimerA, X
|
||||||
LDA.b #$09 : STA.w SprAction, X
|
LDA.b #$09 : STA.w SprAction, X
|
||||||
LDA.b #$13 : STA $012C
|
LDA.b #$13 : STA $012C
|
||||||
LDA.b #$04 : STA.w SprMiscD, X
|
LDA.b #$04 : STA.w SprMiscD, X
|
||||||
LDA.b #$0A : STA.w $36
|
LDA.b #$0A : STA.w $36
|
||||||
.phase2_not_dead
|
.phase2_not_dead
|
||||||
+
|
+
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ macro SetLeftHeadPos()
|
|||||||
LDA.w SprCachedY : SEC : SBC.w #$000F
|
LDA.w SprCachedY : SEC : SBC.w #$000F
|
||||||
SEP #$20
|
SEP #$20
|
||||||
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
macro SetRightHeadPos()
|
macro SetRightHeadPos()
|
||||||
REP #$20
|
REP #$20
|
||||||
@@ -153,14 +153,14 @@ macro SetRightHeadPos()
|
|||||||
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
macro SetCenterHeadPos()
|
macro SetCenterHeadPos()
|
||||||
REP #$20
|
REP #$20
|
||||||
LDA.w SprCachedX
|
LDA.w SprCachedX
|
||||||
SEP #$20
|
SEP #$20
|
||||||
STA.w SprX, Y : XBA : STA.w SprXH, Y
|
STA.w SprX, Y : XBA : STA.w SprXH, Y
|
||||||
|
|
||||||
REP #$20
|
REP #$20
|
||||||
LDA.w SprCachedY
|
LDA.w SprCachedY
|
||||||
SEP #$20
|
SEP #$20
|
||||||
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
STA.w SprY, Y : XBA : STA.w SprYH, Y
|
||||||
endmacro
|
endmacro
|
||||||
@@ -174,7 +174,7 @@ Sprite_Manhandla_Main:
|
|||||||
dw Manhandla_FrontHead ; 0x01
|
dw Manhandla_FrontHead ; 0x01
|
||||||
dw Manhandla_LeftHead ; 0x02
|
dw Manhandla_LeftHead ; 0x02
|
||||||
dw Manhandla_RightHead ; 0x03
|
dw Manhandla_RightHead ; 0x03
|
||||||
dw BigChuchu_Main ; 0x04
|
dw BigChuchu_Main ; 0x04
|
||||||
dw Flower_Flicker ; 0x05
|
dw Flower_Flicker ; 0x05
|
||||||
dw Manhandla_Body ; 0x06
|
dw Manhandla_Body ; 0x06
|
||||||
dw BigChuchu_Emerge ; 0x07
|
dw BigChuchu_Emerge ; 0x07
|
||||||
@@ -189,11 +189,11 @@ Sprite_Manhandla_Main:
|
|||||||
JSR SpawnLeftManhandlaHead
|
JSR SpawnLeftManhandlaHead
|
||||||
JSR SpawnRightManhandlaHead
|
JSR SpawnRightManhandlaHead
|
||||||
JSR SpawnCenterMandhandlaHead
|
JSR SpawnCenterMandhandlaHead
|
||||||
LDA.b #$06 : STA.w SprFrame, X
|
LDA.b #$06 : STA.w SprFrame, X
|
||||||
%GotoAction(6) ; Manhandla_Body
|
%GotoAction(6) ; Manhandla_Body
|
||||||
RTS
|
RTS
|
||||||
.not_main
|
.not_main
|
||||||
|
|
||||||
LDA.w SprSubtype, X : STA.w SprAction, X
|
LDA.w SprSubtype, X : STA.w SprAction, X
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ Sprite_Manhandla_Main:
|
|||||||
|
|
||||||
JSL Sprite_CheckDamageFromPlayer
|
JSL Sprite_CheckDamageFromPlayer
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ Sprite_Manhandla_Main:
|
|||||||
JSL Sprite_CheckDamageFromPlayer
|
JSL Sprite_CheckDamageFromPlayer
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ Sprite_Manhandla_Main:
|
|||||||
{
|
{
|
||||||
%PlayAnimation(11, 12, 10)
|
%PlayAnimation(11, 12, 10)
|
||||||
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
|
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
|
||||||
; Flicker the body every other frame using the timer
|
; Flicker the body every other frame using the timer
|
||||||
LDA.w SprTimerA, X : AND.b #$01 : BEQ .flicker
|
LDA.w SprTimerA, X : AND.b #$01 : BEQ .flicker
|
||||||
LDA $1C : AND.b #$FE : STA $1C ;turn off BG2 (Body)
|
LDA $1C : AND.b #$FE : STA $1C ;turn off BG2 (Body)
|
||||||
.flicker
|
.flicker
|
||||||
@@ -288,8 +288,8 @@ Sprite_Manhandla_Main:
|
|||||||
%GotoAction($04)
|
%GotoAction($04)
|
||||||
|
|
||||||
LDA.b #$10 : STA.w SprTimerC, X
|
LDA.b #$10 : STA.w SprTimerC, X
|
||||||
LDA.b #$8D : STA.w SprHitbox, X
|
LDA.b #$8D : STA.w SprHitbox, X
|
||||||
|
|
||||||
LDA #$88
|
LDA #$88
|
||||||
JSL Sprite_SpawnDynamically : BMI .return
|
JSL Sprite_SpawnDynamically : BMI .return
|
||||||
TYA : STA.w Offspring3_Id
|
TYA : STA.w Offspring3_Id
|
||||||
@@ -310,7 +310,7 @@ Sprite_Manhandla_Main:
|
|||||||
STZ.w SprYRound, X
|
STZ.w SprYRound, X
|
||||||
STZ.w SprXRound, X
|
STZ.w SprXRound, X
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
|
|
||||||
.return
|
.return
|
||||||
|
|
||||||
@@ -326,14 +326,14 @@ Sprite_Manhandla_Main:
|
|||||||
JSR Sprite_Manhandla_Move
|
JSR Sprite_Manhandla_Move
|
||||||
JSL Sprite_DamageFlash_Long
|
JSL Sprite_DamageFlash_Long
|
||||||
|
|
||||||
JSL GetRandomInt : AND.b #$7F : BNE +
|
JSL GetRandomInt : AND.b #$7F : BNE +
|
||||||
JSL GetRandomInt : AND.b #$04 : BNE +
|
JSL GetRandomInt : AND.b #$04 : BNE +
|
||||||
JSR Mothula_SpawnBeams
|
JSR Mothula_SpawnBeams
|
||||||
+
|
+
|
||||||
|
|
||||||
JSL Sprite_CheckDamageFromPlayer
|
JSL Sprite_CheckDamageFromPlayer
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
|
|
||||||
LDY.w Offspring1_Id
|
LDY.w Offspring1_Id
|
||||||
LDA.w SprType, Y : CMP.b #$88 : BNE .not_head
|
LDA.w SprType, Y : CMP.b #$88 : BNE .not_head
|
||||||
LDA.w SprState, Y : BEQ .offspring1_dead
|
LDA.w SprState, Y : BEQ .offspring1_dead
|
||||||
@@ -354,7 +354,7 @@ Sprite_Manhandla_Main:
|
|||||||
.offspring3_dead
|
.offspring3_dead
|
||||||
.not_head3
|
.not_head3
|
||||||
|
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -365,9 +365,9 @@ Sprite_Manhandla_Main:
|
|||||||
|
|
||||||
JSL Sprite_DamageFlash_Long
|
JSL Sprite_DamageFlash_Long
|
||||||
|
|
||||||
LDA.w SprTimerA, X : BNE +
|
LDA.w SprTimerA, X : BNE +
|
||||||
LDA.b #$02 : STA.w SprMiscD, X ; Set phase flag
|
LDA.b #$02 : STA.w SprMiscD, X ; Set phase flag
|
||||||
LDA.b #$20 : STA.w SprTimerA, X
|
LDA.b #$20 : STA.w SprTimerA, X
|
||||||
%GotoAction($05)
|
%GotoAction($05)
|
||||||
+
|
+
|
||||||
|
|
||||||
@@ -389,9 +389,9 @@ Sprite_Manhandla_Main:
|
|||||||
|
|
||||||
BigChuchu_Dead:
|
BigChuchu_Dead:
|
||||||
{
|
{
|
||||||
#_068517: LDA.b #$FF
|
LDA.b #$FF
|
||||||
#_068519: STA.w $0BC0, X
|
STA.w $0BC0, X
|
||||||
LDA.b #$04 : STA.w SprState, X
|
LDA.b #$04 : STA.w SprState, X
|
||||||
STZ.w SprHealth, X
|
STZ.w SprHealth, X
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -410,7 +410,7 @@ Sprite_Manhandla_Main:
|
|||||||
|
|
||||||
Sprite_Manhandla_Move:
|
Sprite_Manhandla_Move:
|
||||||
{
|
{
|
||||||
LDA.w SprMiscC, X
|
LDA.w SprMiscC, X
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
dw StageControl
|
dw StageControl
|
||||||
@@ -456,15 +456,15 @@ Sprite_Manhandla_Move:
|
|||||||
PHX
|
PHX
|
||||||
REP #$20
|
REP #$20
|
||||||
|
|
||||||
; Use a range of + 0x05 because being exact equal didnt trigger consistently
|
; Use a range of + 0x05 because being exact equal didnt trigger consistently
|
||||||
LDA $20 : SBC.w SprCachedY : CMP.w #$FFFB : BCC .notEqualY
|
LDA $20 : SBC.w SprCachedY : CMP.w #$FFFB : BCC .notEqualY
|
||||||
SEP #$20
|
SEP #$20
|
||||||
LDA.b #$02 : STA.w SprMiscC, X
|
LDA.b #$02 : STA.w SprMiscC, X
|
||||||
|
|
||||||
BRA .notEqualX
|
BRA .notEqualX
|
||||||
.notEqualY
|
.notEqualY
|
||||||
|
|
||||||
; Use a range of + 0x05 because being exact equal didnt trigger consistently
|
; Use a range of + 0x05 because being exact equal didnt trigger consistently
|
||||||
LDA $22 : SBC.w SprCachedX : CMP.w #$FFFB : BCC .notEqualX
|
LDA $22 : SBC.w SprCachedX : CMP.w #$FFFB : BCC .notEqualX
|
||||||
SEP #$20
|
SEP #$20
|
||||||
LDA.b #$02 : STA.w SprMiscC, X
|
LDA.b #$02 : STA.w SprMiscC, X
|
||||||
@@ -546,17 +546,17 @@ Sprite_Manhandla_Draw:
|
|||||||
.nextTile
|
.nextTile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
|
||||||
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
||||||
|
|
||||||
PHA ; Keep the value with animation index offset?
|
PHA ; Keep the value with animation index offset?
|
||||||
|
|
||||||
ASL A : TAX
|
ASL A : TAX
|
||||||
|
|
||||||
REP #$20
|
REP #$20
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
||||||
AND.w #$0100 : STA $0E
|
AND.w #$0100 : STA $0E
|
||||||
INY
|
INY
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
@@ -573,14 +573,14 @@ Sprite_Manhandla_Draw:
|
|||||||
INY
|
INY
|
||||||
LDA .properties, X : ORA $08 : STA ($90), Y
|
LDA .properties, X : ORA $08 : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
TYA : LSR #2 : TAY
|
||||||
|
|
||||||
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
|
||||||
PLY : INY
|
PLY : INY
|
||||||
|
|
||||||
PLX : DEX : BPL .nextTile
|
PLX : DEX : BPL .nextTile
|
||||||
|
|
||||||
PLX
|
PLX
|
||||||
@@ -686,17 +686,17 @@ Sprite_BigChuchu_Draw:
|
|||||||
.nextTile
|
.nextTile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
|
||||||
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
||||||
|
|
||||||
PHA ; Keep the value with animation index offset?
|
PHA ; Keep the value with animation index offset?
|
||||||
|
|
||||||
ASL A : TAX
|
ASL A : TAX
|
||||||
|
|
||||||
REP #$20
|
REP #$20
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
||||||
AND.w #$0100 : STA $0E
|
AND.w #$0100 : STA $0E
|
||||||
INY
|
INY
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
@@ -713,14 +713,14 @@ Sprite_BigChuchu_Draw:
|
|||||||
INY
|
INY
|
||||||
LDA .properties, X : ORA $08 : STA ($90), Y
|
LDA .properties, X : ORA $08 : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
TYA : LSR #2 : TAY
|
||||||
|
|
||||||
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
|
||||||
PLY : INY
|
PLY : INY
|
||||||
|
|
||||||
PLX : DEX : BPL .nextTile
|
PLX : DEX : BPL .nextTile
|
||||||
|
|
||||||
PLX
|
PLX
|
||||||
@@ -769,7 +769,7 @@ Chuchu_SpawnBlast:
|
|||||||
PHX
|
PHX
|
||||||
LDA.b #$88
|
LDA.b #$88
|
||||||
JSL Sprite_SpawnDynamically : BMI .return
|
JSL Sprite_SpawnDynamically : BMI .return
|
||||||
|
|
||||||
LDA.b #$0A : STA.w SprSubtype, Y
|
LDA.b #$0A : STA.w SprSubtype, Y
|
||||||
STA.w SprAction, Y
|
STA.w SprAction, Y
|
||||||
|
|
||||||
@@ -783,12 +783,12 @@ Chuchu_SpawnBlast:
|
|||||||
LDA.b #$02 : STA.w SprMiscD, Y
|
LDA.b #$02 : STA.w SprMiscD, Y
|
||||||
LDA.b #$00 : STA.w SprTileDie, Y
|
LDA.b #$00 : STA.w SprTileDie, Y
|
||||||
LDA.b #$40 : STA.w SprProps, Y
|
LDA.b #$40 : STA.w SprProps, Y
|
||||||
LDA.b #$04 : STA.w SprFrame, Y
|
LDA.b #$04 : STA.w SprFrame, Y
|
||||||
LDA.b #$10 : STA.w SprTimerB, Y
|
LDA.b #$10 : STA.w SprTimerB, Y
|
||||||
LDA.b #$00 : STA.w SprNbrOAM, Y
|
LDA.b #$00 : STA.w SprNbrOAM, Y
|
||||||
LDA.b #$03 : STA.w SprHitbox, Y
|
LDA.b #$03 : STA.w SprHitbox, Y
|
||||||
|
|
||||||
.return
|
.return
|
||||||
PLX
|
PLX
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ SpawnLeftManhandlaHead:
|
|||||||
STZ.w SprYRound, X
|
STZ.w SprYRound, X
|
||||||
STZ.w SprXRound, X
|
STZ.w SprXRound, X
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
.return
|
.return
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -925,7 +925,7 @@ ApplyManhandlaPalette:
|
|||||||
{
|
{
|
||||||
REP #$20 ;Set A in 16bit mode
|
REP #$20 ;Set A in 16bit mode
|
||||||
|
|
||||||
;note, this uses adresses like 7EC300 and not 7EC500 because the game
|
;note, this uses adresses like 7EC300 and not 7EC500 because the game
|
||||||
;will fade the colors into 7EC500 based on the colors found in 7EC300
|
;will fade the colors into 7EC500 based on the colors found in 7EC300
|
||||||
|
|
||||||
LDA #$7FFF : STA $7EC5E2 ;BG2
|
LDA #$7FFF : STA $7EC5E2 ;BG2
|
||||||
@@ -937,7 +937,7 @@ ApplyManhandlaPalette:
|
|||||||
LDA #$19DF : STA $7EC5EE
|
LDA #$19DF : STA $7EC5EE
|
||||||
|
|
||||||
INC $15
|
INC $15
|
||||||
|
|
||||||
SEP #$20 ;Set A in 8bit mode
|
SEP #$20 ;Set A in 8bit mode
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
@@ -945,19 +945,19 @@ ApplyManhandlaPalette:
|
|||||||
|
|
||||||
ApplyManhandlaGraphics:
|
ApplyManhandlaGraphics:
|
||||||
{
|
{
|
||||||
PHX
|
PHX
|
||||||
REP #$20 ; A = 16, XY = 8
|
REP #$20 ; A = 16, XY = 8
|
||||||
LDX #$80 : STX $2100 ; turn the screen off (required)
|
LDX #$80 : STX $2100 ; turn the screen off (required)
|
||||||
LDX #$80 : STX $2115 ; Set the video port register every time we write it increase by 1
|
LDX #$80 : STX $2115 ; Set the video port register every time we write it increase by 1
|
||||||
LDA #$5000 : STA $2116 ; Destination of the DMA $5800 in vram <- this need to be divided by 2
|
LDA #$5000 : STA $2116 ; Destination of the DMA $5800 in vram <- this need to be divided by 2
|
||||||
LDA #$1801 : STA $4300 ; DMA Transfer Mode and destination register
|
LDA #$1801 : STA $4300 ; DMA Transfer Mode and destination register
|
||||||
; "001 => 2 registers write once (2 bytes: p, p+1)"
|
; "001 => 2 registers write once (2 bytes: p, p+1)"
|
||||||
|
|
||||||
LDA.w #ManhandlaGraphics : STA $4302
|
LDA.w #ManhandlaGraphics : STA $4302
|
||||||
LDX.b #ManhandlaGraphics>>16 : STX $4304
|
LDX.b #ManhandlaGraphics>>16 : STX $4304
|
||||||
|
|
||||||
LDA #$2000 : STA $4305 ; Size of the transfer 4 sheets of $800 each
|
LDA #$2000 : STA $4305 ; Size of the transfer 4 sheets of $800 each
|
||||||
LDX #$01 : STX $420B ; Do the DMA
|
LDX #$01 : STX $420B ; Do the DMA
|
||||||
LDX #$0F : STX $2100 ; Turn the screen back on
|
LDX #$0F : STX $2100 ; Turn the screen back on
|
||||||
SEP #$30
|
SEP #$30
|
||||||
PLX
|
PLX
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
|
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
|
||||||
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
||||||
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
|
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
|
||||||
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
|
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
|
||||||
!Palette = 00 ; Unused in this template (can be 0 to 7)
|
!Palette = 00 ; Unused in this template (can be 0 to 7)
|
||||||
!Hitbox = $0D ; 00 to 31, can be viewed in sprite draw tool
|
!Hitbox = $0D ; 00 to 31, can be viewed in sprite draw tool
|
||||||
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
||||||
@@ -76,7 +76,6 @@ Sprite_DekuLeaf_Main:
|
|||||||
JSL UseImplicitRegIndexedLocalJumpTable
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
dw WaitForPlayer
|
dw WaitForPlayer
|
||||||
|
|
||||||
dw Whirlpool_Main
|
dw Whirlpool_Main
|
||||||
|
|
||||||
WaitForPlayer:
|
WaitForPlayer:
|
||||||
@@ -92,7 +91,6 @@ Sprite_DekuLeaf_Main:
|
|||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Whirlpool_Main:
|
Whirlpool_Main:
|
||||||
{
|
{
|
||||||
%PlayAnimation(0, 2, 10)
|
%PlayAnimation(0, 2, 10)
|
||||||
@@ -100,9 +98,9 @@ Sprite_DekuLeaf_Main:
|
|||||||
|
|
||||||
LDA $0AAB : BEQ .not_on
|
LDA $0AAB : BEQ .not_on
|
||||||
|
|
||||||
STZ $55 ; Reset cape flag
|
STZ $55 ; Reset cape flag
|
||||||
STZ $0AAB ; Reset underwater flag
|
STZ $0AAB ; Reset underwater flag
|
||||||
STZ $0351 ; Reset ripple flag
|
STZ $0351 ; Reset ripple flag
|
||||||
STZ $037B ; Reset invincibility flag
|
STZ $037B ; Reset invincibility flag
|
||||||
STZ $02B2
|
STZ $02B2
|
||||||
|
|
||||||
@@ -151,7 +149,6 @@ Sprite_DekuLeaf_Main:
|
|||||||
.exit
|
.exit
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
@@ -173,17 +170,17 @@ Sprite_DekuLeaf_Draw:
|
|||||||
.nextTile
|
.nextTile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
|
||||||
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
||||||
|
|
||||||
PHA ; Keep the value with animation index offset?
|
PHA ; Keep the value with animation index offset?
|
||||||
|
|
||||||
ASL A : TAX
|
ASL A : TAX
|
||||||
|
|
||||||
REP #$20
|
REP #$20
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
||||||
AND.w #$0100 : STA $0E
|
AND.w #$0100 : STA $0E
|
||||||
INY
|
INY
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
@@ -200,14 +197,14 @@ Sprite_DekuLeaf_Draw:
|
|||||||
INY
|
INY
|
||||||
LDA .properties, X : STA ($90), Y
|
LDA .properties, X : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
TYA : LSR #2 : TAY
|
||||||
|
|
||||||
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
|
||||||
PLY : INY
|
PLY : INY
|
||||||
|
|
||||||
PLX : DEX : BPL .nextTile
|
PLX : DEX : BPL .nextTile
|
||||||
|
|
||||||
PLX
|
PLX
|
||||||
@@ -246,17 +243,17 @@ Sprite_Whirlpool_Draw:
|
|||||||
.nextTile
|
.nextTile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
|
||||||
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
TXA : CLC : ADC $06 ; Add Animation Index Offset
|
||||||
|
|
||||||
PHA ; Keep the value with animation index offset?
|
PHA ; Keep the value with animation index offset?
|
||||||
|
|
||||||
ASL A : TAX
|
ASL A : TAX
|
||||||
|
|
||||||
REP #$20
|
REP #$20
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
||||||
AND.w #$0100 : STA $0E
|
AND.w #$0100 : STA $0E
|
||||||
INY
|
INY
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
@@ -273,14 +270,14 @@ Sprite_Whirlpool_Draw:
|
|||||||
INY
|
INY
|
||||||
LDA .properties, X : STA ($90), Y
|
LDA .properties, X : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
TYA : LSR #2 : TAY
|
||||||
|
|
||||||
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
|
||||||
PLY : INY
|
PLY : INY
|
||||||
|
|
||||||
PLX : DEX : BPL .nextTile
|
PLX : DEX : BPL .nextTile
|
||||||
|
|
||||||
PLX
|
PLX
|
||||||
@@ -309,4 +306,4 @@ Sprite_Whirlpool_Draw:
|
|||||||
db $29, $29, $29, $29
|
db $29, $29, $29, $29
|
||||||
db $69, $69, $69, $69
|
db $69, $69, $69, $69
|
||||||
db $A9, $A9, $A9, $A9
|
db $A9, $A9, $A9, $A9
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Sprite_IceBlock_Main:
|
|||||||
; matches the push direction (cached) and then initiate
|
; matches the push direction (cached) and then initiate
|
||||||
; the speed changes if they agree
|
; the speed changes if they agree
|
||||||
|
|
||||||
JSL Sprite_CheckDamageToPlayerSameLayer : BCC NotInContact
|
JSL Sprite_CheckDamageToPlayerSameLayer : BCC .NotInContact
|
||||||
LDA.w SprMiscA, X : BNE .push_cached
|
LDA.w SprMiscA, X : BNE .push_cached
|
||||||
LDA.b $26 : STA.w SprMiscA, X
|
LDA.b $26 : STA.w SprMiscA, X
|
||||||
JSR ApplyPush
|
JSR ApplyPush
|
||||||
|
|||||||
Reference in New Issue
Block a user