Small fixes

This commit is contained in:
cassidoxa
2023-08-08 01:00:49 -04:00
parent 39ac6c301a
commit 56cb17a0a3
15 changed files with 73 additions and 98 deletions

View File

@@ -88,21 +88,19 @@ OnAga2Defeated:
JML.l IncrementAgahnim2Sword JML.l IncrementAgahnim2Sword
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnFileCreation: OnFileCreation:
; Copy initial SRAM state from ROM to cart SRAM
; If the inital SRAM table is move these addresses must be changed
PHB PHB
LDA.w #$03D7 ; \ LDA.w #$03D7
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name LDX.w #$B000
LDY.w #$0000 ; | (exclusively) LDY.w #$0000
MVN !SRAMBank, !SRAMTableBank ; / MVN CartridgeSRAM>>16, InitSRAMTable>>16
; Skip file name and validity value ; Skip file name and validity value
LDA.w #$010C ; \ LDA.w #$010C
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block LDX.w #$B3E3
LDY.w #$03E3 ; | LDY.w #$03E3
MVN !SRAMBank, !SRAMTableBank ; / MVN CartridgeSRAM>>16, InitSRAMTable>>16
PLB PLB
; resolve instant post-aga if standard ; Resolve instant post-aga if standard
SEP #$20 SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ + LDA.l InitProgressIndicator : BIT #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
@@ -110,9 +108,9 @@ OnFileCreation:
+ +
REP #$20 REP #$20
; Set validity value and do some cleanup. Jump to checksum. ; Set validity value and do some cleanup. Jump to checksum done.
LDA.w #$55AA : STA.l FileValiditySRAM LDA.w #$55AA : STA.l FileValiditySRAM
JSL.l WriteSaveChecksumAndBackup_from_sram JSL.l WriteSaveChecksumAndBackup
STZ.b Scrap00 STZ.b Scrap00
STZ.b Scrap01 STZ.b Scrap01

View File

@@ -886,7 +886,7 @@ org $80D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL GetAnimatedSpriteBufferPointer : NOP JSL GetAnimatedSpriteBufferPointer : NOP
org $8799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem) org $8799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL AddReceivedItemLong JSL AddReceivedItemExpanded
org $898611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X) org $898611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X)
LDA.w ItemReceipts_target+0, X LDA.w ItemReceipts_target+0, X
@@ -2450,33 +2450,18 @@ JSL FixJingleGlitch
; Text Renderer ; Text Renderer
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
if !FEATURE_NEW_TEXT if !FEATURE_NEW_TEXT
org $8EF51B org $8EF51B : JML RenderCharExtended
JML RenderCharExtended org $8EF520 : RenderCharExtended_returnOriginal:
org $8EF520 org $8EF567 : RenderCharExtended_returnUncompressed:
RenderCharExtended_returnOriginal: org $8EF356 : JSL RenderCharLookupWidth
org $8EF567 org $8EF3BA : JSL RenderCharLookupWidth
RenderCharExtended_returnUncompressed: org $8EF48E : JML RenderCharLookupWidthDraw
org $8EF499 : RenderCharLookupWidthDraw_return:
org $8EF356 org $8EF6AA : JML RenderCharToMapExtended
JSL RenderCharLookupWidth org $8EF6C2 : RenderCharToMapExtended_return:
org $8EF3BA org $8EFA50 : JSL RenderCharSetColorExtended
JSL RenderCharLookupWidth org $8EEE5D : JSL RenderCharSetColorExtended_init
org $8EF48E org $8EF285 : JSL RenderCharSetColorExtended_close : NOP
JML RenderCharLookupWidthDraw
org $8EF499
RenderCharLookupWidthDraw_return:
org $8EF6AA
JML RenderCharToMapExtended
org $8EF6C2
RenderCharToMapExtended_return:
org $8EFA50
JSL RenderCharSetColorExtended
org $8EEE5D
JSL RenderCharSetColorExtended_init
org $8EF285
JSL RenderCharSetColorExtended_close : NOP
endif endif
;================================================================================ ;================================================================================

View File

