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
This commit is contained in:
Peter Ferrie 2017-11-08 21:47:12 -08:00
parent 015103f468
commit f7ede6ef84
36 changed files with 1333 additions and 912 deletions

View File

@ -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

View File

@ -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

View File

@ -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 +

177
src/apicode.a Normal file
View File

@ -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

158
src/apidefs.a Normal file
View File

@ -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
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -142,8 +142,7 @@ SDsuccess
; copy Standard Delivery bootloader into place for T00,S00
lda #<SD_DOS33p
ldx #>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

View File

@ -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
;

View File

@ -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

View File

@ -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
}
;-------------------------------

View File

@ -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

118
src/mods/t00only.a Normal file
View File

@ -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!"
}

View File

@ -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

View File

@ -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

View File

@ -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 #<universalrwts
sta src
jsr Unpack
sta callrwts+1
sta _byte_lo
jsr decrunch
sta jCallRWTS+1
lda #$BD
sta callrwts+2
sta jCallRWTS+2
ldy #$96
.culoop lda nibtable,y
.culoop lda gNIBTable,y
.cu sta $d100,y ; set at runtime
iny
bne .culoop
@ -698,47 +669,14 @@ ChangeSector
;-------------------------------
AnalyzeTrack
lda gTrack
beq _applyToT00
jmp _applyToAll
bne _applyToAll
_applyToT00
jsr AnalyzeT00 ; /src/id/inspect0
!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"
lda #>AnalyzeT00
sta _byte_hi
lda #<AnalyzeT00
sta _byte_lo
jsr decrunch
jsr $2000
_applyToAll
!source "patchers/universale7.a"
!source "patchers/a6bc95.a" ; gIsPascal only
@ -773,122 +711,23 @@ _applyToAll
sec ; set carry if nothing happened
rts
;
; Global variables
;
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
gMode
!byte %00000000 ; bit 7 0=verify, 1=see bit 6
; bit 6 0=demuffin, 1=crack
; set based on main menu choice
gPatchCount
!byte 00 ; int
; number of patches we've applied to this disk
; reset before each operation
; incremented in modify()
gSaidWriting
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set to #TRUE after we print WRITING TO S%s,D%d
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
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
gIsDOS32
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in IDBootloader() after reading T00,S00
gIsBoot0
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in IDBootloader() after reading T00,S00
gIsBoot1
!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
gIsRWTS
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in AnalyzeT00() after reading T00
gIsProDOS
!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
gIsProtDOS
!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
gIsEA
!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
gIsOptimum
!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
gPossibleD5D5F7
!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
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
gUsingRAMDisk
!byte FALSE ; 0=true, 1=false
gRAMDiskRef
!byte 00 ; handle of RAM disk
; non-zero if open
!source "universalrwts.a"
universalrwts
!bin "../build/universalrwts.pak"
!source "unpack.a"
!source "nibtable.a"
AnalyzeT00 ; placeholder to identify stack of packed data
!bin "../build/t00only.pak"
!source "apicode.a"
}
LastMover
!if ($B500 - ((255 + LastMover - FirstMover) & $FF00)) != RELBASE {
!serious "RELBASE requires adjustment to ", ($B500 - ((255 + LastMover - FirstMover) & $FF00))
}
!if ($B500 - ((255 + LastMover - FirstMover) & $FF00)) < LOWPOINT {
!serious "code is too large to fit in available space!"
!if RELBASE = $2000 {
!ifdef PASS2 {
} else { ;PASS2
!set PASS2=1
!warn "RELBASE = ", $B600 - (LastMover - FirstMover)
}
} else {
!if ($B600 - (LastMover - FirstMover)) < LOWPOINT {
!serious "code is too large to fit in available space!"
}
}

View File

@ -4,8 +4,8 @@
; e.g. Video Title Shop, Tomahawk //e
;-------------------------------
!zone {
jsr IDDatasoft
bcs .exit
lda gIsDatasoft
bne .exit
ldy #$06
jsr SearchTrack

View File

@ -10,7 +10,7 @@
; sector 1
lda callrwts+2
lda jCallRWTS+2
sta .cr+1
sec
sbc #$06 ; #$B7 or #$37
@ -55,13 +55,11 @@
.cr lda #$d1 ; set at runtime
cmp #$3D
beq +
lda #<SD_DOS32
ldx #>SD_DOS32
ldx #ID_DOS32
jsr ConstructStandardDelivery
jmp ++
+ lda #<SD_DOS32LO
ldx #>SD_DOS32LO
+ ldx #ID_DOS32LO
jsr ConstructStandardDelivery
++ lda #s_bootwrite

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -5,10 +5,9 @@
; e.g. Phonics Prime Time series
;-------------------------------
!zone {
jsr