diff --git a/Events/lost_sea.asm b/Events/lost_sea.asm new file mode 100644 index 0000000..2fc6ae6 --- /dev/null +++ b/Events/lost_sea.asm @@ -0,0 +1,156 @@ +;=========================================================== +; Lost Sea Hack +; +; Area: 3A +; East Exit 3B (or 33) +; North Exit 32 +; South is 42 +; West is 39 +; combo is N (32),W (39),S (42),N (32) +;=========================================================== + + +Event_LostSeaCombo: +{ + lorom + org $A0F000 ; Note at this stage the accumulator contains area currently in, and X contains the area you're moving to. + + LOST_WOOD_HOOK: + { + CMP #$3A ; are we in the right area? + BEQ begincode + + normalfinish: + { + LDA $02A5EC,x ; not right area so return. + STZ $1CF7 + RTL + } ; label normalfinish + + begincode: + { + CPX #$3B + BEQ normalfinish + + ; from here onwards, use the ram address to determine which combo you're up to + ; this code is pretty repeatable + LDA $1CF7 + + CMP #$00 + BNE combo1 + CPX #$32 ; did you get it right? + BEQ UP_CORRECT + STZ $1CF7 + BRA RESOLVE_INCORRECT + } ; label begincode + + combo1: + { + CMP #$01 + BNE combo2 + CPX #$39 ; did you get it right? + BEQ LEFT_CORRECT + STZ $1CF7 + BRA RESOLVE_INCORRECT + } ; label comb1 + + + combo2: + { + CMP #$02 + BNE combo3 + CPX #$42 ; did you get it right? + BEQ DOWN_CORRECT + STZ $1CF7 + BRA RESOLVE_INCORRECT + } ; label comb2 + + + combo3: + { + CPX #$32; did you get it right? + BNE RESOLVE_INCORRECT ; we want to load the down area, since we complete the combos + LDA #$1B + STA $012F ; play fanfare + BRA normalfinish + RESOLVE_INCORRECT: + CPX #$39 + BEQ CASE_LEFT + CPX #$32 + BEQ CASE_UP + BRA CASE_DOWN + } ; label combo3 + + DOWN_CORRECT: + { + INC $1CF7 + CASE_DOWN: + DEC $21 + DEC $21 + DEC $E7 + DEC $E7 + DEC $E9 + DEC $E9 + DEC $611 + DEC $611 + DEC $613 + DEC $613 + LDA $700 + SEC + SBC #$10 + STA $700 + BRA all + } ; label DOWN_CORRECT + + + UP_CORRECT: + { + INC $1CF7 + CASE_UP: + INC $21 + INC $21 + INC $E7 + INC $E7 + INC $E9 + INC $E9 + INC $611 + INC $611 + INC $613 + INC $613 + LDA $700 + CLC + ADC #$10 + STA $700 + BRA all + } ; label UP_CORRECT + + + LEFT_CORRECT: + { + INC $1CF7 + CASE_LEFT: + INC $23 + INC $23 + INC $E1 + INC $E1 + INC $E3 + INC $E3 + INC $615 + INC $615 + INC $617 + INC $617 + INC $700 + INC $700 + } ; label LEFT_CORRECT + + all: + { + LDA #$3A ; load the same area. + RTL + } + + .end + ORG $02AA7D + JSL LOST_WOOD_HOOK + } ; label LOST_WOOD_HOOK +} ; label Event_LostSeaCombo diff --git a/Events/lostsea.asm b/Events/lostsea.asm deleted file mode 100644 index 04a3853..0000000 --- a/Events/lostsea.asm +++ /dev/null @@ -1,159 +0,0 @@ -;=========================================================== -; Lost Sea Hack -; -; Area: 3A -; East Exit 3B (or 33) -; North Exit 32 -; South is 42 -; West is 39 -; combo is N (32),W (39),S (42),N (32) -;=========================================================== - -namespace LostSea -{ - Main: - { - lorom - org $A0F000 ; Note at this stage the accumulator contains area currently in, and X contains the area you're moving to. - - LOST_WOOD_HOOK: - { - CMP #$3A ; are we in the right area? - BEQ begincode - - normalfinish: - { - LDA $02A5EC,x ; not right area so return. - STZ $1CF7 - RTL - } ; label normalfinish - - begincode: - { - CPX #$3B - BEQ normalfinish - - ; from here onwards, use the ram address to determine which combo you're up to - ; this code is pretty repeatable - LDA $1CF7 - - CMP #$00 - BNE combo1 - CPX #$32 ; did you get it right? - BEQ UP_CORRECT - STZ $1CF7 - BRA RESOLVE_INCORRECT - } ; label begincode - - combo1: - { - CMP #$01 - BNE combo2 - CPX #$39 ; did you get it right? - BEQ LEFT_CORRECT - STZ $1CF7 - BRA RESOLVE_INCORRECT - } ; label comb1 - - - combo2: - { - CMP #$02 - BNE combo3 - CPX #$42 ; did you get it right? - BEQ DOWN_CORRECT - STZ $1CF7 - BRA RESOLVE_INCORRECT - } ; label comb2 - - - combo3: - { - CPX #$32; did you get it right? - BNE RESOLVE_INCORRECT ; we want to load the down area, since we complete the combos - LDA #$1B - STA $012F ; play fanfare - BRA normalfinish - RESOLVE_INCORRECT: - CPX #$39 - BEQ CASE_LEFT - CPX #$32 - BEQ CASE_UP - BRA CASE_DOWN - } ; label combo3 - - DOWN_CORRECT: - { - INC $1CF7 - CASE_DOWN: - DEC $21 - DEC $21 - DEC $E7 - DEC $E7 - DEC $E9 - DEC $E9 - DEC $611 - DEC $611 - DEC $613 - DEC $613 - LDA $700 - SEC - SBC #$10 - STA $700 - BRA all - } ; label DOWN_CORRECT - - - UP_CORRECT: - { - INC $1CF7 - CASE_UP: - INC $21 - INC $21 - INC $E7 - INC $E7 - INC $E9 - INC $E9 - INC $611 - INC $611 - INC $613 - INC $613 - LDA $700 - CLC - ADC #$10 - STA $700 - BRA all - } ; label UP_CORRECT - - - LEFT_CORRECT: - { - INC $1CF7 - CASE_LEFT: - INC $23 - INC $23 - INC $E1 - INC $E1 - INC $E3 - INC $E3 - INC $615 - INC $615 - INC $617 - INC $617 - INC $700 - INC $700 - } ; label LEFT_CORRECT - - all: - { - LDA #$3A ; load the same area. - RTL - } - - .end - ORG $02AA7D - JSL LOST_WOOD_HOOK - } ; label LOST_WOOD_HOOK - } ; label Main -} ; namespace LostSea -namespace off \ No newline at end of file diff --git a/Items/ice_rod.asm b/Items/ice_rod.asm index 830e7bb..2847e8f 100644 --- a/Items/ice_rod.asm +++ b/Items/ice_rod.asm @@ -4,162 +4,159 @@ ; ;=========================================================== -namespace IceRod + +LinkItem_IceRod: { - Main: - { - lorom + lorom - org $088a5d ; jsl to main code - jsl $0efba0 + org $088a5d ; jsl to main code + jsl $0efba0 - org $0efba0 ; main code - STA $03E4,x ; load native value - TAY - LDA $008C ; check if you're on overworld - BNE $01 - RTL - LDA $03A3 ; disable other flying object icing water (boomerang, sword beam) - CMP #$06 - BEQ $01 - RTL - CPX #$04 ; check if ice shot #1 only is used (disable 2nd shot to ice) - BEQ $01 - RTL - LDA $03E8 ; check if ice shot is on water tiles - CMP #$08 - BEQ $08 - LDA $03E8 ; check if ice shot is on native unused, edited blocks - CMP #$03 - BEQ $01 - RTL - LDA $0303 ; double check if really ice shot is used - CMP #$06 - BEQ $01 - RTL - LDA $0304 - CMP #$06 - BEQ $01 - RTL - TXA - STA $7ED004 ; store native x value into ram to regain after code - LDA $4212 ; wait for vblank to enable dma transfer - AND #$80 - BEQ $F9 - REP #$30 - LDA $2116 - STA $7ED005 ; store native value to regain later - LDA $00 ; calculation procedure to get correct x,y coordinates for new tile - SEC - SBC $0708 - AND $070A - ASL A - ASL A - ASL A - STA $06 - LDA $02 - SEC - SBC $070C - AND $070E - ORA $06 - TAX - LDA #$00B7 - STA $7E2000,x ; store new 16x16 ice tile into ram (property of tile!) - CLC - STZ $02 ; calculation procedure to get 8x8 vram map address (look of tile) - TXA - AND #$003F - CMP #$0020 - BCC $05 - LDA #$0400 - STA $02 - TXA - AND #$0FFF - CMP #$0800 - BCC $07 - LDA $02 - ADC #$07FF - STA $02 - TXA - AND #$001F - ADC $02 - STA $02 - TXA - AND #$0780 - LSR A - ADC $02 - STA $2116 ; store vram address for upper tile part (8x16) to $2116 - STA $7ED007 - LDA #$1D83 ; load new ice tiles - STA $7ED000 - STA $7ED002 - JSR $FD00 ; jsr to dma vram transfer for upper ice tile part - REP #$30 - LDA $7ED007 ; regain vram address - ADC #$0020 ; add 20 for lower part (8x16) and store to $2116 - STA $2116 - JSR $FD00 ; jsr to dma vram transfer for lower ice tile part - LDA $7ED005 ; regain native register value - STA $2116 - SEP #$30 - LDA $7ED004 ; regain native x-value - TAX - RTL + org $0efba0 ; main code + STA $03E4,x ; load native value + TAY + LDA $008C ; check if you're on overworld + BNE $01 + RTL + LDA $03A3 ; disable other flying object icing water (boomerang, sword beam) + CMP #$06 + BEQ $01 + RTL + CPX #$04 ; check if ice shot #1 only is used (disable 2nd shot to ice) + BEQ $01 + RTL + LDA $03E8 ; check if ice shot is on water tiles + CMP #$08 + BEQ $08 + LDA $03E8 ; check if ice shot is on native unused, edited blocks + CMP #$03 + BEQ $01 + RTL + LDA $0303 ; double check if really ice shot is used + CMP #$06 + BEQ $01 + RTL + LDA $0304 + CMP #$06 + BEQ $01 + RTL + TXA + STA $7ED004 ; store native x value into ram to regain after code + LDA $4212 ; wait for vblank to enable dma transfer + AND #$80 + BEQ $F9 + REP #$30 + LDA $2116 + STA $7ED005 ; store native value to regain later + LDA $00 ; calculation procedure to get correct x,y coordinates for new tile + SEC + SBC $0708 + AND $070A + ASL A + ASL A + ASL A + STA $06 + LDA $02 + SEC + SBC $070C + AND $070E + ORA $06 + TAX + LDA #$00B7 + STA $7E2000,x ; store new 16x16 ice tile into ram (property of tile!) + CLC + STZ $02 ; calculation procedure to get 8x8 vram map address (look of tile) + TXA + AND #$003F + CMP #$0020 + BCC $05 + LDA #$0400 + STA $02 + TXA + AND #$0FFF + CMP #$0800 + BCC $07 + LDA $02 + ADC #$07FF + STA $02 + TXA + AND #$001F + ADC $02 + STA $02 + TXA + AND #$0780 + LSR A + ADC $02 + STA $2116 ; store vram address for upper tile part (8x16) to $2116 + STA $7ED007 + LDA #$1D83 ; load new ice tiles + STA $7ED000 + STA $7ED002 + JSR $FD00 ; jsr to dma vram transfer for upper ice tile part + REP #$30 + LDA $7ED007 ; regain vram address + ADC #$0020 ; add 20 for lower part (8x16) and store to $2116 + STA $2116 + JSR $FD00 ; jsr to dma vram transfer for lower ice tile part + LDA $7ED005 ; regain native register value + STA $2116 + SEP #$30 + LDA $7ED004 ; regain native x-value + TAX + RTL - org $0efd00 ; vram dma transfer - LDA #$007E ; load origin of bytes to transfer (7E/d000) - STA $4304 - LDA #$D000 - STA $4302 - SEP #$30 - LDA #$18 ; bus - STA $4301 - LDA #$04 ; transfer 4 bytes - STA $4305 - LDA #$01 - STA $4300 - STA $420B ; make dma transfer - RTS + org $0efd00 ; vram dma transfer + LDA #$007E ; load origin of bytes to transfer (7E/d000) + STA $4304 + LDA #$D000 + STA $4302 + SEP #$30 + LDA #$18 ; bus + STA $4301 + LDA #$04 ; transfer 4 bytes + STA $4305 + LDA #$01 + STA $4300 + STA $420B ; make dma transfer + RTS - ; bug fix to not swim through tiles but jump onto them + ; bug fix to not swim through tiles but jump onto them - org $07dc9e - jsl $0efc80 - nop + org $07dc9e + jsl $0efc80 + nop - org $0efc80 - LDA $0A - TSB $0343 - TSB $0348 - RTL + org $0efc80 + LDA $0A + TSB $0343 + TSB $0348 + RTL - ; bug fix to stop gliding on shallow water when leaving ice tile + ; bug fix to stop gliding on shallow water when leaving ice tile - org $07dd1b - jsl $0efc90 - nop + org $07dd1b + jsl $0efc90 + nop - org $0efc90 - LDA $0A - TSB $0359 - LDA $0350 - CMP #$0100 - BNE $03 - STZ $034A - RTL + org $0efc90 + LDA $0A + TSB $0359 + LDA $0350 + CMP #$0100 + BNE $03 + STZ $034A + RTL - org $0e95dc ; get a 0e written here (first byte) to enable gliding on new tiles - ASL $5757 + org $0e95dc ; get a 0e written here (first byte) to enable gliding on new tiles + ASL $5757 - org $0f85b8 ; get new tile values (83 1d) written 4 times here - STA $1D,s - STA $1D,s - STA $1D,s - STA $1D,s - } -} ; namespace IceRod -namespace off \ No newline at end of file + org $0f85b8 ; get new tile values (83 1d) written 4 times here + STA $1D,s + STA $1D,s + STA $1D,s + STA $1D,s +} diff --git a/Oracle_main.asm b/Oracle_main.asm index 2140b9b..052d76b 100644 --- a/Oracle_main.asm +++ b/Oracle_main.asm @@ -56,71 +56,87 @@ namespace Oracle incsrc "Util/ram.asm" incsrc "Util/functions.asm" + ; --------------------------------------------------------- + ; Sprites + incsrc "Sprites/farore_and_maku.asm" - print "End of Sprites/farore_and_maku.asm", pc + print "End of farore_and_maku.asm ", pc + + incsrc "Sprites/Kydrog/kydrog.asm" + print "End of kydrog.asm ", pc ; --------------------------------------------------------- + ; Transformation Masks + + incsrc "Masks/mask_routines.asm" + + incsrc "Masks/deku_mask.asm" + print "End of Masks/deku_mask.asm ", pc + + incsrc "Masks/zora_mask.asm" + print "End of Masks/zora_mask.asm ", pc + + incsrc "Masks/wolf_mask.asm" + print "End of Masks/wolf_mask.asm ", pc + + incsrc "Masks/bunny_hood.asm" + print "End of Masks/bunny_hood.asm ", pc + + + ; --------------------------------------------------------- + ; Items + incsrc "Items/jump_feather.asm" print "End of Items/jump_feather.asm ", pc - ; --------------------------------------------------------- - incsrc "Graphics/boat_gfx.asm" - print "End of Graphics/boat_gfx.asm ", pc - - ; --------------------------------------------------------- - incsrc "Dungeons/keyblock.asm" - print "End of Dungeons/keyblock.asm ", pc - - ; --------------------------------------------------------- - incsrc "Events/house_tag.asm" - print "End of Events/house_tag.asm ", pc - - ; --------------------------------------------------------- - incsrc "Menu/menu.asm" - print "End of Menu/menu.asm ", pc - - ; --------------------------------------------------------- - ; incsrc "Items/bottle_net.asm" - ; print "End of Items/bottle_net.asm ", pc - - ; --------------------------------------------------------- - incsrc "Events/maku_tree.asm" - print "End of Events/maku_tree.asm ", pc - - ; --------------------------------------------------------- - incsrc "Events/lostsea.asm" - print "End of Events/lostsea.asm ", pc - - ; --------------------------------------------------------- incsrc "Items/ice_rod.asm" print "End of Items/ice_rod.asm ", pc - ; --------------------------------------------------------- incsrc "Items/book_of_secrets.asm" print "End of Items/book_of_secrets.asm ", pc + ; incsrc "Items/bottle_net.asm" + ; print "End of Items/bottle_net.asm ", pc + + + ; --------------------------------------------------------- + ; Events + + incsrc "Events/house_tag.asm" + print "End of Events/house_tag.asm ", pc + + incsrc "Events/lost_sea.asm" + print "End of Events/lost_sea.asm ", pc + + + ; --------------------------------------------------------- + ; Graphics + + incsrc "Graphics/boat_gfx.asm" + print "End of Graphics/boat_gfx.asm ", pc + + incsrc "Events/maku_tree.asm" + print "End of Events/maku_tree.asm ", pc + + + ; --------------------------------------------------------- + ; Dungeon + + incsrc "Dungeons/keyblock.asm" + print "End of Dungeons/keyblock.asm ", pc + + + ; --------------------------------------------------------- + ; Custom Menu and HUD + + incsrc "Menu/menu.asm" + print "End of Menu/menu.asm ", pc + + ; --------------------------------------------------------- incsrc "Debug/debug.asm" print "End of Debug/debug.asm ", pc - ; --------------------------------------------------------- - incsrc "Masks/mask_routines.asm" - - ; --------------------------------------------------------- - incsrc "Masks/deku_mask.asm" - print "End of Masks/deku_mask.asm ", pc - - ; --------------------------------------------------------- - incsrc "Masks/zora_mask.asm" - print "End of Masks/zora_mask.asm ", pc - - ; --------------------------------------------------------- - incsrc "Masks/wolf_mask.asm" - print "End of Masks/wolf_mask.asm ", pc - - ; --------------------------------------------------------- - incsrc "Masks/bunny_hood.asm" - print "End of Masks/bunny_hood.asm ", pc print "" print "Finished applying patches" diff --git a/Sprites/farore_and_maku.asm b/Sprites/farore_and_maku.asm index 574d6bb..a711422 100644 --- a/Sprites/farore_and_maku.asm +++ b/Sprites/farore_and_maku.asm @@ -51,185 +51,227 @@ incsrc sprite_new_functions.asm ;============================================================================== -; TODO: Setup Sprite Properties for Farore %Set_Sprite_Properties(Sprite_Farore_Prep, Sprite_Farore_Long) ;============================================================================== Sprite_Farore_Long: -PHB : PHK : PLB +{ + PHB : PHK : PLB -JSR Sprite_Farore_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_Farore_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_Farore_Main ; Call the main sprite code + JSR Sprite_Farore_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_Farore_Prep: -PHB : PHK : PLB - -; LDA.l $7EF300 -; BEQ .PlayIntro -; STZ.w $0DD0, X ; Kill the sprite -; .PlayIntro - -PLB -RTL +{ + PHB : PHK : PLB + + ; LDA.l $7EF300 + ; BEQ .PlayIntro + ; STZ.w $0DD0, X ; Kill the sprite + ; .PlayIntro + PLB + RTL +} ;============================================================================== +; Movement key bitwise ---- udlr + Sprite_Farore_Main: -LDA.w SprAction, X; Load the SprAction -JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in -dw IntroStart -dw MoveUp -dw MoveLeft -dw WaitAndMessage - - -IntroStart: { - RTS + LDA.w SprAction, X; Load the SprAction + JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in + + dw IntroStart + dw MoveUpTowardsFarore + dw MoveLeftTowardsFarore + dw WaitAndMessage + dw FaroreFollowPlayer + + + IntroStart: + { + %GotoAction(1) + RTS + } + + MoveUpTowardsFarore: + { + LDA.b #$08 : STA.b $49 ; Auto-movement north + + LDA.b $20 ; Link's Y Position + CMP.b #$6C ; Y = 6C + BCC .linkistoofar + + %GotoAction(2) + + .linkistoofar + RTS + } + + MoveLeftTowardsFarore: + { + ; Move Link Left + LDA.b #$02 : STA.b $49 + + LDA.b $22 ; Link's X position + CMP.b #$1E + BCS .linkistoofar + + STZ.b $49 ; kill automove + LDA.b #$20 + STA.w SprTimerA, X ; set timer A to 0x10 + + %GotoAction(3) + + .linkistoofar + RTS + } + + + WaitAndMessage: + { + %PlayAnimation(2, 3, 8) + %MoveTowardPlayer(15) + LDA.w SprTimerA, X : BNE + + %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) + + + RTS + } + + ; you could just squeeze it between link and the 1st follower + ; 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: + { + %PlayAnimation(2, 3, 8) + %MoveTowardPlayer(10) + RTS + } } - -MoveUp: -{ - LDA #$01 ; make link move up - STA $49 - - LDA $30 ; Link's Y Position - CMP #$C6 - BCC .linkistoofarleft - ; Here link reached the X position we want - ; goto next action - %GotoAction(2) - -.linkistoofarleft - - RTS -} - - -MoveLeft: -{ - LDA.b #$04 ; make link move left - STA.b $49 - - LDA.b $20 ; Link's Y Position - CMP.b #$88 - BCC .linkistoofarup - - ; Here link reached the X position we want - ; goto next action - - STZ.b $49 ; kill automove - LDA.b #$20 - STA.w SprTimerA, X ; set timer A to 0x10 - %GotoAction(3) - -.linkistoofarup - RTS -} - - -WaitAndMessage: -{ - LDA.w SprTimerA, X : BNE + - %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 - ; could goto next action too instead -+ - RTS -} - ;============================================================================== Sprite_Farore_Draw: { -JSL Sprite_PrepOamCoord -JSL Sprite_OAM_AllocateDeferToPlayer + JSL Sprite_PrepOamCoord + JSL Sprite_OAM_AllocateDeferToPlayer -LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame -LDA .start_index, Y : STA $06 + 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 + 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 + PHX ; Save current Tile Index? + + 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 + 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 + 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 + 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 + 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 + PLX -RTS + RTS ;============================================================================== .start_index -db $00, $02 + db $00, $02, $04, $06 .nbr_of_tiles -db 1, 1 + db 1, 1, 1, 1 .x_offsets -dw 0, 0 -dw 0, 0 + dw 0, 0 + dw 0, 0 + dw 0, 0 + dw 0, 0 .y_offsets -dw 4, -8 -dw 4, -7 + dw 4, -8 + dw 4, -7 + dw 4, -8 + dw 4, -7 .chr -db $AA, $A8 -db $AA, $A8 + db $AA, $A8 + db $AA, $A8 + db $88, $A8 + db $88, $A8 .properties -db $3B, $3B -db $3B, $3B + db $3B, $3B + db $3B, $3B + db $3B, $3B + db $7B, $3B .sizes -db $02, $02 -db $02, $02 + db $02, $02 + db $02, $02 + db $02, $02 + db $02, $02 } ;==============================================================================