diff --git a/Apple2/27256.bin b/Apple2/27256.bin index 792458c..ef31f3b 100644 Binary files a/Apple2/27256.bin and b/Apple2/27256.bin differ diff --git a/Apple2/AT28C64B.bin b/Apple2/AT28C64B.bin index 873b927..091a4ac 100644 Binary files a/Apple2/AT28C64B.bin and b/Apple2/AT28C64B.bin differ diff --git a/Apple2/CommandFirmware.lst b/Apple2/CommandFirmware.lst index 0932251..cdc5937 100644 --- a/Apple2/CommandFirmware.lst +++ b/Apple2/CommandFirmware.lst @@ -1,4 +1,4 @@ -ca65 V2.19 - Git 59c58acb +ca65 V2.17 - Raspbian 2.17-1 Main file : CommandFirmware.asm Current file: CommandFirmware.asm diff --git a/Apple2/DriveFirmware.lst b/Apple2/DriveFirmware.lst index fde318e..07d8e55 100644 --- a/Apple2/DriveFirmware.lst +++ b/Apple2/DriveFirmware.lst @@ -1,4 +1,4 @@ -ca65 V2.19 - Git 59c58acb +ca65 V2.17 - Raspbian 2.17-1 Main file : DriveFirmware.asm Current file: DriveFirmware.asm diff --git a/Apple2/FileAccessFirmware.lst b/Apple2/FileAccessFirmware.lst index 9db6bd1..7cbda31 100644 --- a/Apple2/FileAccessFirmware.lst +++ b/Apple2/FileAccessFirmware.lst @@ -1,4 +1,4 @@ -ca65 V2.19 - Git 59c58acb +ca65 V2.17 - Raspbian 2.17-1 Main file : FileAccessFirmware.asm Current file: FileAccessFirmware.asm diff --git a/Apple2/MenuFirmware.asm b/Apple2/MenuFirmware.asm index d46b284..427ceca 100644 --- a/Apple2/MenuFirmware.asm +++ b/Apple2/MenuFirmware.asm @@ -23,6 +23,7 @@ ChangeDriveCommand = $04 ExecCommand = $05 LoadFileCommand = $06 SaveFileCommand = $07 +MenuCommand = $08 .org SLOT*$100 + $C000 ;ID bytes for booting and drive detection @@ -72,10 +73,18 @@ WaitForRPi: jmp WaitForRPi OK: - lda #$cf - jsr $fded - lda #$cb + jsr $fc58 ;clear screen + + lda #MenuCommand ;request menu text from RPi + jsr SendByte + +DumpOutput: + jsr GetByte + cmp #$00 + beq GetChar jsr $fded + clc + bcc DumpOutput GetChar: jsr $fd0c @@ -93,16 +102,47 @@ Text: .byte "Apple2-IO-RPi",$8d .byte "(c)2020-2021 Terence J. Boldt",$8d .byte $8d -.byte "1. Boot",$8d -.byte "2. Command Line",$8d -.byte "3. Load File",$8d -.byte $8d -.byte "May take 45 seconds for RPi to start",$8d -.byte "after intial power-on...",$00 +.byte "Waiting for RPi...",$00 -end: +SendByte: + pha +waitWrite: + lda InputFlags + rol + rol + bcs waitWrite + pla + sta OutputByte + lda #$3e ; set bit 0 low to indicate write started + sta OutputFlags +finishWrite: + lda InputFlags + rol + rol + bcc finishWrite + lda #$3f + sta OutputFlags rts +GetByte: + lda #$3d ;set read flag low + sta OutputFlags +waitRead: + lda InputFlags + rol + bcs waitRead + lda InputByte + pha + lda #$3f ;set all flags high + sta OutputFlags +finishRead: + lda InputFlags + rol + bcc finishRead + pla +end: + rts + .repeat 251-> 8) fileSizeLow := byte(fileSize & 255) - a2io.WriteByte(fileSizeLow) - a2io.WriteByte(fileSizeHigh) + err = a2io.WriteByte(fileSizeLow) + if err != nil { + return + } + err = a2io.WriteByte(fileSizeHigh) + if err != nil { + return + } buffer := make([]byte, fileSize) diff --git a/RaspberryPi/apple2driver/handlers/menu.go b/RaspberryPi/apple2driver/handlers/menu.go new file mode 100755 index 0000000..8e4fca1 --- /dev/null +++ b/RaspberryPi/apple2driver/handlers/menu.go @@ -0,0 +1,19 @@ +package handlers + +import ( + "fmt" + + "github.com/tjboldt/Apple2-IO-RPi/RaspberryPi/apple2driver/a2io" +) + +func MenuCommand() { + fmt.Printf("Sending menu...\n") + a2io.WriteString("Apple2-IO-RPi\r" + + "(c)2020-2021 Terence J. Boldt\r" + + "\r" + + "Select an option:\r" + + "\r" + + "1. Boot\r" + + "2. Command Line\r" + + "3. Load File\r") +}