let's dev 1/18/18

updated item limits
updated goal item counter
disabled replacement shopkeeper left on
fixed ice cave water walk setup
This commit is contained in:
Karkat
2018-01-18 00:03:34 -05:00
parent 471c14d790
commit 39b20f9a05
7 changed files with 91 additions and 24 deletions

View File

@@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF
db #$00 ; expand file to 2mb db #$00 ; expand file to 2mb
org $1FFFF8 ; <- FFFF8 timestamp rom org $1FFFF8 ; <- FFFF8 timestamp rom
db #$20, #$18, #$01, #$17 ; year/month/day db #$20, #$18, #$01, #$18 ; year/month/day
;================================================================================ ;================================================================================
@@ -65,6 +65,10 @@ db #$20, #$18, #$01, #$17 ; year/month/day
!FORCE_HEART_SPAWN = "$7F5033"; !FORCE_HEART_SPAWN = "$7F5033";
!SKIP_HEART_SAVE = "$7F5034"; !SKIP_HEART_SAVE = "$7F5034";
!INVENTORY_SWAP = "$7EF38C"
!INVENTORY_SWAP_2 = "$7EF38E"
!ITEM_LIMIT_COUNTS = "$7EF390"
;================================================================================ ;================================================================================
incsrc hooks.asm incsrc hooks.asm

View File

@@ -2,34 +2,36 @@
; $7F5010 - Scratch Space (Callee Preserved) ; $7F5010 - Scratch Space (Callee Preserved)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!GOAL_COUNTER = "$7EF460" !GOAL_COUNTER = "$7EF460"
!DRAW_ADDRESS = "$7EC72A"
DrawGoalIndicator: DrawGoalIndicator:
LDA.l GoalItemRequirement : AND.w #$00FF : BNE + : RTL : + ; Star Meter LDA.l GoalItemRequirement : AND.w #$00FF : BNE + : RTL : + ; Star Meter
PHX PHX
LDX.w #$0000 LDX.w #$0000
LDA.l GoalItemIcon : STA $7EC72C, X : INX #2 ; draw star icon and move the cursor LDA.l GoalItemIcon : STA !DRAW_ADDRESS, X : INX #2 ; draw star icon and move the cursor
LDA.l !GOAL_COUNTER LDA.l !GOAL_COUNTER
AND.w #$00FF AND.w #$00FF
JSL.l HexToDec JSL.l HexToDec
LDA $7F5005 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor LDA $7F5005 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 100's digit and move the cursor
LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 10's digit and move the cursor
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 1's and move the cursor
LDA.l GoalItemRequirement : AND.w #$00FF : CMP.w #$00FF : BEQ .skip LDA.l GoalItemRequirement : AND.w #$00FF : CMP.w #$00FF : BEQ .skip
LDA.w #$2830 : STA $7EC72C, X : INX #2 ; draw slash and move the cursor LDA.w #$2830 : STA !DRAW_ADDRESS, X : INX #2 ; draw slash and move the cursor
LDA.l GoalItemRequirement LDA.l GoalItemRequirement
AND.w #$00FF AND.w #$00FF
JSL.l HexToDec JSL.l HexToDec
LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor LDA $7F5005 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 100's digit and move the cursor
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 10's digit and move the cursor
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA !DRAW_ADDRESS, X : INX #2 ; draw 1's and move the cursor
BRA .done BRA .done
.skip .skip
LDA.w #$207F LDA.w #$207F
STA $7EC72C, X : INX # STA !DRAW_ADDRESS, X : INX #
STA $7EC72C, X : INX # STA !DRAW_ADDRESS, X : INX #
STA $7EC72C, X : INX # STA !DRAW_ADDRESS, X : INX #
.done .done
PLX PLX
RTL RTL

View File

@@ -1042,11 +1042,11 @@ JSL.l GetMagicBatItem
;================================================================================ ;================================================================================
; Replacement Shopkeeper ; Replacement Shopkeeper
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $068BEB ; <- 30BEB - Bank07.asm:1125 - (INC $0BA0, X) ;org $068BEB ; <- 30BEB - Bank07.asm:1125 - (INC $0BA0, X)
JSL.l SpritePrep_ShopKeeper : RTS ;JSL.l SpritePrep_ShopKeeper : RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $1EEEE3 ; <- F6EE3 - sprite_shopkeeper.asm:7 - (LDA $0E80, X) ;org $1EEEE3 ; <- F6EE3 - sprite_shopkeeper.asm:7 - (LDA $0E80, X)
JSL.l Sprite_ShopKeeper : RTS ;JSL.l Sprite_ShopKeeper : RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================

View File

