uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 69f72485c75b5c98e2756095da6d3f87aa4abbe2
parent a1dc75a2bcd6a97bc78617c93475b7b605ee0f45
Author: neauoire <aliceffekt@gmail.com>
Date:   Tue, 28 Dec 2021 10:56:53 -0800

Invert y scroll

Diffstat:
Mprojects/examples/blank.tal | 2+-
Msrc/devices/file.c | 14+++++++-------
Msrc/devices/mouse.c | 2+-
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/projects/examples/blank.tal b/projects/examples/blank.tal @@ -24,7 +24,7 @@ |00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1 -|20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 +|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |30 @Audio0 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 |40 @Audio1 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 |50 @Audio2 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 diff --git a/src/devices/file.c b/src/devices/file.c @@ -22,7 +22,7 @@ WITH REGARD TO THIS SOFTWARE. #include <unistd.h> static FILE *f; -static DIR *d; +static DIR *dir; static char *current_filename = ""; static struct dirent *de; @@ -38,9 +38,9 @@ reset(void) fclose(f); f = NULL; } - if(d != NULL) { - closedir(d); - d = NULL; + if(dir != NULL) { + closedir(dir); + dir = NULL; } de = NULL; state = IDLE; @@ -67,8 +67,8 @@ file_read_dir(char *dest, Uint16 len) { static char pathname[4096]; char *p = dest; - if(de == NULL) de = readdir(d); - for(; de != NULL; de = readdir(d)) { + if(de == NULL) de = readdir(dir); + for(; de != NULL; de = readdir(dir)) { Uint16 n; if(de->d_name[0] == '.' && de->d_name[1] == '\0') continue; @@ -94,7 +94,7 @@ file_read(void *dest, Uint16 len) { if(state != FILE_READ && state != DIR_READ) { reset(); - if((d = opendir(current_filename)) != NULL) + if((dir = opendir(current_filename)) != NULL) state = DIR_READ; else if((f = fopen(current_filename, "rb")) != NULL) state = FILE_READ; diff --git a/src/devices/mouse.c b/src/devices/mouse.c @@ -39,7 +39,7 @@ void mouse_mod(Device *d, Uint16 x, Uint16 y) { poke16(d->dat, 0xa, x); - poke16(d->dat, 0xc, y); + poke16(d->dat, 0xc, -y); uxn_eval(d->u, d->vector); poke16(d->dat, 0xa, 0); poke16(d->dat, 0xc, 0);