romdevtools 0.27.0 → 0.29.0

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 (199) hide show
  1. package/AGENTS.md +56 -44
  2. package/CHANGELOG.md +355 -0
  3. package/README.md +4 -4
  4. package/examples/README.md +7 -7
  5. package/examples/atari2600/templates/platformer.asm +1227 -325
  6. package/examples/atari2600/templates/puzzle.asm +1056 -0
  7. package/examples/atari2600/templates/racing.asm +909 -257
  8. package/examples/atari2600/templates/shmup.asm +1035 -218
  9. package/examples/atari2600/templates/sports.asm +1143 -229
  10. package/examples/atari7800/templates/hello_sprite.c +8 -4
  11. package/examples/atari7800/templates/platformer.c +991 -152
  12. package/examples/atari7800/templates/puzzle.c +1091 -145
  13. package/examples/atari7800/templates/racing.c +949 -118
  14. package/examples/atari7800/templates/shmup.c +812 -130
  15. package/examples/atari7800/templates/sports.c +820 -181
  16. package/examples/c64/templates/platformer.c +876 -157
  17. package/examples/c64/templates/puzzle.c +881 -143
  18. package/examples/c64/templates/racing.c +873 -88
  19. package/examples/c64/templates/shmup.c +762 -154
  20. package/examples/c64/templates/sports.c +755 -95
  21. package/examples/gb/templates/platformer.c +841 -175
  22. package/examples/gb/templates/puzzle.c +1094 -176
  23. package/examples/gb/templates/racing.c +761 -169
  24. package/examples/gb/templates/shmup.c +679 -169
  25. package/examples/gb/templates/sports.c +790 -153
  26. package/examples/gba/templates/platformer.c +624 -169
  27. package/examples/gba/templates/puzzle.c +535 -207
  28. package/examples/gba/templates/racing.c +513 -196
  29. package/examples/gba/templates/shmup.c +565 -168
  30. package/examples/gba/templates/sports.c +454 -162
  31. package/examples/gbc/templates/platformer.c +944 -176
  32. package/examples/gbc/templates/puzzle.c +1131 -177
  33. package/examples/gbc/templates/racing.c +891 -175
  34. package/examples/gbc/templates/shmup.c +827 -179
  35. package/examples/gbc/templates/sports.c +870 -156
  36. package/examples/genesis/templates/platformer.c +747 -129
  37. package/examples/genesis/templates/puzzle.c +702 -208
  38. package/examples/genesis/templates/racing.c +728 -193
  39. package/examples/genesis/templates/shmup.c +535 -142
  40. package/examples/genesis/templates/shmup_2p.c +13 -1
  41. package/examples/genesis/templates/sports.c +495 -158
  42. package/examples/gg/templates/platformer.c +883 -214
  43. package/examples/gg/templates/puzzle.c +906 -181
  44. package/examples/gg/templates/racing.c +919 -160
  45. package/examples/gg/templates/shmup.c +716 -177
  46. package/examples/gg/templates/sports.c +735 -128
  47. package/examples/lynx/templates/platformer.c +604 -50
  48. package/examples/lynx/templates/puzzle.c +533 -130
  49. package/examples/lynx/templates/racing.c +538 -102
  50. package/examples/lynx/templates/shmup.c +461 -122
  51. package/examples/lynx/templates/sports.c +496 -69
  52. package/examples/msx/platformer/main.c +648 -159
  53. package/examples/msx/puzzle/main.c +750 -185
  54. package/examples/msx/racing/main.c +669 -177
  55. package/examples/msx/shmup/main.c +460 -177
  56. package/examples/msx/sports/main.c +591 -124
  57. package/examples/nes/templates/platformer.c +586 -160
  58. package/examples/nes/templates/puzzle.c +603 -222
  59. package/examples/nes/templates/racing.c +505 -197
  60. package/examples/nes/templates/shmup.c +339 -144
  61. package/examples/nes/templates/sports.c +341 -182
  62. package/examples/pce/platformer/main.c +875 -204
  63. package/examples/pce/puzzle/main.c +797 -216
  64. package/examples/pce/racing/main.c +782 -206
  65. package/examples/pce/shmup/main.c +638 -211
  66. package/examples/pce/sports/main.c +585 -167
  67. package/examples/porting-across-platforms/README.md +1 -1
  68. package/examples/sms/templates/platformer.c +765 -176
  69. package/examples/sms/templates/puzzle.c +783 -177
  70. package/examples/sms/templates/racing.c +812 -133
  71. package/examples/sms/templates/shmup.c +601 -148
  72. package/examples/sms/templates/shmup_2p.c +17 -1
  73. package/examples/sms/templates/sports.c +633 -121
  74. package/examples/snes/templates/music_demo.c +7 -0
  75. package/examples/snes/templates/platformer-data.asm +123 -24
  76. package/examples/snes/templates/platformer-hdr.asm +57 -0
  77. package/examples/snes/templates/platformer.c +587 -149
  78. package/examples/snes/templates/puzzle-data.asm +116 -21
  79. package/examples/snes/templates/puzzle-hdr.asm +57 -0
  80. package/examples/snes/templates/puzzle.c +632 -185
  81. package/examples/snes/templates/racing-data.asm +390 -32
  82. package/examples/snes/templates/racing-hdr.asm +57 -0
  83. package/examples/snes/templates/racing.c +807 -177
  84. package/examples/snes/templates/shmup-data.asm +87 -29
  85. package/examples/snes/templates/shmup-hdr.asm +57 -0
  86. package/examples/snes/templates/shmup.c +459 -180
  87. package/examples/snes/templates/sports-data.asm +48 -2
  88. package/examples/snes/templates/sports-hdr.asm +57 -0
  89. package/examples/snes/templates/sports.c +414 -156
  90. package/package.json +12 -12
  91. package/src/cores/wasm/bluemsx_libretro.js +1 -1
  92. package/src/cores/wasm/bluemsx_libretro.wasm +0 -0
  93. package/src/cores/wasm/fceumm_libretro.js +1 -1
  94. package/src/cores/wasm/fceumm_libretro.wasm +0 -0
  95. package/src/cores/wasm/gambatte_libretro.js +1 -1
  96. package/src/cores/wasm/gambatte_libretro.wasm +0 -0
  97. package/src/cores/wasm/geargrafx_libretro.js +1 -1
  98. package/src/cores/wasm/geargrafx_libretro.wasm +0 -0
  99. package/src/cores/wasm/genesis_plus_gx_libretro.js +1 -1
  100. package/src/cores/wasm/genesis_plus_gx_libretro.wasm +0 -0
  101. package/src/cores/wasm/handy_libretro.js +1 -1
  102. package/src/cores/wasm/handy_libretro.wasm +0 -0
  103. package/src/cores/wasm/mgba_libretro.js +1 -1
  104. package/src/cores/wasm/mgba_libretro.wasm +0 -0
  105. package/src/cores/wasm/prosystem_libretro.js +1 -1
  106. package/src/cores/wasm/prosystem_libretro.wasm +0 -0
  107. package/src/cores/wasm/snes9x_libretro.js +1 -1
  108. package/src/cores/wasm/snes9x_libretro.wasm +0 -0
  109. package/src/cores/wasm/stella2014_libretro.js +1 -1
  110. package/src/cores/wasm/stella2014_libretro.wasm +0 -0
  111. package/src/cores/wasm/vice_x64_libretro.js +1 -1
  112. package/src/cores/wasm/vice_x64_libretro.wasm +0 -0
  113. package/src/host/LibretroHost.js +304 -11
  114. package/src/http/tool-registry.js +11 -11
  115. package/src/mcp/server.js +6 -0
  116. package/src/mcp/tools/cheats.js +2 -1
  117. package/src/mcp/tools/disasm-rebuild.js +315 -65
  118. package/src/mcp/tools/disasm.js +149 -28
  119. package/src/mcp/tools/find-references.js +216 -51
  120. package/src/mcp/tools/frame.js +14 -6
  121. package/src/mcp/tools/index.js +18 -4
  122. package/src/mcp/tools/input.js +31 -7
  123. package/src/mcp/tools/lifecycle.js +6 -4
  124. package/src/mcp/tools/memory.js +208 -39
  125. package/src/mcp/tools/platform-docs.js +1 -1
  126. package/src/mcp/tools/playtest.js +56 -4
  127. package/src/mcp/tools/preview-tile.js +6 -2
  128. package/src/mcp/tools/project.js +1114 -120
  129. package/src/mcp/tools/rom-id.js +5 -1
  130. package/src/mcp/tools/run-until.js +4 -2
  131. package/src/mcp/tools/snippets.js +6 -6
  132. package/src/mcp/tools/sprite-pipeline.js +14 -2
  133. package/src/mcp/tools/state.js +2 -1
  134. package/src/mcp/tools/tile-inspect.js +8 -1
  135. package/src/mcp/tools/toolchain.js +55 -11
  136. package/src/mcp/tools/watch-memory.js +145 -27
  137. package/src/observer/bus.js +73 -0
  138. package/src/observer/livestream.html +4 -2
  139. package/src/observer/tool-wrap.js +17 -14
  140. package/src/platforms/_guides/ROMHACKING_PLAYBOOK.md +64 -17
  141. package/src/platforms/atari2600/MENTAL_MODEL.md +5 -1
  142. package/src/platforms/atari2600/TROUBLESHOOTING.md +40 -0
  143. package/src/platforms/atari7800/MENTAL_MODEL.md +32 -11
  144. package/src/platforms/atari7800/TROUBLESHOOTING.md +5 -5
  145. package/src/platforms/c64/MENTAL_MODEL.md +11 -4
  146. package/src/platforms/c64/TROUBLESHOOTING.md +13 -0
  147. package/src/platforms/gb/MENTAL_MODEL.md +19 -4
  148. package/src/platforms/gb/TROUBLESHOOTING.md +101 -6
  149. package/src/platforms/gb/lib/c/README.md +10 -11
  150. package/src/platforms/gb/lib/c/gb_crt0.s +27 -3
  151. package/src/platforms/gb/lib/c/patch-header.js +19 -6
  152. package/src/platforms/gba/MENTAL_MODEL.md +4 -4
  153. package/src/platforms/gba/TROUBLESHOOTING.md +3 -3
  154. package/src/platforms/gba/lib/c/gba_sfx.c +40 -0
  155. package/src/platforms/gba/lib/c/gba_sfx.h +10 -0
  156. package/src/platforms/gbc/MENTAL_MODEL.md +16 -4
  157. package/src/platforms/gbc/TROUBLESHOOTING.md +24 -3
  158. package/src/platforms/gbc/UPSTREAM_SOURCES.md +1 -1
  159. package/src/platforms/gbc/lib/c/README.md +10 -11
  160. package/src/platforms/gbc/lib/c/font.h +43 -0
  161. package/src/platforms/gbc/lib/c/gb_crt0.s +26 -3
  162. package/src/platforms/gbc/lib/c/patch-header.js +19 -6
  163. package/src/platforms/genesis/MENTAL_MODEL.md +43 -9
  164. package/src/platforms/genesis/TROUBLESHOOTING.md +2 -2
  165. package/src/platforms/genesis/lib/c/genesis_sfx.c +37 -0
  166. package/src/platforms/genesis/lib/c/genesis_sfx.h +1 -0
  167. package/src/platforms/gg/MENTAL_MODEL.md +4 -4
  168. package/src/platforms/gg/TROUBLESHOOTING.md +14 -18
  169. package/src/platforms/gg/UPSTREAM_SOURCES.md +1 -1
  170. package/src/platforms/gg/lib/c/gg_crt0.s +14 -2
  171. package/src/platforms/gg/lib/c/joypad_read.c +29 -0
  172. package/src/platforms/lynx/MENTAL_MODEL.md +1 -1
  173. package/src/platforms/lynx/TROUBLESHOOTING.md +3 -3
  174. package/src/platforms/lynx/lib/c/lynx_sfx.c +38 -2
  175. package/src/platforms/lynx/lib/c/lynx_sfx.h +1 -0
  176. package/src/platforms/msx/MENTAL_MODEL.md +11 -5
  177. package/src/platforms/msx/TROUBLESHOOTING.md +21 -0
  178. package/src/platforms/msx/lib/c/msx_crt0.s +27 -0
  179. package/src/platforms/msx/lib/c/msx_hw.h +3 -0
  180. package/src/platforms/msx/lib/c/msx_vdp.c +70 -0
  181. package/src/platforms/nes/MENTAL_MODEL.md +12 -5
  182. package/src/platforms/nes/lib/c/nes_runtime.c +190 -34
  183. package/src/platforms/nes/lib/c/nes_runtime.h +35 -0
  184. package/src/platforms/pce/MENTAL_MODEL.md +14 -5
  185. package/src/platforms/pce/TROUBLESHOOTING.md +9 -0
  186. package/src/platforms/pce/lib/c/pce_hw.h +13 -1
  187. package/src/platforms/pce/lib/c/pce_sound.c +22 -0
  188. package/src/platforms/pce/lib/c/pce_video.c +32 -0
  189. package/src/platforms/sms/MENTAL_MODEL.md +11 -6
  190. package/src/platforms/sms/TROUBLESHOOTING.md +6 -0
  191. package/src/platforms/sms/lib/c/sms_crt0.s +14 -2
  192. package/src/platforms/snes/MENTAL_MODEL.md +7 -2
  193. package/src/platforms/snes/TROUBLESHOOTING.md +40 -1
  194. package/src/playtest/playtest.js +73 -3
  195. package/src/toolchains/cc65/presets/nes/chr-ram-runtime.cfg +13 -8
  196. package/src/toolchains/cc65/presets/nes/chr-ram-runtime.crt0.s +58 -5
  197. package/src/toolchains/cc65/presets/nes/chr-rom.crt0.s +52 -3
  198. package/src/toolchains/cc65/presets/pce/rom32k.cfg +52 -0
  199. package/src/toolchains/index.js +64 -19
