Rearrange sprites

This commit is contained in:
scawful
2024-01-06 02:53:47 -05:00
parent 75a5281c8a
commit 8959de6414
11 changed files with 38 additions and 9 deletions

1705
Sprites/Bosses/dark_link.asm Normal file

File diff suppressed because it is too large Load Diff

243
Sprites/Bosses/kydrog.asm Normal file
View File

@@ -0,0 +1,243 @@
;==============================================================================
; Sprite Properties
;==============================================================================
!SPRID = $7B; The sprite ID you are overwriting (HEX)
!NbrTiles = 6 ; Number of tiles used in a frame
!Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 0 ; Number of Health the sprite have
!Damage = 0 ; (08 is a whole heart), 04 is half heart
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 0 ; Unused in this template (can be 0 to 7)
!Hitbox = 0 ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
!CollisionLayer = 00 ; 01 = will check both layer for collision
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
!DeflectArrow = 00 ; 01 = deflect arrows
!WaterSprite = 00 ; 01 = can only walk shallow water
!Blockable = 00 ; 01 = can be blocked by link's shield?
!Prize = 0 ; 00-15 = the prize pack the sprite will drop from
!Sound = 00 ; 01 = Play different sound when taking damage
!Interaction = 00 ; ?? No documentation
!Statue = 00 ; 01 = Sprite is statue
!DeflectProjectiles = 00 ; 01 = Sprite will deflect ALL projectiles
!ImperviousArrow = 00 ; 01 = Impervious to arrows
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_Kydrog_Prep, Sprite_Kydrog_Long)
;==============================================================================
Sprite_Kydrog_Long:
{
PHB : PHK : PLB
JSR Sprite_Kydrog_Draw ; Call the draw code
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_Kydrog_Main ; Call the main sprite code
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
}
;==============================================================================
Sprite_Kydrog_Prep:
{
PHB : PHK : PLB
; Add more code here to initialize data
LDA.l $7EF300
BEQ .PlayIntro
STZ.w $0DD0, X ; Kill the sprite
.PlayIntro
PLB
RTL
}
;==============================================================================
Sprite_Kydrog_Main:
{
LDA.w SprAction, X; Load the SprAction
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
dw Kydrog_StartCutscene
dw Kydrog_AttractPlayer
dw Kydrog_SpawnOffspring
dw Kydrog_WarpPlayerAway
Kydrog_StartCutscene:
{
LDA WALKSPEED : STA.b $57 ; Slow Link down for the cutscene
LDA.b #$08 : STA.b $49 ; Auto-movement north
LDA.b $20 ; Link's Y Position
CMP.b #72 ; Y = 6C
BCC .linkistoofar
LDA.b #$80
STA.w SprTimerA, X ; set timer A to 0x10
%GotoAction(1)
.linkistoofar
RTS
}
Kydrog_AttractPlayer:
{
LDA.w SprTimerA, X : BNE +
LDA #$00 : STA $7EF303
%ShowUnconditionalMessage($21)
%GotoAction(2)
+
RTS
}
Kydrog_SpawnOffspring:
{
LDA.b #$02 : STA.b $B6 ; Update story flag for Farore
STZ.b $49 ; Stop Link from moving
%GotoAction(3)
RTS
}
Kydrog_WarpPlayerAway:
{
; Set game state to part 03
; LDA.b #$03 : STA $7EF3C5
; Put us in the Dark World.
LDA $7EF3CA : EOR.b #$40 : STA $7EF3CA
JSL $00FC41 ; Sprite_LoadGfxProperties
; JSL $00FC62 ; Sprite_LoadGfxProperties.justLightWorld
STZ $037B : STZ $3C : STZ $3A : STZ $03EF
; Link can't move
LDA.b #$01 : STA $02E4
; The module to return to is #$08 (preoverworld)
LDA.b #$08 : STA $010C
; Set the map I want
LDA.b #$20 : STA $A0 : STZ $A1
; Set us to the warp state
LDA.b #$15 : STA $10
; Clear submodules
STZ $11 : STZ $B0
; Remove Impa follower
LDA.b #$00 : STA $7EF3CC
; Set the flag to remove Farore and Kydrog from Maku area
LDA #$01 : STA.l $7EF300
; Set the progress flag for Impa (Zelda) in the sanctuary
LDA $7EF3C6 : ORA.b #$04 : STA $7EF3C6
RTS
}
}
;==============================================================================
Sprite_Kydrog_Draw:
{
JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00
.nextTile
PHX ; Save current Tile Index?
TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset?
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.b #$F0 : STA ($90), Y ;Put the sprite out of the way
STA $0E
.on_screen_y
PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore)
INY
LDA .chr, X : STA ($90), Y
INY
LDA .properties, X : STA ($90), Y
PHY
TYA : LSR #2 : TAY
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY
PLX : DEX : BPL .nextTile
PLX
RTS
;==============================================================================
.start_index
db $00
.nbr_of_tiles
db 5
.x_offsets
dw -8, 8, 8, -8, -8, 8
.y_offsets
dw -12, -12, 4, 4, 20, 20
.chr
db $CC, $CE, $EE, $EC, $E8, $EA
.properties
db $3B, $3B, $3B, $3B, $3B, $3B
.sizes
db $02, $02, $02, $02, $02, $02
}
; I forget what this is lol
; org $02ECF8
; dw $0029
; ==============================================================================
; 169BC
; org $02E9BC
; LoadOverworldFromSpecialOverworld:
; org $029E65
; JSR LoadOverworldFromSpecialOverworld