@@ -142,6 +142,7 @@ AddInventory:
PHA : PHX : PHY : PHP : PHB PHA : PHX : PHY : PHP : PHB
PHK : PLB PHK : PLB
LDA.l StatsLocked : BNE .done LDA.l StatsLocked : BNE .done
LDA.w InventoryTable_properties,Y : BIT #$01 : BEQ .done
JSR.w ShopCheck : BCS .done JSR.w ShopCheck : BCS .done
JSR.w DungeonIncrement : BCS .done JSR.w DungeonIncrement : BCS .done
LDA.b #$7E : STA.b Scrap0D LDA.b #$7E : STA.b Scrap0D
@@ -149,7 +150,6 @@ AddInventory:
JSR.w IncrementByOne JSR.w IncrementByOne
SEP #$20 SEP #$20
JSR.w IncrementYAItems JSR.w IncrementYAItems
LDA.w InventoryTable_properties,Y : BIT #$01 : BEQ .done
REP #$20 REP #$20
LDA.l TotalItemCounter : INC : TAY LDA.l TotalItemCounter : INC : TAY
LDA.l BootsEquipment : BNE + LDA.l BootsEquipment : BNE +
@@ -211,6 +211,9 @@ DungeonIncrement:
+ +
.count .count
CLC CLC
RTS
.dont_count
SEC
RTS RTS
.ballchain_bigkey .ballchain_bigkey
LDA.l BigKeysBigChests LDA.l BigKeysBigChests

View File

