Add flag to make the baserom work

This commit is contained in:
2025-12-12 21:33:08 -06:00
parent 4f0703ea62
commit 18a73e3b88
5 changed files with 39 additions and 31 deletions

View File

@@ -50,6 +50,7 @@ dw !ROM_VERSION_HIGH
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0)) function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
; Feature flags, run asar with -DFEATURE_X=1 to enable ; Feature flags, run asar with -DFEATURE_X=1 to enable
!FEATURE_FIX_BASEROM ?= 0
;================================================================================ ;================================================================================

View File

@@ -61,7 +61,3 @@ LDA.b [Scrap00],Y
org $89C416 org $89C416
LDA.b [Scrap00],Y LDA.b [Scrap00],Y

View File

@@ -1,7 +1,12 @@
LoadUnderworldSprites: LoadUnderworldSprites:
STA.b Scrap00 ; part one of what we replaced STA.b Scrap00 ; part one of what we replaced
LDA.w #UWSpritesData>>16 : STA.b Scrap02 ; set the bank to 28 for now if !FEATURE_FIX_BASEROM
LDA.w $048E LDA.w #$89
else
LDA.w #UWSpritesData>>16 ; set the bank to 28 for now
endif
STA.b Scrap02
LDA.w $048E
RTL RTL
GetSpriteSlot16Bit: GetSpriteSlot16Bit:
@@ -11,37 +16,37 @@ GetSpriteSlot16Bit:
RTL RTL
GeldmanDrawOverride: GeldmanDrawOverride:
PLA : PLA : PLA ; fix the call stack PLA : PLA : PLA ; fix the call stack
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
LDA.b #$01 LDA.b #$01
STA.w $0DC0,X STA.w $0DC0,X
JML Sprite_4C_Geldman_do_indeed_draw JML Sprite_4C_Geldman_do_indeed_draw
.vanilla .vanilla
JSL Sprite_PrepOAMCoordLong JSL Sprite_PrepOAMCoordLong
JML Sprite_4C_Geldman_continue JML Sprite_4C_Geldman_continue
StalfosKnightDrawOverride: StalfosKnightDrawOverride:
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
JSL Sprite_PrepOAMCoordLong JSL Sprite_PrepOAMCoordLong
LDA.b #$12 LDA.b #$12
JML Sprite_DrawShadowLong JML Sprite_DrawShadowLong
.vanilla .vanilla
JSL Sprite_PrepOAMCoordLong JSL Sprite_PrepOAMCoordLong
RTL RTL
BlobDrawOverride: BlobDrawOverride:
PLA : PLA : PLA ; fix the call stack PLA : PLA : PLA ; fix the call stack
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
LDA.b #$05 LDA.b #$05
STA.w $0DC0,X STA.w $0DC0,X
JML SpriteDraw_Blob_head_popping_out JML SpriteDraw_Blob_head_popping_out
.vanilla .vanilla
JSL Sprite_PrepOAMCoordLong JSL Sprite_PrepOAMCoordLong
JML SpriteDraw_Blob_bad_gfx JML SpriteDraw_Blob_bad_gfx

View File

@@ -2729,8 +2729,10 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Enable new room header table ; Enable new room header table
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81B5E6 if not(!FEATURE_FIX_BASEROM)
LDA.b #$30 org $81B5E6
LDA.b #$30
endif
;================================================================================ ;================================================================================
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -91,7 +91,11 @@ InitializeMirrorHDMA:
org $89D62E org $89D62E
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
org $89D87E if !FEATURE_FIX_BASEROM
org $81DB67
else
org $89D87E
endif
UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
org $89DACE org $89DACE
@@ -188,7 +192,7 @@ RevealPotItem:
LDA.b RoomIndex : ASL : TAX LDA.b RoomIndex : ASL : TAX
LDA.l UWPotsPointers,X : STA.b Scrap00 ; we may move this LDA.l UWPotsPointers, X : STA.b Scrap00 ; we may move this
LDA.w #UWPotsPointers>>16 : STA.b Scrap02 LDA.w #UWPotsPointers>>16 : STA.b Scrap02
LDY.w #$FFFD : LDX.w #$FFFF LDY.w #$FFFD : LDX.w #$FFFF
@@ -869,7 +873,7 @@ CheckIfPotIsSpecial:
BIT.b $BF : BVC .upper ; if $BF has bit 14 set, it's upper layer BIT.b $BF : BVC .upper ; if $BF has bit 14 set, it's upper layer
ORA.w #$2000 ; set the lower layer bit ($2000) ORA.w #$2000 ; set the lower layer bit ($2000)
.upper .upper
STA.b $90 ; cache tilemap offset STA.b $90 ; cache tilemap offset
LDA.l UWPotsPointers,X : TAX LDA.l UWPotsPointers,X : TAX
LDY.w #$0000 LDY.w #$0000