Fixed firmware for v3 board

This commit is contained in:
Terence Boldt 2021-12-22 09:37:54 -05:00
parent 62c7343258
commit 63f7ded969
9 changed files with 439 additions and 280 deletions

Binary file not shown.

View File

@ -8,166 +8,167 @@
blockHalfCounter = $FF
;ProDOS defines
command = $42 ;ProDOS command
unit = $43 ;7=drive 6-4=slot 3-0=not used
buflo = $44 ;low address of buffer
bufhi = $45 ;hi address of buffer
blklo = $46 ;low block
blkhi = $47 ;hi block
ioerr = $27 ;I/O error code
nodev = $28 ;no device connected
wperr = $2B ;write protect error
command = $42 ;ProDOS command
unit = $43 ;7=drive 6-4=slot 3-0=not used
buflo = $44 ;low address of buffer
bufhi = $45 ;hi address of buffer
blklo = $46 ;low block
blkhi = $47 ;hi block
ioerr = $27 ;I/O error code
nodev = $28 ;no device connected
wperr = $2B ;write protect error
;for relocatable code, address to jump to instead of JSR absolute + RTS
jumpAddressLo = $FA
jumpAddressHi = $FB
ioAddressLo = $FC
ioAddressHi = $FD
knownRts = $FF58
knownRts = $FF58
.org $C700
;code is relocatable
; but set to $c700 for
; readability
.org $C700
;code is relocatable
; but set to $c700 for
; readability
;ID bytes for booting and drive detection
cpx #$20 ;ID bytes for ProDOS and the
cpx #$00 ; Apple Autostart ROM
cpx #$03 ;
cpx #$3C ;this one for older II's
cpx #$20 ;ID bytes for ProDOS and the
ldy #$00 ; Apple Autostart ROM
cpx #$03 ;
cpx #$3C ;this one for older II's
;zero out block numbers and buffer address
sty buflo
sty blklo
sty blkhi
sty buflo
sty blklo
sty blkhi
iny ;set command = 1 for read block
sty command
sty jumpAddressLo ;$01 of $0801 where boot code starts
jsr knownRts ;jump to known RTS to get our address from the stack
sty command
sty jumpAddressLo ;$01 of $0801 where boot code starts
jsr knownRts ;jump to known RTS to get our address from the stack
tsx
lda $0100,x ;this for example would be $C7 in slot 7
sta bufhi ;keep the slot here
asl
asl
asl
asl
tax
lda $0100,x ;this for example would be $C7 in slot 7
sta bufhi ;keep the slot here
asl
asl
asl
asl
tax
;display copyright message
ldy #<text
drawtxt: lda (buflo),y
sta $07D0,y ;put text on last line
ldy #<text
drawtxt:
lda (buflo),y
sta $07D0,y ;put text on last line
iny
bne drawtxt
bne drawtxt
;load block 0000 at $0800
lda #$08
sta bufhi
sta jumpAddressHi
stx unit
bne start
lda #$08
sta bufhi
sta jumpAddressHi
stx unit
bne start
;This is the ProDOS entry point for this card
entry:
lda #<knownRts
sta jumpAddressLo
lda #>knownRts
sta jumpAddressHi
lda #<knownRts
sta jumpAddressLo
lda #>knownRts
sta jumpAddressHi
start:
lda #$C0
sta ioAddressHi
jsr knownRts
lda #$C0
sta ioAddressHi
jsr knownRts
tsx
lda $0100,x
asl a
asl a
asl a
asl a
lda $0100,x
asl a
asl a
asl a
asl a
tax
cpx unit ;make sure same as ProDOS
beq docmd ;yep, do command
sec ;nope, set device not connected
lda #nodev
rts ;go back to ProDOS
cpx unit ;make sure same as ProDOS
beq docmd ;yep, do command
sec ;nope, set device not connected
lda #nodev
rts ;go back to ProDOS
docmd:
lda command
beq getstat ;command 0 is GetStatus
cmp #$01
beq readblk ;command 1 is ReadBlock
sec ;Format/Write not permitted
lda #wperr ;write protect error
rts ;go back to ProDOS
beq getstat ;command 0 is GetStatus
cmp #$01
beq readblk ;command 1 is ReadBlock
sec ;Format/Write not permitted
lda #wperr ;write protect error
rts ;go back to ProDOS
getstat:
clc ;send back status
lda #$00 ;good status
ldx #$00 ;1024 blocks
ldy #$04 ;
clc ;send back status
lda #$00 ;good status
ldx #$00 ;1024 blocks
ldy #$04 ;
rts
readblk:
lda blkhi ;get hi block
asl a ;shift up to top 3 bits
asl a ;since that's all the high
asl a ;blocks we can handle
asl a ;
asl a ;
sta highLatch ;save it in scratch ram 0
lda blkhi ;get hi block
asl a ;shift up to top 3 bits
asl a ;since that's all the high
asl a ;blocks we can handle
asl a ;
asl a ;
sta highLatch ;save it in scratch ram 0
;so we can stuff it in the
;high latch later
lda blklo ;get low block
lsr a ;shift so we get the top 5
lsr a ;bits - this also goes in
lsr a ;the high latch
ora highLatch ;add it to those top 3 bits
sta highLatch ;save it back in scratch ram
lda blklo ;get low block
asl a ;shift it to top 3 bits
asl a ;
asl a ;
asl a ;
asl a ;
sta lowLatch
lda #$02
sta blockHalfCounter
lda blklo ;get low block
lsr a ;shift so we get the top 5
lsr a ;bits - this also goes in
lsr a ;the high latch
ora highLatch ;add it to those top 3 bits
sta highLatch ;save it back in scratch ram
lda blklo ;get low block
asl a ;shift it to top 3 bits
asl a ;
asl a ;
asl a ;
asl a ;
sta lowLatch
lda #$02
sta blockHalfCounter
;This gets 256 bytes from the ROM card
read256:
ldy #$00
lda highLatch ;get high latch value
sta writeLatchHigh,x ;set high latch for card
ldy #$00
lda highLatch ;get high latch value
sta writeLatchHigh,x ;set high latch for card
loop256:
lda lowLatch
sta writeLatchLow,x
lda lowLatch
sta writeLatchLow,x
txa
ora #$80
sta ioAddressLo
ora #$80
sta ioAddressLo
loop16:
sty tempY
ldy #$00
lda (ioAddressLo),y
ldy tempY
sta (buflo),y
sty tempY
ldy #$00
lda (ioAddressLo),y
ldy tempY
sta (buflo),y
iny
inc ioAddressLo
lda ioAddressLo
and #$0F
bne loop16
inc lowLatch
cpy #$00
bne loop256
dec blockHalfCounter
bne readnext256
dec bufhi
clc ;clear error code for success
lda #$00
rts ;return to ProDOS
inc ioAddressLo
lda ioAddressLo
and #$0F
bne loop16
inc lowLatch
cpy #$00
bne loop256
dec blockHalfCounter
bne readnext256
dec bufhi
clc ;clear error code for success
lda #$00
jmp (jumpAddressLo)
readnext256:
inc bufhi
clc
bcc read256
inc bufhi
clc
bcc read256
;macro for string with high-bit set
.macro aschi str
@ -176,9 +177,9 @@ readnext256:
.endrep
.endmacro
text: aschi "ROM-Drive (c)1998-2021 Terence J. Boldt"
text: aschi "ROM-Drive (c)1998-2021 Terence J. Boldt"
end:
.byte 0
.byte 0
; These bytes need to be at the top of the 256 byte firmware as ProDOS
; uses these to find the entry point and drive capabilities
@ -187,7 +188,7 @@ end:
.byte 0
.endrepeat
.byte 0,0 ;0000 blocks = check status
.byte 3 ;bit 0=read 1=status
.byte entry&$00FF ;low byte of entry
.byte 0,0 ;0000 blocks = check status
.byte 3 ;bit 0=read 1=status
.byte <entry ;low byte of entry

