mirror of
https://github.com/tjboldt/Apple2-IO-RPi.git
synced 2024-11-25 21:33:15 +00:00
143 lines
5.2 KiB
Plaintext
143 lines
5.2 KiB
Plaintext
ca65 V2.18 - N/A
|
|
Main file : MenuFirmware.asm
|
|
Current file: MenuFirmware.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
|
|
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 1 of EPROMi
|
|
00C70E 1 PageJump:
|
|
00C70E 1 8D F7 C0 sta OutputFlags
|
|
00C711 1 4C 19 C7 jmp Start
|
|
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 ;since the firmware page changes to 0, this falls through to the driver
|
|
00C719 1
|
|
00C719 1 Start:
|
|
00C719 1 A9 F0 lda #$f0 ;restore COUT after PR# called
|
|
00C71B 1 85 36 sta $36
|
|
00C71D 1 A9 FD lda #$fd
|
|
00C71F 1 85 37 sta $37
|
|
00C721 1 20 58 FC jsr $fc58 ;clear screen and show menu options
|
|
00C724 1 A0 00 ldy #$00
|
|
00C726 1 PrintString:
|
|
00C726 1 B9 42 C7 lda Text,y
|
|
00C729 1 F0 08 beq GetChar
|
|
00C72B 1 09 80 ora #$80
|
|
00C72D 1 20 ED FD jsr $fded
|
|
00C730 1 C8 iny
|
|
00C731 1 D0 F3 bne PrintString
|
|
00C733 1
|
|
00C733 1 GetChar:
|
|
00C733 1 20 0C FD jsr $fd0c
|
|
00C736 1 38 sec ;subtract ascii "1" to get 0 - 3 from "1" to "4"
|
|
00C737 1 E9 B1 sbc #$b1
|
|
00C739 1 0A asl ;put in top nibble as EPROM page
|
|
00C73A 1 0A asl
|
|
00C73B 1 0A asl
|
|
00C73C 1 0A asl
|
|
00C73D 1 09 0F ora #$0f ;set all flags high
|
|
00C73F 1 4C 0E C7 jmp PageJump
|
|
00C742 1
|
|
00C742 1 Text:
|
|
00C742 1
|
|
00C742 1 41 70 70 6C .byte "Apple2-IO-RPi",$8d
|
|
00C746 1 65 32 2D 49
|
|
00C74A 1 4F 2D 52 50
|
|
00C74E 1 69 8D
|
|
00C750 1 28 63 29 32 .byte "(c)2020-2021 Terence J. Boldt",$8d
|
|
00C754 1 30 32 30 2D
|
|
00C758 1 32 30 32 31
|
|
00C75C 1 20 54 65 72
|
|
00C760 1 65 6E 63 65
|
|
00C764 1 20 4A 2E 20
|
|
00C768 1 42 6F 6C 64
|
|
00C76C 1 74 8D
|
|
00C76E 1 8D .byte $8d
|
|
00C76F 1 31 2E 20 42 .byte "1. Boot",$8d
|
|
00C773 1 6F 6F 74 8D
|
|
00C777 1 32 2E 20 43 .byte "2. Command Line",$8d
|
|
00C77B 1 6F 6D 6D 61
|
|
00C77F 1 6E 64 20 4C
|
|
00C783 1 69 6E 65 8D
|
|
00C787 1 33 2E 20 46 .byte "3. File Access [NOT IMPLEMENTED]",$8d
|
|
00C78B 1 69 6C 65 20
|
|
00C78F 1 41 63 63 65
|
|
00C793 1 73 73 20 5B
|
|
00C797 1 4E 4F 54 20
|
|
00C79B 1 49 4D 50 4C
|
|
00C79F 1 45 4D 45 4E
|
|
00C7A3 1 54 45 44 5D
|
|
00C7A7 1 8D
|
|
00C7A8 1 8D .byte $8d
|
|
00C7A9 1 4D 61 79 20 .byte "May take 45 seconds for RPi to start",$8d
|
|
00C7AD 1 74 61 6B 65
|
|
00C7B1 1 20 34 35 20
|
|
00C7B5 1 73 65 63 6F
|
|
00C7B9 1 6E 64 73 20
|
|
00C7BD 1 66 6F 72 20
|
|
00C7C1 1 52 50 69 20
|
|
00C7C5 1 74 6F 20 73
|
|
00C7C9 1 74 61 72 74
|
|
00C7CD 1 8D
|
|
00C7CE 1 61 66 74 65 .byte "after intial power-on...",$00
|
|
00C7D2 1 72 20 69 6E
|
|
00C7D6 1 74 69 61 6C
|
|
00C7DA 1 20 70 6F 77
|
|
00C7DE 1 65 72 2D 6F
|
|
00C7E2 1 6E 2E 2E 2E
|
|
00C7E6 1 00
|
|
00C7E7 1
|
|
00C7E7 1 end:
|
|
00C7E7 1 60 rts
|
|
00C7E8 1
|
|
00C7E8 1 00 00 00 00 .repeat 251-<end
|
|
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
|