diff --git a/src/dhgr.tk/utils/dhgrrgb.pla b/src/dhgr.tk/utils/dhgrrgb.pla index ff58776..7451f49 100644 --- a/src/dhgr.tk/utils/dhgrrgb.pla +++ b/src/dhgr.tk/utils/dhgrrgb.pla @@ -64,7 +64,7 @@ def luv2rgb(l, u, v)#3 // l = fix 1.7, u, v = fix s.15; return fix 0.8 * 3 var r, g, b r = l + (v >> 7) - g = l - u / 181 - v / 181 // l + 0.7071 * u / 128 - 0.7071 * v / 128 + g = l - (u / 181) - (v / 181) // l - 0.7071 * u / 128 - 0.7071 * v / 128 b = l + (u >> 7) return r, g, b end @@ -78,7 +78,7 @@ def calcChroma(angle)#0 r, g, b = luv2rgb(256, cos(angle), sin(angle)) j = ((i - 1) & 3) * 3 // Match Apple II order ntscChroma[j + RED] = min(255, (r + 2) >> 2) - ntscChroma[((i-2)&3)*3 + GRN] = min(255, (g + 2) >> 2) // ??? why ??? + ntscChroma[j + GRN] = min(255, (g + 2) >> 2) ntscChroma[j + BLU] = min(255, (b + 2) >> 2) // Next NTSC chroma pixel angle = angle - 90 @@ -273,6 +273,10 @@ def rgbInit#0 rgberr=>[RED] = -1 rgberr=>[GRN] = -1 rgberr=>[BLU] = -1 + //dcgrColor(CLR_WHITE) + //for i = 0 to 139 + // dcgrPixel(i, sin(i * 3) / 1024 + 96) + //next end def rgbExit#0 diff --git a/src/samplesrc/hello.pla b/src/samplesrc/hello.pla index 1640bf5..bb39d48 100644 --- a/src/samplesrc/hello.pla +++ b/src/samplesrc/hello.pla @@ -1,6 +1,4 @@ include "inc/cmdsys.plh" -puts("a"); putln -puts("bb"); putln -puts("ccc"); putln + puts("Hello, world.\n") done diff --git a/src/toolsrc/parse.c b/src/toolsrc/parse.c index 691cb40..f9e9384 100755 --- a/src/toolsrc/parse.c +++ b/src/toolsrc/parse.c @@ -274,7 +274,7 @@ int parse_constexpr(long *value, int *size) if (scantoken == binary_ops_table[i]) { matchop = 2; - if (binary_ops_precedence[i] >= tos_op_prec(optos)) + while (binary_ops_precedence[i] >= tos_op_prec(optos)) if (!calc_op(pop_op())) parse_error("Invalid binary operation"); push_op(scantoken, binary_ops_precedence[i]); @@ -715,7 +715,7 @@ t_opseq *parse_subexpr(t_opseq *codeseq, int *stackdepth) if (scantoken == binary_ops_table[i]) { matchop = 2; - if (binary_ops_precedence[i] >= tos_op_prec(optos)) + while (binary_ops_precedence[i] >= tos_op_prec(optos)) { codeseq = gen_op(codeseq, pop_op()); if (stackdepth) diff --git a/src/toolsrc/parse.pla b/src/toolsrc/parse.pla index c9f8507..f922abc 100644 --- a/src/toolsrc/parse.pla +++ b/src/toolsrc/parse.pla @@ -178,9 +178,9 @@ def parse_constexpr#3 for i = 0 to bops_tblsz if token == bops_tbl[i] matchop = 2 - if bops_prec[i] >= tos_op_prec(optos) + while bops_prec[i] >= tos_op_prec(optos) calc_binaryop(pop_op) - fin + loop push_op(token, bops_prec[i]) break fin @@ -514,10 +514,10 @@ def parse_subexpr(codeseq)#2 for i = 0 to bops_tblsz if token == bops_tbl[i] matchop = 2 - if bops_prec[i] >= tos_op_prec(optos) + while bops_prec[i] >= tos_op_prec(optos) codeseq = gen_bop(codeseq, pop_op) stackdepth-- - fin + loop push_op(token, bops_prec[i]) break fin