@@ -333,7 +333,7 @@ endmacro
%SpriteProps($1D, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 1D - Book %SpriteProps($1D, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 1D - Book
%SpriteProps($1E, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 1E - Flippers %SpriteProps($1E, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 1E - Flippers
%SpriteProps($1F, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 1F - Pearl %SpriteProps($1F, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 1F - Pearl
%SpriteProps($20, 2, 2, $06, $06, PalettesCustom_crystal) ; 20 - Crystal %SpriteProps($20, 2, 2, $86, $86, PalettesCustom_crystal) ; 20 - Crystal
%SpriteProps($21, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 21 - Net %SpriteProps($21, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 21 - Net
%SpriteProps($22, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 22 - Blue mail %SpriteProps($22, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 22 - Blue mail
%SpriteProps($23, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 23 - Red mail %SpriteProps($23, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 23 - Red mail

View File

@@ -117,7 +117,7 @@ ProcessEventItems:
PLA : STA.b Scrap00 PLA : STA.b Scrap00
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AddReceivedItemLong: AddReceivedItemExpanded:
JSR.w ResolveReceipt JSR.w ResolveReceipt
PHB : PHK PHB : PHK
JML AddReceivedItem+2 JML AddReceivedItem+2
@@ -699,6 +699,7 @@ ResolveLootID:
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JMP.w .get_item JMP.w .get_item
+ +
TAX
LDA.w ResolveLootID_armor_ids,X LDA.w ResolveLootID_armor_ids,X
JMP.w .have_item JMP.w .have_item
..ids ..ids

View File

@@ -174,8 +174,10 @@ RTL
; Randomize Zora King ; Randomize Zora King
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadZoraKingItemGFX: LoadZoraKingItemGFX:
LDA.l $9DE1C3 ; location randomizer writes zora item to LDA.l $9DE1C3 ; location randomizer writes zora item to
JML.l PrepDynamicTile JSL.l ResolveLootIDLong
STA.w SpriteID,X
JML.l PrepDynamicTile
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
JumpToSplashItemTarget: JumpToSplashItemTarget:
LDA.w SpriteMovement, X LDA.w SpriteMovement, X

View File

@@ -80,7 +80,7 @@ PHX
.checkIfObtained .checkIfObtained
LDA.l MC_DungeonIdsForPrize, X LDA.l MC_DungeonIdsForPrize, X
BPL +++ : CLC : BRA .done : +++ ; non-prize flags BPL +++ : CLC : BRA .done : +++ ; non-prize flags
CMP.b #$03 : BCC .hyrule_castle CMP.b #$02 : BCC .hyrule_castle
ASL : TAX ASL : TAX
REP #$20 REP #$20
LDA.l DungeonsCompleted : AND.l DungeonItemMasks,X : BNE .fail LDA.l DungeonsCompleted : AND.l DungeonItemMasks,X : BNE .fail

View File

@@ -507,8 +507,9 @@ skip 9 ;
; Shop Block $7F5050 - $7F506F ; Shop Block $7F5050 - $7F506F
ShopId: skip 1 ; Shop ID. Used for indexing and loading inventory for custom shops ShopId: skip 1 ; Shop ID. Used for indexing and loading inventory for custom shops
ShopType: skip 1 ; Shop type. $FF = vanilla shop ShopType: skip 1 ; Shop type. $FF = vanilla shop
; t - - - - - - - ; t d a v - - q q
; t = Take-any ; t = $01 - Take-any | d = $01 - Door check | a = $01 = Take-all
; v = Use alt vram | q = Number of items
ShopInventory: skip $0D ; For three possible shop items, row major: ShopInventory: skip $0D ; For three possible shop items, row major:
; [Item ID][Price low][Price High][Purchase Count] ; [Item ID][Price low][Price High][Purchase Count]
ShopState: skip 1 ; - - - - - l c r | Bitfield that determines whether to draw an item ShopState: skip 1 ; - - - - - l c r | Bitfield that determines whether to draw an item

View File

@@ -1,24 +1,5 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
WriteSaveChecksumAndBackup: WriteSaveChecksumAndBackup:
TDC
CLC
LDX.w #$004FC
-
ADC.l SaveDataWRAM, X
DEX #2
BPL -
LDX.w #$0FFE
-
ADC.l ExtendedFileNameWRAM, X
DEX #2
BPL -
STA.b Scrap00
LDA.w #$5A5A
SEC : SBC.b Scrap00
STA.l InverseChecksumSRAM
BRA .backup_save
.from_sram
TDC TDC
CLC CLC
LDX.w #$004FC LDX.w #$004FC
@@ -38,10 +19,10 @@ WriteSaveChecksumAndBackup:
.backup_save .backup_save
PHB PHB
LDA.w #$14FF ; \ LDA.w #$14FF
LDX.w #CartridgeSRAM ; | Copies $1500 bytes from beginning of cart SRAM to LDX.w #CartridgeSRAM
LDY.w #SaveBackupSRAM ; | $704000 LDY.w #SaveBackupSRAM
MVN !SRAMBank, !SRAMBank ; / MVN CartridgeSRAM>>16, CartridgeSRAM>>16
PLB PLB
TDC TDC
TAX TAX
@@ -80,13 +61,14 @@ ValidateSRAM:
LDA.w #$5A5A LDA.w #$5A5A
SEC : SBC.b Scrap00 SEC : SBC.b Scrap00
CMP.l SaveBackupSRAM+$4FE : BEQ + CMP.l SaveBackupSRAM+$4FE : BEQ +
TDC : STA.l FileValiditySRAM ; Delete save by way of zeroing validity marker TDC : STA.l FileValiditySRAM ; Delete save
BRA .goodchecksum : + BRA .goodchecksum
+
PHB PHB
LDA.w #$14FF ; \ LDA.w #$14FF
LDX.w #SaveBackupSRAM ; | Copies $1500 bytes from backup on cart SRAM to LDX.w #SaveBackupSRAM
LDY.w #CartridgeSRAM ; | main save location at $700000 LDY.w #CartridgeSRAM
MVN !SRAMBank, !SRAMBank ; / MVN CartridgeSRAM>>16, CartridgeSRAM>>16
PLB PLB
.goodchecksum .goodchecksum
@@ -182,7 +164,7 @@ CopyExtendedSaveFileToWRAM:
LDA.w #$0FFF LDA.w #$0FFF
LDX.w #ExtendedSaveDataSRAM LDX.w #ExtendedSaveDataSRAM
LDY.w #ExtendedSaveDataWRAM LDY.w #ExtendedSaveDataWRAM
MVN $7F, !SRAMBank MVN ExtendedSaveDataWRAM>>16, CartridgeSRAM>>16
PLB PLB
PLA PLA
STA.l $7EC00D ; What we wrote over. Keep this write last. STA.l $7EC00D ; What we wrote over. Keep this write last.
@@ -193,7 +175,7 @@ CopyExtendedWRAMSaveFileToSRAM:
LDA.w #$0FFF LDA.w #$0FFF
LDX.w #ExtendedSaveDataSRAM LDX.w #ExtendedSaveDataSRAM
LDY.w #ExtendedSaveDataWRAM LDY.w #ExtendedSaveDataWRAM
MVN !SRAMBank, $7F MVN CartridgeSRAM>>16, ExtendedSaveDataWRAM>>16
PLB PLB
TDC TDC
TAX TAX

View File

@@ -1,5 +1,6 @@
!FREE_TILE_BUFFER = $1180 !FREE_TILE_BUFFER = $1180
!FREE_TILE = $5A40 !FREE_TILE = $5C60
!FREE_TILE_ALT = $5A40
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $0A : Digit Offset ; $0A : Digit Offset
@@ -185,14 +186,19 @@ dw $0100, $0000
; X - Tile Buffer Offset ; X - Tile Buffer Offset
; Y - Item ID ; Y - Item ID
LoadTile: LoadTile:
TXA : LSR #2 : !ADD.w #!FREE_TILE : STA.w ItemGFXTarget ; load offset from X LDA.l ShopType : BIT.w #$0010 : BNE .alt_vram
;SEP #$30 TXA : LSR #2
CLC : ADC.w #!FREE_TILE
BRA .store_target
.alt_vram
TXA : LSR #2
CLC : ADC.w #!FREE_TILE_ALT
.store_target
STA.w ItemGFXTarget
TYA : ASL : TAX TYA : ASL : TAX
LDA.l StandingItemGraphicsOffsets,X : STA.w ItemGFXPtr LDA.l StandingItemGraphicsOffsets,X : STA.w ItemGFXPtr
JSL.l TransferItemToVRAM JSL.l TransferItemToVRAM
TDC TDC
;JSL.l GetSpriteID ; convert loot id to sprite id
;JSL.l GetAnimatedSpriteTile_variable
REP #$10 ; set 16-bit index registers REP #$10 ; set 16-bit index registers
SEP #$20 SEP #$20
RTS RTS

View File

@@ -428,15 +428,6 @@ SaveBackupSRAM: ; Backup copy of save ram. Game will attempt to
; checksum on file select screen load fails. ; checksum on file select screen load fails.
base off base off
;================================================================================
; Bank Definitions
;--------------------------------------------------------------------------------
; If these move (most likely by placing initsramtable.asm somewhere else) these
; bank definitions need to be changed as well.
;================================================================================
!SRAMBank = $70
!SRAMTableBank = $30|$80
;================================================================================ ;================================================================================
; Assertions ; Assertions
;================================================================================ ;================================================================================

View File

@@ -106,6 +106,7 @@ IncrementSmallKeysNoPrimary:
++ ++
PLP PLP
+ +
INC.w UpdateHUD
JSL.l HUD_RebuildLong JSL.l HUD_RebuildLong
PLX PLX
RTL RTL

View File

@@ -2682,9 +2682,9 @@ db $34, $64 ; crystal
db $34, $64 ; crystal db $34, $64 ; crystal
db $34, $64 ; crystal db $34, $64 ; crystal
db $34, $64 ; crystal db $34, $64 ; crystal
db $32, $64 ; crystal db $34, $64 ; crystal
db $32, $64 ; crystal db $34, $64 ; crystal
db $34, $64 ; crystal db $34, $64 ; crystal
db $32, $66 ; skull looking thing db $32, $66 ; skull looking thing
db $00, $00 ; red x db $00, $00 ; red x

View File

@@ -1,6 +1,6 @@
RenderCharSetColorExtended_init: RenderCharSetColorExtended_init:
stz.b Scrap0C stz.b Scrap0C
jsl $80d84e jsl Attract_DecompressStoryGfx
rtl rtl
RenderCharSetColorExtended_close: RenderCharSetColorExtended_close:

View File

@@ -24,6 +24,7 @@ Tagalong_LoadGfx = $80D463
GetAnimatedSpriteTile = $80D51B GetAnimatedSpriteTile = $80D51B
GetAnimatedSpriteTile_variable = $80D52D GetAnimatedSpriteTile_variable = $80D52D
Attract_DecompressStoryGfx = $80D84E Attract_DecompressStoryGfx = $80D84E
InitializeTilesets = $80E1DB
LoadSelectScreenGfx = $80E529 LoadSelectScreenGfx = $80E529
PrepDungeonExit = $80F945 PrepDungeonExit = $80F945
Mirror_InitHdmaSettings = $80FDEE Mirror_InitHdmaSettings = $80FDEE
@@ -126,6 +127,7 @@ Sprite_PlayerCantPassThrough = $9EF4E7
;=================================================================================================== ;===================================================================================================
; Local routines (use JSR) ; Local routines (use JSR)
;=================================================================================================== ;===================================================================================================
LoadBackgroundGraphics = $80E649
RoomTag_PrizeTriggerDoor_open = $81C529 RoomTag_PrizeTriggerDoor_open = $81C529
RoomTag_PrizeTriggerDoor_exit = $81C529 RoomTag_PrizeTriggerDoor_exit = $81C529
RoomTag_GetHeartForPrize = $81C709 RoomTag_GetHeartForPrize = $81C709
@@ -150,6 +152,9 @@ ItemMenu_DrawEquippedYItem = $8DEB3A
ItemMenu_DrawEquippedYItem_exit = $8DECE6 ItemMenu_DrawEquippedYItem_exit = $8DECE6
ItemMenu_DrawEquipment_dungeonitems = $8DEDCC ItemMenu_DrawEquipment_dungeonitems = $8DEDCC
DrawEquipment = $8DED29 DrawEquipment = $8DED29
DecompressFontGFX = $8EF572
CopyDecompressedCharToTransferBuffer = $8EF5BC
CopyDecompressedToFullBuffer = $8EF6A8
;=================================================================================================== ;===================================================================================================
; Palettes ; Palettes