Merge pull request #73 from peterferrie/master

support Choplifter copying
This commit is contained in:
4am 2019-04-17 13:48:31 -04:00 committed by GitHub
commit 578365f80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 1205 additions and 726 deletions

View File

@ -7,7 +7,8 @@
SkipTrack SkipTrack
; don't look for whole-track protections on track 0, that's silly ; don't look for whole-track protections on track 0, that's silly
lda gTrack lda gTrack
beq .donotskip sec
beq .linknoskip
; ;
; Electronic Arts protection track? ; Electronic Arts protection track?
; ;
@ -24,6 +25,7 @@ SkipTrack
; Unformatted track? ; Unformatted track?
; ;
jsr IsUnformatted jsr IsUnformatted
.linknoskip
bcs .donotskip bcs .donotskip
; ;
; $F7F6EFEAAB protection track? ; $F7F6EFEAAB protection track?
@ -52,15 +54,12 @@ SkipTrack
; ;
lda gTrack lda gTrack
cmp #$22 cmp #$22
bne + clc
bne .donotskip
lda gIsProDOS lda gIsProDOS
bne + bne .donotskip
lda #TRUE
sta gPossibleGamco sta gPossibleGamco
+ clc
!byte $24 ; hides next SEC
.donotskip .donotskip
sec
rts rts
} }
@ -79,40 +78,40 @@ IsF7F6
lda $C0E9 lda $C0E9
lda #$00 lda #$00
jsr WAIT jsr WAIT
tay
lda #$19 lda #$19
sta nibcount sta nibcount
ldy #$00 jsr .readnib
- lda $C0EC
bpl -
cmp #$F7 cmp #$F7
beq + beq +
.restart iny .restart iny
bne - bne -
dec nibcount dec nibcount
bne - bne -
beq .fail sec
beq .driveoff
+ +
- lda $C0EC jsr .readnib
bpl -
cmp #$F6 cmp #$F6
bne .restart bne .restart
- lda $C0EC jsr .readnib
bpl -
cmp #$EF cmp #$EF
bne .restart bne .restart
- lda $C0EC jsr .readnib
bpl -
cmp #$EE cmp #$EE
bne .restart bne .restart
- lda $C0EC jsr .readnib
bpl -
cmp #$AB cmp #$AB
bne .restart bne .restart
clc clc
!byte $24 ; hides SEC .driveoff
.fail sec
lda $C0E8 lda $C0E8
rts rts
.readnib
- lda $C0EC
bpl -
rts
} }
;------------------------------- ;-------------------------------
@ -250,7 +249,6 @@ xHeredityDog
lda $08FE lda $08FE
clc clc
adc #$04 adc #$04
pha
ldx #$16 ldx #$16
ldy #$4A ldy #$4A
jsr CompareMemory jsr CompareMemory
@ -259,7 +257,6 @@ xHeredityDog
!byte $C0,$10,$FB,$C9,$D5,$D0,$EE,$BD,$8C,$C0,$10,$FB,$C9,$AA,$D0,$E5 !byte $C0,$10,$FB,$C9,$D5,$D0,$EE,$BD,$8C,$C0,$10,$FB,$C9,$AA,$D0,$E5
!byte $A9,$4C,$A0,$00,$99,$00,$95,$88,$D0,$FA,$CE,$46,$BB,$AD,$46,$BB !byte $A9,$4C,$A0,$00,$99,$00,$95,$88,$D0,$FA,$CE,$46,$BB,$AD,$46,$BB
!byte $C9,$07,$D0,$EC,$A9,$18,$8D,$42,$B9,$A9,$0A,$8D,$ED,$B7,$D0,$05 !byte $C9,$07,$D0,$EC,$A9,$18,$8D,$42,$B9,$A9,$0A,$8D,$ED,$B7,$D0,$05
pla
bcs .exit bcs .exit
lda #kSectorOptional lda #kSectorOptional
sta T00S0A sta T00S0A
@ -351,9 +348,8 @@ b4bbcompare
!byte $08,$85,$3D,$85,$43,$A9,$BF,$85 !byte $08,$85,$3D,$85,$43,$A9,$BF,$85
!byte $3F,$A9,$00,$85,$3C,$85,$42,$E6 !byte $3F,$A9,$00,$85,$3C,$85,$42,$E6
!byte $42,$A9,$FE,$85,$3E,$A0,$00,$AD !byte $42,$A9,$FE,$85,$3E,$A0,$00,$AD
bcc + bcs _b4bbexit
jmp _b4bbexit ldy gIsDOS32
+ lda gIsDOS32
beq .dos32 beq .dos32
lda #$55 ; low byte of address that checks address prologue 1 lda #$55 ; low byte of address that checks address prologue 1
sta b4bbmodify+1 sta b4bbmodify+1
@ -368,14 +364,13 @@ b4bbcompare
lda #$B2 ; low byte of address that checks address epilogue 1 lda #$B2 ; low byte of address that checks address epilogue 1
sta b4bbmodify2+1 sta b4bbmodify2+1
ldx #$01 ; track ldx #$01 ; track
ldy #$00 ; sector ;;ldy #$00 ; sector
.all .all
stx gTrack stx gTrack
sty gSector sty gSector
lda #$00 lda #$00
sta gAddress sta gAddress
lda #$0C lda #$0C
clc
adc #BASEPAGE adc #BASEPAGE
sta gAddress+1 sta gAddress+1
jsr ReadSector ; read sector so we can look for 'JMP $B4BB' marker jsr ReadSector ; read sector so we can look for 'JMP $B4BB' marker
@ -386,13 +381,11 @@ b4bbcompare
jsr compare jsr compare
!byte $4C,$BB,$B4 !byte $4C,$BB,$B4
bcs _b4bbexit bcs _b4bbexit
lda gIsDOS32
beq .dos32b
ldx #$02 ; track ldx #$02 ; track
ldy #$02 ; sector ldy #$02 ; sector
bne .allb ; always branches lda gIsDOS32
bne .allb
.dos32b .dos32b
ldx #$02 ; track
ldy #$09 ; sector ldy #$09 ; sector
.allb .allb
stx gTrack stx gTrack
@ -400,7 +393,6 @@ b4bbcompare
jsr ReadSector ; read sector to get address prologue 3 for rest of disk jsr ReadSector ; read sector to get address prologue 3 for rest of disk
bcs _b4bbexit bcs _b4bbexit
lda #$0C lda #$0C
clc
adc #BASEPAGE adc #BASEPAGE
sta x0+2 sta x0+2
x0 lda $FFC2 ; high byte modified at runtime (above) x0 lda $FFC2 ; high byte modified at runtime (above)

View File

@ -48,7 +48,7 @@ flag = $FF ; byte
RELBASE = $2000 ; dummy assignment for first build RELBASE = $2000 ; dummy assignment for first build
; to allow calculation of proper value ; to allow calculation of proper value
} }
LOWPOINT = $4300 ; lowest available address for code LOWPOINT = $4000 ; lowest available address for code
HIGHPOINT = $B200 ; highest available address+1 for code HIGHPOINT = $B200 ; highest available address+1 for code
BASEPAGE = $10 ; Special Delivery tracer assumes BASEPAGE = $10 ; Special Delivery tracer assumes
; this is $10, so don't change it! ; this is $10, so don't change it!

View File

@ -10,7 +10,7 @@
;------------------------------- ;-------------------------------
IDDatasoft IDDatasoft
lda #$00 lda #$00
ldx #$00 tax
ldy #$7E ldy #$7E
jsr compare jsr compare
!byte $01,$4C,$7E,$08,$04,$8A,$0C,$B8 !byte $01,$4C,$7E,$08,$04,$8A,$0C,$B8

View File

@ -17,7 +17,7 @@ IDDavidson
bne .no ; no, give up bne .no ; no, give up
lda gSector ; sector $00? lda gSector ; sector $00?
bne .no ; no, give up bne .no ; no, give up
lda #$00 ; try re-reading the sector but ;;lda #$00 ; try re-reading the sector but
sta $B92E ; ignore data field checksum failure sta $B92E ; ignore data field checksum failure
jsr ReadSector jsr ReadSector
lda #$13 lda #$13

View File

@ -32,7 +32,7 @@ IDDOS33
; Code at $0801 must be standard (with one exception) ; Code at $0801 must be standard (with one exception)
; ;
++ lda #$00 ++ lda #$00
ldx #$00 tax
ldy #$3F ldy #$3F
jsr compare ; if T00,S00,$00 == jsr compare ; if T00,S00,$00 ==
!byte $01 !byte $01

View File