Binary file not shown.

View File

@ -12,191 +12,201 @@ Current file: Firmware.asm
000000r 1 blockHalfCounter = $FF
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 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, address to jump to instead of JSR absolute + RTS
000000r 1 jumpAddressLo = $FA
000000r 1 jumpAddressHi = $FB
000000r 1 ioAddressLo = $FC
000000r 1 ioAddressHi = $FD
000000r 1 knownRts = $FF58
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
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 E0 00 cpx #$00 ; Apple Autostart ROM
00C704 1 E0 03 cpx #$03 ;
00C706 1 E0 3C cpx #$3C ;this one for older II's
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
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 84 FA sty jumpAddressLo ;$01 of $0801 where boot code starts
00C713 1 20 58 FF jsr knownRts ;jump to known RTS to get our address from the stack
00C70F 1 84 42 sty command
00C711 1 84 FA sty jumpAddressLo ;$01 of $0801 where boot code starts
00C713 1 20 58 FF jsr knownRts ;jump to known RTS to get our address from the stack
00C716 1 BA tsx
00C717 1 BD 00 01 lda $0100,x ;this for example would be $C7 in slot 7
00C71A 1 85 45 sta bufhi ;keep the slot here
00C71C 1 0A asl
00C71D 1 0A asl
00C71E 1 0A asl
00C71F 1 0A asl
00C720 1 AA tax
00C717 1 BD 00 01 lda $0100,x ;this for example would be $C7 in slot 7
00C71A 1 85 45 sta bufhi ;keep the slot here
00C71C 1 0A asl
00C71D 1 0A asl
00C71E 1 0A asl
00C71F 1 0A asl
00C720 1 AA tax
00C721 1
00C721 1 ;display copyright message
00C721 1 A0 C1 ldy #<text
00C723 1 B1 44 drawtxt: lda (buflo),y
00C725 1 99 D0 07 sta $07D0,y ;put text on last line
00C721 1 A0 C3 ldy #<text
00C723 1 drawtxt:
00C723 1 B1 44 lda (buflo),y
00C725 1 99 D0 07 sta $07D0,y ;put text on last line
00C728 1 C8 iny
00C729 1 D0 F8 bne drawtxt
00C729 1 D0 F8 bne drawtxt
00C72B 1
00C72B 1 ;load block 0000 at $0800
00C72B 1 A9 08 lda #$08
00C72D 1 85 45 sta bufhi
00C72F 1 85 FB sta jumpAddressHi
00C731 1 86 43 stx unit
00C733 1 D0 08 bne start
00C72B 1 A9 08 lda #$08
00C72D 1 85 45 sta bufhi
00C72F 1 85 FB sta jumpAddressHi
00C731 1 86 43 stx unit
00C733 1 D0 08 bne start
00C735 1 ;This is the ProDOS entry point for this card
00C735 1 entry:
00C735 1 A9 58 lda #<knownRts
00C737 1 85 FA sta jumpAddressLo
00C739 1 A9 FF lda #>knownRts
00C73B 1 85 FB sta jumpAddressHi
00C735 1 A9 58 lda #<knownRts
00C737 1 85 FA sta jumpAddressLo
00C739 1 A9 FF lda #>knownRts
00C73B 1 85 FB sta jumpAddressHi
00C73D 1 start:
00C73D 1 A9 C0 lda #$C0
00C73F 1 85 FD sta ioAddressHi
00C741 1 20 58 FF jsr knownRts
00C73D 1 A9 C0 lda #$C0
00C73F 1 85 FD sta ioAddressHi
00C741 1 20 58 FF jsr knownRts
00C744 1 BA tsx
00C745 1 BD 00 01 lda $0100,x
00C748 1 0A asl a
00C749 1 0A asl a
00C74A 1 0A asl a
00C74B 1 0A asl a
00C745 1 BD 00 01 lda $0100,x
00C748 1 0A asl a
00C749 1 0A asl a
00C74A 1 0A asl a
00C74B 1 0A asl a
00C74C 1 AA tax
00C74D 1 E4 43 cpx unit ;make sure same as ProDOS
00C74F 1 F0 04 beq docmd ;yep, do command
00C751 1 38 sec ;nope, set device not connected
00C752 1 A9 28 lda #nodev
00C754 1 60 rts ;go back to ProDOS
00C74D 1 E4 43 cpx unit ;make sure same as ProDOS
00C74F 1 F0 04 beq docmd ;yep, do command
00C751 1 38 sec ;nope, set device not connected
00C752 1 A9 28 lda #nodev
00C754 1 60 rts ;go back to ProDOS
00C755 1
00C755 1 docmd:
00C755 1 A5 42 lda command
00C757 1 F0 08 beq getstat ;command 0 is GetStatus
00C759 1 C9 01 cmp #$01
00C75B 1 F0 0C beq readblk ;command 1 is ReadBlock
00C75D 1 38 sec ;Format/Write not permitted
00C75E 1 A9 2B lda #wperr ;write protect error
00C760 1 60 rts ;go back to ProDOS
00C757 1 F0 08 beq getstat ;command 0 is GetStatus
00C759 1 C9 01 cmp #$01
00C75B 1 F0 0C beq readblk ;command 1 is ReadBlock
00C75D 1 38 sec ;Format/Write not permitted
00C75E 1 A9 2B lda #wperr ;write protect error
00C760 1 60 rts ;go back to ProDOS
00C761 1
00C761 1 getstat:
00C761 1 18 clc ;send back status
00C762 1 A9 00 lda #$00 ;good status
00C764 1 A2 00 ldx #$00 ;1024 blocks
00C766 1 A0 04 ldy #$04 ;
00C761 1 18 clc ;send back status
00C762 1 A9 00 lda #$00 ;good status
00C764 1 A2 00 ldx #$00 ;1024 blocks
00C766 1 A0 04 ldy #$04 ;
00C768 1 60 rts
00C769 1
00C769 1 readblk:
00C769 1 A5 47 lda blkhi ;get hi block
00C76B 1 0A asl a ;shift up to top 3 bits
00C76C 1 0A asl a ;since that's all the high
00C76D 1 0A asl a ;blocks we can handle
00C76E 1 0A asl a ;
00C76F 1 0A asl a ;
00C770 1 85 F8 sta highLatch ;save it in scratch ram 0
00C769 1 A5 47 lda blkhi ;get hi block
00C76B 1 0A asl a ;shift up to top 3 bits
00C76C 1 0A asl a ;since that's all the high
00C76D 1 0A asl a ;blocks we can handle
00C76E 1 0A asl a ;
00C76F 1 0A asl a ;
00C770 1 85 F8 sta highLatch ;save it in scratch ram 0
00C772 1 ;so we can stuff it in the
00C772 1 ;high latch later
00C772 1 A5 46 lda blklo ;get low block
00C774 1 4A lsr a ;shift so we get the top 5
00C775 1 4A lsr a ;bits - this also goes in
00C776 1 4A lsr a ;the high latch
00C777 1 05 F8 ora highLatch ;add it to those top 3 bits
00C779 1 85 F8 sta highLatch ;save it back in scratch ram
00C77B 1 A5 46 lda blklo ;get low block
00C77D 1 0A asl a ;shift it to top 3 bits
00C77E 1 0A asl a ;
00C77F 1 0A asl a ;
00C780 1 0A asl a ;
00C781 1 0A asl a ;
00C782 1 85 F9 sta lowLatch
00C784 1 A9 02 lda #$02
00C786 1 85 FF sta blockHalfCounter
00C772 1 A5 46 lda blklo ;get low block
00C774 1 4A lsr a ;shift so we get the top 5
00C775 1 4A lsr a ;bits - this also goes in
00C776 1 4A lsr a ;the high latch
00C777 1 05 F8 ora highLatch ;add it to those top 3 bits
00C779 1 85 F8 sta highLatch ;save it back in scratch ram
00C77B 1 A5 46 lda blklo ;get low block
00C77D 1 0A asl a ;shift it to top 3 bits
00C77E 1 0A asl a ;
00C77F 1 0A asl a ;
00C780 1 0A asl a ;
00C781 1 0A asl a ;
00C782 1 85 F9 sta lowLatch
00C784 1 A9 02 lda #$02
00C786 1 85 FF sta blockHalfCounter
00C788 1
00C788 1 ;This gets 256 bytes from the ROM card
00C788 1
00C788 1 read256:
00C788 1 A0 00 ldy #$00
00C78A 1 A5 F8 lda highLatch ;get high latch value
00C78C 1 9D 81 C0 sta writeLatchHigh,x ;set high latch for card
00C788 1 A0 00 ldy #$00
00C78A 1 A5 F8 lda highLatch ;get high latch value
00C78C 1 9D 81 C0 sta writeLatchHigh,x ;set high latch for card
00C78F 1 loop256:
00C78F 1 A5 F9 lda lowLatch
00C791 1 9D 80 C0 sta writeLatchLow,x
00C78F 1 A5 F9 lda lowLatch
00C791 1 9D 80 C0 sta writeLatchLow,x
00C794 1 8A txa
00C795 1 09 80 ora #$80
00C797 1 85 FC sta ioAddressLo
00C795 1 09 80 ora #$80
00C797 1 85 FC sta ioAddressLo
00C799 1 loop16:
00C799 1 84 FE sty tempY
00C79B 1 A0 00 ldy #$00
00C79D 1 B1 FC lda (ioAddressLo),y
00C79F 1 A4 FE ldy tempY
00C7A1 1 91 44 sta (buflo),y
00C799 1 84 FE sty tempY
00C79B 1 A0 00 ldy #$00
00C79D 1 B1 FC lda (ioAddressLo),y
00C79F 1 A4 FE ldy tempY
00C7A1 1 91 44 sta (buflo),y
00C7A3 1 C8 iny
00C7A4 1 E6 FC inc ioAddressLo
00C7A6 1 A5 FC lda ioAddressLo
00C7A8 1 29 0F and #$0F
00C7AA 1 D0 ED bne loop16
00C7AC 1 E6 F9 inc lowLatch
00C7AE 1 C0 00 cpy #$00
00C7B0 1 D0 DD bne loop256
00C7B2 1 C6 FF dec blockHalfCounter
00C7B4 1 D0 06 bne readnext256
00C7B6 1 C6 45 dec bufhi
00C7B8 1 18 clc ;clear error code for success
00C7B9 1 A9 00 lda #$00
00C7BB 1 60 rts ;return to ProDOS
00C7BC 1
00C7BC 1 readnext256:
00C7BC 1 E6 45 inc bufhi
00C7BE 1 18 clc
00C7BF 1 90 C7 bcc read256
00C7C1 1
00C7C1 1 ;macro for string with high-bit set
00C7C1 1 .macro aschi str
00C7C1 1 .repeat .strlen (str), c
00C7C1 1 .byte .strat (str, c) | $80
00C7C1 1 .endrep
00C7C1 1 .endmacro
00C7C1 1
00C7C1 1 D2 CF CD AD text: aschi "ROM-Drive (c)1998-2021 Terence J. Boldt"
00C7C5 1 C4 F2 E9 F6
00C7C9 1 E5 A0 A8 E3
00C7E8 1 end:
00C7E8 1 00 .byte 0
00C7E9 1
00C7E9 1 ; These bytes need to be at the top of the 256 byte firmware as ProDOS
00C7E9 1 ; uses these to find the entry point and drive capabilities
00C7E9 1
00C7E9 1 00 00 00 00 .repeat 251-<end
00C7ED 1 00 00 00 00
00C7F1 1 00 00 00 00
00C7A4 1 E6 FC inc ioAddressLo
00C7A6 1 A5 FC lda ioAddressLo
00C7A8 1 29 0F and #$0F
00C7AA 1 D0 ED bne loop16
00C7AC 1 E6 F9 inc lowLatch
00C7AE 1 C0 00 cpy #$00
00C7B0 1 D0 DD bne loop256
00C7B2 1 C6 FF dec blockHalfCounter
00C7B4 1 D0 08 bne readnext256
00C7B6 1 C6 45 dec bufhi
00C7B8 1 18 clc ;clear error code for success
00C7B9 1 A9 00 lda #$00
00C7BB 1 6C FA 00 jmp (jumpAddressLo)
00C7BE 1
00C7BE 1 readnext256:
00C7BE 1 E6 45 inc bufhi
00C7C0 1 18 clc
00C7C1 1 90 C5 bcc read256
00C7C3 1
00C7C3 1 ;macro for string with high-bit set
00C7C3 1 .macro aschi str
00C7C3 1 .repeat .strlen (str), c
00C7C3 1 .byte .strat (str, c) | $80
00C7C3 1 .endrep
00C7C3 1 .endmacro
00C7C3 1
00C7C3 1 D2 CF CD AD text: aschi "ROM-Drive (c)1998-2021 Terence J. Boldt"
00C7C7 1 C4 F2 E9 F6
00C7CB 1 E5 A0 A8 E3
00C7CF 1 A9 B1 B9 B9
00C7D3 1 B8 AD B2 B0
00C7D7 1 B2 B1 A0 D4
00C7DB 1 E5 F2 E5 EE
00C7DF 1 E3 E5 A0 CA
00C7E3 1 AE A0 C2 EF
00C7E7 1 EC E4 F4
00C7EA 1 end:
00C7EA 1 00 .byte 0
00C7EB 1
00C7EB 1 ; These bytes need to be at the top of the 256 byte firmware as ProDOS
00C7EB 1 ; uses these to find the entry point and drive capabilities
00C7EB 1
00C7EB 1 00 00 00 00 .repeat 251-<end
00C7EF 1 00 00 00 00
00C7F3 1 00 00 00 00
00C7F7 1 00 00 00 00
00C7FB 1 00
00C7FC 1 .byte 0
00C7FC 1 .endrepeat
00C7FC 1
00C7FC 1 00 00 .byte 0,0 ;0000 blocks = check status
00C7FE 1 03 .byte 3 ;bit 0=read 1=status
00C7FF 1 35 .byte entry&$00FF ;low byte of entry
00C7FC 1 00 00 .byte 0,0 ;0000 blocks = check status
00C7FE 1 03 .byte 3 ;bit 0=read 1=status
00C7FF 1 35 .byte <entry ;low byte of entry
00C800 1
00C800 1

