diff --git a/compiler/res/prog8lib/diskio.p8 b/compiler/res/prog8lib/diskio.p8 index 191019ec4..5f6a8c1d4 100644 --- a/compiler/res/prog8lib/diskio.p8 +++ b/compiler/res/prog8lib/diskio.p8 @@ -427,7 +427,7 @@ io_error: ubyte flen = string.length(filenameptr) filename[0] = 's' filename[1] = ':' - sys.memcopy(filenameptr, &filename+2, flen+1) + string.copy(filenameptr, &filename+2) c64.SETNAM(flen+2, filename) c64.SETLFS(1, drivenumber, 15) void c64.OPEN() @@ -441,9 +441,9 @@ io_error: ubyte flen_new = string.length(newfileptr) filename[0] = 'r' filename[1] = ':' - sys.memcopy(newfileptr, &filename+2, flen_new) + string.copy(newfileptr, &filename+2) filename[flen_new+2] = '=' - sys.memcopy(oldfileptr, &filename+3+flen_new, flen_old+1) + string.copy(oldfileptr, &filename+3+flen_new) c64.SETNAM(3+flen_new+flen_old, filename) c64.SETLFS(1, drivenumber, 15) void c64.OPEN() diff --git a/examples/test.p8 b/examples/test.p8 index 0f33f7d92..cecebdf79 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,4 +1,5 @@ %import textio +%import diskio %import string %zeropage basicsafe %option no_sysinit @@ -7,35 +8,13 @@ main { sub start() { - uword screen=$0400 - ubyte[256] xbuf = 1 - ubyte[256] ybuf = 3 - - - ubyte ix = 0 - ubyte cc = 0 - - repeat 20 { - cc++ - } - - @(screen) = 1 - @(screen+1) = 2 - swap(@(screen), @(screen+1)) - -; cc = @(screen+2) -; cc++ -; @(screen+2) = cc - -; cc = @(screen+ix) -; cc++ -; @(screen+ix) = cc -; for ii in 24 downto 0 { -; for i in 39 downto 0 { -; @(screen+i) = xbuf[i] + ybuf[ii] -; } -; screen+=40 -; } + diskio.directory(8) + diskio.save(8, "blabla", $2000, 1024) + diskio.directory(8) + diskio.rename(8, "blabla", "newname") + diskio.directory(8) + diskio.delete(8, "newname") + diskio.directory(8) } }