@ -26,16 +26,16 @@ IDBootloader
dex dex
bpl - bpl -
lda gIsInfocom18
bne .check13
lda #s_infocom18 lda #s_infocom18
jsr PrintByID ldx gIsInfocom18
jmp UseUniversal beq .printinfo
.check13 .check13
lda gIs13Sector lda gIs13Sector
bne .sanity bne .sanity
lda #s_13sector lda #s_13sector
.printinfo
jsr PrintByID jsr PrintByID
jmp UseUniversal jmp UseUniversal
@ -74,16 +74,14 @@ IDBootloader
lda #TRUE lda #TRUE
sta gPossibleD5D5F7 sta gPossibleD5D5F7
+ jsr IDDiversi + jsr IDDiversi
bcc .diversi
jsr IDPronto
bcc .pronto
lda #s_dosb0
!byte $2c
.diversi
lda #s_diversidos lda #s_diversidos
!byte $2c bcc .printdos
.pronto jsr IDPronto
lda #s_prontodos lda #s_prontodos
bcc .printdos
lda #s_dosb0
.printdos
jsr PrintByID jsr PrintByID
jmp TraceDOS33 jmp TraceDOS33
; ;
@ -217,18 +215,16 @@ IDBootloader
lda #TRUE lda #TRUE
sta gIsProDOS sta gIsProDOS
jsr IDVolumeName jsr IDVolumeName
bcc + bcs .useuniv
jmp .useuniv
+
; ;
; Dinkey-DOS (ProDOS file structure with DOS 3.3-ish RWTS in language card) ; Dinkey-DOS (ProDOS file structure with DOS 3.3-ish RWTS in language card)
; detectable now because IDVolumeName just read the first sector of the ; detectable now because IDVolumeName just read the first sector of the
; volume directory into memory so we can look for a unique filename ; volume directory into memory so we can look for a unique filename
; ;
jsr IDDinkeyDOS jsr IDDinkeyDOS
bcc + bcs .useuniv
jmp .useuniv lda #s_dinkeydos
+ lda #s_dinkeydos
jsr PrintByID jsr PrintByID
lda #TRUE lda #TRUE
sta gIsDinkeyDOS sta gIsDinkeyDOS

View File

