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: apps with .eh_frame, and a game too big for the space picked

Mason36302352a029bec
diff --git a/customize/app.js b/customize/app.js
index dffb12c3..9b084f98 100644
--- a/customize/app.js
+++ b/customize/app.js
@@ -323,7 +323,7 @@
b.addEventListener('animationend', () => b.classList.remove(cls), { once: true });
}
function overflow(bytes) {
- toast("That doesn't fit: " + size(bytes) + ' too much' + (st.cap === 'std' ? '. Epsilon 26 and Nwagra give more space' : ''));
+ toast("That doesn't fit: " + size(bytes) + ' too much' + (st.cap === 'std' ? '. Epsilon 26 and Nwagra give more space' : '. Take games out first'));
$('#screen').classList.add('over');
setTimeout(() => render(), 500);
}
@@ -377,7 +377,9 @@
const fit = (id) => spaces().some((s) => s.id === id && s.size >= alone);
const needs = st.cap === 'std' && fit('e26') ? 'Epsilon 26 or Nwagra' : !nwagra() && fit(st.cap === 'e26' ? 'xl26' : 'xl') ? 'Nwagra'
: st.cap === 'xl' && fit('xl26') ? SPACES.xl26 : '';
- toast(r.name + ' is ' + mb(r.bytes.length) + (needs ? ': a game that big needs ' + needs : ', too big for the calculator'));
+ toast(r.name + ' is ' + mb(r.bytes.length) + ', more than ' + mb(capacity()) +
+ (needs ? '. On ' + needs + '? Pick it in the space for apps' : ': too big for the calculator'));
+ if (needs && popOpen !== $('#space-pop')) { renderSpaces(); openPop($('#space-pop'), $('#space-chip'), true); }
$('#screen').classList.add('over');
setTimeout(() => render(), 500);
return true;
diff --git a/customize/apps.js b/customize/apps.js
index 9472870b..736b0fb8 100644
--- a/customize/apps.js
+++ b/customize/apps.js
@@ -9,7 +9,7 @@
const SHT_PROGBITS = 1, SHT_SYMTAB = 2, SHT_STRTAB = 3, SHT_RELA = 4, SHT_NOBITS = 8, SHT_REL = 9;
const SHT_ARM_ATTRIBUTES = 0x70000003;
const SHF_ALLOC = 2, SHF_EXECINSTR = 4, SHF_INFO_LINK = 0x40;
- const STB_LOCAL = 0, STB_GLOBAL = 1;
+ const STB_LOCAL = 0, STB_GLOBAL = 1, STB_WEAK = 2;
const STT_NOTYPE = 0, STT_OBJECT = 1, STT_SECTION = 3, STT_FILE = 4;
const SHN_UNDEF = 0, SHN_ABS = 0xFFF1;
const R_ARM_ABS32 = 2;
@@ -223,7 +223,8 @@
const attrs = e.secs.find((s) => s.type === SHT_ARM_ATTRIBUTES);
if (attrs) bodies.push({ name: '.ARM.attributes', type: SHT_ARM_ATTRIBUTES, flags: 0, data: attrs.data, link: 0, info: 0, align: 1, entsize: 0 });
return { obj: writeElf(e.flags, bodies), code: code.length, data: dataSize, bss: bssSize, ramAlign,
- undefined: [...undef.keys()].sort() };
+ // (what it needs: a weak one may stay undefined, as crtbegin.o's __register_frame_info)
+ undefined: [...undef.values()].filter((u) => u.bind !== STB_WEAK).map((u) => u.name).sort() };
}
// ------------------------------------------------------------------ the app's name and icon
diff --git a/tools/module.ld b/tools/module.ld
index a4dbba90..c0fdf0f7 100644
--- a/tools/module.ld
+++ b/tools/module.ld
@@ -2,7 +2,8 @@
Merges a game into one code section, one .data and one .bss, and drops what
the launcher does not need (the game's own name, icon and unwind tables, and
its constructor lists: the installer's start code never runs them, so a game
- on its own doesn't either). */
+ on its own doesn't either). .eh_frame stays, in the code: an app linked with
+ GCC's crtbegin.o points to it (frame_dummy's __EH_FRAME_BEGIN__). */
SECTIONS {
/DISCARD/ : {
*(.rodata.eadk_app_name) *(.rodata.eadk_app_icon) *(.rodata.eadk_api_level)
@@ -11,6 +12,7 @@ SECTIONS {
}
.text : {
*(.text .text.* .rodata .rodata.* .glue_7 .glue_7t .vfp11_veneer .v4_bx)
+ *(.eh_frame .eh_frame.* .gcc_except_table .gcc_except_table.*)
}
.data : { *(.data .data.*) }
.bss : { *(.bss .bss.* COMMON) }