uxn

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

commit a92dd9fd73ff619f8d9b2e2761466ee3657a1480
parent 3a11945fec9ddc32f73c0f54b8fb52081ba3f217
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Sat,  6 Nov 2021 00:51:43 +0000

Rearranged File ports for backwards compatibility.

Diffstat:
Mprojects/examples/blank.tal | 2+-
Mprojects/examples/demos/asma-piano.tal | 2+-
Mprojects/examples/demos/drum-rack.tal | 2+-
Mprojects/examples/demos/font.tal | 2+-
Mprojects/examples/demos/piano.tal | 2+-
Mprojects/examples/devices/file.load.tal | 2+-
Mprojects/examples/devices/file.save.tal | 2+-
Mprojects/examples/devices/file.tal | 2+-
Mprojects/examples/gui/picture.tal | 2+-
Mprojects/software/asma.tal | 2+-
Mprojects/software/calc.tal | 2+-
Mprojects/software/launcher.tal | 2+-
Msrc/uxncli.c | 21++++++++++++---------
Msrc/uxnemu.c | 21++++++++++++---------
14 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/projects/examples/blank.tal b/projects/examples/blank.tal @@ -21,7 +21,7 @@ |60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] |b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ] ( variables ) diff --git a/projects/examples/demos/asma-piano.tal b/projects/examples/demos/asma-piano.tal @@ -2,7 +2,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 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( vectors ) diff --git a/projects/examples/demos/drum-rack.tal b/projects/examples/demos/drum-rack.tal @@ -30,7 +30,7 @@ |70 @Midi [ &vector $2 &channel $1 &note $1 &velocity $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/examples/demos/font.tal b/projects/examples/demos/font.tal @@ -12,7 +12,7 @@ |00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 -|a0 @File &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 +|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ( variables ) diff --git a/projects/examples/demos/piano.tal b/projects/examples/demos/piano.tal @@ -27,7 +27,7 @@ |70 @Midi [ &vector $2 &channel $1 &note $1 &velocity $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/examples/devices/file.load.tal b/projects/examples/devices/file.load.tal @@ -4,7 +4,7 @@ |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/examples/devices/file.save.tal b/projects/examples/devices/file.save.tal @@ -3,7 +3,7 @@ ( devices ) |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/examples/devices/file.tal b/projects/examples/devices/file.tal @@ -8,7 +8,7 @@ |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |10 @Console [ &pad $8 &write $1 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/examples/gui/picture.tal b/projects/examples/gui/picture.tal @@ -7,7 +7,7 @@ |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |20 @Screen [ &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/software/asma.tal b/projects/software/asma.tal @@ -2,7 +2,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 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( vectors ) diff --git a/projects/software/calc.tal b/projects/software/calc.tal @@ -35,7 +35,7 @@ |30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 ] ( variables ) diff --git a/projects/software/launcher.tal b/projects/software/launcher.tal @@ -22,7 +22,7 @@ |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File &vector $2 &name $2 &length $2 &success $2 &load $2 &save $2 &stat $2 &delete $1 &append $1 +|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &load $2 &save $2 |b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ] ( variables ) diff --git a/src/uxncli.c b/src/uxncli.c @@ -80,20 +80,23 @@ static void file_deo(Device *d, Uint8 port) { switch(port) { - case 0x3: - file_prepare(&d->mem[peek16(d->dat, 0x2)]); + case 0x1: + d->vector = peek16(d->dat, 0x0); break; case 0x9: - poke16(d->dat, 0x6, file_read(&d->mem[peek16(d->dat, 0x8)], peek16(d->dat, 0x4))); - break; - case 0xb: - poke16(d->dat, 0x6, file_write(&d->mem[peek16(d->dat, 0xa)], peek16(d->dat, 0x4), d->dat[0xf])); + file_prepare(&d->mem[peek16(d->dat, 0x8)]); break; case 0xd: - poke16(d->dat, 0x6, file_stat(&d->mem[peek16(d->dat, 0xc)], peek16(d->dat, 0x4))); + poke16(d->dat, 0x2, file_read(&d->mem[peek16(d->dat, 0xc)], peek16(d->dat, 0xa))); break; - case 0xe: - poke16(d->dat, 0x6, file_delete()); + case 0xf: + poke16(d->dat, 0x2, file_write(&d->mem[peek16(d->dat, 0xe)], peek16(d->dat, 0xa), d->dat[0x7])); + break; + case 0x5: + poke16(d->dat, 0x2, file_stat(&d->mem[peek16(d->dat, 0x4)], peek16(d->dat, 0xa))); + break; + case 0x6: + poke16(d->dat, 0x2, file_delete()); break; } } diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -372,20 +372,23 @@ static void file_deo(Device *d, Uint8 port) { switch(port) { - case 0x3: - file_prepare(&d->mem[peek16(d->dat, 0x2)]); + case 0x1: + d->vector = peek16(d->dat, 0x0); break; case 0x9: - poke16(d->dat, 0x6, file_read(&d->mem[peek16(d->dat, 0x8)], peek16(d->dat, 0x4))); - break; - case 0xb: - poke16(d->dat, 0x6, file_write(&d->mem[peek16(d->dat, 0xa)], peek16(d->dat, 0x4), d->dat[0xf])); + file_prepare(&d->mem[peek16(d->dat, 0x8)]); break; case 0xd: - poke16(d->dat, 0x6, file_stat(&d->mem[peek16(d->dat, 0xc)], peek16(d->dat, 0x4))); + poke16(d->dat, 0x2, file_read(&d->mem[peek16(d->dat, 0xc)], peek16(d->dat, 0xa))); + break; + case 0xf: + poke16(d->dat, 0x2, file_write(&d->mem[peek16(d->dat, 0xe)], peek16(d->dat, 0xa), d->dat[0x7])); + break; + case 0x5: + poke16(d->dat, 0x2, file_stat(&d->mem[peek16(d->dat, 0x4)], peek16(d->dat, 0xa))); break; - case 0xe: - poke16(d->dat, 0x6, file_delete()); + case 0x6: + poke16(d->dat, 0x2, file_delete()); break; } }