@ -13,7 +13,7 @@
!zone { !zone {
ID8b3 ID8b3
lda #$00 lda #$00
ldx #$00 tax
ldy #$5A ldy #$5A
jsr compare jsr compare
!byte $01,$20,$B3,$08,$D0,$19,$EA,$A5 !byte $01,$20,$B3,$08,$D0,$19,$EA,$A5

View File

@ -16,7 +16,7 @@
!zone { !zone {
IDMECC IDMECC
lda #$00 lda #$00
ldx #$00 tax
ldy #$17 ldy #$17
jsr compare jsr compare
!byte $01,$4C,$1A,$08,$17,$0F,$00,$00 !byte $01,$4C,$1A,$08,$17,$0F,$00,$00

View File

@ -17,7 +17,7 @@ IDPascal
; addresses (e.g. Wizardry I, Sundog Frozen Legacy) ; addresses (e.g. Wizardry I, Sundog Frozen Legacy)
; ;
lda #$00 lda #$00
ldx #$00 tax
ldy #$08 ldy #$08
jsr compare ; if T00,S00,$00 == jsr compare ; if T00,S00,$00 ==
!byte $01 !byte $01

View File

@ -17,7 +17,7 @@ IDProDOS
; Dazzle Draw, SuperPrint II). All of these variants ; Dazzle Draw, SuperPrint II). All of these variants
; will match. ; will match.
lda #$00 lda #$00
ldx #$00 tax
ldy #$05 ldy #$05
jsr compare ; if T00,S00,$00 == jsr compare ; if T00,S00,$00 ==
!byte $01 !byte $01

View File

@ -12,7 +12,7 @@
!zone { !zone {
IDRDOS IDRDOS
lda #$00 lda #$00
ldx #$00 tax
ldy #$0E ldy #$0E
jsr compare ; if T00,S00,$00 == jsr compare ; if T00,S00,$00 ==
!byte $01 !byte $01

View File

@ -15,24 +15,21 @@ Trace
ldy #$01 ldy #$01
jsr CopyMemory jsr CopyMemory
pla pla
tax ldx #0
pla
ldy $B6F8 ldy $B6F8
cpy #$4C cpy #$4C
bne + beq +
sty $B6F8 ; JMP for Disk II controller ldx #3
sta $B6F9 ; lo byte of callback ldy $B6FB
stx $B6FA ; hi byte of callback
jmp $B600
+ ldy $B6FB
cpy #$4C cpy #$4C
bne + bne ++
sty $B6FB ; JMP for IIgs smart controller + sta $B6FA,x ; hi byte of callback
sta $B6FC ; lo byte of callback pla
stx $B6FD ; hi byte of callback sta $B6F9,x ; lo byte of callback
jmp $B600 jmp $B600
+ lda #s_canttrace ; unknown disk controller ++ pla
lda #s_canttrace ; unknown disk controller
jsr PrintByID jsr PrintByID
jmp UseUniversal jmp UseUniversal
} }

View File

@ -10,7 +10,7 @@
!zone { !zone {
IDDOS32 IDDOS32
lda #$00 lda #$00
ldx #$00 tax
ldy #$0F ldy #$0F
jsr compare jsr compare
!byte $01 !byte $01
@ -52,7 +52,7 @@ IDDOS32
!zone { !zone {
IDDOS32LO IDDOS32LO
lda #$00 lda #$00
ldx #$00 tax
ldy #$0F ldy #$0F
jsr compare jsr compare
!byte $01 !byte $01
@ -74,6 +74,11 @@ IDDOS32LO
ldy #$03 ldy #$03
jsr compare jsr compare
!byte $4C,$01,$03; JMP $0301 !byte $4C,$01,$03; JMP $0301
bcc .exit
ldx #$37
ldy #$03
jsr compare
!byte $4C,$01,$03; JMP $0301
.exit rts .exit rts
} }
@ -85,10 +90,11 @@ IDDOS32LO
TraceDOS32 TraceDOS32
lda #<.TraceDOS32b lda #<.TraceDOS32b
ldx #>.TraceDOS32b ldx #>.TraceDOS32b
jmp Trace bne .linktrace
TraceDOS32LO TraceDOS32LO
lda #<.TraceDOS32LOb lda #<.TraceDOS32LOb
ldx #>.TraceDOS32LOb ldx #>.TraceDOS32LOb
.linktrace
jmp Trace jmp Trace
.TraceDOS32b .TraceDOS32b
@ -96,13 +102,19 @@ TraceDOS32LO
sta $0846 sta $0846
lda #>.TraceDOS32c lda #>.TraceDOS32c
sta $0847 sta $0847
jmp $0801 bne .linkjmp
.TraceDOS32LOb .TraceDOS32LOb
lda #<.TraceDOS32c ldy #$00
sta $0842 lda $0837
cmp #$4C
beq +
ldy #$0A
+ lda #<.TraceDOS32c
sta $0838,y
lda #>.TraceDOS32c lda #>.TraceDOS32c
sta $0843 sta $0839,y
.linkjmp
jmp $0801 jmp $0801
.TraceDOS32c .TraceDOS32c
@ -138,7 +150,7 @@ TraceDOS32LO
!byte $85,$3F !byte $85,$3F
!byte $E6,$3F !byte $E6,$3F
!byte $6C,$3E,$00 !byte $6C,$3E,$00
bcs .fail bcs .tryChoplifter
lda $03CC lda $03CC
cmp #$B6 cmp #$B6
beq + beq +
@ -174,6 +186,24 @@ TraceDOS32LO
ldy $0300 ldy $0300
jmp $0301 jmp $0301
.tryChoplifter
lda #$03
ldx #$01
ldy #$10
jsr CompareMemory
!byte $A2,$2E ;LDX #$2E
!byte $9A ;TXS
!byte $84,$48 ;STY $48
!byte $A2,$00 ;LDX #$00
!byte $BC,$00,$03 ;LDY $0300,X
!byte $88 ;DEY
!byte $A9,$EA ;LDA #$EA
!byte $20,$26,$03 ;JSR $0326
bcs .fail
lda #s_choplifter
jsr PrintByID
jmp Choplifter
; something did not match, not comfortable tracing, ; something did not match, not comfortable tracing,
; but we know enough to know that the universal RWTS won't work, ; but we know enough to know that the universal RWTS won't work,
; so we're done ; so we're done
@ -308,13 +338,13 @@ FFer
bne + bne +
iny iny
bne - bne -
tya
ldy jCallRWTS+2 ldy jCallRWTS+2
dey dey
sty .G+2 sty .G+2
dey dey
sty .F+2 sty .F+2
ldy #$00 tay
tya
.F sta $FF00,y .F sta $FF00,y
iny iny
bne .F bne .F

View File

@ -9,7 +9,7 @@
;------------------------------- ;-------------------------------
IDSpecDel IDSpecDel
lda #$00 lda #$00
ldx #$00 tax
ldy #$58 ldy #$58
jsr compare jsr compare
!byte $02,$90,$4A,$C6,$27,$BD,$31,$09 !byte $02,$90,$4A,$C6,$27,$BD,$31,$09
@ -35,7 +35,7 @@ TraceSpecDel
jsr ClearTSBuffer jsr ClearTSBuffer
lda #$00 ; set a marker to see if entire lda #$00 ; set a marker to see if entire
sta $3FFF ; RWTS loads successfully later sta $3FFF ; RWTS loads successfully later
lda #$00 ; save zero page before trace ;; lda #$00 ; save zero page before trace
ldx #$0A ldx #$0A
ldy #$01 ldy #$01
jsr CopyMemory jsr CopyMemory
@ -164,9 +164,10 @@ SDsuccess
jsr IncProgress jsr IncProgress
inc gTrack inc gTrack
lda #$20 lda #$10
ldx #$10 tax
ldy #$10 tay
asl
jsr CopyMemory jsr CopyMemory
jsr WriteTrackNA ; doesn't really write anything in verify-only mode jsr WriteTrackNA ; doesn't really write anything in verify-only mode

205
src/initscan.a Normal file
View File

@ -0,0 +1,205 @@
;-------------------------------
; ScanForDiskII
; scan all slots for things that
; look like Disk II cards
;
; out: all registers clobbered
; all flags clobbered
; DiskIIArray filled with 00 or FF
;-------------------------------
!zone {
ScanForDiskII
lda #$00
sta cmp1
ldx #$07
.fingerprint
txa
ora #$C0
sta cmp1+1
ldy #$01
lda (cmp1),y
cmp #$20
bne .next
ldy #$03
lda (cmp1),y
bne .next
ldy #$05
lda (cmp1),y
cmp #$03
bne .next
ldy #$FF
lda (cmp1),y
bne .next
tya
sta DiskIIArray-1,x
.next
dex
bne .fingerprint
rts
}
!zone {
ScanForRAMDisk
lda #$00
sta iunit
- lda iunit
clc
adc #$10
sta iunit
beq .done
cmp #$80
beq -
pha
and #$70
lsr
lsr
lsr
lsr
tay
pla
ldx DiskIIArray-1,y
bne -
jsr GetVolumeName
bcs -
lda OnlineReturn
beq -
jsr GetVolumeInfo
;watch for RAM disk type
lda filetype
and #$0F
cmp #$0F
bne -
;check for RAM[x] by name
ldy OnlineReturn
cpy #4
beq +
cpy #5
bne -
dey
+
-- lda SlashRAM-1,y
cmp VolumeName-1,y
bne -
dey
bne --
;check free space
;need at least $118 blocks
sec
lda auxtype
sbc blocks
tax
lda auxtype+1
sbc blocks+1
cmp #1
bcc -
bne +
cpx #$18
bcc -
+ lda #TRUE
sta gUsingRAMDisk
.done
rts
SlashRAM !byte $2F, $52, $41, $4D
}
;-------------------------------
; LoadPrefs
; load preferences from file
;
; in: ProDOS must be in memory
;-------------------------------
LoadPrefs
lda #$FF
sta PREFSVER
jsr LoadFile1Shot
!word PREFSFILE
!word PREFSVER
!word PREFSREADLEN
!word PREFSBUFFER
jsr ValidatePrefs
bcc .goodprefs
jmp SavePrefs
.goodprefs
rts
;-------------------------------
; LoadFile1Shot
; load a file into memory all at once,
; using ProDOS MLI calls
;
; in: stack contains 8 bytes of parameters:
; +1 address of pathname
; +3 address of data buffer (to receive file contents)
; +5 [word] maximum length of data to read
; +7 address of ProDOS file buffer
; out: if C set, load failed and A contains error code
; from open or read
; if C clear, load succeeded and ($02) contains
; data loaded from file
; all other flags clobbered
; all registers clobbered
; stack set to next instruction after parameters
;-------------------------------
!zone {
LoadFile1Shot
clc
pla
adc #$08
sta $00
tax
pla
adc #$00
sta $01
pha
txa
pha
ldy #$01
lda ($00),y ; lo byte of pathname
sta mliparam+1
iny
lda ($00),y ; hi byte of pathname
sta mliparam+2
ldy #$07
lda ($00),y ; lo byte of ProDOS file buffer
sta mliparam+3
iny
lda ($00),y ; hi byte of ProDOS file buffer
sta mliparam+4
jsr OpenFile
bcs .loadfile1s ; C set on error
pha ; push file reference number
ldy #$03
lda ($00),y ; lo address of data buffer
sta mliparam+2
iny
lda ($00),y ; hi address of data buffer
sta mliparam+3
iny
lda ($00),y ; lo data length
sta mliparam+4
iny
lda ($00),y ; hi data length
sta mliparam+5
pla ; pull file reference number
jsr ReadFile
php ; save flags from readfile
pha
jsr CloseFile ; always close whether read worked or not
pla
plp ; restore flags from readfile
; (so caller gets codes from read attempt,
; not close)
.loadfile1s
rts
}

View File

@ -7,16 +7,32 @@
; 0A00..0AFF - backup of zero page during Special Delivery tracer, used by RAM disk ; 0A00..0AFF - backup of zero page during Special Delivery tracer, used by RAM disk
; 0B00..0BFF - used by RAM disk ; 0B00..0BFF - used by RAM disk
; 0C00..0CFF - clobbered by Special Delivery tracer ; 0C00..0CFF - clobbered by Special Delivery tracer
; 0D00..0FFF - unused ; 0D00..0EFF - unused
; 0F00..0FFF - backup of page $BF (SaveProDOS, SwapProDOS)
; 1000..1FFF - data buffer for current track ; 1000..1FFF - data buffer for current track
; 2000..35FF - clobbered by Special Delivery tracer ; 2000..35FF - clobbered by Special Delivery tracer
; 3600..3FFF - clobbered by lomem DOS 3.3 / Special Delivery tracers ; 3600..3FFF - clobbered by lomem DOS 3.3 / Special Delivery tracers
; 4000..42FF - backup of zero page, page 3, page $BF (SaveProDOS, SwapProDOS) ; 4000..B1FF - program code
; 4300..B1FF - program code
; B200..BFFF - clobbered by DOS boot tracer (RDOS is B200+, DOS 3.x is B600+) ; B200..BFFF - clobbered by DOS boot tracer (RDOS is B200+, DOS 3.x is B600+)
;------------------------------- ;-------------------------------
;-------------------------------
; SaveProDOS
; saves memory pages used by ProDOS
; pages $BF
; in: none
; out: all flags and registers clobbered
;-------------------------------
!zone {
SaveProDOS
SaveGlobal
lda #$BF
ldx #$0F
ldy #$01
;;jsr CopyMemory ; fall through
}
;------------------------------- ;-------------------------------
; CopyMemory ; CopyMemory
; in: A = source address (high) ; in: A = source address (high)
@ -40,27 +56,6 @@ CopyMemory
rts rts
} }
;-------------------------------
; ClearMemory
; in: A = source address (high)
; X = value to set
; Y = number of pages
; out: all flags and registers clobbered
;-------------------------------
!zone {
ClearMemory
sta .dest+2
txa
ldx #$00
.dest sta $FF00,x
inx
bne .dest
inc .dest+2
dey
bne .dest
rts
}
;------------------------------- ;-------------------------------
; ClearTSBuffer ; ClearTSBuffer
; clear the $1000 byte memory buffer ; clear the $1000 byte memory buffer
@ -72,7 +67,59 @@ ClearTSBuffer
lda #BASEPAGE lda #BASEPAGE
ldx #$00 ldx #$00
ldy #$10 ldy #$10
jmp ClearMemory ;; jmp ClearMemory ; fall through
;-------------------------------
; ClearMemory
; in: A = source address (high)
; X = value to set
; Y = number of pages
; out: all flags and registers clobbered
;-------------------------------
!zone {
ClearMemory
sta .dest+2
.dest stx $FF00
inc .dest+1
bne .dest
inc .dest+2
dey
bne .dest
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
bcc SwapMemory ; branch always
}
;-------------------------------
; SwapProDOS
; saves/restores memory pages used by ProDOS
; pages $BF
; in: none
; out: all flags and registers clobbered
;-------------------------------
SwapProDOS
lda #$BF
ldx #$0F
ldy #$01
sec
;;jsr SwapMemory ; fall through
;------------------------------- ;-------------------------------
; SwapMemory ; SwapMemory
@ -114,76 +161,6 @@ SwapMemory
rts 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
; pages $00, $03, $BF
; in: none
; out: all flags and registers clobbered
;-------------------------------
!zone {
SaveProDOS
lda #$00
ldx #$40
ldy #$01
jsr CopyMemory
lda #$03
ldx #$41
ldy #$01
jsr CopyMemory
SaveGlobal
lda #$BF
ldx #$42
ldy #$01
jsr CopyMemory
.exit
rts
}
;-------------------------------
; SwapProDOS
; saves/restores memory pages used by ProDOS
; pages $00, $03, $BF
; in: none
; out: all flags and registers clobbered
;-------------------------------
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
;------------------------------- ;-------------------------------
; ReorderLogicalToPhysical - reorder pages in ; ReorderLogicalToPhysical - reorder pages in
; track data buffer for disks that expect ; track data buffer for disks that expect

100
src/mli.a
View File

@ -139,21 +139,16 @@ WriteTrackMLI
;------------------------------- ;-------------------------------
!zone { !zone {
SaveFile1Shot SaveFile1Shot
pla
sta $00
pla
sta $01
tax
lda #$0B
clc clc
adc $00 pla
bcc .noinc adc #$0B
inx sta $00
.noinc tax
tay pla
txa adc #$00
sta $01
pha pha
tya txa
pha pha
ldy #$01 ldy #$01
@ -211,85 +206,6 @@ SaveFile1Shot
rts rts
} }
;-------------------------------
; LoadFile1Shot
; load a file into memory all at once,
; using ProDOS MLI calls
;
; in: stack contains 8 bytes of parameters:
; +1 address of pathname
; +3 address of data buffer (to receive file contents)
; +5 [word] maximum length of data to read
; +7 address of ProDOS file buffer
; out: if C set, load failed and A contains error code
; from open or read
; if C clear, load succeeded and ($02) contains
; data loaded from file
; all other flags clobbered
; all registers clobbered
; stack set to next instruction after parameters
;-------------------------------
!zone {
LoadFile1Shot
pla
sta $00
pla
sta $01
tax
lda #$08
clc
adc $00
bcc .noinc
inx
.noinc
tay
txa
pha
tya
pha
ldy #$01
lda ($00),y ; lo byte of pathname
sta mliparam+1
iny
lda ($00),y ; hi byte of pathname
sta mliparam+2
ldy #$07
lda ($00),y ; lo byte of ProDOS file buffer
sta mliparam+3
iny
lda ($00),y ; hi byte of ProDOS file buffer
sta mliparam+4
jsr OpenFile
bcs .loadfile1s ; C set on error
pha ; push file reference number
ldy #$03
lda ($00),y ; lo address of data buffer
sta mliparam+2
iny
lda ($00),y ; hi address of data buffer
sta mliparam+3
iny
lda ($00),y ; lo data length
sta mliparam+4
iny
lda ($00),y ; hi data length
sta mliparam+5
pla ; pull file reference number
jsr ReadFile
php ; save flags from readfile
pha
jsr CloseFile ; always close whether read worked or not
pla
plp ; restore flags from readfile
; (so caller gets codes from read attempt,
; not close)
.loadfile1s
rts
}
;------------------------------- ;-------------------------------
; open file via ProDOS MLI ; open file via ProDOS MLI
; ;

View File

@ -96,7 +96,26 @@ FM lda LastMover - 256,x
lda FM+5 lda FM+5
cmp #(>RELBASE)-((>(RELBASE+255))->RELBASE)-1 cmp #(>RELBASE)-((>(RELBASE+255))->RELBASE)-1
bne FM bne FM
jmp OneTimeSetup
OneTimeSetup
lda $C0E8
jsr SaveProDOS
ldx MACHINEID
cpx #$EA
bne .slotscan
lda #$DF
sta kForceLower
.slotscan
jsr ScanForDiskII
lda DiskIIArray+5
bne .founds6
jmp FatalNoSlot6
.founds6
jsr ScanForRAMDisk
jsr LoadPrefs ; load preferences (if available)
jmp ResetVector
!source "initscan.a"
FirstMover FirstMover
!pseudopc RELBASE { !pseudopc RELBASE {
@ -165,24 +184,6 @@ FirstMover
!source "rwts.a" !source "rwts.a"
!source "standarddelivery.a" !source "standarddelivery.a"
OneTimeSetup
lda $C0E8
jsr SaveProDOS
ldx MACHINEID
cpx #$EA
bne .slotscan
lda #$DF
sta kForceLower
.slotscan
jsr ScanForDiskII
lda DiskIIArray+5
bne .founds6
jmp FatalNoSlot6
.founds6
jsr ScanForRAMDisk
jsr LoadPrefs ; load preferences (if available)
bcc ResetVector
jsr SavePrefs ; save preferences (if possible)
ResetVector ResetVector
lda #<ResetVector lda #<ResetVector
sta $03F2 sta $03F2
@ -411,17 +412,15 @@ ReadWithRWTS
checksector checksector
lda $FFFF ; status of current sector in sector map (modified above) lda $FFFF ; status of current sector in sector map (modified above)
pha
cmp #kSectorCustomFirst ; call a custom routine before deciding what to do with this sector? cmp #kSectorCustomFirst ; call a custom routine before deciding what to do with this sector?
bcc + bcc +
cmp #kSectorCustomLast cmp #kSectorCustomLast
bcs + bcs +
pla
jsr PreReadSector jsr PreReadSector
pha ; replace status (on stack) with new status returned from PreReadSector + pha ; replace status (on stack) with new status returned from PreReadSector
+ cmp #kSectorIgnore ; skip this sector? cmp #kSectorIgnore ; skip this sector?
beq nextsector beq nextsector
+ cmp #kSectorSwitchToBuiltinRWTS ; switch to built-in RWTS before reading this sector? cmp #kSectorSwitchToBuiltinRWTS ; switch to built-in RWTS before reading this sector?
bne + bne +
lda gTriedUniv lda gTriedUniv
beq + beq +
@ -499,18 +498,18 @@ checksector
nextsector nextsector
pla pla
dec checksector+1
lda checksector+1 lda checksector+1
cmp #$FF
bne .nodec bne .nodec
dec checksector+2 dec checksector+2
.nodec .nodec
lda gSector dec checksector+1
sec ldy gSector
sbc #$01 dey
tya
jsr ChangeSector jsr ChangeSector
lda gSector lda gSector
bmi .prevtrack bmi .prevtrack
.linkread
jmp .read jmp .read
.prevtrack .prevtrack
lda #$0F lda #$0F
@ -518,17 +517,16 @@ nextsector
bne + bne +
lda #$0C lda #$0C
+ jsr ChangeSector + jsr ChangeSector
lda gTrack ldy gTrack
sec dey
sbc #$01 tya
jsr ChangeTrack jsr ChangeTrack
jsr IncProgress jsr IncProgress
lda gTrack lda gTrack
bmi .pass bmi Pass
cmp gLastTrack cmp gLastTrack
bcc .pass bcs .linkread
jmp .read Pass
.pass
bit gMode bit gMode
bmi .passwrite bmi .passwrite
lda #s_pass lda #s_pass
@ -545,12 +543,10 @@ nextsector
jsr WriteRAMToDisk jsr WriteRAMToDisk
bcc + bcc +
jmp FatalWriteError jmp FatalWriteError
+ lda gPatchCount + lda #s_passcrack0
beq .passcrack0 ldx gPatchCount
beq .passprint
lda #s_passcrack lda #s_passcrack
!byte $2C ; hide next LDA
.passcrack0
lda #s_passcrack0
.passprint .passprint
jsr PrintByID jsr PrintByID
jmp TheEnd jmp TheEnd
@ -602,17 +598,15 @@ FatalError
jsr PrintByID jsr PrintByID
lda gTrack lda gTrack
cmp #$22 cmp #$22
beq .failont22 bne TheEnd
jmp TheEnd
.failont22 .failont22
lda gSector lda gSector
cmp #$0F cmp #$0F
beq .failont22s0f beq .failont22s0f
ldx gIsDOS32 ldx gIsDOS32
bne + bne TheEnd
cmp #$0C cmp #$0C
beq .failont22s0f bne TheEnd
+ jmp TheEnd
.failont22s0f .failont22s0f
lda #s_fatal220f lda #s_fatal220f
jsr PrintByID jsr PrintByID
@ -708,22 +702,18 @@ WriteTrackNA ; entry point used by Special Delivery tracer
;------------------------------- ;-------------------------------
FatalWriteError FatalWriteError
sta gDisplayBytes ; for use in error messages, if any sta gDisplayBytes ; for use in error messages, if any
cmp #MLI_IOERR tax
beq .ioerr
cmp #MLI_NODEV
beq .nodev
cmp #MLI_WRITEPROT
beq .writeprot
lda #s_othermli
!byte $2C ; hide next LDA
.ioerr
lda #s_writeioerr lda #s_writeioerr
!byte $2C ; hide next LDA cpx #MLI_IOERR
.nodev beq .printerr
lda #s_writenodev lda #s_writenodev
!byte $2C ; hide next LDA cpx #MLI_NODEV
.writeprot beq .printerr
lda #s_writeprot lda #s_writeprot
cpx #MLI_WRITEPROT
beq .printerr
lda #s_othermli
.printerr
pha pha
lda #s_writeerr lda #s_writeerr
jsr PrintByID jsr PrintByID
@ -847,6 +837,7 @@ _applyToAll
!source "patchers/holle.a" ; gIsHolle only !source "patchers/holle.a" ; gIsHolle only
!source "patchers/zoomgrafix.a" ; gIsPhoenix only !source "patchers/zoomgrafix.a" ; gIsPhoenix only
!source "patchers/e7everywhere.a" ; gIsBoot0 || gIsProDOS only !source "patchers/e7everywhere.a" ; gIsBoot0 || gIsProDOS only
!source "patchers/choplifter.a" ; gIsChoplifter only
lda gPatchCount lda gPatchCount
beq .nopatches beq .nopatches
@ -873,6 +864,6 @@ LastMover
} }
} else { } else {
!if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT { !if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT {
!serious "code is too large to fit in available space!" !serious "code end (", HIGHPOINT - (LastMover - FirstMover), ") is below minimum (", LOWPOINT, ")!"
} }
} }

