diff --git a/bin/changebootloader.js b/bin/changebootloader.js index 57fd956aa..7875c2efb 100644 --- a/bin/changebootloader.js +++ b/bin/changebootloader.js @@ -2,6 +2,6 @@ a = new ActiveXObject("scripting.filesystemobject") b = a.opentextfile(WScript.Arguments(0)) c = b.read(0x40) b.skip(0x200) -d = b.read(0x1fff600) +d = b.read(a.getfile(WScript.Arguments(0)).size-0x240) b.close() b=a.createtextfile(WScript.Arguments(0), 1).write(c+a.opentextfile(WScript.Arguments(1)).read(512)+d) diff --git a/res/demo/FLIP.OUT b/res/demo/FLIP.OUT index f4c10659f..c977a08d3 100755 Binary files a/res/demo/FLIP.OUT and b/res/demo/FLIP.OUT differ diff --git a/res/dsk/flip out 9k file PRODOS (san inc pack).dsk b/res/dsk/flip out 9k file PRODOS (san inc pack).dsk index 62859f473..4a9ed7ab6 100644 Binary files a/res/dsk/flip out 9k file PRODOS (san inc pack).dsk and b/res/dsk/flip out 9k file PRODOS (san inc pack).dsk differ diff --git a/src/glue.prorwts2.a b/src/glue.prorwts2.a index e45085870..4e1ce638d 100644 --- a/src/glue.prorwts2.a +++ b/src/glue.prorwts2.a @@ -64,6 +64,45 @@ LoadFile sta reqcmd lda #0 ; 0 = read into main memory sta auxreq + sta sizelo + sta sizehi ; 0 = query load address + jsr hddopendir ; call ProRWTS2 + lda ldrlo2 + sta ldrlo + lda ldrhi2 + sta ldrhi + dec sizehi ; read entire file (ProRWTS2 will figure out exact size) + jmp hddopendir ; exit via ProRWTS2 (must re-open the file after query) + +;------------------------------------------------------------------------------ +; LoadFileAt +; Load a file into memory all at once, using ProRWTS2, at the load address +; specified by the passed parameter. +; +; supports paths, see note +; +; in: stack contains 4 bytes of parameters: +; +1 address of filename +; +3 address to load file +; out: all flags clobbered +; all registers clobbered +; filename clobbered (hey, this is important, you can't call this with +; the same filename buffer twice unless you REALLY know what you're +; doing, so you should probably use one of the LOAD_* macros which +; copies the filename to a temporary buffer) +; stack set to next instruction after parameters +;------------------------------------------------------------------------------ +LoadFileAt + +PARAMS_ON_STACK 4 + +LDPARAM 1 + +STAY namlo ; set filename + +LDPARAM 3 + +STAY ldrlo ; set load address + jsr traverse ; go to subdirectory, set up filename for read + lda #cmdread ; read (instead of write) + sta reqcmd + lda #0 ; 0 = read into main memory + sta auxreq lda #$FF ; read entire file (ProRWTS2 will figure out exact size) sta sizehi jmp hddopendir ; exit via ProRWTS2 @@ -90,8 +129,11 @@ LoadDHRFile jsr traverse ; go to subdirectory, set up filename for read lda #$00 ; read first $2000 bytes sta sizelo + sta ldrlo lda #$20 sta sizehi + asl + sta ldrhi lda #1 ; 1 = read into aux memory sta auxreq lda #cmdread ; read (instead of write) @@ -99,6 +141,8 @@ LoadDHRFile jsr hddopendir ; call ProRWTS2 lda #$20 ; read next $2000 bytes sta sizehi + asl + sta ldrhi dec auxreq ; 0 = read into main memory clc ; not a subdirectory jmp hddrdwrpart ; call ProRWTS2 @@ -125,9 +169,21 @@ SaveSmallFile +LDPARAM 3 +STAY ldrlo ; set data buffer address for ProRWTS2 jsr traverse ; go to subdirectory, set up filename for read + ;;if the write address is always a fixed value then we can discard the query + lda #cmdread ; read (instead of write) + sta reqcmd + lda #0 ; 0 = read into main memory + sta sizelo + sta sizehi ; 0 = query load address + jsr hddopendir ; call ProRWTS2 + lda ldrlo2 + sta ldrlo + lda ldrhi2 + sta ldrhi lda #cmdwrite ; write (instead of read) sta reqcmd - jmp hddopendir ; exit via ProRWTS2 + sta sizelo ; non-zero + jmp hddopendir ; exit via ProRWTS2 (must re-open the file after query) ;------------------------------------------------------------------------------ ; traverse [private] diff --git a/src/prorwts2.a b/src/prorwts2.a index 670401143..4a6cc1d25 100644 --- a/src/prorwts2.a +++ b/src/prorwts2.a @@ -17,7 +17,7 @@ ver_02 = 1 enable_floppy = 0 ;set to 1 to enable floppy drive support poll_drive = 0 ;set to 1 to check if disk is in drive, recommended if allow_multi is enabled allow_extend = 0 ;enable support for more than four partitions (note: it has overhead) - override_adr = 0 ;set to 1 to require an explicit load address + override_adr = 1 ;set to 1 to require an explicit load address aligned_read = 0 ;set to 1 if all reads can be a multiple of block size enable_readseq=0 ;set to 1 to enable reading multiple sequential times from the same file without seek ;(exposes a fixed address that can be called for either floppy or hard disk support) @@ -2222,6 +2222,14 @@ hddfoundname iny } ;allow_subdir or allow_saplings or allow_trees or not aligned_read } ;override_adr +;;allow query even in override mode + ldy #AUX_TYPE + lda (bloklo), y + sta ldrlo2 + iny + lda (bloklo), y + sta ldrhi2 + ;cache KEY_POINTER ldy #KEY_POINTER diff --git a/winmake.bat b/winmake.bat index 224d1518c..c3fffa664 100644 --- a/winmake.bat +++ b/winmake.bat @@ -99,7 +99,7 @@ cscript /nologo bin\padto.js 512 build\PREFS.CONF %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\FX.CONF" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\DFX.CONF" >>build\log cscript /nologo bin\rsync.js res\title.hgr\* build\TITLE.HGR >>build\log -cscript /nologo cscript /nologo bin\buildfileinfo.js build\TITLE.HGR "06" "4000" >>build\log +cscript /nologo bin\buildfileinfo.js build\TITLE.HGR "06" "4000" >>build\log %CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/TITLE.HGR" "build\TITLE.HGR" >>build\log cscript /nologo bin\rsync.js res\title.dhgr\* build\TITLE.DHGR >>build\log cscript /nologo bin\buildfileinfo.js build\TITLE.DHGR "06" "4000" >>build\log