@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.
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 -24
  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
@@ -0,0 +1,373 @@
1
+ ; ==============================================================================
2
+ ; Options input remap - save bytes to engine joypad remap words
3
+ ; ==============================================================================
4
+ ; What it does: Converts six saved action bytes into $0DA6-$0DB4 remap words;
5
+ ; initializes defaults on new/old saves; preset detect/load for options UI.
6
+ ; Vanilla behavior: Diary ApplySoundAndRemap wrote fixed Type-1/2 layouts from
7
+ ; $0B26 only; no persistent per-button action bytes in save.
8
+ ; Hooks (overrides): None (called via JSL from options menu and diary hook).
9
+ ; Adds: ConvertActionByte, ApplyButtonMapping, InitDefault/AltButtonMap,
10
+ ; DetectAndInitButtonMap, DetectPreset, LoadButtonMapPreview, SetButtonPreset.
11
+ ; Depends on: Called from options_menu_core and OptionsMenu ApplySoundAndRemap tail.
12
+ ; State: Save $0B34-$0B39 (action bits per button); preview $0BEA-$0BEF;
13
+ ; remap words $0DA6-$0DB4; $0B26 picks Alternate vs Default on empty save.
14
+ ; Hazards: ApplyButtonMapping RTL; ConvertActionByte uses $@ActionFlagTable;
15
+ ; Start/Select always passthrough $1000/$2000 in ApplyButtonMapping.
16
+ ; ==============================================================================
17
+
18
+ !btnMapA 0B34
19
+ !btnMapB 0B35
20
+ !btnMapX 0B36
21
+ !btnMapY 0B37
22
+ !btnMapL 0B38
23
+ !btnMapR 0B39
24
+
25
+ ; 6-byte preview buffer used by the options menu (WRAM scratch, not saved in any meaningful way).
26
+ !optMapPreview 0BEA
27
+
28
+ ; Remap variables — variable name vs physical button is non-obvious:
29
+ ; remapA ($0DAC) -> physical A ($0080)
30
+ ; remapB ($0DAA) -> physical B ($8000)
31
+ ; remapX ($0DB0) -> physical X ($0040)
32
+ ; remapY ($0DAE) -> physical Y ($4000)
33
+ ; remapL ($0DA8) -> physical L ($0020)
34
+ ; remapR ($0DA6) -> physical R ($0010)
35
+ ; remapStart ($0DB2) -> physical Start ($1000) -- passthrough
36
+ ; remapSelect ($0DB4) -> physical Select($2000) -- passthrough
37
+
38
+ !remapR 0DA6
39
+ !remapL 0DA8
40
+ !remapB 0DAA
41
+ !remapA 0DAC
42
+ !remapY 0DAE
43
+ !remapX 0DB0
44
+ !remapStart 0DB2
45
+ !remapSelect 0DB4
46
+
47
+ ---------------------------------------------
48
+ ; Lookup table: save byte bit position -> joypadCurrent action flag word.
49
+ ; Indexed by bit position (0-7), each entry is a 16-bit word.
50
+ ; Bit 0 is shifted out first by LSR, so entry 0 = Cycle Item.
51
+
52
+ ActionFlagTable [
53
+ #$0004 ;00 bit 0 -> ACTION_CYCLE_ITEM
54
+ #$0008 ;01 bit 1 -> ACTION_USE_ITEM
55
+ #$0010 ;02 bit 2 -> ACTION_BLOCK2
56
+ #$0020 ;03 bit 3 -> ACTION_BLOCK1
57
+ #$0040 ;04 bit 4 -> ACTION_RUN
58
+ #$0080 ;05 bit 5 -> ACTION_ATTACK
59
+ #$4000 ;06 bit 6 -> ACTION_CANCEL
60
+ #$8000 ;07 bit 7 -> ACTION_CONFIRM
61
+ ]
62
+
63
+ ---------------------------------------------
64
+ ; Default button mapping bytes — written on new game and old-save detection.
65
+ ; A=$A0 (Confirm+Attack), B=$42 (Cancel+UseItem), X=$01 (Cycle Item)
66
+ ; Y=$10 (Run), L=$08 (Block2), R=$04 (Block1)
67
+
68
+ DefaultButtonMap [
69
+ #$A0 ;00 A
70
+ #$42 ;01 B
71
+ #$01 ;02 X
72
+ #$10 ;03 Y
73
+ #$08 ;04 L
74
+ #$04 ;05 R
75
+ ]
76
+
77
+ AlternateButtonMap [
78
+ #$10 ;00 A
79
+ #$A0 ;01 B
80
+ #$01 ;02 X
81
+ #$42 ;03 Y
82
+ #$08 ;04 L
83
+ #$04 ;05 R
84
+ ]
85
+
86
+ ---------------------------------------------
87
+ ; ConvertActionByte — expand a save byte into a 16-bit remap word.
88
+ ;
89
+ ; Entry: A = save byte (low 8 bits valid, high byte ignored)
90
+ ; Exit: A = 16-bit remap word
91
+ ; Clobbers: $00, $02, X
92
+
93
+ ConvertActionByte {
94
+ AND #$00FF
95
+ STA $0000
96
+ STZ $0002
97
+ LDX #$0000
98
+
99
+ cab_loop:
100
+ LSR $0000
101
+ BCC cab_skip
102
+ LDA $@ActionFlagTable, X
103
+ TSB $0002
104
+
105
+ cab_skip:
106
+ INX
107
+ INX
108
+ CPX #$0010
109
+ BNE cab_loop
110
+ LDA $0002
111
+ RTS
112
+ }
113
+
114
+ ---------------------------------------------
115
+ ; ApplyButtonMapping — read 6 save bytes and rebuild all remap words.
116
+ ;
117
+ ; Called after loading a save, after new game init, and after changing
118
+ ; a button mapping in the options menu.
119
+ ;
120
+ ; Hardcodes Start and Select as passthrough ($1000/$2000).
121
+
122
+ ApplyButtonMapping {
123
+ PHP
124
+ PHX
125
+ REP #$20
126
+
127
+ ; A button -> remapA (physical A $0080)
128
+ LDA $btnMapA
129
+ JSR $&ConvertActionByte
130
+ STA $remapA
131
+
132
+ ; B button -> remapB (physical B $8000)
133
+ LDA $btnMapB
134
+ JSR $&ConvertActionByte
135
+ STA $remapB
136
+
137
+ ; X button -> remaX (physical X $0040)
138
+ LDA $btnMapX
139
+ JSR $&ConvertActionByte
140
+ STA $remapX
141
+
142
+ ; Y button -> remapY (physical Y $4000)
143
+ LDA $btnMapY
144
+ JSR $&ConvertActionByte
145
+ STA $remapY
146
+
147
+ ; L button -> remapL (physical L $0020)
148
+ LDA $btnMapL
149
+ JSR $&ConvertActionByte
150
+ STA $remapL
151
+
152
+ ; R button -> remapR (physical R $0010)
153
+ LDA $btnMapR
154
+ JSR $&ConvertActionByte
155
+ STA $remapR
156
+
157
+ ; Start -> passthrough $1000 (always maps to Start)
158
+ LDA #$1000
159
+ STA $remapStart
160
+
161
+ ; Select -> passthrough $2000 (always maps to Select)
162
+ LDA #$2000
163
+ STA $remapSelect
164
+
165
+ PLX
166
+ PLP
167
+ RTL
168
+ }
169
+
170
+ ---------------------------------------------
171
+ ; InitDefaultButtonMap — write default mapping bytes to $0B34-$0B39.
172
+ ;
173
+ ; Called on new game or when loading an old save without mapping data.
174
+
175
+ InitDefaultButtonMap {
176
+ PHP
177
+ SEP #$20
178
+ LDX #$0000
179
+
180
+ idbm_loop:
181
+ LDA $@DefaultButtonMap, X
182
+ STA $btnMapA, X
183
+ INX
184
+ CPX #$0006
185
+ BNE idbm_loop
186
+
187
+ PLP
188
+ RTS
189
+ }
190
+
191
+ ---------------------------------------------
192
+ ; InitAltButtonMap — write default mapping bytes to $0B34-$0B39.
193
+ ;
194
+ ; Called on new game or when loading an old save without mapping data.
195
+
196
+ InitAltButtonMap {
197
+ PHP
198
+ SEP #$20
199
+ LDX #$0000
200
+
201
+ iabm_loop:
202
+ LDA $@AlternateButtonMap, X
203
+ STA $btnMapA, X
204
+ INX
205
+ CPX #$0006
206
+ BNE iabm_loop
207
+
208
+ PLP
209
+ RTS
210
+ }
211
+
212
+ ---------------------------------------------
213
+ ; DetectAndInitButtonMap — check if save data has button mappings.
214
+ ; If all 6 bytes at $0B34-$0B39 are zero, assume old save and init defaults.
215
+ ;
216
+ ; Entry: called after LoadGameState_Scene returns successfully.
217
+
218
+ DetectAndInitButtonMap {
219
+ PHP
220
+ REP #$20
221
+ LDA $btnMapA
222
+ AND #$FFFF
223
+ BNE dibm_has_data
224
+ LDA $btnMapX
225
+ AND #$FFFF
226
+ BNE dibm_has_data
227
+ LDA $btnMapL
228
+ AND #$FFFF
229
+ BNE dibm_has_data
230
+
231
+ ; All 6 bytes zero — old save, write defaults
232
+ LDA $0B26
233
+ BEQ dibm_init_default
234
+ JSR $&InitAltButtonMap
235
+ BRA dibm_has_data
236
+
237
+ dibm_init_default:
238
+ JSR $&InitDefaultButtonMap
239
+
240
+ dibm_has_data:
241
+ PLP
242
+ RTL
243
+ }
244
+
245
+ ---------------------------------------------
246
+ ; DetectPreset — compare the live mapping ($0B34-$0B39) with the two
247
+ ; built-in presets.
248
+ ;
249
+ ; Exit: A (16-bit) = 0 if identical to DefaultButtonMap (Classic A)
250
+ ; 1 if identical to AlternateButtonMap (Classic B)
251
+ ; 2 if neither (Custom)
252
+ ; Called via JSL. Preserves X, Y, P.
253
+
254
+ DetectPreset {
255
+ PHP
256
+ PHX
257
+ SEP #$20
258
+ LDX #$0000
259
+
260
+ detpre_cmp_default:
261
+ LDA $btnMapA, X
262
+ CMP $@DefaultButtonMap, X
263
+ BNE detpre_try_alt
264
+ INX
265
+ CPX #$0006
266
+ BNE detpre_cmp_default
267
+ LDA #$00
268
+ BRA detpre_done
269
+
270
+ detpre_try_alt:
271
+ LDX #$0000
272
+
273
+ detpre_cmp_alt:
274
+ LDA $btnMapA, X
275
+ CMP $@AlternateButtonMap, X
276
+ BNE detpre_custom
277
+ INX
278
+ CPX #$0006
279
+ BNE detpre_cmp_alt
280
+ LDA #$01
281
+ BRA detpre_done
282
+
283
+ detpre_custom:
284
+ LDA #$02
285
+
286
+ detpre_done:
287
+ REP #$20
288
+ AND #$00FF
289
+ PLX
290
+ PLP
291
+ RTL
292
+ }
293
+
294
+ ---------------------------------------------
295
+ ; LoadButtonMapPreview — copy one 6-byte button map into the preview buffer
296
+ ; ($0BEA-$0BEF) so the options menu can display it without touching the
297
+ ; player's real mapping.
298
+ ;
299
+ ; Entry: A (16-bit) = source: 0 = live mapping ($0B34-$0B39)
300
+ ; 1 = DefaultButtonMap (Classic A)
301
+ ; 2 = AlternateButtonMap (Classic B)
302
+ ; Called via JSL. Preserves X, Y, P.
303
+
304
+ LoadButtonMapPreview {
305
+ PHP
306
+ PHX
307
+ REP #$20
308
+ LDX #$0000
309
+ CMP #$0001
310
+ BEQ lbmp_default
311
+ CMP #$0002
312
+ BEQ lbmp_alt
313
+ SEP #$20
314
+
315
+ lbmp_live_loop:
316
+ LDA $btnMapA, X
317
+ STA $optMapPreview, X
318
+ INX
319
+ CPX #$0006
320
+ BNE lbmp_live_loop
321
+ BRA lbmp_done
322
+
323
+ lbmp_default:
324
+ SEP #$20
325
+
326
+ lbmp_default_loop:
327
+ LDA $@DefaultButtonMap, X
328
+ STA $optMapPreview, X
329
+ INX
330
+ CPX #$0006
331
+ BNE lbmp_default_loop
332
+ BRA lbmp_done
333
+
334
+ lbmp_alt:
335
+ SEP #$20
336
+
337
+ lbmp_alt_loop:
338
+ LDA $@AlternateButtonMap, X
339
+ STA $optMapPreview, X
340
+ INX
341
+ CPX #$0006
342
+ BNE lbmp_alt_loop
343
+
344
+ lbmp_done:
345
+ PLX
346
+ PLP
347
+ RTL
348
+ }
349
+
350
+ ---------------------------------------------
351
+ ; SetButtonPreset — overwrite the live mapping ($0B34-$0B39) with a preset.
352
+ ; The caller must follow up with ApplyButtonMapping to rebuild the remap words.
353
+ ;
354
+ ; Entry: A (16-bit) = 0 -> Classic A (DefaultButtonMap), otherwise Classic B.
355
+ ; Called via JSL. Preserves X, Y, P.
356
+
357
+ SetButtonPreset {
358
+ PHP
359
+ PHX
360
+ REP #$20
361
+ CMP #$0000
362
+ BNE sbp_alt
363
+ JSR $&InitDefaultButtonMap
364
+ BRA sbp_done
365
+
366
+ sbp_alt:
367
+ JSR $&InitAltButtonMap
368
+
369
+ sbp_done:
370
+ PLX
371
+ PLP
372
+ RTL
373
+ }