@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.
Files changed (135) hide show
  1. package/baserom/auto-use-items/CellKeysAutoUse.patch.asm +30 -0
  2. package/baserom/auto-use-items/CrystalBallAutoUse.patch.asm +131 -0
  3. package/baserom/auto-use-items/DiamondBlockAutoUse.patch.asm +50 -0
  4. package/baserom/auto-use-items/ElevatorKeyAutoUse.patch.asm +26 -0
  5. package/baserom/auto-use-items/GorgonFlowerAutoUse.patch.asm +153 -0
  6. package/baserom/auto-use-items/HieroglyphPuzzle.patch.asm +1187 -0
  7. package/baserom/auto-use-items/HopeStatueAutoUse.patch.asm +99 -0
  8. package/baserom/auto-use-items/IncanStatueAutoUse.patch.asm +75 -0
  9. package/baserom/auto-use-items/ItemUseStub.patch.asm +24 -0
  10. package/baserom/auto-use-items/MagicPowerAutoUse.patch.asm +55 -0
  11. package/baserom/auto-use-items/MeatAutoUse.patch.asm +33 -0
  12. package/baserom/auto-use-items/MushroomDropAutoUse.patch.asm +100 -0
  13. package/baserom/auto-use-items/PalaceKeyAutoUse.patch.asm +52 -0
  14. package/baserom/auto-use-items/PrisonKeyAutoUse.patch.asm +84 -0
  15. package/baserom/auto-use-items/PurificationStoneAutoUse.patch.asm +49 -0
  16. package/baserom/auto-use-items/RamaStatueAutoUse.patch.asm +100 -0
  17. package/baserom/auto-use-items/TearpotAutoUse.patch.asm +41 -0
  18. package/baserom/{spritemaps → boot-logo}/spm_boot_logos.sprite.asm +10 -0
  19. package/baserom/collectible-system/RelicMenu.patch.asm +250 -0
  20. package/baserom/collectible-system/key_item_core.asm +445 -0
  21. package/baserom/{patches → equipped-icon}/EquippedIcon.patch.asm +41 -46
  22. package/baserom/equipped-icon/ItemSwapping.patch.asm +99 -0
  23. package/baserom/{palettes → equipped-icon}/pal_item_exprite2.pal +0 -0
  24. package/baserom/{spritemaps → equipped-icon}/spm_sc02_main_characters.sprite.asm +10 -0
  25. package/baserom/equipped-icon/spriteset_aura.asm +131 -0
  26. package/baserom/equipped-icon/spriteset_dark_friar.asm +277 -0
  27. package/baserom/equipped-icon/spriteset_darkgaia_projectile.asm +233 -0
  28. package/baserom/fixes-tweaks/BCDHex.patch.asm +60 -0
  29. package/baserom/fixes-tweaks/HudRedesign.patch.asm +108 -0
  30. package/baserom/fixes-tweaks/NeilsFatherFix.patch.asm +26 -0
  31. package/baserom/fixes-tweaks/PyramidPortalExit.patch.asm +41 -0
  32. package/baserom/fixes-tweaks/SceneTitles.patch.asm +84 -0
  33. package/baserom/fixes-tweaks/ThankfulFlower.patch.asm +28 -0
  34. package/baserom/fixes-tweaks/Utils.patch.asm +111 -0
  35. package/baserom/{spritemaps → fixes-tweaks}/spm_goldship_sprites.sprite.asm +11 -0
  36. package/baserom/fonts/EnhancedOverworldText.patch.asm +44 -0
  37. package/baserom/fonts/EnhancedPrologueText.patch.asm +252 -0
  38. package/baserom/{graphics → fonts}/gfx_fonts.bin +0 -0
  39. package/baserom/fonts/gfx_overworld_font.bin +0 -0
  40. package/baserom/inventory/EnhancedSlotActor.patch.asm +50 -0
  41. package/baserom/inventory/InventoryCounters.patch.asm +407 -0
  42. package/baserom/inventory/InventoryManagement.patch.asm +390 -0
  43. package/baserom/kara-run/gfx_castle_sprites.bin +0 -0
  44. package/baserom/new-game-plus/NGPEpilogueSwitch.patch.asm +52 -0
  45. package/baserom/{patches → new-game-plus}/NewGamePlus.patch.asm +42 -23
  46. package/baserom/oakton/map_fr30.map +0 -0
  47. package/baserom/oakton/map_fr30_effect.map +0 -0
  48. package/baserom/options-menu/EnhancedInvItemPicker.patch.asm +130 -0
  49. package/baserom/options-menu/MinimalHudOption.patch.asm +109 -0
  50. package/baserom/options-menu/OptionsMenu.patch.asm +218 -0
  51. package/baserom/options-menu/TextSpeedOption.patch.asm +108 -0
  52. package/baserom/options-menu/options_input_remap.asm +373 -0
  53. package/baserom/options-menu/options_menu_core.asm +1221 -0
  54. package/baserom/patches/APUWaitFixes.patch.asm +30 -17
  55. package/baserom/patches/AccentMap.patch.asm +16 -5
  56. package/baserom/patches/MusicTransitions.patch.asm +41 -24
  57. package/baserom/player-input/MergeInputFlags.patch.asm +146 -0
  58. package/baserom/player-input/PlayerInput.patch.asm +51 -0
  59. package/baserom/red-jewels/AnnSparkle.patch.asm +28 -0
  60. package/baserom/red-jewels/ChestFlaggedHiddenRedJewel.patch.asm +50 -0
  61. package/baserom/red-jewels/FishermanRedJewel.patch.asm +55 -0
  62. package/baserom/red-jewels/LanceSparkle.patch.asm +38 -0
  63. package/baserom/red-jewels/RedJewelSparkle.patch.asm +49 -0
  64. package/baserom/red-jewels/SnakePanicSparkle.patch.asm +45 -0
  65. package/baserom/red-jewels/SparkleAlways.patch.asm.example +19 -0
  66. package/baserom/red-jewels/StoneGirlSparkle.patch.asm +26 -0
  67. package/baserom/red-jewels/TrappedSlaveSparkle.patch.asm +63 -0
  68. package/baserom/red-jewels/generic_sparkle.asm +57 -0
  69. package/baserom/run-button/RunButtonCore.patch.asm +89 -0
  70. package/baserom/run-button/RunButtonOption.patch.asm +50 -0
  71. package/baserom/{patches/BitmapPatch.patch.asm → scene-load/BitmapLoad.patch.asm} +27 -12
  72. package/baserom/scene-load/Cop51Decompress.patch.asm +98 -0
  73. package/baserom/scene-load/ExpriteLoader.patch.asm +82 -0
  74. package/baserom/scene-load/MapNameLookup.patch.asm +27 -0
  75. package/baserom/scene-load/MenuBGLoad.patch.asm +70 -0
  76. package/baserom/scene-load/SFXTable.patch.asm +92 -0
  77. package/baserom/scene-load/SceneMetaLoad.patch.asm +68 -0
  78. package/baserom/scene-load/SpritemapLoad.patch.asm +61 -0
  79. package/baserom/scene-load/TilemapLoad.patch.asm +109 -0
  80. package/baserom/scene-load/TilesetLoad.patch.asm +41 -0
  81. package/baserom/set_overworld.set +0 -0
  82. package/baserom/seths-jewel/SethsJewelGoldShip.patch.asm +22 -0
  83. package/baserom/seths-jewel/SethsJewelIcon.patch.asm +22 -0
  84. package/baserom/seths-jewel/SethsJewelItem.patch.asm +62 -0
  85. package/baserom/seths-jewel/SethsJewelSprites.patch.asm +49 -0
  86. package/baserom/{patches → sky-delivery}/SouthCapeDeliveryman.patch.asm +12 -3
  87. package/baserom/sky-delivery/WatermiaDeliveryman.patch.asm +15 -0
  88. package/dist/index.cjs +10159 -964
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +9 -1
  91. package/dist/index.d.cts.map +1 -1
  92. package/dist/index.d.mts +9 -1
  93. package/dist/index.d.mts.map +1 -1
  94. package/dist/index.mjs +10161 -967
  95. package/dist/index.mjs.map +1 -1
  96. package/package.json +10 -8
  97. package/baserom/asm/spriteset_aura.asm +0 -122
  98. package/baserom/asm/spriteset_dark_friar.asm +0 -268
  99. package/baserom/asm/spriteset_will_projectile.asm +0 -224
  100. package/baserom/patches/Cop51Patch.patch.asm +0 -81
  101. package/baserom/patches/DPShop.asm.old +0 -328
  102. package/baserom/patches/DeathWarp.asm.old +0 -174
  103. package/baserom/patches/ExpandedHealthBars.old +0 -203
  104. package/baserom/patches/ExpriteLoader.patch.asm +0 -66
  105. package/baserom/patches/GemShop.asm.old +0 -345
  106. package/baserom/patches/InventoryCounters.patch.asm +0 -292
  107. package/baserom/patches/InventoryManagement.patch.asm +0 -324
  108. package/baserom/patches/InventoryScript.asm.old +0 -319
  109. package/baserom/patches/ItemDictionary.asm.old +0 -86
  110. package/baserom/patches/ItemRewards.asm.old +0 -49
  111. package/baserom/patches/ItemSwapping.patch.asm +0 -80
  112. package/baserom/patches/MapNameLookup.patch.asm +0 -13
  113. package/baserom/patches/MenuBGPatch.patch.asm +0 -54
  114. package/baserom/patches/NGPEpilogueSwitch.patch.asm +0 -44
  115. package/baserom/patches/PixelConverter.patch.asm.old +0 -60
  116. package/baserom/patches/QuickScripts.asm.old +0 -210
  117. package/baserom/patches/RunButton.patch.asm +0 -79
  118. package/baserom/patches/SFXTable.patch.asm +0 -73
  119. package/baserom/patches/SceneLoadPatch.patch.asm +0 -52
  120. package/baserom/patches/SpritemapPatch.patch.asm +0 -45
  121. package/baserom/patches/Teleporter.patch.asm.old +0 -203
  122. package/baserom/patches/TilemapPatch.patch.asm +0 -94
  123. package/baserom/patches/TilesetPatch.patch.asm +0 -27
  124. package/baserom/patches/Utils.patch.asm +0 -414
  125. package/baserom/patches/WatermiaDeliveryman.patch.asm +0 -2
  126. /package/baserom/{graphics → boot-logo}/gfx_boot_exprite.raw.bin +0 -0
  127. /package/baserom/{graphics → boot-logo}/gfx_boot_logos.bin +0 -0
  128. /package/baserom/{palettes → boot-logo}/pal_boot_logos.pal +0 -0
  129. /package/baserom/{palettes → equipped-icon}/fx_palette_198000.pal +0 -0
  130. /package/baserom/{graphics → equipped-icon}/gfx_item_exprite.raw.bin +0 -0
  131. /package/baserom/{graphics → equipped-icon}/misc_fx_1CD580.bin +0 -0
  132. /package/baserom/{palettes → equipped-icon}/pal_item_exprite.pal +0 -0
  133. /package/baserom/{palettes → equipped-icon}/pal_sc02_main_characters.pal +0 -0
  134. /package/baserom/{graphics → fonts}/gfx_credits_font.bin +0 -0
  135. /package/baserom/{graphics → inventory}/gfx_inventory_sprites.bin +0 -0
