From 590ff6883ba51c578f573593190044d1796c2d7c Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 16 Apr 2023 19:21:40 -0500 Subject: [PATCH] Fix Farore sprite table bug, rearrange banks again --- Events/house_tag.asm | 2 +- Graphics/boat_gfx.asm | 2 +- Items/book_of_secrets.asm | 2 +- Items/bottle_net.asm | 2 +- Items/jump_feather.asm | 2 +- Masks/deku_mask.asm | 1 - Masks/zora_mask.asm | 2 +- Menu/menu.asm | 2 +- Menu/menu_hud.asm | 2 +- Oracle_main.asm | 27 ++++++++---- Sprites/farore_and_maku.asm | 14 +++---- Sprites/sprite_new_table.asm | 79 ++++++++++++++++++++++++++++++++++++ 12 files changed, 110 insertions(+), 27 deletions(-) create mode 100644 Sprites/sprite_new_table.asm diff --git a/Events/house_tag.asm b/Events/house_tag.asm index 489f1fe..3655c3c 100644 --- a/Events/house_tag.asm +++ b/Events/house_tag.asm @@ -10,7 +10,7 @@ org $01CC18 ; override routine 0x39 "Holes(7)" org $01CC5A HouseTag_Return: -org $268000 +org $2F8000 HouseTag: { PHX diff --git a/Graphics/boat_gfx.asm b/Graphics/boat_gfx.asm index 39b53d1..c01c008 100644 --- a/Graphics/boat_gfx.asm +++ b/Graphics/boat_gfx.asm @@ -9,7 +9,7 @@ org $00E19B ; ============================================================================== -org $2F8000 +org $3F8000 CheckForChangeGraphicsNormalLoad: { JSL InitTilesets ;calls $00E19B that was replaced diff --git a/Items/book_of_secrets.asm b/Items/book_of_secrets.asm index b4ec51f..38c8162 100644 --- a/Items/book_of_secrets.asm +++ b/Items/book_of_secrets.asm @@ -29,7 +29,7 @@ JSL LinkItem_SecretsBook ; overwrite it (originally JSL $099F91) ; go to expanded space to write our routine ; (keep EveryFrame.asm in mind for the right adresses) ; org $3CA600 -org $228000 +org $2B8000 LinkItem_SecretsBook: { LDA $1B ; load data that tells us whether we are in a building or not diff --git a/Items/bottle_net.asm b/Items/bottle_net.asm index 4f4fff6..fd858c0 100644 --- a/Items/bottle_net.asm +++ b/Items/bottle_net.asm @@ -138,7 +138,7 @@ org $07B085 ; ============================================================================= -org $238000 +org $2C8000 LinkItem_NewBottle: { ; Check if we have a bottle or not diff --git a/Items/jump_feather.asm b/Items/jump_feather.asm index ff68f8d..57a59f7 100644 --- a/Items/jump_feather.asm +++ b/Items/jump_feather.asm @@ -17,7 +17,7 @@ org $07AFF8 ; ============================================================================= -org $218000 +org $2A8000 NewBookCode: { JSL $07983A ; Reset swim state diff --git a/Masks/deku_mask.asm b/Masks/deku_mask.asm index f0caa32..4b871a11 100644 --- a/Masks/deku_mask.asm +++ b/Masks/deku_mask.asm @@ -161,7 +161,6 @@ LinkItem_UsingQuake: ; ============================================================================= org $318000 -;incsrc "link_handler.asm" LinkItem_UsingDekuMask: { SEP #$20 diff --git a/Masks/zora_mask.asm b/Masks/zora_mask.asm index 4e76f9d..b81105c 100644 --- a/Masks/zora_mask.asm +++ b/Masks/zora_mask.asm @@ -162,7 +162,7 @@ org $079781 ; ============================================================================= ; 22E0E0 -org $208000 +org $348000 FairyFlippers_E0E0: { LDA $1B ; 1 if the player is in indoors and 0 otherwise. diff --git a/Menu/menu.asm b/Menu/menu.asm index d4c2357..d1235e4 100644 --- a/Menu/menu.asm +++ b/Menu/menu.asm @@ -34,7 +34,7 @@ pullpc ; ============================================================================= ; Menu Bank -org $248000 +org $2D8000 incsrc "menu_gfx_table.asm" incsrc "menu_text.asm" incsrc "menu_palette.asm" diff --git a/Menu/menu_hud.asm b/Menu/menu_hud.asm index fb69ff9..e29fd96 100644 --- a/Menu/menu_hud.asm +++ b/Menu/menu_hud.asm @@ -45,7 +45,7 @@ org $0DF14F ; ============================================================================== ; New Code Region Starts Here -org $258000 +org $2E8000 ; ============================================================================== ; Main HUD Update Loop diff --git a/Oracle_main.asm b/Oracle_main.asm index ad5f39d..2140b9b 100644 --- a/Oracle_main.asm +++ b/Oracle_main.asm @@ -14,26 +14,36 @@ ; ; ; Expanded Banks Key: -; 20 - None -; 21 - Jump Feather -; 22 - Book of Secrets -; 23 - Bottle Net -; 24 - Menu -; 25 - HUD -; 26 - House Tag +; 21 - N/A +; 22 - N/A +; 23 - N/A +; 24 - N/A +; 25 - N/A +; 26 - N/A ; 27 - Mask Routines(?) ; 28 - None ; 29 - Custom Sprite Jump Table +; 2A - Jump Feather +; 2B - Book of Secrets +; 2C - Bottle Net +; 2D - Menu +; 2E - HUD +; 2F - House Tag ; 30 - Custom Sprite Functions ; 31 - Deku Link Code ; 32 - Farore Sprite Code ; 33 - None -; 34 - None +; 34 - Zora Link Code ; 35 - Deku Link GFX ; 36 - Zora Link GFX ; 37 - Bunny Link GFX ; 38 - Wolf Link GFX ; 39 - Palette_ArmorAndGloves +; 3A - None +; 3B - None +; 3C - None +; 3D - None +; 3F - Boat GFX ; ;=========================================================== @@ -46,7 +56,6 @@ namespace Oracle incsrc "Util/ram.asm" incsrc "Util/functions.asm" - incsrc "Sprites/farore_and_maku.asm" print "End of Sprites/farore_and_maku.asm", pc diff --git a/Sprites/farore_and_maku.asm b/Sprites/farore_and_maku.asm index 25dc2fc..574d6bb 100644 --- a/Sprites/farore_and_maku.asm +++ b/Sprites/farore_and_maku.asm @@ -10,13 +10,14 @@ incsrc sprite_functions_hooks.asm ;============================================================================== org $298000 -incsrc sprite_jump_table.asm +incsrc sprite_new_table.asm ;============================================================================== org $308000 incsrc sprite_new_functions.asm + ;============================================================================== ; Sprite Properties ;============================================================================== @@ -29,7 +30,7 @@ incsrc sprite_new_functions.asm !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 +!Shadow = 1 ; 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 @@ -211,29 +212,24 @@ RTS ;============================================================================== .start_index -db $00, $02, $04 +db $00, $02 .nbr_of_tiles -db 1, 1, 1 +db 1, 1 .x_offsets dw 0, 0 dw 0, 0 -dw 0, 0 .y_offsets dw 4, -8 dw 4, -7 -dw 4, -8 .chr db $AA, $A8 db $AA, $A8 -db $AA, $A8 .properties db $3B, $3B -db $7B, $3B db $3B, $3B .sizes db $02, $02 db $02, $02 -db $02, $02 } ;============================================================================== diff --git a/Sprites/sprite_new_table.asm b/Sprites/sprite_new_table.asm new file mode 100644 index 0000000..9531543 --- /dev/null +++ b/Sprites/sprite_new_table.asm @@ -0,0 +1,79 @@ +pushpc +org $06FFF8 ; New Jumptable for sprites +NewMainSprFunction: +JSL SpriteActiveExp_MainLong +RTS + +org $068EB9 +NewSprPrepFunction: +JSL Sprite_PrepExp_Long +RTS +pullpc + + + +SpriteActiveExp_MainLong: +{ +PHB : PHK : PLB + +JSL NewSprTable + +PLB + +RTL +} + +NewSprTable: +LDA $0E20, X ; Load Sprite ID +REP #$30 +AND.w #$00FF +STA $06 +ASL A ; *2 +CLC : ADC $06 ; *3 +TAY + +LDA NewSprRoutinesLong, Y ; Load sprite Address +STA $06 +SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash) +LDA NewSprRoutinesLong+2, Y +STA $08 +SEP #$30 +JMP [$0006] + +;do a JML and sprite will RTL back to previous code + +Sprite_PrepExp_Long: +{ +PHB : PHK : PLB + +JSL NewSprPrepTable + +PLB + +RTL +} + +NewSprPrepTable: +LDA $0E20, X ; Load Sprite ID +REP #$30 +AND.w #$00FF +STA $06 +ASL A ; *2 +CLC : ADC $06 ; *3 +TAY + +LDA NewSprPrepRoutinesLong, Y ; Load sprite Address +STA $06 +SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash) +LDA NewSprPrepRoutinesLong+2, Y +STA $08 +SEP #$30 +JMP [$0006] + +NewSprRoutinesLong: +fillbyte $00 +fill $2FD + +NewSprPrepRoutinesLong: +fillbyte $00 +fill $2FD