BIN
Firmware/GamesWithFirmware.po Executable file

Binary file not shown.

View File

@ -1 +1,46 @@
.byte "Do not overwrite any of blocks after this point as it is used for the firmware. There are 7 copies of the 256 byte firmware, one for each slot due to 6502 code being non-relocatable. Have fun and feel free to improve on the hardware / sofware. --- Terence"
printChar = $FDED
home = $FC58
.org $2000
jsr home
ldy #$0
nextChar:
lda text,y
beq infiniteLoop
jsr printChar
iny
clc
bcc nextChar
infiniteLoop:
clc
bcc infiniteLoop ;hang for eternity
.macro aschi str
.repeat .strlen (str), c
.byte .strat (str, c) | $80
.endrep
.endmacro
text:
aschi "Block 0001 normally reserved for SOS"
.byte $8D
aschi "boot contains the firmware for the"
.byte $8D
aschi "ProDOS ROM-Drive."
.byte $8D
.byte $8D
aschi "(c)1998 - 2021 Terence J. Boldt"
.byte $8D
.byte $8D
aschi "github.com/tjboldt/ProDOS-ROMDrive"
.byte $8D
.byte $8D
aschi "Do NOT overwrite Block 0001"
end:
.byte 0
.repeat 255-<end
.byte 0
.endrepeat