View File

@ -7,11 +7,10 @@
!zone { !zone {
bit gMode ; nothing to do here in verify-only mode bit gMode ; nothing to do here in verify-only mode
bpl .exit bpl .exit
lda gTrack ldx gTrack
cmp #$01 dex
bne .exit bne .exit
lda #$00 txa
ldx #$00
ldy #$23 ldy #$23
jsr compare ; if T01,S00,$00 != jsr compare ; if T01,S00,$00 !=
!byte $AD,$F3,$03,$8D,$F4,$03,$20,$2F !byte $AD,$F3,$03,$8D,$F4,$03,$20,$2F

View File

@ -10,8 +10,7 @@
bit gMode ; nothing to do here in verify-only mode bit gMode ; nothing to do here in verify-only mode
bpl .exit bpl .exit
lda gIsBoot0 ; if DOS 3.3 boot0 loader lda gIsBoot0 ; if DOS 3.3 boot0 loader
bne .exit ora gIsBoot1 ; and DOS 3.3 boot1 loader
lda gIsBoot1 ; and DOS 3.3 boot1 loader
bne .exit bne .exit
lda #$08 lda #$08
ldx #$5A ldx #$5A

443
src/patchers/choplifter.a Normal file
View File

@ -0,0 +1,443 @@
;-------------------------------
; #Choplifter
; insane protection by Roland Gustafsson
; licensed by Broderbund, Gebelli, and others
;
; module by qkumba
;-------------------------------
!zone {
rts ; reachable only via inspect
Choplifter
lda #$00
sta gCommand
sta dct+1
jsr ChangeTrackNW
jsr IncProgress
.read
asl gTrack
jsr ReadChoplifter
lsr gTrack
jsr WriteTrackNA
ldx gTrack
inx
txa
pha
jsr ChangeTrackNW
jsr IncProgress
pla
cmp #$23
bne .read
bit gMode ; done if in verify-only mode
bpl .exit
; start with RDOS as a minimal SD base
; and copy SD code for free
ldx #ID_RDOS13
jsr ConstructStandardDelivery
ldx #$B0
stx $104E ; exit address
stx $1050 ; next-stage addressing
inx
stx $104F ; next-stage addressing
inx
stx $105D ; next-stage addressing
lda #$10
sta modsrc+1
lda #$5E
sta modsrc
ldx #$27
lda #$67
jsr .inittable
lda #$1F
sta modsrc+1
lda #$00
sta modsrc
ldx #$87
lda #$C7
jsr .inittable
dec modsrc+1
ldx #$0F
lda #$27
jsr .inittable
ldx #$47
lda #$87
jsr .inittable2
dec $1E00
lda #$C0
sta $10DD
sta $1EAF
sta $1F7F
ldy #0
- lda .stage2,y
sta $1D00,y
iny
bne -
lda #s_bootwrite
jsr PrintByID
lda #$00
sta gTrack
jsr WriteTrackNA
inc gPatchCount
.exit
jsr .cleanup
jmp Pass
.cleanup
lda $C0E8
lda #$01
sta gCommand
sta dct+1
rts
ReadChoplifter
lda #BASEPAGE
sta modsrc+1
lda #$00
sta modsrc
- jsr ReadSector ; really just seek
lda $C0E9 ; turn the drive back on
; no need for spin-up because we are fast enough
ldx #$04
lda gTrack
beq .settrack00
cmp #$12
bcc .settrack01
cmp #$16
bcc .ignore
beq .readtrack0B
cmp #$3E
bcs .checktrack1E
jsr .readtrack
inc gTrack
lda gTrack
lsr
bcs -
dec gTrack
.ignore
rts
.readtrack0B
.checkkey1
lda KEY
bmi .cancel
jsr .readnib
- cmp #$DD
bne .checkkey1
jsr .readnib
cmp #$F5
bne -
jsr .readnib
cmp #$D5
bne - ; this had the same bug (see below)
ldx #$03
- jsr .read4x4
jsr .read4x4
jsr .read4x4
sta cmp1+0,x
dex
bpl -
rts
.checktrack1E
cmp #$40
bcs .checktrack20
rts
.cancel
jsr .cleanup
jmp Cancel
.settrack00
lda #$D5
sta cmp1+1
sta cmp2+1
lda #$DD
sta cmp1+0
sta cmp2+0
!byte $2C
.settrack01
ldx #$08
.readtrack
stx tmpx
ldx #3
.retry0
dex
beq .fatal
.checkkey0
lda KEY
.linkcancel2
bmi .cancel
jsr .readnib
- cmp cmp2+1
bne .checkkey0
jsr .readnib
cmp cmp2+0
bne -
jsr .readnib
eor cmp1+1
bne - ; this had a bug
; it branched to the middle nibble instead of the first one
; it allowed PR0 PR1 [any] PR1 PR2 instead of requiring PR0 PR1 PR2
tay
-- jsr .read4x4
sta (modsrc), y
iny
bne --
- lda $C0EC
bpl -
cmp cmp1+0
bne .retry0
inc modsrc+1
dec tmpx
bne --
jsr .readnib
sta cmp1+1 ; prologue 3
jsr .readnib
sta cmp2+0 ; prologue 2
jsr .readnib
sta cmp2+1 ; prologue 1
jsr .readnib
sta cmp1+0 ; epilog
rts
.fatal
jsr .cleanup
; if we get to here, we've
jmp FatalError ; decided the read error is fatal
.checktrack20
beq .readtrack20
cmp #$44
beq .readtrack22
rts
.readtrack20
ldx #1
jsr .readtrack
lda (BASEPAGE<<8)+$C5
sta .prolog1+1
lda (BASEPAGE<<8)+$CC
sta .prolog2+1
lda (BASEPAGE<<8)+$D3
sta .prolog3+1
.checkkey2
lda KEY
bmi .linkcancel2
jsr .readnib
.prolog1
- cmp #$D1 ; SMC
bne .checkkey2
jsr .readnib
.prolog2
cmp #$D1 ; SMC
bne -
jsr .readnib
.prolog3
eor #$D1 ; SMC
bne - ; this had the same bug
tax
-- lda $C0EC ; timing issue requires unrolling part of this
bpl --
sec
rol
sta tmp
jsr .readnib
and tmp
sta (BASEPAGE+8)<<8,x
inx
jsr .read4x4
sta (BASEPAGE+8)<<8,x
inx
jsr .readnib
sec
rol
sta tmp
- lda $C0EC
bpl -
and tmp
sta (BASEPAGE+8)<<8,x
inx
cmp #$EA
bne --
rts
.readtrack22
ldx #$40
ldy #0
-- dey
bne +
dex
beq ++
+ jsr .readnib
- cmp #$D5
bne --
jsr .readnib
cmp #$FF
bne -
jsr .readnib
cmp #$DD
bne - ; this had the same bug
ldx #$00
- jsr .read4x4
sta BASEPAGE<<8,x
inx
bne -
++ rts
.read4x4
- lda $C0EC
bpl -
sec
rol
sta tmp
- lda $C0EC
bpl -
and tmp
rts
.readnib
- lda $C0EC
bpl -
rts
.inittable
ldy #$08
.inittable2
sta tmp
.buildtable
txa
sta (modsrc),y
dex
iny
tya
and #$0F
cmp #$0F
bne .buildtable
tya
sbc #$0F
tay
txa
sta (modsrc),y
tya
adc #$18-1 ; carry set by sbc
tay
txa
adc #$0F
tax
cmp tmp
bne .buildtable
rts
.stage2 !pseudopc $B000 { ; high address that won't be hit on the first round of SD
lda $c057
lda $c054
lda $c052
lda $c050
ldx #$42
txs
lda #>(.resume-1)
pha
lda #<(.resume-1)
pha
jmp $4000
.resume
ldx #0
- lda .stager,x
sta $500,x
lda (*+$ff) and $ff00,x
sta $200,x
lda (*+$1ff) and $ff00,x
sta $400,x
txs
inx
bne -
jsr .dostep4
ldy #2 ; pagehi, first table
sty $807
ldy #$60 ; rts
sty $84c
ldx $2b
jsr .callSD ; including original $8xx to $7xx
asl $807 ; 4xx, second table
jmp $500
.stager !pseudopc $500 {
jsr .callSD
jsr .step
lda #$60 ; rts
sta $801
; to enable writing requires finding three spare pages
; that is common to all games. I did not succeed.
; for that reason, auto-crack is read-only.
sta $207
lda #4
sta $27
jsr $823 ; read patch table to $400
ldy #0 ; avoid CFFA bug (Y is not zero on return)
- lda $400,y
sta .patcher+1
lda $401,y
sta .patcher+2
lda $402,y
iny
iny
iny
.patcher
sta $d1d1
cmp #$ea
bne -
jsr .dostep2 ; reach track $22
sta $3d
dec $27
jsr $823 ; read high scores to $400
ldy #0 ; avoid CFFA bug (Y is not zero on return)
- lda $700,y
sta $800,y
iny
bne -
lda $C088,x
jmp ($20)
.callSD
sta $806 ; pagelo
ldy #$ff
jsr $805
beq .step
.dostep4
jsr .dostep2
.dostep2
jsr .step
.step
jsr $82F
lsr $40
rts
} ;$5xx
} ;$Bxxx
}

View File

@ -29,8 +29,7 @@
; additional samples.) ; additional samples.)
; ;
lda gIsBoot0 lda gIsBoot0
bne .exit ora gPossibleD5D5F7
lda gPossibleD5D5F7
bne .exit bne .exit
+ ldy #$20 + ldy #$20

