@gaialabs/iog-baserom 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/baserom/auto-use-items/CellKeysAutoUse.patch.asm +30 -0
- package/baserom/auto-use-items/CrystalBallAutoUse.patch.asm +131 -0
- package/baserom/auto-use-items/DiamondBlockAutoUse.patch.asm +50 -0
- package/baserom/auto-use-items/ElevatorKeyAutoUse.patch.asm +26 -0
- package/baserom/auto-use-items/GorgonFlowerAutoUse.patch.asm +153 -0
- package/baserom/auto-use-items/HieroglyphPuzzle.patch.asm +1187 -0
- package/baserom/auto-use-items/HopeStatueAutoUse.patch.asm +99 -0
- package/baserom/auto-use-items/IncanStatueAutoUse.patch.asm +75 -0
- package/baserom/auto-use-items/ItemUseStub.patch.asm +24 -0
- package/baserom/auto-use-items/MagicPowerAutoUse.patch.asm +55 -0
- package/baserom/auto-use-items/MeatAutoUse.patch.asm +33 -0
- package/baserom/auto-use-items/MushroomDropAutoUse.patch.asm +100 -0
- package/baserom/auto-use-items/PalaceKeyAutoUse.patch.asm +52 -0
- package/baserom/auto-use-items/PrisonKeyAutoUse.patch.asm +84 -0
- package/baserom/auto-use-items/PurificationStoneAutoUse.patch.asm +49 -0
- package/baserom/auto-use-items/RamaStatueAutoUse.patch.asm +100 -0
- package/baserom/auto-use-items/TearpotAutoUse.patch.asm +41 -0
- package/baserom/{spritemaps → boot-logo}/spm_boot_logos.sprite.asm +10 -0
- package/baserom/collectible-system/RelicMenu.patch.asm +250 -0
- package/baserom/collectible-system/key_item_core.asm +445 -0
- package/baserom/{patches → equipped-icon}/EquippedIcon.patch.asm +41 -46
- package/baserom/equipped-icon/ItemSwapping.patch.asm +99 -0
- package/baserom/{palettes → equipped-icon}/pal_item_exprite2.pal +0 -0
- package/baserom/{spritemaps → equipped-icon}/spm_sc02_main_characters.sprite.asm +10 -0
- package/baserom/equipped-icon/spriteset_aura.asm +131 -0
- package/baserom/equipped-icon/spriteset_dark_friar.asm +277 -0
- package/baserom/equipped-icon/spriteset_darkgaia_projectile.asm +233 -0
- package/baserom/fixes-tweaks/BCDHex.patch.asm +60 -0
- package/baserom/fixes-tweaks/HudRedesign.patch.asm +108 -0
- package/baserom/fixes-tweaks/NeilsFatherFix.patch.asm +26 -0
- package/baserom/fixes-tweaks/PyramidPortalExit.patch.asm +41 -0
- package/baserom/fixes-tweaks/SceneTitles.patch.asm +84 -0
- package/baserom/fixes-tweaks/ThankfulFlower.patch.asm +28 -0
- package/baserom/fixes-tweaks/Utils.patch.asm +111 -0
- package/baserom/{spritemaps → fixes-tweaks}/spm_goldship_sprites.sprite.asm +11 -0
- package/baserom/fonts/EnhancedOverworldText.patch.asm +44 -0
- package/baserom/fonts/EnhancedPrologueText.patch.asm +252 -0
- package/baserom/{graphics → fonts}/gfx_fonts.bin +0 -0
- package/baserom/fonts/gfx_overworld_font.bin +0 -0
- package/baserom/inventory/EnhancedSlotActor.patch.asm +50 -0
- package/baserom/inventory/InventoryCounters.patch.asm +407 -0
- package/baserom/inventory/InventoryManagement.patch.asm +390 -0
- package/baserom/kara-run/gfx_castle_sprites.bin +0 -0
- package/baserom/new-game-plus/NGPEpilogueSwitch.patch.asm +52 -0
- package/baserom/{patches → new-game-plus}/NewGamePlus.patch.asm +42 -23
- package/baserom/oakton/map_fr30.map +0 -0
- package/baserom/oakton/map_fr30_effect.map +0 -0
- package/baserom/options-menu/EnhancedInvItemPicker.patch.asm +130 -0
- package/baserom/options-menu/MinimalHudOption.patch.asm +109 -0
- package/baserom/options-menu/OptionsMenu.patch.asm +218 -0
- package/baserom/options-menu/TextSpeedOption.patch.asm +108 -0
- package/baserom/options-menu/options_input_remap.asm +373 -0
- package/baserom/options-menu/options_menu_core.asm +1221 -0
- package/baserom/patches/APUWaitFixes.patch.asm +30 -17
- package/baserom/patches/AccentMap.patch.asm +16 -5
- package/baserom/patches/MusicTransitions.patch.asm +41 -24
- package/baserom/player-input/MergeInputFlags.patch.asm +146 -0
- package/baserom/player-input/PlayerInput.patch.asm +51 -0
- package/baserom/red-jewels/AnnSparkle.patch.asm +28 -0
- package/baserom/red-jewels/ChestFlaggedHiddenRedJewel.patch.asm +50 -0
- package/baserom/red-jewels/FishermanRedJewel.patch.asm +55 -0
- package/baserom/red-jewels/LanceSparkle.patch.asm +38 -0
- package/baserom/red-jewels/RedJewelSparkle.patch.asm +49 -0
- package/baserom/red-jewels/SnakePanicSparkle.patch.asm +45 -0
- package/baserom/red-jewels/SparkleAlways.patch.asm.example +19 -0
- package/baserom/red-jewels/StoneGirlSparkle.patch.asm +26 -0
- package/baserom/red-jewels/TrappedSlaveSparkle.patch.asm +63 -0
- package/baserom/red-jewels/generic_sparkle.asm +57 -0
- package/baserom/run-button/RunButtonCore.patch.asm +89 -0
- package/baserom/run-button/RunButtonOption.patch.asm +50 -0
- package/baserom/{patches/BitmapPatch.patch.asm → scene-load/BitmapLoad.patch.asm} +27 -12
- package/baserom/scene-load/Cop51Decompress.patch.asm +98 -0
- package/baserom/scene-load/ExpriteLoader.patch.asm +82 -0
- package/baserom/scene-load/MapNameLookup.patch.asm +27 -0
- package/baserom/scene-load/MenuBGLoad.patch.asm +70 -0
- package/baserom/scene-load/SFXTable.patch.asm +92 -0
- package/baserom/scene-load/SceneMetaLoad.patch.asm +68 -0
- package/baserom/scene-load/SpritemapLoad.patch.asm +61 -0
- package/baserom/scene-load/TilemapLoad.patch.asm +109 -0
- package/baserom/scene-load/TilesetLoad.patch.asm +41 -0
- package/baserom/set_overworld.set +0 -0
- package/baserom/seths-jewel/SethsJewelGoldShip.patch.asm +22 -0
- package/baserom/seths-jewel/SethsJewelIcon.patch.asm +22 -0
- package/baserom/seths-jewel/SethsJewelItem.patch.asm +62 -0
- package/baserom/seths-jewel/SethsJewelSprites.patch.asm +49 -0
- package/baserom/{patches → sky-delivery}/SouthCapeDeliveryman.patch.asm +12 -3
- package/baserom/sky-delivery/WatermiaDeliveryman.patch.asm +15 -0
- package/dist/index.cjs +10159 -964
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10161 -967
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -8
- package/baserom/asm/spriteset_aura.asm +0 -122
- package/baserom/asm/spriteset_dark_friar.asm +0 -268
- package/baserom/asm/spriteset_will_projectile.asm +0 -224
- package/baserom/patches/Cop51Patch.patch.asm +0 -81
- package/baserom/patches/DPShop.asm.old +0 -328
- package/baserom/patches/DeathWarp.asm.old +0 -174
- package/baserom/patches/ExpandedHealthBars.old +0 -203
- package/baserom/patches/ExpriteLoader.patch.asm +0 -66
- package/baserom/patches/GemShop.asm.old +0 -345
- package/baserom/patches/InventoryCounters.patch.asm +0 -292
- package/baserom/patches/InventoryManagement.patch.asm +0 -324
- package/baserom/patches/InventoryScript.asm.old +0 -319
- package/baserom/patches/ItemDictionary.asm.old +0 -86
- package/baserom/patches/ItemRewards.asm.old +0 -49
- package/baserom/patches/ItemSwapping.patch.asm +0 -80
- package/baserom/patches/MapNameLookup.patch.asm +0 -13
- package/baserom/patches/MenuBGPatch.patch.asm +0 -54
- package/baserom/patches/NGPEpilogueSwitch.patch.asm +0 -44
- package/baserom/patches/PixelConverter.patch.asm.old +0 -60
- package/baserom/patches/QuickScripts.asm.old +0 -210
- package/baserom/patches/RunButton.patch.asm +0 -79
- package/baserom/patches/SFXTable.patch.asm +0 -73
- package/baserom/patches/SceneLoadPatch.patch.asm +0 -52
- package/baserom/patches/SpritemapPatch.patch.asm +0 -45
- package/baserom/patches/Teleporter.patch.asm.old +0 -203
- package/baserom/patches/TilemapPatch.patch.asm +0 -94
- package/baserom/patches/TilesetPatch.patch.asm +0 -27
- package/baserom/patches/Utils.patch.asm +0 -414
- package/baserom/patches/WatermiaDeliveryman.patch.asm +0 -2
- /package/baserom/{graphics → boot-logo}/gfx_boot_exprite.raw.bin +0 -0
- /package/baserom/{graphics → boot-logo}/gfx_boot_logos.bin +0 -0
- /package/baserom/{palettes → boot-logo}/pal_boot_logos.pal +0 -0
- /package/baserom/{palettes → equipped-icon}/fx_palette_198000.pal +0 -0
- /package/baserom/{graphics → equipped-icon}/gfx_item_exprite.raw.bin +0 -0
- /package/baserom/{graphics → equipped-icon}/misc_fx_1CD580.bin +0 -0
- /package/baserom/{palettes → equipped-icon}/pal_item_exprite.pal +0 -0
- /package/baserom/{palettes → equipped-icon}/pal_sc02_main_characters.pal +0 -0
- /package/baserom/{graphics → fonts}/gfx_credits_font.bin +0 -0
- /package/baserom/{graphics → inventory}/gfx_inventory_sprites.bin +0 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
; ==============================================================================
|
|
2
|
+
; Key item / relic flag core - buckets, pickup, and inventory display helpers
|
|
3
|
+
; ==============================================================================
|
|
4
|
+
; What it does: Maps inventory item IDs to bit indices in WRAM key_item_flags ($0B58),
|
|
5
|
+
; groups them into buckets for stacked menu display, and exposes Test/Set helpers used
|
|
6
|
+
; when giving key items and when RelicMenu animates multi-relic slots.
|
|
7
|
+
; Vanilla behavior: (new baserom data and routines; not in extracted ROM as this layout.)
|
|
8
|
+
; Adds: KeyItemFlagIndex, KeyBucket* tables, KeyItemGetNext, KeyItemTestFlag(Wrapper),
|
|
9
|
+
; KeyItemCountAndInit, KeyItemCheckAndStore (hooks inventory store for flagged items).
|
|
10
|
+
; Depends on: BitMaskTable; InventoryCheckAndStore for non-revoke items; tag key_item_flags.
|
|
11
|
+
; State: $0B58+ nibble bytes hold per-relic acquisition bits (see KeyItemCounters comments).
|
|
12
|
+
; Hazards/notes: KeyItemTestFlag assumes M=8 on entry; KeyItemCheckAndStore uses stack layout.
|
|
13
|
+
; ==============================================================================
|
|
14
|
+
|
|
15
|
+
!key_item_flags 0B58
|
|
16
|
+
|
|
17
|
+
-------------------------------------------
|
|
18
|
+
|
|
19
|
+
--KeyItemCounters
|
|
20
|
+
; 00000001 = Prison Key
|
|
21
|
+
; 00000010 = Meat
|
|
22
|
+
; 00000100 = Incan Statue A
|
|
23
|
+
; 00001000 = Incan Statue B
|
|
24
|
+
; 00010000 = Diamond Block
|
|
25
|
+
; 00100000 = Elevator Key
|
|
26
|
+
; 01000000 = Mine Key A
|
|
27
|
+
; 10000000 = Mine Key B
|
|
28
|
+
|
|
29
|
+
; 00001111 = Crystal Balls
|
|
30
|
+
; 00010000 = Purify Stone
|
|
31
|
+
; 00100000 = Palace Key
|
|
32
|
+
; 11000000 = Statue of Hope
|
|
33
|
+
|
|
34
|
+
; 00000011 = Rama Statue
|
|
35
|
+
; 00000100 = Magic Dust
|
|
36
|
+
; 00111000 = Mushroom Drops
|
|
37
|
+
; 01000000 = Teapot
|
|
38
|
+
; 10000000 = Gorgon Flower
|
|
39
|
+
|
|
40
|
+
; 00111111 = Hieroglyphs
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
KeyItemFlagIndex [
|
|
44
|
+
#FF
|
|
45
|
+
#FF
|
|
46
|
+
#00
|
|
47
|
+
#02
|
|
48
|
+
#03
|
|
49
|
+
#FF
|
|
50
|
+
#FF
|
|
51
|
+
#04
|
|
52
|
+
#FF
|
|
53
|
+
#FF
|
|
54
|
+
#01
|
|
55
|
+
#06
|
|
56
|
+
#07
|
|
57
|
+
#FF
|
|
58
|
+
#08
|
|
59
|
+
#05
|
|
60
|
+
#0D ;10
|
|
61
|
+
#0C
|
|
62
|
+
#0E
|
|
63
|
+
#10
|
|
64
|
+
#12
|
|
65
|
+
#FF
|
|
66
|
+
#FF
|
|
67
|
+
#FF
|
|
68
|
+
#FF
|
|
69
|
+
#16
|
|
70
|
+
#13
|
|
71
|
+
#FF
|
|
72
|
+
#FF
|
|
73
|
+
#17
|
|
74
|
+
#18
|
|
75
|
+
#19
|
|
76
|
+
#1A ;20
|
|
77
|
+
#1B
|
|
78
|
+
#1C
|
|
79
|
+
#1D
|
|
80
|
+
#FF
|
|
81
|
+
#FF
|
|
82
|
+
#FF
|
|
83
|
+
#FF
|
|
84
|
+
#FF
|
|
85
|
+
#FF
|
|
86
|
+
#FF
|
|
87
|
+
#FF
|
|
88
|
+
#FF
|
|
89
|
+
#FF
|
|
90
|
+
#FF
|
|
91
|
+
#FF
|
|
92
|
+
#FF ;30
|
|
93
|
+
#FF
|
|
94
|
+
#FF
|
|
95
|
+
#FF
|
|
96
|
+
#FF
|
|
97
|
+
#FF
|
|
98
|
+
#FF
|
|
99
|
+
#FF
|
|
100
|
+
#FF
|
|
101
|
+
#FF
|
|
102
|
+
#FF
|
|
103
|
+
#FF
|
|
104
|
+
#FF
|
|
105
|
+
#FF
|
|
106
|
+
#FF
|
|
107
|
+
#FF
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
KeyBucketLookup [
|
|
111
|
+
&KeyBucketPrisonKey ; +1 DEF
|
|
112
|
+
&KeyBucketMeat ; +1 HP
|
|
113
|
+
&KeyBucketIncanStatues ; +1 ATK / +1 DEF
|
|
114
|
+
&KeyBucketDiamondBlock ; +2 ATK
|
|
115
|
+
|
|
116
|
+
&KeyBucketElevatorKey ; +2 HP
|
|
117
|
+
&KeyBucketMineKeys ; +2 ATK / +2 DEF
|
|
118
|
+
&KeyBucketCrystalBall ; +4 HP
|
|
119
|
+
&KeyBucketPurifyStone ; +0.5 Sec IFrames
|
|
120
|
+
|
|
121
|
+
&KeyBucketPalaceKey ; +4 DEF
|
|
122
|
+
&KeyBucketHopeStatues ; +2 HP / +2 DEF
|
|
123
|
+
&KeyBucketRamaStatues ; +4 ATK
|
|
124
|
+
&KeyBucketMagicDust ; Reduces knockback
|
|
125
|
+
|
|
126
|
+
&KeyBucketMushroomDrops ; +2 ATK / +2 DEF / +2 HP
|
|
127
|
+
&KeyBucketTeapot ; Reduces charge time
|
|
128
|
+
&KeyBucketGorgonFlower ; +3 ATK / +3 DEF
|
|
129
|
+
&KeyBucketHieroglyphs ; +6 HP
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
KeyBucketPrisonKey [
|
|
133
|
+
key-entry < #00, #02 > ;Prison Key
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
KeyBucketMeat [
|
|
137
|
+
key-entry < #01, #0A > ;Meat
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
KeyBucketIncanStatues [
|
|
141
|
+
key-entry < #02, #03 > ;Incan Statue A
|
|
142
|
+
key-entry < #03, #04 > ;Incan Statue B
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
KeyBucketDiamondBlock [
|
|
146
|
+
key-entry < #04, #07 > ;Diamond Block
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
KeyBucketElevatorKey [
|
|
150
|
+
key-entry < #05, #0F > ;Elevator Key
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
KeyBucketMineKeys [
|
|
154
|
+
key-entry < #06, #0B > ;Mine Key A
|
|
155
|
+
key-entry < #07, #0C > ;Mine Key B
|
|
156
|
+
]
|
|
157
|
+
|
|
158
|
+
KeyBucketCrystalBall [
|
|
159
|
+
key-entry < #08, #0E > ;Crystal Ball
|
|
160
|
+
key-entry < #09, #0E >
|
|
161
|
+
key-entry < #0A, #0E >
|
|
162
|
+
key-entry < #0B, #0E >
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
KeyBucketPurifyStone [
|
|
166
|
+
key-entry < #0C, #11 > ;Purify Stone
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
KeyBucketPalaceKey [
|
|
170
|
+
key-entry < #0D, #10 > ;Palace Key
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
KeyBucketHopeStatues [
|
|
174
|
+
key-entry < #0E, #12 > ;Hope Statue
|
|
175
|
+
key-entry < #0F, #12 >
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
KeyBucketRamaStatues [
|
|
179
|
+
key-entry < #10, #13 > ;Rama Statue
|
|
180
|
+
key-entry < #11, #13 >
|
|
181
|
+
]
|
|
182
|
+
|
|
183
|
+
KeyBucketMagicDust [
|
|
184
|
+
key-entry < #12, #14 > ;Magic Dust
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
KeyBucketMushroomDrops [
|
|
188
|
+
key-entry < #13, #1A > ;Mushroom Drops
|
|
189
|
+
key-entry < #14, #1A >
|
|
190
|
+
key-entry < #15, #1A >
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
KeyBucketTeapot [
|
|
194
|
+
key-entry < #16, #19 > ;Tearpot
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
KeyBucketGorgonFlower [
|
|
198
|
+
key-entry < #17, #1D > ;Gorgon Flower
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
KeyBucketHieroglyphs [
|
|
202
|
+
key-entry < #18, #1E > ;Hieroglyphs
|
|
203
|
+
key-entry < #19, #1F >
|
|
204
|
+
key-entry < #1A, #20 >
|
|
205
|
+
key-entry < #1B, #21 >
|
|
206
|
+
key-entry < #1C, #22 >
|
|
207
|
+
key-entry < #1D, #23 >
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
KeyBucketSizes [
|
|
211
|
+
#01
|
|
212
|
+
#01
|
|
213
|
+
#02
|
|
214
|
+
#01
|
|
215
|
+
#01
|
|
216
|
+
#02
|
|
217
|
+
#04
|
|
218
|
+
#01
|
|
219
|
+
#01
|
|
220
|
+
#02
|
|
221
|
+
#02
|
|
222
|
+
#01
|
|
223
|
+
#03
|
|
224
|
+
#01
|
|
225
|
+
#01
|
|
226
|
+
#06
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
KeyItemRevokeFlags [
|
|
230
|
+
#0000003F
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
---------------------------------------------
|
|
234
|
+
;Resolves a bucket index to the next avilable in the bucket
|
|
235
|
+
;Accepts: A = item slot index, Y = bucket entry index
|
|
236
|
+
;Returns: A = next bucket index, Y = item ID
|
|
237
|
+
|
|
238
|
+
KeyItemGetNext {
|
|
239
|
+
PHX
|
|
240
|
+
PHY
|
|
241
|
+
PHA
|
|
242
|
+
ASL
|
|
243
|
+
TAX
|
|
244
|
+
LDA $@KeyBucketLookup, X
|
|
245
|
+
SEC
|
|
246
|
+
SBC #&KeyBucketLookup
|
|
247
|
+
STA $0000 ;$0000 now contains the bucket offset
|
|
248
|
+
|
|
249
|
+
kign_loop:
|
|
250
|
+
LDA $03, S ;Get current bucket slot
|
|
251
|
+
BNE kign_continue
|
|
252
|
+
LDA $01, S
|
|
253
|
+
TAX
|
|
254
|
+
LDA $@KeyBucketSizes, X
|
|
255
|
+
AND #$00FF
|
|
256
|
+
|
|
257
|
+
kign_continue:
|
|
258
|
+
DEC
|
|
259
|
+
STA $03, S
|
|
260
|
+
ASL
|
|
261
|
+
CLC
|
|
262
|
+
ADC $0000
|
|
263
|
+
TAX
|
|
264
|
+
|
|
265
|
+
SEP #$20
|
|
266
|
+
LDA $@KeyBucketLookup, X
|
|
267
|
+
JSR $&KeyItemTestFlag
|
|
268
|
+
REP #$20
|
|
269
|
+
BCC kign_loop
|
|
270
|
+
|
|
271
|
+
kign_slot_found:
|
|
272
|
+
LDA $@KeyBucketLookup+1, X
|
|
273
|
+
AND #$00FF
|
|
274
|
+
TAY
|
|
275
|
+
PLA
|
|
276
|
+
PLA
|
|
277
|
+
PLX
|
|
278
|
+
RTL
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
---------------------------------------------
|
|
282
|
+
;Tests a key item flag
|
|
283
|
+
;Assumes: M == 1, clobbers X, preserves Y
|
|
284
|
+
;Accepts: A = flag ID
|
|
285
|
+
;Returns: carry set = flag set
|
|
286
|
+
|
|
287
|
+
KeyItemTestFlag {
|
|
288
|
+
PHX
|
|
289
|
+
PHA
|
|
290
|
+
LSR
|
|
291
|
+
LSR
|
|
292
|
+
LSR
|
|
293
|
+
TAX
|
|
294
|
+
LDA $&key_item_flags, X
|
|
295
|
+
PHA
|
|
296
|
+
LDA $02, S
|
|
297
|
+
AND #$07
|
|
298
|
+
TAX
|
|
299
|
+
LDA $@BitMaskTable, X
|
|
300
|
+
AND $01, S
|
|
301
|
+
BEQ kitf_false
|
|
302
|
+
|
|
303
|
+
PLX
|
|
304
|
+
PLX
|
|
305
|
+
SEC
|
|
306
|
+
RTS
|
|
307
|
+
|
|
308
|
+
kitf_false:
|
|
309
|
+
PLX
|
|
310
|
+
PLX
|
|
311
|
+
CLC
|
|
312
|
+
RTS
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
KeyItemTestFlagWrapper {
|
|
316
|
+
SEP #$20
|
|
317
|
+
JSR $&KeyItemTestFlag
|
|
318
|
+
REP #$20
|
|
319
|
+
RTL
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
---------------------------------------------
|
|
323
|
+
;Prepares initialization data for inventory actors
|
|
324
|
+
;Assumes M == 1, clobbers Y, preserves X
|
|
325
|
+
;Accepts: A = item slot index
|
|
326
|
+
;Returns: A = relic count for slot, Y = last item ID
|
|
327
|
+
;Side-effect: $0002 = last flagged item index, $0003 = bucket array length
|
|
328
|
+
|
|
329
|
+
KeyItemCountAndInit {
|
|
330
|
+
PHX
|
|
331
|
+
ASL
|
|
332
|
+
TAX
|
|
333
|
+
LDA $@KeyBucketLookup, X
|
|
334
|
+
SEC
|
|
335
|
+
SBC #&KeyBucketLookup
|
|
336
|
+
TAX
|
|
337
|
+
LDA #$0000
|
|
338
|
+
STA $0000
|
|
339
|
+
STA $0002
|
|
340
|
+
SEP #$20
|
|
341
|
+
|
|
342
|
+
kicai_bucket_loop:
|
|
343
|
+
LDA $@KeyBucketLookup, X
|
|
344
|
+
BMI kicai_bucket_end
|
|
345
|
+
|
|
346
|
+
JSR $&KeyItemTestFlag
|
|
347
|
+
BCC kicai_flag_continue
|
|
348
|
+
LDA $@KeyBucketLookup+1, X
|
|
349
|
+
STA $0001
|
|
350
|
+
LDA $0003
|
|
351
|
+
STA $0002
|
|
352
|
+
|
|
353
|
+
kicai_flag_increment:
|
|
354
|
+
INC $0000
|
|
355
|
+
|
|
356
|
+
kicai_flag_continue:
|
|
357
|
+
INX
|
|
358
|
+
INX
|
|
359
|
+
INC $0003
|
|
360
|
+
BRA kicai_bucket_loop
|
|
361
|
+
|
|
362
|
+
kicai_bucket_end:
|
|
363
|
+
LDA $0001
|
|
364
|
+
TAY
|
|
365
|
+
LDA $0000
|
|
366
|
+
REP #$20
|
|
367
|
+
PLX
|
|
368
|
+
RTL
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
---------------------------------------------
|
|
372
|
+
|
|
373
|
+
KeyItemCheckAndStore {
|
|
374
|
+
PHX
|
|
375
|
+
PHA
|
|
376
|
+
TAX ;This assumes the B register is zero
|
|
377
|
+
LDA $@KeyItemFlagIndex, X
|
|
378
|
+
BPL kic_check_revoke
|
|
379
|
+
|
|
380
|
+
LDY #$0000
|
|
381
|
+
PLA
|
|
382
|
+
PLX
|
|
383
|
+
CLC
|
|
384
|
+
RTL
|
|
385
|
+
|
|
386
|
+
kic_inventory_full:
|
|
387
|
+
LDY #$0001
|
|
388
|
+
PLA
|
|
389
|
+
PLA
|
|
390
|
+
PLX
|
|
391
|
+
CLC
|
|
392
|
+
RTL
|
|
393
|
+
|
|
394
|
+
kic_check_revoke:
|
|
395
|
+
PHA
|
|
396
|
+
LSR
|
|
397
|
+
LSR
|
|
398
|
+
LSR
|
|
399
|
+
TAX
|
|
400
|
+
LDA $@KeyItemRevokeFlags, X
|
|
401
|
+
TAY
|
|
402
|
+
LDA $01, S
|
|
403
|
+
AND #$07
|
|
404
|
+
TAX
|
|
405
|
+
TYA
|
|
406
|
+
AND $@BitMaskTable, X
|
|
407
|
+
BNE kic_scan_flags
|
|
408
|
+
|
|
409
|
+
;LDA $@KeyItemRevoke
|
|
410
|
+
;BNE kic_scan_flags
|
|
411
|
+
|
|
412
|
+
LDA $02, S
|
|
413
|
+
JSL $@InventoryCheckAndStore
|
|
414
|
+
BCS kic_inventory_full
|
|
415
|
+
|
|
416
|
+
kic_scan_flags:
|
|
417
|
+
LDA $01, S
|
|
418
|
+
LSR
|
|
419
|
+
LSR
|
|
420
|
+
LSR
|
|
421
|
+
TAY
|
|
422
|
+
LDA $&key_item_flags, Y
|
|
423
|
+
PHA
|
|
424
|
+
LDA $02, S
|
|
425
|
+
AND #$07
|
|
426
|
+
TAX
|
|
427
|
+
|
|
428
|
+
kic_set_flag_loop:
|
|
429
|
+
LDA $@BitMaskTable, X
|
|
430
|
+
AND $01, S
|
|
431
|
+
BEQ kic_set_flag_free
|
|
432
|
+
INX
|
|
433
|
+
BRA kic_set_flag_loop
|
|
434
|
+
|
|
435
|
+
kic_set_flag_free:
|
|
436
|
+
PLA
|
|
437
|
+
ORA $@BitMaskTable, X
|
|
438
|
+
STA $&key_item_flags, Y
|
|
439
|
+
PLA
|
|
440
|
+
|
|
441
|
+
PLA
|
|
442
|
+
PLX
|
|
443
|
+
SEC
|
|
444
|
+
RTL
|
|
445
|
+
}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
; ==============================================================================
|
|
2
|
+
; Equipped item icon - HUD VRAM upload and ability palette fixes
|
|
3
|
+
; ==============================================================================
|
|
4
|
+
; What it does: Each frame uploads the equipped item 2bpp icon into HUD CHR via
|
|
5
|
+
; adhoc DMA when display flag $09EC bit $4000 clear; fixes aura/dark friar
|
|
6
|
+
; palette DMA glitches and sets display preset bit $4000 on select cutscenes.
|
|
7
|
+
; Vanilla behavior: No dynamic item icon; ability FX reused stale CGRAM; presets
|
|
8
|
+
; lack forced $09EC bit 14 for icon compose path.
|
|
9
|
+
; Hooks (overrides): sprite_composition RenderComposeBuffer; scene_lifecycle
|
|
10
|
+
; LoadHud path; palette_bundles; display_preset_table; attack/inventory FX
|
|
11
|
+
; locs; spriteset_freedan_fx sword group; pr8F_prologue4 timing.
|
|
12
|
+
; Adds: item_icon_generate and per-item icon loaders (JMP table from $0AC6).
|
|
13
|
+
; Depends on: scene_script, chunk_03BAE1, gfx_item_exprite data in this patch set.
|
|
14
|
+
; State: $0AC6 equipped type, $09EC/$09ED display flags, $7F3100 compose buf.
|
|
15
|
+
; Hazards/notes: item_icon_generate clobbers X; ItemSwapping PHX/PLX around JSL;
|
|
16
|
+
; RenderComposeBuffer calls loc_03C7F0 from InventoryCounters patch bank.
|
|
17
|
+
; ==============================================================================
|
|
18
|
+
|
|
2
19
|
?INCLUDE 'scene_script'
|
|
3
20
|
--------------------------------------------
|
|
4
21
|
|
|
@@ -410,7 +427,7 @@ item_icon_next {
|
|
|
410
427
|
--------------------------------------------------
|
|
411
428
|
;Allow both static sprites and temporary sprites
|
|
412
429
|
|
|
413
|
-
RenderComposeBuffer! {
|
|
430
|
+
sprite_composition.RenderComposeBuffer! {
|
|
414
431
|
LDX #$0000
|
|
415
432
|
TXY
|
|
416
433
|
|
|
@@ -421,7 +438,7 @@ RenderComposeBuffer! {
|
|
|
421
438
|
JSR loc_03C7F0
|
|
422
439
|
LDX #$0000
|
|
423
440
|
|
|
424
|
-
loc_03C797!:
|
|
441
|
+
sprite_composition.loc_03C797!:
|
|
425
442
|
LDA $7F3100, X
|
|
426
443
|
BPL loc_03C79E
|
|
427
444
|
RTS
|
|
@@ -430,46 +447,24 @@ RenderComposeBuffer! {
|
|
|
430
447
|
--------------------------------------------------------
|
|
431
448
|
;Make system sprite page loading also load item icon
|
|
432
449
|
|
|
433
|
-
loc_03E04E! {
|
|
450
|
+
scene_lifecycle.loc_03E04E! {
|
|
434
451
|
JML item_icon_stub
|
|
435
452
|
}
|
|
436
453
|
|
|
437
|
-
LoadHudTilemap! {
|
|
438
|
-
LDA $09ED
|
|
439
|
-
BIT #$40
|
|
440
|
-
BEQ
|
|
441
|
-
STZ $00DA ; Full suppress (cutscene): clear icon too
|
|
442
|
-
RTL
|
|
443
|
-
|
|
444
|
-
hud_check_combat:
|
|
445
|
-
LDA $playerFlags
|
|
446
|
-
BIT #$08 ; Bit 3 = input lock (non-combat area)
|
|
447
|
-
BEQ loc_03DED5 ; Combat area → load HUD normally
|
|
448
|
-
RTL ; Non-combat → skip HUD, keep icon ($00DA preserved)
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
--------------------------------------------------------
|
|
452
|
-
?INCLUDE 'system_core'
|
|
453
|
-
--------------------------------------------------------
|
|
454
|
-
;Suppress HUD stat updates in non-combat areas
|
|
455
|
-
|
|
456
|
-
UpdateHUD! {
|
|
457
|
-
LDA $09ED
|
|
458
|
-
BIT #$40 ; Bit 6 = full HUD suppression (cutscene)
|
|
459
|
-
BNE hud_update_suppress
|
|
460
|
-
LDA $playerFlags
|
|
461
|
-
BIT #$08 ; Bit 3 = input lock (non-combat area)
|
|
462
|
-
BEQ loc_00820E ; Neither set → proceed with HUD update
|
|
463
|
-
hud_update_suppress:
|
|
464
|
-
RTL
|
|
465
|
-
}
|
|
454
|
+
;LoadHudTilemap! {
|
|
455
|
+
; LDA $09ED
|
|
456
|
+
; BIT #$40
|
|
457
|
+
; BEQ loc_03DED5
|
|
458
|
+
; STZ $00DA ; Full suppress (cutscene): clear icon too
|
|
459
|
+
; RTL
|
|
460
|
+
;}
|
|
466
461
|
|
|
467
462
|
--------------------------------------------------------
|
|
468
463
|
?INCLUDE 'palette_bundles'
|
|
469
464
|
--------------------------------------------------------
|
|
470
465
|
|
|
471
466
|
;Aura barrier flame
|
|
472
|
-
palette_bundle_16C1BD! [
|
|
467
|
+
palette_bundles.palette_bundle_16C1BD! [
|
|
473
468
|
palette-bundle < #01, &word_16C1EE, #F1, #0F, #01 > ;00
|
|
474
469
|
palette-bundle < #01, &word_16C1FE, #F1, #0F, #01 > ;01
|
|
475
470
|
palette-bundle < #01, &word_16C20E, #F1, #0F, #01 > ;02
|
|
@@ -481,7 +476,7 @@ palette_bundle_16C1BD! [
|
|
|
481
476
|
]
|
|
482
477
|
|
|
483
478
|
//Firebird
|
|
484
|
-
palette_bundle_16CE8F! [
|
|
479
|
+
palette_bundles.palette_bundle_16CE8F! [
|
|
485
480
|
palette-bundle < #01, &word_16CEC0, #98, #0F, #02 > ;00
|
|
486
481
|
palette-bundle < #01, &word_16CED0, #98, #0F, #02 > ;01
|
|
487
482
|
palette-bundle < #01, &word_16CEE0, #98, #0F, #02 > ;02
|
|
@@ -497,11 +492,11 @@ palette_bundle_16CE8F! [
|
|
|
497
492
|
------------------------------------------------------
|
|
498
493
|
;Enable engine flag 4000
|
|
499
494
|
|
|
500
|
-
|
|
495
|
+
display_preset_table.display_preset_00! [
|
|
501
496
|
display-preset < #17, #00, #80, #00, #24, #85, #09, #80, #00, #00 > ;Statue reward scene
|
|
502
497
|
]
|
|
503
498
|
|
|
504
|
-
|
|
499
|
+
display_preset_table.display_preset_25! [
|
|
505
500
|
display-preset < #17, #00, #80, #03, #E4, #80, #09, #80, #00, #00 > ;Epilogue scene
|
|
506
501
|
]
|
|
507
502
|
|
|
@@ -511,7 +506,7 @@ display_preset_0181D0! [
|
|
|
511
506
|
------------------------------------------------------
|
|
512
507
|
;Force flying scene flag 4000
|
|
513
508
|
|
|
514
|
-
code_068114- {
|
|
509
|
+
sp58_descent_cutscene.code_068114- {
|
|
515
510
|
LDA #$4000
|
|
516
511
|
TSB $09EC
|
|
517
512
|
COP [4F] ( $7F0200, #$7800, #$0100 ) ;For some reason there is a situation where the BG3 data isn't refreshed
|
|
@@ -522,7 +517,7 @@ code_068114- {
|
|
|
522
517
|
------------------------------------------------------
|
|
523
518
|
;Force plane crash scene flag 4000
|
|
524
519
|
|
|
525
|
-
code_03A0AD- {
|
|
520
|
+
garden_crash_cutscene.code_03A0AD- {
|
|
526
521
|
LDA #$4000
|
|
527
522
|
TSB $09EC
|
|
528
523
|
}
|
|
@@ -532,7 +527,7 @@ code_03A0AD- {
|
|
|
532
527
|
------------------------------------------------------
|
|
533
528
|
;Force babel flying scene flag 4000
|
|
534
529
|
|
|
535
|
-
code_098149- {
|
|
530
|
+
btDC_plane_jumping.code_098149- {
|
|
536
531
|
LDA #$4000
|
|
537
532
|
TSB $09EC
|
|
538
533
|
COP [4F] ( $7F0200, #$7800, #$0100 ) ;For some reason there is a situation where the BG3 data isn't refreshed
|
|
@@ -543,7 +538,7 @@ code_098149- {
|
|
|
543
538
|
------------------------------------------------------
|
|
544
539
|
;Fix for copied palette during aura barrier
|
|
545
540
|
|
|
546
|
-
loc_02B9C0! {
|
|
541
|
+
attack_ability_system.loc_02B9C0! {
|
|
547
542
|
COP [50] ( @fx_palette_198090, #00, #F9, #07 ) ; <-
|
|
548
543
|
COP [8E] ( #06 )
|
|
549
544
|
COP [80] ( #02 )
|
|
@@ -562,7 +557,7 @@ loc_02B9C0! {
|
|
|
562
557
|
}
|
|
563
558
|
|
|
564
559
|
;Fix for copied palette during dark friar
|
|
565
|
-
loc_02BB77! {
|
|
560
|
+
attack_ability_system.loc_02BB77! {
|
|
566
561
|
COP [50] ( @fx_palette_198070, #00, #F0, #10 )
|
|
567
562
|
COP [3B] ( #4A, @PaletteResetAndKillThinker )
|
|
568
563
|
COP [48]
|
|
@@ -576,7 +571,7 @@ loc_02BB77! {
|
|
|
576
571
|
------------------------------------------------------
|
|
577
572
|
|
|
578
573
|
;Fix for copied palette during dark friar
|
|
579
|
-
loc_02EED2! {
|
|
574
|
+
inventory_overlay.loc_02EED2! {
|
|
580
575
|
DEC
|
|
581
576
|
BNE loc_02EEF0
|
|
582
577
|
LDX #$4400
|
|
@@ -590,7 +585,7 @@ loc_02EED2! {
|
|
|
590
585
|
}
|
|
591
586
|
|
|
592
587
|
;Fix for copied palette during aura barrier
|
|
593
|
-
loc_02EEF0! {
|
|
588
|
+
inventory_overlay.loc_02EEF0! {
|
|
594
589
|
LDX #$4400
|
|
595
590
|
STX $VMADDL
|
|
596
591
|
LDX #$&misc_fx_1CC480
|
|
@@ -607,7 +602,7 @@ loc_02EEF0! {
|
|
|
607
602
|
------------------------------------------------------
|
|
608
603
|
;Fix for sword palette during aura barrier
|
|
609
604
|
|
|
610
|
-
sprite_group_17A483! [
|
|
605
|
+
spriteset_freedan_fx.sprite_group_17A483! [
|
|
611
606
|
sprite_group < #13, #10, #46, #00, #F8, #F0, #01, #01, #F8, #10, #F0, #10, #0E, [
|
|
612
607
|
sprite_part < #01, #0B, #08, #00, #36, #$0E4E > ;00
|
|
613
608
|
sprite_part < #01, #0B, #08, #10, #26, #$0E6E > ;01
|
|
@@ -632,7 +627,7 @@ sprite_group_17A483! [
|
|
|
632
627
|
------------------------------------------------------
|
|
633
628
|
;Fix for prologue scene 4 to wait before generating sprites
|
|
634
629
|
|
|
635
|
-
code_0BCE36! {
|
|
630
|
+
pr8F_prologue4.code_0BCE36! {
|
|
636
631
|
LDA #$4001
|
|
637
632
|
TSB $09EC
|
|
638
633
|
COP [50] ( @pal_prologue_mishap, #00, #00, #20 )
|