@@ -348,7 +348,14 @@ AddReceivedItemExpanded:
{ {
PHA : PHX PHA : PHX
JSL.l PreItemGet JSL.l PreItemGet
LDA $02D8 : CMP.b #$16 : BNE ++ ; Bottle
LDA $02D8 ; Item Value
JSR AttemptItemSubstitution
STA $02D8
JSR IncrementItemCounters
CMP.b #$16 : BNE ++ ; Bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8 LDA.l BottleLimitReplacement : STA $02D8
+++ : BRL .done +++ : BRL .done
@@ -780,7 +787,7 @@ Link_ReceiveItemAlternatesExpanded:
db -1 ; Master Sword (Safe) db -1 ; Master Sword (Safe)
db -1, -1, -1, -1 ; +5/+10 Bomb Arrows db -1, -1, -1, -1 ; +5/+10 Bomb Arrows
db -1, -1, -1 ; 3x Programmable Item db -1, -1, -1 ; 3x Programmable Item
db -1 ; Upgrade-Only Sivler Arrows db -1 ; Upgrade-Only Silver Arrows
db -1 ; 1 Rupoor db -1 ; 1 Rupoor
db -1 ; Null Item db -1 ; Null Item
db -1, -1, -1 ; Red, Blue & Green Clocks db -1, -1, -1 ; Red, Blue & Green Clocks
@@ -801,7 +808,10 @@ Link_ReceiveItemAlternatesExpanded:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
.loadAlternate .loadAlternate
PHB : PHK : PLB PHB : PHK : PLB
LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03 ;TYA : JSR IncrementItemCounters
;LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03
TYA : JSR AttemptItemSubstitution : STA $03
CPY $03 : BNE + : LDA.b #$FF : STA $03 : +
PLB PLB
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -915,6 +925,49 @@ GetRNGItemMulti:
TAX : XBA : LDA.l RNGMultiItemTable, X TAX : XBA : LDA.l RNGMultiItemTable, X
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
IncrementItemCounters:
PHX : PHA
LDX.b #$00
-
LDA.l ItemSubstitutionRules, X
CMP.b #$FF : BEQ .exit
CMP 1,s : BNE .noMatch
.match
PHX
TXA : LSR #2 : TAX
LDA !ITEM_LIMIT_COUNTS, X : INC : STA !ITEM_LIMIT_COUNTS, X
PLX
BEQ .exit
.noMatch
INX #4
BRA -
.exit
PLA : PLX
RTS
;--------------------------------------------------------------------------------
AttemptItemSubstitution:
PHX : PHA
LDX.b #$00
-
LDA.l ItemSubstitutionRules, X
CMP.b #$FF : BEQ .exit
CMP 1,s : BNE .noMatch
.match
PHX
TXA : LSR #2 : TAX
LDA !ITEM_LIMIT_COUNTS, X
CMP.l ItemSubstitutionRules+1, X : !BLT +
LDA.l ItemSubstitutionRules+2, X : STA 2,s
+
PLX
BEQ .exit
.noMatch
INX #4
BRA -
.exit
PLA : PLX
RTS
;--------------------------------------------------------------------------------
CountBottles: CountBottles:
LDX.b #$00 LDX.b #$00
LDA $7EF35C : BEQ ++ : INX LDA $7EF35C : BEQ ++ : INX

View File

@@ -189,8 +189,10 @@ DungeonStairsTransition:
JSL Dungeon_SaveRoomQuadrantData JSL Dungeon_SaveRoomQuadrantData
BRA StatTransitionCounter BRA StatTransitionCounter
DungeonExitTransition: DungeonExitTransition:
LDA $7F50C7 : BEQ + ; ice physics
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
LDA.b #$00 : STA $0301 ; stop item dashing LDA.b #$00 : STA $0301 ; stop item dashing
+
LDA.b #$0F : STA $10 ; stop running through the transition LDA.b #$0F : STA $10 ; stop running through the transition
StatTransitionCounter: StatTransitionCounter:
PHA : PHP PHA : PHP

View File

@@ -691,7 +691,7 @@ StandingKey_Hera:
;================================================================================ ;================================================================================
org $308165 ; PC 0x180165 org $308165 ; PC 0x180165
GoalItemIcon: GoalItemIcon:
dw #$280E ; #$280D = Star (default) - #$280E = Triforce Piece dw #$280E ; #$280D = Star - #$280E = Triforce Piece (default)
;================================================================================ ;================================================================================
org $308167 ; PC 0x180167 org $308167 ; PC 0x180167
GoalItemRequirement: GoalItemRequirement:
@@ -1347,3 +1347,9 @@ dw $0000, $0000, $0000, $0000, $F800, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000 dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000 dw $0000, $0000
;=============================================================================== ;===============================================================================
org $30C000 ; PC 0x184000 - 0x184007
ItemSubstitutionRules:
;db [item][quantity][substitution][pad]
db $12, $01, $35, $FF
db $FF, $FF, $FF, $FF
;================================================================================

View File

@@ -8,7 +8,7 @@
; out: A - Sprite GFX ID ; out: A - Sprite GFX ID
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetSpriteID: GetSpriteID:
JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -143,7 +143,7 @@ RTL
; out: A - Palette ; out: A - Palette
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetSpritePalette: GetSpritePalette:
JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -265,7 +265,7 @@ RTL
IsNarrowSprite: IsNarrowSprite:
PHA : PHX PHA : PHX
PHB : PHK : PLB PHB : PHK : PLB
JSR AttemptItemSubstitution
;-------- ;--------
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle