2021-07-11 11:56:35 -04:00

108 lines
3.3 KiB

!cpu 6502
!to "../build/PASSPORT.SYSTEM",plain
; no code in these
!source "apidefs.a"
!source "strings/enid.a"
!source "prefs.load.a"
!source "hw.diskii.a"
!source "../build/vars.a"
bit $C082 ; read ROM, no write
sta $C00E ; primary character set
sta $C00C ; 40 columns
sta $C000 ; 80STORE off
sta $C002 ; read main memory
jsr $FB2F ; TEXT
jsr $FC58 ; HOME
jsr $FE84 ; NORMAL
jsr $FE93 ; PR#0
jsr $FE89 ; IN#0
lda $BF98 ; ProDOS MachineID
and #$20 ; at least 64K?
bne OneTimeSetup
jsr $BF00 ; immediately quit on 48K machine
!byte $65 ; (but congratulations on launching Passport at all)
!word quit
quit !byte 4
jsr decrunch ; decompress main Passport code
sty $FE ;;zp_dest_lo = low byte of Passport entry point
ldx #$0D ; copy t00only.pak to $3200
ldy #$32
sty $F1
ldy #$00
sty $F0
- lda ($FE), y
sta ($F0), y
bne -
inc $FF
inc $F1
bne -
- lda $BF00, y ; save a copy of ProDOS system global page
sta $0F00, y ; (will be copied back and forth by SwapProDOS later)
bne -
lda $FBB3 ; ROM MachineID
cmp #$EA ; ][+?
bne +
lda #$DF ; AND mask to force characters to uppercase on ][+
sta kForceLower
+ScanForDiskII ; scan slots for Disk II drives
lda DiskIIArray+5
bne +
jsr PrintByID ; no Disk II in slot 6, this is fatal
!byte s_noslot6
jsr WaitForKey
jmp CleanExit
jsr ScanForRAMAndHardDisks; scan for things that look like RAM disks or hard disks
+LoadPrefs ; load preferences (if available)
jsr ThisSlot ; get information about selected drive and set gTargetType for main menu
lda #<MainMenu ; set reset vector
sta $03F2
lda #>MainMenu
sta $03F3
jsr $FB6F
lda #<CheckCache ; set up output hook used to store log messages before they scroll off
sta $36
lda #>CheckCache
sta $37
jmp MainMenu
!source "hw.harddisk.a"
SHOW_PROGRESS_DURING_DECRUNCH = 1 ; activates optional UI code in exodecrunch
!source "exodecrunch.s"
lda _byte_lo
bne _byte_skip_hi
dec _byte_hi
dec _byte_lo
_byte_lo = * + 1
_byte_hi = * + 2
lda packend ; needs to be set correctly before decrunch_file is called
!bin "../build/passport.pak"