View File

@ -12,7 +12,7 @@
lda #$01 lda #$01
ldx #$EE ldx #$EE
ldy #$01 tay
jsr compare ; and T00,S01,$EE == jsr compare ; and T00,S01,$EE ==
!byte $FB !byte $FB
bcs .exit bcs .exit
@ -27,8 +27,7 @@
beq .yes beq .yes
lda gIsPanglosDOS lda gIsPanglosDOS
bne + ora gCapturedDiskVolumeNumber
lda gCapturedDiskVolumeNumber
bne + bne +
lda gDiskVolumeNumber lda gDiskVolumeNumber
cmp #$FE cmp #$FE

View File

@ -10,8 +10,8 @@
bpl .exit bpl .exit
lda gIsDOS32 lda gIsDOS32
bne .exit bne .exit
lda gTrack ldx gTrack
cmp #$01 dex
bne .exit bne .exit
lda #$08 lda #$08
ldx #$D6 ldx #$D6

View File

@ -11,8 +11,8 @@
bpl .exit bpl .exit
lda gIsBoot0 lda gIsBoot0
bne .exit bne .exit
lda gTrack ldx gTrack
cmp #$01 dex
bne .exit bne .exit
ldy #(@search1end-@search1start) ldy #(@search1end-@search1start)

View File

