commit c7644f90c195b984702973484b50faa42bf46e7a
parent d5a18c6cd1d2fefd6526ef30380f0cbd91e8b593
Author: neauoire <aliceffekt@gmail.com>
Date: Sun, 28 Mar 2021 16:52:34 -0700
Clamp name erase
Diffstat:
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/projects/software/noodle.usm b/projects/software/noodle.usm
@@ -44,7 +44,7 @@
;pt1 { x 2 y 2 }
;pt2 { x 2 y 2 } ( paint-rect )
;px { x 1 y 1 }
-;document { state 1 edit 1 namelength 1 name 48 }
+;document { state 1 edit 1 namelength 1 name 20 }
;timer { byte 1 }
( devices )
@@ -308,26 +308,23 @@ BRK
@on-document-edit
~Keys #00 EQU ,$no-keys JNZ2
-
~Keys #0d NEQ ,$no-enter JNZ2
#00 =document.edit
,redraw JSR2
BRK
$no-enter
-
~Keys #08 NEQ ,$no-backspace JNZ2
+ ~document.namelength #00 EQU ,$end JNZ2
( incr ) ~document.namelength #01 SUB =document.namelength
,$end JSR2
BRK
$no-backspace
-
+ ~document.namelength #1f EQU ,$end JNZ2
( store key ) ~Keys ,document.name #00 ~document.namelength ADD2 POK2
( incr ) ~document.namelength #01 ADD =document.namelength
-
$end
( store end ) #00 ,document.name #00 ~document.namelength ADD2 POK2
( release ) #00 =Keys.key
-
$no-keys
( move ) #0008 =Sprite.x ~Screen.height #0010 SUB2 =Sprite.y
diff --git a/src/assembler.c b/src/assembler.c
@@ -239,7 +239,7 @@ makevariable(char *name, Uint16 *addr, FILE *f)
if(word[0] == '{') continue;
if(word[0] == '}') break;
scpy(word, l->map[l->maps].name, 64);
- fscanf(f, "%u", &l->map[l->maps].size);
+ fscanf(f, "%02x", &l->map[l->maps].size);
*addr += l->map[l->maps].size;
l->len += l->map[l->maps++].size;
}