Invert y scroll

This commit is contained in:
neauoire 2021-12-28 10:56:53 -08:00
parent a1dc75a2bc
commit 69f72485c7
3 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@
|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |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 |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 |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 |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 |50 @Audio2 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1

View File

@ -22,7 +22,7 @@ WITH REGARD TO THIS SOFTWARE.
#include <unistd.h> #include <unistd.h>
static FILE *f; static FILE *f;
static DIR *d; static DIR *dir;
static char *current_filename = ""; static char *current_filename = "";
static struct dirent *de; static struct dirent *de;
@ -38,9 +38,9 @@ reset(void)
fclose(f); fclose(f);
f = NULL; f = NULL;
} }
if(d != NULL) { if(dir != NULL) {
closedir(d); closedir(dir);
d = NULL; dir = NULL;
} }
de = NULL; de = NULL;
state = IDLE; state = IDLE;
@ -67,8 +67,8 @@ file_read_dir(char *dest, Uint16 len)
{ {
static char pathname[4096]; static char pathname[4096];
char *p = dest; char *p = dest;
if(de == NULL) de = readdir(d); if(de == NULL) de = readdir(dir);
for(; de != NULL; de = readdir(d)) { for(; de != NULL; de = readdir(dir)) {
Uint16 n; Uint16 n;
if(de->d_name[0] == '.' && de->d_name[1] == '\0') if(de->d_name[0] == '.' && de->d_name[1] == '\0')
continue; continue;
@ -94,7 +94,7 @@ file_read(void *dest, Uint16 len)
{ {
if(state != FILE_READ && state != DIR_READ) { if(state != FILE_READ && state != DIR_READ) {
reset(); reset();
if((d = opendir(current_filename)) != NULL) if((dir = opendir(current_filename)) != NULL)
state = DIR_READ; state = DIR_READ;
else if((f = fopen(current_filename, "rb")) != NULL) else if((f = fopen(current_filename, "rb")) != NULL)
state = FILE_READ; state = FILE_READ;

View File

@ -39,7 +39,7 @@ void
mouse_mod(Device *d, Uint16 x, Uint16 y) mouse_mod(Device *d, Uint16 x, Uint16 y)
{ {
poke16(d->dat, 0xa, x); poke16(d->dat, 0xa, x);
poke16(d->dat, 0xc, y); poke16(d->dat, 0xc, -y);
uxn_eval(d->u, d->vector); uxn_eval(d->u, d->vector);
poke16(d->dat, 0xa, 0); poke16(d->dat, 0xa, 0);
poke16(d->dat, 0xc, 0); poke16(d->dat, 0xc, 0);