@@ -3,6 +3,7 @@
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
LoadLibraryItemGFX:
|
LoadLibraryItemGFX:
|
||||||
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
|
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID, X
|
STA.w SpriteID, X
|
||||||
JSL.l PrepDynamicTile_loot_resolved
|
JSL.l PrepDynamicTile_loot_resolved
|
||||||
@@ -30,9 +31,17 @@ LoadBonkItemGFX:
|
|||||||
LoadBonkItemGFX_inner:
|
LoadBonkItemGFX_inner:
|
||||||
LDA.b #$00 : STA.l RedrawFlag
|
LDA.b #$00 : STA.l RedrawFlag
|
||||||
JSR LoadBonkItem
|
JSR LoadBonkItem
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteItemType, X
|
STA.w SpriteItemType, X
|
||||||
STA.w SpriteID, X
|
STA.w SpriteID, X
|
||||||
JSL.l PrepDynamicTile
|
JSL.l PrepDynamicTile
|
||||||
|
PHA : PHX
|
||||||
|
LDA.w SpriteID,X : TAX
|
||||||
|
LDA.l SpriteProperties_standing_width,X : BNE +
|
||||||
|
LDA.b #$00 : STA.l SpriteOAM : STA.l SpriteOAM+8
|
||||||
|
+
|
||||||
|
PLX : PLA
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
DrawBonkItemGFX:
|
DrawBonkItemGFX:
|
||||||
@@ -42,7 +51,7 @@ DrawBonkItemGFX:
|
|||||||
BRA .done ; don't draw on the init frame
|
BRA .done ; don't draw on the init frame
|
||||||
|
|
||||||
.skipInit
|
.skipInit
|
||||||
JSR LoadBonkItem
|
LDA.w SpriteID,X
|
||||||
JSL.l DrawDynamicTileNoShadow
|
JSL.l DrawDynamicTileNoShadow
|
||||||
|
|
||||||
.done
|
.done
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ dw $0000, $7FFF, $27FF, $5E2D, $7FFF, $1CE7, $7A10, $64A5
|
|||||||
.red_shield
|
.red_shield
|
||||||
dw $0000, $7FFF, $27FF, $5E2D, $4F5F, $1CE7, $2E9C, $14B6
|
dw $0000, $7FFF, $27FF, $5E2D, $4F5F, $1CE7, $2E9C, $14B6
|
||||||
.mirror_shield
|
.mirror_shield
|
||||||
dw $0000, $7FFF, $27FF, $5E2D, $7399, $1CE7, $02F9, $0233
|
dw $0000, $7E4E, $6F44, $1CF5, $7399, $1CE7, $02F9, $0233
|
||||||
.crystal
|
.crystal
|
||||||
dw $7FFF, $7FFF, $0000, $5907, $6E0E, $0000, $7FBB, $7672
|
dw $7FFF, $7FFF, $0000, $5907, $6E0E, $0000, $7FBB, $7672
|
||||||
.off_black
|
.off_black
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
SpawnDungeonPrize:
|
SpawnDungeonPrize:
|
||||||
PHX : PHB
|
PHX : PHB
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w ItemReceiptID
|
STA.w ItemReceiptID
|
||||||
TAX
|
TAX
|
||||||
@@ -61,6 +62,7 @@ RTS
|
|||||||
PrepPrizeTile:
|
PrepPrizeTile:
|
||||||
PHA : PHX : PHY
|
PHA : PHX : PHY
|
||||||
LDA.w AncillaGet, X
|
LDA.w AncillaGet, X
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID,X
|
STA.w SpriteID,X
|
||||||
JSL.l TransferItemReceiptToBuffer_using_ReceiptID
|
JSL.l TransferItemReceiptToBuffer_using_ReceiptID
|
||||||
@@ -69,6 +71,7 @@ RTL
|
|||||||
|
|
||||||
SetItemPose:
|
SetItemPose:
|
||||||
PHA
|
PHA
|
||||||
|
LDA.w DungeonID : BMI .one_handed
|
||||||
LDA.w RoomItemsTaken : BIT.b #$80 : BNE +
|
LDA.w RoomItemsTaken : BIT.b #$80 : BNE +
|
||||||
.one_handed
|
.one_handed
|
||||||
PLA
|
PLA
|
||||||
@@ -97,6 +100,7 @@ SetCutsceneFlag:
|
|||||||
; Out: c - Cutscene flag $02 if set, $01 if unset.
|
; Out: c - Cutscene flag $02 if set, $01 if unset.
|
||||||
PHX
|
PHX
|
||||||
LDY.b #$01 ; wrote over
|
LDY.b #$01 ; wrote over
|
||||||
|
LDA.w DungeonID : BMI .no_cutscene
|
||||||
LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize
|
LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize
|
||||||
.no_cutscene
|
.no_cutscene
|
||||||
PLX
|
PLX
|
||||||
@@ -112,6 +116,7 @@ RTL
|
|||||||
AnimatePrizeCutscene:
|
AnimatePrizeCutscene:
|
||||||
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE +
|
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE +
|
||||||
JSR.w CrystalOrPendantBehavior : BCC +
|
JSR.w CrystalOrPendantBehavior : BCC +
|
||||||
|
LDA.w DungeonID : BMI +
|
||||||
LDA.w RoomItemsTaken : BIT #$80 : BEQ +
|
LDA.w RoomItemsTaken : BIT #$80 : BEQ +
|
||||||
SEC
|
SEC
|
||||||
RTL
|
RTL
|
||||||
@@ -148,7 +153,9 @@ RTL
|
|||||||
|
|
||||||
MaybeKeepLootID:
|
MaybeKeepLootID:
|
||||||
PHA
|
PHA
|
||||||
|
LDA.w DungeonID : BMI .no_prize
|
||||||
LDA.w RoomItemsTaken : BIT #$80 : BNE .prize
|
LDA.w RoomItemsTaken : BIT #$80 : BNE .prize
|
||||||
|
.no_prize
|
||||||
STZ.w ItemReceiptID
|
STZ.w ItemReceiptID
|
||||||
STZ.w ItemReceiptPose
|
STZ.w ItemReceiptPose
|
||||||
PLA
|
PLA
|
||||||
|
|||||||
36
events.asm
36
events.asm
@@ -236,6 +236,7 @@ PostItemGet:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
PostItemAnimation:
|
PostItemAnimation:
|
||||||
|
PHB
|
||||||
LDA.b #$00 : STA.l BusyItem ; mark item as finished
|
LDA.b #$00 : STA.l BusyItem ; mark item as finished
|
||||||
LDA.l TextBoxDefer : BEQ +
|
LDA.l TextBoxDefer : BEQ +
|
||||||
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
|
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
|
||||||
@@ -247,29 +248,32 @@ PostItemAnimation:
|
|||||||
JSL.l IncrementChestTurnCounter
|
JSL.l IncrementChestTurnCounter
|
||||||
+
|
+
|
||||||
REP #$20
|
REP #$20
|
||||||
|
PEA.w $7E00
|
||||||
|
PLB : PLB
|
||||||
LDA.w TransparencyFlag : BNE .SP05
|
LDA.w TransparencyFlag : BNE .SP05
|
||||||
LDA.l PalettesCustom_off_black+$00 : STA.l PaletteBuffer+$0170
|
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$0170 : STA.w PaletteBufferAux+$0170
|
||||||
LDA.l PalettesCustom_off_black+$02 : STA.l PaletteBuffer+$0172
|
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$0172 : STA.w PaletteBufferAux+$0172
|
||||||
LDA.l PalettesCustom_off_black+$04 : STA.l PaletteBuffer+$0174
|
STA.w PaletteBuffer+$0174 : STA.w PaletteBufferAux+$0174
|
||||||
LDA.l PalettesCustom_off_black+$06 : STA.l PaletteBuffer+$0176
|
STA.w PaletteBuffer+$0176 : STA.w PaletteBufferAux+$0176
|
||||||
LDA.l PalettesCustom_off_black+$08 : STA.l PaletteBuffer+$0178
|
STA.w PaletteBuffer+$0178 : STA.w PaletteBufferAux+$0178
|
||||||
LDA.l PalettesCustom_off_black+$0A : STA.l PaletteBuffer+$017A
|
STA.w PaletteBuffer+$017A : STA.w PaletteBufferAux+$017A
|
||||||
LDA.l PalettesCustom_off_black+$0C : STA.l PaletteBuffer+$017C
|
STA.w PaletteBuffer+$017C : STA.w PaletteBufferAux+$017C
|
||||||
LDA.l PalettesCustom_off_black+$0E : STA.l PaletteBuffer+$017E
|
STA.w PaletteBuffer+$017E : STA.w PaletteBufferAux+$017E
|
||||||
BRA .done
|
BRA .done
|
||||||
.SP05
|
.SP05
|
||||||
LDA.l PalettesCustom_off_black+$00 : STA.l PaletteBuffer+$01B0
|
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$01B0 : STA.w PaletteBufferAux+$01B0
|
||||||
LDA.l PalettesCustom_off_black+$02 : STA.l PaletteBuffer+$01B2
|
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$01B2 : STA.w PaletteBufferAux+$01B2
|
||||||
LDA.l PalettesCustom_off_black+$04 : STA.l PaletteBuffer+$01B4
|
STA.w PaletteBuffer+$01B4 : STA.w PaletteBufferAux+$01B4
|
||||||
LDA.l PalettesCustom_off_black+$06 : STA.l PaletteBuffer+$01B6
|
STA.w PaletteBuffer+$01B6 : STA.w PaletteBufferAux+$01B6
|
||||||
LDA.l PalettesCustom_off_black+$08 : STA.l PaletteBuffer+$01B8
|
STA.w PaletteBuffer+$01B8 : STA.w PaletteBufferAux+$01B8
|
||||||
LDA.l PalettesCustom_off_black+$0A : STA.l PaletteBuffer+$01BA
|
STA.w PaletteBuffer+$01BA : STA.w PaletteBufferAux+$01BA
|
||||||
LDA.l PalettesCustom_off_black+$0C : STA.l PaletteBuffer+$01BC
|
STA.w PaletteBuffer+$01BC : STA.w PaletteBufferAux+$01BC
|
||||||
LDA.l PalettesCustom_off_black+$0E : STA.l PaletteBuffer+$01BE
|
STA.w PaletteBuffer+$01BE : STA.w PaletteBufferAux+$01BE
|
||||||
.done
|
.done
|
||||||
INC.b NMICGRAM
|
INC.b NMICGRAM
|
||||||
SEP #$20
|
SEP #$20
|
||||||
|
|
||||||
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
|
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
|
||||||
|
PLB
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -44,10 +44,12 @@ TransferItemGFX:
|
|||||||
; Only used for shops now but could be used for anything. We should look at how door rando does this
|
; Only used for shops now but could be used for anything. We should look at how door rando does this
|
||||||
; and try to unify one approach.
|
; and try to unify one approach.
|
||||||
REP #$30
|
REP #$30
|
||||||
LDX.w ItemQueuePtr : BEQ .done
|
LDX.w ItemStackPtr : BEQ .done
|
||||||
|
TXA : BIT #$0040 : BNE .fail ; Crash if we have more than 16 queued (should never happen.)
|
||||||
|
DEX #2
|
||||||
-
|
-
|
||||||
LDA.w ItemGFXQueue,X : STA.w ItemGFXPtr
|
LDA.l ItemGFXStack,X : STA.w ItemGFXPtr
|
||||||
LDA.w ItemTargetQueue,X : STA.w ItemGFXTarget
|
LDA.l ItemTargetStack,X : STA.w ItemGFXTarget
|
||||||
PHX
|
PHX
|
||||||
JSL.l TransferItemToVRAM
|
JSL.l TransferItemToVRAM
|
||||||
REP #$10
|
REP #$10
|
||||||
@@ -55,7 +57,9 @@ TransferItemGFX:
|
|||||||
DEX #2
|
DEX #2
|
||||||
BPL -
|
BPL -
|
||||||
|
|
||||||
STZ.w ItemQueuePtr
|
STZ.w ItemStackPtr
|
||||||
.done
|
.done
|
||||||
SEP #$30
|
SEP #$30
|
||||||
RTS
|
RTS
|
||||||
|
.fail
|
||||||
|
BRK #$00
|
||||||
|
|||||||
17
goalitem.asm
17
goalitem.asm
@@ -142,10 +142,8 @@ CheckEnoughCrystalsForGanon:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
CheckTowerOpen:
|
CheckTowerOpen:
|
||||||
REP #$30
|
|
||||||
LDA.l GanonsTowerOpenMode : ASL : TAX
|
LDA.l GanonsTowerOpenMode : ASL : TAX
|
||||||
JSR.w (.tower_open_modes,X)
|
JSR.w (.tower_open_modes,X)
|
||||||
SEP #$30
|
|
||||||
RTL
|
RTL
|
||||||
.tower_open_modes
|
.tower_open_modes
|
||||||
dw .vanilla
|
dw .vanilla
|
||||||
@@ -153,13 +151,15 @@ RTL
|
|||||||
|
|
||||||
.vanilla
|
.vanilla
|
||||||
LDA.l CrystalsField
|
LDA.l CrystalsField
|
||||||
AND.w #$007F : CMP.w #$007F
|
AND.b #$7F : CMP.b #$7F
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.arbitrary_cmp
|
.arbitrary_cmp
|
||||||
|
REP #$30
|
||||||
LDA.l GanonsTowerOpenAddress : TAX
|
LDA.l GanonsTowerOpenAddress : TAX
|
||||||
LDA.l $7E0000,X
|
LDA.l $7E0000,X
|
||||||
CMP.l GanonsTowerOpenTarget
|
CMP.l GanonsTowerOpenTarget
|
||||||
|
SEP #$30
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
;---------------------------------------------------------------------------------------------------
|
;---------------------------------------------------------------------------------------------------
|
||||||
@@ -195,10 +195,9 @@ KillGanon:
|
|||||||
CMP.b #$06 : BNE .exit
|
CMP.b #$06 : BNE .exit
|
||||||
|
|
||||||
.light_speed
|
.light_speed
|
||||||
LDA.l OverworldEventDataWRAM+$5B : ORA.b #$20 : STA.l OverworldEventDataWRAM+$5B ; pyramid hole
|
REP #$20
|
||||||
LDA.b #$08 : STA.l RoomDataWRAM[$00].high ; kill ganon
|
LDA.w #$0019 : STA.b GameMode
|
||||||
LDA.b #$02 : STA.l MoonPearlEquipment ; pearl but invisible in menu
|
SEP #$20
|
||||||
|
|
||||||
.exit
|
.exit
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
@@ -267,7 +266,9 @@ RTL
|
|||||||
RTS
|
RTS
|
||||||
|
|
||||||
.arbitrary_cmp
|
.arbitrary_cmp
|
||||||
|
REP #$30
|
||||||
LDA.l PedPullAddress : TAX
|
LDA.l PedPullAddress : TAX
|
||||||
LDA.l $7E000,X
|
LDA.l $7E0000,X
|
||||||
CMP.l PedPullTarget
|
CMP.l PedPullTarget
|
||||||
|
SEP #$30
|
||||||
RTS
|
RTS
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
HeartPieceGet:
|
HeartPieceGet:
|
||||||
PHX : PHY
|
PHX : PHY
|
||||||
JSL.l LoadHeartPieceRoomValue
|
JSL.l LoadHeartPieceRoomValue
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
TAY
|
TAY
|
||||||
JSL.l MaybeMarkDigSpotCollected
|
JSL.l MaybeMarkDigSpotCollected
|
||||||
@@ -112,6 +113,7 @@ HeartPieceSpritePrep:
|
|||||||
|
|
||||||
LDA.b #$00 : STA.l RedrawFlag
|
LDA.b #$00 : STA.l RedrawFlag
|
||||||
JSL.l LoadHeartPieceRoomValue
|
JSL.l LoadHeartPieceRoomValue
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID, X
|
STA.w SpriteID, X
|
||||||
JSL.l PrepDynamicTile_loot_resolved
|
JSL.l PrepDynamicTile_loot_resolved
|
||||||
@@ -125,6 +127,7 @@ HeartContainerSpritePrep:
|
|||||||
|
|
||||||
LDA.b #$00 : STA.l RedrawFlag
|
LDA.b #$00 : STA.l RedrawFlag
|
||||||
JSL.l LoadHeartContainerRoomValue ; load item type
|
JSL.l LoadHeartContainerRoomValue ; load item type
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID, X
|
STA.w SpriteID, X
|
||||||
JSL.l PrepDynamicTile_loot_resolved
|
JSL.l PrepDynamicTile_loot_resolved
|
||||||
|
|||||||
22
hooks.asm
22
hooks.asm
@@ -59,10 +59,8 @@ org $00FFEA : dw NMIBounce
|
|||||||
org $00FFEE : dw IRQBounce
|
org $00FFEE : dw IRQBounce
|
||||||
|
|
||||||
org $8098AB
|
org $8098AB
|
||||||
|
NMIBounce: JML.l $8080C9
|
||||||
NMIBounce: JML $8080C9
|
IRQBounce: JML.l $8082D8
|
||||||
IRQBounce: JML $8082D8
|
|
||||||
|
|
||||||
warnpc $8098C0
|
warnpc $8098C0
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
@@ -1408,19 +1406,15 @@ MVN $A17E
|
|||||||
org $8DFB1F : JSL CheckHUDSilverArrows
|
org $8DFB1F : JSL CheckHUDSilverArrows
|
||||||
org $8DFB29 : BRA UpdateHUDBuffer_update_item_check_arrows
|
org $8DFB29 : BRA UpdateHUDBuffer_update_item_check_arrows
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $8DF1AB
|
org $8DF1AB : JSR.w RebuildHUD_update
|
||||||
JSR.w RebuildHUD_update
|
org $8DDFC8 : JSR.w RebuildHUD_update
|
||||||
org $8DDFC8
|
|
||||||
JSR.w RebuildHUD_update
|
|
||||||
org $8DDB88 ; Don't rebuild HUD twice on icon refresh
|
org $8DDB88 ; Don't rebuild HUD twice on icon refresh
|
||||||
NOP #3 ; Not sure why this is here
|
NOP #3 ; Not sure why this is here
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $87A205
|
org $87A205 : JSL.l RebuildHUD_update_long
|
||||||
JSL.l RebuildHUD_update_long
|
org $8AEF62 : JSL.l RebuildHUD_update_long
|
||||||
org $8AEF62
|
org $87A1CF : JSL.l RebuildHUD_update_long
|
||||||
JSL.l RebuildHUD_update_long
|
org $87A235 : JSL.l RebuildHUD_update_long
|
||||||
org $87A1CF
|
|
||||||
JSL.l RebuildHUD_update_long
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $8DFFE1
|
org $8DFFE1
|
||||||
RebuildHUD_update_long:
|
RebuildHUD_update_long:
|
||||||
|
|||||||
5
init.asm
5
init.asm
@@ -48,11 +48,12 @@ Init_Primary:
|
|||||||
LDA.l OneMindTimerInit : STA.l OneMindTimerRAM
|
LDA.l OneMindTimerInit : STA.l OneMindTimerRAM
|
||||||
SEP #$30
|
SEP #$30
|
||||||
|
|
||||||
LDA.b #$01 : STA.w MEMSEL ; enable fastrom access on upper banks
|
LDA.l RomSpeed : STA.w MEMSEL ; enable fastrom access on upper banks
|
||||||
STA.l OneMindId
|
LDA.b #$01 : STA.l OneMindId
|
||||||
|
|
||||||
LDA.b #$10 : STA.b PlayerSpriteBank ; set default player sprite bank
|
LDA.b #$10 : STA.b PlayerSpriteBank ; set default player sprite bank
|
||||||
LDA.b #$81 : STA.w NMITIMEN ; thing we wrote over, turn on NMI & gamepad
|
LDA.b #$81 : STA.w NMITIMEN ; thing we wrote over, turn on NMI & gamepad
|
||||||
|
LDA.b #(ReturnFromInit>>16)|$80 : PHA : PLB
|
||||||
|
|
||||||
JML ReturnFromInit
|
JML ReturnFromInit
|
||||||
|
|
||||||
|
|||||||
@@ -520,6 +520,7 @@ LoadPowder:
|
|||||||
PHX
|
PHX
|
||||||
JSL.l Sprite_SpawnDynamically ; thing we wrote over
|
JSL.l Sprite_SpawnDynamically ; thing we wrote over
|
||||||
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
|
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID, Y
|
STA.w SpriteID, Y
|
||||||
TYX
|
TYX
|
||||||
@@ -572,6 +573,7 @@ LoadMushroom:
|
|||||||
|
|
||||||
LDA.b #$00 : STA.l RedrawFlag
|
LDA.b #$00 : STA.l RedrawFlag
|
||||||
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
|
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSR.w ResolveLootID
|
JSR.w ResolveLootID
|
||||||
STA.w SpriteID,X
|
STA.w SpriteID,X
|
||||||
JSL.l PrepDynamicTile
|
JSL.l PrepDynamicTile
|
||||||
|
|||||||
@@ -183,9 +183,9 @@ endmacro
|
|||||||
%ReceiptProps($2B, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2B - Full bottle (red)
|
%ReceiptProps($2B, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2B - Full bottle (red)
|
||||||
%ReceiptProps($2C, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2C - Full bottle (green)
|
%ReceiptProps($2C, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2C - Full bottle (green)
|
||||||
%ReceiptProps($2D, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2D - Full bottle (blue)
|
%ReceiptProps($2D, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2D - Full bottle (blue)
|
||||||
%ReceiptProps($2E, -4, 0, $1E, $F36D, $FF, skip, bottles) ; 2E - Potion refill (red)
|
%ReceiptProps($2E, -4, 0, $1E, $F36D, $FF, skip, skip) ; 2E - Potion refill (red)
|
||||||
%ReceiptProps($2F, -4, 0, $1E, $F36E, $FF, skip, bottles) ; 2F - Potion refill (green)
|
%ReceiptProps($2F, -4, 0, $1E, $F36E, $FF, skip, skip) ; 2F - Potion refill (green)
|
||||||
%ReceiptProps($30, -4, 0, $1E, $F36E, $FF, skip, bottles) ; 30 - Potion refill (blue)
|
%ReceiptProps($30, -4, 0, $1E, $F36E, $FF, skip, skip) ; 30 - Potion refill (blue)
|
||||||
%ReceiptProps($31, -4, 0, $30, $F375, $FF, skip, skip) ; 31 - 10 bombs
|
%ReceiptProps($31, -4, 0, $30, $F375, $FF, skip, skip) ; 31 - 10 bombs
|
||||||
%ReceiptProps($32, -4, 0, $22, $F366, $FF, dungeon_bigkey, skip) ; 32 - Big key
|
%ReceiptProps($32, -4, 0, $22, $F366, $FF, dungeon_bigkey, skip) ; 32 - Big key
|
||||||
%ReceiptProps($33, -4, 0, $21, $F368, $FF, dungeon_map, skip) ; 33 - Map
|
%ReceiptProps($33, -4, 0, $21, $F368, $FF, dungeon_map, skip) ; 33 - Map
|
||||||
@@ -416,7 +416,7 @@ macro SpriteProps(id, chest_width, standing_width, chest_pal, standing_pal, addr
|
|||||||
pullpc
|
pullpc
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
%SpriteProps($00, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 00 - Fighter sword & Shield
|
%SpriteProps($00, 0, 2, $05, $02, PalettesVanilla_blue_ice+$0E) ; 00 - Fighter sword & Shield
|
||||||
%SpriteProps($01, 0, 2, $05, $05, PalettesCustom_master_sword) ; 01 - Master sword
|
%SpriteProps($01, 0, 2, $05, $05, PalettesCustom_master_sword) ; 01 - Master sword
|
||||||
%SpriteProps($02, 0, 2, $05, $01, PalettesCustom_tempered_sword) ; 02 - Tempered sword
|
%SpriteProps($02, 0, 2, $05, $01, PalettesCustom_tempered_sword) ; 02 - Tempered sword
|
||||||
%SpriteProps($03, 0, 2, $05, $04, PalettesCustom_golden_sword) ; 03 - Golden sword
|
%SpriteProps($03, 0, 2, $05, $04, PalettesCustom_golden_sword) ; 03 - Golden sword
|
||||||
@@ -452,7 +452,7 @@ endmacro
|
|||||||
%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
|
||||||
%SpriteProps($24, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; 24 - Small key
|
%SpriteProps($24, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; 24 - Small key
|
||||||
%SpriteProps($25, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 25 - Compass
|
%SpriteProps($25, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 25 - Compass
|
||||||
%SpriteProps($26, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 26 - Heart container from 4/4
|
%SpriteProps($26, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 26 - Heart container from 4/4
|
||||||
%SpriteProps($27, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 27 - Bomb
|
%SpriteProps($27, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 27 - Bomb
|
||||||
@@ -590,7 +590,7 @@ endmacro
|
|||||||
%SpriteProps($AB, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town
|
%SpriteProps($AB, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town
|
||||||
%SpriteProps($AC, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock
|
%SpriteProps($AC, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock
|
||||||
%SpriteProps($AD, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower
|
%SpriteProps($AD, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower
|
||||||
%SpriteProps($AE, 2, 2, $04, $04, $0000) ; AE - Reserved
|
%SpriteProps($AE, 2, 2, $02, $02, $0000) ; AE - Reserved
|
||||||
%SpriteProps($AF, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key
|
%SpriteProps($AF, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key
|
||||||
%SpriteProps($B0, 2, 2, $80, $80, PalettesCustom_crystal) ; B0 - Crystal 6
|
%SpriteProps($B0, 2, 2, $80, $80, PalettesCustom_crystal) ; B0 - Crystal 6
|
||||||
%SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1
|
%SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1
|
||||||
@@ -1032,7 +1032,7 @@ ItemReceiptGraphicsOffsets:
|
|||||||
dw $05A0 ; 4D - Arrow capacity (70)
|
dw $05A0 ; 4D - Arrow capacity (70)
|
||||||
dw $01A0 ; 4E - 1/2 magic
|
dw $01A0 ; 4E - 1/2 magic
|
||||||
dw $01E0 ; 4F - 1/4 magic
|
dw $01E0 ; 4F - 1/4 magic
|
||||||
dw $0 ; 50 - Safe master sword
|
dw $00E0 ; 50 - Safe master sword
|
||||||
dw $0420 ; 51 - Bomb capacity (+5)
|
dw $0420 ; 51 - Bomb capacity (+5)
|
||||||
dw $0460 ; 52 - Bomb capacity (+10)
|
dw $0460 ; 52 - Bomb capacity (+10)
|
||||||
dw $0520 ; 53 - Arrow capacity (+5)
|
dw $0520 ; 53 - Arrow capacity (+5)
|
||||||
|
|||||||
27
newitems.asm
27
newitems.asm
@@ -434,7 +434,10 @@ ItemBehavior:
|
|||||||
RTS
|
RTS
|
||||||
|
|
||||||
.single_arrow
|
.single_arrow
|
||||||
INC.w UpdateHUD
|
LDA.l ArrowMode : BEQ +
|
||||||
|
LDA.l CurrentArrows : INC : STA.l CurrentArrows ; Should be sole write to this address
|
||||||
|
INC.w UpdateHUD ; in retro/rupee bow mode.
|
||||||
|
+
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.rupoor
|
.rupoor
|
||||||
@@ -626,7 +629,12 @@ ItemBehavior:
|
|||||||
|
|
||||||
.pendant
|
.pendant
|
||||||
SEP #$20
|
SEP #$20
|
||||||
LDA.l PendantCounter : INC : STA.l PendantCounter
|
LSR
|
||||||
|
SEC : SBC.b #$37
|
||||||
|
TAX
|
||||||
|
LDA.w PendantMasks,X : AND.l PendantsField : BNE +
|
||||||
|
LDA.l PendantCounter : INC : STA.l PendantCounter
|
||||||
|
+
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.dungeon_crystal
|
.dungeon_crystal
|
||||||
@@ -645,9 +653,12 @@ ItemBehavior:
|
|||||||
DEX
|
DEX
|
||||||
BPL -
|
BPL -
|
||||||
SEP #$20
|
SEP #$20
|
||||||
ORA.l CrystalsField : STA.l CrystalsField
|
TAX
|
||||||
LDA.l CrystalCounter : INC : STA.l CrystalCounter
|
AND.l CrystalsField : BNE +
|
||||||
|
TXA
|
||||||
|
ORA.l CrystalsField : STA.l CrystalsField
|
||||||
|
LDA.l CrystalCounter : INC : STA.l CrystalCounter
|
||||||
|
+
|
||||||
.done
|
.done
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
@@ -657,7 +668,7 @@ ResolveReceipt:
|
|||||||
JSL.l PreItemGet
|
JSL.l PreItemGet
|
||||||
LDA.w ItemReceiptID
|
LDA.w ItemReceiptID
|
||||||
.get_item
|
.get_item
|
||||||
JSR.w AttemptItemSubstitution
|
JSL.l AttemptItemSubstitution
|
||||||
JSR.w HandleBowTracking
|
JSR.w HandleBowTracking
|
||||||
JSR.w ResolveLootID
|
JSR.w ResolveLootID
|
||||||
.have_item
|
.have_item
|
||||||
@@ -1013,7 +1024,7 @@ AttemptItemSubstitution:
|
|||||||
BRA -
|
BRA -
|
||||||
.exit
|
.exit
|
||||||
PLA : PLX
|
PLA : PLX
|
||||||
RTS
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
CountBottles:
|
CountBottles:
|
||||||
PHX
|
PHX
|
||||||
@@ -1121,3 +1132,5 @@ dw $0004 ; EP
|
|||||||
dw $0002 ; HC
|
dw $0002 ; HC
|
||||||
dw $0000 ; Sewers
|
dw $0000 ; Sewers
|
||||||
|
|
||||||
|
PendantMasks:
|
||||||
|
db $04, 01, 02
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ RTL
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
LoadZoraKingItemGFX:
|
LoadZoraKingItemGFX:
|
||||||
LDA.l $9DE1C3 ; location randomizer writes zora item to
|
LDA.l $9DE1C3 ; location randomizer writes zora item to
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID,Y
|
STA.w SpriteID,Y
|
||||||
TYX
|
TYX
|
||||||
@@ -190,6 +191,7 @@ JumpToSplashItemTarget:
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
LoadCatfishItemGFX:
|
LoadCatfishItemGFX:
|
||||||
LDA.l $9DE185 ; location randomizer writes catfish item to
|
LDA.l $9DE185 ; location randomizer writes catfish item to
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.w SpriteID, Y
|
STA.w SpriteID, Y
|
||||||
TYX
|
TYX
|
||||||
|
|||||||
12
ram.asm
12
ram.asm
@@ -190,10 +190,10 @@ MessageJunk = $7E0223 ; Zeroed but never used (?)
|
|||||||
;
|
;
|
||||||
ShopPurchaseFlag = $7E0224 ; $01 = Shop purchase item receipt.
|
ShopPurchaseFlag = $7E0224 ; $01 = Shop purchase item receipt.
|
||||||
;CoolScratch = $7E0224 ; 0x5C bytes of free ram
|
;CoolScratch = $7E0224 ; 0x5C bytes of free ram
|
||||||
ItemQueuePtr = $7E0226 ; Pointer into Item GFX and VRAM target queues. Word length.
|
ItemStackPtr = $7E0226 ; Pointer into Item GFX and VRAM target queues. Word length.
|
||||||
|
; If not zero, pointer should always be left pointing at the
|
||||||
|
; next available slot in the stack during the frame.
|
||||||
SpriteID = $7E0230 ; 0x0A bytes. Receipt ID for main loop sprite we're handling.
|
SpriteID = $7E0230 ; 0x0A bytes. Receipt ID for main loop sprite we're handling.
|
||||||
ItemGFXQueue = $7E0230 ; Pointers to decompressed item tiles deferred to NMI loading. $10 bytes
|
|
||||||
ItemTargetQueue = $7E0240 ; Pointers to VRAM targets for ItemGFXQueue. $10 bytes
|
|
||||||
AncillaVelocityZ = $7E0294 ; 0x0A bytes
|
AncillaVelocityZ = $7E0294 ; 0x0A bytes
|
||||||
AncillaZCoord = $7E029E ; 0x0A bytes
|
AncillaZCoord = $7E029E ; 0x0A bytes
|
||||||
;
|
;
|
||||||
@@ -476,7 +476,10 @@ HUDArrowCount = $7EC760 ;
|
|||||||
HUDKeyDigits = $7EC764 ;
|
HUDKeyDigits = $7EC764 ;
|
||||||
;
|
;
|
||||||
BigRAM = $7EC900 ; Big buffer of free ram (0x1F00)
|
BigRAM = $7EC900 ; Big buffer of free ram (0x1F00)
|
||||||
TotalItemCountTiles = $7ECB00 ; Cached total item count tiles for HUD. Four words high to low.
|
ItemGFXStack = $7ECB00 ; Pointers to source of decompressed item tiles deferred to NMI loading.
|
||||||
|
ItemGFXSBankStack = $7ECB20 ; Source bank byte for above.
|
||||||
|
ItemTargetStack = $7ECB40 ; Pointers to VRAM targets for ItemGFXStack.
|
||||||
|
TotalItemCountTiles = $7ECF00 ; Cached total item count tiles for HUD. Four words high to low.
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
; Bank 7F
|
; Bank 7F
|
||||||
@@ -485,7 +488,6 @@ DecompressionBuffer = $7F0000 ; Decompression Buffer. $2000 bytes.
|
|||||||
|
|
||||||
DecompBuffer2 = $7F4000 ; Another buffer
|
DecompBuffer2 = $7F4000 ; Another buffer
|
||||||
|
|
||||||
|
|
||||||
base $7F5000
|
base $7F5000
|
||||||
RedrawFlag: skip 1 ;
|
RedrawFlag: skip 1 ;
|
||||||
skip 2 ; Unused
|
skip 2 ; Unused
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ SpritePrep_ShopKeeper:
|
|||||||
LDX.w #$0000
|
LDX.w #$0000
|
||||||
LDY.w #$0000
|
LDY.w #$0000
|
||||||
-
|
-
|
||||||
TYA : CMP.l ShopCapacity : !BLT ++ : JMP .stop : ++
|
TYA : CMP.l ShopCapacity : !BLT ++ : JMP .done : ++
|
||||||
LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .stop : ++
|
LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .done : ++
|
||||||
|
|
||||||
LDA.l ShopContentsTable, X : CMP.l ShopId : BEQ ++ : JMP .next : ++
|
LDA.l ShopContentsTable, X : CMP.l ShopId : BEQ ++ : JMP .next : ++
|
||||||
LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l ShopInventory, X : PLX
|
LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l ShopInventory, X : PLX
|
||||||
@@ -129,29 +129,23 @@ SpritePrep_ShopKeeper:
|
|||||||
++
|
++
|
||||||
PLY : +++
|
PLY : +++
|
||||||
|
|
||||||
PHX : PHY
|
PHX : PHY
|
||||||
PHX : TYX : LDA.l ShopInventory, X : PLX
|
PHX : TYX : LDA.l ShopInventory, X : PLX
|
||||||
SEP #$10
|
SEP #$10
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l AttemptItemSubstitution
|
||||||
TAY
|
JSL.l ResolveLootIDLong
|
||||||
REP #$30
|
TAY
|
||||||
LDA.b 1,s : TAX : LDA.l .tile_offsets, X : TAX
|
REP #$30
|
||||||
JSR.w SetupTileTransfer
|
LDA.b 1,s : TAX : LDA.l .tile_offsets, X : TAX
|
||||||
PLY : PLX
|
JSR.w SetupTileTransfer
|
||||||
INY #4
|
PLY : PLX
|
||||||
|
INY #4
|
||||||
.next
|
.next
|
||||||
INX #8
|
INX #8
|
||||||
JMP -
|
JMP -
|
||||||
.stop
|
|
||||||
REP #$20
|
|
||||||
LDA.w ItemQueuePtr
|
|
||||||
DEC #2
|
|
||||||
AND.w #$00E
|
|
||||||
STA.w ItemQueuePtr
|
|
||||||
SEP #$20
|
|
||||||
|
|
||||||
.done
|
.done
|
||||||
|
SEP #$20
|
||||||
LDA.l ShopType : BIT.b #$20 : BEQ .notTakeAll ; Take-all
|
LDA.l ShopType : BIT.b #$20 : BEQ .notTakeAll ; Take-all
|
||||||
.takeAll
|
.takeAll
|
||||||
|
|
||||||
@@ -199,19 +193,19 @@ SetupTileTransfer:
|
|||||||
TXA : LSR #2
|
TXA : LSR #2
|
||||||
CLC : ADC.w #!FREE_TILE_ALT
|
CLC : ADC.w #!FREE_TILE_ALT
|
||||||
.store_target
|
.store_target
|
||||||
LDX.w ItemQueuePtr
|
LDX.w ItemStackPtr
|
||||||
STA.w ItemTargetQueue,X
|
STA.l ItemTargetStack,X
|
||||||
|
|
||||||
TYA : ASL : TAX
|
TYA : ASL : TAX
|
||||||
LDA.l StandingItemGraphicsOffsets,X
|
LDA.l StandingItemGraphicsOffsets,X
|
||||||
LDX.w ItemQueuePtr
|
LDX.w ItemStackPtr
|
||||||
STA.w ItemGFXQueue,X
|
STA.l ItemGFXStack,X
|
||||||
|
|
||||||
TXA
|
TXA
|
||||||
INC #2
|
INC #2
|
||||||
AND.w #$000E
|
STA.l ItemStackPtr
|
||||||
STA.w ItemQueuePtr
|
|
||||||
TDC
|
LDA.w #$0000
|
||||||
REP #$10 ; set 16-bit index registers
|
REP #$10 ; set 16-bit index registers
|
||||||
SEP #$20
|
SEP #$20
|
||||||
RTS
|
RTS
|
||||||
@@ -561,6 +555,7 @@ Shopkeeper_DrawNextItem:
|
|||||||
PLY
|
PLY
|
||||||
|
|
||||||
LDA.l ShopInventory, X ; get item id
|
LDA.l ShopInventory, X ; get item id
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
STA.b Scrap0D
|
STA.b Scrap0D
|
||||||
CMP.b #$2E : BNE + : BRA .potion
|
CMP.b #$2E : BNE + : BRA .potion
|
||||||
|
|||||||
25
tables.asm
25
tables.asm
@@ -87,7 +87,6 @@ SmithItemMode:
|
|||||||
db $01 ; #$00 = Classic Tempering Process - #$01 = Quick Item Get (default)
|
db $01 ; #$00 = Classic Tempering Process - #$01 = Quick Item Get (default)
|
||||||
SmithItem:
|
SmithItem:
|
||||||
db $02 ; #$02 = Tempered Sword (default)
|
db $02 ; #$02 = Tempered Sword (default)
|
||||||
|
|
||||||
org $86B55C ; PC 0x3355C ; sprite_smithy_bros.asm : 634
|
org $86B55C ; PC 0x3355C ; sprite_smithy_bros.asm : 634
|
||||||
SmithSword:
|
SmithSword:
|
||||||
db $02 ; #$02 = Tempered Sword (default)
|
db $02 ; #$02 = Tempered Sword (default)
|
||||||
@@ -643,17 +642,17 @@ org $81C6FC ; PC 0xC6FC - Bank01.asm:10344 - (db $00, $00, $01, $02, $00, $06, $
|
|||||||
DungeonPrizeReceiptID:
|
DungeonPrizeReceiptID:
|
||||||
db $00 ; Sewers
|
db $00 ; Sewers
|
||||||
db $00 ; Hyrule Castle
|
db $00 ; Hyrule Castle
|
||||||
db $01 ; Eastern Palace
|
db $37 ; Eastern Palace
|
||||||
db $02 ; Desert Palace
|
db $38 ; Desert Palace
|
||||||
db $00 ; Agahnim's Tower
|
db $00 ; Agahnim's Tower
|
||||||
db $06 ; Swamp Palace
|
db $20 ; Swamp Palace
|
||||||
db $06 ; Palace of Darkness
|
db $20 ; Palace of Darkness
|
||||||
db $20 ; Misery Mire
|
db $20 ; Misery Mire
|
||||||
db $20 ; Skull Woods
|
db $20 ; Skull Woods
|
||||||
db $06 ; Ice Palace
|
db $20 ; Ice Palace
|
||||||
db $03 ; Tower of Hera
|
db $39 ; Tower of Hera
|
||||||
db $06 ; Thieves' Town
|
db $20 ; Thieves' Town
|
||||||
db $06 ; Turtle Rock
|
db $20 ; Turtle Rock
|
||||||
;Ether/Nothing: $00
|
;Ether/Nothing: $00
|
||||||
;Green Pendant: $01
|
;Green Pendant: $01
|
||||||
;Blue Pendant: $02
|
;Blue Pendant: $02
|
||||||
@@ -2600,10 +2599,14 @@ dw #$0C00 ; Blue
|
|||||||
dw #$1800 ; Green
|
dw #$1800 ; Green
|
||||||
dw #$0800 ; Yellow
|
dw #$0800 ; Yellow
|
||||||
|
|
||||||
org $B0F032
|
org $B0F032 ; PC 0x187032
|
||||||
|
RomSpeed:
|
||||||
|
db $01 ; $01 = FastROM (default) | $00 = SlowROM
|
||||||
|
|
||||||
|
org $B0F033 ; PC 0x187033
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; 0x187032 - 187FFF (unused)
|
; 0x187033 - 187FFF (unused)
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ RTS
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
SpawnTabletItem:
|
SpawnTabletItem:
|
||||||
JSL.l LoadOutdoorValue
|
JSL.l LoadOutdoorValue
|
||||||
|
JSL.l AttemptItemSubstitution
|
||||||
JSL.l ResolveLootIDLong
|
JSL.l ResolveLootIDLong
|
||||||
PHA
|
PHA
|
||||||
LDA.b #$EB : STA.l MiniGameTime
|
LDA.b #$EB : STA.l MiniGameTime
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
; out: A - Sprite GFX ID
|
; out: A - Sprite GFX ID
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
GetSpriteID:
|
GetSpriteID:
|
||||||
JSR.w AttemptItemSubstitution
|
JSL.l AttemptItemSubstitution
|
||||||
JSR.w ResolveLootID
|
JSR.w ResolveLootID
|
||||||
CMP.b #$6D : BEQ .server_F0 ; Server Request F0
|
CMP.b #$6D : BEQ .server_F0 ; Server Request F0
|
||||||
CMP.b #$6E : BEQ .server_F1 ; Server Request F1
|
CMP.b #$6E : BEQ .server_F1 ; Server Request F1
|
||||||
@@ -32,7 +32,7 @@ RTL
|
|||||||
; out: A - Palette
|
; out: A - Palette
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
GetSpritePalette:
|
GetSpritePalette:
|
||||||
JSR AttemptItemSubstitution
|
JSL.l AttemptItemSubstitution
|
||||||
JSR.w ResolveLootID
|
JSR.w ResolveLootID
|
||||||
.resolved
|
.resolved
|
||||||
TAX
|
TAX
|
||||||
@@ -69,6 +69,10 @@ RTL
|
|||||||
;-------------------------------------------------------------------------------- 20/847B
|
;-------------------------------------------------------------------------------- 20/847B
|
||||||
LoadDynamicTileOAMTable:
|
LoadDynamicTileOAMTable:
|
||||||
PHP
|
PHP
|
||||||
|
REP #$20
|
||||||
|
LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2
|
||||||
|
LDA.w #$0200 : STA.l SpriteOAM+6
|
||||||
|
SEP #$20
|
||||||
LDA.b #$24 : STA.l SpriteOAM+4
|
LDA.b #$24 : STA.l SpriteOAM+4
|
||||||
|
|
||||||
LDA.w SpriteID,X
|
LDA.w SpriteID,X
|
||||||
@@ -76,27 +80,23 @@ LoadDynamicTileOAMTable:
|
|||||||
STA.l SpriteOAM+5 : STA.l SpriteOAM+13
|
STA.l SpriteOAM+5 : STA.l SpriteOAM+13
|
||||||
PHX
|
PHX
|
||||||
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
|
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
|
||||||
REP #$20
|
|
||||||
LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2
|
|
||||||
LDA.w #$0200 : STA.l SpriteOAM+6
|
|
||||||
BRA .done
|
BRA .done
|
||||||
|
|
||||||
.narrow
|
.narrow
|
||||||
REP #$20
|
REP #$20
|
||||||
LDA.w #$0004 : STA.l SpriteOAM
|
|
||||||
LDA.w #$0000 : STA.l SpriteOAM+2
|
|
||||||
LDA.w #$0200 : STA.l SpriteOAM+6
|
|
||||||
|
|
||||||
LDA.w #$0400 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14
|
LDA.w #$0400 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14
|
||||||
|
LDA.w #$0000 : STA.l SpriteOAM+14
|
||||||
LDA.w #$0800 : STA.l SpriteOAM+9
|
LDA.w #$0800 : STA.l SpriteOAM+9
|
||||||
LDA.w #$3400 : STA.l SpriteOAM+11
|
LDA.w #$3400 : STA.l SpriteOAM+11
|
||||||
|
|
||||||
|
SEP #$20
|
||||||
|
LDA.b #$04 : STA.l SpriteOAM
|
||||||
|
|
||||||
.done
|
.done
|
||||||
TXA
|
TXA
|
||||||
PLX
|
PLX
|
||||||
PLP
|
PLP
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; DrawDynamicTile
|
; DrawDynamicTile
|
||||||
; in: A - Loot ID
|
; in: A - Loot ID
|
||||||
@@ -359,23 +359,26 @@ LoadItemPalette:
|
|||||||
; Out: A - Sprite palette index
|
; Out: A - Sprite palette index
|
||||||
PHX : PHY : PHB
|
PHX : PHY : PHB
|
||||||
LDA.b #PalettesVanillaBank>>16 : STA.b Scrap0C
|
LDA.b #PalettesVanillaBank>>16 : STA.b Scrap0C
|
||||||
LDA.b #$7E
|
PEA $7E00
|
||||||
PHA : PLB
|
PLB : PLB
|
||||||
REP #$30
|
REP #$30
|
||||||
|
|
||||||
TXA : ASL : TAX
|
TXA : ASL : TAX
|
||||||
LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A
|
LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A
|
||||||
LDY.w #$000E
|
LDY.w #$000E
|
||||||
|
LDA.w RoomIndex : CMP.w #$008C : BEQ .aux
|
||||||
LDA.w TransparencyFlag : BNE .SP05
|
LDA.w TransparencyFlag : BNE .SP05
|
||||||
-
|
-
|
||||||
LDA.b [Scrap0A], Y : STA.w PaletteBuffer+$0170,Y
|
LDA.b [Scrap0A], Y
|
||||||
|
STA.w PaletteBuffer+$0170,Y
|
||||||
DEY #2
|
DEY #2
|
||||||
BPL -
|
BPL -
|
||||||
LDA.w #$0003
|
LDA.w #$0003
|
||||||
BRA .done
|
BRA .done
|
||||||
.SP05
|
.SP05
|
||||||
-
|
-
|
||||||
LDA.b [Scrap0A], Y : STA.w PaletteBuffer+$01B0,Y
|
LDA.b [Scrap0A], Y
|
||||||
|
STA.w PaletteBuffer+$01B0,Y
|
||||||
DEY #2
|
DEY #2
|
||||||
BPL -
|
BPL -
|
||||||
LDA.w #$0005
|
LDA.w #$0005
|
||||||
@@ -384,6 +387,23 @@ LoadItemPalette:
|
|||||||
PLB : PLY : PLX
|
PLB : PLY : PLX
|
||||||
INC.b NMICGRAM
|
INC.b NMICGRAM
|
||||||
RTL
|
RTL
|
||||||
|
.aux
|
||||||
|
LDA.w TransparencyFlag : BNE .SP05_aux
|
||||||
|
-
|
||||||
|
LDA.b [Scrap0A], Y
|
||||||
|
STA.w PaletteBufferAux+$0170,Y
|
||||||
|
DEY #2
|
||||||
|
BPL -
|
||||||
|
LDA.w #$0003
|
||||||
|
BRA .done
|
||||||
|
.SP05_aux
|
||||||
|
-
|
||||||
|
LDA.b [Scrap0A], Y
|
||||||
|
STA.w PaletteBufferAux+$01B0,Y
|
||||||
|
DEY #2
|
||||||
|
BPL -
|
||||||
|
LDA.w #$0005
|
||||||
|
BRA .done
|
||||||
|
|
||||||
TransferVRAMStripes:
|
TransferVRAMStripes:
|
||||||
JSL.l TransferNewNameStripes
|
JSL.l TransferNewNameStripes
|
||||||
|
|||||||
@@ -164,6 +164,8 @@ RenderText_DecompressAndDrawSingle = $8EF4FB
|
|||||||
DecompressFontGFX = $8EF572
|
DecompressFontGFX = $8EF572
|
||||||
CopyDecompressedCharToTransferBuffer = $8EF5BC
|
CopyDecompressedCharToTransferBuffer = $8EF5BC
|
||||||
CopyDecompressedToFullBuffer = $8EF6A8
|
CopyDecompressedToFullBuffer = $8EF6A8
|
||||||
|
Trinexx_FinalPhase = $9DADB5
|
||||||
|
Trinexx_PreFinalPhase = $9DB0D2
|
||||||
|
|
||||||
;===================================================================================================
|
;===================================================================================================
|
||||||
; Palettes
|
; Palettes
|
||||||
|
|||||||
Reference in New Issue
Block a user