uxn

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

commit a92fd8fb223524a519a8161fd9b02bd6ee38f191
parent 28569d118e907e9dbd1ffadf939dca2fba7c0503
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Sat, 28 Aug 2021 00:37:27 +0100

Expanded File/offset to 32-bit /offset-hs and /offset-ls

Diffstat:
Mprojects/examples/blank.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 | 8++++----
Mprojects/software/repl.tal | 2+-
Msrc/uxncli.c | 2+-
Msrc/uxnemu.c | 2+-
12 files changed, 15 insertions(+), 15 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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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/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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 +|a0 @File &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ( variables ) diff --git a/projects/examples/demos/piano.tal b/projects/examples/demos/piano.tal @@ -25,7 +25,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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] -|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &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 [ &pad $8 &write $1 ] -|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ] ( vectors ) @@ -62,7 +62,7 @@ that will prevent an infinite loop. ) ;&dest-file .File/name DEO2 - #0000 .File/offset DEO2 + #0000 .File/offset-ls DEO2 #ff00 .File/length DEO2 #0100 .File/load LIT DEO2 #00ff STA @@ -269,7 +269,7 @@ &loop OVR2 .File/name DEO2 - DUP2 .File/offset DEO2 + DUP2 .File/offset-ls DEO2 ;asma-read-buffer/end ;asma-read-buffer SUB2 STH2k .File/length DEO2 ;asma-read-buffer DUP2k .File/load DEO2 .File/success DEI2 @@ -544,7 +544,7 @@ @asma-flush-to-file ( len* -- ) DUP2 .File/length DEO2 - ,asma-output/offset LDR2 DUP2 .File/offset DEO2 ADD2 ,asma-output/offset STR2 + ,asma-output/offset LDR2 DUP2 .File/offset-ls DEO2 ADD2 ,asma-output/offset STR2 ;asma/dest-filename LDA2 .File/name DEO2 ;asma-write-buffer .File/save DEO2 JMP2r diff --git a/projects/software/repl.tal b/projects/software/repl.tal @@ -10,7 +10,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 |80 @Controller [ &vector $2 &button $1 &key $1 ] -|a0 @File &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 +|a0 @File &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ( init ) diff --git a/src/uxncli.c b/src/uxncli.c @@ -76,7 +76,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w) if(w && (read || b0 == 0xf)) { char *name = (char *)&d->mem[mempeek16(d->dat, 0x8)]; Uint16 result = 0, length = mempeek16(d->dat, 0xa); - Uint16 offset = mempeek16(d->dat, 0x4); + long offset = (mempeek16(d->dat, 0x4) << 16) + mempeek16(d->dat, 0x6); Uint16 addr = mempeek16(d->dat, b0 - 1); FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w")); if(f) { diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -344,7 +344,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w) if(w && (read || b0 == 0xf)) { char *name = (char *)&d->mem[mempeek16(d->dat, 0x8)]; Uint16 result = 0, length = mempeek16(d->dat, 0xa); - Uint16 offset = mempeek16(d->dat, 0x4); + long offset = (mempeek16(d->dat, 0x4) << 16) + mempeek16(d->dat, 0x6); Uint16 addr = mempeek16(d->dat, b0 - 1); FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w")); if(f) {