103
Firmware/Warning.lst Normal file
View File

@ -0,0 +1,103 @@
ca65 V2.18 - N/A
Main file : Warning.asm
Current file: Warning.asm
000000r 1 printChar = $FDED
000000r 1 home = $FC58
000000r 1
000000r 1 .org $2000
002000 1
002000 1 20 58 FC jsr home
002003 1 A0 00 ldy #$0
002005 1 nextChar:
002005 1 B9 14 20 lda text,y
002008 1 F0 07 beq infiniteLoop
00200A 1 20 ED FD jsr printChar
00200D 1 C8 iny
00200E 1 18 clc
00200F 1 90 F4 bcc nextChar
002011 1 infiniteLoop:
002011 1 18 clc
002012 1 90 FD bcc infiniteLoop ;hang for eternity
002014 1
002014 1 .macro aschi str
002014 1 .repeat .strlen (str), c
002014 1 .byte .strat (str, c) | $80
002014 1 .endrep
002014 1 .endmacro
002014 1
002014 1 text:
002014 1 C2 EC EF E3 aschi "Block 0001 normally reserved for SOS"
002018 1 EB A0 B0 B0
00201C 1 B0 B1 A0 EE
002020 1 EF F2 ED E1
002024 1 EC EC F9 A0
002028 1 F2 E5 F3 E5
00202C 1 F2 F6 E5 E4
002030 1 A0 E6 EF F2
002034 1 A0 D3 CF D3
002038 1 8D .byte $8D
002039 1 E2 EF EF F4 aschi "boot contains the firmware for the"
00203D 1 A0 E3 EF EE
002041 1 F4 E1 E9 EE
002045 1 F3 A0 F4 E8
002049 1 E5 A0 E6 E9
00204D 1 F2 ED F7 E1
002051 1 F2 E5 A0 E6
002055 1 EF F2 A0 F4
002059 1 E8 E5
00205B 1 8D .byte $8D
00205C 1 D0 F2 EF C4 aschi "ProDOS ROM-Drive."
002060 1 CF D3 A0 D2
002064 1 CF CD AD C4
002068 1 F2 E9 F6 E5
00206C 1 AE
00206D 1 8D .byte $8D
00206E 1 8D .byte $8D
00206F 1 A8 E3 A9 B1 aschi "(c)1998 - 2021 Terence J. Boldt"
002073 1 B9 B9 B8 A0
002077 1 AD A0 B2 B0
00207B 1 B2 B1 A0 D4
00207F 1 E5 F2 E5 EE
002083 1 E3 E5 A0 CA
002087 1 AE A0 C2 EF
00208B 1 EC E4 F4
00208E 1 8D .byte $8D
00208F 1 8D .byte $8D
002090 1 E7 E9 F4 E8 aschi "github.com/tjboldt/ProDOS-ROMDrive"
002094 1 F5 E2 AE E3
002098 1 EF ED AF F4
00209C 1 EA E2 EF EC
0020A0 1 E4 F4 AF D0
0020A4 1 F2 EF C4 CF
0020A8 1 D3 AD D2 CF
0020AC 1 CD C4 F2 E9
0020B0 1 F6 E5
0020B2 1 8D .byte $8D
0020B3 1 8D .byte $8D
0020B4 1 C4 EF A0 CE aschi "Do NOT overwrite Block 0001"
0020B8 1 CF D4 A0 EF
0020BC 1 F6 E5 F2 F7
0020C0 1 F2 E9 F4 E5
0020C4 1 A0 C2 EC EF
0020C8 1 E3 EB A0 B0
0020CC 1 B0 B0 B1
0020CF 1
0020CF 1 end:
0020CF 1 00 .byte 0
0020D0 1
0020D0 1 00 00 00 00 .repeat 255-<end
0020D4 1 00 00 00 00
0020D8 1 00 00 00 00
0020DC 1 00 00 00 00
0020E0 1 00 00 00 00
0020E4 1 00 00 00 00
0020E8 1 00 00 00 00
0020EC 1 00 00 00 00
0020F0 1 00 00 00 00
0020F4 1 00 00 00 00
0020F8 1 00 00 00 00
0020FC 1 00 00 00 00
0020D0 1 .byte 0
0020D0 1 .endrepeat
0020D0 1