View File

@@ -0,0 +1,767 @@
; =============================================================================
; Kydrog Boss
; =============================================================================
; RAM Addresses
; =============================================================================
!OffspringCount = $AC ;0x01
!CurrentDraw = $7A ;0x01
!WalkSpeed = 10 ;0x01
;==============================================================================
; Sprite Properties
;==============================================================================
!SPRID = $CB ; The sprite ID you are overwriting (HEX)
!NbrTiles = 10 ; Number of tiles used in a frame
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 00 ; Number of Health the sprite have
!Damage = 00 ; (08 is a whole heart), 04 is half heart
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 00 ; Unused in this KydrogBoss (can be 0 to 7)
!Hitbox = 03 ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
!CollisionLayer = 00 ; 01 = will check both layer for collision
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
!DeflectArrow = 00 ; 01 = deflect arrows
!WaterSprite = 00 ; 01 = can only walk shallow water
!Blockable = 00 ; 01 = can be blocked by link's shield?
!Prize = 00 ; 00-15 = the prize pack the sprite will drop from
!Sound = 00 ; 01 = Play different sound when taking damage
!Interaction = 00 ; ?? No documentation
!Statue = 00 ; 01 = Sprite is statue
!DeflectProjectiles = 00 ; 01 = Sprite will deflect ALL projectiles
!ImperviousArrow = 00 ; 01 = Impervious to arrows
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = $01 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_KydrogBoss_Prep, Sprite_KydrogBoss_Long)
;==============================================================================
Sprite_KydrogBoss_Long:
{
PHB : PHK : PLB
JSR Sprite_KydrogBoss_Draw ; Call the draw code
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_KydrogBoss_CheckIfDead ; Check if sprite is dead
JSR Sprite_KydrogBoss_Main ; Call the main sprite code
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
}
;==============================================================================
Sprite_KydrogBoss_CheckIfDead:
{
LDA $0D80, X : CMP.b #$09 : BEQ .not_dead
; If health is negative, set back to zero
LDA $0E50, X : CMP.b #$44 : BCC .healthNotNegative
LDA.b #$00 : STA $0E50, X
.healthNotNegative
LDA $0E50, X : BNE .not_dead
PHX
LDA.b #$04 : STA $0DD0, X ;kill sprite boss style
LDA.b #$09 : STA $0D80, X ;go to KydrogBoss_Death stage
PLX
.not_dead
RTS
}
;==============================================================================
Sprite_KydrogBoss_Prep:
{
PHB : PHK : PLB
LDA.b #$40 : STA $0E50, X ;health
LDA.b #$80 : STA $0CAA, X
LDA.b #$03 : STA $0F60, X ; hitbox settings
LDA.b #$0F : STA $0CD2, X ; bump damage type (4 hearts, green tunic)
; Make the sprite take damage from a sword
; LDA $0CAA, X : AND.b #$FB : STA $0CAA, X
; Make the sprite not invincible
LDA $0E60, X : AND.b #$BF : STA $0E60, X
JSR KydrogBoss_Set_Damage ; Set the damage table
%SetSpriteSpeedX(15)
%SetSpriteSpeedX(15)
%SetHarmless(00)
LDA #$60 : STA SprTimerD, X
PLB
RTL
}
;==============================================================================
macro StopIfTooClose()
LDA $0E : CMP.b #$0030 : BCS +
CLC
LDA $0F : CMP.b #$0030 : BCS +
LDA.b #$20 : STA.w SprTimerD, X ; set timer E to 0x20
%GotoAction(7)
RTS
+
endmacro
macro RandomStalfosOffspring()
JSL GetRandomInt : AND.b #$7F : BNE +
PHX : JSR Sprite_Offspring_Spawn : PLX
+
JSL GetRandomInt : AND.b #$7F : BNE +
PHX : JSR Sprite_Offspring_SpawnHead : PLX
+
endmacro
Sprite_KydrogBoss_Main:
{
LDA.w SprAction, X; Load the SprAction
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
dw KydrogBoss_Init ; 00
dw KydrogBoss_WalkState ; 01
dw KydrogBoss_WalkForward ; 02
dw KydrogBoss_WalkLeft ; 03
dw KydrogBoss_WalkRight ; 04
dw KydrogBoss_WalkBackward ; 05
dw KydrogBoss_TakeDamage ; 06
dw KydrogBoss_TauntPlayer ; 07
dw KydrogBoss_SummonStalfos ; 08
dw KydrogBoss_Death ; 09
; ---------------------------------------------------------------------------
KydrogBoss_Init:
{
%StartOnFrame(15)
%PlayAnimation(15, 16, 8) ; Arms Crossed Animation
; JSR SetupMovieEffect
; JSR MovieEffect
; LDX.b #$00
LDA.w SprTimerD, X : BNE +
%GotoAction(1) ; Goto KydrogBoss_WalkState
+
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_WalkState:
{
LDA $0DA0 : BEQ .not_flashing
LDA.b #$20 : STA.w SprTimerD, X
%GotoAction(6) ; Goto KydrogBoss_TakeDamage
RTS
.not_flashing
; LDA !OffspringCount : CMP.b #$05 : BCS .no_offspring
JSL GetRandomInt : AND.b #$0F : BNE .no_offspring
LDA.b #$10 : STA.w SprTimerD, X
%GotoAction(8) ; Goto KydrogBoss_TauntPlayer
RTS
.no_offspring
LDA #$50 : STA $09, X
JSL Sprite_DirectionToFacePlayer
TYA : CMP.b #$02 : BCC .WalkRight
.WalkForward
%StopIfTooClose()
JSL Sprite_IsBelowPlayer ; Check if sprite is below player
TYA : BNE .WalkBackwards ; If 1, go to KydrogBoss_WalkBackwards
%GotoAction(2) ; Goto KydrogBoss_WalkForward
RTS
.WalkBackwards
%GotoAction(5) ; Goto KydrogBoss_WalkBackwards
RTS
.WalkRight
%StopIfTooClose()
JSL Sprite_IsToRightOfPlayer ; Check if sprite is to the right of player
TYA : BNE .WalkLeft ; If so, go to KydrogBoss_WalkLeft
%GotoAction(4)
RTS
.WalkLeft
%GotoAction(3) ; Goto KydrogBoss_WalkLeft
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_WalkForward:
{
%PlayAnimation(0, 2, 8)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%RandomStalfosOffspring()
%GotoAction(1)
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_WalkLeft:
{
%PlayAnimation(3, 5, 8)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%RandomStalfosOffspring()
%GotoAction(1)
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_WalkRight:
{
%PlayAnimation(6, 8, 8)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%RandomStalfosOffspring()
%GotoAction(1)
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_WalkBackward:
{
%PlayAnimation(9, 11, 8)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%RandomStalfosOffspring()
%GotoAction(1)
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_TakeDamage: ;0x06
{
%StartOnFrame(12)
%PlayAnimation(12, 14, 8)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
%RandomStalfosOffspring()
LDA.w SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_TauntPlayer: ;0x07
{
%StartOnFrame(15)
%PlayAnimation(15, 16, 8) ; Arms Crossed Animation
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
LDA.w SprTimerD, X : BNE .continue_timer
LDA.b #$20 : STA.w SprTimerD, X ; set timer E to 0x20
%GotoAction(8)
.continue_timer
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_SummonStalfos: ;0x08
{
%StartOnFrame(17)
%PlayAnimation(17, 17, 10)
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
LDA.w SprTimerD, X : BNE +
JSL GetRandomInt : AND.b #$3F : BNE .no_stalfos
PHX
JSR Sprite_Offspring_Spawn
PLX
.no_stalfos
JSR Kydrog_ThrowBoneAtPlayer
CLC
JSL GetRandomInt : AND.b #$3F : BNE .finish_summon
JSR Sprite_Offspring_SpawnHead
; .offspring_stalfos
;
.finish_summon
%GotoAction(1)
+
RTS
}
; ---------------------------------------------------------------------------
KydrogBoss_Death: ;0x09
{
; %StartOnFrame(0)
; %PlayAnimation(0, 0, 10)
; Change the palette to the next in the cycle for the leg
LDA $0DA0, X : INC : CMP.b #$08 : BNE .dontReset
LDA.b #$00
.dontReset
STA $0DA0, X
RTS
}
RTS
}
;==============================================================================
Sprite_KydrogBoss_Draw:
{
JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer
LDA $0DC0, X : CLC : ADC $0D90, X : ASL : TAY ; Animation Frame
REP #$20
LDA .start_index, Y : STA $06 ; Needs to be 16 bit ; Y = 00, 02, 04, 06
SEP #$20
; Store Palette thing
LDA $0DA0, X : STA $08
PHX ; Store Sprite ID
REP #$20
LDA .nbr_of_tiles, Y ;amount of tiles -1 ; doesn't need to be 16 bit ;Y = 00, 02, 04, 06
REP #$30
TAX
LDY.w #$0000
.nextTile
REP #$30
PHX ; Save current tile index
TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset
ASL A : TAX ; *2 for the X and Y position
REP #$30 ; X and Y position must be 16 bit
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 ; change A back to 8bit but not X and Y
BCC .on_screen_y
LDA.b #$F0 : STA ($90), Y ; Put the sprite out of the way
STA $0E
.on_screen_y
PLX ; Pullback Animation Index Offset
; so X here is (nbr of tiles + animation index)
INY
LDA .chr, X : STA ($90), Y
INY
; Set palette flash modifier
LDA .properties, X : ORA $08 : STA ($90), Y
REP #$30
PHY
TYA : LSR #2 : TAY ; divide Y by 4
SEP #$20 ;set A back to 8bit but not X and Y
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY
PLX : DEX : BPL .nextTile
SEP #$30
PLX
RTS
;==============================================================================
.start_index
dw $00, $0B, $15, $1F, $27, $2D, $35, $3D, $43, $4C, $57, $66, $71, $7A, $87, $91, $99, $A1
.nbr_of_tiles
dw 10, 9, 9, 7, 5, 7, 7, 5, 8, 10, 14, 10, 8, 12, 9, 7, 7, 6
.x_offsets
dw -8, 8, 8, 0, 8, 0, -8, -8, 16, 16, -8
dw -8, 8, -8, 0, 16, 16, -8, 16, 0, 8
dw -8, 8, 0, 16, -8, -8, -8, 16, 0, 8
dw 0, 0, 16, 8, 0, 16, 16, 16
dw 16, 0, 0, 16, 16, 0
dw 0, 16, 8, 16, 0, 16, 12, 0
dw 4, -4, 12, 4, -4, -4, 4, -4
dw 4, -12, 4, -12, -4, 16
dw 4, -4, 4, -4, -4, 12, 12, -4, 12
dw 0, 8, 8, 0, 0, 8, -8, -8, -8, 16, 16
dw 0, 8, 8, 0, 8, 0, 0, 8, 8, -8, -8, -8, 16, 16, 16
dw 0, 8, 8, 0, 0, 8, 16, 16, 16, -8, -8
dw -8, -8, 8, 16, 8, 8, 16, 0, 8
dw 0, -8, 8, 8, -8, -8, 0, 8, 0, 8, 16, 16, 16
dw -8, 16, 8, 8, 16, 0, 16, -8, 0, 8
dw -8, 8, -8, -8, 8, 8, -8, 16
dw -8, 8, 0, 8, -8, 8, -8, 16
dw -12, 4, 12, -4, 0, 16, 8
.y_offsets
dw -20, -20, -4, 4, 4, 12, 4, 12, 4, 12, -4
dw -19, -19, 4, 4, 4, 12, -4, -4, -3, -3
dw -20, -20, 4, 4, 4, 12, -4, -4, -4, -4
dw -20, -4, -4, -4, 4, 4, 12, -20
dw -20, -4, 4, -4, 4, -20
dw -20, -20, -4, -4, 4, 4, 12, -4
dw -20, -20, -4, -4, -4, -12, 4, 4
dw -20, -20, -4, -4, 4, 0
dw -20, -20, -4, -4, 4, 0, 8, -12, -4
dw -20, -20, -12, 0, -4, -4, -8, 0, 8, 0, -8
dw -20, -20, -12, -4, -4, 0, 8, 0, 8, 0, 8, -8, 0, 8, -8
dw -20, -20, -12, 0, -4, -4, -8, 0, 8, 0, -8
dw -24, -8, -24, -8, -8, 0, 0, 8, 8
dw -8, -24, -24, -8, -8, 0, 8, 8, 0, 0, 0, 8, -8
dw -16, -16, -16, -8, -8, 0, 0, 0, -24, -24
dw 0, 0, -16, -24, -16, -24, -16, -16
dw 0, 0, -8, -8, -24, -24, -8, -8
dw -4, -4, -20, -20, 12, 12, 12
.chr
db $87, $87, $A7, $80, $81, $A4, $93, $A3, $96, $A6, $A7
db $87, $87, $B3, $80, $92, $A2, $83, $83, $A8, $A8
db $87, $87, $80, $B2, $A1, $B1, $83, $83, $A8, $A8
db $C9, $E9, $EB, $EA, $C0, $C2, $D2, $CB
db $CE, $EC, $C3, $EE, $C5, $CC
db $C9, $CB, $FA, $FB, $C6, $C8, $D8, $E9
db $C9, $CB, $E9, $EA, $EB, $DB, $E1, $E0
db $CC, $CE, $EC, $EE, $E3, $E5
db $C9, $CB, $FA, $FB, $E6, $E8, $F8, $DE, $E9
db $89, $89, $99, $8E, $A9, $A9, $82, $92, $A2, $B3, $83
db $89, $89, $99, $A9, $A9, $8D, $9D, $8D, $9D, $8C, $9C, $83, $A1, $B1, $82
db $89, $89, $99, $8E, $A9, $A9, $83, $93, $A3, $B2, $83
db $45, $65, $45, $65, $66, $77, $75, $BD, $BE
db $6F, $4E, $4E, $6F, $47, $57, $7C, $7D, $AA, $AB, $6E, $7E, $83
db $84, $84, $85, $95, $5D, $AA, $6D, $6D, $8A, $8A
db $AC, $AE, $50, $40, $50, $40, $52, $52
db $AC, $AE, $63, $63, $42, $42, $60, $60
db $68, $6A, $4B, $49, $70, $72, $71
.properties
db $3B, $7B, $7B, $3B, $3B, $3B, $3B, $3B, $3B, $3B, $3B
db $3B, $7B, $3B, $3B, $3B, $3B, $3B, $7B, $3B, $7B
db $3B, $7B, $7B, $3B, $3B, $3B, $3B, $7B, $3B, $7B
db $3B, $3B, $3B, $3B, $3B, $3B, $3B, $3B
db $3B, $3B, $3B, $3B, $3B, $3B
db $3B, $3B, $3B, $3B, $3B, $3B, $3B, $3B
db $7B, $7B, $7B, $7B, $7B, $7B, $3B, $3B
db $7B, $7B, $7B, $7B, $3B, $3B
db $7B, $7B, $7B, $7B, $3B, $3B, $3B, $7B, $7B
db $3B, $7B, $7B, $3B, $3B, $7B, $7B, $7B, $7B, $7B, $7B
db $3B, $7B, $7B, $3B, $7B, $3B, $3B, $7B, $7B, $3B, $3B, $3B, $7B, $7B, $3B
db $3B, $7B, $7B, $7B, $3B, $7B, $7B, $7B, $7B, $7B, $3B
db $3B, $3B, $7B, $7B, $7B, $3B, $7B, $3B, $3B
db $3B, $3B, $7B, $7B, $3B, $3B, $3B, $3B, $3B, $3B, $3B, $3B, $7B
db $3B, $7B, $7B, $7B, $3B, $3B, $3B, $7B, $3B, $7B
db $3B, $3B, $3B, $3B, $7B, $7B, $3B, $7B
db $3B, $3B, $3B, $7B, $3B, $7B, $3B, $7B
db $3B, $3B, $3B, $3B, $3B, $3B, $3B
.sizes
db $02, $02, $02, $00, $00, $02, $00, $00, $00, $00, $02
db $02, $02, $00, $02, $00, $00, $00, $00, $00, $00
db $02, $02, $02, $00, $00, $00, $00, $00, $00, $00
db $02, $00, $00, $00, $02, $00, $00, $00
db $02, $02, $02, $02, $00, $02
db $02, $00, $00, $00, $02, $00, $00, $00
db $02, $00, $00, $00, $00, $00, $02, $02
db $02, $02, $02, $02, $02, $00
db $02, $00, $00, $00, $02, $00, $00, $00, $00
db $02, $00, $00, $02, $00, $00, $00, $00, $00, $00, $00
db $02, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $02, $00, $00, $02, $00, $00, $00, $00, $00, $00, $00
db $02, $02, $02, $00, $00, $00, $00, $00, $00
db $00, $02, $02, $00, $02, $02, $00, $00, $00, $00, $00, $00, $00
db $02, $00, $00, $00, $00, $02, $00, $00, $00, $00
db $02, $02, $02, $02, $02, $02, $00, $00
db $02, $02, $02, $00, $02, $02, $00, $00
db $02, $02, $02, $02, $00, $00, $00
}
; =============================================================================
;BA: Boomerang
;D1: Damage 1
;D2: Damage 2
;D3: Damage 3
;D4: Damage 4
;D5: Damage 5
;AR: Arrow Damage
;HS: Hookshot Damage
;BM: BombDamage
;SA: Silvers Damage
;PD: Powder Damage
;FR: Fire Rod Damage
;IR: Ice Rod Damage
;BB: Bombos Damage
;EF: Ether Damage
;QU: Quake Damage
KydrogBoss_Set_Damage:
{
PHX
LDX.b #$00
.loop
LDA .damageProperties, X : STA $7F6880, X
INX : CPX.b #$10 : BNE .loop
PLX
RTS
.damageProperties
db $00, $01, $01, $01, $01, $01, $01, $00, $05, $01, $00, $01, $01, $01, $00, $01
;BA D1 D2 D3 D4 D5 AR HS BM SA PD FR IR BB ET QU
}
; =============================================================================
Sprite_DamageFlash_Long:
{
PHB : PHK : PLB
JSR Sprite_Damage_Flash
PLB
RTL
}
; =============================================================================
Sprite_Damage_Flash:
{
LDA $0EF0, X : BEQ .dontFlash
; Change the palette to the next in the cycle
LDA $0DA0, X : INC : CMP.b #$08 : BNE .dontReset
LDA.b #$00
.dontReset
STA $0DA0, X
BRA .flash
.dontFlash
STZ $0DA0, X
.flash
RTS
}
; =============================================================================
Sprite_Offspring_SpawnHead:
{
JSL GetRandomInt : AND.b #$3F : BNE .normal_head
LDA.b #$04 : BRA .alt_entry
.normal_head
LDA.b #$7C
.alt_entry
BRA Sprite_Offspring_Spawn_alt_entry
RTS
}
Sprite_Offspring_Spawn:
{
; LDA !OffspringCount : CMP.b #$05 : BCS .return
JSL GetRandomInt : AND.b #$3F : BNE .normal_stalfos
LDA.b #$85 : BRA .alt_entry
.normal_stalfos
; Spawn the stalfos offspring
LDA.b #$A7
.alt_entry
JSL Sprite_SpawnDynamically : BMI .return ;89
;store the sub-type
LDA.b #$02 : STA $0E30, Y
PHX
;code that controls where to spawn the offspring.
REP #$20
LDA $0FD8 : CLC : ADC.w #$000C
SEP #$20
STA $0D10, Y
XBA : STA $0D30, Y
REP #$20
LDA $0FDA : CLC : ADC.w #$001E
SEP #$20
STA $0D00, Y
XBA : STA $0D20, Y
TYX
STZ $0D60, X
STZ $0D70, X
; INC !OffspringCount
PLX
.return
RTS
}
Kydrog_ThrowBoneAtPlayer:
{
LDA.b #$A7 : JSL Sprite_SpawnDynamically : BMI .spawn_failed
LDA.b #$01 : STA $0D90, Y ; Sprite state "falling into a pit"
JSL Sprite_SetSpawnedCoords
PHX
TYX
LDA.b #$20 : JSL Sprite_ApplySpeedTowardsPlayer
LDA.b #$21 : STA $0E40, X : STA $0BA0, X
LDA $0E60, X : ORA.b #$40 : STA $0E60, X
LDA.b #$48 : STA $0CAA, X
LDA.b #$10 : STA SprTimerC, X
LDA.b #$14 : STA $0F60, X
LDA.b #$07 : STA $0F50, X
LDA.b #$20 : STA $0CD2, X
PLX
LDA.b #$02 : JSL Sound_SetSfx2PanLong
.spawn_failed
RTS
}
; Y is the sprite index after you spawn it.
; oh right yeah y will be equal to the sprite you spawned for that frame
; but if you want to do a count what you would do:
; PHX
; STZ $00
; LDX.b #$10
; .loop
; DEX
; LDA $0E20, X : CMP.b #$skull : BNE .notSkull
; LDA $0DD0, X : CMP.b #$09 : BNE .notSkull
; INC $00
; .notSkull
; CPX.b #$00 : BNE .loop
; PLX
; $00 = your stalfos skull count

732
Sprites/Bosses/twinrova.asm Normal file
View File

@@ -0,0 +1,732 @@
; =========================================================
; Twinrova Boss Sprite
; =========================================================
!SPRID = $CE ; The sprite ID you are overwriting (HEX)
!NbrTiles = 06 ; Number of tiles used in a frame
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 00 ; Number of Health the sprite have
!Damage = 00 ; (08 is a whole heart), 04 is half heart
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 01 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 00 ; Unused in this Twinrova (can be 0 to 7)
!Hitbox = 03 ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
!CollisionLayer = 01 ; 01 = will check both layer for collision
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
!DeflectArrow = 00 ; 01 = deflect arrows
!WaterSprite = 00 ; 01 = can only walk shallow water
!Blockable = 00 ; 01 = can be blocked by link's shield?
!Prize = 00 ; 00-15 = the prize pack the sprite will drop from
!Sound = 00 ; 01 = Play different sound when taking damage
!Interaction = 00 ; ?? No documentation
!Statue = 00 ; 01 = Sprite is statue
!DeflectProjectiles = 00 ; 01 = Sprite will deflect ALL projectiles
!ImperviousArrow = 00 ; 01 = Impervious to arrows
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = 01 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_Twinrova_Prep, Sprite_Twinrova_Long)
; =========================================================
Sprite_Twinrova_Long:
{
PHB : PHK : PLB
JSR Sprite_Twinrova_Draw ; Call the draw code
JSL Sprite_DrawShadow
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_Twinrova_CheckIfDead ; Check if sprite is dead
JSR Sprite_Twinrova_Main ; Call the main sprite code
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
}
; =========================================================
Sprite_Twinrova_CheckIfDead:
{
LDA $0D80, X : CMP.b #$0A : BEQ .not_dead
; If health is negative, set back to zero
LDA $0E50, X : CMP.b #$44 : BCC .healthNotNegative
LDA.b #$00 : STA $0E50, X
.healthNotNegative
LDA $0E50, X : BNE .not_dead
PHX
LDA.b #$04 : STA $0DD0, X ; Kill sprite boss style
LDA.b #$0A : STA $0D80, X ; Go to Twinrova_Dead stage
PLX
.not_dead
RTS
}
; =========================================================
Sprite_Twinrova_Prep:
{
PHB : PHK : PLB
STZ $0D80, X
LDA.b #$40 : STA $0E50, X ; Health
LDA.b #$04 : STA $0CD2, X ; Bump damage type (4 hearts, green tunic)
%SetSpriteSpeedX(15)
%SetSpriteSpeedX(15)
LDA #$10 : STA $08
LDA #$10 : STA $09
LDA #$00 : STA $7EF3CC
PLB
RTL
}
!AnimSpeed = 8
macro Twinrova_Front()
%PlayAnimation(0,1,!AnimSpeed)
endmacro
macro Twinrova_Back()
%PlayAnimation(2,3,!AnimSpeed)
endmacro
macro Twinrova_Ready()
%PlayAnimation(4,6,!AnimSpeed)
endmacro
macro Twinrova_Attack()
%PlayAnimation(7,7,!AnimSpeed)
endmacro
macro Show_Koume()
%PlayAnimation(8,8,!AnimSpeed)
endmacro
macro Show_Kotake()
%PlayAnimation(9,9,!AnimSpeed)
endmacro
macro Twinrova_Hurt()
%PlayAnimation(10,11,!AnimSpeed)
endmacro
; =========================================================
; Phase 0: Blind Maiden turns into Twinrova.
;
; Phase 1: Twinrova is one entity, moving around the room
; and shooting fire and ice attacks at Link.
; Similar to the Trinexx attacks.
;
; Phase 2: Twinrova alternates between Koume (fire) and
; Kotake (ice) forms. Koume changes the arena
; to a fire arena. Similar to Ganon fight changes.
Sprite_Twinrova_Main:
{
LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable
dw Twinrova_Init ; 0x00
dw Twinrova_MoveState ; 0x01
dw Twinrova_MoveForwards ; 0x02
dw Twinrova_MoveBackwards ; 0x03
dw Twinrova_PrepareAttack ; 0x04
dw Twinrova_FireAttack ; 0x05
dw Twinrova_IceAttack ; 0x06
dw Twinrova_Hurt ; 0x07
dw Twinrova_KoumeMode ; 0x08
dw Twinrova_KotakeMode ; 0x09
dw Twinrova_Dead ; 0x0A
Twinrova_Init:
{
; %Twinrova_Front()
JSR ApplyTwinrovaGraphics
%GotoAction(01)
RTS
}
Twinrova_MoveState:
{
LDA $0E50, X : CMP.b #$20 : BCS .phase_1
; -------------------------------------------
; Phase 2
LDA SprTimerE, X : BNE .kotake
LDA #$70 : STA SprTimerD, X
%GotoAction(8) ; Koume Mode
RTS
.kotake
LDA #$70 : STA SprTimerD, X
%GotoAction(9) ; Kotake Mode
RTS
; ---------------------------------------------
.phase_1
LDA $0DA0 : BEQ .not_flashing
LDA.b #$20 : STA.w SprTimerD, X
%GotoAction(7) ; Goto Twinrova_Hurt
RTS
.not_flashing
JSL GetRandomInt : AND.b #$3F : BNE +
LDA.b #$20 : STA.w SprTimerD, X
STZ $AC
%GotoAction(4) ; Prepare Attack
RTS
+
JSL GetRandomInt : AND.b #$3F : BNE ++
LDA.b #$20 : STA.w SprTimerD, X
LDA #$01 : STA $AC
%GotoAction(4) ; Prepare Attack
RTS
++
JSL Sprite_IsBelowPlayer ; Check if sprite is below player
TYA : BNE .MoveBackwards ; If 1,
%GotoAction(2)
RTS
.MoveBackwards
%GotoAction(3)
RTS
}
Twinrova_MoveForwards:
{
%Twinrova_Front()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%GotoAction(1)
RTS
}
Twinrova_MoveBackwards:
{
%Twinrova_Back()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
%GotoAction(1)
RTS
}
Twinrova_PrepareAttack:
{
%StartOnFrame(7)
%Twinrova_Attack()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
LDA $0CAA : AND.b #$03 : STA $0CAA
LDA SprTimerD, X : BNE +
LDA $0CAA : ORA.b #$03 : STA $0CAA
LDA.b #$40 : STA.w SprTimerD, X
LDA $AC : BEQ .fire
%GotoAction(6) ; Ice Attack
RTS
.fire
%GotoAction(5)
+
RTS
}
; 0x05
Twinrova_FireAttack:
{
%StartOnFrame(4)
%Twinrova_Ready()
JSR Sprite_Twinrova_FireAttack
LDA.w SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
; 0x06
Twinrova_IceAttack:
{
%StartOnFrame(4)
%Twinrova_Ready()
JSR Sprite_Twinrova_IceAttack
LDA.w SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
Twinrova_Hurt:
{
%StartOnFrame(10)
%Twinrova_Hurt()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
LDA.w SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
Twinrova_KoumeMode:
{
%StartOnFrame(8)
%Show_Koume()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
LDA SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
Twinrova_KotakeMode:
{
%StartOnFrame(9)
%Show_Kotake()
PHX
JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_DamageFlash_Long
JSL Sprite_BounceTowardPlayer
LDA SprTimerD, X : BNE +
%GotoAction(1)
+
RTS
}
Twinrova_Dead:
{
%StartOnFrame(10)
%Twinrova_Hurt()
RTS
}
}
; =========================================================
Untitled_Garnish:
{
LDA $1A : AND.b #$03 : BNE .no_shake
JSL Sprite_IsToRightOfPlayer
LDA $0D50, X : CMP .x_speed_targets, Y : BEQ .no_shake
CLC : ADC.w $8000, Y : STA $0D50, X
.no_shake:
JSL Sprite_CheckTileCollision : BEQ .exit
JSL Sprite_BounceTowardPlayer
.exit
RTS
.x_speed_targets
db 8, -16
}
Sprite_Twinrova_FireAttack:
{
JSL Sprite_CheckTileCollision : BNE .no_collision
JSL Sprite_Move
.no_collision
JSR Sprite_Twinrova_FireAttack_AddFireGarnish
JMP Untitled_Garnish
.AddFireGarnish
INC $0E80, X : LDA $0E80, X : AND.b #$07 : BNE .return
LDA.b #$2A : JSL Sound_SetSfx2PanLong
LDA.b #$1D
; *$EBDE8 ALTERNATE ENTRY POINT
PHX : TXY
TAX : STA $00
.next_slot
LDA $7FF800, X : BEQ .free_slot
DEX : BPL .next_slot
DEC $0FF8 : BPL .use_search_index
LDA $00 : STA $0FF8
.use_search_index
LDX $0FF8
.free_slot
LDA.b #$10 : STA $7FF800, X : STA $0FB4
TYA : STA $7FF92C, X
LDA $0D10, Y : STA $7FF83C, X
LDA $0D30, Y : STA $7FF878, X
LDA $0D00, Y : CLC : ADC.b #$10 : STA $7FF81E, X
LDA $0D20, Y : ADC.b #$00 : STA $7FF85A, X
LDA.b #$7F : STA $7FF90E, X
STX $00
PLX
.return
RTS
}
AddIceGarnishV2:
{
INC $0E80, X : LDA $0E80, X : AND.b #$07 : BNE .return
LDA.b #$14 : JSL Sound_SetSfx3PanLong
LDA.b #$1D
; *$EBDE8 ALTERNATE ENTRY POINT
PHX : TXY
TAX : STA $00
.next_slot
LDA $7FF800, X : BEQ .free_slot
DEX : BPL .next_slot
DEC $0FF8 : BPL .use_search_index
LDA.b #$00 : STA $0FF8
.use_search_index
LDX $0FF8
.free_slot
LDA.b #$0C : STA $7FF800, X : STA $0FB4
TYA : STA $7FF92C, X
LDA $0D10, Y : STA $7FF83C, X
LDA $0D30, Y : STA $7FF878, X
LDA $0D00, Y : CLC : ADC.b #$10 : STA $7FF81E, X
LDA $0D20, Y : ADC.b #$00 : STA $7FF85A, X
LDA.b #$7F : STA $7FF90E, X
STX $00
PLX
.return
RTS
}
Sprite_Twinrova_IceAttack:
{
JSL Sprite_Move
JSR AddIceGarnishV2
JSR Untitled_Garnish
.return
RTS
}
; =========================================================
; Overwrite vanilla Trinexx ice garnish
; Plays like a simple ice cloud animation now.
pushpc
org $09B5DE
Garnish_PrepOamCoord:
org $09B70C
Garnish_SetOamPropsAndLargeSize:
org $09B459
Garnish_CheckPlayerCollision:
org $09B5D6
Garnish_SetOamPropsAndSmallSize:
org $09B33F
TrinexxIce_Pool:
{
.chr
db $2E
db $2E
db $2C
db $2C
.properties
db $35
db $35
db $35
db $35
}
org $09B34F
Garnish_TrinexxIce:
{
; special animation 0x0C
LDA $7FF90E, X : LSR #2 : AND.b #$03 : TAY
LDA TrinexxIce_Pool_properties, Y : STA $04
JSR Garnish_PrepOamCoord
LDA $00 : STA ($90), Y
LDA $02 : INY : STA ($90), Y
LDA $7FF90E, X : LSR #5 : PHX : TAX
LDA TrinexxIce_Pool_chr, X : INY : STA ($90), Y
LDA.b #$35 : ORA $04 : PLX
JMP Garnish_SetOamPropsAndLargeSize
}
warnpc $09B3B8
; Ice Garnish
org $0DB266+$CD
db $04
pullpc
; =========================================================
Sprite_Twinrova_Draw:
{
JSL Sprite_PrepOamCoord
JSL Sprite_OAM_AllocateDeferToPlayer
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
; Store Palette thing
LDA $0DA0, X : STA $08
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00
.nextTile
PHX ; Save current Tile Index?
TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset?
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.b #$F0 : STA ($90), Y ;Put the sprite out of the way
STA $0E
.on_screen_y
PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore)
INY
LDA .chr, X : STA ($90), Y
INY
; Set palette flash modifier
LDA .properties, X : ORA $08 : STA ($90), Y
PHY
TYA : LSR #2 : TAY
SEP #$20 ;set A back to 8bit but not X and Y
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY
PLX : DEX : BPL .nextTile
SEP #$30
PLX
RTS
; =========================================================
.start_index
db $00, $04, $08, $0C, $10, $14, $18, $1C, $22, $26, $2A, $2E
.nbr_of_tiles
db 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3
.x_offsets
dw -8, 8, 8, -8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -16, 0, 16, -16, 0, 16
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
dw -8, 8, -8, 8
.y_offsets
dw -8, -8, 8, 8
dw -7, -7, 9, 9
dw -8, -8, 8, 8
dw -8, -8, 8, 8
dw -8, -8, 8, 8
dw -7, -7, 9, 9
dw -6, -6, 10, 10
dw -8, -8, -8, 8, 8, 8
dw -8, -8, 8, 8
dw -8, -8, 8, 8
dw -8, -8, 8, 8
dw -7, -7, 9, 9
.chr
db $00, $02, $22, $24
db $04, $06, $24, $26
db $08, $0A, $28, $2A
db $0C, $0E, $28, $2A
db $44, $46, $64, $66
db $48, $4A, $68, $6A
db $4C, $4E, $6C, $6E
db $88, $8A, $8C, $A8, $AA, $AC
db $80, $82, $A0, $A2
db $84, $86, $A4, $A6
db $40, $42, $60, $62
db $40, $42, $60, $62
.properties
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
db $39, $39, $39, $39
.sizes
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, $02, $02, $02
db $02, $02, $02, $02
db $02, $02, $02, $02, $02, $00
db $02, $02, $02, $02
db $02, $02, $02, $02
db $02, $02, $02, $02
db $02, $02, $02, $02
}
ApplyTwinrovaGraphics:
{
PHX
REP #$20 ; A = 16, XY = 8
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
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
; "001 => 2 registers write once (2 bytes: p, p+1)"
LDA.w #TwinrovaGraphics : STA $4302 ; Source address where you want gfx from ROM
LDX.b #TwinrovaGraphics>>16 : STX $4304
LDA #$2000 : STA $4305 ; size of the transfer 4 sheets of $800 each
LDX #$01 : STX $420B ; Do the DMA
LDX #$0F : STX $2100 ;turn the screen back on
SEP #$30
PLX
RTS
TwinrovaGraphics:
incbin twinrova.bin
}

BIN
Sprites/Bosses/twinrova.bin Normal file

Binary file not shown.