Cleanup Kydreeok and Kydreeok Head
This commit is contained in:
@@ -29,27 +29,23 @@
|
|||||||
!ImperviousArrow = 00 ; 01 = Impervious to arrows
|
!ImperviousArrow = 00 ; 01 = Impervious to arrows
|
||||||
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
||||||
!Boss = 01 ; 00 = normal sprite, 01 = sprite is a boss
|
!Boss = 01 ; 00 = normal sprite, 01 = sprite is a boss
|
||||||
%Set_Sprite_Properties(Sprite_Kydreeok_Prep, Sprite_Kydreeok_Long);
|
|
||||||
|
|
||||||
; =========================================================
|
%Set_Sprite_Properties(Sprite_Kydreeok_Prep, Sprite_Kydreeok_Long)
|
||||||
|
|
||||||
Sprite_Kydreeok_Long:
|
Sprite_Kydreeok_Long:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
JSR Sprite_Kydreeok_Draw
|
||||||
JSR Sprite_Kydreeok_Draw
|
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
|
||||||
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
|
JSR Sprite_Kydreeok_Main
|
||||||
JSR Sprite_Kydreeok_Main
|
JSR Sprite_Kydreeok_CheckIfDead
|
||||||
JSR Sprite_Kydreeok_CheckIfDead
|
JSR MaybeRespawnHead
|
||||||
JSR MaybeRespawnHead
|
.SpriteIsNotActive
|
||||||
|
LDA.w SprState, X : BNE .not_inactive
|
||||||
.SpriteIsNotActive
|
JSR ApplyEndPalette
|
||||||
LDA.w SprState, X : BNE .not_inactive
|
.not_inactive
|
||||||
JSR ApplyEndPalette
|
PLB
|
||||||
.not_inactive
|
RTL
|
||||||
|
|
||||||
PLB ; Get back the databank we stored previously
|
|
||||||
RTL ; Go back to original code
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
@@ -57,7 +53,6 @@ Sprite_Kydreeok_Long:
|
|||||||
Sprite_Kydreeok_Prep:
|
Sprite_Kydreeok_Prep:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA #$40 : STA.w SprTimerA, X
|
LDA #$40 : STA.w SprTimerA, X
|
||||||
LDA.b #$08 : STA $36 ; Stores initial movement speeds
|
LDA.b #$08 : STA $36 ; Stores initial movement speeds
|
||||||
LDA.b #$06 : STA $0428 ; Allows BG1 to move
|
LDA.b #$06 : STA $0428 ; Allows BG1 to move
|
||||||
@@ -274,7 +269,6 @@ Sprite_Kydreeok_Main:
|
|||||||
|
|
||||||
Kydreeok_Dead:
|
Kydreeok_Dead:
|
||||||
{
|
{
|
||||||
|
|
||||||
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
|
||||||
@@ -282,33 +276,24 @@ Sprite_Kydreeok_Main:
|
|||||||
.flicker
|
.flicker
|
||||||
|
|
||||||
; Spawn the explosion
|
; Spawn the explosion
|
||||||
LDA.b #$00 ; SPRITE 00
|
LDA.b #$00
|
||||||
JSL Sprite_SpawnDynamically
|
JSL Sprite_SpawnDynamically : BMI .no_space
|
||||||
BMI .no_space
|
LDA.b #$0B : STA.w $0AAA
|
||||||
|
LDA.b #$04 : STA.w $0DD0,Y
|
||||||
LDA.b #$0B : STA.w $0AAA
|
LDA.b #$03 : STA.w $0E40,Y
|
||||||
LDA.b #$04 : STA.w $0DD0,Y
|
LDA.b #$0C : STA.w $0F50,Y
|
||||||
LDA.b #$03 : STA.w $0E40,Y
|
LDA.w $0FD8 : STA.w SprX,Y
|
||||||
LDA.b #$0C : STA.w $0F50,Y
|
LDA.w $0FD9 : STA.w SprXH,Y
|
||||||
LDA.w $0FD8 : STA.w SprX,Y
|
LDA.w $0FDA : STA.w SprY,Y
|
||||||
LDA.w $0FD9 : STA.w SprXH,Y
|
LDA.w $0FDB : STA.w SprYH,Y
|
||||||
LDA.w $0FDA : STA.w SprY,Y
|
LDA.b #$1F : STA.w $0DF0,Y : STA.w $0D90,Y
|
||||||
LDA.w $0FDB : STA.w SprYH,Y
|
LDA.b #$02 : STA.w $0F20,Y
|
||||||
|
|
||||||
LDA.b #$1F
|
|
||||||
STA.w $0DF0,Y
|
|
||||||
STA.w $0D90,Y
|
|
||||||
|
|
||||||
LDA.b #$02 : STA.w $0F20,Y
|
|
||||||
|
|
||||||
.no_space
|
.no_space
|
||||||
|
|
||||||
LDA.w SprTimerA, X : BNE .continue
|
LDA.w SprTimerA, X : BNE .continue
|
||||||
STZ.w $0422
|
STZ.w $0422
|
||||||
STZ.w $0424
|
STZ.w $0424
|
||||||
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
|
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
|
||||||
STZ.w $0DD0, X ; GG
|
STZ.w $0DD0, X ; GG
|
||||||
|
|
||||||
.continue
|
.continue
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -333,7 +318,6 @@ Sprite_Kydreeok_Main:
|
|||||||
%GotoAction(2)
|
%GotoAction(2)
|
||||||
.continue
|
.continue
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -367,12 +351,10 @@ Offspring3_Neck3_Y = $1A7D
|
|||||||
SpawnLeftHead:
|
SpawnLeftHead:
|
||||||
{
|
{
|
||||||
LDA #$CF
|
LDA #$CF
|
||||||
|
|
||||||
JSL Sprite_SpawnDynamically : BMI .return
|
JSL Sprite_SpawnDynamically : BMI .return
|
||||||
TYA : STA.w Offspring1_Id
|
TYA : STA.w Offspring1_Id
|
||||||
;store the sub-type
|
;store the sub-type
|
||||||
LDA.b #$00 : STA $0E30, Y
|
LDA.b #$00 : STA $0E30, Y
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
; code that controls where to spawn the offspring.
|
; code that controls where to spawn the offspring.
|
||||||
REP #$20
|
REP #$20
|
||||||
@@ -395,7 +377,6 @@ SpawnLeftHead:
|
|||||||
STZ.w SprYRound, X
|
STZ.w SprYRound, X
|
||||||
STZ.w SprXRound, X
|
STZ.w SprXRound, X
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
.return
|
.return
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -588,17 +569,17 @@ StopIfOutOfBounds:
|
|||||||
LDA.w SprCachedY : CMP.w #$00D0 : BCC .not_out_of_bounds_Down
|
LDA.w SprCachedY : CMP.w #$00D0 : BCC .not_out_of_bounds_Down
|
||||||
SEP #$20
|
SEP #$20
|
||||||
LDA.w SprYSpeed : CMP.b #$80 : BCS .not_out_of_bounds_Down
|
LDA.w SprYSpeed : CMP.b #$80 : BCS .not_out_of_bounds_Down
|
||||||
LDA.b #-10 : STA.w SprYSpeed : STA.w SprYRound ; Reverse the direction
|
LDA.b #-10 : STA.w SprYSpeed : STA.w SprYRound ; Reverse the direction
|
||||||
|
|
||||||
; Modify the neck position
|
; Modify the neck position
|
||||||
; Makes them move away from each other a bit
|
; Makes them move away from each other a bit
|
||||||
LDA $19EA : SEC : SBC #$04 : STA $19EA
|
LDA $19EA : SEC : SBC #$04 : STA $19EA
|
||||||
LDA $19EC : SEC : SBC #$04 : STA $19EC
|
LDA $19EC : SEC : SBC #$04 : STA $19EC
|
||||||
LDA $19EE : SEC : SBC #$04 : STA $19EE
|
LDA $19EE : SEC : SBC #$04 : STA $19EE
|
||||||
|
|
||||||
LDA $19F0 : CLC : ADC #$04 : STA $19F0
|
LDA $19F0 : CLC : ADC #$04 : STA $19F0
|
||||||
LDA $19F2 : CLC : ADC #$04 : STA $19F2
|
LDA $19F2 : CLC : ADC #$04 : STA $19F2
|
||||||
LDA $19F4 : CLC : ADC #$04 : STA $19F4
|
LDA $19F4 : CLC : ADC #$04 : STA $19F4
|
||||||
|
|
||||||
.not_out_of_bounds_Down
|
.not_out_of_bounds_Down
|
||||||
SEP #$20
|
SEP #$20
|
||||||
@@ -662,60 +643,55 @@ ApplyEndPalette:
|
|||||||
|
|
||||||
Sprite_Kydreeok_Draw:
|
Sprite_Kydreeok_Draw:
|
||||||
{
|
{
|
||||||
JSL Sprite_PrepOamCoord
|
JSL Sprite_PrepOamCoord
|
||||||
; JSL Sprite_OAM_AllocateDeferToPlayer
|
; JSL Sprite_OAM_AllocateDeferToPlayer
|
||||||
LDA.b #$08
|
LDA.b #$08
|
||||||
JSL OAM_AllocateFromRegionE
|
JSL OAM_AllocateFromRegionE
|
||||||
|
|
||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
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
|
||||||
.next_tile
|
.next_tile
|
||||||
|
|
||||||
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
|
||||||
|
AND.w #$0100 : STA $0E
|
||||||
|
INY
|
||||||
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
|
SEP #$20
|
||||||
|
BCC .on_screen_y
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
|
||||||
AND.w #$0100 : STA $0E
|
STA $0E
|
||||||
INY
|
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
|
||||||
SEP #$20
|
|
||||||
BCC .on_screen_y
|
|
||||||
|
|
||||||
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
|
|
||||||
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
|
||||||
LDA .chr, X : STA ($90), Y
|
LDA .chr, X : STA ($90), Y
|
||||||
INY
|
INY
|
||||||
LDA .properties, X : STA ($90), Y
|
LDA .properties, X : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
TYA : LSR #2 : TAY
|
||||||
|
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
PLY : INY
|
||||||
|
PLX : DEX : BPL .next_tile
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
PLX
|
||||||
|
|
||||||
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
|
RTS
|
||||||
|
|
||||||
PLY : INY
|
|
||||||
|
|
||||||
PLX : DEX : BPL .next_tile
|
|
||||||
|
|
||||||
PLX
|
|
||||||
|
|
||||||
RTS
|
|
||||||
|
|
||||||
.start_index
|
.start_index
|
||||||
db $00, $08, $10
|
db $00, $08, $10
|
||||||
@@ -741,27 +717,27 @@ Sprite_Kydreeok_Draw:
|
|||||||
|
|
||||||
ApplyKydreeokGraphics:
|
ApplyKydreeokGraphics:
|
||||||
{
|
{
|
||||||
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)"
|
||||||
CPY #$01 : BEQ .phase2
|
CPY #$01 : BEQ .phase2
|
||||||
LDA.w #KydreeokGraphics : STA $4302
|
LDA.w #KydreeokGraphics : STA $4302
|
||||||
LDX.b #KydreeokGraphics>>16 : STX $4304
|
LDX.b #KydreeokGraphics>>16 : STX $4304
|
||||||
JMP .continue
|
JMP .continue
|
||||||
.phase2
|
.phase2
|
||||||
LDA.w #KydreeokPhase2Graphics : STA $4302
|
LDA.w #KydreeokPhase2Graphics : STA $4302
|
||||||
LDX.b #KydreeokPhase2Graphics>>16 : STX $4304
|
LDX.b #KydreeokPhase2Graphics>>16 : STX $4304
|
||||||
.continue
|
.continue
|
||||||
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
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
KydreeokGraphics:
|
KydreeokGraphics:
|
||||||
incbin kydreeok.bin
|
incbin kydreeok.bin
|
||||||
|
|||||||
@@ -30,9 +30,7 @@
|
|||||||
!ImperviousArrow = 00 ; 01 = Impervious to arrows
|
!ImperviousArrow = 00 ; 01 = Impervious to arrows
|
||||||
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
||||||
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
|
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
|
||||||
%Set_Sprite_Properties(Sprite_KydreeokHead_Prep, Sprite_KydreeokHead_Long);
|
%Set_Sprite_Properties(Sprite_KydreeokHead_Prep, Sprite_KydreeokHead_Long)
|
||||||
|
|
||||||
; =========================================================
|
|
||||||
|
|
||||||
Sprite_KydreeokHead_Long:
|
Sprite_KydreeokHead_Long:
|
||||||
{
|
{
|
||||||
@@ -86,54 +84,54 @@ Sprite_KydreeokHead_Main:
|
|||||||
; 0x00
|
; 0x00
|
||||||
KydreeokHead_ForwardAnim:
|
KydreeokHead_ForwardAnim:
|
||||||
{
|
{
|
||||||
%StartOnFrame(0)
|
%StartOnFrame(0)
|
||||||
%PlayAnimation(0,2,10)
|
%PlayAnimation(0,2,10)
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
JSL Sprite_CheckDamageFromPlayer
|
JSL Sprite_CheckDamageFromPlayer
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
JSR KydreeokHead_RotationMove
|
JSR KydreeokHead_RotationMove
|
||||||
JSR RandomlyAttack
|
JSR RandomlyAttack
|
||||||
|
|
||||||
LDA.b #$20 : STA.w SprTimerA, X
|
LDA.b #$20 : STA.w SprTimerA, X
|
||||||
JSL Sprite_IsToRightOfPlayer : TYA : BNE .not_right
|
JSL Sprite_IsToRightOfPlayer : TYA : BNE .not_right
|
||||||
JSR GetDistance8bit : CMP #$0B : BCC .not_far
|
JSR GetDistance8bit : CMP #$0B : BCC .not_far
|
||||||
%GotoAction(3)
|
%GotoAction(3)
|
||||||
RTS
|
|
||||||
.not_far
|
|
||||||
%GotoAction(1)
|
|
||||||
RTS
|
RTS
|
||||||
.not_right
|
.not_far
|
||||||
JSR GetDistance8bit : CMP #$0B : BCC .not_far2
|
%GotoAction(1)
|
||||||
%GotoAction(4)
|
|
||||||
RTS
|
|
||||||
.not_far2
|
|
||||||
%GotoAction(2)
|
|
||||||
RTS
|
RTS
|
||||||
|
.not_right
|
||||||
|
JSR GetDistance8bit : CMP #$0B : BCC .not_far2
|
||||||
|
%GotoAction(4)
|
||||||
|
RTS
|
||||||
|
.not_far2
|
||||||
|
%GotoAction(2)
|
||||||
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
; -------------------------------------------------------
|
; -------------------------------------------------------
|
||||||
; 0x01
|
; 0x01
|
||||||
KydreeokHead_RightAnim:
|
KydreeokHead_RightAnim:
|
||||||
{
|
{
|
||||||
%StartOnFrame(3)
|
%StartOnFrame(3)
|
||||||
%PlayAnimation(3,5,10)
|
%PlayAnimation(3,5,10)
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
JSL Sprite_CheckDamageFromPlayer
|
JSL Sprite_CheckDamageFromPlayer
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
JSR KydreeokHead_RotationMove
|
JSR KydreeokHead_RotationMove
|
||||||
JSR RandomlyAttack
|
JSR RandomlyAttack
|
||||||
|
|
||||||
JSL Sprite_IsToRightOfPlayer : TYA : BNE .not_right
|
JSL Sprite_IsToRightOfPlayer : TYA : BNE .not_right
|
||||||
RTS
|
|
||||||
.not_right
|
|
||||||
%GotoAction(0)
|
|
||||||
RTS
|
RTS
|
||||||
|
.not_right
|
||||||
|
%GotoAction(0)
|
||||||
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
; -------------------------------------------------------
|
; -------------------------------------------------------
|
||||||
@@ -241,7 +239,6 @@ KydreeokHead_RotationMove:
|
|||||||
; LDA.b #$01 : STA.w SprMiscE, X
|
; LDA.b #$01 : STA.w SprMiscE, X
|
||||||
; LDA.b #$10 : STA.w SprTimerE, X
|
; LDA.b #$10 : STA.w SprTimerE, X
|
||||||
; .no_independent
|
; .no_independent
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,15 +248,14 @@ Sprite_KydreeokHead_Damage_Flash:
|
|||||||
; Change the palette to the next in the cycle
|
; Change the palette to the next in the cycle
|
||||||
LDA.w $0EB0, X : INC : CMP.b #$08 : BNE .dontReset
|
LDA.w $0EB0, X : INC : CMP.b #$08 : BNE .dontReset
|
||||||
LDA.b #$00
|
LDA.b #$00
|
||||||
|
|
||||||
.dontReset
|
.dontReset
|
||||||
STA.w $0EB0, X
|
STA.w $0EB0, X
|
||||||
BRA .flash
|
BRA .flash
|
||||||
|
|
||||||
.dontFlash
|
.dontFlash
|
||||||
STZ.w $0EB0, X
|
STZ.w $0EB0, X
|
||||||
|
|
||||||
.flash
|
.flash
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,21 +263,21 @@ Sprite_KydreeokHead_Damage_Flash:
|
|||||||
|
|
||||||
CoordinateBasedRotation:
|
CoordinateBasedRotation:
|
||||||
{
|
{
|
||||||
LDA.w Neck_Index : TAY
|
LDA.w Neck_Index : TAY
|
||||||
; JSL GetRandomInt : AND #$04 : TAY
|
; JSL GetRandomInt : AND #$04 : TAY
|
||||||
LDA.w X_Coords, Y : STA.w Neck1_OffsetX
|
LDA.w X_Coords, Y : STA.w Neck1_OffsetX
|
||||||
LDA.w X_Coords, Y : STA.w Neck2_OffsetX
|
LDA.w X_Coords, Y : STA.w Neck2_OffsetX
|
||||||
LDA.w X_Coords, Y : STA.w Neck3_OffsetX
|
LDA.w X_Coords, Y : STA.w Neck3_OffsetX
|
||||||
LDA.w Y_Coords, Y : STA.w Neck1_OffsetY
|
LDA.w Y_Coords, Y : STA.w Neck1_OffsetY
|
||||||
LDA.w Y_Coords, Y : STA.w Neck2_OffsetY
|
LDA.w Y_Coords, Y : STA.w Neck2_OffsetY
|
||||||
LDA.w Y_Coords, Y : STA.w Neck3_OffsetY
|
LDA.w Y_Coords, Y : STA.w Neck3_OffsetY
|
||||||
JSL GetRandomInt : AND #$3F : BNE .dont_increment
|
JSL GetRandomInt : AND #$3F : BNE .dont_increment
|
||||||
INC.w Neck_Index
|
INC.w Neck_Index
|
||||||
.dont_increment
|
.dont_increment
|
||||||
CPY #15 : BNE .not_full
|
CPY #15 : BNE .not_full
|
||||||
LDA #0 : STA.w Neck_Index
|
LDA #0 : STA.w Neck_Index
|
||||||
.not_full
|
.not_full
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
; Table for X coordinates (based on a radius of 8)
|
; Table for X coordinates (based on a radius of 8)
|
||||||
@@ -308,7 +304,6 @@ RotateHeadUsingSpeedValues:
|
|||||||
.not_full
|
.not_full
|
||||||
STY.w Neck_Index
|
STY.w Neck_Index
|
||||||
JSL Sprite_MoveLong
|
JSL Sprite_MoveLong
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +379,6 @@ MoveWithBody:
|
|||||||
; STA.w SprX, X
|
; STA.w SprX, X
|
||||||
|
|
||||||
LDA.w SprY, Y : SEC : SBC #$0F
|
LDA.w SprY, Y : SEC : SBC #$0F
|
||||||
|
|
||||||
; STA.w SprY, X
|
; STA.w SprY, X
|
||||||
STA.w SprMiscB, X
|
STA.w SprMiscB, X
|
||||||
STA.w $19F1
|
STA.w $19F1
|
||||||
@@ -420,7 +414,7 @@ Neck1_Control:
|
|||||||
LDA.w SprY, X : STA $06 ; dest Y
|
LDA.w SprY, X : STA $06 ; dest Y
|
||||||
LDA.w SprYH, X : STA $07 ; dest YH
|
LDA.w SprYH, X : STA $07 ; dest YH
|
||||||
|
|
||||||
;load body position into sprite position
|
; load body position into sprite position
|
||||||
LDA.w $19EA : STA.w SprX, X
|
LDA.w $19EA : STA.w SprX, X
|
||||||
LDA.w $19EB : STA.w SprY, X
|
LDA.w $19EB : STA.w SprY, X
|
||||||
|
|
||||||
@@ -502,38 +496,38 @@ Neck1_Control:
|
|||||||
|
|
||||||
Neck2_Control:
|
Neck2_Control:
|
||||||
{
|
{
|
||||||
; Set head pos
|
; Set head pos
|
||||||
LDA $19F4 : STA.w SprX, X
|
LDA $19F4 : STA.w SprX, X
|
||||||
LDA $19F5 : STA.w SprY, X
|
LDA $19F5 : STA.w SprY, X
|
||||||
|
|
||||||
LDA.w SprX, X : STA.w SprMiscC, X
|
LDA.w SprX, X : STA.w SprMiscC, X
|
||||||
LDA.w SprY, X : STA.w SprMiscD, X
|
LDA.w SprY, X : STA.w SprMiscD, X
|
||||||
LDA.w SprXSpeed, X : STA $08
|
LDA.w SprXSpeed, X : STA $08
|
||||||
LDA.w SprYSpeed, X : STA $09
|
LDA.w SprYSpeed, X : STA $09
|
||||||
|
|
||||||
LDA.w $19F0 : STA $02 ; x
|
LDA.w $19F0 : STA $02 ; x
|
||||||
LDA.w $19F1 : STA $03 ; y
|
LDA.w $19F1 : STA $03 ; y
|
||||||
|
|
||||||
LDA.w SprX, X : STA $04
|
LDA.w SprX, X : STA $04
|
||||||
LDA.w SprY, X : STA $05
|
LDA.w SprY, X : STA $05
|
||||||
JSR GetDistance8bit : CMP #$08 : BCC .TooCloseToHead2 ; is body1 too close to the head?
|
JSR GetDistance8bit : CMP #$08 : BCC .TooCloseToHead2 ; is body1 too close to the head?
|
||||||
LDA.w SprX, X : STA $04 ; dest X
|
LDA.w SprX, X : STA $04 ; dest X
|
||||||
LDA.w SprXH, X : STA $05 ; dest XH
|
LDA.w SprXH, X : STA $05 ; dest XH
|
||||||
LDA.w SprY, X : STA $06 ; dest Y
|
LDA.w SprY, X : STA $06 ; dest Y
|
||||||
LDA.w SprYH, X : STA $07 ; dest YH
|
LDA.w SprYH, X : STA $07 ; dest YH
|
||||||
; load body position into sprite position
|
; load body position into sprite position
|
||||||
LDA.w $19F0 : STA.w SprX, X
|
LDA.w $19F0 : STA.w SprX, X
|
||||||
LDA.w $19F1 : STA.w SprY, X
|
LDA.w $19F1 : STA.w SprY, X
|
||||||
|
|
||||||
LDA #$08
|
LDA #$08
|
||||||
JSL Sprite_ProjectSpeedTowardsEntityLong
|
JSL Sprite_ProjectSpeedTowardsEntityLong
|
||||||
LDA.b $01 : STA.w SprXSpeed, X
|
LDA.b $01 : STA.w SprXSpeed, X
|
||||||
LDA.b $00 : STA.w SprYSpeed, X
|
LDA.b $00 : STA.w SprYSpeed, X
|
||||||
JSL Sprite_MoveLong
|
JSL Sprite_MoveLong
|
||||||
LDA.w SprX, X : STA.w $19F0
|
LDA.w SprX, X : STA.w $19F0
|
||||||
LDA.w SprY, X : STA.w $19F1
|
LDA.w SprY, X : STA.w $19F1
|
||||||
|
|
||||||
.TooCloseToHead2
|
.TooCloseToHead2
|
||||||
|
|
||||||
LDA.w $19F2 : STA $02 ; x
|
LDA.w $19F2 : STA $02 ; x
|
||||||
LDA.w $19F3 : STA $03 ; y
|
LDA.w $19F3 : STA $03 ; y
|
||||||
@@ -595,11 +589,11 @@ Neck2_Control:
|
|||||||
|
|
||||||
KydreeokHead_NeckControl:
|
KydreeokHead_NeckControl:
|
||||||
{
|
{
|
||||||
LDA.w SprSubtype, X : BEQ .DoNeck1
|
LDA.w SprSubtype, X : BEQ .DoNeck1
|
||||||
JMP .DoNeck2
|
JMP .DoNeck2
|
||||||
.DoNeck1
|
.DoNeck1
|
||||||
JSR Neck1_Control
|
JSR Neck1_Control
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.DoNeck2
|
.DoNeck2
|
||||||
JSR Neck2_Control
|
JSR Neck2_Control
|
||||||
@@ -685,54 +679,52 @@ Sprite_KydreeokHead_DrawNeck:
|
|||||||
|
|
||||||
Sprite_KydreeokHead_Draw:
|
Sprite_KydreeokHead_Draw:
|
||||||
{
|
{
|
||||||
JSL Sprite_PrepOamCoord
|
JSL Sprite_PrepOamCoord
|
||||||
JSL Sprite_OAM_AllocateDeferToPlayer
|
JSL Sprite_OAM_AllocateDeferToPlayer
|
||||||
|
|
||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
LDA.w $0EB0, X : STA $08
|
LDA.w $0EB0, X : STA $08
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
; amount of tiles - 1
|
; amount of tiles - 1
|
||||||
LDX .nbr_of_tiles, Y : LDY.b #$00
|
LDX .nbr_of_tiles, Y : LDY.b #$00
|
||||||
.next_tile
|
.next_tile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
; Add Animation Index Offset
|
||||||
|
TXA : CLC : ADC $06
|
||||||
|
|
||||||
; Add Animation Index Offset
|
; Keep the value with animation index offset?
|
||||||
TXA : CLC : ADC $06
|
PHA : ASL A : TAX
|
||||||
|
|
||||||
; Keep the value with animation index offset?
|
REP #$20
|
||||||
PHA : ASL A : TAX
|
|
||||||
|
|
||||||
REP #$20
|
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
||||||
|
AND.w #$0100 : STA $0E : INY
|
||||||
|
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
||||||
|
CLC : ADC #$0010 : CMP.w #$0100
|
||||||
|
SEP #$20
|
||||||
|
BCC .on_screen_y
|
||||||
|
|
||||||
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
|
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
|
||||||
AND.w #$0100 : STA $0E : INY
|
STA $0E
|
||||||
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
|
|
||||||
CLC : ADC #$0010 : CMP.w #$0100
|
|
||||||
SEP #$20
|
|
||||||
BCC .on_screen_y
|
|
||||||
|
|
||||||
LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way
|
|
||||||
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 : LDA .chr, X : STA ($90), Y : INY
|
INY : LDA .chr, X : STA ($90), Y : INY
|
||||||
LDA .properties, X : ORA $08 : STA ($90), Y
|
LDA .properties, X : ORA $08 : STA ($90), Y
|
||||||
|
|
||||||
PHY
|
PHY
|
||||||
|
TYA : LSR #2 : TAY
|
||||||
|
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
||||||
|
PLY : INY
|
||||||
|
PLX : DEX : BPL .next_tile
|
||||||
|
|
||||||
TYA : LSR #2 : TAY
|
PLX
|
||||||
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
|
|
||||||
PLY : INY
|
|
||||||
PLX : DEX : BPL .next_tile
|
|
||||||
|
|
||||||
PLX
|
JMP Sprite_KydreeokHead_DrawNeck
|
||||||
|
|
||||||
JMP Sprite_KydreeokHead_DrawNeck
|
|
||||||
|
|
||||||
.start_index
|
.start_index
|
||||||
db $00, $02, $04, $06, $0A, $0E, $12, $16, $1A, $1E, $22, $26, $2A, $2E, $32, $36
|
db $00, $02, $04, $06, $0A, $0E, $12, $16, $1A, $1E, $22, $26, $2A, $2E, $32, $36
|
||||||
|
|||||||
Reference in New Issue
Block a user