Skip to content

Commit e5afebb

Browse files
committed
don't open when can't carry
1 parent 35fafb1 commit e5afebb

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

FF1Lib/GlobalImprovements.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public void EnableIdentifyTreasures(DialogueData dialogues)
108108
public void EnableChestsAppearOpened()
109109
{
110110
// Open chest routine
111-
PutInBank(0x1F, 0xCBF9, Blob.FromHex("A9112003FE4C8CB9"));
112-
PutInBank(0x11, 0xB98C, Blob.FromHex("A645BD00622904F003A9F2602078DD48A52F186907A8A533C908D004884CB1B9C904D001C898C90F9002E90FA8A514291FC910B00E0A19E2D5850EB9F2D5850F4CDEB9290F0A19E2D5850EB9F2D50904850F20A8FEAD0220A50F8D0620A50E8D0620A97E8D0720A97F8D072020A1CC6860"));
111+
PutInBank(0x1F, 0xCBF9, Blob.FromHex("A9112003FE4C8AB9"));
112+
PutInBank(0x11, 0xB98A, Blob.FromHex("A645BD00622904F003A9F2602078DDC9F1F06148A52F186907A8A533C908D004884CB3B9C904D001C898C90F9002E90FA8A514291FC910B00E0A19E2D5850EB9F2D5850F4CE0B9290F0A19E2D5850EB9F2D50904850F20A8FEAD0220A50F8D0620A50E8D0620A97E8D0720A97F8D072020A1CC6860"));
113113

114114
// Map loading routine
115115
PutInBank(0x1F, 0xCC45, Blob.FromHex("A9112003FE4C40B9"));

FF1Lib/asm/11_B940_ChestsAppearOpened.asm

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ lut_NTHi = $D5F2
1515
unsram = $6000 ; $400 bytes
1616
game_flags = unsram+$0200
1717
GMFLG_TCOPEN = %00000100
18+
DLGID_TCGET = $F0 ; "In this chest you find..."
19+
DLGID_CANTCARRY = $F1 ; "You can't carry anymore"
1820
DLGID_EMPTYTC = $F2 ; "this treasure chest is empty"
1921

2022
SwapPRG = $FE03
@@ -161,9 +163,9 @@ ReplaceOpenedChestTSA:
161163
JSR SwapPRG
162164
JMP WrapOpenTreasureChest
163165

164-
; A9 11 20 03 FE 4C 8C B9
166+
; A9 11 20 03 FE 4C 8A B9
165167

166-
.ORG $B98C
168+
.ORG $B98A
167169
WrapOpenTreasureChest:
168170
; Replicate the patched out code
169171
LDX tileprop+1 ; put the chest ID in X
@@ -175,6 +177,8 @@ WrapOpenTreasureChest:
175177

176178
; Now we call the original OpenTreasureChest
177179
: JSR OpenTreasureChest
180+
CMP #DLGID_CANTCARRY
181+
BEQ @End
178182
PHA ; save whatever the return value was from OpenTreasureChest
179183
; So that we can come back here and draw the new tiles
180184
LDA scroll_y ; get the scroll value to see where the player is
@@ -233,9 +237,11 @@ WrapOpenTreasureChest:
233237

234238
JSR SetSMScroll ; reset the scroll (don't know why this is needed, but it prevents flicker)
235239
PLA ; restore the return value from OpenTreasureChest
240+
@End:
236241
RTS
237242

238-
; A6 45 BD 00 62 29 04 F0 03 A9 F2 60 20 78 DD 48 A5 2F 18 69 07 A8 A5 33 C9 08 D0 04 88 4C B1 B9
239-
; C9 04 D0 01 C8 98 C9 0F 90 02 E9 0F A8 A5 14 29 1F C9 10 B0 0E 0A 19 E2 D5 85 0E B9 F2 D5 85 0F
240-
; 4C DE B9 29 0F 0A 19 E2 D5 85 0E B9 F2 D5 09 04 85 0F 20 A8 FE AD 02 20 A5 0F 8D 06 20 A5 0E 8D
241-
; 06 20 A9 7E 8D 07 20 A9 7F 8D 07 20 20 A1 CC 68 60
243+
; A6 45 BD 00 62 29 04 F0 03 A9 F2 60 20 78 DD C9 F1 F0 61 48 A5 2F 18 69 07 A8 A5 33 C9 08 D0 04
244+
; 88 4C B3 B9 C9 04 D0 01 C8 98 C9 0F 90 02 E9 0F A8 A5 14 29 1F C9 10 B0 0E 0A 19 E2 D5 85 0E B9
245+
; F2 D5 85 0F 4C E0 B9 29 0F 0A 19 E2 D5 85 0E B9 F2 D5 09 04 85 0F 20 A8 FE AD 02 20 A5 0F 8D 06
246+
; 20 A5 0E 8D 06 20 A9 7E 8D 07 20 A9 7F 8D 07 20 20 A1 CC 68 60
247+

0 commit comments

Comments
 (0)