Fix Farore sprite table bug, rearrange banks again

This commit is contained in:
scawful
2023-04-16 19:21:40 -05:00
parent 5021977b06
commit 590ff6883b
12 changed files with 110 additions and 27 deletions

View File

@@ -10,7 +10,7 @@ org $01CC18 ; override routine 0x39 "Holes(7)"
org $01CC5A org $01CC5A
HouseTag_Return: HouseTag_Return:
org $268000 org $2F8000
HouseTag: HouseTag:
{ {
PHX PHX

View File

@@ -9,7 +9,7 @@ org $00E19B
; ============================================================================== ; ==============================================================================
org $2F8000 org $3F8000
CheckForChangeGraphicsNormalLoad: CheckForChangeGraphicsNormalLoad:
{ {
JSL InitTilesets ;calls $00E19B that was replaced JSL InitTilesets ;calls $00E19B that was replaced

View File

@@ -29,7 +29,7 @@ JSL LinkItem_SecretsBook ; overwrite it (originally JSL $099F91)
; go to expanded space to write our routine ; go to expanded space to write our routine
; (keep EveryFrame.asm in mind for the right adresses) ; (keep EveryFrame.asm in mind for the right adresses)
; org $3CA600 ; org $3CA600
org $228000 org $2B8000
LinkItem_SecretsBook: LinkItem_SecretsBook:
{ {
LDA $1B ; load data that tells us whether we are in a building or not LDA $1B ; load data that tells us whether we are in a building or not

View File

@@ -138,7 +138,7 @@ org $07B085
; ============================================================================= ; =============================================================================
org $238000 org $2C8000
LinkItem_NewBottle: LinkItem_NewBottle:
{ {
; Check if we have a bottle or not ; Check if we have a bottle or not

View File

@@ -17,7 +17,7 @@ org $07AFF8
; ============================================================================= ; =============================================================================
org $218000 org $2A8000
NewBookCode: NewBookCode:
{ {
JSL $07983A ; Reset swim state JSL $07983A ; Reset swim state

View File

@@ -161,7 +161,6 @@ LinkItem_UsingQuake:
; ============================================================================= ; =============================================================================
org $318000 org $318000
;incsrc "link_handler.asm"
LinkItem_UsingDekuMask: LinkItem_UsingDekuMask:
{ {
SEP #$20 SEP #$20

View File

@@ -162,7 +162,7 @@ org $079781
; ============================================================================= ; =============================================================================
; 22E0E0 ; 22E0E0
org $208000 org $348000
FairyFlippers_E0E0: FairyFlippers_E0E0:
{ {
LDA $1B ; 1 if the player is in indoors and 0 otherwise. LDA $1B ; 1 if the player is in indoors and 0 otherwise.

View File

@@ -34,7 +34,7 @@ pullpc
; ============================================================================= ; =============================================================================
; Menu Bank ; Menu Bank
org $248000 org $2D8000
incsrc "menu_gfx_table.asm" incsrc "menu_gfx_table.asm"
incsrc "menu_text.asm" incsrc "menu_text.asm"
incsrc "menu_palette.asm" incsrc "menu_palette.asm"

View File

@@ -45,7 +45,7 @@ org $0DF14F
; ============================================================================== ; ==============================================================================
; New Code Region Starts Here ; New Code Region Starts Here
org $258000 org $2E8000
; ============================================================================== ; ==============================================================================
; Main HUD Update Loop ; Main HUD Update Loop

View File

@@ -14,26 +14,36 @@
; ;
; ;
; Expanded Banks Key: ; Expanded Banks Key:
; 20 - None ; 21 - N/A
; 21 - Jump Feather ; 22 - N/A
; 22 - Book of Secrets ; 23 - N/A
; 23 - Bottle Net ; 24 - N/A
; 24 - Menu ; 25 - N/A
; 25 - HUD ; 26 - N/A
; 26 - House Tag
; 27 - Mask Routines(?) ; 27 - Mask Routines(?)
; 28 - None ; 28 - None
; 29 - Custom Sprite Jump Table ; 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 ; 30 - Custom Sprite Functions
; 31 - Deku Link Code ; 31 - Deku Link Code
; 32 - Farore Sprite Code ; 32 - Farore Sprite Code
; 33 - None ; 33 - None
; 34 - None ; 34 - Zora Link Code
; 35 - Deku Link GFX ; 35 - Deku Link GFX
; 36 - Zora Link GFX ; 36 - Zora Link GFX
; 37 - Bunny Link GFX ; 37 - Bunny Link GFX
; 38 - Wolf Link GFX ; 38 - Wolf Link GFX
; 39 - Palette_ArmorAndGloves ; 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/ram.asm"
incsrc "Util/functions.asm" incsrc "Util/functions.asm"
incsrc "Sprites/farore_and_maku.asm" incsrc "Sprites/farore_and_maku.asm"
print "End of Sprites/farore_and_maku.asm", pc print "End of Sprites/farore_and_maku.asm", pc

View File

@@ -10,13 +10,14 @@ incsrc sprite_functions_hooks.asm
;============================================================================== ;==============================================================================
org $298000 org $298000
incsrc sprite_jump_table.asm incsrc sprite_new_table.asm
;============================================================================== ;==============================================================================
org $308000 org $308000
incsrc sprite_new_functions.asm incsrc sprite_new_functions.asm
;============================================================================== ;==============================================================================
; Sprite Properties ; Sprite Properties
;============================================================================== ;==============================================================================
@@ -29,7 +30,7 @@ incsrc sprite_new_functions.asm
!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 = 1 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 0 ; Unused in this template (can be 0 to 7) !Palette = 0 ; Unused in this template (can be 0 to 7)
!Hitbox = 0 ; 00 to 31, can be viewed in sprite draw tool !Hitbox = 0 ; 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
@@ -211,29 +212,24 @@ RTS
;============================================================================== ;==============================================================================
.start_index .start_index
db $00, $02, $04 db $00, $02
.nbr_of_tiles .nbr_of_tiles
db 1, 1, 1 db 1, 1
.x_offsets .x_offsets
dw 0, 0 dw 0, 0
dw 0, 0 dw 0, 0
dw 0, 0
.y_offsets .y_offsets
dw 4, -8 dw 4, -8
dw 4, -7 dw 4, -7
dw 4, -8
.chr .chr
db $AA, $A8 db $AA, $A8
db $AA, $A8 db $AA, $A8
db $AA, $A8
.properties .properties
db $3B, $3B db $3B, $3B
db $7B, $3B
db $3B, $3B db $3B, $3B
.sizes .sizes
db $02, $02 db $02, $02
db $02, $02 db $02, $02
db $02, $02
} }
;============================================================================== ;==============================================================================

View File

@@ -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