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 .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 ;zero out block numbers and buffer address 00C708 1 84 44 sty buflo 00C70A 1 84 46 sty blklo 00C70C 1 84 47 sty blkhi 00C70E 1 C8 iny ;set command = 1 for read block 00C70F 1 84 42 sty command 00C711 1 20 58 FF jsr knownRts ;jump to known RTS to get our address from the stack 00C714 1 BA tsx 00C715 1 BD 00 01 lda $0100,x ;this for example would be $C7 in slot 7 00C718 1 85 45 sta bufhi ;keep the slot here 00C71A 1 0A asl 00C71B 1 0A asl 00C71C 1 0A asl 00C71D 1 0A asl 00C71E 1 85 43 sta unit 00C720 1 00C720 1 ;display copyright message 00C720 1 A0 CE ldy #