@gaialabs/iog-baserom 0.2.7 → 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 -24
- 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,24 +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 loc_03DED5
|
|
441
|
-
STZ $00DA ; Full suppress (cutscene): clear icon too
|
|
442
|
-
RTL
|
|
443
|
-
}
|
|
454
|
+
;LoadHudTilemap! {
|
|
455
|
+
; LDA $09ED
|
|
456
|
+
; BIT #$40
|
|
457
|
+
; BEQ loc_03DED5
|
|
458
|
+
; STZ $00DA ; Full suppress (cutscene): clear icon too
|
|
459
|
+
; RTL
|
|
460
|
+
;}
|
|
444
461
|
|
|
445
462
|
--------------------------------------------------------
|
|
446
463
|
?INCLUDE 'palette_bundles'
|
|
447
464
|
--------------------------------------------------------
|
|
448
465
|
|
|
449
466
|
;Aura barrier flame
|
|
450
|
-
palette_bundle_16C1BD! [
|
|
467
|
+
palette_bundles.palette_bundle_16C1BD! [
|
|
451
468
|
palette-bundle < #01, &word_16C1EE, #F1, #0F, #01 > ;00
|
|
452
469
|
palette-bundle < #01, &word_16C1FE, #F1, #0F, #01 > ;01
|
|
453
470
|
palette-bundle < #01, &word_16C20E, #F1, #0F, #01 > ;02
|
|
@@ -459,7 +476,7 @@ palette_bundle_16C1BD! [
|
|
|
459
476
|
]
|
|
460
477
|
|
|
461
478
|
//Firebird
|
|
462
|
-
palette_bundle_16CE8F! [
|
|
479
|
+
palette_bundles.palette_bundle_16CE8F! [
|
|
463
480
|
palette-bundle < #01, &word_16CEC0, #98, #0F, #02 > ;00
|
|
464
481
|
palette-bundle < #01, &word_16CED0, #98, #0F, #02 > ;01
|
|
465
482
|
palette-bundle < #01, &word_16CEE0, #98, #0F, #02 > ;02
|
|
@@ -475,11 +492,11 @@ palette_bundle_16CE8F! [
|
|
|
475
492
|
------------------------------------------------------
|
|
476
493
|
;Enable engine flag 4000
|
|
477
494
|
|
|
478
|
-
|
|
495
|
+
display_preset_table.display_preset_00! [
|
|
479
496
|
display-preset < #17, #00, #80, #00, #24, #85, #09, #80, #00, #00 > ;Statue reward scene
|
|
480
497
|
]
|
|
481
498
|
|
|
482
|
-
|
|
499
|
+
display_preset_table.display_preset_25! [
|
|
483
500
|
display-preset < #17, #00, #80, #03, #E4, #80, #09, #80, #00, #00 > ;Epilogue scene
|
|
484
501
|
]
|
|
485
502
|
|
|
@@ -489,7 +506,7 @@ display_preset_0181D0! [
|
|
|
489
506
|
------------------------------------------------------
|
|
490
507
|
;Force flying scene flag 4000
|
|
491
508
|
|
|
492
|
-
code_068114- {
|
|
509
|
+
sp58_descent_cutscene.code_068114- {
|
|
493
510
|
LDA #$4000
|
|
494
511
|
TSB $09EC
|
|
495
512
|
COP [4F] ( $7F0200, #$7800, #$0100 ) ;For some reason there is a situation where the BG3 data isn't refreshed
|
|
@@ -500,7 +517,7 @@ code_068114- {
|
|
|
500
517
|
------------------------------------------------------
|
|
501
518
|
;Force plane crash scene flag 4000
|
|
502
519
|
|
|
503
|
-
code_03A0AD- {
|
|
520
|
+
garden_crash_cutscene.code_03A0AD- {
|
|
504
521
|
LDA #$4000
|
|
505
522
|
TSB $09EC
|
|
506
523
|
}
|
|
@@ -510,7 +527,7 @@ code_03A0AD- {
|
|
|
510
527
|
------------------------------------------------------
|
|
511
528
|
;Force babel flying scene flag 4000
|
|
512
529
|
|
|
513
|
-
code_098149- {
|
|
530
|
+
btDC_plane_jumping.code_098149- {
|
|
514
531
|
LDA #$4000
|
|
515
532
|
TSB $09EC
|
|
516
533
|
COP [4F] ( $7F0200, #$7800, #$0100 ) ;For some reason there is a situation where the BG3 data isn't refreshed
|
|
@@ -521,7 +538,7 @@ code_098149- {
|
|
|
521
538
|
------------------------------------------------------
|
|
522
539
|
;Fix for copied palette during aura barrier
|
|
523
540
|
|
|
524
|
-
loc_02B9C0! {
|
|
541
|
+
attack_ability_system.loc_02B9C0! {
|
|
525
542
|
COP [50] ( @fx_palette_198090, #00, #F9, #07 ) ; <-
|
|
526
543
|
COP [8E] ( #06 )
|
|
527
544
|
COP [80] ( #02 )
|
|
@@ -540,7 +557,7 @@ loc_02B9C0! {
|
|
|
540
557
|
}
|
|
541
558
|
|
|
542
559
|
;Fix for copied palette during dark friar
|
|
543
|
-
loc_02BB77! {
|
|
560
|
+
attack_ability_system.loc_02BB77! {
|
|
544
561
|
COP [50] ( @fx_palette_198070, #00, #F0, #10 )
|
|
545
562
|
COP [3B] ( #4A, @PaletteResetAndKillThinker )
|
|
546
563
|
COP [48]
|
|
@@ -554,7 +571,7 @@ loc_02BB77! {
|
|
|
554
571
|
------------------------------------------------------
|
|
555
572
|
|
|
556
573
|
;Fix for copied palette during dark friar
|
|
557
|
-
loc_02EED2! {
|
|
574
|
+
inventory_overlay.loc_02EED2! {
|
|
558
575
|
DEC
|
|
559
576
|
BNE loc_02EEF0
|
|
560
577
|
LDX #$4400
|
|
@@ -568,7 +585,7 @@ loc_02EED2! {
|
|
|
568
585
|
}
|
|
569
586
|
|
|
570
587
|
;Fix for copied palette during aura barrier
|
|
571
|
-
loc_02EEF0! {
|
|
588
|
+
inventory_overlay.loc_02EEF0! {
|
|
572
589
|
LDX #$4400
|
|
573
590
|
STX $VMADDL
|
|
574
591
|
LDX #$&misc_fx_1CC480
|
|
@@ -585,7 +602,7 @@ loc_02EEF0! {
|
|
|
585
602
|
------------------------------------------------------
|
|
586
603
|
;Fix for sword palette during aura barrier
|
|
587
604
|
|
|
588
|
-
sprite_group_17A483! [
|
|
605
|
+
spriteset_freedan_fx.sprite_group_17A483! [
|
|
589
606
|
sprite_group < #13, #10, #46, #00, #F8, #F0, #01, #01, #F8, #10, #F0, #10, #0E, [
|
|
590
607
|
sprite_part < #01, #0B, #08, #00, #36, #$0E4E > ;00
|
|
591
608
|
sprite_part < #01, #0B, #08, #10, #26, #$0E6E > ;01
|
|
@@ -610,7 +627,7 @@ sprite_group_17A483! [
|
|
|
610
627
|
------------------------------------------------------
|
|
611
628
|
;Fix for prologue scene 4 to wait before generating sprites
|
|
612
629
|
|
|
613
|
-
code_0BCE36! {
|
|
630
|
+
pr8F_prologue4.code_0BCE36! {
|
|
614
631
|
LDA #$4001
|
|
615
632
|
TSB $09EC
|
|
616
633
|
COP [50] ( @pal_prologue_mishap, #00, #00, #20 )
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
|
|
2
|
+
; ==============================================================================
|
|
3
|
+
; Inventory item swapping - L/R shoulder cycle equipped slot
|
|
4
|
+
; ==============================================================================
|
|
5
|
+
; What it does: While inventory overlay is active ($09EC bit $4000 clear), X
|
|
6
|
+
; or L/R scans $0AB4 slots and updates $0AC4/$0AC6 then refreshes icon via JSL.
|
|
7
|
+
; Vanilla behavior: No shoulder-button equip cycling in the input hook chain.
|
|
8
|
+
; Hooks (overrides): PlayerInputHooks+ append (registry in player_input_core).
|
|
9
|
+
; Adds: item_swapping_main (JSL target from hook chain).
|
|
10
|
+
; Depends on: EquippedIcon JSL, player actor $09AA, joypad $0656.
|
|
11
|
+
; State: $0AC4 index ($FFFF empty), $0AC6 type, $09EC bit $0002 debounce.
|
|
12
|
+
; Hazards/notes: PHX/PLX around EquippedIcon (icon code clobbers X); hook must
|
|
13
|
+
; stay at file end; X must remain actor slot for COP [07] after swap.
|
|
14
|
+
; ==============================================================================
|
|
15
|
+
|
|
16
|
+
item_swapping_main:
|
|
17
|
+
LDA $09EC
|
|
18
|
+
BIT #$4000
|
|
19
|
+
BNE item_swapping_end
|
|
20
|
+
LDA $09AA
|
|
21
|
+
BEQ item_swapping_end ;Skip if player has no actor
|
|
22
|
+
LDA $0656
|
|
23
|
+
BIT #$0004
|
|
24
|
+
BEQ item_swapping_reset ;Skip if not pressing X
|
|
25
|
+
BIT #$0010
|
|
26
|
+
BNE item_swapping_right
|
|
27
|
+
BIT #$0020
|
|
28
|
+
BNE item_swapping_left
|
|
29
|
+
|
|
30
|
+
item_swapping_reset:
|
|
31
|
+
LDA #$0002
|
|
32
|
+
TRB $09EC
|
|
33
|
+
|
|
34
|
+
item_swapping_end:
|
|
35
|
+
RTL
|
|
36
|
+
|
|
37
|
+
item_swapping_left:
|
|
38
|
+
LDA $09EC
|
|
39
|
+
BIT #$0002
|
|
40
|
+
BNE item_swapping_end
|
|
41
|
+
|
|
42
|
+
LDY $0AC4
|
|
43
|
+
BPL item_swap_left_begin
|
|
44
|
+
LDY #$0010
|
|
45
|
+
|
|
46
|
+
item_swap_left_begin:
|
|
47
|
+
LDA #$0000
|
|
48
|
+
|
|
49
|
+
item_swap_left_top:
|
|
50
|
+
DEY
|
|
51
|
+
BMI item_swap_store
|
|
52
|
+
LDA $0AB4, Y
|
|
53
|
+
AND #$00FF
|
|
54
|
+
BEQ item_swap_left_top
|
|
55
|
+
|
|
56
|
+
item_swap_store:
|
|
57
|
+
STY $0AC4
|
|
58
|
+
STA $0AC6
|
|
59
|
+
LDA #$0002
|
|
60
|
+
TSB $09EC
|
|
61
|
+
COP [07] ( #10 )
|
|
62
|
+
PHX ;EquippedIcon clobbers X, hooks must keep X = actor id
|
|
63
|
+
JSL @EquippedIcon
|
|
64
|
+
PLX
|
|
65
|
+
RTL
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
item_swapping_right:
|
|
69
|
+
LDA $09EC
|
|
70
|
+
BIT #$0002
|
|
71
|
+
BNE item_swapping_end
|
|
72
|
+
|
|
73
|
+
LDY $0AC4
|
|
74
|
+
BPL item_swap_right_begin
|
|
75
|
+
LDY #$FFFF
|
|
76
|
+
|
|
77
|
+
item_swap_right_begin:
|
|
78
|
+
LDA #$0000
|
|
79
|
+
|
|
80
|
+
item_swap_right_top:
|
|
81
|
+
INY
|
|
82
|
+
CPY #$0010
|
|
83
|
+
BCS item_swap_right_nothing
|
|
84
|
+
LDA $0AB4, Y
|
|
85
|
+
AND #$00FF
|
|
86
|
+
BEQ item_swap_right_top
|
|
87
|
+
BRA item_swap_store
|
|
88
|
+
|
|
89
|
+
item_swap_right_nothing:
|
|
90
|
+
LDY #$FFFF
|
|
91
|
+
BRA item_swap_store
|
|
92
|
+
|
|
93
|
+
----------------------------------------------------------------------
|
|
94
|
+
;Registration with the player input chain (registry: player_input_core.asm)
|
|
95
|
+
;Must stay at the END of this file
|
|
96
|
+
|
|
97
|
+
PlayerInputHooks+ {
|
|
98
|
+
JSL $@item_swapping_main
|
|
99
|
+
}
|
|
Binary file
|