diff --git a/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy b/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy index 88931fad..4193d058 100644 --- a/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy +++ b/Platform/Apple/tools/PackPartitions/src/org/badvision/A2PackPartitions.groovy @@ -1240,7 +1240,6 @@ class A2PackPartitions assert compressedLen > 0 // If we saved at least 10 bytes, take the compressed version. - println "TODO: Put back compression" if (false && (uncompressedLen - compressedLen) >= 10) { if (debugCompression) println String.format(" Compress. rawLen=\$%x compLen=\$%x", uncompressedLen, compressedLen) diff --git a/Platform/Apple/tools/PackPartitions/src/org/badvision/Lx47Algorithm.java b/Platform/Apple/tools/PackPartitions/src/org/badvision/Lx47Algorithm.java index aa5ae65b..905e75e9 100644 --- a/Platform/Apple/tools/PackPartitions/src/org/badvision/Lx47Algorithm.java +++ b/Platform/Apple/tools/PackPartitions/src/org/badvision/Lx47Algorithm.java @@ -12,7 +12,7 @@ import java.util.Arrays; public class Lx47Algorithm { static final int MAX_OFFSET = 16384; /* range 1..65536 */ - static final int MAX_LEN = 256; /* range 2..65536 */ + static final int MAX_LEN = 255; /* range 2..65536 */ static final int OFFSET_EXP_BITS = 6; LinkedList debugs = new LinkedList(); @@ -421,15 +421,6 @@ public class Lx47Algorithm } public byte[] compress(byte[] input_data) { - if (false) { - input_data = "hellohelloabchello".getBytes(); - byte[] testComp = compressOptimal(optimize(input_data), input_data); - byte[] testDecomp = new byte[input_data.length]; - decompress(testComp, 0, testDecomp, 0, input_data.length); - assert Arrays.equals(input_data, testDecomp); - System.out.println("Good!"); - System.exit(1); - } return compressOptimal(optimize(input_data), input_data); } } diff --git a/Platform/Apple/tools/ProRWTS/PRORWTS2#4000 b/Platform/Apple/tools/ProRWTS/PRORWTS2#4000 index 4121a8be..742da5b5 100644 Binary files a/Platform/Apple/tools/ProRWTS/PRORWTS2#4000 and b/Platform/Apple/tools/ProRWTS/PRORWTS2#4000 differ diff --git a/Platform/Apple/tools/ProRWTS/PRORWTS2.S b/Platform/Apple/tools/ProRWTS/PRORWTS2.S index b3edcb6e..763b08fc 100755 --- a/Platform/Apple/tools/ProRWTS/PRORWTS2.S +++ b/Platform/Apple/tools/ProRWTS/PRORWTS2.S @@ -1709,8 +1709,8 @@ hddsetaux sta CLRAUXRD, x sta blokhi pla sta sizehi - dec adrhi - dec adrhi +; dec adrhi ; MH: this causes the F800 buffer (containing the key block contents) +; dec adrhi ; to be read instead of FA00 (containing the file's data) hddcopycache !if enable_seek = 1 { ldy reqcmd diff --git a/Platform/Apple/virtual/data/disks/base.2mg.gz b/Platform/Apple/virtual/data/disks/base.2mg.gz index 777dc9f1..26148e1e 100644 Binary files a/Platform/Apple/virtual/data/disks/base.2mg.gz and b/Platform/Apple/virtual/data/disks/base.2mg.gz differ diff --git a/Platform/Apple/virtual/src/core/loader.s b/Platform/Apple/virtual/src/core/loader.s index 46a3bf47..219f5a19 100644 --- a/Platform/Apple/virtual/src/core/loader.s +++ b/Platform/Apple/virtual/src/core/loader.s @@ -35,16 +35,38 @@ pRun = $82 ; len 2 decomp = $DF00 -init ; Init pointer to blocks we're going to move/decompress - lda #dataStart sta pData+1 - ; temporary: copy ROM so we can debug decompressor - ldy #0 - ; First is the decompressor itself (special: just copy one page) bit setLcWr+lcBank1 ; read from ROM, write to LC ram bit setLcWr+lcBank1 + ; temporary: copy monitor ROM so we can debug decompressor + ldy #0 + sty pSrc + ldx #$f8 +-- stx pSrc+1 +- lda (pSrc),y + sta (pSrc),y + iny + bne - + inx + bne -- + ; First is the decompressor itself (special: just copy one page) jsr getBlk - lda (pSrc),y .st sta decomp,y diff --git a/Platform/Apple/virtual/src/core/mem.s b/Platform/Apple/virtual/src/core/mem.s index be5d396c..7473f23d 100644 --- a/Platform/Apple/virtual/src/core/mem.s +++ b/Platform/Apple/virtual/src/core/mem.s @@ -62,8 +62,8 @@ reseek_0 = $18 ; to reset seek ptr, zero out these 3 locs reseek_1 = $1B reseek_2 = $1C proRWTS = $F600 -opendir = proRWTS -rdwrpart = opendir+3 +rdwrpart = proRWTS +opendir = rdwrpart+3 ; Memory buffers fileBuf = $4000 ; len $400 @@ -83,27 +83,18 @@ gcHash_dstHi = $5500 ;------------------------------------------------------------------------------ ; Relocate all the pieces to their correct locations and perform patching. relocate: - ; Put something interesting on the screen :) - jsr ROM_home - ldy #0 -- lda .welcomeText,y - beq + - jsr ROM_cout - iny - bne - -.welcomeText: !text "Welcome to LegendOS.",$8D,0 ; special: clear most of the lower 48k and the ProDOS bank of the LC -+ bit setLcRW+lcBank1 bit setLcRW+lcBank1 - ldy #0 + bit setLcRW+lcBank1 tya ldx #8 .clr1 stx .clrst1+2 stx .clrst2+2 + ldy #0 .clrst1 sta $800,y .clrst2 sta $880,y iny - bpl .clrst1 + bpl .clrst1 ; yes, bpl not bne, because we're doing 128 bytes per loop inx cpx #$40 ; skip our own unrelocated code $4000.4FFF bne + @@ -172,6 +163,7 @@ relocate: ;------------------------------------------------------------------------------ init: !zone ; KLUDGE ALERT! Turning off IIc keyboard buffer as an experiment + ; FIXME: This depends on ProDOS machine ID byte. ProRWTS doesn't have such a byte. Hmm... lda $BF98 ; machine ID byte and #$C8 ; mask just the machine bits cmp #$88 ; Apple IIc? @@ -1324,11 +1316,7 @@ saneStart: !zone { } saneCheck: !zone { - lda $BF00 - cmp #$4C - beq + - +internalErr 'S' -+ lda $E1 + lda $E1 cmp #$BE bcc + +internalErr 's' @@ -1953,13 +1941,14 @@ openPartition: !zone sta reqLen lda #0 sta reqLen+1 - lda #0 ; cmdread, for drive 1 + lda #cmdread ; no hi bit => go to drive 1 sta tmp jsr opendir lda tmp+1 ; get status bne .insert ; zero=ok, 1=err - jsr disk_reseek ; by opening, we did an implicit seek - lda #2 ; and we read 2 bytes + sta curMarkPos+1 ; by opening we did an implicit seek to zero + sta curMarkPos+2 + lda #2 ; and then we read 2 bytes sta curMarkPos ; read the full header .opened lda headerBuf ; grab header size @@ -1969,11 +1958,13 @@ openPartition: !zone lda headerBuf+1 ; hi byte too sbc #0 sta reqLen+1 - lda #headerBuf + lda #>(headerBuf+2) sta pDst+1 - jmp disk_read + jsr disk_read + inc partFileOpen ; remember we've opened it now + rts ; ask user to insert the disk ; TODO: handle dual drive configuration .insert +safeHome diff --git a/Platform/Apple/virtual/src/include/global.i b/Platform/Apple/virtual/src/include/global.i index 5efd4461..6adfe4f9 100644 --- a/Platform/Apple/virtual/src/include/global.i +++ b/Platform/Apple/virtual/src/include/global.i @@ -36,6 +36,12 @@ clrAuxWr = $C004 setAuxWr = $C005 clrAuxZP = $C008 setAuxZP = $C009 +clrC3Rom = $C00A +setC3Rom = $C00B +clr80Vid = $C00C +set80Vid = $C00D +clrAltCh = $C00E +setAltCh = $C00F kbdStrobe = $C010 rdLCBnk2 = $C011 ;reading from LC bank $Dx 2 rdLCRam = $C012 ;reading from LC RAM