passport/src/passport.a

910 lines
26 KiB
Plaintext
Raw Normal View History

2017-01-08 03:35:35 +00:00
!cpu 6502
!ifdef RELBASE {
*=RELBASE
} else {
2017-01-08 03:35:35 +00:00
*=$2000
}
2017-01-08 03:35:35 +00:00
;-------------------------------
; Passport
; a 4am hack
; (c) 2016-2020 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.
;
;-------------------------------
!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.TMP",plain
2017-01-08 03:35:35 +00:00
}
!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
;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
!source "apidefs.a"
2017-01-08 03:35:35 +00:00
2017-01-30 22:10:41 +00:00
FirstMover
jmp ResetVector
!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"
2020-07-22 23:01:07 +00:00
!source "id/tsr.a"
2017-01-08 03:35:35 +00:00
!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"
!source "id/daviddos.a"
!source "id/quickdos.a"
!source "id/diversidos.a"
!source "id/prontodos.a"
!source "id/d5d5f7.a"
!source "id/laureate.a"
!source "id/micrograms.a"
2017-12-06 01:59:55 +00:00
!source "id/volumename.a"
!source "id/dinkeydos.a"
!source "id/advent.a"
2018-06-07 15:18:06 +00:00
!source "id/panglosdos.a"
!source "id/davidson.a"
!source "id/holle.a"
2019-04-08 00:02:19 +00:00
!source "id/phoenix.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"
!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
ResetVector
lda $C0E8
jsr PR0
jsr IN0
sta $C000
sta $C002
sta $C004
sta $C00C
sta $C00E
MainMenu
2019-04-24 05:00:02 +00:00
lda #<ResetVector
sta $03F2
lda #>ResetVector
sta $03F3
eor #$A5
sta $03F4
2017-01-08 03:35:35 +00:00
ldx #$FF
txs
jsr ClearScreen
lda #s_header
jsr PrintByID
lda #s_mainmenu
jsr PrintByID
.getkey
2017-01-08 03:35:35 +00:00
jsr WaitForKey
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
beq .jmptoexit
2017-01-08 03:35:35 +00:00
cmp #k_quit
bne +
.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_crack
bne .getkey
2017-01-08 03:35:35 +00:00
lda #%11000000
; note: execution falls through here
Action
sta gMode
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
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
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
lda #$B2
ldx #$00
ldy #$0D
jsr ClearMemory
jsr CopyUniversal
jsr IgnoreAddressChecksum
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
+ 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
bcs +
2017-01-08 03:35:35 +00:00
lda #s_bb00
jsr PrintByID
+
2017-01-08 03:35:35 +00:00
jsr xSunburst
bcs +
2017-01-08 03:35:35 +00:00
lda #s_sunburst
jsr PrintByID
+
2017-01-08 03:35:35 +00:00
jsr xOptimumRes
bcs +
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
+
jsr xSVE
bcs +
lda #s_sve
jsr PrintByID
lda #$CA
sta $BE5B
lda #$B6
sta $BE5C
+
jsr xRPS
bcs +
lda #s_rps
jsr PrintByID
+
2017-01-08 03:35:35 +00:00
jsr xB660
jsr xB4BB
jsr xHarvey
2017-01-08 03:35:35 +00:00
jmp ReadWithRWTS
UseUniversal
jsr IncProgress
jsr StartWithUniv
;
; On Dinkey-DOS disks (e.g. Ultima V, Times of Lore), we start with the
; universal RWTS then apply a patch in memory.
; 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.
;
2020-07-22 23:01:07 +00:00
lda gIsDinkeyDOS
bne +
jsr PatchUniversalRWTSForOrigin
bmi ReadWithRWTS ; always branches
;
2020-07-22 23:01:07 +00:00
; On TSR disks (e.g. Dawn Patrol, Dungeon), we start with the universal
; RWTS then apply a patch in memory.
;
+ lda gIsTSR
bne +
jsr PatchUniversalRWTSForTSR
;
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
;
; 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
;
; Disable drive recalibration on bad sectors so we give up on bad sectors
; faster and detect unformatted or specially structured tracks faster.
;
jsr PatchUniversalRWTSForNoRecal
;
; 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-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
.read
2017-01-08 03:35:35 +00:00
lda KEY
2018-12-28 19:46:36 +00:00
bpl .checkinfocom
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
lda $FFFF ; status of current sector in sector map (modified above)
cmp #kSectorCustomFirst ; call a custom routine before deciding what to do with this sector?
bcc +
cmp #kSectorCustomLast
bcs +
2018-12-28 19:46:36 +00:00
jsr PreReadSector
2019-04-13 17:33:15 +00:00
+ pha ; replace status (on stack) with new status returned from PreReadSector
cmp #kSectorIgnore ; skip this sector?
beq nextsector
2019-04-13 17:33:15 +00:00
cmp #kSectorSwitchToBuiltinRWTS ; switch to built-in RWTS before reading this sector?
bne +
2017-01-08 03:35:35 +00:00
lda gTriedUniv
beq +
jsr SwitchToUniv
+ jsr ReadSector
2017-01-08 03:35:35 +00:00
bcc nextsector
;
; Uh oh, we got a read error. But do we care?
; If we just got to this track, check for whole-track protections.
;
ldx #$0F ;16-sector
2018-12-29 06:20:48 +00:00
lda gIs13Sector
beq .expect13
lda gIsDOS32
bne +
2018-12-29 06:20:48 +00:00
.expect13
ldx #$0C ;13-sector
+ cpx gSector
bne .checkoptional
stx .sub+1
jsr SkipTrack
bcs .checkoptional
; Skip this track (we already printed the reason)
lda #$00
2017-01-08 03:35:35 +00:00
jsr ChangeSector
lda checksector+1
sec
.sub sbc #$0F ;self-modified according to sectors per track
2017-01-08 03:35:35 +00:00
sta checksector+1
bcs +
2017-01-08 03:35:35 +00:00
dec checksector+2
+ jmp nextsector
2017-01-08 03:35:35 +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.)
;
.tryuniversal
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?
beq .maybedavidson ; yes, but check one last thing
2017-01-08 03:35:35 +00:00
jsr SwitchToUniv ; no, switch it in now
jmp .read ; and re-read this sector
2017-01-08 03:35:35 +00:00
.maybedavidson
jsr IDDavidson
bcc .optional
.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
.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
lda checksector+1
bne .nodec
2017-01-08 03:35:35 +00:00
dec checksector+2
.nodec
2019-04-13 17:33:15 +00:00
dec checksector+1
2019-04-16 05:39:12 +00:00
ldy gSector
dey
tya
2017-01-08 03:35:35 +00:00
jsr ChangeSector
lda gSector
bmi .prevtrack
2019-04-16 05:39:12 +00:00
.linkread
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
2019-04-16 05:39:12 +00:00
ldy gTrack
dey
tya
2017-01-08 03:35:35 +00:00
jsr ChangeTrack
jsr IncProgress
lda gTrack
2019-04-13 17:33:15 +00:00
bmi Pass
2017-01-08 03:35:35 +00:00
cmp gLastTrack
2019-04-16 05:39:12 +00:00
bcs .linkread
2019-04-13 17:33:15 +00:00
Pass
2017-01-08 03:35:35 +00:00
bit gMode
bmi .passwrite
2017-01-08 03:35:35 +00:00
lda #s_pass
bne .passprint ; always branches
.passwrite
bvs .passcrack
2017-01-08 03:35:35 +00:00
lda #s_passdemuf
bne .passprint ; always branches
.passcrack
2017-06-23 03:50:39 +00:00
lda gUsingRAMDisk
bne +
2017-06-23 03:50:39 +00:00
lda #s_writing
jsr PrintByID
jsr WriteRAMToDisk
bcc +
jmp FatalWriteError
2019-04-16 05:39:12 +00:00
+ lda #s_passcrack0
ldx gPatchCount
beq .passprint
2017-01-08 03:35:35 +00:00
lda #s_passcrack
.passprint
2017-01-08 03:35:35 +00:00
jsr PrintByID
jmp TheEnd
SwitchToUniv
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
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
sta _byte_hi
lda #<universalrwts
sta _byte_lo
jsr decrunch
sty jCallRWTS+1
2017-01-08 03:35:35 +00:00
lda #$BD
sta jCallRWTS+2
ldy #$96
.culoop lda gNIBTable,y
2017-09-08 14:32:07 +00:00
.cu sta $d100,y ; set at runtime
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
2019-04-16 05:39:12 +00:00
bne TheEnd
.failont22
2017-01-08 03:35:35 +00:00
lda gSector
cmp #$0F
beq .failont22s0f
ldx gIsDOS32
2019-04-16 05:39:12 +00:00
bne TheEnd
cmp #$0C
2019-04-16 05:39:12 +00:00
bne TheEnd
.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
cmp #k_redo_with_ignore
beq HandleRedoWithIgnore
2017-01-08 03:35:35 +00:00
jmp MainMenu
HandleRedoWithIgnore
2018-10-12 23:43:40 +00:00
jsr ResetProgress
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
.doquit
2017-01-08 03:35:35 +00:00
jsr MLI
!byte $65
!word .quitparm
.quitparm
!byte $04,$00,$00,$00,$00,$00,$00
2017-01-08 03:35:35 +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
bpl .exit ; verify mode -> no write
2017-01-08 03:35:35 +00:00
lda gSaidWriting
beq .write
lda #s_writeram ; only print "writing to RAM disk" message once
2017-06-23 03:50:39 +00:00
ldx gUsingRAMDisk
beq +
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
.write
2017-01-08 03:35:35 +00:00
jsr WriteTrackMLI
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
2019-04-16 05:39:12 +00:00
tax
2017-01-08 03:35:35 +00:00
lda #s_writeioerr
2019-04-16 05:39:12 +00:00
cpx #MLI_IOERR
beq .printerr
2017-01-08 03:35:35 +00:00
lda #s_writenodev
2019-04-16 05:39:12 +00:00
cpx #MLI_NODEV
beq .printerr
2017-01-08 03:35:35 +00:00
lda #s_writeprot
2019-04-16 05:39:12 +00:00
cpx #MLI_WRITEPROT
beq .printerr
lda #s_othermli
.printerr
2017-01-08 03:35:35 +00:00
pha
lda #s_writeerr
jsr PrintByID
pla
jsr PrintByID
jmp TheEnd
;-------------------------------
; ChangeTrack
; in: A = new track
;-------------------------------
ChangeTrack
sta .new+1
2017-01-08 03:35:35 +00:00
jsr WriteTrack
.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
;-------------------------------
; 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.
; 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
bne _applyToAll
2017-01-08 03:35:35 +00:00
_applyToT00
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
!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
!source "patchers/bbf9.a" ; gIsProDOS only
!source "patchers/memory.config.a" ; gIsProDOS only
!source "patchers/origin.a" ; gIsProDOS only
!source "patchers/meccdbc.a" ; gMECCFastloadType==1 && gT07 only
2018-07-03 17:46:03 +00:00
!source "patchers/rwtsswapmecc.a" ; gMECCFastloadType only
!source "patchers/rwtsswapmecc2.a" ; gPossibleMECCSwapper only
!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"
!source "patchers/fbffencrypted.a" ; gIsProDOS only
!source "patchers/fbffpascal.a" ; gIsPascal only
!source "patchers/polarware.a" ; gIsProDOS only
!source "patchers/sierra.a" ; gIsBoot0 only
!source "patchers/corrupter.a" ; T13 only
2020-07-22 23:01:07 +00:00
!source "patchers/ea.a" ; gIsEA || gIsBoot0 only
!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
!source "patchers/jmp2012.a" ; T02 only
!source "patchers/jmpb400.a" ; T02 && gIsBoot0 only
!source "patchers/advint.a" ; gAdventureInternational only
!source "patchers/jsr8635.a" ; gIsRWTS only
2017-11-25 16:22:25 +00:00
!source "patchers/jmpb4bb.a" ; T02 only
!source "patchers/dos32muse.a" ; T01 && gIsDOS32 only
2020-07-22 23:01:07 +00:00
!source "patchers/sra.a" ; gIsDOS32 || gIsRWTS only
!source "patchers/sierra13.a" ; gIsDOS32 only
2017-12-26 16:44:19 +00:00
!source "patchers/ssprot.a" ; gIsF7F6 only
!source "patchers/f7f6.a" ; gIsF7F6 only
!source "patchers/trillium.a" ; gIsTrillium only
!source "patchers/trillium2.a" ; T17 only
!source "patchers/advent.a" ; gIsAdvent only
!source "patchers/davidsonforth.a" ; gIsDavidson only
!source "patchers/davidsonasm.a" ; gIsDavidson only
!source "patchers/ssi.a" ; gIsRDOS13 only
2018-09-27 21:26:08 +00:00
!source "patchers/rdosfmt.a" ; gIsRDOS13 only
!source "patchers/aacount.a"
!source "patchers/hallabs.a" ; T01 only
!source "patchers/holle.a" ; gIsHolle only
2019-04-08 00:02:19 +00:00
!source "patchers/zoomgrafix.a" ; gIsPhoenix only
!source "patchers/e7everywhere.a" ; gIsBoot0 || gIsProDOS only
2019-04-13 17:33:15 +00:00
!source "patchers/choplifter.a" ; gIsChoplifter only
!source "patchers/pdi.a" ; gIsDiversi only
!source "patchers/harvey.a" ; T01 only
2020-07-22 23:01:07 +00:00
!source "patchers/tsr.a" ; T04 && gIsTSR only
2017-01-08 03:35:35 +00:00
lda gPatchCount
beq .nopatches
2017-01-08 03:35:35 +00:00
clc
!byte $24 ; hide next SEC
.nopatches
2017-01-08 03:35:35 +00:00
sec ; set carry if nothing happened
rts
inx6 inx
inx5 inx
inx4 inx
inx
inx
inx
rts
universalrwts
!bin "../build/universalrwts.pak"
!source "exodecrunch.s"
get_crunched_byte:
_byte_lo = * + 1
_byte_hi = * + 2
lda $1234 ; needs to be set correctly before
; decrunch_file is called.
inc _byte_lo
bne _byte_skip_hi
inc _byte_hi
_byte_skip_hi:
rts
AnalyzeT00 ; placeholder to identify stack of packed data
!bin "../build/t00only.pak"
!source "apicode.a"
2017-01-30 22:10:41 +00:00
LastMover
!if RELBASE = $2000 {
!ifdef PASS2 {
} else { ;PASS2
!set PASS2=1
!warn "RELBASE = ", HIGHPOINT - (LastMover - FirstMover)
}
} else {
!if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT {
!serious "code end (", HIGHPOINT - (LastMover - FirstMover), ") is below minimum (", LOWPOINT, ")!"
}
!warn "CleanExit=",CleanExit
!warn "WaitForKey=",WaitForKey
!warn "SaveProDOS=",SaveProDOS
!warn "OpenFile=",OpenFile
!warn "ReadFile=",ReadFile
!warn "CloseFile=",CloseFile
!warn "GetVolumeName=",GetVolumeName
!warn "OnlineReturn=",OnlineReturn
!warn "VolumeName=",VolumeName
!warn "GetVolumeInfo=",GetVolumeInfo
!warn "mliparam=",mliparam
!warn "filetype=",filetype
!warn "auxtype=",auxtype
!warn "blocks=",blocks
!warn "PREFSFILE=",PREFSFILE
!warn "PREFSBUFFER=",PREFSBUFFER
!warn "PREFSREADLEN=",PREFSREADLEN
!warn "PREFSVER=",PREFSVER
!warn "SavePrefs=",SavePrefs
!warn "ValidatePrefs=",ValidatePrefs
!warn "kForceLower=",kForceLower
!warn "PrintByID=",PrintByID
!warn "DiskIIArray=",DiskIIArray
2017-02-13 21:20:24 +00:00
}