Apple2-IO-RPi/Apple2/FileAccessFirmware.lst

148 lines
5.2 KiB
Plaintext
Raw Normal View History

ca65 V2.18 - N/A
Main file : FileAccessFirmware.asm
Current file: FileAccessFirmware.asm
000000r 1 ;ProDOS Zero Page
000000r 1 Command = $42 ;ProDOS Command
000000r 1 Unit = $43 ;ProDOS unit (SDDD0000)
000000r 1 BufferLo = $44
000000r 1 BufferHi = $45
000000r 1 BlockLo = $46
000000r 1 BlockHi = $47
000000r 1
000000r 1 ; ProDOS Error Codes
000000r 1 IOError = $27
000000r 1 NoDevice = $28
000000r 1 WriteProtect = $2B
000000r 1
000000r 1 InputByte = $c08e+SLOT*$10
000000r 1 OutputByte = $c08d+SLOT*$10
000000r 1 InputFlags = $c08b+SLOT*$10
000000r 1 OutputFlags = $c087+SLOT*$10
000000r 1
000000r 1 ReadBlockCommand = $01
000000r 1 WriteBlockCommand = $02
000000r 1 GetTimeCommand = $03
000000r 1 ChangeDriveCommand = $04
000000r 1 ExecCommand = $05
000000r 1 LoadFileCommand = $06
000000r 1 SaveFileCommand = $07
000000r 1
000000r 1 .org SLOT*$100 + $C000
2021-04-01 12:43:04 +00:00
00C700 1 ;ID bytes for booting and drive detection
00C700 1 E0 20 cpx #$20 ;ID bytes for ProDOS and the
00C702 1 E0 00 cpx #$00 ; Apple Autostart ROM
00C704 1 E0 03 cpx #$03 ;
00C706 1
00C706 1 A2 70 ldx #SLOT*$10
00C708 1 86 2B stx $2b
00C70A 1 86 43 stx Unit
00C70C 1
00C70C 1 ;force EPROM to second page on boot
00C70C 1 A9 3F lda #$3f ;set all flags high and page 3 of EPROM for menu
00C70E 1 PageJump:
00C70E 1 8D F7 C0 sta OutputFlags
00C711 1 4C 19 C7 jmp Start ;this jump is only called if coming in from PageJump with A=$2f
00C714 1
00C714 1 ;entry points for ProDOS
00C714 1 DriverEntry:
00C714 1 A9 0F lda #$0f ;set all flags high and page 0 of EPROM
00C716 1 8D F7 C0 sta OutputFlags
00C719 1
00C719 1 Start:
00C719 1
00C719 1 ; Put command firmware here
00C719 1 ;
00C719 1 ;
00C719 1 ;
00C719 1 60 rts
00C71A 1
00C71A 1 SendByte:
00C71A 1 48 pha
00C71B 1 waitWrite:
00C71B 1 AD FB C0 lda InputFlags
00C71E 1 2A rol
00C71F 1 2A rol
00C720 1 B0 F9 bcs waitWrite
00C722 1 68 pla
00C723 1 8D FD C0 sta OutputByte
00C726 1 A9 0E lda #$0e ; set bit 0 low to indicate write started
00C728 1 8D F7 C0 sta OutputFlags
00C72B 1 finishWrite:
00C72B 1 AD FB C0 lda InputFlags
00C72E 1 2A rol
00C72F 1 2A rol
00C730 1 90 F9 bcc finishWrite
00C732 1 A9 0F lda #$0f
00C734 1 8D F7 C0 sta OutputFlags
00C737 1 60 rts
00C738 1
00C738 1 GetByte:
00C738 1 A9 0D lda #$0d ;set read flag low
00C73A 1 8D F7 C0 sta OutputFlags
00C73D 1 waitRead:
00C73D 1 AD FB C0 lda InputFlags
00C740 1 2A rol
00C741 1 B0 FA bcs waitRead
00C743 1 AD FE C0 lda InputByte
00C746 1 48 pha
00C747 1 A9 0F lda #$0f ;set all flags high
00C749 1 8D F7 C0 sta OutputFlags
00C74C 1 finishRead:
00C74C 1 AD FB C0 lda InputFlags
00C74F 1 2A rol
00C750 1 90 FA bcc finishRead
00C752 1 68 pla
00C753 1 end:
00C753 1 60 rts
00C754 1
00C754 1 00 00 00 00 .repeat 251-<end
00C758 1 00 00 00 00
00C75C 1 00 00 00 00
00C760 1 00 00 00 00
00C764 1 00 00 00 00
00C768 1 00 00 00 00
00C76C 1 00 00 00 00
00C770 1 00 00 00 00
00C774 1 00 00 00 00
00C778 1 00 00 00 00
00C77C 1 00 00 00 00
00C780 1 00 00 00 00
00C784 1 00 00 00 00
00C788 1 00 00 00 00
00C78C 1 00 00 00 00
00C790 1 00 00 00 00
00C794 1 00 00 00 00
00C798 1 00 00 00 00
00C79C 1 00 00 00 00
00C7A0 1 00 00 00 00
00C7A4 1 00 00 00 00
00C7A8 1 00 00 00 00
00C7AC 1 00 00 00 00
00C7B0 1 00 00 00 00
00C7B4 1 00 00 00 00
00C7B8 1 00 00 00 00
00C7BC 1 00 00 00 00
00C7C0 1 00 00 00 00
00C7C4 1 00 00 00 00
00C7C8 1 00 00 00 00
00C7CC 1 00 00 00 00
00C7D0 1 00 00 00 00
00C7D4 1 00 00 00 00
00C7D8 1 00 00 00 00
00C7DC 1 00 00 00 00
00C7E0 1 00 00 00 00
00C7E4 1 00 00 00 00
00C7E8 1 00 00 00 00
00C7EC 1 00 00 00 00
00C7F0 1 00 00 00 00
00C7F4 1 00 00 00 00
00C7F8 1 00 00 00 00
00C7FC 1 .byte 0
00C7FC 1 .endrepeat
00C7FC 1 00 00 .byte 0,0 ;0000 blocks = check status
00C7FE 1 07 .byte 7 ;bit set(0=status 1=read 2=write) unset(3=format, 4/5=number of volumes, 6=interruptable, 7=removable)
00C7FF 1 14 .byte DriverEntry&$00FF ;low byte of entry
00C800 1
00C800 1