2017-01-08 03:35:35 +00:00
|
|
|
!cpu 6502
|
|
|
|
*=$2000
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; Passport
|
|
|
|
; a 4am hack
|
2018-09-26 17:20:03 +00:00
|
|
|
; (c) 2016-8 by 4am
|
2017-01-08 03:35:35 +00:00
|
|
|
;
|
|
|
|
; Permission is hereby granted, free of charge, to any
|
|
|
|
; person obtaining a copy of this software and associated
|
|
|
|
; documentation files (the "Software"), to deal in the
|
|
|
|
; Software without restriction, including without limitation
|
|
|
|
; the rights to use, copy, modify, merge, publish,
|
|
|
|
; distribute, sublicense, and/or sell copies of the
|
|
|
|
; furnished to do so, subject to the following conditions:
|
|
|
|
;
|
|
|
|
; The above copyright notice and this permission notice
|
|
|
|
; shall be included in all copies or substantial portions of
|
|
|
|
; the Software.
|
|
|
|
;
|
|
|
|
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
|
|
; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
|
|
; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
|
|
; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
|
|
; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
;
|
|
|
|
;-------------------------------
|
|
|
|
|
2017-11-09 05:47:12 +00:00
|
|
|
!ifndef VERBOSE {
|
|
|
|
VERBOSE = $00 ; set to $01 to display API label addresses
|
|
|
|
}
|
|
|
|
|
2017-01-08 03:35:35 +00:00
|
|
|
; Supported languages
|
|
|
|
; (each has its own localized strings file
|
|
|
|
; and its own output filename)
|
|
|
|
ENGLISH = 1 ; src/strings/en, PASSPORT.SYSTEM
|
|
|
|
FRENCH = 2 ; src/strings/fr, PASSPORT.FR
|
|
|
|
SPANISH = 3 ; src/strings/es, PASSPORT.ES
|
|
|
|
ITALIAN = 4 ; src/strings/it, PASSPORT.IT
|
|
|
|
FINNISH = 5 ; src/strings/fi, PASSPORT.FI
|
|
|
|
|
|
|
|
; Current language for this assembly
|
|
|
|
LANG = ENGLISH
|
|
|
|
|
|
|
|
!if LANG=ENGLISH {
|
|
|
|
!to "../build/PASSPORT.SYSTEM",plain
|
|
|
|
}
|
|
|
|
!if LANG=FRENCH {
|
|
|
|
!to "../build/PASSPORT.FR",plain
|
|
|
|
}
|
|
|
|
!if LANG=SPANISH {
|
|
|
|
!to "../build/PASSPORT.SP",plain
|
|
|
|
}
|
|
|
|
!if LANG=ITALIAN {
|
|
|
|
!to "../build/PASSPORT.IT",plain
|
|
|
|
}
|
|
|
|
!if LANG=FINNISH {
|
|
|
|
!to "../build/PASSPORT.FI",plain
|
|
|
|
}
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; Addresses we read/call
|
|
|
|
TEXTTOP = $22
|
|
|
|
VPOS = $25
|
|
|
|
MLI = $BF00
|
|
|
|
REBOOT = $FAA6
|
|
|
|
TEXT = $FB2F
|
|
|
|
MACHINEID = $FBB3
|
|
|
|
HOME = $FC58
|
|
|
|
WAIT = $FCA8
|
|
|
|
PRBYTE = $FDDA
|
|
|
|
COUT = $FDED
|
|
|
|
PR0 = $FE89
|
|
|
|
IN0 = $FE93
|
|
|
|
|
2017-11-09 05:47:12 +00:00
|
|
|
;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
|
2017-01-08 03:35:35 +00:00
|
|
|
|
2017-11-09 05:47:12 +00:00
|
|
|
!source "apidefs.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
ldx #$00
|
2017-11-09 05:47:12 +00:00
|
|
|
FM lda LastMover - 256,x
|
2018-09-26 17:20:03 +00:00
|
|
|
sta HIGHPOINT-$100,x
|
2017-01-08 03:35:35 +00:00
|
|
|
inx
|
|
|
|
bne FM
|
2017-01-30 22:10:41 +00:00
|
|
|
dec FM+2
|
|
|
|
dec FM+5
|
2017-11-09 05:47:12 +00:00
|
|
|
lda FM+5
|
|
|
|
cmp #(>RELBASE)-((>(RELBASE+255))->RELBASE)-1
|
2017-01-08 03:35:35 +00:00
|
|
|
bne FM
|
|
|
|
jmp OneTimeSetup
|
|
|
|
|
2017-01-30 22:10:41 +00:00
|
|
|
FirstMover
|
|
|
|
!pseudopc RELBASE {
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone
|
2017-01-08 03:35:35 +00:00
|
|
|
; use localized strings based on current language
|
|
|
|
|
|
|
|
!if LANG=ENGLISH {
|
|
|
|
!source "strings/en.a"
|
|
|
|
}
|
|
|
|
!if LANG=FRENCH {
|
|
|
|
!source "strings/fr.a"
|
|
|
|
}
|
|
|
|
!if LANG=SPANISH {
|
|
|
|
!source "strings/es.a"
|
|
|
|
}
|
|
|
|
!if LANG=ITALIAN {
|
|
|
|
!source "strings/it.a"
|
|
|
|
}
|
|
|
|
!if LANG=FINNISH {
|
|
|
|
!source "strings/fi.a"
|
|
|
|
}
|
|
|
|
|
|
|
|
!source "analyze.a"
|
|
|
|
!source "id/inspect0.a"
|
2017-05-04 14:54:59 +00:00
|
|
|
!source "id/trace.a"
|
2017-08-15 15:31:36 +00:00
|
|
|
!source "id/trace33.a"
|
|
|
|
!source "id/trace32.a"
|
|
|
|
!source "id/trace8b3.a"
|
|
|
|
!source "id/trace33p.a"
|
|
|
|
!source "id/dos33.a"
|
2017-05-04 14:54:59 +00:00
|
|
|
!source "id/prodos.a"
|
|
|
|
!source "id/pascal.a"
|
2017-09-07 13:52:27 +00:00
|
|
|
!source "id/rdos.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
!source "id/jsr8b3.a"
|
|
|
|
!source "id/mecc.a"
|
|
|
|
!source "id/datasoft.a"
|
|
|
|
!source "id/protecteddos.a"
|
|
|
|
!source "id/encode44.a"
|
|
|
|
!source "id/encode53.a"
|
2017-01-30 22:10:41 +00:00
|
|
|
!source "id/ea.a"
|
2017-04-05 01:20:05 +00:00
|
|
|
!source "id/milliken.a"
|
2017-05-04 13:42:48 +00:00
|
|
|
!source "id/daviddos.a"
|
2017-05-04 23:51:35 +00:00
|
|
|
!source "id/quickdos.a"
|
2017-05-05 00:25:34 +00:00
|
|
|
!source "id/diversidos.a"
|
2017-05-05 00:36:48 +00:00
|
|
|
!source "id/prontodos.a"
|
2017-05-05 22:06:30 +00:00
|
|
|
!source "id/d5d5f7.a"
|
2017-05-09 00:45:11 +00:00
|
|
|
!source "id/laureate.a"
|
2017-06-20 14:43:17 +00:00
|
|
|
!source "id/micrograms.a"
|
2017-12-06 01:59:55 +00:00
|
|
|
!source "id/volumename.a"
|
2017-12-06 19:12:45 +00:00
|
|
|
!source "id/dinkeydos.a"
|
2018-05-26 04:34:30 +00:00
|
|
|
!source "id/advent.a"
|
2018-06-07 15:18:06 +00:00
|
|
|
!source "id/panglosdos.a"
|
2018-06-16 15:38:26 +00:00
|
|
|
!source "id/davidson.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
!source "print.a"
|
|
|
|
!source "compare.a"
|
|
|
|
!source "modify.a"
|
|
|
|
!source "memory.a"
|
|
|
|
!source "sectormap.a"
|
|
|
|
!source "mli.a"
|
|
|
|
!source "slots.a"
|
|
|
|
!source "prefs.a"
|
|
|
|
!source "keys.a"
|
2017-02-20 03:41:48 +00:00
|
|
|
!source "cffa.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
!source "rwts.a"
|
2017-08-15 15:31:36 +00:00
|
|
|
!source "standarddelivery.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
OneTimeSetup
|
|
|
|
lda $C0E8
|
|
|
|
jsr SaveProDOS
|
|
|
|
ldx MACHINEID
|
|
|
|
cpx #$EA
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .slotscan
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$DF
|
|
|
|
sta kForceLower
|
2017-01-24 00:57:43 +00:00
|
|
|
.slotscan
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr ScanForDiskII
|
|
|
|
lda DiskIIArray+5
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .founds6
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp FatalNoSlot6
|
2017-01-24 00:57:43 +00:00
|
|
|
.founds6
|
2017-05-16 16:14:20 +00:00
|
|
|
jsr ScanForRAMDisk
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr LoadPrefs ; load preferences (if available)
|
|
|
|
bcc ResetVector
|
|
|
|
jsr SavePrefs ; save preferences (if possible)
|
|
|
|
ResetVector
|
|
|
|
lda #<ResetVector
|
|
|
|
sta $03F2
|
|
|
|
lda #>ResetVector
|
|
|
|
sta $03F3
|
|
|
|
eor #$A5
|
|
|
|
sta $03F4
|
|
|
|
lda $C0E8
|
|
|
|
jsr PR0
|
|
|
|
jsr IN0
|
|
|
|
sta $C000
|
|
|
|
sta $C002
|
|
|
|
sta $C004
|
|
|
|
sta $C00C
|
|
|
|
sta $C00E
|
|
|
|
MainMenu
|
|
|
|
ldx #$FF
|
|
|
|
txs
|
|
|
|
jsr ClearScreen
|
|
|
|
lda #s_header
|
|
|
|
jsr PrintByID
|
|
|
|
lda #s_mainmenu
|
|
|
|
jsr PrintByID
|
2017-01-24 00:57:43 +00:00
|
|
|
.getkey
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr WaitForKey
|
2017-02-20 03:41:48 +00:00
|
|
|
cmp #$80
|
|
|
|
bne +
|
|
|
|
jsr EnterCFFAIfAvailable
|
|
|
|
bcc ResetVector
|
|
|
|
bcs .getkey
|
2017-07-07 18:12:50 +00:00
|
|
|
+ cmp #$9B ; esc
|
|
|
|
beq .jmptoexit
|
|
|
|
cmp #$91 ; ctrl-Q
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .jmptoexit
|
2017-01-08 03:35:35 +00:00
|
|
|
cmp #k_quit
|
|
|
|
bne +
|
2017-01-24 00:57:43 +00:00
|
|
|
.jmptoexit
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp CleanExit
|
|
|
|
+
|
|
|
|
cmp #k_slot
|
|
|
|
bne +
|
|
|
|
jsr NextSlot
|
|
|
|
lda #TRUE
|
|
|
|
sta gChangedPrefs
|
|
|
|
jmp MainMenu
|
|
|
|
+
|
|
|
|
cmp #k_verify
|
|
|
|
bne +
|
|
|
|
lda #%00000000
|
|
|
|
beq Action ; unconditional branch
|
|
|
|
+
|
|
|
|
cmp #k_demuffin
|
|
|
|
bne +
|
|
|
|
lda #%10000000
|
|
|
|
bne Action ; unconditional branch
|
|
|
|
+
|
|
|
|
cmp #k_crack
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .getkey
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #%11000000
|
|
|
|
|
|
|
|
; note: execution falls through here
|
|
|
|
|
|
|
|
Action
|
|
|
|
sta gMode
|
2017-11-08 17:48:16 +00:00
|
|
|
bpl +
|
|
|
|
jsr CreateRAMFile
|
|
|
|
+ jsr ResetProgress
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr InitSectorMap
|
2018-10-12 23:43:40 +00:00
|
|
|
Reaction
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #FALSE
|
|
|
|
sta gTriedUniv
|
|
|
|
sta gSaidWriting
|
2017-10-26 02:30:21 +00:00
|
|
|
sta gIsProtDOS
|
2018-12-29 06:20:48 +00:00
|
|
|
sta gIsInfocom18
|
|
|
|
sta gIs13Sector
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$00
|
|
|
|
sta gTrack
|
|
|
|
sta gSector
|
|
|
|
sta gPatchCount
|
2017-11-09 05:47:12 +00:00
|
|
|
sta jCallRWTS+1
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$08
|
|
|
|
sta gAddress+1
|
|
|
|
jsr ClearScreen
|
|
|
|
lda #s_header
|
|
|
|
jsr PrintByID
|
|
|
|
lda #s_progbar
|
|
|
|
jsr PrintByID
|
|
|
|
lda VPOS
|
|
|
|
sta TEXTTOP
|
|
|
|
lda #s_reading
|
|
|
|
jsr PrintByID
|
2017-11-10 18:38:31 +00:00
|
|
|
jsr CopyUniversal
|
2017-10-30 01:00:15 +00:00
|
|
|
jsr IgnoreAddressChecksum
|
2017-10-26 02:30:21 +00:00
|
|
|
jsr ReadSector
|
|
|
|
bcc +
|
2018-12-28 19:46:36 +00:00
|
|
|
jsr IDBootFailure ; /src/id/inspect0
|
|
|
|
bcc +
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_fail
|
|
|
|
jsr PrintByID
|
|
|
|
lda #s_fatal0000
|
|
|
|
jsr PrintByID
|
|
|
|
jmp TheEnd
|
2017-10-26 02:30:21 +00:00
|
|
|
+ jmp IDBootloader ; /src/id/inspect0
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
; We are now fairly confident that the RWTS in memory
|
|
|
|
; is normal enough to call, Advanced Demuffin style.
|
|
|
|
;
|
|
|
|
ADStyle
|
|
|
|
jsr IncProgress
|
|
|
|
lda #s_diskrwts
|
|
|
|
jsr PrintByID
|
|
|
|
;
|
|
|
|
; Check for protections in early boot that
|
|
|
|
; might indicate intentional bad sectors
|
|
|
|
; elsewhere in the disk that we should skip,
|
|
|
|
; or changes we need to make to the RWTS
|
|
|
|
; before we start.
|
|
|
|
;
|
|
|
|
jsr xHeredityDog
|
2017-01-24 00:57:43 +00:00
|
|
|
bcs .noDog
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_bb00
|
|
|
|
jsr PrintByID
|
2017-01-24 00:57:43 +00:00
|
|
|
.noDog
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr xSunburst
|
2017-01-24 00:57:43 +00:00
|
|
|
bcs .noSun
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_sunburst
|
|
|
|
jsr PrintByID
|
2017-01-24 00:57:43 +00:00
|
|
|
.noSun
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr xOptimumRes
|
2017-01-24 00:57:43 +00:00
|
|
|
bcs .noOptimum
|
2017-02-10 05:13:35 +00:00
|
|
|
lda #TRUE
|
|
|
|
sta gIsOptimum
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_optimum
|
|
|
|
jsr PrintByID
|
2017-01-24 00:57:43 +00:00
|
|
|
.noOptimum
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr xB660
|
|
|
|
jsr xB4BB
|
|
|
|
jmp ReadWithRWTS
|
|
|
|
|
|
|
|
UseUniversal
|
|
|
|
jsr IncProgress
|
|
|
|
jsr StartWithUniv
|
2017-12-06 19:12:45 +00:00
|
|
|
lda gIsDinkeyDOS
|
2017-12-12 20:43:41 +00:00
|
|
|
bne +
|
|
|
|
;
|
|
|
|
; On Dinkey-DOS disks (e.g. Ultima V, Times of Lore), we start with the
|
|
|
|
; universal RWTS then apply a patch in memory.
|
2017-12-04 05:37:41 +00:00
|
|
|
; These disks use a hybrid RWTS that alters the sector number in the
|
|
|
|
; address field based on the address epilogue. Once we normalize the
|
|
|
|
; sector numbers, no further patches are required, since the RWTS can also
|
|
|
|
; read unprotected disks. A separate patcher finds the actual code that
|
|
|
|
; alters the sector number to print it to the log.
|
2017-12-12 20:43:41 +00:00
|
|
|
;
|
2017-12-04 05:37:41 +00:00
|
|
|
jsr PatchUniversalRWTSForOrigin
|
2017-12-12 20:43:41 +00:00
|
|
|
bmi ReadWithRWTS ; always branches
|
|
|
|
;
|
2018-12-29 06:20:48 +00:00
|
|
|
; On pure 13-sector disks, we just hijack the read routine to perform a
|
|
|
|
; verification instead.
|
|
|
|
;
|
|
|
|
+ lda gIs13Sector
|
|
|
|
bne +
|
|
|
|
lda #<read13
|
|
|
|
sta jCallRWTS+1
|
|
|
|
lda #>read13
|
|
|
|
sta jCallRWTS+2
|
|
|
|
bne ReadWithRWTS ; always branches
|
|
|
|
;
|
2017-12-12 20:43:41 +00:00
|
|
|
; On other disks that use the universal RWTS for the entire disk, we use
|
|
|
|
; an adaptive RWTS that accepts any epilogue on the first sector but then
|
|
|
|
; enforces all other sectors to have the same epilogue.
|
|
|
|
;
|
|
|
|
+ jsr PatchUniversalRWTSForAdaptive
|
|
|
|
;
|
2018-08-09 23:31:26 +00:00
|
|
|
; Disable drive recalibration on bad sectors so we give up on bad sectors
|
|
|
|
; faster and detect unformatted or specially structured tracks faster.
|
|
|
|
;
|
|
|
|
jsr PatchUniversalRWTSForNoRecal
|
|
|
|
;
|
2017-12-12 20:43:41 +00:00
|
|
|
; Some disks have different epilogues on track 0, so we stop using the
|
|
|
|
; adaptive RWTS so we don't falsely accuse those disks of being damaged.
|
|
|
|
;
|
|
|
|
lda #kSectorResetAdaptiveRWTS
|
|
|
|
sta T00S0F
|
|
|
|
;
|
|
|
|
; Some disks have an intentionally invalid checksum on T00,S00 (read by
|
|
|
|
; the drive firmware, which doesn't verify it).
|
|
|
|
;
|
|
|
|
lda #kSectorIgnoreAddressChecksum
|
|
|
|
sta T00S00
|
|
|
|
;
|
2017-01-08 03:35:35 +00:00
|
|
|
; note: execution falls through here
|
2017-12-12 20:43:41 +00:00
|
|
|
;
|
2017-01-08 03:35:35 +00:00
|
|
|
ReadWithRWTS
|
|
|
|
lda #$22
|
|
|
|
jsr ChangeTrackNW
|
|
|
|
lda #$0F
|
2018-12-29 06:20:48 +00:00
|
|
|
ldx gIs13Sector
|
|
|
|
bne +
|
|
|
|
lda #$0C
|
|
|
|
+ jsr ChangeSector
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #<T22S0F
|
|
|
|
sta checksector+1
|
|
|
|
lda #>T22S0F
|
|
|
|
sta checksector+2
|
2017-01-24 00:57:43 +00:00
|
|
|
.read
|
2017-01-08 03:35:35 +00:00
|
|
|
lda KEY
|
2018-12-28 19:46:36 +00:00
|
|
|
bpl .checkinfocom
|
2018-09-26 17:20:03 +00:00
|
|
|
bit STROBE
|
|
|
|
cmp #$e0 ;ignore backtick (MAME debug break)
|
2018-12-28 19:46:36 +00:00
|
|
|
beq .checkinfocom
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp Cancel
|
2018-12-28 19:46:36 +00:00
|
|
|
.checkinfocom
|
|
|
|
lda gIsInfocom18
|
|
|
|
bne checksector
|
|
|
|
jsr VerifyInfocom18
|
|
|
|
bcc .passtrack
|
|
|
|
jmp FatalError
|
|
|
|
.passtrack
|
|
|
|
jmp .prevtrack
|
|
|
|
|
2017-01-08 03:35:35 +00:00
|
|
|
checksector
|
2017-10-02 01:36:43 +00:00
|
|
|
lda $FFFF ; status of current sector in sector map (modified above)
|
2017-01-08 03:35:35 +00:00
|
|
|
pha
|
2017-10-02 01:36:43 +00:00
|
|
|
cmp #kSectorCustomFirst ; call a custom routine before deciding what to do with this sector?
|
|
|
|
bcc +
|
|
|
|
cmp #kSectorCustomLast
|
|
|
|
bcs +
|
2017-12-12 20:43:41 +00:00
|
|
|
pla
|
2018-12-28 19:46:36 +00:00
|
|
|
jsr PreReadSector
|
2017-12-12 20:43:41 +00:00
|
|
|
pha ; replace status (on stack) with new status returned from PreReadSector
|
2017-10-02 01:36:43 +00:00
|
|
|
+ cmp #kSectorIgnore ; skip this sector?
|
|
|
|
beq nextsector
|
|
|
|
+ cmp #kSectorSwitchToBuiltinRWTS ; switch to built-in RWTS before reading this sector?
|
2017-08-17 19:11:19 +00:00
|
|
|
bne +
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gTriedUniv
|
|
|
|
beq +
|
|
|
|
jsr SwitchToUniv
|
2017-08-17 19:11:19 +00:00
|
|
|
+ jsr ReadSector
|
2017-01-08 03:35:35 +00:00
|
|
|
bcc nextsector
|
|
|
|
;
|
|
|
|
; Uh oh, we got a read error. But do we care?
|
2017-08-17 19:11:19 +00:00
|
|
|
; If we just got to this track, check for whole-track protections.
|
|
|
|
;
|
2017-12-02 21:07:38 +00:00
|
|
|
ldx #$0F ;16-sector
|
2018-12-29 06:20:48 +00:00
|
|
|
lda gIs13Sector
|
|
|
|
beq .expect13
|
2017-08-17 19:11:19 +00:00
|
|
|
lda gIsDOS32
|
|
|
|
bne +
|
2018-12-29 06:20:48 +00:00
|
|
|
.expect13
|
2017-12-02 21:07:38 +00:00
|
|
|
ldx #$0C ;13-sector
|
|
|
|
+ cpx gSector
|
|
|
|
bne .checkoptional
|
|
|
|
stx .sub+1
|
2017-02-06 20:24:49 +00:00
|
|
|
jsr SkipTrack
|
2017-12-02 21:07:38 +00:00
|
|
|
bcs .checkoptional
|
2017-02-06 20:24:49 +00:00
|
|
|
; Skip this track (we already printed the reason)
|
|
|
|
lda #$00
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr ChangeSector
|
|
|
|
lda checksector+1
|
|
|
|
sec
|
2017-12-02 21:07:38 +00:00
|
|
|
.sub sbc #$0F ;self-modified according to sectors per track
|
2017-01-08 03:35:35 +00:00
|
|
|
sta checksector+1
|
2017-08-17 19:11:19 +00:00
|
|
|
bcs +
|
2017-01-08 03:35:35 +00:00
|
|
|
dec checksector+2
|
2017-08-17 19:11:19 +00:00
|
|
|
+ jmp nextsector
|
2017-01-08 03:35:35 +00:00
|
|
|
|
2017-12-02 21:07:38 +00:00
|
|
|
; do this only *after* checking for track-skip
|
|
|
|
; to avoid fatal errors on unformatted tracks
|
|
|
|
|
|
|
|
.checkoptional
|
|
|
|
pla
|
|
|
|
pha
|
|
|
|
;
|
|
|
|
; Maybe we marked this sector as optional based
|
|
|
|
; on markers in the bootloader.
|
|
|
|
;
|
|
|
|
cmp #kSectorOptional
|
|
|
|
beq .optional
|
|
|
|
|
|
|
|
;
|
|
|
|
; Otherwise we're in the middle of a track, so try switching to
|
|
|
|
; the universal RWTS and see if that helps. (Many disks contain
|
|
|
|
; an RWTS that can't read the early tracks or sectors that
|
|
|
|
; contain the RWTS code, since those are loaded by the
|
|
|
|
; disk controller firmware.)
|
|
|
|
;
|
|
|
|
|
2017-01-24 00:57:43 +00:00
|
|
|
.tryuniversal
|
2017-08-17 19:11:19 +00:00
|
|
|
lda gIsDOS32 ; is this a DOS 3.2 disk?
|
|
|
|
beq .fatal ; yes, so read error is fatal
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gTriedUniv ; have we tried the universal RWTS?
|
2018-06-16 15:38:26 +00:00
|
|
|
beq .maybedavidson ; yes, but check one last thing
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr SwitchToUniv ; no, switch it in now
|
2017-01-24 00:57:43 +00:00
|
|
|
jmp .read ; and re-read this sector
|
2017-01-08 03:35:35 +00:00
|
|
|
|
2018-06-16 15:38:26 +00:00
|
|
|
.maybedavidson
|
|
|
|
jsr IDDavidson
|
|
|
|
bcc .optional
|
|
|
|
|
2017-01-24 00:57:43 +00:00
|
|
|
.fatal pla ; if we get to here, we've
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp FatalError ; decided the read error is fatal
|
|
|
|
|
2017-01-24 00:57:43 +00:00
|
|
|
.optional
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_optbad ; say we're skipping this
|
|
|
|
jsr PrintByID ; optional sector
|
|
|
|
|
|
|
|
; note: execution falls through here
|
|
|
|
|
|
|
|
nextsector
|
|
|
|
pla
|
|
|
|
dec checksector+1
|
|
|
|
lda checksector+1
|
|
|
|
cmp #$FF
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .nodec
|
2017-01-08 03:35:35 +00:00
|
|
|
dec checksector+2
|
2017-01-24 00:57:43 +00:00
|
|
|
.nodec
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gSector
|
|
|
|
sec
|
|
|
|
sbc #$01
|
|
|
|
jsr ChangeSector
|
|
|
|
lda gSector
|
2017-01-24 00:57:43 +00:00
|
|
|
bmi .prevtrack
|
|
|
|
jmp .read
|
|
|
|
.prevtrack
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$0F
|
2018-12-29 06:20:48 +00:00
|
|
|
ldx gIs13Sector
|
|
|
|
bne +
|
|
|
|
lda #$0C
|
|
|
|
+ jsr ChangeSector
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gTrack
|
|
|
|
sec
|
|
|
|
sbc #$01
|
|
|
|
jsr ChangeTrack
|
|
|
|
jsr IncProgress
|
|
|
|
lda gTrack
|
2017-01-24 00:57:43 +00:00
|
|
|
bmi .pass
|
2017-01-08 03:35:35 +00:00
|
|
|
cmp gLastTrack
|
2017-01-24 00:57:43 +00:00
|
|
|
bcc .pass
|
|
|
|
jmp .read
|
|
|
|
.pass
|
2017-01-08 03:35:35 +00:00
|
|
|
bit gMode
|
2017-01-24 00:57:43 +00:00
|
|
|
bmi .passwrite
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_pass
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .passprint ; always branches
|
|
|
|
.passwrite
|
|
|
|
bvs .passcrack
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_passdemuf
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .passprint ; always branches
|
|
|
|
.passcrack
|
2017-06-23 03:50:39 +00:00
|
|
|
lda gUsingRAMDisk
|
2017-11-08 18:46:42 +00:00
|
|
|
bne +
|
2017-06-23 03:50:39 +00:00
|
|
|
lda #s_writing
|
|
|
|
jsr PrintByID
|
|
|
|
jsr WriteRAMToDisk
|
2017-11-08 18:46:42 +00:00
|
|
|
bcc +
|
|
|
|
jmp FatalWriteError
|
|
|
|
+ lda gPatchCount
|
2017-07-02 00:16:12 +00:00
|
|
|
beq .passcrack0
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_passcrack
|
|
|
|
!byte $2C ; hide next LDA
|
2017-01-24 00:57:43 +00:00
|
|
|
.passcrack0
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_passcrack0
|
2017-01-24 00:57:43 +00:00
|
|
|
.passprint
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr PrintByID
|
|
|
|
jmp TheEnd
|
|
|
|
|
|
|
|
SwitchToUniv
|
2018-01-19 16:04:58 +00:00
|
|
|
lda gSector
|
|
|
|
sta gDisplayBytes
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_switch
|
|
|
|
!byte $2C ; hide next LDA
|
|
|
|
StartWithUniv
|
|
|
|
lda #s_builtin
|
|
|
|
jsr PrintByID
|
|
|
|
lda #TRUE
|
|
|
|
sta gTriedUniv
|
|
|
|
lda #FALSE
|
|
|
|
sta gIsProtDOS
|
|
|
|
|
|
|
|
; note: execution falls through here
|
|
|
|
|
|
|
|
CopyUniversal
|
2017-09-08 14:32:07 +00:00
|
|
|
lda #$B8
|
|
|
|
CopyUniversalAnywhere
|
2017-11-09 05:47:12 +00:00
|
|
|
sta universalrwts
|
2017-09-08 14:32:07 +00:00
|
|
|
clc
|
|
|
|
adc #$02
|
|
|
|
sta .cu+2
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #>universalrwts
|
2017-11-09 05:47:12 +00:00
|
|
|
sta _byte_hi
|
2017-08-18 04:45:46 +00:00
|
|
|
lda #<universalrwts
|
2017-11-09 05:47:12 +00:00
|
|
|
sta _byte_lo
|
|
|
|
jsr decrunch
|
|
|
|
sta jCallRWTS+1
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$BD
|
2017-11-09 05:47:12 +00:00
|
|
|
sta jCallRWTS+2
|
2017-08-18 04:45:46 +00:00
|
|
|
ldy #$96
|
2017-11-09 05:47:12 +00:00
|
|
|
.culoop lda gNIBTable,y
|
2017-09-08 14:32:07 +00:00
|
|
|
.cu sta $d100,y ; set at runtime
|
2017-08-18 04:45:46 +00:00
|
|
|
iny
|
2017-09-08 14:32:07 +00:00
|
|
|
bne .culoop
|
2017-01-08 03:35:35 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
Cancel
|
|
|
|
lda #s_canceled
|
|
|
|
jsr PrintByID
|
|
|
|
jmp TheEnd
|
|
|
|
|
|
|
|
FatalError
|
|
|
|
lda #s_fail
|
|
|
|
jsr PrintByID
|
|
|
|
lda gTrack
|
|
|
|
cmp #$22
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .failont22
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp TheEnd
|
2017-01-24 00:57:43 +00:00
|
|
|
.failont22
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gSector
|
|
|
|
cmp #$0F
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .failont22s0f
|
2017-10-26 02:38:08 +00:00
|
|
|
ldx gIsDOS32
|
|
|
|
bne +
|
|
|
|
cmp #$0C
|
|
|
|
beq .failont22s0f
|
|
|
|
+ jmp TheEnd
|
2017-01-24 00:57:43 +00:00
|
|
|
.failont22s0f
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_fatal220f
|
|
|
|
jsr PrintByID
|
|
|
|
|
|
|
|
; note: execution falls through here
|
|
|
|
|
|
|
|
TheEnd
|
|
|
|
lda $C0E8
|
|
|
|
lda #s_done
|
|
|
|
jsr PrintByID
|
|
|
|
jsr WaitForKey
|
|
|
|
cmp #$9B
|
|
|
|
beq CleanExit
|
2018-05-29 01:15:45 +00:00
|
|
|
cmp #k_redo
|
|
|
|
beq HandleRedo
|
2018-10-11 21:58:12 +00:00
|
|
|
cmp #k_redo_with_ignore
|
|
|
|
beq HandleRedoWithIgnore
|
2017-01-08 03:35:35 +00:00
|
|
|
jmp MainMenu
|
|
|
|
|
2018-10-11 21:58:12 +00:00
|
|
|
HandleRedoWithIgnore
|
2018-10-12 23:43:40 +00:00
|
|
|
jsr ResetProgress
|
2018-10-11 21:58:12 +00:00
|
|
|
jsr InitSectorMapWithIgnore
|
2018-10-12 23:43:40 +00:00
|
|
|
jmp Reaction
|
|
|
|
|
2018-05-29 01:15:45 +00:00
|
|
|
HandleRedo
|
|
|
|
jsr ClearScreen
|
|
|
|
lda #s_header
|
|
|
|
jsr PrintByID
|
|
|
|
lda #s_progbar
|
|
|
|
jsr PrintByID
|
|
|
|
lda VPOS
|
|
|
|
sta TEXTTOP
|
|
|
|
lda #s_reading
|
|
|
|
jsr PrintByID
|
|
|
|
jmp RestartScan
|
|
|
|
|
2017-01-08 03:35:35 +00:00
|
|
|
CleanExit
|
|
|
|
jsr SwapProDOS
|
|
|
|
lda gChangedPrefs
|
2017-06-23 03:50:39 +00:00
|
|
|
bne .checkRAM
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr SavePrefs
|
2017-06-23 03:50:39 +00:00
|
|
|
.checkRAM
|
|
|
|
lda gRAMDiskRef
|
|
|
|
beq .doquit
|
|
|
|
jsr CloseFile ; leave it behind in case it's wanted
|
2017-01-24 00:57:43 +00:00
|
|
|
.doquit
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr MLI
|
|
|
|
!byte $65
|
2017-01-24 00:57:43 +00:00
|
|
|
!word .quitparm
|
|
|
|
.quitparm
|
|
|
|
!byte $04,$00,$00,$00,$00,$00,$00
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
FatalNoSlot6
|
|
|
|
lda #s_noslot6
|
|
|
|
jsr PrintByID
|
|
|
|
jsr WaitForKey
|
|
|
|
jmp CleanExit
|
|
|
|
|
2017-11-08 18:18:34 +00:00
|
|
|
!source "progress.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; WriteTrack
|
|
|
|
;-------------------------------
|
|
|
|
MLI_IOERR = $27
|
|
|
|
MLI_NODEV = $28
|
|
|
|
MLI_WRITEPROT = $2B
|
|
|
|
|
|
|
|
WriteTrack
|
|
|
|
jsr AnalyzeTrack
|
|
|
|
WriteTrackNA ; entry point used by Special Delivery tracer
|
|
|
|
; to write track with "N"o "A"nalysis
|
|
|
|
bit gMode
|
2017-11-08 18:46:42 +00:00
|
|
|
bpl .exit ; verify mode -> no write
|
2017-01-08 03:35:35 +00:00
|
|
|
lda gSaidWriting
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .write
|
2017-11-08 18:46:42 +00:00
|
|
|
lda #s_writeram ; only print "writing to RAM disk" message once
|
2017-06-23 03:50:39 +00:00
|
|
|
ldx gUsingRAMDisk
|
|
|
|
beq +
|
2017-11-08 18:46:42 +00:00
|
|
|
lda #s_writing ; only print "writing to slot/drive" message once
|
2017-06-23 03:50:39 +00:00
|
|
|
+ jsr PrintByID
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #TRUE
|
|
|
|
sta gSaidWriting
|
2017-01-24 00:57:43 +00:00
|
|
|
.write
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr WriteTrackMLI
|
2017-11-08 18:46:42 +00:00
|
|
|
bcs FatalWriteError
|
|
|
|
.exit
|
|
|
|
rts
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; FatalWriteError
|
|
|
|
; in: A has MLI code (from WriteTrackMLI)
|
|
|
|
; out: exits via TheEnd
|
|
|
|
;-------------------------------
|
|
|
|
FatalWriteError
|
2017-01-08 03:35:35 +00:00
|
|
|
sta gDisplayBytes ; for use in error messages, if any
|
|
|
|
cmp #MLI_IOERR
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .ioerr
|
2017-01-08 03:35:35 +00:00
|
|
|
cmp #MLI_NODEV
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .nodev
|
2017-01-08 03:35:35 +00:00
|
|
|
cmp #MLI_WRITEPROT
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .writeprot
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_othermli
|
|
|
|
!byte $2C ; hide next LDA
|
2017-01-24 00:57:43 +00:00
|
|
|
.ioerr
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_writeioerr
|
|
|
|
!byte $2C ; hide next LDA
|
2017-01-24 00:57:43 +00:00
|
|
|
.nodev
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_writenodev
|
|
|
|
!byte $2C ; hide next LDA
|
2017-01-24 00:57:43 +00:00
|
|
|
.writeprot
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_writeprot
|
|
|
|
pha
|
|
|
|
lda #s_writeerr
|
|
|
|
jsr PrintByID
|
|
|
|
pla
|
|
|
|
jsr PrintByID
|
|
|
|
jmp TheEnd
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; ChangeTrack
|
|
|
|
; in: A = new track
|
|
|
|
;-------------------------------
|
|
|
|
ChangeTrack
|
2017-11-08 18:46:42 +00:00
|
|
|
sta .new+1
|
2017-01-08 03:35:35 +00:00
|
|
|
jsr WriteTrack
|
2017-11-08 18:46:42 +00:00
|
|
|
.new lda #$d1 ; modified at runtime
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
; note: execution falls through here
|
|
|
|
|
|
|
|
ChangeTrackNW ; "N"o "W"rite
|
|
|
|
sta gTrack
|
|
|
|
jsr ClearTSBuffer
|
|
|
|
rts
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; ChangeSector
|
|
|
|
; in: A = new sector
|
|
|
|
;-------------------------------
|
|
|
|
ChangeSector
|
|
|
|
sta gSector
|
|
|
|
clc
|
|
|
|
adc #BASEPAGE
|
|
|
|
sta gAddress+1
|
|
|
|
rts
|
|
|
|
|
2017-12-26 16:40:08 +00:00
|
|
|
;-------------------------------
|
|
|
|
; RestartScan
|
|
|
|
; Print 'Restarting scan...' then do exactly that.
|
|
|
|
; Used by several patchers that find evidence of a protection
|
|
|
|
; then activate an expensive search the second time around.
|
|
|
|
; Can be called from anywhere.
|
|
|
|
; Resets stack, never returns.
|
|
|
|
; Exits via ReadWithRWTS
|
|
|
|
;-------------------------------
|
|
|
|
RestartScan
|
|
|
|
lda #s_restart
|
|
|
|
jsr PrintByID
|
|
|
|
jsr RestartProgress
|
|
|
|
jsr IncProgress
|
|
|
|
ldx #$FF
|
|
|
|
txs
|
|
|
|
jmp ReadWithRWTS
|
|
|
|
|
2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
|
|
|
; AnalyzeTrack routine
|
|
|
|
; Looks at buffer in memory to detect known
|
|
|
|
; copy protections and disable/revert/modify them
|
|
|
|
; to work on standard disks.
|
2017-12-13 00:21:15 +00:00
|
|
|
; Prints through COUT
|
|
|
|
; Makes modifications in memory only.
|
2017-01-08 03:35:35 +00:00
|
|
|
; in: $BASEPAGE page contains one track worth of data
|
|
|
|
; out: if C set, no known protections were found and
|
|
|
|
; no modifications were made
|
|
|
|
; if C clear, at least one modification was made
|
|
|
|
;-------------------------------
|
|
|
|
AnalyzeTrack
|
|
|
|
lda gTrack
|
2017-11-09 05:47:12 +00:00
|
|
|
bne _applyToAll
|
2017-01-08 03:35:35 +00:00
|
|
|
_applyToT00
|
2017-11-09 05:47:12 +00:00
|
|
|
lda #>AnalyzeT00
|
|
|
|
sta _byte_hi
|
|
|
|
lda #<AnalyzeT00
|
|
|
|
sta _byte_lo
|
|
|
|
jsr decrunch
|
|
|
|
jsr $2000
|
2017-01-08 03:35:35 +00:00
|
|
|
_applyToAll
|
2017-12-26 16:44:19 +00:00
|
|
|
!source "patchers/t11diskvol.a" ; T11 && gIsRWTS only
|
|
|
|
!source "patchers/t02volumename.a" ; T02 && gIsBoot0 only
|
2017-01-08 03:35:35 +00:00
|
|
|
!source "patchers/universale7.a"
|
2018-09-24 02:30:17 +00:00
|
|
|
!source "patchers/c9ff.a"
|
2017-05-05 18:04:32 +00:00
|
|
|
!source "patchers/a6bc95.a" ; gIsPascal only
|
|
|
|
!source "patchers/a5count.a" ; gIsPascal only
|
2017-05-05 22:11:31 +00:00
|
|
|
!source "patchers/d5d5f7.a" ; gIsPascal || (gIsBoot0 && gPossibleD5D5F7) only
|
2017-05-05 18:04:32 +00:00
|
|
|
!source "patchers/prodosrwts.a" ; gIsProDOS only
|
|
|
|
!source "patchers/prodos6a.a" ; gIsProDOS only
|
|
|
|
!source "patchers/prodosmecc.a" ; gIsProDOS only
|
2017-05-21 17:59:36 +00:00
|
|
|
!source "patchers/bbf9.a" ; gIsProDOS only
|
2017-08-01 23:42:11 +00:00
|
|
|
!source "patchers/memory.config.a" ; gIsProDOS only
|
2017-12-04 05:37:41 +00:00
|
|
|
!source "patchers/origin.a" ; gIsProDOS only
|
2018-07-03 17:46:03 +00:00
|
|
|
!source "patchers/rwtsswapmecc.a" ; gMECCFastloadType only
|
2018-09-23 18:43:06 +00:00
|
|
|
!source "patchers/rwtsswappenguin.a" ; T01 only
|
2017-05-05 18:04:32 +00:00
|
|
|
!source "patchers/protecteddos.a" ; gIsProtDOS only
|
2017-01-24 04:37:16 +00:00
|
|
|
!source "patchers/fbff.a"
|
2018-01-27 15:32:49 +00:00
|
|
|
!source "patchers/fbffencrypted.a" ; gIsProDOS only
|
2018-07-19 16:27:02 +00:00
|
|
|
!source "patchers/fbffpascal.a" ; gIsPascal only
|
2018-01-27 15:32:49 +00:00
|
|
|
!source "patchers/polarware.a" ; gIsProDOS only
|
2017-05-05 20:01:35 +00:00
|
|
|
!source "patchers/sierra.a" ; gIsBoot0 only
|
2017-05-05 18:21:03 +00:00
|
|
|
!source "patchers/corrupter.a" ; T13 only
|
2017-05-05 22:11:31 +00:00
|
|
|
!source "patchers/ea.a" ; (gIsEA || gIsBoot0) only
|
2017-07-03 14:50:55 +00:00
|
|
|
!source "patchers/gamco.a" ; gPossibleGamco only
|
2017-05-05 18:04:32 +00:00
|
|
|
!source "patchers/optimum.a" ; gIsOptimum only
|
|
|
|
!source "patchers/bootcounter.a" ; T01 only
|
|
|
|
!source "patchers/jmpb412.a" ; T02 only
|
2017-07-15 15:24:56 +00:00
|
|
|
!source "patchers/jmpb400.a" ; T02 && gIsBoot0 only
|
2017-08-03 14:08:36 +00:00
|
|
|
!source "patchers/advint.a" ; gAdventureInternational only
|
2017-09-19 00:39:45 +00:00
|
|
|
!source "patchers/jsr8635.a" ; gIsRWTS only
|
2017-11-25 16:22:25 +00:00
|
|
|
!source "patchers/jmpb4bb.a" ; T02 only
|
2017-11-24 22:03:48 +00:00
|
|
|
!source "patchers/dos32muse.a" ; T01 && gIsDOS32 only
|
2017-10-06 14:46:40 +00:00
|
|
|
!source "patchers/sra.a" ; gIsDOS32 or gIsRWTS only
|
2017-12-02 21:07:38 +00:00
|
|
|
!source "patchers/sierra13.a" ; gIsDOS32 only
|
2017-12-26 16:44:19 +00:00
|
|
|
!source "patchers/ssprot.a" ; gIsF7F6 only
|
2017-12-26 18:13:11 +00:00
|
|
|
!source "patchers/f7f6.a" ; gIsF7F6 only
|
2018-01-04 20:02:27 +00:00
|
|
|
!source "patchers/trillium.a" ; gIsTrillium only
|
2018-09-23 03:00:24 +00:00
|
|
|
!source "patchers/trillium2.a" ; T17 only
|
2018-05-26 17:54:48 +00:00
|
|
|
!source "patchers/advent.a" ; gIsAdvent only
|
2018-06-16 15:38:26 +00:00
|
|
|
!source "patchers/davidsonforth.a" ; gIsDavidson only
|
|
|
|
!source "patchers/davidsonasm.a" ; gIsDavidson only
|
2018-09-26 17:20:03 +00:00
|
|
|
!source "patchers/ssi.a" ; gIsRDOS13 only
|
2018-09-27 21:26:08 +00:00
|
|
|
!source "patchers/rdosfmt.a" ; gIsRDOS13 only
|
2018-09-28 19:54:24 +00:00
|
|
|
!source "patchers/aacount.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
|
|
|
|
lda gPatchCount
|
2017-01-24 00:57:43 +00:00
|
|
|
beq .nopatches
|
2017-01-08 03:35:35 +00:00
|
|
|
clc
|
|
|
|
!byte $24 ; hide next SEC
|
2017-01-24 00:57:43 +00:00
|
|
|
.nopatches
|
2017-01-08 03:35:35 +00:00
|
|
|
sec ; set carry if nothing happened
|
|
|
|
rts
|
|
|
|
|
2017-11-09 05:47:12 +00:00
|
|
|
universalrwts
|
|
|
|
!bin "../build/universalrwts.pak"
|
2017-08-18 04:45:46 +00:00
|
|
|
!source "unpack.a"
|
2017-11-09 05:47:12 +00:00
|
|
|
AnalyzeT00 ; placeholder to identify stack of packed data
|
|
|
|
!bin "../build/t00only.pak"
|
|
|
|
!source "apicode.a"
|
2017-01-08 03:35:35 +00:00
|
|
|
}
|
2017-01-30 22:10:41 +00:00
|
|
|
LastMover
|
|
|
|
|
2017-11-09 05:47:12 +00:00
|
|
|
!if RELBASE = $2000 {
|
|
|
|
!ifdef PASS2 {
|
|
|
|
} else { ;PASS2
|
|
|
|
!set PASS2=1
|
2018-09-26 17:20:03 +00:00
|
|
|
!warn "RELBASE = ", HIGHPOINT - (LastMover - FirstMover)
|
2017-11-09 05:47:12 +00:00
|
|
|
}
|
|
|
|
} else {
|
2018-09-26 17:20:03 +00:00
|
|
|
!if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT {
|
2017-11-09 05:47:12 +00:00
|
|
|
!serious "code is too large to fit in available space!"
|
|
|
|
}
|
2017-02-13 21:20:24 +00:00
|
|
|
}
|