View File

@ -1,12 +1,13 @@
#!/bin/sh
ca65 Warning.asm -o warning.o
ca65 Firmware.asm -o firmware.o --listing Firmware.lst
ca65 Warning.asm -o warning.o --listing Warning.lst --list-bytes 255 || exit 1
ca65 Firmware.asm -o firmware.o --listing Firmware.lst --list-bytes 255 || exit 1
ld65 -t none warning.o firmware.o -o Firmware.bin
ld65 -t none warning.o firmware.o -o Firmware.bin || exit 1
# assumes ProDOS-Utilities is in your path: https://github.com/tjboldt/ProDOS-Utilities
rm BlankDriveWithFirmware.po
ProDOS-Utilities -c create -d BlankDriveWithFirmware.po -v ROM -s 2048
ProDOS-Utilities -b 0x0001 -c writeblock -d BlankDriveWithFirmware.po -i Firmware.bin
ProDOS-Utilities -b 0x0001 -c readblock -d BlankDriveWithFirmware.po
ProDOS-Utilities -c ls -d BlankDriveWithFirmware.po
rm BlankDriveWithFirmware.po || exit 1
ProDOS-Utilities -c create -d BlankDriveWithFirmware.po -v ROM -s 2048 || exit 1
ProDOS-Utilities -b 0x0001 -c writeblock -d GamesWithFirmware.po -i Firmware.bin || exit 1
ProDOS-Utilities -b 0x0001 -c writeblock -d BlankDriveWithFirmware.po -i Firmware.bin || exit 1
ProDOS-Utilities -b 0x0001 -c readblock -d BlankDriveWithFirmware.po || exit 1
ProDOS-Utilities -c ls -d BlankDriveWithFirmware.po || exit 1

