Skip to content

Commit eda6325

Browse files
committed
Set ld_bin_format for embedded Zehn files properly
1 parent 8ec6e54 commit eda6325

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ndless/src/resources/ploaderhook.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ static int ndless_load(const char *docpath, NUC_FILE *docfile, void **base, int
101101
{
102102
case 0: // Execute as Zehn
103103
case 2: // Valid Zehn, but don't execute
104+
ld_bin_format = LD_ZEHN_BIN;
104105
free(scanarea);
105106
return ret;
106107
case 1: // Invalid Zehn
@@ -301,30 +302,30 @@ int ld_exec_with_args(const char *path, int argsn, char *args[], void **resident
301302
switch(signature)
302303
{
303304
case 0x00475250: //"PRG\0"
305+
ld_bin_format = LD_PRG_BIN;
304306
if((ret = ndless_load(prgm_path, prgm, &base, &entry, &supports_hww)) == 0)
305307
{
306308
nuc_fclose(prgm);
307-
ld_bin_format = LD_PRG_BIN;
308309
break;
309310
}
310311

311312
nuc_fclose(prgm);
312313
return ret == 1 ? 0xDEAD : 0xBEEF;
313314
case 0x544c4662: //"bFLT"
315+
ld_bin_format = LD_BFLT_BIN;
314316
if(bflt_load(prgm, &base, &entry) == 0)
315317
{
316318
nuc_fclose(prgm);
317-
ld_bin_format = LD_BFLT_BIN;
318319
break;
319320
}
320321

321322
nuc_fclose(prgm);
322323
return 0xDEAD;
323324
case 0x6e68655a: //"Zehn"
325+
ld_bin_format = LD_ZEHN_BIN;
324326
if((ret = zehn_load(prgm, &base, &entry, &supports_hww)) == 0)
325327
{
326328
nuc_fclose(prgm);
327-
ld_bin_format = LD_ZEHN_BIN;
328329
break;
329330
}
330331

0 commit comments

Comments
 (0)