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

View File

@@ -886,7 +886,7 @@ org $80D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL GetAnimatedSpriteBufferPointer : NOP
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)
LDA.w ItemReceipts_target+0, X
@@ -2450,33 +2450,18 @@ JSL FixJingleGlitch
; Text Renderer
;--------------------------------------------------------------------------------
if !FEATURE_NEW_TEXT
org $8EF51B
JML RenderCharExtended
org $8EF520
RenderCharExtended_returnOriginal:
org $8EF567
RenderCharExtended_returnUncompressed:
org $8EF356
JSL RenderCharLookupWidth
org $8EF3BA
JSL RenderCharLookupWidth
org $8EF48E
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
org $8EF51B : JML RenderCharExtended
org $8EF520 : RenderCharExtended_returnOriginal:
org $8EF567 : RenderCharExtended_returnUncompressed:
org $8EF356 : JSL RenderCharLookupWidth
org $8EF3BA : JSL RenderCharLookupWidth
org $8EF48E : 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
;================================================================================

View File

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

View File

@@ -333,7 +333,7 @@ endmacro
%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($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($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

View File

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

View File

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

View File

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

View File

@@ -507,8 +507,9 @@ skip 9 ;
; Shop Block $7F5050 - $7F506F
ShopId: skip 1 ; Shop ID. Used for indexing and loading inventory for custom shops
ShopType: skip 1 ; Shop type. $FF = vanilla shop
; t - - - - - - -
; t = Take-any
; t d a v - - q q
; 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:
; [Item ID][Price low][Price High][Purchase Count]
ShopState: skip 1 ; - - - - - l c r | Bitfield that determines whether to draw an item

View File

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

View File

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

View File

@@ -428,15 +428,6 @@ SaveBackupSRAM: ; Backup copy of save ram. Game will attempt to
; checksum on file select screen load fails.
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
;================================================================================

View File

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

View File

@@ -2682,9 +2682,9 @@ 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 $32, $66 ; skull looking thing
db $00, $00 ; red x

View File

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

View File

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