From f7ede6ef849e20647fddc30dc0f5617ec82acbb9 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 8 Nov 2017 21:47:12 -0800 Subject: [PATCH] pack T00 analyzers define a global page for shared content make nib table global autoclear filters instead of case-by-case cache IDs in global variables where useful merge some near-duplicated routines optimise sector reordering allow cancel when writing from RAM pack universal RWTS dynamically to allow easier modification consolidate output when modifying sequential nibble table entries make Standard Delivery accept a parameter to specify table switch unpacker to Exomizer for cross-platform support make relbase dynamic for easier building makefile for windows --- Makefile | 13 +- res/makeuniv.txt | 6 - src/analyze.a | 6 +- src/apicode.a | 177 ++++++ src/apidefs.a | 158 +++++ src/id/inspect0.a | 102 +--- src/id/milliken.a | 4 + src/id/trace32.a | 12 +- src/id/trace33.a | 4 +- src/id/trace33p.a | 7 +- src/id/trace8b3.a | 4 +- src/memory.a | 103 ++-- src/mli.a | 67 +- src/modify.a | 9 +- src/mods/t00only.a | 118 ++++ .../mods/universalrwts.a | 31 +- src/nibtable.a | 11 - src/passport.a | 251 ++------ src/patchers/datasoft.a | 4 +- src/patchers/dos32.a | 8 +- src/patchers/jsr8b3.a | 6 +- src/patchers/laureate.a | 6 +- src/patchers/mecc1.a | 7 +- src/patchers/mecc2.a | 7 +- src/patchers/mecc3.a | 7 +- src/patchers/mecc4.a | 7 +- src/patchers/milliken.a | 4 +- src/patchers/nibtable.a | 148 +++-- src/print.a | 2 - src/rwts.a | 8 +- src/standarddelivery.a | 21 +- src/strings/en.a | 102 +--- src/strings/enid.a | 100 +++ src/universalrwts.a | 113 ---- src/unpack.a | 573 +++++++++++++----- winmake.bat | 39 ++ 36 files changed, 1333 insertions(+), 912 deletions(-) delete mode 100644 res/makeuniv.txt create mode 100644 src/apicode.a create mode 100644 src/apidefs.a create mode 100644 src/mods/t00only.a rename res/universalrwts.org => src/mods/universalrwts.a (93%) delete mode 100644 src/nibtable.a create mode 100644 src/strings/enid.a delete mode 100755 src/universalrwts.a create mode 100644 winmake.bat diff --git a/Makefile b/Makefile index 90c0909..30d6c12 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,24 @@ # third-party tools required to build # https://sourceforge.net/projects/acme-crossass/ -ACME=`which acme` +ACME=acme # https://sourceforge.net/projects/applecommander/ AC=bin/AppleCommander.jar +# https://bitbucket.org/magli143/exomizer/wiki/Home +EXOMIZER=exomizer BUILDDISK=build/passport.po asm: mkdir -p build - cd src && $(ACME) passport.a && cd - + cd src/mods && $(ACME) universalrwts.a + $(EXOMIZER) raw -q build/universalrwts.bin -o build/universalrwts.tmp + printf "\xB8\x00" | cat - build/universalrwts.tmp > build/universalrwts.pak + cd src/mods && $(ACME) t00only.a + $(EXOMIZER) raw -q build/t00only.bin -o build/t00only.tmp + printf "\x20\x00" | cat - build/t00only.tmp > build/t00only.pak + cd src && $(ACME) passport.a 2> ../build/relbase.log + cd src && $(ACME) -DRELBASE=`cat ../build/relbase.log | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` passport.a cp res/work.po $(BUILDDISK) java -jar $(AC) -p $(BUILDDISK) "PASSPORT.SYSTEM" sys 0x2000 < build/PASSPORT.SYSTEM diff --git a/res/makeuniv.txt b/res/makeuniv.txt deleted file mode 100644 index c6d580c..0000000 --- a/res/makeuniv.txt +++ /dev/null @@ -1,6 +0,0 @@ -to create the compressed universalrwts.a: -1. acme --cpu 6502 --setpc 0 -o universalrwts.bin universalrwts.org -2. appack c universalrwts.bin universalrwts.pak -3. use a sector editor to remove the first #$18 bytes of the universalrwts.pak file -4. convert the binary back to ACME-compatible text (!byte, '$' for hex, no trailing commas) -5. save in universalrwts.a diff --git a/src/analyze.a b/src/analyze.a index 463e5ab..1194ca0 100755 --- a/src/analyze.a +++ b/src/analyze.a @@ -191,10 +191,10 @@ IsEEEF ;------------------------------- IsSyncBytes lda #$FD - sta nibtableff + sta gNIBTableFF jsr IsUnformatted lda #$3F - sta nibtableff + sta gNIBTableFF rts ;------------------------------- @@ -216,7 +216,7 @@ IsUnformatted ldy #$00 nibloop ldx $C0EC bpl nibloop - lda nibtable,x + lda gNIBTable,x bpl + inc unform bne + diff --git a/src/apicode.a b/src/apicode.a new file mode 100644 index 0000000..d6a5258 --- /dev/null +++ b/src/apicode.a @@ -0,0 +1,177 @@ +;------------------------------- +; globally-accessible variables +; in fixed position to allow +; compressed code to work +; offsets must match t00defs.a +;------------------------------- + +;gNIBTable + !byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8A,$8B,$8C,$8D,$8E,$8F + !byte $90,$91,$92,$93,$94,$95,$00,$01,$98,$99,$02,$03,$9C,$04,$05,$06 + !byte $A0,$A1,$A2,$A3,$A4,$A5,$07,$08,$A8,$A9,$AA,$09,$0A,$0B,$0C,$0D + !byte $B0,$B1,$0E,$0F,$10,$11,$12,$13,$B8,$14,$15,$16,$17,$18,$19,$1A + !byte $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7,$C8,$C9,$CA,$1B,$CC,$1C,$1D,$1E + !byte $D0,$D1,$D2,$1F,$D4,$D5,$20,$21,$D8,$22,$23,$24,$25,$26,$27,$28 + !byte $E0,$E1,$E2,$E3,$E4,$29,$2A,$2B,$E8,$2C,$2D,$2E,$2F,$30,$31,$32 + !byte $F0,$F1,$33,$34,$35,$36,$37,$38,$F8,$39,$3A,$3B,$3C,$3D,$3E +;gNIBTableFF + !byte $3F + +;jConstructStandardDelivery + jmp ConstructStandardDelivery +;jCopyUniversalAnywhere + jmp CopyUniversalAnywhere +;jCopyMemory + jmp CopyMemory +;jCallRWTS + jmp $FF59 ; modified at runtime +;jSearchTrack + jmp SearchTrack +;jPrintByID + jmp PrintByID +;jmodify + jmp modify +;jcompare + jmp compare +;gDisplayBytes + !fill 10 ; array of ten bytes for use as + ; substitution strings +;gRAMDiskRef + !byte 00 ; handle of RAM disk + ; non-zero if open +;gUsingRAMDisk + !byte FALSE ; 0=true, 1=false + +;gOnAClearDayYouCanReadForever + !byte FALSE ; 0=true, 1=false + ; retry reads with a captured RWTS forever, + ; instead of falling back to built-in RWTS + ; compile-time flag, no way to change at runtime + +FIRSTFILTER +;gIsDatasoft + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsLaureate + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gAdventureInternational + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in TraceDOS33c() after tracing DOS 3.3-shaped RWTS +;gIsMilliken1 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in TraceDOS33c() after tracing DOS 3.3-shaped RWTS +;gIs8b3 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gPossibleD5D5F7 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsMECC4 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsMECC3 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsMECC2 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsMECC1 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsMECCFastloader + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsOptimum + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gPossibleGamco + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in SkipTrack() after reading T22 +;gIsEA + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsDavidDOS + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsProtDOS + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsPascal + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsProDOS + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsRWTS + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in AnalyzeT00() after reading T00 +;gIsMaster + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in AnalyzeT00() after reading T00 +;gIsBoot1 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in AnalyzeT00() after reading T00 +;gIsBoot0 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +;gIsDOS32 + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in IDBootloader() after reading T00,S00 +LASTFILTER + +;gLastTrack + !byte 00 ; int + ; the last track that we should try to read + ; (assuming reading from T22 down to T00) + ; reset to 0 before each operation, but some + ; disks (like DOS3.3P) will change it because + ; they write out the first few DOS tracks + ; manually before seeking up to T22 to convert + ; the rest of the disk +;gChangedPrefs + !byte FALSE ; 0=true, 1=false + ; whether we should try to write the configuration file + ; when the program exits + ; set to #TRUE when changing slots +;gSaidWriting + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set to #TRUE after we print WRITING TO S%s,D%d +;gTriedUniv + !byte FALSE ; 0=true, 1=false + ; whether or not we've already tried the built-in RWTS + ; (and therefore a read error is fatal) + ; reset before each operation +;gPatchCount + !byte 00 ; int + ; number of patches we've applied to this disk + ; reset before each operation + ; incremented in modify() +;gMode + !byte %00000000 ; bit 7 0=verify, 1=see bit 6 + ; bit 6 0=demuffin, 1=crack + ; set based on main menu choice diff --git a/src/apidefs.a b/src/apidefs.a new file mode 100644 index 0000000..1dab970 --- /dev/null +++ b/src/apidefs.a @@ -0,0 +1,158 @@ +TRUE = $00 ; Lots of code assumes this is $00 + ; so it can branch with BEQ, so + ; don't change it either! +FALSE = $01 + +;------------------------------- +;Standard Delivery table indexes +;------------------------------- + +ID_DOS33p = $00 +ID_DOS32 = $01 +ID_DOS32LO = $02 + +; Zero-page addresses we use for variables +nibsrcindex = $EC ; byte +nibdestindex = $ED ; byte +prbuf = $EE ; word +unform = $F0 ; word +nibcount = $F2 ; byte +modtmp = $F3 ; byte +modsrc = $F4 ; word +moddest = $F6 ; word +cmp1 = $F8 ; word +cmp2 = $FA ; word +counter = $FC ; byte +tmp = $FC ; byte +iunit = $FC ; byte +tmpa = $FC ; byte +tmpx = $FD ; byte +tmpy = $FE ; byte +flag = $FF ; byte + +; Application constants (not zero addresses) +!ifdef RELBASE { +!set VERBOSE = $00 ; override for make script +} else { +RELBASE = $2000 ; dummy assignment for first build + ; to allow calculation of proper value +} +LOWPOINT = $4300 ; lowest available address for code +BASEPAGE = $10 ; Special Delivery tracer assumes + ; this is $10, so don't change it! + +;------------------------------- +; globally-accessible variables +; in fixed position to allow +; compressed code to work +;------------------------------- + +APIEND = $B600 +gMode = APIEND-$01 ; byte +gPatchCount = gMode-$01 ; byte +gTriedUniv = gPatchCount-$01 ; byte +gSaidWriting = gTriedUniv-$01 ; byte +gChangedPrefs = gSaidWriting-$01 ; byte +gLastTrack = gChangedPrefs-$01 ; byte + +;FIRSTFILTER ; add new gIs* below this line +gIsDOS32 = gLastTrack-$01 ; byte +gIsBoot0 = gIsDOS32-$01 ; byte +gIsBoot1 = gIsBoot0-$01 ; byte +gIsMaster = gIsBoot1-$01 ; byte +gIsRWTS = gIsMaster-$01 ; byte +gIsProDOS = gIsRWTS-$01 ; byte +gIsPascal = gIsProDOS-$01 ; byte +gIsProtDOS = gIsPascal-$01 ; byte +gIsDavidDOS = gIsProtDOS-$01 ; byte +gIsEA = gIsDavidDOS-$01 ; byte +gPossibleGamco = gIsEA-$01 ; byte +gIsOptimum = gPossibleGamco-$01 ; byte +gIsMECCFastloader = gIsOptimum-$01 ; byte +gIsMECC1 = gIsMECCFastloader-$01 ; byte +gIsMECC2 = gIsMECC1-$01 ; byte +gIsMECC3 = gIsMECC2-$01 ; byte +gIsMECC4 = gIsMECC3-$01 ; byte +gPossibleD5D5F7 = gIsMECC4-$01 ; byte +gIs8b3 = gPossibleD5D5F7-$01 ; byte +gIsMilliken1 = gIs8b3-$01 ; byte +gAdventureInternational = gIsMilliken1-$01 ; byte +gIsLaureate = gAdventureInternational-$01 ; byte +gIsDatasoft = gIsLaureate-$01 ; byte +;LASTFILTER ; add new gIs* above this line + +gOnAClearDayYouCanReadForever = gIsDatasoft-$01 ; byte +gUsingRAMDisk = gOnAClearDayYouCanReadForever-$01 ; byte +gRAMDiskRef = gUsingRAMDisk-$01 ; byte +gDisplayBytes = gRAMDiskRef-$0A ; 10 bytes +jcompare = gDisplayBytes-$03 ; 3-byte +jmodify = jcompare-$03 ; 3-byte +jPrintByID = jmodify-$03 ; 3-byte +jSearchTrack = jPrintByID-$03 ; 3-byte +jCallRWTS = jSearchTrack-$03 ; 3-byte +jCopyMemory = jCallRWTS-$03 ; 3-byte +jCopyUniversalAnywhere = jCopyMemory-$03 ; 3-byte +jConstructStandardDelivery = jCopyUniversalAnywhere-$03 ; 3-byte +gNIBTableFF = jConstructStandardDelivery-1 ; 1 byte +gNIBTable = gNIBTableFF-$FF ; accessed by +$80 +gNIBTableBase = gNIBTableFF-$7F ; 127 bytes + +!ifdef MODULE { +compare = jcompare +modify = jmodify +PrintByID = jPrintByID +SearchTrack = jSearchTrack +CallRWTS = jCallRWTS +CopyMemory = jCopyMemory +CopyUniversalAnywhere = jCopyUniversalAnywhere +ConstructStandardDelivery = jConstructStandardDelivery +} + +!ifdef VERBOSE { + !if VERBOSE=1 { +!warn "gMode=",gMode +!warn "gPatchCount=",gPatchCount +!warn "gTriedUniv=",gTriedUniv +!warn "gSaidWriting=",gSaidWriting +!warn "gChangedPrefs=",gChangedPrefs +!warn "gLastTrack=",gLastTrack +!warn "gIsDOS32=",gIsDOS32 +!warn "gIsBoot0=",gIsBoot0 +!warn "gIsBoot1=",gIsBoot1 +!warn "gIsMaster=",gIsMaster +!warn "gIsRWTS=",gIsRWTS +!warn "gIsProDOS=",gIsProDOS +!warn "gIsPascal=",gIsPascal +!warn "gIsProtDOS=",gIsProtDOS +!warn "gIsDavidDOS=",gIsDavidDOS +!warn "gIsEA=",gIsEA +!warn "gPossibleGamco=",gPossibleGamco +!warn "gIsOptimum=",gIsOptimum +!warn "gIsMECCFastloader=",gIsMECCFastloader +!warn "gIsMECC1=",gIsMECC1 +!warn "gIsMECC2=",gIsMECC2 +!warn "gIsMECC3=",gIsMECC3 +!warn "gIsMECC4=",gIsMECC4 +!warn "gPossibleD5D5F7=",gPossibleD5D5F7 +!warn "gIs8b3=",gIs8b3 +!warn "gIsMilliken1=",gIsMilliken1 +!warn "gAdventureInternational=",gAdventureInternational +!warn "gIsLaureate=",gIsLaureate +!warn "gIsDatasoft=",gIsDatasoft +!warn "gOnAClearDayYouCanReadForever=",gOnAClearDayYouCanReadForever +!warn "gUsingRAMDisk=",gUsingRAMDisk +!warn "gRAMDiskRef=",gRAMDiskRef +!warn "gDisplayBytes=",gDisplayBytes +!warn "jcompare=",jcompare +!warn "jmodify=",jmodify +!warn "jPrintByID=",jPrintByID +!warn "jSearchTrack=",jSearchTrack +!warn "jCallRWTS=",jCallRWTS +!warn "jCopyMemory=",jCopyMemory +!warn "jCopyUniversalAnywhere=",jCopyUniversalAnywhere +!warn "jConstructStandardDelivery=",jConstructStandardDelivery +!warn "gNIBTableFF=",gNIBTableFF +!warn "gNIBTable=",gNIBTable +!warn "gNIBTableBase=",gNIBTableBase + } +} diff --git a/src/id/inspect0.a b/src/id/inspect0.a index ac4d98c..1364e3b 100755 --- a/src/id/inspect0.a +++ b/src/id/inspect0.a @@ -11,23 +11,12 @@ IDBootloader ; Reset all per-disk globals. ; These are used as filters later so irrelevant patchers can be skipped. ; + ldx #(LASTFILTER-FIRSTFILTER) lda #FALSE - sta gIsDOS32 - sta gIsBoot0 - sta gIsBoot1 - sta gIsMaster - sta gIsRWTS - sta gIsProDOS - sta gIsPascal - sta gIsProtDOS - sta gIsDavidDOS - sta gIsEA - sta gIsMECCFastloader - sta gPossibleGamco - sta gPossibleD5D5F7 - sta gAdventureInternational - lda #$00 - sta gLastTrack +- sta FIRSTFILTER-1,x + dex + bne - + stx gLastTrack ; ; Quick sanity check -- only recognized values for $0800 ; are 1 or 2 for regular disks, and 5 for possible Electronic Arts. @@ -84,6 +73,8 @@ IDBootloader bcs + lda #s_jsr8b3 jsr PrintByID + lda #TRUE + sta gIs8b3 jmp Trace8B3 ; ; Try to identify all the different MECC fastloader variants. @@ -99,15 +90,23 @@ IDBootloader bcs .notmecc jsr IDMECC1 bcs + + lda #TRUE + sta gIsMECC1 jmp foundmecc1 + jsr IDMECC2 bcs + + lda #TRUE + sta gIsMECC2 jmp foundmecc2 + jsr IDMECC3 bcs + + lda #TRUE + sta gIsMECC3 jmp foundmecc3 + jsr IDMECC4 bcs .notmecc + lda #TRUE + sta gIsMECC4 jmp foundmecc4 .notmecc ; @@ -127,6 +126,8 @@ IDBootloader bcs + lda #s_laureate jsr PrintByID + lda #TRUE + sta gIsLaureate lda #$0B jsr PrereadT00Partial bcs + @@ -213,7 +214,9 @@ IDBootloader bcs + lda #s_datasoftb0 jsr PrintByID - bcc .useuniv ; always branches + lda #TRUE + sta gIsDatasoft + beq .useuniv ; always branches ; ; Micrograms bootloader ; @@ -243,71 +246,6 @@ IDBootloader jmp UseUniversal } -;------------------------------- -; AnalyzeT00 -; set additional flags based on contents of track $00 -; -; in: Track $00 in data buffer -; out: gIsBoot1, gIsMaster, gIsRWTS set to #TRUE or #FALSE -; all flags clobbered -; all registers clobbered -;------------------------------- -!zone { -AnalyzeT00 - lda #$01 - ldx #$00 - ldy #$38 - jsr compare ; if T00,S01,$00 == - !byte $8E,$E9,$B7,$8E,$F7,$B7,$A9,$01 - !byte $8D,$F8,$B7,$8D,$EA,$B7,$AD,$E0 - !byte $B7,$8D,$E1,$B7,$A9,$02,$8D,$EC - !byte $B7,$A9,$04,$8D,$ED,$B7,$AC,$E7 - !byte $B7,$88,$8C,$F1,$B7,$A9,$01,$8D - !byte $F4,$B7,$8A,$4A,$4A,$4A,$4A,$AA - !byte $A9,$00,$9D,$F8,$04,$9D,$78,$04 - ldx #TRUE - bcc .boot1 - ldx #FALSE -.boot1 - stx gIsBoot1 - - lda #$01 - ldx #$00 - ldy #$38 - jsr compare ; if T00,S01,$00 == - !byte $8E,$E9,$37,$8E,$F7,$37,$A9,$01 - !byte $8D,$F8,$37,$8D,$EA,$37,$AD,$E0 - !byte $37,$8D,$E1,$37,$A9,$02,$8D,$EC - !byte $37,$A9,$04,$8D,$ED,$37,$AC,$E7 - !byte $37,$88,$8C,$F1,$37,$A9,$01,$8D - !byte $F4,$37,$8A,$4A,$4A,$4A,$4A,$AA - !byte $A9,$00,$9D,$F8,$04,$9D,$78,$04 - ldx #TRUE - bcc .master - ldx #FALSE -.master - stx gIsMaster - - lda #$07 - ldx #$00 - ldy #$40 - jsr compare ; if T00,S07,$00 == - !byte $84,$48,$85,$49,$A0,$02,$8C,$F8 - !byte $06,$A0,$04,$8C,$F8,$04,$A0,$01 - !byte $B1,$48,$AA,$A0,$0F,$D1,$48,$F0 - !byte $1B,$8A,$48,$B1,$48,$AA,$68,$48 - !byte $91,$48,$BD,$8E,$C0,$A0,$08,$BD - !byte $8C,$C0,$DD,$8C,$C0,$D0,$F6,$88 - !byte $D0,$F8,$68,$AA,$BD,$8E,$C0,$BD - !byte $8C,$C0,$A0,$08,$BD,$8C,$C0,$48 - ldx #TRUE - bcc .rwts - ldx #FALSE -.rwts - stx gIsRWTS - rts -} - !zone { PrereadT00 lda #$0F diff --git a/src/id/milliken.a b/src/id/milliken.a index 530d08d..0e94a30 100644 --- a/src/id/milliken.a +++ b/src/id/milliken.a @@ -34,8 +34,12 @@ IDMilliken1 jsr compare !byte $A9,$AE,$8D,$00,$04,$4C,$99,$AD !byte $AE,$F8,$05,$BD,$89,$C0 + bcs + + lda #TRUE + sta gIsMilliken1 bcc .exit ++ ; variant 2 (seen in The Writing Workshop) ldy #$0B jsr compare diff --git a/src/id/trace32.a b/src/id/trace32.a index e1b36f0..463868d 100644 --- a/src/id/trace32.a +++ b/src/id/trace32.a @@ -154,11 +154,11 @@ TraceDOS32LO sta b4bbmodify+2 sta b4bbmodify2+2 adc #$04 ; $BD or $3D - sta callrwts+2 + sta jCallRWTS+2 adc #$02 ; $BF or $3F sta b4bbcompare+1 lda #$00 - sta callrwts+1 + sta jCallRWTS+1 ; set up final trace @@ -178,7 +178,7 @@ TraceDOS32LO .fail jmp FatalError TraceDOS32d - lda callrwts+2 + lda jCallRWTS+2 ldx #$00 ; check for "STY $48;STA $49" ldy #$04 ; at RWTS entry point jsr CompareMemory ; (e.g. $BD00 or $3D00) @@ -187,7 +187,7 @@ TraceDOS32d lda #$FA sta modsrc - lda callrwts+2 + lda jCallRWTS+2 sec sbc #$05 sta modsrc+1 @@ -240,7 +240,7 @@ TraceDOS32d sta gIsDOS32 ; check for MUSE sector doubling RWTS - lda callrwts+2 + lda jCallRWTS+2 ldx #$09 ldy #$02 jsr CompareMemory @@ -265,7 +265,7 @@ FFer bne + iny bne - - ldy callrwts+2 + ldy jCallRWTS+2 dey sty .G+2 dey diff --git a/src/id/trace33.a b/src/id/trace33.a index 119e735..000f1b8 100755 --- a/src/id/trace33.a +++ b/src/id/trace33.a @@ -69,13 +69,13 @@ _Inspect1a dex stx .x3+1 stx .x4+1 - stx callrwts+2 + stx jCallRWTS+2 jsr ProtectedDOS ; check for a specific (encrypted) ; bootloader called "Protected DOS" bcs .notprotdos jmp ADStyle .notprotdos - lda callrwts+2 + lda jCallRWTS+2 ldx #$00 ; check for "STY $48;STA $49" ldy #$04 ; at RWTS entry point jsr CompareMemory ; (e.g. $BD00 or $3D00) diff --git a/src/id/trace33p.a b/src/id/trace33p.a index 616bb3e..8e13a8a 100755 --- a/src/id/trace33p.a +++ b/src/id/trace33p.a @@ -142,8 +142,7 @@ SDsuccess ; copy Standard Delivery bootloader into place for T00,S00 - lda #SD_DOS33p + ldx #ID_DOS33p jsr ConstructStandardDelivery lda #s_bootwrite jsr PrintByID @@ -205,9 +204,9 @@ skipsectors ; set up RWTS entry point lda #$D5 - sta callrwts+1 + sta jCallRWTS+1 lda #$36 - sta callrwts+2 + sta jCallRWTS+2 ; read the rest of the disk with the original RWTS diff --git a/src/id/trace8b3.a b/src/id/trace8b3.a index cf2d802..1bd6445 100644 --- a/src/id/trace8b3.a +++ b/src/id/trace8b3.a @@ -98,9 +98,9 @@ _restore3 ; Set up RWTS entry point ; lda #$00 - sta callrwts+1 + sta jCallRWTS+1 lda #$BD - sta callrwts+2 + sta jCallRWTS+2 ; ; Read the rest of the disk with the original RWTS ; diff --git a/src/memory.a b/src/memory.a index 40944c6..c8dbcf4 100755 --- a/src/memory.a +++ b/src/memory.a @@ -79,6 +79,7 @@ ClearTSBuffer ; in: A = source address (high) ; X = destination address (high) ; Y = number of pages to copy +; C = dest direction (set: +, clear: -) ; out: all flags and registers clobbered ;------------------------------- !zone { @@ -87,6 +88,10 @@ SwapMemory sta .source2+2 stx .dest1+2 stx .dest2+2 + lda #$FF + adc #0 + ora #1 + sta .destadjust+1 ldx #$00 .source1 lda $FF00,x pha @@ -98,13 +103,36 @@ SwapMemory bne .source1 inc .source1+2 inc .source2+2 - inc .dest1+2 - inc .dest2+2 + lda .dest1+2 + clc +.destadjust + adc #$D1 + sta .dest1+2 + sta .dest2+2 dey bne .source1 rts } +;------------------------------- +; ReorderBuffer - convert data +; buffer between ProDOS and +; DOS 3.3 ordering (use after +; read or before write under +; ProDOS) +; in: none +; out: all flags clobbered +; all registers clobbered +;------------------------------- +!zone { +ReorderBuffer + lda #BASEPAGE+1 + ldx #BASEPAGE+$0E + ldy #$07 + clc + jmp SwapMemory +} + ;------------------------------- ; SaveProDOS ; saves memory pages used by ProDOS @@ -142,14 +170,17 @@ SwapProDOS lda #$00 ldx #$40 ldy #$01 + sec jsr SwapMemory lda #$03 ldx #$41 ldy #$01 + sec jsr SwapMemory lda #$BF ldx #$42 ldy #$01 + sec jsr SwapMemory rts @@ -176,58 +207,38 @@ SwapProDOS ; 0123456789ABCDEF ; 07E6D5C4B3A2918F ; in: track buffer has data in logical sector order -; out: A,Y clobbered -; X preserved +; out: A,X,Y clobbered ;------------------------------- !zone { ReorderLogicalToPhysical ldy #$00 -- lda $1100,y - pha - lda $1200,y - pha - lda $1300,y - pha - lda $1400,y - pha - lda $1600,y - pha - lda $1700,y - pha - lda $1800,y - pha - lda $1900,y - pha - lda $1b00,y - pha - lda $1c00,y - pha - lda $1d00,y - pha +- ldx $1800,y lda $1e00,y sta $1800,y - pla - sta $1100,y - pla - sta $1900,y - pla - sta $1200,y - pla - sta $1300,y - pla - sta $1b00,y - pla - sta $1400,y - pla - sta $1c00,y - pla - sta $1d00,y - pla - sta $1600,y - pla + lda $1200,y sta $1e00,y - pla + lda $1b00,y + sta $1200,y + txa + sta $1b00,y + ldx $1100,y + lda $1d00,y + sta $1100,y + lda $1400,y + sta $1d00,y + lda $1700,y + sta $1400,y + txa sta $1700,y + ldx $1900,y + lda $1c00,y + sta $1900,y + lda $1600,y + sta $1c00,y + lda $1300,y + sta $1600,y + txa + sta $1300,y iny bne - rts diff --git a/src/mli.a b/src/mli.a index b858486..5aff227 100755 --- a/src/mli.a +++ b/src/mli.a @@ -54,9 +54,7 @@ WriteTrackMLI lda gUsingRAMDisk beq + jsr ReorderBuffer -+ lda #$81 ; 'write block' command - sta mlicmd - lda DRIVE ; ProDOS "unit number" is ++ lda DRIVE ; ProDOS "unit number" is sec sbc #$31 lsr ; DSSS0000, where D is the @@ -90,7 +88,7 @@ WriteTrackMLI .writeloop lda gUsingRAMDisk beq + - lda mlicmd + lda #$81 ; 'write block' command ldy #$03 ; parameter count jsr mli bcs .writeerr @@ -119,46 +117,6 @@ WriteTrackMLI .blockcount !byte $FF } -;------------------------------- -; ReorderBuffer - convert data -; buffer between ProDOS and -; DOS 3.3 ordering (use after -; read or before write under -; ProDOS) -; in: none -; out: all flags clobbered -; all registers clobbered -; @cmp1, @cmp2 clobbered -;------------------------------- -!zone { -ReorderBuffer - lda #$00 - sta cmp1 - sta cmp2 - tay - lda #$01 - clc - adc #BASEPAGE - sta cmp1+1 - lda #$0E - clc - adc #BASEPAGE - sta cmp2+1 - ldx #$07 -.L lda (cmp1),y - pha - lda (cmp2),y - sta (cmp1),y - pla - sta (cmp2),y - iny - bne .L - inc cmp1+1 - dec cmp2+1 - dex - bne .L - rts -} ;------------------------------- ; SaveFile1Shot @@ -497,13 +455,13 @@ accessbits = $C3 ; full access CreateFile lda #accessbits sta mliparam+3 ; access bits (full access) - lda #1 - sta mliparam+7 ; storage type (file) - lda #0 - sta mliparam+8 ; creation date (current) - sta mliparam+9 - sta mliparam+10 ; creation time (current) - sta mliparam+11 + ldy #1 + sty mliparam+7 ; storage type (file) + dey + sty mliparam+8 ; creation date (current) + sty mliparam+9 + sty mliparam+10 ; creation time (current) + sty mliparam+11 lda #CMD_CREATE ; MLI create command ldy #PC_CREATE ; number of parameters for 'create' command jsr mli @@ -706,6 +664,8 @@ WriteRAMToDisk jsr IncProgress jsr WriteTrackMLI bcs .exit + lda KEY + bmi .cancel inc gTrack lda gTrack cmp #$23 @@ -715,8 +675,13 @@ WriteRAMToDisk lda #TRUE sta gUsingRAMDisk clc + .exit rts + +.cancel + jmp Cancel + } ;------------------------------- diff --git a/src/modify.a b/src/modify.a index 0ac38fa..b844c10 100755 --- a/src/modify.a +++ b/src/modify.a @@ -61,13 +61,12 @@ modify bne .src lda #$8D jsr PrintA + bvc + .mod - lda (modsrc),y - dey - bmi .exit sta (moddest),y - clv - bvc .mod ; unconditional branch ++ lda (modsrc),y + dey + bpl .mod .exit inc gPatchCount .exitnomod diff --git a/src/mods/t00only.a b/src/mods/t00only.a new file mode 100644 index 0000000..6666230 --- /dev/null +++ b/src/mods/t00only.a @@ -0,0 +1,118 @@ +!cpu 6502 +*=$2000 + +!to "../../build/t00only.bin",plain + +MODULE=1 +!source "../apidefs.a" +!source "../strings/enid.a" +WILDCARD = $97 ; from compare.a + +;------------------------------- +; AnalyzeT00 +; set additional flags based on contents of track $00 +; +; in: Track $00 in data buffer +; out: gIsBoot1, gIsMaster, gIsRWTS set to #TRUE or #FALSE +; all flags clobbered +; all registers clobbered +;------------------------------- +!zone { +AnalyzeT00 + lda #$01 + ldx #$00 + ldy #$38 + jsr compare ; if T00,S01,$00 == + !byte $8E,$E9,$B7,$8E,$F7,$B7,$A9,$01 + !byte $8D,$F8,$B7,$8D,$EA,$B7,$AD,$E0 + !byte $B7,$8D,$E1,$B7,$A9,$02,$8D,$EC + !byte $B7,$A9,$04,$8D,$ED,$B7,$AC,$E7 + !byte $B7,$88,$8C,$F1,$B7,$A9,$01,$8D + !byte $F4,$B7,$8A,$4A,$4A,$4A,$4A,$AA + !byte $A9,$00,$9D,$F8,$04,$9D,$78,$04 + ldx #TRUE + bcc .boot1 + ldx #FALSE +.boot1 + stx gIsBoot1 + + lda #$01 + ldx #$00 + ldy #$38 + jsr compare ; if T00,S01,$00 == + !byte $8E,$E9,$37,$8E,$F7,$37,$A9,$01 + !byte $8D,$F8,$37,$8D,$EA,$37,$AD,$E0 + !byte $37,$8D,$E1,$37,$A9,$02,$8D,$EC + !byte $37,$A9,$04,$8D,$ED,$37,$AC,$E7 + !byte $37,$88,$8C,$F1,$37,$A9,$01,$8D + !byte $F4,$37,$8A,$4A,$4A,$4A,$4A,$AA + !byte $A9,$00,$9D,$F8,$04,$9D,$78,$04 + ldx #TRUE + bcc .master + ldx #FALSE +.master + stx gIsMaster + + lda #$07 + ldx #$00 + ldy #$40 + jsr compare ; if T00,S07,$00 == + !byte $84,$48,$85,$49,$A0,$02,$8C,$F8 + !byte $06,$A0,$04,$8C,$F8,$04,$A0,$01 + !byte $B1,$48,$AA,$A0,$0F,$D1,$48,$F0 + !byte $1B,$8A,$48,$B1,$48,$AA,$68,$48 + !byte $91,$48,$BD,$8E,$C0,$A0,$08,$BD + !byte $8C,$C0,$DD,$8C,$C0,$D0,$F6,$88 + !byte $D0,$F8,$68,$AA,$BD,$8E,$C0,$BD + !byte $8C,$C0,$A0,$08,$BD,$8C,$C0,$48 + ldx #TRUE + bcc .rwts + ldx #FALSE +.rwts + stx gIsRWTS +} + + !source "../patchers/sunburst.a" + !source "../patchers/jmpbcf0.a" + !source "../patchers/jmpbeb1.a" + !source "../patchers/jmpbeca.a" + !source "../patchers/jmpb660.a" + !source "../patchers/jmpb720.a" + !source "../patchers/bademu.a" + !source "../patchers/bademu2.a" + !source "../patchers/rwts.a" + !source "../patchers/rwtslog.a" + !source "../patchers/mecc1.a" + !source "../patchers/mecc2.a" + !source "../patchers/mecc3.a" + !source "../patchers/mecc4.a" + !source "../patchers/rol1e.a" + !source "../patchers/jmpb4bb.a" + !source "../patchers/jmpb4bbhi.a" + !source "../patchers/thunder.a" + !source "../patchers/jsrbb03.a" + !source "../patchers/davidbb03.a" + !source "../patchers/rwtsswap.a" + !source "../patchers/rwtsswap2.a" + !source "../patchers/border.a" + !source "../patchers/jmpae8e.a" + !source "../patchers/jmpbbfe.a" + !source "../patchers/datasoft.a" + !source "../patchers/nibtable.a" + !source "../patchers/diskvol.a" + !source "../patchers/c9ff.a" + !source "../patchers/milliken.a" + !source "../patchers/methods.a" + !source "../patchers/jsr8b3.a" + !source "../patchers/laureate.a" + !source "../patchers/pascalrwts.a" + !source "../patchers/micrograms.a" + !source "../patchers/dos32.a" + !source "../patchers/dos32dlm.a" + +;add only above this line + rts + +!if * > $4000 { + !serious "code is too large to fit in available space!" +} diff --git a/res/universalrwts.org b/src/mods/universalrwts.a similarity index 93% rename from res/universalrwts.org rename to src/mods/universalrwts.a index 4d28c66..69ecc42 100644 --- a/res/universalrwts.org +++ b/src/mods/universalrwts.a @@ -1,3 +1,8 @@ +!cpu 6502 +*=$B800 + +!to "../../build/universalrwts.bin",plain + ;------------------------------- ; Universal RWTS ; a modified DOS 3.3-style RWTS that reads 16-sector (6-and-2 encoded) disks @@ -17,13 +22,6 @@ ; will crash. ;------------------------------- -UNIV_A1 = $B956 ; must LSR before setting -UNIV_A2 = $B95F -UNIV_A3 = $B968 -UNIV_D1 = $B8E7 -UNIV_D2 = $B8F1 -UNIV_D3 = $B8FC - universalrwts !byte $A2,$00,$A0,$02,$88,$B1,$3E,$4A,$3E,$00,$BC,$4A,$3E,$00,$BC,$99 !byte $00,$BB,$E8,$E0,$56,$90,$ED,$A2,$00,$98,$D0,$E8,$A2,$55,$BD,$00 @@ -57,7 +55,6 @@ universalrwts !byte $38,$20,$EE,$B9,$B9,$11,$BA,$20,$00,$BA,$A5,$27,$18,$20,$F1,$B9 !byte $B9,$1D,$BA,$20,$00,$BA,$E6,$26,$D0,$C3,$20,$00,$BA,$18,$AD,$78 !byte $04,$29,$03,$2A,$05,$2B,$AA,$BD,$80,$C0,$A6,$2B,$60,$AA,$A0,$A0 -nibtable !byte $A2,$11,$CA,$D0,$FD,$E6,$46,$D0,$02,$E6,$47,$38,$E9,$01,$D0,$F0 !byte $60,$01,$30,$28,$24,$20,$1E,$1D,$1C,$1C,$1C,$1C,$1C,$70,$2C,$26 !byte $22,$1F,$1E,$1D,$1C,$1C,$1C,$1C,$1C,$96,$97,$9A,$9B,$9D,$9E,$9F @@ -69,15 +66,15 @@ nibtable ; these $FF bytes (at $BA80..$BA95) are used by the ; routine that checks whether a track is formatted !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF - !byte $FF,$FF,$FF,$FF,$FF,$FF,$00,$01,$98,$99,$02,$03,$9C,$04,$05,$06 - !byte $A0,$A1,$A2,$A3,$A4,$A5,$07,$08,$A8,$A9,$AA,$09,$0A,$0B,$0C,$0D - !byte $B0,$B1,$0E,$0F,$10,$11,$12,$13,$B8,$14,$15,$16,$17,$18,$19,$1A - !byte $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7,$C8,$C9,$CA,$1B,$CC,$1C,$1D,$1E - !byte $D0,$D1,$D2,$1F,$D4,$D5,$20,$21,$D8,$22,$23,$24,$25,$26,$27,$28 - !byte $E0,$E1,$E2,$E3,$E4,$29,$2A,$2B,$E8,$2C,$2D,$2E,$2F,$30,$31,$32 - !byte $F0,$F1,$33,$34,$35,$36,$37,$38,$F8,$39,$3A,$3B,$3C,$3D,$3E -nibtableff - !byte $3F +; the nibble table that lives at $BA96 is copied into here from another location +; after being potentially modified because of protection + !byte $FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 diff --git a/src/nibtable.a b/src/nibtable.a deleted file mode 100644 index e8a9eb5..0000000 --- a/src/nibtable.a +++ /dev/null @@ -1,11 +0,0 @@ -nibtable=*-$80 - !byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8A,$8B,$8C,$8D,$8E,$8F - !byte $90,$91,$92,$93,$94,$95,$00,$01,$98,$99,$02,$03,$9C,$04,$05,$06 - !byte $A0,$A1,$A2,$A3,$A4,$A5,$07,$08,$A8,$A9,$AA,$09,$0A,$0B,$0C,$0D - !byte $B0,$B1,$0E,$0F,$10,$11,$12,$13,$B8,$14,$15,$16,$17,$18,$19,$1A - !byte $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7,$C8,$C9,$CA,$1B,$CC,$1C,$1D,$1E - !byte $D0,$D1,$D2,$1F,$D4,$D5,$20,$21,$D8,$22,$23,$24,$25,$26,$27,$28 - !byte $E0,$E1,$E2,$E3,$E4,$29,$2A,$2B,$E8,$2C,$2D,$2E,$2F,$30,$31,$32 - !byte $F0,$F1,$33,$34,$35,$36,$37,$38,$F8,$39,$3A,$3B,$3C,$3D,$3E -nibtableff - !byte $3F diff --git a/src/passport.a b/src/passport.a index 7393a7f..6d9bcdb 100755 --- a/src/passport.a +++ b/src/passport.a @@ -29,6 +29,10 @@ ; ;------------------------------- +!ifndef VERBOSE { +VERBOSE = $00 ; set to $01 to display API label addresses +} + ; Supported languages ; (each has its own localized strings file ; and its own output filename) @@ -72,55 +76,25 @@ COUT = $FDED PR0 = $FE89 IN0 = $FE93 -; Zero-page addresses we use for variables -!ifdef PASS2 { -} else { -;unpacker variables, no need to change these -src = $3c ; word -dst = $3e ; word -ecx = $40 ; word -last = $42 ; word -tmpu = $44 ; word +;Universal RWTS-specific values +UNIV_A1 = $B956 ; must LSR before setting +UNIV_A2 = $B95F +UNIV_A3 = $B968 +UNIV_D1 = $B8E7 +UNIV_D2 = $B8F1 +UNIV_D3 = $B8FC -nibsrcindex = $EC ; byte -nibdestindex = $ED ; byte -prbuf = $EE ; word -unform = $F0 ; word -nibcount = $F2 ; byte -modtmp = $F3 ; byte -modsrc = $F4 ; word -moddest = $F6 ; word -cmp1 = $F8 ; word -cmp2 = $FA ; word -counter = $FC ; byte -tmp = $FC ; byte -iunit = $FC ; byte -tmpa = $FC ; byte -tmpx = $FD ; byte -tmpy = $FE ; byte -flag = $FF ; byte -} - -; Application constants (not zero addresses) -RELBASE = $5600 ; address to move Passport code - ; so that it's out of the way -LOWPOINT = $4300 ; lowest available address for code -BASEPAGE = $10 ; Special Delivery tracer assumes - ; this is $10, so don't change it! -TRUE = $00 ; Lots of code assumes this is $00 - ; so it can branch with BEQ, so - ; don't change it either! -FALSE = $01 +!source "apidefs.a" ldx #$00 -FM lda FirstMover + ((255 + LastMover - FirstMover) & $FF00),x +FM lda LastMover - 256,x sta $B500,x inx bne FM dec FM+2 dec FM+5 - lda FM+2 - cmp #$1F + lda FM+5 + cmp #(>RELBASE)-((>(RELBASE+255))->RELBASE)-1 bne FM jmp OneTimeSetup @@ -266,7 +240,6 @@ MainMenu Action sta gMode - bit gMode bpl + jsr CreateRAMFile + jsr ResetProgress @@ -280,7 +253,7 @@ Action sta gTrack sta gSector sta gPatchCount - sta callrwts+1 + sta jCallRWTS+1 lda #$08 sta gAddress+1 jsr ClearScreen @@ -518,22 +491,20 @@ CopyUniversal pha lda #$B8 CopyUniversalAnywhere - sta dst+1 + sta universalrwts clc adc #$02 sta .cu+2 - lda #$00 - sta dst lda #>universalrwts - sta src+1 + sta _byte_hi lda #AnalyzeT00 + sta _byte_hi + lda #SD_DOS32 + ldx #ID_DOS32 jsr ConstructStandardDelivery jmp ++ -+ lda #SD_DOS32LO ++ ldx #ID_DOS32LO jsr ConstructStandardDelivery ++ lda #s_bootwrite diff --git a/src/patchers/jsr8b3.a b/src/patchers/jsr8b3.a index f4223e6..22f7e48 100644 --- a/src/patchers/jsr8b3.a +++ b/src/patchers/jsr8b3.a @@ -9,9 +9,9 @@ ; e.g. English Achievement I ;------------------------------- !zone { - jsr ID8b3 - bcs .exit - bcc + + lda gIs8b3 + bne .exit + beq + .sectors !byte $00,$00,$02,$02,$02,$02,$02,$02,$02,$02 diff --git a/src/patchers/laureate.a b/src/patchers/laureate.a index 418b9c2..070f25d 100644 --- a/src/patchers/laureate.a +++ b/src/patchers/laureate.a @@ -4,9 +4,9 @@ ; but generally DOS-shaped ;------------------------------- !zone { - jsr IDLaureate - bcs .exit - bcc + + lda gIsLaureate + bne .exit + beq + .sectors !byte $04,$04,$04,$04,$04,$04,$04,$04,$04,$05,$05,$05,$05,$05,$05,$05,$06,$06,$06 diff --git a/src/patchers/mecc1.a b/src/patchers/mecc1.a index 91b9d89..6bc4590 100755 --- a/src/patchers/mecc1.a +++ b/src/patchers/mecc1.a @@ -5,10 +5,9 @@ ; e.g. Word Munchers ;------------------------------- !zone { - jsr IDMECC - bcs .exit - jsr IDMECC1 - bcs .exit + lda gIsMECCFastloader + ora gIsMECC1 + bne .exit lda #$0B ldx #$08 ldy #$01 diff --git a/src/patchers/mecc2.a b/src/patchers/mecc2.a index 468b7d0..742648c 100755 --- a/src/patchers/mecc2.a +++ b/src/patchers/mecc2.a @@ -5,10 +5,9 @@ ; e.g. Phonics Prime Time series ;------------------------------- !zone { - jsr IDMECC - bcs .exit - jsr IDMECC2 - bcs .exit + lda gIsMECCFastloader + ora gIsMECC2 + bne .exit lda #$07 ldx #$83 ldy #$01 diff --git a/src/patchers/mecc3.a b/src/patchers/mecc3.a index 5cff756..a75a1ea 100644 --- a/src/patchers/mecc3.a +++ b/src/patchers/mecc3.a @@ -5,10 +5,9 @@ ; e.g. Word Munchers v1.1 ;------------------------------- !zone { - jsr IDMECC - bcs .exit - jsr IDMECC3 - bcs .exit + lda gIsMECCFastloader + ora gIsMECC3 + bne .exit lda #$0A ldx #$E8 ldy #$01 diff --git a/src/patchers/mecc4.a b/src/patchers/mecc4.a index 86d09fc..36901a6 100644 --- a/src/patchers/mecc4.a +++ b/src/patchers/mecc4.a @@ -5,10 +5,9 @@ ; e.g. A-201 Conquering Whole Numbers ;------------------------------- !zone { - jsr IDMECC - bcs .exit - jsr IDMECC4 - bcs .exit + lda gIsMECCFastloader + ora gIsMECC4 + bne .exit lda #$08 ldx #$83 ldy #$01 diff --git a/src/patchers/milliken.a b/src/patchers/milliken.a index 4672511..d5ed765 100644 --- a/src/patchers/milliken.a +++ b/src/patchers/milliken.a @@ -7,8 +7,8 @@ ; The Writing Workshop, Math Sequences ;------------------------------- !zone { - jsr IDMilliken1 - bcs .exit + lda gIsMilliken1 + bne .exit lda #$01 ldx #$48 ldy #$02 diff --git a/src/patchers/nibtable.a b/src/patchers/nibtable.a index 9bf212a..9958cc8 100755 --- a/src/patchers/nibtable.a +++ b/src/patchers/nibtable.a @@ -8,22 +8,6 @@ _nibtable jmp .checkread -.readdata - !byte $00,$01 - !byte $98,$99,$02,$03,$9C,$04,$05,$06 - !byte $A0,$A1,$A2,$A3,$A4,$A5,$07,$08 - !byte $A8,$A9,$AA,$09,$0A,$0B,$0C,$0D - !byte $B0,$B1,$0E,$0F,$10,$11,$12,$13 - !byte $B8,$14,$15,$16,$17,$18,$19,$1A - !byte $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 - !byte $C8,$C9,$CA,$1B,$CC,$1C,$1D,$1E - !byte $D0,$D1,$D2,$1F,$D4,$D5,$20,$21 - !byte $D8,$22,$23,$24,$25,$26,$27,$28 - !byte $E0,$E1,$E2,$E3,$E4,$29,$2A,$2B - !byte $E8,$2C,$2D,$2E,$2F,$30,$31,$32 - !byte $F0,$F1,$33,$34,$35,$36,$37,$38 - !byte $F8,$39,$3A,$3B,$3C,$3D,$3E,$3F - .writedata !byte $96,$97,$9A,$9B,$9D,$9E,$9F,$A6 !byte $A7,$AB,$AC,$AD,$AE,$AF,$B2,$B3 @@ -80,59 +64,103 @@ _nibtable jmp .exit2 .fixread - lda #$00 - sta nibsrcindex + lda #$6A + sta .loopcheck+1 lda #$96 - sta nibdestindex -.read - ldx nibsrcindex - lda .readdata,x - sta .nibcmpr - sta .nibmodr - lda #$04 - ldx nibdestindex - ldy #$01 - jsr compare -.nibcmpr !byte $FF - bcc .nomodr - lda #$04 - ldx nibdestindex - ldy #$01 - jsr modify -.nibmodr !byte $FF -.nomodr - inc nibsrcindex - inc nibdestindex - bne .read - rts + ldx #<(gNIBTableBase+$16) + ldy #>(gNIBTableBase+$16) + bne .common .fixwrite + lda #$40 + sta .loopcheck+1 + lda #$29 + ldx #<.writedata + ldy #>.writedata + +.common + sta nibdestindex + stx .nibload1+1 + sty .nibload1+2 + stx .nibload2+1 + sty .nibload2+2 lda #$00 sta nibsrcindex - lda #$29 +.modloop + ldy nibsrcindex + ldx nibdestindex + + ;loop while match succeeds + +.nibload1 + lda $D1D1,y + cmp (BASEPAGE*256)+$400,x + beq .nibcheck + + ;count mismatches until match or end + + inx + iny + cpy .loopcheck+1 + bne .nibload1 + + ;if we saw mismatches... + +.nibcheck + cpy nibsrcindex + beq .advance + + ;remember where + + txa + pha + tya + pha + + ;determine how many + + sec + sbc nibsrcindex + pha + tax + + ;construct dynamic data to apply mods + + lda #$20 + sta $300 + lda #modify + sta $302 + lda #$60 + sta $303,x +.nibdec + dex + dey +.nibload2 + lda $D1D1,y + sta $303,x + txa + bne .nibdec + pla + tay + lda #$04 + ldx nibdestindex + jsr $300 + + ;restore position, then resume + + pla + sta nibsrcindex + pla sta nibdestindex -.write - ldx nibsrcindex - lda .writedata,x - sta .nibcmpw - sta .nibmodw - lda #$04 - ldx nibdestindex - ldy #$01 - jsr compare -.nibcmpw !byte $FF - bcc .nomodw - lda #$04 - ldx nibdestindex - ldy #$01 - jsr modify -.nibmodw !byte $FF -.nomodw +.advance inc nibsrcindex inc nibdestindex lda nibsrcindex - cmp #$40 - bne .write +.loopcheck + cmp #$D1 + bcc .modloop rts .exit2 } diff --git a/src/print.a b/src/print.a index 38a636b..ab159ae 100755 --- a/src/print.a +++ b/src/print.a @@ -1,7 +1,5 @@ kForceLower !byte $FF ; AND mask for lowercase letters ; (set at program startup) -gDisplayBytes !fill 10 ; array of ten bytes for use as - ; substitution strings ;------------------------------- ; PrintByID diff --git a/src/rwts.a b/src/rwts.a index 62fdc03..386fd36 100755 --- a/src/rwts.a +++ b/src/rwts.a @@ -2,8 +2,8 @@ ; ReadSector ; high-level function to read a single sector. ; in: gIsProtDOS is TRUE or FALSE -; if gProtDOS is FALSE, callrwts+2 has been set to -; the RWTS entry point (e.g. $BD or $3D) +; if gProtDOS is FALSE, jCallRWTS has been set to +; the RWTS entry point (e.g. $BDxx or $3Dxx) ; out: all registers clobbered ; C clear if read was successful ; C set if read failed @@ -33,7 +33,7 @@ ReadSector setuprwts ldy #gRWTSParams -callrwts jsr $FF00 ; modified at runtime + jsr jCallRWTS bcc endread lda gOnAClearDayYouCanReadForever beq setuprwts @@ -88,7 +88,7 @@ PreReadSector !zone { cmp #kSectorCustomDOS32B4BB bne + - ldx callrwts+2 + ldx jCallRWTS+2 dex dex dex diff --git a/src/standarddelivery.a b/src/standarddelivery.a index 648e7ab..b993279 100644 --- a/src/standarddelivery.a +++ b/src/standarddelivery.a @@ -13,7 +13,26 @@ ;------------------------------- !zone { ConstructStandardDelivery - sta .A+1 + dex + beq .construct32 + dex + beq .construct32lo + +.construct33p + lda #SD_DOS33p + bne + + +.construct32 + lda #SD_DOS32 + bne + + +.construct32lo + lda #SD_DOS32LO + ++ sta .A+1 stx .A+2 ldx #$00 txa diff --git a/src/strings/en.a b/src/strings/en.a index cd96281..2485489 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -11,107 +11,7 @@ k_slot = "S" k_quit = "Q" ; will also quit -; -; String IDs -; (pass in accumulator to PrintByID) -; -s_header = $00 -s_mainmenu = $01 -s_progbar = $02 -s_reading = $03 -s_diskrwts = $04 -s_bb00 = $05 -s_sunburst = $06 -s_optimum = $07 -s_builtin = $08 -s_switch = $09 -s_writing = $0A -s_unformat = $0B -s_f7 = $0C -s_sync = $0D -s_optbad = $0E -s_pass = $0F -s_passdemuf = $10 -s_passcrack = $11 -s_passcrack0 = $12 -s_fail = $13 -s_fatal0000 = $14 -s_fatal220f = $15 -s_done = $16 -s_noslot6 = $17 -s_writeerr = $18 -s_writeioerr = $19 -s_writenodev = $1A -s_writeprot = $1B -s_othermli = $1C -s_canttrace = $1D -s_canceled = $1E -s_bademu = $1F -s_reset = $20 -s_modify = $21 -s_modifyto = $22 -s_dosb0 = $23 -s_prodosb0 = $24 -s_pascalb0 = $25 -s_mecc = $26 -s_sierra = $27 -s_a6bc95 = $28 -s_jmpbcf0 = $29 -s_rol1e = $2A -s_runhello = $2B -s_e7 = $2C -s_jmpb4bb = $2D -s_jmpb400 = $2E -s_jmpbeca = $2F -s_jsrbb03 = $30 -s_thunder = $31 -s_jmpae8e = $32 -s_diskvol = $33 -s_d5d5f7 = $34 -s_construct= $35 -s_datasoftb0 = $36 -s_datasoft = $37 -s_lsr6a = $38 -s_bcs08 = $39 -s_jmpb660 = $3A -s_protdos = $3B -s_protdosw = $3C -s_protserial = $3D -s_fbff = $3E -s_encoded44 = $3F -s_encoded53 = $40 -s_specdel = $41 -s_bytrack = $42 -s_a5count = $43 -s_restart = $44 -s_corrupter= $45 -s_eab0 = $46 -s_eatrk6 = $47 -s_eeef = $48 -s_poke = $49 -s_bootcounter = $4A -s_milliken = $4B -s_jsr8b3 = $4C -s_daviddos = $4D -s_quickdos = $4E -s_diversidos = $4F -s_prontodos = $50 -s_jmpb412 = $51 -s_laureate = $52 -s_bbf9 = $53 -s_micrograms = $54 -s_cmpbne0 = $55 -s_writeram = $56 -s_d5timing = $57 -s_advint = $58 -s_dos32b0 = $59 -s_bootwrite = $5A -s_rwtswrite = $5B -s_rdos = $5C -s_sra = $5D -s_muse = $5E -STRINGCOUNT = $5F - +!source "strings/enid.a" !zone { StringTable !word .header diff --git a/src/strings/enid.a b/src/strings/enid.a new file mode 100644 index 0000000..2d5e718 --- /dev/null +++ b/src/strings/enid.a @@ -0,0 +1,100 @@ +; +; String IDs +; (pass in accumulator to PrintByID) +; +s_header = $00 +s_mainmenu = $01 +s_progbar = $02 +s_reading = $03 +s_diskrwts = $04 +s_bb00 = $05 +s_sunburst = $06 +s_optimum = $07 +s_builtin = $08 +s_switch = $09 +s_writing = $0A +s_unformat = $0B +s_f7 = $0C +s_sync = $0D +s_optbad = $0E +s_pass = $0F +s_passdemuf = $10 +s_passcrack = $11 +s_passcrack0 = $12 +s_fail = $13 +s_fatal0000 = $14 +s_fatal220f = $15 +s_done = $16 +s_noslot6 = $17 +s_writeerr = $18 +s_writeioerr = $19 +s_writenodev = $1A +s_writeprot = $1B +s_othermli = $1C +s_canttrace = $1D +s_canceled = $1E +s_bademu = $1F +s_reset = $20 +s_modify = $21 +s_modifyto = $22 +s_dosb0 = $23 +s_prodosb0 = $24 +s_pascalb0 = $25 +s_mecc = $26 +s_sierra = $27 +s_a6bc95 = $28 +s_jmpbcf0 = $29 +s_rol1e = $2A +s_runhello = $2B +s_e7 = $2C +s_jmpb4bb = $2D +s_jmpb400 = $2E +s_jmpbeca = $2F +s_jsrbb03 = $30 +s_thunder = $31 +s_jmpae8e = $32 +s_diskvol = $33 +s_d5d5f7 = $34 +s_construct= $35 +s_datasoftb0 = $36 +s_datasoft = $37 +s_lsr6a = $38 +s_bcs08 = $39 +s_jmpb660 = $3A +s_protdos = $3B +s_protdosw = $3C +s_protserial = $3D +s_fbff = $3E +s_encoded44 = $3F +s_encoded53 = $40 +s_specdel = $41 +s_bytrack = $42 +s_a5count = $43 +s_restart = $44 +s_corrupter= $45 +s_eab0 = $46 +s_eatrk6 = $47 +s_eeef = $48 +s_poke = $49 +s_bootcounter = $4A +s_milliken = $4B +s_jsr8b3 = $4C +s_daviddos = $4D +s_quickdos = $4E +s_diversidos = $4F +s_prontodos = $50 +s_jmpb412 = $51 +s_laureate = $52 +s_bbf9 = $53 +s_micrograms = $54 +s_cmpbne0 = $55 +s_writeram = $56 +s_d5timing = $57 +s_advint = $58 +s_dos32b0 = $59 +s_bootwrite = $5A +s_rwtswrite = $5B +s_rdos = $5C +s_sra = $5D +s_muse = $5E +STRINGCOUNT = $5F diff --git a/src/universalrwts.a b/src/universalrwts.a deleted file mode 100755 index 0ecc61a..0000000 --- a/src/universalrwts.a +++ /dev/null @@ -1,113 +0,0 @@ -;------------------------------- -; Universal RWTS -; a modified DOS 3.3-style RWTS that reads 16-sector (6-and-2 encoded) disks -; - address prologue "D4 AA 96" or "D5 AA 96" -; - any address epilogue -; - data prologue "D5 AA AD" -; - any data epilogue -; -; It verifies the data field checksum byte, but it ignores the address field -; checksum. It waits longer than a normal RWTS to find an address prologue -- -; long enough that it will find the prologue even if there is only one sector -; on a track. -; -; It must be loaded at $B800. It uses the standard RWTS entry point at $BD00. -; -; Write support has been disabled. Any attempt to pass $02 or $04 RWTS commands -; will crash. -;------------------------------- - -UNIV_A1 = $B956 ; must LSR before setting -UNIV_A2 = $B95F -UNIV_A3 = $B968 -UNIV_D1 = $B8E7 -UNIV_D2 = $B8F1 -UNIV_D3 = $B8FC - -universalrwts - !byte $A2,$E0,$A0,$07,$02,$88,$B1,$3E,$4A,$2E,$0A,$BC,$04,$1C,$99,$00 - !byte $BB,$E8,$E0,$56,$90,$ED,$C7,$2E,$98,$D0,$9E,$A6,$55,$BD,$24,$18 - !byte $29,$3F,$9D,$0A,$CA,$10,$00,$F5,$60,$38,$86,$27,$8E,$78,$06,$1C - !byte $BD,$8D,$C0,$FB,$F3,$18,$30,$7C,$AD,$2A,$85,$26,$0F,$A9,$FF,$9D - !byte $8F,$E7,$1D,$8C,$F0,$48,$68,$EA,$A0,$60,$04,$0A,$20,$B9,$B8,$88 - !byte $0F,$D0,$F8,$A9,$D5,$1D,$FC,$75,$42,$AA,$22,$AD,$03,$98,$A0,$56 - !byte $D0,$03,$B9,$00,$5C,$59,$FF,$BB,$AA,$BD,$29,$BA,$1B,$A6,$27,$9D - !byte $85,$60,$66,$52,$EB,$A5,$26,$EA,$70,$59,$A9,$15,$AE,$A1,$B0,$16 - !byte $30,$50,$BB,$C8,$D0,$46,$EA,$3D,$20,$E5,$82,$DE,$72,$4B,$EB,$2D - !byte $DE,$B4,$0B,$FC,$06,$29,$60,$18,$DE,$D0,$66,$7C,$7A,$70,$A0,$06 - !byte $A2,$56,$CA,$30,$FB,$77,$65,$5E,$CC,$2A,$00,$04,$91,$3E,$C8,$C4 - !byte $26,$D8,$C0,$34,$20,$88,$30,$F0,$61,$5B,$10,$FB,$49,$7F,$D5,$2A - !byte $F4,$EA,$0A,$3D,$C9,$AA,$28,$F2,$92,$84,$0B,$7B,$AD,$38,$E7,$A9 - !byte $05,$88,$84,$26,$BC,$10,$0E,$8B,$1E,$BA,$A4,$A8,$FF,$F8,$D0,$56 - !byte $EE,$11,$91,$91,$2A,$EE,$10,$41,$D9,$E9,$13,$49,$39,$C3,$CF,$05 - !byte $EA,$61,$0A,$5C,$38,$9B,$D0,$F7,$66,$1D,$4C,$04,$E6,$4A,$F0,$F3 - !byte $16,$87,$4A,$C9,$6A,$E5,$EF,$74,$6E,$23,$09,$96,$18,$D8,$A0,$03 - !byte $DC,$85,$27,$A9,$0F,$2A,$21,$3C,$13,$08,$25,$38,$C2,$2C,$0F,$45 - !byte $27,$88,$46,$E7,$A8,$A6,$85,$5C,$4E,$00,$18,$60,$86,$2B,$85,$03 - !byte $2A,$CD,$78,$04,$F0,$53,$1B,$79,$26,$AD,$12,$0F,$82,$38,$E5,$2A - !byte $C0,$33,$B0,$07,$49,$FF,$60,$EE,$1C,$90,$05,$69,$FE,$63,$CE,$0E - !byte $C5,$26,$CA,$02,$40,$4E,$C9,$0C,$01,$B0,$01,$A8,$38,$20,$EE,$B9 - !byte $C4,$11,$BA,$ED,$40,$AD,$A5,$27,$18,$F8,$F1,$C8,$18,$1D,$48,$9B - !byte $0C,$D0,$C3,$0F,$18,$C0,$83,$29,$03,$2A,$05,$2B,$90,$62,$1D,$80 - !byte $C0,$A6,$9D,$60,$DC,$A0,$40,$A2,$11,$CA,$D0,$FD,$E6,$74,$46,$74 - !byte $02,$0F,$47,$38,$E9,$01,$67,$F0,$60,$40,$30,$28,$24,$20,$14,$1E - !byte $1D,$1C,$01,$02,$70,$2C,$26,$22,$1F,$98,$0C,$96,$97,$00,$9A,$9B - !byte $9D,$9E,$9F,$A6,$A7,$AB,$00,$AC,$AD,$AE,$AF,$B2,$B3,$B4,$B5,$00 - !byte $B6,$B7,$B9,$BA,$BB,$BC,$BD,$BE,$00,$BF,$CB,$CD,$CE,$CF,$D3,$D6 - !byte $D7,$00,$D9,$DA,$DB,$DC,$DD,$DE,$DF,$E5,$00,$E6,$E7,$E9,$EA,$EB - !byte $EC,$ED,$EE,$00,$EF,$F2,$F3,$F4,$F5,$F6,$F7,$F9,$03,$FA,$FB,$FC - !byte $FD,$FE,$FF,$85,$3A,$01,$21,$FF,$DB,$80,$01,$98,$99,$00,$02,$03 - !byte $9C,$04,$05,$06,$A0,$A1,$01,$A2,$A3,$A4,$A5,$07,$08,$A8,$30,$07 - !byte $09,$00,$0A,$0B,$0C,$0D,$B0,$B1,$0E,$0F,$00,$10,$11,$12,$13,$B8 - !byte $14,$15,$16,$00,$17,$18,$19,$1A,$C0,$C1,$C2,$C3,$00,$C4,$C5,$C6 - !byte $C7,$C8,$C9,$CA,$1B,$00,$CC,$1C,$1D,$1E,$D0,$D1,$D2,$1F,$4C,$D4 - !byte $82,$02,$21,$D8,$22,$23,$24,$40,$5E,$27,$28,$00,$E0,$E1,$E2,$E3 - !byte $E4,$29,$2A,$2B,$00,$E8,$2C,$2D,$2E,$2F,$30,$31,$32,$00,$F0,$F1 - !byte $33,$34,$35,$36,$37,$38,$00,$F8,$39,$3A,$3B,$3C,$3D,$3E,$3F,$E1 - !byte $4E,$01,$EE,$96,$72,$27,$5E,$E6,$22,$42,$DD,$0D,$20,$C3,$BC,$07 - !byte $F9,$8D,$42,$0E,$EA,$C1,$FE,$F0,$75,$27,$CB,$FC,$59,$0B,$96,$11 - !byte $A5,$41,$FD,$C4,$02,$44,$11,$3F,$09,$FD,$45,$F3,$97,$90,$48,$4A - !byte $05,$3E,$BB,$19,$0C,$68,$09,$54,$D4,$81,$DE,$5C,$34,$EB,$89,$18 - !byte $77,$0C,$43,$27,$22,$DD,$6D,$EA,$02,$54,$B4,$08,$DE,$20,$10,$60 - !byte $88,$A5,$0E,$E8,$91,$A0,$94,$CA,$96,$06,$4F,$7F,$1F,$C8,$10,$D0 - !byte $A3,$A3,$E0,$A0,$A5,$85,$1D,$A4,$84,$48,$1E,$49,$04,$02,$8C,$F8 - !byte $C3,$69,$04,$73,$0A,$F4,$01,$2C,$B1,$48,$15,$0E,$0F,$D1,$A3,$F0 - !byte $1B,$8A,$CE,$17,$7E,$68,$7B,$91,$C6,$CB,$A0,$08,$CE,$80,$4F,$D0 - !byte $F6,$BA,$E0,$29,$68,$AA,$77,$22,$15,$DB,$D2,$04,$F1,$F8,$05,$42 - !byte $1C,$03,$06,$EE,$26,$66,$89,$30,$06,$72,$38,$99,$36,$3C,$C8,$B4 - !byte $0A,$5E,$C7,$F3,$C1,$3C,$85,$47,$B7,$C0,$24,$A6,$10,$AB,$67,$06 - !byte $9C,$28,$DE,$05,$08,$6A,$80,$B7,$BD,$8A,$C0,$3A,$B0,$03,$BA,$8B - !byte $8F,$66,$35,$28,$E1,$D0,$0B,$A0,$07,$65,$9D,$8D,$7E,$FA,$AE,$94 - !byte $06,$87,$58,$FA,$5A,$3E,$BE,$28,$83,$11,$A4,$47,$10,$0D,$F1,$12 - !byte $88,$63,$9E,$20,$F7,$F0,$F3,$FA,$0C,$C2,$36,$F0,$5A,$C9,$E0,$0C - !byte $58,$6A,$6C,$08,$7A,$64,$B8,$06,$A0,$30,$8C,$78,$05,$69,$F6,$44 - !byte $0C,$B9,$90,$24,$CE,$16,$10,$59,$F3,$E0,$01,$48,$A9,$60,$20,$95 - !byte $BE,$FA,$83,$D1,$F0,$28,$D7,$D5,$8D,$1F,$D3,$F8,$66,$9F,$68,$09 - !byte $58,$4C,$AB,$0B,$A4,$2E,$CC,$A5,$4B,$1C,$0C,$26,$98,$4B,$68,$DF - !byte $4C,$83,$D0,$E5,$F0,$CA,$C0,$A9,$40,$28,$3F,$4C,$48,$F9,$75,$39 - !byte $75,$AF,$B9,$A5,$3D,$9D,$A5,$2F,$D4,$0E,$AB,$07,$68,$F0,$08,$C5 - !byte $9E,$98,$82,$20,$D0,$7F,$E1,$60,$05,$F6,$A8,$B9,$B8,$BF,$3E,$C5 - !byte $2D,$01,$97,$28,$90,$1C,$20,$DC,$EE,$87,$82,$8E,$97,$A2,$03,$86 - !byte $26,$DB,$C2,$DC,$40,$18,$24,$38,$A0,$0D,$92,$2B,$30,$88,$C0,$FA - !byte $2A,$B8,$90,$90,$DD,$1F,$10,$B0,$EE,$A4,$4D,$87,$3C,$6A,$68,$D0 - !byte $08,$0A,$20,$6B,$32,$BE,$4E,$E6,$60,$E3,$C9,$CB,$8E,$CB,$B9,$07 - !byte $12,$24,$35,$30,$03,$7C,$F4,$8D,$C6,$14,$A5,$2A,$19,$20,$05,$99 - !byte $3A,$10,$03,$E0,$1C,$4C,$A0,$B9,$8A,$64,$4A,$03,$A8,$85,$D1,$22 - !byte $32,$6A,$43,$1C,$14,$61,$68,$0A,$23,$E2,$60,$4A,$51,$84,$B1,$41 - !byte $C7,$03,$47,$3E,$A4,$56,$A0,$12,$44,$12,$99,$FF,$BB,$5D,$38,$B8 - !byte $50,$06,$A9,$55,$50,$D4,$D4,$28,$85,$4D,$45,$47,$41,$EF,$F0,$0D - !byte $BF,$F9,$43,$A5,$24,$A3,$30,$12,$D0,$05,$38,$44,$1D,$F0,$19,$90 - !byte $27,$B0,$F5,$A5,$A1,$C2,$F1,$57,$BF,$93,$EC,$E6,$F6,$4E,$04,$C9 - !byte $23,$90,$D3,$18,$84,$8D,$22,$BB,$38,$93,$BC,$3E,$A5,$3F,$80,$80 - !byte $D0,$02,$A4,$45,$20,$56,$15,$BC,$B0,$6B,$CB,$75,$13,$66,$E6,$3F - !byte $01,$91,$C9,$10,$90,$EC,$30,$16,$84,$F5,$50,$4D,$99,$A8,$BF,$19 - !byte $88,$10,$FA,$47,$87,$E2,$92,$03,$50,$FE,$CA,$FC,$F1,$5E,$10,$23 - !byte $14,$F0,$15,$FC,$28,$C5,$82,$E4,$E9,$50,$01,$88,$C9,$05,$05,$B0 - !byte $11,$38,$60,$1E,$19,$75,$E7,$11,$37,$86,$42,$28,$20,$0B,$3D,$C9 - !byte $0F,$D4,$15,$8C,$84,$61,$EB,$4C,$A4,$2D,$B9,$8B,$B0,$30,$DD,$0C - !byte $30,$BF,$C6,$14,$3F,$10,$CA,$9D,$1B,$D0,$0A,$8C,$3F,$F3,$E5,$76 - !byte $C4,$04,$18,$60,$A2,$22,$A0,$0D,$0B,$09,$00,$07,$05,$03,$01,$0E - !byte $0C,$0A,$08,$00,$06,$04,$02,$0F,$20,$93,$FE,$AD,$34,$81,$C0,$07 - !byte $0E,$C4,$8D,$01,$E0,$4C,$44,$B7,$65,$85,$E4,$63,$AA,$F8,$70,$CE - !byte $06,$71,$D4,$84,$06,$5B,$A7,$8C,$B7,$0F,$38,$7E,$AE,$8F,$9B,$B3 - !byte $9A,$C1,$16,$A3,$BA,$8E,$83,$10,$A9,$09,$4C,$85,$EE,$00 diff --git a/src/unpack.a b/src/unpack.a index cc97d3a..d5a2830 100644 --- a/src/unpack.a +++ b/src/unpack.a @@ -1,177 +1,436 @@ -;aPLib data decompressor for Apple II -;Peter Ferrie (peter.ferrie@gmail.com) -;assemble using ACME -;dstnul rd build /s +goto :EOF +) +2>nul md build +cd src\mods +acme universalrwts.a +cd ..\..\build +exomize raw -q universalrwts.bin -o universalrwts.tmp +cscript /nologo //e:jscript %~f0 "b8" "00" +1>nul copy /b tmp+universalrwts.tmp universalrwts.pak +cd ..\src\mods +acme t00only.a +cd ..\..\build +exomize raw -q t00only.bin -o t00only.tmp +cscript /nologo //e:jscript %~f0 "20" "00" +1>nul copy /b tmp+t00only.tmp t00only.pak +cd ..\src +for /f "tokens=*" %%q in ('2^>^&1 acme passport.a') do set _make=%%q +acme -DRELBASE=$%_make:~-5,4% passport.a +set _make= +cd .. +1>nul copy res\work.po build\passport.po +java -jar bin\AppleCommander.jar -p build\passport.po "PASSPORT.SYSTEM" sys 0x2000 < build\PASSPORT.SYSTEM +goto :EOF +*/ +new ActiveXObject("scripting.filesystemobject").createtextfile("tmp").write(String.fromCharCode(parseInt(WScript.arguments(0),16),String.fromCharCode(parseInt(WScript.arguments(1),16)))) +/* +bat/jscript hybrid make script for Windows environments +a qkumba monstrosity from 2017-10-16 +requires ACME, Exomizer, Apple Commander, Java +https://sourceforge.net/projects/acme-crossass/ +https://sourceforge.net/projects/applecommander/ +https://bitbucket.org/magli143/exomizer/wiki/Home +https://java.com/en/download/ +requires ACME, Exomizer, Java to be in path +*/