From 5930552f09758b3ad5ea890e492fa76bb579b992 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Fri, 28 Mar 2008 16:28:41 -0400 Subject: [PATCH] Add readout --- readout.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 readout.c diff --git a/readout.c b/readout.c new file mode 100644 index 0000000..9b92953 --- /dev/null +++ b/readout.c @@ -0,0 +1,138 @@ +#include +#include + +#define WIN_X 1500 +#define WIN_Y 768 + +char *readline() +{ + static char s[2048]; + return gets(s); /* Insecure, oh well, who cares, this will get replaced later */ +} + +struct vars { + char *vname, *var, *sub; + int val; +}; + +int *findvar(char *var, char *sub, struct vars *vars, int n) +{ + int i; + for (i=0; i %s %s\n", vname, var, sub); + + vars[nvars].vname = strdup(vname); + vars[nvars].var = strdup(var); + vars[nvars].sub = sub ? strdup(sub) : NULL; + vars[nvars].val = 0; + nvars++; + } + } else if (s[0] == '#') + ; + else + { + int val = (s[0] == '1'); + int i; + int oldclk = *findvar("gclk", NULL, vars, nvars); + static int pixn = 0; + for (i=0; ipixels + ((WIN_X * y + x) * 3); + pixp[0] = b; pixp[1] = g; pixp[2] = r; + SDL_UnlockSurface(screen); + if ((x % 5) == 4) + SDL_UpdateRect(screen, x/5*5, y, 5, 1); + } + } + } +} -- 2.43.0