ca65 V2.18 - N/A Main file : Firmware.asm Current file: Firmware.asm 000000r 1 ;i/o ports to write to 000000r 1 writeLatchHigh = $C081 000000r 1 writeLatchLow = $C080 000000r 1 000000r 1 ;ProDOS defines 000000r 1 command = $42 ;ProDOS command 000000r 1 unit = $43 ;7=drive 6-4=slot 3-0=not used 000000r 1 buflo = $44 ;low address of buffer 000000r 1 bufhi = $45 ;hi address of buffer 000000r 1 blklo = $46 ;low block 000000r 1 blkhi = $47 ;hi block 000000r 1 ioerr = $27 ;I/O error code 000000r 1 nodev = $28 ;no device connected 000000r 1 wperr = $2B ;write protect error 000000r 1 000000r 1 ;for relocatable code 000000r 1 ioAddressLo = $FA 000000r 1 ioAddressHi = $FB 000000r 1 tempY = $FC 000000r 1 blockHalfCounter = $FD 000000r 1 lowLatch = $FE 000000r 1 highLatch = $FF 000000r 1 knownRts = $FF58 000000r 1 000000r 1 ;autostart ROM next card 000000r 1 sloop = $FABA 000000r 1 keyboard = $C000 000000r 1 clearKeyboard = $C010 000000r 1 000000r 1 .org $C700 00C700 1 ;code is relocatable 00C700 1 ; but set to $c700 for 00C700 1 ; readability 00C700 1 00C700 1 ;ID bytes for booting and drive detection 00C700 1 E0 20 cpx #$20 ;ID bytes for ProDOS and the 00C702 1 A0 00 ldy #$00 ; Apple Autostart ROM 00C704 1 E0 03 cpx #$03 ; 00C706 1 E0 3C cpx #$3C ;this one for older II's 00C708 1 00C708 1 ;check for ESC key and if so, jump to next slot in autostart 00C708 1 AD 00 C0 lda keyboard 00C70B 1 C9 9B cmp #$9B 00C70D 1 D0 03 bne start 00C70F 1 4C BA FA jmp sloop 00C712 1 00C712 1 ;zero out block numbers and buffer address 00C712 1 start: 00C712 1 84 44 sty buflo 00C714 1 84 46 sty blklo 00C716 1 84 47 sty blkhi 00C718 1 C8 iny ;set command = 1 for read block 00C719 1 84 42 sty command 00C71B 1 20 58 FF jsr knownRts ;jump to known RTS to get our address from the stack 00C71E 1 BA tsx 00C71F 1 BD 00 01 lda $0100,x ;this for example would be $C7 in slot 7 00C722 1 85 45 sta bufhi ;keep the slot here 00C724 1 0A asl 00C725 1 0A asl 00C726 1 0A asl 00C727 1 0A asl 00C728 1 85 43 sta unit 00C72A 1 00C72A 1 ;display copyright message 00C72A 1 A0 CF ldy #