View File

@ -1,11 +1,13 @@
# NOTE!
This branch is untested and just here as a work in progress. Do NOT use. Use main branch instead.
# v3
This is a new revision of the hardware, incompatible with previous firmware and drive image. If you have a v2.5 board, see the v2.5 tag [here](https://github.com/tjboldt/ProDOS-ROM-Drive/tree/v2.5)
# ProDOS ROM-Drive
This is a peripheral card for the Apple ][ series computers that acts as a read-only solid state disk drive (SSD) all in EPROM. Although it won't run DOS, it is fully ProDOS compatible and will appear as a read-only hard drive even when booting from another drive. It holds 1024 KB of disk data with the 256 byte firmware stored in block 0001 where the SOS boot loader normally resides. The drive boots ProDOS and into BASIC in under 1.5 seconds.
![Image of Board](/Hardware/ProDOS%20ROM-Drive%203.0%20Front.jpg)
You can order blank circuit boards from [PCBWay](https://www.pcbway.com/project/shareproject/ProDOS_ROM_Drive_v3_1903e388.html) or upload the provided gerber and drill files to any PCB manufacturer.
## History
My first Apple computer was an Apple //e that my brother bought in early 1984. Countless hours were spent playing games which developed my interest in building games. This also led to the creation of various utilities to help organize disks or just to see what could be done while programming.
@ -22,14 +24,11 @@ To build actual circuit boards, I tried making some by hand with marker, etching
In 2019, I decided to revisit the original design as I was disappointed that the original didn't have a solder mask and was rather large for what it was. I got the board much smaller but in the process of translating my two decade old hand written notes, I made a mistake on one control line. To actually call this project finished, I had to make another revision. I also noticed the revised board was slightly larger than a credit card so I worked for a couple weeks to optimize the lines and squeeze the two-layer board down to 3.375" x 2.125". The board here is that final revision 2.5 (note that references to first, second and third design are all the solderless breadboard prototypes leading up to the 1.0 circuit board printed in 1999, 2.0 was never made, 2.1 is the board with the error patched with a jumper wire and 2.2 through 2.4 were never made).
In 2021, the first and only issue was opened on the project requesting that the firmware be relocatable. I let that issue sit for a few months and then Ralle Palaveev supplied some relocatable firmware as a patch. I quickly realized that this could be placed into the second block on the drive normally reserved for SOS bootloader for the Apple ///, essentially allowing the full EPROM to be used for the drive. I disassembed Ralle's patch, merged it into the existing source
code and made a few updates to save a few bytes and add clarity.
In 2021, the first and only issue was opened on the project requesting that the firmware be relocatable. I let that issue sit for a few months and then Ralle Palaveev supplied some relocatable firmware as a patch. I quickly realized that this could be placed into the second block on the drive normally reserved for SOS bootloader for the Apple ///, essentially allowing the full EPROM to be used for the drive. I disassembed Ralle's patch, merged it into the existing source code and made a few updates to save a few bytes and add clarity.
## Notes
The firmware code needs to be assembled 7 times with different parameters specifying which slot to assemble for. It is probably easier to work from the EPROM image as it is already a 1 MB disk image with the firmware in the top four ProDOS blocks.
I usually use Ciderpress to copy files onto the drive image and then burn the file to a 27C801 EPROM with a GQ-4x4 USB Programmer.
I usually use Ciderpress to copy files onto the drive image and then burn the file to a 27C801 EPROM with a GQ-4x4 USB Programmer. Do NOT overwrite block 0001 as it contains the firmware for the card.
If you're planning on designing you own card, I highly recommend reading "Interfacing & Digital Experiments with your Apple" by Charles J. Engelisher and Apple's "Apple II Reference Manual" as well as "ProDOS Technical Reference Manual" if you want to build a drive. You also need an EPROM programmer, some chips and a prototyping board. My designs used simple logic gates to decode addresses but if you want to reduce chip count, you'll also need a PAL/GAL logic programmer (which some EPROM programmers can do).