@@ -1,292 +0,0 @@
1
- ?BANK 02
2
-
3
- !num_xoffset 01
4
- !num_yoffset F7
5
- !scene_current 0644
6
- !inventory_slots 0AB4
7
- !herb_count 0B55
8
- !jewel_count 0B56
9
- !crystal_count 0B57
10
-
11
- ---------------------------------------------
12
-
13
- generate_number_sprites {
14
- ;BRK #$70
15
- PHX
16
- LDA #$0000
17
- STZ $00DA
18
- SEP #$20
19
-
20
- LDY #$0010
21
-
22
- generate_number_top:
23
- DEY
24
- BMI generate_number_quit
25
- LDA $inventory_slots, Y
26
- CMP #$01
27
- BEQ generate_number_jewels
28
- CMP #$06
29
- BEQ generate_number_herbs
30
- CMP #$0E
31
- BEQ generate_number_crystals
32
- BRA generate_number_top
33
-
34
- generate_number_herbs:
35
- LDA $herb_count
36
- BRA generate_number_next
37
-
38
- generate_number_jewels:
39
- LDA $jewel_count
40
- BRA generate_number_next
41
-
42
- generate_number_crystals:
43
- LDA $crystal_count
44
-
45
- generate_number_next:
46
- PHA
47
-
48
- TYA
49
- ASL
50
- ASL
51
- TAX
52
- LDA @SlotPositionTable, X
53
- CLC
54
- ADC #$num_xoffset
55
- STA $25
56
-
57
- LDA @SlotPositionTable+2, X
58
- CLC
59
- ADC #$num_yoffset
60
- STA $26
61
-
62
- PLA
63
- CMP #$0A
64
- BCC generate_process_single
65
- STZ $24
66
-
67
- generate_process_top:
68
- ;SEC
69
- SBC #$0A
70
- INC $24
71
- CMP #$0A
72
- BCS generate_process_top
73
-
74
- PHA
75
- LDA $24
76
- JSR &push_number_sprite
77
- LDA $25
78
- CLC
79
- ADC #$04
80
- STA $25
81
- PLA
82
-
83
- generate_process_single:
84
- JSR &push_number_sprite
85
-
86
- JMP generate_number_top
87
-
88
- generate_number_quit:
89
- REP #$20
90
- PLX
91
- RTS
92
- }
93
-
94
- ----------------------------------------------
95
-
96
- push_number_sprite {
97
- LDX $00DA
98
-
99
- push_number_next:
100
- ORA #$80 ;Bottom half
101
- STA $7F1FC2, X
102
-
103
- LDA $25
104
- STA $7F1FC0, X
105
-
106
- LDA $26
107
- STA $7F1FC1, X
108
-
109
- LDA #$21
110
- STA $7F1FC3, X
111
-
112
- INX
113
- INX
114
- INX
115
- INX
116
- STX $00DA
117
-
118
- RTS
119
- }
120
-
121
- ---------------------------------------------
122
- ?INCLUDE 'inventory_menu'
123
- ?INCLUDE 'system_strings'
124
- ---------------------------------------------
125
-
126
- InventoryMenuInit! {
127
- COP [88] ( @inventory_spritemap )
128
- COP [BD] ( @consolestring_01E869 )
129
- LDA #$1000
130
- TSB $06EE
131
- JSR generate_number_sprites
132
- STZ $0AFA
133
- LDA #$000F
134
- STA $24
135
- }
136
-
137
- loc_02E63D! {
138
- JSR generate_number_sprites
139
- PHX
140
- PHD
141
- LDA $2C
142
- TAX
143
- TCD
144
- COP [A7]
145
- PLD
146
- PLX
147
- JMP $&code_02E544
148
- }
149
-
150
- loc_02E6FC! {
151
- JSR generate_number_sprites
152
- COP [06] ( #13 )
153
- JMP $&code_02E66B
154
- }
155
-
156
- ;Enable direct sprites
157
- loc_02EB22! {
158
- LDA #$1000
159
- TSB $06EE
160
-
161
- LDA #$1000
162
- TSB $10
163
- LDA #$000F
164
- STA $0000
165
- LDA $7F0010, X
166
- TAY
167
- }
168
-
169
- ;Disable direct sprites for status menu
170
- loc_02EB4D! {
171
- LDA #$1000
172
- TRB $06EE
173
-
174
- LDA #$1000
175
- TRB $10
176
- LDA #$000F
177
- STA $0000
178
- LDA $7F0010, X
179
- TAY
180
- }
181
-
182
-
183
- ---------------------------------------------
184
- ;Cursor positions
185
-
186
- GridColumnPositions! [
187
- screen-pos < #$004E, #$0030 > ;00
188
- screen-pos < #$0066, #$0030 > ;01
189
- screen-pos < #$007E, #$0030 > ;02
190
- screen-pos < #$0096, #$0030 > ;03
191
- ]
192
-
193
- ------------------------------------------------
194
- ?INCLUDE 'inventory_spritemap'
195
- ------------------------------------------------
196
- ;H-Mirror on the cursor
197
-
198
- sprite_group_108BAA! [
199
- sprite_group < #01, #0F, #18, #00, #F8, #F0, #01, #01, #F8, #10, #F0, #10, #01, [
200
- sprite_part < #01, #00, #00, #00, #08, #$46E5 >
201
- ] >
202
- ]
203
-
204
- ------------------------------------------------
205
- ?INCLUDE 'chunk_03BAE1'
206
- ------------------------------------------------
207
- ;Enable static sprites for scene FF with a different address and size
208
-
209
- loc_03C7F6! {
210
- LDA $scene_current
211
- CMP #$00FF
212
- BNE direct_sprite_large
213
-
214
- PEA #$0000
215
- BRA scene_check_next
216
-
217
- direct_sprite_large:
218
- PEA #$00AA
219
-
220
- scene_check_next:
221
- CMP #$00FE
222
- BEQ scene_addr_large
223
- CMP #$0090
224
- BCS scene_addr_small
225
- CMP #$008C
226
- BCS scene_addr_large
227
- BRA scene_addr_small
228
-
229
- scene_addr_large:
230
- LDX #$0600
231
- BRA scene_addr_next
232
-
233
- scene_addr_small:
234
- LDX #$1FC0
235
-
236
- scene_addr_next:
237
- LDY #$0422
238
- LDA $00DA
239
- BIT #$FE00
240
- BEQ loc_03C807
241
- LDA #$0200
242
- }
243
-
244
-
245
- loc_03C807! {
246
- DEC
247
- PHB
248
- MVN #$00, #$7F
249
- PLB
250
-
251
- LDY $00DA
252
- TYA
253
- LSR
254
- LSR
255
- LSR
256
- LSR
257
- STA $0E
258
-
259
- TYA
260
- LSR
261
- AND #$0006
262
- TAX
263
-
264
- SEP #$20
265
-
266
- loc_03C821!:
267
- DEC $0E
268
- BMI loc_03C82D
269
- LDA $01, S
270
- STA ($06)
271
- INC $06
272
- BRA loc_03C821
273
- }
274
-
275
-
276
- loc_03C82D! {
277
- LDA $01, S
278
- BEQ small_sprite_process
279
- LDA $@OamHiTableMasks, X
280
- STA $00
281
- BRA small_sprite_continue
282
-
283
- small_sprite_process:
284
- STZ $00
285
-
286
- small_sprite_continue:
287
- LDA $@OamHiTableMasks+1, X
288
- STA $0E
289
- REP #$20
290
- PLA
291
- RTS
292
- }
@@ -1,324 +0,0 @@
1
- ?BANK 03
2
-
3
- ?INCLUDE 'chunk_038000'
4
- ?INCLUDE 'chunk_03BAE1'
5
- ?INCLUDE 'jeweler_gem'
6
-
7
- !player_actor 09AA
8
- !jewels_collected 0AB0
9
- !inventory_slots 0AB4
10
- !inventory_equipped_index 0AC4
11
- !inventory_equipped_type 0AC6
12
- ;!page_2 0B34 ;16 items per page
13
-
14
- !state_1 0B54
15
- !herb_count 0B55
16
- !jewel_count 0B56
17
- !crystal_count 0B57
18
-
19
- --------------------------------------------------------
20
-
21
- inv_check_pages {
22
- PHA
23
- LDY #inventory_slots
24
-
25
- inv_check_page_1:
26
- LDA $0000, Y
27
- BEQ inv_give_item
28
- INY
29
- CPY #$inventory_slots+10
30
- BNE inv_check_page_1
31
-
32
- ;LDY #$page_2
33
-
34
- ;inv_check_page_2:
35
- ;LDA $0000, Y
36
- ;BEQ inv_give_item
37
- ;INY
38
- ;CPY #$page_2+10
39
- ;BNE inv_check_page_2
40
-
41
- inv_no_room:
42
- PLA
43
- SEC
44
- RTS
45
-
46
- inv_give_item:
47
- PLA
48
- STA $0000, Y
49
- CLC
50
- RTS
51
- }
52
-
53
- ------------------------------------------------
54
-
55
- inv_remove_stub:
56
- SEP #$20
57
- LDA $inventory_slots, X
58
- CMP #$01
59
- BEQ inv_remove_jewel
60
- CMP #$06
61
- BEQ inv_remove_herb
62
- CMP #$0E
63
- BEQ inv_remove_crystal
64
- BRA inv_remove_item
65
-
66
- inv_remove_jewel:
67
- SED
68
- REP #$20
69
- LDA $jewels_collected
70
-
71
- inv_add_jewel_count:
72
- CLC
73
- ADC #$0001
74
-
75
- SEP #$20
76
- DEC $jewel_count
77
- BMI inv_remove_jewel_minus
78
- REP #$20
79
- BEQ inv_finish_jewel_item
80
- BRA inv_add_jewel_count
81
-
82
- inv_remove_jewel_minus:
83
- STZ $jewel_count
84
- REP #$20
85
-
86
- inv_finish_jewel_item:
87
- STA $jewels_collected
88
- CLD
89
- SEP #$20
90
- BRA inv_remove_item
91
-
92
- inv_remove_herb:
93
- DEC $herb_count
94
- BMI inv_remove_herb_minus
95
- BEQ inv_remove_item
96
- RTS
97
-
98
- inv_remove_herb_minus:
99
- STZ $herb_count
100
- BRA inv_remove_item
101
-
102
- inv_remove_crystal:
103
- DEC $crystal_count
104
- BMI inv_remove_crystal_minus
105
- BEQ inv_remove_item
106
- RTS
107
-
108
- inv_remove_crystal_minus:
109
- STZ $crystal_count
110
-
111
- inv_remove_item:
112
- STZ $inventory_slots, X
113
- CPX $inventory_equipped_index
114
- BNE inv_remove_finish
115
- REP #$20
116
- LDA #$0000
117
- STA $inventory_equipped_type
118
- DEC
119
- STA $inventory_equipped_index
120
- LDA #$1000
121
- TRB $06EE
122
-
123
- inv_remove_finish:
124
- RTS
125
-
126
- ------------------------------------------------
127
- ;Entry point for gem use (prevent increase, this is done elsewhere)
128
- UseItem_RedJewel! {
129
- COP [BF] ( &dialogstring_038517 )
130
- JSR $&RemoveEquippedItem
131
-
132
- ; SED
133
- ; LDA $jewels_collected
134
- ; CLC
135
- ; ADC #$0001
136
- ; STA $jewels_collected
137
- ; CLD
138
-
139
- PHX
140
- PHD
141
- LDA $player_actor
142
- TCD
143
- TAX
144
- COP [A5] ( @code_038566, #00, #00, #$2000 )
145
- TYX
146
- LDA #$0000
147
- STA $0012, X
148
- LDA #$3000
149
- STA $000E, X
150
- LDY $player_actor
151
- LDA $0014, Y
152
- STA $0014, X
153
- LDA $0016, Y
154
- STA $0016, X
155
- PLD
156
- PLX
157
- RTS
158
- }
159
-
160
- ---------------------------------------------
161
- ;Entry point for removing an item from the inventory upon use
162
-
163
- RemoveEquippedItem! {
164
- PHX
165
- LDX $inventory_equipped_index
166
- JSR inv_remove_stub
167
- PLX
168
- REP #$20
169
- RTS
170
- }
171
-
172
- --------------------------------------------------
173
- ;Entry point for adding an item to the inventory
174
-
175
- GiveItemToPlayer! {
176
- PHP
177
- SEP #$20
178
- BIT #$80
179
- BNE loc_03EFB3
180
-
181
- inv_give_item_handler:
182
- CMP #$01
183
- BEQ inv_give_jewel
184
- CMP #$06
185
- BEQ inv_give_herb
186
- CMP #$0E
187
- BEQ inv_give_crystal
188
-
189
- JSR inv_check_pages
190
- BCS inv_exit_fail
191
- JMP GiveItem_StoreInSlot+4
192
-
193
- inv_exit_fail:
194
- JMP GiveItem_InventoryFull+1
195
-
196
- inv_give_jewel:
197
- LDA $jewel_count
198
- BNE $05
199
- LDA #01
200
- JSR inv_check_pages
201
- INC $jewel_count
202
- LDA #01
203
- JMP GiveItem_StoreInSlot+4
204
-
205
- inv_give_herb:
206
- LDA $herb_count
207
- BNE $07
208
- LDA #$06
209
- JSR inv_check_pages
210
- BCS inv_exit_fail
211
- INC $herb_count
212
- LDA #06
213
- JMP GiveItem_StoreInSlot+4
214
-
215
- inv_give_crystal:
216
- LDA $crystal_count
217
- BNE $07
218
- LDA #$0E
219
- JSR inv_check_pages
220
- BCS inv_exit_fail
221
- INC $crystal_count
222
- LDA #0E
223
- JMP GiveItem_StoreInSlot+4
224
-
225
- }
226
-
227
- ---------------------------------------------
228
- ;Entry point for checking inventory for item
229
-
230
- loc_03F0B9! {
231
- CMP $inventory_slots, Y
232
- BEQ loc_03F0C7
233
- INY
234
- CPY #$0010
235
- BNE loc_03F0B9
236
- ;LDY #$0000
237
-
238
- ;inv_search_page2:
239
- ;CMP $page_2, Y
240
- ;BEQ code_03F0C7
241
- ;INY
242
- ;CPY #$0010
243
- ;BNE inv_search_page2
244
-
245
- PLP
246
- SEC
247
- RTL
248
- }
249
-
250
- ---------------------------------------------
251
- ;Route COP item removal through common process
252
-
253
- loc_03F0A0! {
254
- PHX
255
- TYX
256
- JSR inv_remove_stub
257
- PLX
258
- REP #$20
259
- }
260
-
261
- -----------------------------------------
262
- ;Entry point for giving Jewels to Gem
263
-
264
- JewelerCountJewels! {
265
- SEP #$20
266
- LDA #$00
267
- XBA
268
- LDA $jewel_count
269
- BEQ search_inventory
270
- STZ $jewel_count
271
- REP #$20
272
- STA $26
273
- SED
274
- LDA $0AB0
275
-
276
- search_add_top:
277
- CLC
278
- ADC #$0001
279
- DEC $26
280
- BEQ search_store_gems
281
- BRA search_add_top
282
-
283
- search_store_gems:
284
- STA $0AB0
285
- CLD
286
- SEP #$20
287
-
288
- search_inventory:
289
- LDA #$01
290
- LDY #$000F
291
-
292
- search_top_1:
293
- CMP $inventory_slots, Y
294
- BNE search_next_1
295
- PHA
296
- LDA #$00
297
- STA $inventory_slots, Y
298
- PLA
299
-
300
- search_next_1:
301
- DEY
302
- BPL search_top_1
303
- ;LDY #$000F
304
-
305
- ;search_top_2:
306
- ;CMP $page_2, Y
307
- ;BNE search_next_2
308
- ;PHA
309
- ;LDA #$00
310
- ;STA $page_2, Y
311
- ;PLA
312
-
313
- ;search_next_2:
314
- ; DEY
315
- ; BPL search_top_2
316
-
317
- REP #$20
318
- }
319
-
320
- loc_08CF74! {
321
- }
322
-
323
- loc_08CF84! {
324
- }