Updated mkuxn-fast scripts

This commit is contained in:
Andrew Alderwick 2021-08-02 06:51:51 +01:00
parent b64570f827
commit a58ffb9828
3 changed files with 7 additions and 13 deletions

View File

@ -298,15 +298,11 @@ See etc/mkuxn-fast.moon for instructions.
if l == '/* Stack */' then if l == '/* Stack */' then
wanted = false wanted = false
end end
if l:match('errors%[%]') then
_with_0:write('\n#ifndef NO_STACK_CHECKS\n')
wanted = true
end
if wanted then if wanted then
_with_0:write(('%s\n'):format(l)) _with_0:write(('%s\n'):format(l))
end end
if l == '}' then if l == '}' then
_with_0:write('#endif\n\n') _with_0:write('\n')
break break
end end
_continue_0 = true _continue_0 = true
@ -323,8 +319,8 @@ int
uxn_eval(Uxn *u, Uint16 vec) uxn_eval(Uxn *u, Uint16 vec)
{ {
Uint8 instr; Uint8 instr;
if(u->dev[0].dat[0xf]) if(u->dev[0].dat[0xf])
return 0; return 0;
u->ram.ptr = vec; u->ram.ptr = vec;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8; if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr) { while(u->ram.ptr) {
@ -375,7 +371,7 @@ int
if not l then if not l then
break break
end end
if l:match('^bootuxn') then if l:match('^uxn_boot') then
wanted = true wanted = true
end end
if wanted then if wanted then

View File

@ -214,13 +214,10 @@ See etc/mkuxn-fast.moon for instructions.
continue continue
if l == '/* Stack */' if l == '/* Stack */'
wanted = false wanted = false
if l\match 'errors%[%]'
\write '\n#ifndef NO_STACK_CHECKS\n'
wanted = true
if wanted if wanted
\write '%s\n'\format l \write '%s\n'\format l
if l == '}' if l == '}'
\write '#endif\n\n' \write '\n'
break break
\write [[ \write [[
/* clang-format on */ /* clang-format on */
@ -270,7 +267,7 @@ int
l = f\read '*l' l = f\read '*l'
if not l if not l
break break
if l\match '^bootuxn' if l\match '^uxn_boot'
wanted = true wanted = true
if wanted if wanted
\write '%s\n'\format l \write '%s\n'\format l

View File

@ -4045,5 +4045,6 @@ uxn_port(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8
d->u = u; d->u = u;
d->mem = u->ram.dat; d->mem = u->ram.dat;
d->talk = talkfn; d->talk = talkfn;
(void)name;
return d; return d;
} }