diff --git a/projects/examples/gui/picture.tal b/projects/examples/gui/picture.tal index 1424a25..0ce89df 100644 --- a/projects/examples/gui/picture.tal +++ b/projects/examples/gui/picture.tal @@ -53,7 +53,7 @@ BRK -@draw-icn ( x* y* width* height* addr* color -- ) +@draw-icn ( x* y* width* height* addr* color -- ) ( load ) STH .Screen/addr DEO2 .size/height STZ2 .size/width STZ2 .position/y STZ2 .position/x STZ2 .size/height LDZ2 #0000 @@ -72,6 +72,34 @@ BRK RTN +@draw-icn-pixels ( x* y* width* height* addr* color -- ) + + ( load ) STH .Screen/addr DEO2 .size/height STZ2 .size/width STZ2 .position/y STZ2 .position/x STZ2 + .size/height LDZ2 #0000 + &ver + ( save ) DUP2 .position/y LDZ2 ++ .Screen/y DEO2 + .size/width LDZ2 #0000 + &hor + ( get x,y ) STH2 OVR2 STH2r SWP2 OVR2 SWP2 + ( save ) OVR2 .position/x LDZ2 ++ .Screen/x DEO2 + ( draw ) ,get-icn-pixel JSR STHkr * .Screen/pixel DEO + INC2 GTH2k ,&hor JCN + POP2 POP2 + INC2 GTH2k ,&ver JCN + POP2 POP2 + POPr + +RTN + +@get-icn-pixel ( x* y* -- color ) + + ( get row ) OVR2 SWP2 DUP2 8MOD2 + ( get tile ) SWP2 8// 80** ++ SWP2 STEP8 ++ ;source ++ LDA + ( get mask ) ROT ROT NIP 8MOD + ( get pixel ) #07 SWP - SFT #01 AND + +RTN + @draw-chr ( x* y* width* height* addr* color -- ) ( load ) STH .Screen/addr DEO2 .size/height STZ2 .size/width STZ2 .position/y STZ2 .position/x STZ2 diff --git a/projects/pictures/dafu10x10.bit b/projects/pictures/dafu10x10.bit new file mode 100644 index 0000000..e88d7a1 Binary files /dev/null and b/projects/pictures/dafu10x10.bit differ diff --git a/projects/pictures/dafu80x80.bit b/projects/pictures/dafu80x80.bit deleted file mode 100644 index 6a17a89..0000000 Binary files a/projects/pictures/dafu80x80.bit and /dev/null differ diff --git a/src/uxnasm.c b/src/uxnasm.c index d63ec32..c1905d9 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -156,7 +156,7 @@ makelabel(char *name) Label *l; if(findlabel(name)) return error("Label duplicate", name); - if(sihx(name) && slen(name) % 2 == 0) + if(sihx(name) && (slen(name) == 2 || slen(name) == 4)) return error("Label name is hex number", name); if(findopcode(name) || scmp(name, "BRK", 4) || !slen(name)) return error("Label name is invalid", name);