@@ -1,8 +1,58 @@
1
- ; ── puzzle-data.asm — font stubs only ─────────────────────────────
2
- ; puzzle.c uses only consoleDrawText, so we don't need sprite tile
3
- ; or palette data.
1
+ ; ── puzzle-data.asm — JEWEL JOUST's assembly half ────────────────────────────
2
+ ;
3
+ ; What lives here (and why it can't live in puzzle.c):
4
+ ; 1. sram_read16/sram_write16 — battery SRAM accessors. SRAM sits at
5
+ ; $70:0000 (declared in hdr.asm — see puzzle-hdr.asm), reachable only
6
+ ; with long (24-bit) addressing, which tcc C pointers don't emit.
7
+ ; 2. Console font + the board tileset (8 tiles 4bpp: blank, well frame,
8
+ ; cabinet dither, empty-cell speck, three jewels) + its palette.
9
+ ; The SAME tile data is uploaded to BOTH the BG2 char base and the OBJ
10
+ ; char base, so the falling-trio sprites and the locked board cells are
11
+ ; pixel-identical by construction.
12
+ ;
13
+ ; Section names must stay unique vs snes_sfx_data.asm (also linked in).
14
+
4
15
  .include "hdr.asm"
5
16
 
17
+ .SECTION ".puzzle_asm" SUPERFREE
18
+
19
+ ; ── HARDWARE IDIOM (load-bearing — reshape gameplay around this; see TROUBLESHOOTING) ──
20
+ ; Battery SRAM accessors. SRAM is mapped at $70:0000 (LoROM, SRAMSIZE $01 in
21
+ ; puzzle-hdr.asm = 2 KB). Long addressing only — there is no SRAM mirror in
22
+ ; the program banks, which is why these are asm and not C. tcc calling
23
+ ; convention: u16 arg at 5,s (after the 4-byte rtl frame), second arg at 7,s;
24
+ ; u16 return in tcc__r0.
25
+
26
+ ; u16 sram_read16(u16 offset)
27
+ sram_read16:
28
+ php
29
+ rep #$30
30
+ lda 5,s ; offset
31
+ tax
32
+ sep #$20
33
+ lda.l $700000,x
34
+ sta.w tcc__r0
35
+ lda.l $700001,x
36
+ sta.w tcc__r0 + 1
37
+ plp
38
+ rtl
39
+
40
+ ; void sram_write16(u16 offset, u16 value)
41
+ sram_write16:
42
+ php
43
+ rep #$30
44
+ lda 5,s ; offset
45
+ tax
46
+ lda 7,s ; value
47
+ sep #$20
48
+ sta.l $700000,x ; low byte
49
+ xba
50
+ sta.l $700001,x ; high byte
51
+ plp
52
+ rtl
53
+
54
+ .ENDS
55
+
6
56
  .section ".rodata1" superfree
7
57
 
8
58
  tilfont:
@@ -309,26 +359,71 @@ palfont:
309
359
  .db $00, $00, $00, $00, $00, $00, $00, $00
310
360
  .db $00, $00
311
361
 
312
- ; ── Background wallpaper (one 8x8 4bpp tile, 4 solid colour quadrants) ──
313
- ; Tiled across BG1 it paints the whole screen in four muted colours so the
314
- ; playfield never reads as a flat/blank backdrop. Quadrant->colour: TL=1,
315
- ; TR=2, BL=3, BR=4. 4bpp plane order: bytes 0-15 = rows 0-7 plane0/plane1
316
- ; pairs, bytes 16-31 = rows 0-7 plane2/plane3 pairs.
317
- tilbg:
318
- .db $F0, $0F, $F0, $0F, $F0, $0F, $F0, $0F ; rows 0-3: p0=left p1=right
319
- .db $F0, $F0, $F0, $F0, $F0, $F0, $F0, $F0 ; rows 4-7: p0+p1 = left
320
- .db $00, $00, $00, $00, $00, $00, $00, $00 ; rows 0-3: p2/p3 = 0
321
- .db $0F, $00, $0F, $00, $0F, $00, $0F, $00 ; rows 4-7: p2 = right
362
+ ; ── Board tileset (8 tiles, 4bpp, 32 bytes each) ─────────────────────────────
363
+ ; 4bpp plane order per tile: bytes 0-15 = rows 0-7 as plane0/plane1 byte
364
+ ; pairs, bytes 16-31 = rows 0-7 as plane2/plane3 pairs. The pixel's colour
365
+ ; index is the 4-bit number assembled from the planes (p0 = bit 0).
366
+ ; The three jewels are the SAME round shape on different plane combinations —
367
+ ; colour index 4 / 5 / 6 — so a board cell changes colour by changing its
368
+ ; TILE, and the trio sprites reuse the very same tiles (uploaded to the OBJ
369
+ ; char base too). Layout matches puzzle.c's BG_* defines:
370
+ ; 0 blank 1 frame 2 dither 3 speck 4 jewel A 5 jewel B 6 jewel C 7 pad
371
+ tilboard:
372
+ ; tile 0 — blank (colour 0 = transparent; the backdrop shows through)
373
+ .db $00, $00, $00, $00, $00, $00, $00, $00
374
+ .db $00, $00, $00, $00, $00, $00, $00, $00
375
+ .db $00, $00, $00, $00, $00, $00, $00, $00
376
+ .db $00, $00, $00, $00, $00, $00, $00, $00
377
+ ; tile 1 — well frame (colour 3 = planes 0+1): ring with a notched centre
378
+ .db $FF, $FF, $FF, $FF, $E7, $E7, $C3, $C3
379
+ .db $C3, $C3, $E7, $E7, $FF, $FF, $FF, $FF
380
+ .db $00, $00, $00, $00, $00, $00, $00, $00
381
+ .db $00, $00, $00, $00, $00, $00, $00, $00
382
+ ; tile 2 — cabinet dither (colour 2 = plane 1): sparse checker backdrop
383
+ .db $00, $55, $00, $00, $00, $AA, $00, $00
384
+ .db $00, $55, $00, $00, $00, $AA, $00, $00
385
+ .db $00, $00, $00, $00, $00, $00, $00, $00
386
+ .db $00, $00, $00, $00, $00, $00, $00, $00
387
+ ; tile 3 — empty-cell speck (colour 7 = planes 0+1+2): one dim pixel so the
388
+ ; well-interior reads as a recessed playfield, not raw backdrop
389
+ .db $00, $00, $00, $00, $00, $00, $10, $10
390
+ .db $00, $00, $00, $00, $00, $00, $00, $00
391
+ .db $00, $00, $00, $00, $00, $00, $10, $00
392
+ .db $00, $00, $00, $00, $00, $00, $00, $00
393
+ ; tile 4 — jewel A, ruby (colour 4 = plane 2 only)
394
+ .db $00, $00, $00, $00, $00, $00, $00, $00
395
+ .db $00, $00, $00, $00, $00, $00, $00, $00
396
+ .db $3C, $00, $7E, $00, $FF, $00, $FF, $00
397
+ .db $FF, $00, $FF, $00, $7E, $00, $3C, $00
398
+ ; tile 5 — jewel B, emerald (colour 5 = planes 0+2)
399
+ .db $3C, $00, $7E, $00, $FF, $00, $FF, $00
400
+ .db $FF, $00, $FF, $00, $7E, $00, $3C, $00
401
+ .db $3C, $00, $7E, $00, $FF, $00, $FF, $00
402
+ .db $FF, $00, $FF, $00, $7E, $00, $3C, $00
403
+ ; tile 6 — jewel C, amber (colour 6 = planes 1+2)
404
+ .db $00, $3C, $00, $7E, $00, $FF, $00, $FF
405
+ .db $00, $FF, $00, $FF, $00, $7E, $00, $3C
406
+ .db $3C, $00, $7E, $00, $FF, $00, $FF, $00
407
+ .db $FF, $00, $FF, $00, $7E, $00, $3C, $00
408
+ ; tile 7 — pad (keeps the upload a tidy 256 bytes)
409
+ .db $00, $00, $00, $00, $00, $00, $00, $00
410
+ .db $00, $00, $00, $00, $00, $00, $00, $00
411
+ .db $00, $00, $00, $00, $00, $00, $00, $00
412
+ .db $00, $00, $00, $00, $00, $00, $00, $00
322
413
 
323
- palbg:
324
- ; 16-colour BG palette; only 1-4 used (the four wallpaper quadrant tones).
325
- .db $00, $00 ; 0 unused (BG fully opaque)
326
- .db $C4, $30 ; 1 dark blue
327
- .db $42, $29 ; 2 dark teal
328
- .db $88, $30 ; 3 dark purple
329
- .db $C6, $24 ; 4 dark slate
414
+ palboard:
415
+ ; 16-colour palette (BGR555). Loaded TWICE by puzzle.c: into CGRAM block 1
416
+ ; (BG2 map entries select it) and into OBJ palette 0 locked cells and the
417
+ ; falling trio share these exact inks.
418
+ .db $00, $00 ; 0 transparent (BG: backdrop shows / OBJ: see-through)
419
+ .db $FF, $7F ; 1 white
420
+ .db $A4, $30 ; 2 dark navy (dither ink)
421
+ .db $0E, $52 ; 3 steel blue (well frame)
422
+ .db $9C, $18 ; 4 ruby (jewel A)
423
+ .db $45, $23 ; 5 emerald (jewel B)
424
+ .db $1E, $13 ; 6 amber (jewel C)
425
+ .db $4A, $31 ; 7 dim grey (empty-cell speck)
330
426
  .db $00, $00, $00, $00, $00, $00, $00, $00
331
427
  .db $00, $00, $00, $00, $00, $00, $00, $00
332
- .db $00, $00, $00, $00, $00, $00
333
428
 
334
429
  .ends
@@ -0,0 +1,57 @@
1
+ ;==LoRom== puzzle hdr.asm — PROJECT OVERRIDE of PVSnesLib's stock header
2
+ ;
3
+ ; Why this file exists: the stock include/hdr.asm declares CARTRIDGETYPE $00
4
+ ; (ROM only) and SRAMSIZE $00. The SNES cart header is the ONLY place battery
5
+ ; SRAM gets declared — snes9x (and real flash carts) size the save RAM from
6
+ ; these two bytes. Delete this file and the build still succeeds, the game
7
+ ; still runs, and saves silently stop existing: sram_read16/sram_write16 hit
8
+ ; open bus at $70:0000 and the hi-score never survives a power cycle.
9
+ ;
10
+ ; Everything except CARTRIDGETYPE/SRAMSIZE/NAME is byte-identical to the
11
+ ; stock header — the memory map and vectors MUST match what PVSnesLib's
12
+ ; crt0/libs were assembled against, or wlalink places sections inconsistently.
13
+
14
+ .MEMORYMAP ; Begin describing the system architecture.
15
+ SLOTSIZE $8000 ; ROM slot is $8000 bytes (LoROM 32K banks).
16
+ DEFAULTSLOT 0
17
+ SLOT 0 $8000 ; ROM
18
+ SLOT 1 $0 $2000 ; low WRAM mirror (tcc registers live at $0000)
19
+ SLOT 2 $2000 $E000 ; WRAM $2000-$FFFF
20
+ SLOT 3 $0 $10000 ; bank $7F WRAM (tcc C globals)
21
+ .ENDME
22
+
23
+ .ROMBANKSIZE $8000 ; 32 KByte ROM banks
24
+ .ROMBANKS 8 ; 2 Mbits (256 KB) — matches PVSnesLib stock
25
+
26
+ .SNESHEADER
27
+ ID "SNES"
28
+
29
+ NAME "JEWEL JOUST " ; Program Title - 21 bytes, space-padded.
30
+ ; "123456789012345678901"
31
+
32
+ SLOWROM
33
+ LOROM
34
+
35
+ CARTRIDGETYPE $02 ; $02 = ROM + SRAM + battery ← THE SAVE SWITCH
36
+ ROMSIZE $08 ; $08 = 2 Mbits
37
+ SRAMSIZE $01 ; $01 = 2 KB SRAM, mapped at $70:0000-$07FF
38
+ COUNTRY $01 ; $01 = U.S.
39
+ LICENSEECODE $00
40
+ VERSION $00
41
+ .ENDSNES
42
+
43
+ .SNESNATIVEVECTOR ; Native Mode interrupt vector table
44
+ COP EmptyHandler
45
+ BRK EmptyHandler
46
+ ABORT EmptyHandler
47
+ NMI VBlank ; PVSnesLib's vblank.asm handler
48
+ IRQ EmptyHandler
49
+ .ENDNATIVEVECTOR
50
+
51
+ .SNESEMUVECTOR ; Emulation Mode interrupt vector table
52
+ COP EmptyHandler
53
+ ABORT EmptyHandler
54
+ NMI EmptyHandler
55
+ RESET tcc__start ; PVSnesLib crt0 entry
56
+ IRQBRK EmptyHandler
57
+ .ENDEMUVECTOR