@ -18,8 +18,7 @@
- jmp .exit - jmp .exit
+ bvc - ; nothing to do here in demuffin mode + bvc - ; nothing to do here in demuffin mode
lda gIsHolle lda gIsHolle
beq + bne -
jmp .exit
+ lda gTrack + lda gTrack
bne + bne +
jmp .DecryptBootloader jmp .DecryptBootloader
@ -246,11 +245,11 @@
EOR $01 EOR $01
AND #$01 AND #$01
.alternatingTrackEnd .alternatingTrackEnd
bcs + bcs .exit
ldy #$01 ldy #$01
jsr modify jsr modify
!byte $A9 ; EOR -> LDA so alternating track check always passes !byte $A9 ; EOR -> LDA so alternating track check always passes
+
jmp .exit jmp .exit
.reorderAndExit .reorderAndExit
jsr ReorderBuffer jsr ReorderBuffer

View File

@ -8,8 +8,7 @@
bit gMode ; nothing to do here in verify-only mode bit gMode ; nothing to do here in verify-only mode
bpl .exit bpl .exit
lda gIsBoot0 ; if DOS 3.3 boot0 loader lda gIsBoot0 ; if DOS 3.3 boot0 loader
bne .exit ora gIsBoot1 ; and DOS 3.3 boot1 loader
lda gIsBoot1 ; and DOS 3.3 boot1 loader
bne .exit bne .exit
lda #$0D lda #$0D
ldx #$4D ldx #$4D

View File

@ -52,7 +52,7 @@
jsr PrintByID jsr PrintByID
lda #$03 lda #$03
ldx #$00 ldx #$00
ldy #$03 tay
jsr modify ; then set T02,S03,$00 = jsr modify ; then set T02,S03,$00 =
!byte $4C,$84,$9D !byte $4C,$84,$9D
.exit .exit

View File

@ -10,12 +10,11 @@
lda gTrack lda gTrack
cmp #$02 cmp #$02
bne .exit bne .exit
lda gIsDOS32 lda #$03
ldx gIsDOS32
bne + bne +
lda #$0A lda #$0A
!byte $2C ; hide next LDA + sta gDisplayBytes
+ lda #$03
sta gDisplayBytes
ldx #$D7 ldx #$D7
ldy #$04 ldy #$04
jsr compare ; and T02,S0x,$D7 == jsr compare ; and T02,S0x,$D7 ==

View File

@ -10,7 +10,6 @@ _jmpbbfe
bpl .exit bpl .exit
lda gIsBoot0 ; if DOS 3.3 boot0 loader lda gIsBoot0 ; if DOS 3.3 boot0 loader
bne .exit bne .exit
lda #$00
ldx #$4A ldx #$4A
ldy #$03 ldy #$03
jsr compare ; and T00,S00,$4A == jsr compare ; and T00,S00,$4A ==

View File

@ -19,14 +19,11 @@
!byte $C9,$BE !byte $C9,$BE
!byte $D0,$E5 !byte $D0,$E5
bcs .exit bcs .exit
inx tay
inx txa
inx adc #8
inx tax
inx tya
inx
inx
inx
ldy #$01 ldy #$01
jsr modify ; change BNE to continue instead jsr modify ; change BNE to continue instead
!byte $00 !byte $00

View File

@ -18,17 +18,11 @@
!byte $20,$10,$30,WILDCARD,$AA,$EB !byte $20,$10,$30,WILDCARD,$AA,$EB
bcs + bcs +
sta gDisplayBytes sta gDisplayBytes
inx tay
inx txa
inx adc #$0B
inx tax
inx tya
inx
inx
inx
inx
inx
inx
ldy #$01 ldy #$01
jsr compare jsr compare
!byte $DE !byte $DE
@ -44,25 +38,11 @@
!byte $02,$18,$24,$38,$60 !byte $02,$18,$24,$38,$60
bcs + bcs +
sta gDisplayBytes sta gDisplayBytes
inx tay
inx txa
inx adc #$13
inx tax
inx tya
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
ldy #$01 ldy #$01
jsr compare jsr compare
!byte $38 !byte $38
@ -81,28 +61,11 @@
!byte $C9,$DE,$F0,$02,$18,$24,$38,$60 !byte $C9,$DE,$F0,$02,$18,$24,$38,$60
bcs + bcs +
sta gDisplayBytes sta gDisplayBytes
inx tay
inx txa
inx adc #$16
inx tax
inx tya
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
ldy #$01 ldy #$01
jsr compare jsr compare
!byte $38 !byte $38
@ -121,16 +84,11 @@
!byte $38 !byte $38
!byte $60 !byte $60
bcs + bcs +
inx tay
inx txa
inx adc #$0A
inx tax
inx tya
inx
inx
inx
inx
inx
ldy #$01 ldy #$01
jsr compare jsr compare
!byte $38 !byte $38

