passport/src/passport.a

873 lines
25 KiB
Plaintext
Raw Normal View History

2017-01-08 03:35:35 +00:00
!cpu 6502
*=$2000
;-------------------------------
; Passport
; a 4am hack
; (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.
;
;-------------------------------
!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
;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
ldx #$00
FM lda LastMover - 256,x
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
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 {
!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"
!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"
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
OneTimeSetup
lda $C0E8
jsr SaveProDOS
ldx MACHINEID
cpx #$EA
bne .slotscan
2017-01-08 03:35:35 +00:00
lda #$DF
sta kForceLower
.slotscan
2017-01-08 03:35:35 +00:00
jsr ScanForDiskII
lda DiskIIArray+5
bne .founds6
2017-01-08 03:35:35 +00:00
jmp FatalNoSlot6
.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
.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_demuffin
bne +
lda #%10000000
bne 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
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 .noDog
2017-01-08 03:35:35 +00:00
lda #s_bb00
jsr PrintByID
.noDog
2017-01-08 03:35:35 +00:00
jsr xSunburst
bcs .noSun
2017-01-08 03:35:35 +00:00
lda #s_sunburst
jsr PrintByID
.noSun
2017-01-08 03:35:35 +00:00
jsr xOptimumRes
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
.noOptimum
2017-01-08 03:35:35 +00:00
jsr xB660
jsr xB4BB
jmp ReadWithRWTS
UseUniversal
jsr IncProgress
jsr StartWithUniv
lda gIsDinkeyDOS
bne +
;
; 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.
;
jsr PatchUniversalRWTSForOrigin
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
;
; 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)
2017-01-08 03:35:35 +00:00
pha
cmp #kSectorCustomFirst ; call a custom routine before deciding what to do with this sector?
bcc +
cmp #kSectorCustomLast
bcs +
pla
2018-12-28 19:46:36 +00:00
jsr PreReadSector
pha ; replace status (on stack) with new status returned from PreReadSector
+ cmp #kSectorIgnore ; skip this sector?
beq nextsector
+ 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
dec checksector+1
lda checksector+1
cmp #$FF
bne .nodec
2017-01-08 03:35:35 +00:00
dec checksector+2
.nodec
2017-01-08 03:35:35 +00:00
lda gSector
sec
sbc #$01
jsr ChangeSector
lda gSector
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
bmi .pass
2017-01-08 03:35:35 +00:00
cmp gLastTrack
bcc .pass
jmp .read
.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
+ 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
.passcrack0
2017-01-08 03:35:35 +00:00
lda #s_passcrack0
.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
sta 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
beq .failont22
2017-01-08 03:35:35 +00:00
jmp TheEnd
.failont22
2017-01-08 03:35:35 +00:00
lda gSector
cmp #$0F
beq .failont22s0f
ldx gIsDOS32
bne +
cmp #$0C
beq .failont22s0f
+ jmp 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
FatalNoSlot6
lda #s_noslot6
jsr PrintByID
jsr WaitForKey
jmp CleanExit
!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
cmp #MLI_IOERR
beq .ioerr
2017-01-08 03:35:35 +00:00
cmp #MLI_NODEV
beq .nodev
2017-01-08 03:35:35 +00:00
cmp #MLI_WRITEPROT
beq .writeprot
2017-01-08 03:35:35 +00:00
lda #s_othermli
!byte $2C ; hide next LDA
.ioerr
2017-01-08 03:35:35 +00:00
lda #s_writeioerr
!byte $2C ; hide next LDA
.nodev
2017-01-08 03:35:35 +00:00
lda #s_writenodev
!byte $2C ; hide next LDA
.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
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
2018-07-03 17:46:03 +00:00
!source "patchers/rwtsswapmecc.a" ; gMECCFastloadType 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
!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/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
!source "patchers/sra.a" ; gIsDOS32 or 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"
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
universalrwts
!bin "../build/universalrwts.pak"
!source "unpack.a"
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
!if RELBASE = $2000 {
!ifdef PASS2 {
} else { ;PASS2
!set PASS2=1
!warn "RELBASE = ", HIGHPOINT - (LastMover - FirstMover)
}
} else {
!if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT {
!serious "code is too large to fit in available space!"
}
2017-02-13 21:20:24 +00:00
}