From 12c3a8eecd44e3cfa76c324bc0c38e5d5fc96809 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 10 Jan 2024 12:51:38 -0800 Subject: [PATCH] (ref) Removed malloc --- ref/uxn | Bin 28680 -> 0 bytes ref/uxn.c | 15 ++------------- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100755 ref/uxn diff --git a/ref/uxn b/ref/uxn deleted file mode 100755 index 6bdafe8e08ca17928b385b80ca664e28621fb9ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28680 zcmeHQ4|G)3nZGj-Nf4O8f<{FdQFcKkhQA91G(ZL)76g@OU8Td2%#f+cOgfn$sA$|F zlGibkb(gMZ*PcR;uHDuubuqBC#fe}Nki*9H9A#VEMhiOAp>5Q-jh5x@@4J6q-V8}d z@Qh2(&dteu_kMrw{qFbOd*8kHy?5WEt`*DdHXBo67`us4sv}=uiY1|;LPh|J**rEH zzgMv<*+obX=Qu$x764Qcj@wgVuEY-mB)I~L^Z_RdG*eJ%NRZ_E3%PlMq9Bv?Ah{eO z$#gn=WxkM8P|?luRtq{ygXL0x1+8*qn~t?YuA?dyHc7j*OQ_^1NphW1u2agHP#U6B zLS;{~3H{HL`lQ2R&?pr1U&hkqHc7d3SR(lqq%tVnc`{snKIN^JayQ&A@=1qbfo2M- z@@|J5*=4Xnx%m!RUVnZllJ-|nnw8yH>0dv0_KlV0(<}Xf+D+3p&6_)Y?(D*vVBt)z z0_jzRe`-^=+*Zo$bu30WC2wQ4l(b!@!NLRaj>kWlo#fxUujG|k#vi^qdt~eM8tti- zziJHpiFl|Ulqc~}ARPUxK=O)*+sEc)b+&vv;l@g)X;(fm(O2rppZ{@Gbtg&b1-BwP zt~Y7MF6jsV0`N|gt2a`HXkYm(><91f2TyhGE1#+T;2-PG#?wN(N z&DgBo=*+@7%)NZgN;k6fZt&NHy`eQLmsSP?-Zh@}m89{8s$f8B>=vwjGQtja^cEX_ z?dSpYOMfCQenom1dknnP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Xn?l0U4{V46{ORw!*M?6XLveU{{?tpF(ei+ZXawdEFJ|kX0!m;r4_=9w}zzWYVuG*88lAn#_J{aqn7PgP|QuQgnQgqT|h z>^wPPQ?S^|jJP?jNIcFKPLbavd>BWe~*h z$Ag-GD_A7)YW|(BzXx=hdnUyU1S9}US0(qL7tF)S*D_G1+6*ji&FVU)%rk{pI-le zl=4ethHAZ`V3)*`JgrI6<#z!`da3-)>zcg2QTw)rbpJmCqE+50rBO;uK&MDd1Ze!Pf~CiRn8KW{S@jah!BgCSMzrT z(+8UL@(-uU@1%)6f`W(6QT|)t9fN<_ZO!$w`tDS^zACNYuOaKO$gB1B@wGrAC_a(u zO)Gp71Zq2~e6_AIzau8~r~XSp$tgc}14k@MUVXnN<|b~&rV3#GDtQGz1H~$@*5`34 zUtvm$h>}y#4q>ajnzyfBC-{|~DjOwdrXfr?rN5eYu3INK(wZ-G3bgqram = ram; - if(!system_load(u, rom)) - if(!system_load(u, "boot.rom")) - return 0; - return 1; -} - int console_input(Uxn *u, char c, int type) { @@ -175,7 +165,7 @@ main(int argc, char **argv) fprintf(stdout, "usage: %s file.rom [args..]\n", argv[0]); return 0; } - if(!system_init(&u, (Uint8 *)calloc(0x10000, sizeof(Uint8)), argv[i++])) { + if(!system_load(&u, argv[i++])) { fprintf(stderr, "Failed to initialize %s\n", argv[1]); return 0; } @@ -192,6 +182,5 @@ main(int argc, char **argv) console_input(&u, (Uint8)c, 0x1); } } - free(u.ram); return u.dev[0x0f] & 0x7f; }