Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

NumPlay Studio's kit: NumPico's carts in its block

Mason36372f22b2a7d15
diff --git a/tools/gen_games.py b/tools/gen_games.py
index 6cc252fa..353a8ac6 100644
--- a/tools/gen_games.py
+++ b/tools/gen_games.py
@@ -180,19 +180,20 @@ def main():
" KEEP(*(SORT_BY_NAME(.rodata.np_games.*)))",
" np_games_end = .;",
" }"]
- def block(i, n, roms=False):
+ def block(i, n, roms=False, carts=False):
p = f".rodata.np.{n}.{i}"
return [f" {p} : {{",
f" np_{i}_begin = .;",
f" KEEP(*({p}.0head))",
f" *({p})",
f" *({p}.init)"] + (
- [" *(.rodata.np_roms)"] if roms else []) + [
+ [" *(.rodata.np_roms)"] if roms else []) + (
+ [" *(.rodata.np_carts)"] if carts else []) + [
f" KEEP(*({p}.shots))",
f" KEEP(*({p}.zztail))",
f" np_{i}_end = .;",
" }"]
- blocks = {g["id"]: block(g["id"], index[g["id"]], g.get("roms")) for g in manifest}
+ blocks = {g["id"]: block(g["id"], index[g["id"]], g.get("roms"), g.get("carts")) for g in manifest}
tail = [" .text : { *(.text .text.*) }",
" .rodata : { *(.rodata .rodata.*) }",
" .data : { *(.data .data.*) }",
diff --git a/tools/kit.py b/tools/kit.py
index efb11e4f..2f6a631c 100644
--- a/tools/kit.py
+++ b/tools/kit.py
@@ -201,7 +201,7 @@ def main():
"id": i, "index": n, "rank": g.get("rank", 99), "title": g["title"], "tagline": g["tagline"], "credit": g.get("credit"),
"top": g["top"], "bottom": g["bottom"], "accent": g["accent"],
"flash": flash, "ram": ram, "heap": g.get("heap", 0), "default": i in default, "upsilon": i in upsilon,
- "roms": bool(g.get("roms")), "systems": g.get("systems"), "xl": bool(g.get("xl")),
+ "roms": bool(g.get("roms")), "systems": g.get("systems"), "xl": bool(g.get("xl")), "carts": bool(g.get("carts")),
"bytes": os.path.getsize(os.path.join(O, "games", i + ".o.gz")),
"icon": bool(icon), "thumb": os.path.exists(thumb), "preview": preview})
@@ -218,7 +218,8 @@ def main():
nm = subprocess.run(["arm-none-eabi-nm", "-u", nwa], capture_output=True, text=True, check=True).stdout
loose = [l.split()[-1] for l in nm.splitlines()
if not re.match(r"(eadk_|_heap_end$|_data_section_|_bss_section_)", l.split()[-1])
- and l.split() not in (["w", "__sf"], ["w", "_printf_float"])] # (newlib's own weak hooks)
+ and l.split() not in (["w", "__sf"], ["w", "_printf_float"], # (newlib's own weak hooks)
+ ["w", "np_carts"])] # (NumPico's carts: the website links them)
if loose:
sys.exit(f"kit: {ids[0] if len(ids) == 1 else 'NumPlay'} leaves undefined: {' '.join(loose)}")
nwa = os.path.join(tmp, "custom.nwa")