View File

@ -23,21 +23,11 @@ _prodosrwts
!byte $38 !byte $38
bcs .exit bcs .exit
sta gDisplayBytes sta gDisplayBytes
inx tay
inx txa
inx adc #$0F
inx tax
inx tya
inx
inx
inx
inx
inx
inx
inx
inx
inx
inx
ldy #$01 ldy #$01
jsr compare jsr compare
!byte $DE !byte $DE

View File

@ -152,7 +152,7 @@
; ;
lda #$01 lda #$01
ldx #$07 ldx #$07
ldy #$01 tay
jsr modify ; set T00,S01,$07 = jsr modify ; set T00,S01,$07 =
!byte $2C !byte $2C

View File

@ -10,8 +10,7 @@
bit gMode ; nothing to do here in verify-only mode bit gMode ; nothing to do here in verify-only mode
bpl .exit bpl .exit
lda gIsBoot0 ; if DOS 3.3 boot0 loader lda gIsBoot0 ; if DOS 3.3 boot0 loader
bne .exit ora gIsBoot1 ; and DOS 3.3 boot1 loader
lda gIsBoot1 ; and DOS 3.3 boot1 loader
bne .exit bne .exit
lda #$04 lda #$04
ldx #$69 ldx #$69

View File

@ -12,8 +12,8 @@
!zone { !zone {
bit gMode ; nothing to do here in verify-only mode bit gMode ; nothing to do here in verify-only mode
bpl .exit bpl .exit
lda gTrack ; and track 1 ldx gTrack ; and track 1
cmp #$01 dex
bne .exit bne .exit
lda #$04 lda #$04
ldx #$52 ldx #$52

View File

@ -54,9 +54,8 @@ universale7
!byte $00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00
!byte $00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00
!byte $00,$00,$00,$00,$00,$00,$00,$00 !byte $00,$00,$00,$00,$00,$00,$00,$00
bcc + bcs .nextsector
jmp .nextsector
+
lda .sector+1 lda .sector+1
sta gDisplayBytes sta gDisplayBytes
lda #s_e7 lda #s_e7

View File

@ -20,22 +20,6 @@ DRIVE !byte $FF
!text "+---PREFS VERSION (DO NOT CHANGE)",$8D !text "+---PREFS VERSION (DO NOT CHANGE)",$8D
PREFSWRITELEN = *-PREFSVER PREFSWRITELEN = *-PREFSVER
;-------------------------------
; LoadPrefs
; load preferences from file
;
; in: ProDOS must be in memory
;-------------------------------
LoadPrefs
lda #$FF
sta PREFSVER
jsr LoadFile1Shot
!word PREFSFILE
!word PREFSVER
!word PREFSREADLEN
!word PREFSBUFFER
jmp ValidatePrefs
;------------------------------- ;-------------------------------
; SavePrefs ; SavePrefs
; save preferences to file ; save preferences to file

View File

@ -14,15 +14,14 @@ kForceLower !byte $FF ; AND mask for lowercase letters
;------------------------------- ;-------------------------------
!zone { !zone {
PrintByID PrintByID
stx .x stx .x+1
ldy #0 ; substitution mode flag ldy #0 ; substitution mode flag
cmp #STRINGCOUNT cmp #STRINGCOUNT
bcs .error bcs .error
asl
tax tax
lda StringTable,x lda StringTableLow,x
sta .print+1 sta .print+1
lda StringTable+1,x lda StringTableHigh,x
sta .print+2 sta .print+2
.print .print
lda $FFFF ; modified at runtime lda $FFFF ; modified at runtime
@ -83,9 +82,8 @@ PrintByID
.done .done
clc clc
.error .error
ldx .x .x ldx #$d1
rts rts
.x !byte 00
;------------------------------- ;-------------------------------
; PrintByte ; PrintByte
@ -98,15 +96,9 @@ PrintByID
; @tmpy clobbered ; @tmpy clobbered
;------------------------------- ;-------------------------------
PrintByte PrintByte
sta tmpa jsr .saveAXY
stx tmpx
sty tmpy
jsr PRBYTE jsr PRBYTE
lda tmpa jmp .loadAXY
ldx tmpx
ldy tmpy
clv
rts
;------------------------------- ;-------------------------------
; PrintA ; PrintA
@ -119,16 +111,22 @@ PrintByte
; @tmpy clobbered ; @tmpy clobbered
;------------------------------- ;-------------------------------
PrintA PrintA
sta tmpa jsr .saveAXY
stx tmpx
sty tmpy
jsr COUT jsr COUT
.loadAXY
lda tmpa lda tmpa
ldx tmpx ldx tmpx
ldy tmpy ldy tmpy
clv clv
rts rts
.saveAXY
sta tmpa
stx tmpx
sty tmpy
rts
;------------------------------- ;-------------------------------
; ClearScreen ; ClearScreen
;------------------------------- ;-------------------------------
@ -146,17 +144,16 @@ ClearScreen
ldy #$00 ldy #$00
sty flag sty flag
.loop .loop
lda $FF00,y ; modified at runtime ldx $FF00,y ; modified at runtime
cmp #$A0 cpx #$A0
beq .nochange beq .nochange
bcs .down bcs .down
clc inx
adc #$01
bne .change bne .change
.down .down
sec dex
sbc #$01
.change .change
txa
sta $FF00,y ; modified at runtime sta $FF00,y ; modified at runtime
sta flag sta flag
.nochange .nochange

View File

@ -199,5 +199,6 @@ _track !byte $00
_sector !byte $00 _sector !byte $00
!word dct !word dct
gAddress !word $1F00 gAddress !word $1F00
!byte $00,$00,$01,$00,$FE,$60,$01,$00,$00 !byte $00,$00
gCommand !byte $01,$00,$FE,$60,$01,$00,$00
dct !byte $00,$01,$EF,$D8,$00 dct !byte $00,$01,$EF,$D8,$00

View File

@ -1,46 +1,6 @@
DiskIIArray DiskIIArray
!byte 00,00,00,00,00,00,00 !byte 00,00,00,00,00,00,00
;-------------------------------
; ScanForDiskII
; scan all slots for things that
; look like Disk II cards
;
; out: all registers clobbered
; all flags clobbered
; DiskIIArray filled with 00 or FF
;-------------------------------
!zone {
ScanForDiskII
lda #$00
sta cmp1
ldx #$07
.fingerprint
txa
ora #$C0
sta cmp1+1
ldy #$01
lda (cmp1),y
cmp #$20
bne .next
ldy #$03
lda (cmp1),y
bne .next
ldy #$05
lda (cmp1),y
cmp #$03
bne .next
ldy #$FF
lda (cmp1),y
bne .next
tya
sta DiskIIArray-1,x
.next
dex
bne .fingerprint
rts
}
;------------------------------- ;-------------------------------
; NextSlot ; NextSlot
;------------------------------- ;-------------------------------
@ -76,74 +36,3 @@ NextSlot
.reallydone .reallydone
rts rts
} }
!zone {
ScanForRAMDisk
lda #$00
sta iunit
- lda iunit
clc
adc #$10
sta iunit
beq .done
cmp #$80
beq -
pha
and #$70
lsr
lsr
lsr
lsr
tay
pla
ldx DiskIIArray-1,y
bne -
jsr GetVolumeName
bcs -
lda OnlineReturn
beq -
jsr GetVolumeInfo
;watch for RAM disk type
lda filetype
and #$0F
cmp #$0F
bne -
;check for RAM[x] by name
ldy OnlineReturn
cpy #4
beq +
cpy #5
bne -
dey
+
-- lda SlashRAM-1,y
cmp VolumeName-1,y
bne -
dey
bne --
;check free space
;need at least $118 blocks
sec
lda auxtype
sbc blocks
tax
lda auxtype+1
sbc blocks+1
cmp #1
bcc -
bne +
cpx #$18
bcc -
+ lda #TRUE
sta gUsingRAMDisk
.done
rts
SlashRAM !byte $2F, $52, $41, $4D
}

View File

@ -15,124 +15,246 @@ k_redo_with_ignore = $92; <Ctrl-R>
!source "strings/enid.a" !source "strings/enid.a"
!zone { !zone {
StringTable StringTableLow
!word .header !byte <.header
!word .mainmenu !byte <.mainmenu
!word .progbar !byte <.progbar
!word .reading !byte <.reading
!word .diskrwts !byte <.diskrwts
!word .bb00 !byte <.bb00
!word .sunburst !byte <.sunburst
!word .optimum !byte <.optimum
!word .builtin !byte <.builtin
!word .switch !byte <.switch
!word .writing !byte <.writing
!word .unformat !byte <.unformat
!word .f7 !byte <.f7
!word .sync !byte <.sync
!word .optbad !byte <.optbad
!word .passver !byte <.passver
!word .passdemuf !byte <.passdemuf
!word .passcrack !byte <.passcrack
!word .passcrack0 !byte <.passcrack0
!word .fail !byte <.fail
!word .fatal0000 !byte <.fatal0000
!word .fatal220f !byte <.fatal220f
!word .done !byte <.done
!word .noslot6 !byte <.noslot6
!word .writeerr !byte <.writeerr
!word .writeioerr !byte <.writeioerr
!word .writenodev !byte <.writenodev
!word .writeprot !byte <.writeprot
!word .othermli !byte <.othermli
!word .canttrace !byte <.canttrace
!word .canceled !byte <.canceled
!word .bademu !byte <.bademu
!word .reset !byte <.reset
!word .modify !byte <.modify
!word .modifyto !byte <.modifyto
!word .dos33boot0 !byte <.dos33boot0
!word .prodosboot0 !byte <.prodosboot0
!word .pascalboot0 !byte <.pascalboot0
!word .mecc !byte <.mecc
!word .sierra !byte <.sierra
!word .a6bc95 !byte <.a6bc95
!word .jmpbcf0 !byte <.jmpbcf0
!word .rol1e !byte <.rol1e
!word .runhello !byte <.runhello
!word .e7 !byte <.e7
!word .jmpb4bb !byte <.jmpb4bb
!word .jmpb400 !byte <.jmpb400
!word .jmpbeca !byte <.jmpbeca
!word .bb03 !byte <.bb03
!word .thunder !byte <.thunder
!word .jmpae8e !byte <.jmpae8e
!word .diskvol !byte <.diskvol
!word .d5d5f7 !byte <.d5d5f7
!word .construct !byte <.construct
!word .datasoftb0 !byte <.datasoftb0
!word .datasoft !byte <.datasoft
!word .lsr6a !byte <.lsr6a
!word .bcs08 !byte <.bcs08
!word .jmpb660 !byte <.jmpb660
!word .protdos !byte <.protdos
!word .decryptrwts !byte <.decryptrwts
!word .protserial !byte <.protserial
!word .fbff !byte <.fbff
!word .encoded44 !byte <.encoded44
!word .encoded53 !byte <.encoded53
!word .specdel !byte <.specdel
!word .bytrack !byte <.bytrack
!word .a5count !byte <.a5count
!word .restart !byte <.restart
!word .corrupter !byte <.corrupter
!word .eaboot0 !byte <.eaboot0
!word .eatrk6 !byte <.eatrk6
!word .eeef !byte <.eeef
!word .poke !byte <.poke
!word .bootcounter !byte <.bootcounter
!word .milliken !byte <.milliken
!word .jsr8b3 !byte <.jsr8b3
!word .daviddos !byte <.daviddos
!word .quickdos !byte <.quickdos
!word .diversidos !byte <.diversidos
!word .prontodos !byte <.prontodos
!word .jmpb412 !byte <.jmpb412
!word .laureate !byte <.laureate
!word .bbf9 !byte <.bbf9
!word .micrograms !byte <.micrograms
!word .cmpbne0 !byte <.cmpbne0
!word .writeram !byte <.writeram
!word .d5timing !byte <.d5timing
!word .advint !byte <.advint
!word .dos32boot0 !byte <.dos32boot0
!word .bootwrite !byte <.bootwrite
!word .rwtswrite !byte <.rwtswrite
!word .rdos !byte <.rdos
!word .sra !byte <.sra
!word .muse !byte <.muse
!word .origin !byte <.origin
!word .volumename !byte <.volumename
!word .dinkeydos !byte <.dinkeydos
!word .trillium !byte <.trillium
!word .tamper !byte <.tamper
!word .microfun !byte <.microfun
!word .advent !byte <.advent
!word .gathering !byte <.gathering
!word .davidson !byte <.davidson
!word .rdos13 !byte <.rdos13
!word .ssi !byte <.ssi
!word .aacount !byte <.aacount
!word .infocom18 !byte <.infocom18
!word .toverify !byte <.toverify
!word .sector13 !byte <.sector13
!word .dakin5 !byte <.dakin5
!word .springboard !byte <.springboard
!word .hallabs !byte <.hallabs
!word .holle !byte <.holle
!word .hoffman !byte <.hoffman
!word .diskvol0 !byte <.diskvol0
!word .e7everywhere !byte <.e7everywhere
!byte <.choplifter
StringTableHigh
!byte >.header
!byte >.mainmenu
!byte >.progbar
!byte >.reading
!byte >.diskrwts
!byte >.bb00
!byte >.sunburst
!byte >.optimum
!byte >.builtin
!byte >.switch
!byte >.writing
!byte >.unformat
!byte >.f7
!byte >.sync
!byte >.optbad
!byte >.passver
!byte >.passdemuf
!byte >.passcrack
!byte >.passcrack0
!byte >.fail
!byte >.fatal0000
!byte >.fatal220f
!byte >.done
!byte >.noslot6
!byte >.writeerr
!byte >.writeioerr
!byte >.writenodev
!byte >.writeprot
!byte >.othermli
!byte >.canttrace
!byte >.canceled
!byte >.bademu
!byte >.reset
!byte >.modify
!byte >.modifyto
!byte >.dos33boot0
!byte >.prodosboot0
!byte >.pascalboot0
!byte >.mecc
!byte >.sierra
!byte >.a6bc95
!byte >.jmpbcf0
!byte >.rol1e
!byte >.runhello
!byte >.e7
!byte >.jmpb4bb
!byte >.jmpb400
!byte >.jmpbeca
!byte >.bb03
!byte >.thunder
!byte >.jmpae8e
!byte >.diskvol
!byte >.d5d5f7
!byte >.construct
!byte >.datasoftb0
!byte >.datasoft
!byte >.lsr6a
!byte >.bcs08
!byte >.jmpb660
!byte >.protdos
!byte >.decryptrwts
!byte >.protserial
!byte >.fbff
!byte >.encoded44
!byte >.encoded53
!byte >.specdel
!byte >.bytrack
!byte >.a5count
!byte >.restart
!byte >.corrupter
!byte >.eaboot0
!byte >.eatrk6
!byte >.eeef
!byte >.poke
!byte >.bootcounter
!byte >.milliken
!byte >.jsr8b3
!byte >.daviddos
!byte >.quickdos
!byte >.diversidos
!byte >.prontodos
!byte >.jmpb412
!byte >.laureate
!byte >.bbf9
!byte >.micrograms
!byte >.cmpbne0
!byte >.writeram
!byte >.d5timing
!byte >.advint
!byte >.dos32boot0
!byte >.bootwrite
!byte >.rwtswrite
!byte >.rdos
!byte >.sra
!byte >.muse
!byte >.origin
!byte >.volumename
!byte >.dinkeydos
!byte >.trillium
!byte >.tamper
!byte >.microfun
!byte >.advent
!byte >.gathering
!byte >.davidson
!byte >.rdos13
!byte >.ssi
!byte >.aacount
!byte >.infocom18
!byte >.toverify
!byte >.sector13
!byte >.dakin5
!byte >.springboard
!byte >.hallabs
!byte >.holle
!byte >.hoffman
!byte >.diskvol0
!byte >.e7everywhere
!byte >.choplifter
; ;
; Text can contain substitution strings, which ; Text can contain substitution strings, which
; are replaced by current values at runtime. Each ; are replaced by current values at runtime. Each
@ -158,7 +280,7 @@ StringTable
; can be set directly before calling PrintByID. ; can be set directly before calling PrintByID.
; ;
.header .header
!text "Passport by 4am 2019-04-13",$00 !text "Passport by 4am 2019-04-15",$00
.mainmenu .mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " " !text " "
@ -486,4 +608,6 @@ StringTable
!text "T%t,S%0 Disk requires volume number 000",$8D,$00 !text "T%t,S%0 Disk requires volume number 000",$8D,$00
.e7everywhere .e7everywhere
!text "T%t,S%0 Found E7 Everywhere protection",$8D,$00 !text "T%t,S%0 Found E7 Everywhere protection",$8D,$00
.choplifter
!text "T00,S01 Found Choplifter protection",$8D,$00
} }

View File

@ -119,4 +119,5 @@ s_holle = $71
s_hoffman = $72 s_hoffman = $72
s_diskvol0 = $73 s_diskvol0 = $73
s_e7everywhere=$74 s_e7everywhere=$74
STRINGCOUNT = $75 s_choplifter = $75
STRINGCOUNT = $76