Add new ROM builds, updated A2PI image with new pidrive driver, and

remove delay in gpclk setting
This commit is contained in:
dschmenk 2015-02-27 08:08:42 -08:00
parent 19ec719d07
commit b0408fc485
14 changed files with 521 additions and 432 deletions

4
debian/changelog vendored
View File

@ -1,12 +1,10 @@
a2pi (0.2.0) unstable; urgency=low a2pi (0.2.0-1) unstable; urgency=low
=======
* Add support for Raspberry Pi version 2 * Add support for Raspberry Pi version 2
-- David Schmenk <dschmenk@gmail.com> Sun, 22 Feb 2015 13:27:30 -0800 -- David Schmenk <dschmenk@gmail.com> Sun, 22 Feb 2015 13:27:30 -0800
a2pi (0.1.8-8) unstable; urgency=low a2pi (0.1.8-8) unstable; urgency=low
=======
* Full ROM build * Full ROM build
* Add a2pi logo with transparent background * Add a2pi logo with transparent background

2
debian/postinst vendored
View File

@ -64,7 +64,7 @@ case "$1" in
if [ -e /usr/share/a2pi/A2VD1.PO ] || [ -L /usr/share/a2pi/A2VD1.PO ] ;then if [ -e /usr/share/a2pi/A2VD1.PO ] || [ -L /usr/share/a2pi/A2VD1.PO ] ;then
rm /usr/share/a2pi/A2VD1.PO rm /usr/share/a2pi/A2VD1.PO
fi fi
ln -s /usr/share/a2pi/A2PI-1.4.PO /usr/share/a2pi/A2VD1.PO ln -s /usr/share/a2pi/A2PI-1.5.PO /usr/share/a2pi/A2VD1.PO
fi fi
if [ ! -s /usr/share/a2pi/A2VD2.PO ] ; then if [ ! -s /usr/share/a2pi/A2VD2.PO ] ; then
if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then

View File

@ -1,6 +1,7 @@
.SUFFIXES = .SUFFIXES =
AFLAGS = -o $@ AFLAGS = -o $@
ROM = ROM\#062000 SIROM = SIROM\#062000
PIROM = PIROM\#062000
VDRV = PIDRIVE\#062000 VDRV = PIDRIVE\#062000
VCLK = PICLOCK\#062000 VCLK = PICLOCK\#062000
# #
@ -11,14 +12,18 @@ BINTYPE = \#060000
SYSTYPE = \#ff0000 SYSTYPE = \#ff0000
TXTTYPE = \#040000 TXTTYPE = \#040000
all: $(ROM) $(VDRV) $(VCLK) all: $(SIROM) $(PIROM) $(VDRV) $(VCLK)
clean: clean:
-rm $(ROM) $(VDRV) $(VCLK) *.o *~ -rm $(SIROM) $(PIROM) $(VDRV) $(VCLK) *.o *~
$(ROM): rom.s $(SIROM): sirom.s romincs.s cxrom.s c8rom.s
ca65 rom.s -o rom.o ca65 sirom.s -o sirom.o
ld65 -o $(ROM) -C rom.cfg rom.o ld65 -o $(SIROM) -C sirom.cfg sirom.o
$(PIROM): pirom.s romincs.s cxrom.s c8rom.s
ca65 pirom.s -o pirom.o
ld65 -o $(PIROM) -C pirom.cfg pirom.o
$(VDRV): pidrive.s $(VDRV): pidrive.s
ca65 pidrive.s -o pidrive.o ca65 pidrive.s -o pidrive.o

Binary file not shown.

242
pidrive/c8rom.s Executable file
View File

@ -0,0 +1,242 @@
;****************************************
;*
;* OPTION ROM SPACE @ $C800
;*
;****************************************
;*
;* RETURN SLOT*16 IN X REG, SLOT IN Y REG
;*
GETSLOT:
TSX
LDA $102,X ; GET MSB OF RETURN ADDRESS
STA IOSLOT
AND #$0F
TAY
LDA SLOT16
STA SAVE16,Y ; SAVE SLOT16 LOCATION
TYA
ASL
ASL
ASL
ASL
STA SLOT16
TAX
RTS
;*
;* OUTPUT BYTE TO ACIA
;*
SENDACC:
PHA
LDA SLOT16
ORA #$89+1 ; ACIASR
TAX
SENDWT: LDA $C000-1,X
AND #$10
BEQ SENDWT
DEX ; ACIADR
PLA
STA $C000-1,X ; AVOID PHANTOM READ OF DATA REG
RTS
;*
;* INPUT BYTE FROM ACIA
;*
RECVACC:
LDX SLOT16
RECVWT: LDA ACIASR,X
AND #$08
BEQ RECVWT
LDA ACIADR,X
RTS
;*
;* WAIT FOR DELAY
;*
WAIT: SEC
WAIT2: PHA
WAIT3: SBC #$01
BNE WAIT3
PLA
SBC #$01
BNE WAIT2
RTS
;*
;* SYNC WITH HOST
;*
SYNC: LDA INDCTR
PHA
LDA #$0B
STA ACIASR,X ; RESET STATUS REGISTER
STA ACIACR,X ; SET CONTROL REGISTER
LDA #$10
STA ACIAMR,X ; SET COMMAND REGISTER (115K BAUD)
LDA #$80
JSR WAIT
STA STROBE ; CLEAR KEYBOARD STROBE
SYNCLP: LDA #SYNC_REQ
JSR SENDACC
INY
TYA
AND #$07
TAY
LDA SPIN,Y
STA INDCTR
LDA #$FF
JSR WAIT
LDA KEYBD
BPL CHKRSP
STA STROBE
PLA
.IFNDEF DEBUG
STA INDCTR
.ENDIF
NODEV: LDA #PDNODEV
RTS
SPIN: DB $A1, $AF, $AD, $DC, $A1, $AF, $AD, $DC
CHKRSP: LDX SLOT16
LDA ACIASR,X
AND #$08
BEQ SYNCLP
LDA ACIADR,X
CMP #SYNC_ACK
BNE SYNCLP
LDA IOSLOT
AND #$0F
TAY
LDA #SYNC_ACK
STA SYNCED,Y
PLA
.IFNDEF DEBUG
STA INDCTR
.ENDIF
LDA #$00
RTS
RESYNC: JSR SYNC
BEQ DOCMD
RTS
;*
;* DO STATUS, READ, WRITE COMMAND
;*
DOCMD: LDA ACIACR,X ; CHECK FOR ANY REASON TO RESYNC
CMP #$0B
BNE RESYNC
LDA ACIAMR,X
CMP #$10
BNE RESYNC
LDA SYNCED,Y
CMP #SYNC_ACK
BNE RESYNC
LDA PDUNIT ; FORMAT COMMAND FOR SIDRIVE AND SEND IT
ASL
LDA PDCMD
ROL
ASL
ORA #$A0
JSR SENDACC
CLC
ADC #$01
STA CMDACK,Y
LDA PDBLKL
JSR SENDACC
LDA PDBLKH
JSR SENDACC
CHKACK: JSR RECVACC ; WAIT FOR CORRECT ACK (MAY BE OUTSTANDING A2PI REQUESTS)
CMP CMDACK,Y
BNE CHKACK
;*
;* BRANCH TO COMMAND HANDLER
;*
LDA PDCMD
AND #$03
TAY ; CPY #PDSTATUS
BEQ STATUS
DEY ; CPY #PDREAD
BEQ RDBLK
DEY ; CPY #PDWRITE
BEQ WRBLK
.IFDEF DEBUG
LDA #'?'
STA INDCTR+6
.ENDIF
IOERR: LDA #PDIOERR
RTS
;*
;* SIDRIVE STATUS - RETURN NUMBER OF BLOCKS OR NODEV
;*
STATUS:
.IFDEF DEBUG
LDA #'S'-$40
STA INDCTR+3
.ENDIF
LDA IOSLOT
AND #$0F
TAY
JSR RECVACC
STA SCRTCH6,Y
JSR RECVACC
STA SCRTCH7,Y
JSR RECVACC
PHA
LDX SCRTCH6,Y
LDA SCRTCH7,Y
TAY
PLA
RTS
;*
;* READ A BLOCK (512 BYTES) FROM SIDRIVE
;*
RDBLK:
.IFDEF DEBUG
LDA #'R'-$40 ; LDY #$00
STA INDCTR+4
.ENDIF
RDBLKL: JSR RECVACC
STA (PDBUFF),Y
INY
BNE RDBLKL
INC PDBUFH
RDBLKH: JSR RECVACC
STA (PDBUFF),Y
INY
BNE RDBLKH
JMP RECVACC
;*
;* WRITE A BLOCK (512 BYTES) TO SIDRIVE
;*
WRBLK:
.IFDEF DEBUG
LDA #'W'-$40 ; LDY #$00
STA INDCTR+5
.ENDIF
WRBLKL: LDA (PDBUFF),Y
JSR SENDACC
INY
BNE WRBLKL
INC PDBUFH
WRBLKH: LDA (PDBUFF),Y
JSR SENDACC
INY
BNE WRBLKH
JMP RECVACC
.IFDEF ALTBOOT
;*
;* PRINT THE BOOT MESSAGE AT THE TOP OF THE SCREEN
;*
PUTMSG: LDY #$00
PUTC: LDA MSG,Y
BMI FILLEOL
ORA #$80
STA MSGLN,Y
INY
BNE PUTC
MSG: DB "PRESS 'M' FOR BOOT MENU", $A0
;*
;* CLEAR THE MESSAGE AT THE TOP OF THE SCREEN
;*
CLRMSG: LDY #$00
LDA #$A0
FILLEOL:
STA MSGLN,Y
INY
CPY #40
BNE FILLEOL
RTS
.ENDIF

147
pidrive/cxrom.s Executable file
View File

@ -0,0 +1,147 @@
;****************************************
;*
;* SLOT INDEPENDENT ROM CODE @ $Cn00
;*
;****************************************
CXSLOT EQU *
;*
;* AUTOSTART BOOT SIGNATURE
;*
LDX #$20
LDY #$00
LDX #$03
STX $3C
;*
;* AUTOSTART/PR# ENTRYPOINT
;*
.IFDEF DEBUG
LDA #'*'
STA INDCTR+7
.ENDIF
PHP
SEI
STA XROMOFF
.IFDEF PIROM
LDA #$01
STA BANKSEL
.ENDIF
JSR GETSLOT
LDA #$00
STA SYNCED,Y ; CLEAR SYNCED FLAG
JSR SYNC
BNE NOBOOT
;*
;* CREATE COMMAND BUFFER FOR BOOT BLOCK
;*
STX PDUNIT ; SLOT * 16, DEV 0
LDX #$00
STX PDBLKL
STX PDBLKH
STX PDBUFL
INX ; LDX #PDREAD
STX PDCMD
LDX #$08
STX PDBUFH
.IFDEF ALTBOOT
STA STROBE
JSR PUTMSG
LDX #$10
BOOTMSG:
LDA #$FF
JSR WAIT
LDA KEYBD
BPL BOOTDELAY
STA STROBE
LDX #$01
CMP #'M'+$80
BEQ :+
CMP #'m'+$80
BNE BOOTDELAY
: LDA #SIBOOT ; LOAD SI BOOT PROGRAM
STA PDCMD
BOOTDELAY:
DEX
BNE BOOTMSG
JSR CLRMSG
LDA IOSLOT
AND #$0F
TAY
.ENDIF
BOOT: LDX SLOT16
JSR DOCMD ; READ BOOT BLOCK
PLP
PHA
LDA IOSLOT
AND #$0F
TAY
LDA SAVE16,Y ; SAVED ORIGINAL SLOT16 VALUE
STA SLOT16
PLA
BNE NOBOOT
JMP $801 ; JUMP TO BOOT BLOCK
NOBOOT: LDA $00
BEQ AUTOSTART
RTS
AUTOSTART:
JMP $FABA ; JUMP BACK TO AUTOSTART BOOT SCANNER ROM
;*
;* PRODOS INTELLIGENT DEVICE ENTRYPOINT
;*
CMDENTRY:
PHP
SEI
STA XROMOFF
.IFDEF PIROM
LDA #$01
STA BANKSEL
.ENDIF
JSR GETSLOT
.IFDEF DEBUG
LDA PDCMD
ORA #'0'
STA INDCTR+1
.ENDIF
JSR DOCMD
PLP
PHA ; RESTORE ORIGINAL SLOT16 VALUE
TYA
PHA
LDA IOSLOT
AND #$0F
TAY
LDA SAVE16,Y ; SAVED ORIGINAL SLOT16 VALUE
STA SLOT16
PLA
TAY
PLA
;*
;* CHECK FOR ERROR
;*
BNE CMDERR
CLC ; ALL GOOD, CLEAR ERROR FLAG
RTS
CMDERR:
.IFDEF DEBUG
PHA
STA $2FF
LDA #'E'-$40
STA INDCTR+2
: LDA KEYBD
BPL :-
STA STROBE
CMP #'M'+$80
BNE :+
LDA ROMEN
JMP MONITOR
: PLA
.ENDIF
SEC ; SET ERROR FLAG
RTS
ENDCMD:
.REPEAT CXSLOT+250-*
DB $00
.ENDREP
DB SIG ; SIGNATURE
DW 0 ; USE STATUS TO GET SIZE
DB $97 ; REMOVEABLE, 2 DEVICES, R/W
DB <CMDENTRY

View File

@ -1,5 +1,5 @@
MEMORY { MEMORY {
ROM: start = $c700, size = $0800, file = %O; ROM: start = $c000, size = $1000, file = %O;
} }
SEGMENTS { SEGMENTS {
CODE: load = ROM, type = ro; CODE: load = ROM, type = ro;

66
pidrive/pirom.s Executable file
View File

@ -0,0 +1,66 @@
;****************************************
;*
;* PIDRIVE (PI DRIVE) ROM
;*
;****************************************
PIROM = 1
.DEFINE SIG "PI"
.INCLUDE "romincs.s"
;****************************************
;*
;* PER-SLOT ROM @ $Cx00
;*
;****************************************
ORG $C000
.SCOPE
BANKSEL EQU $C08F
.INCLUDE "cxrom.s" ; DUMMY SLOT - NEVER USED
.ENDSCOPE
.SCOPE
BANKSEL EQU $C09F
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0AF
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0BF
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0CF
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0DF
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0EF
.INCLUDE "cxrom.s"
.ENDSCOPE
.SCOPE
BANKSEL EQU $C0FF
.INCLUDE "cxrom.s"
.ENDSCOPE
;****************************************
;*
;* OPTION ROM SPACE @ $C800
;*
;****************************************
.ASSERT * = $C800, error, "Slot ROM not page aligned"
; ORG $C800
.INCLUDE "c8rom.s"
;*
;* FILL REMAINING ROM WITH 0'S
;*
.REPEAT $D000-*
DB $00
.ENDREP
.ASSERT * = $D000, error, "Code not page size"

View File

@ -1,413 +0,0 @@
;****************************************
;*
;* SIDRIVE (SERIAL INTERFACE DRIVE) ROM
;*
;****************************************
;DEBUG = 1
.DEFINE EQU =
.DEFINE DB .BYTE
.DEFINE DW .WORD
.DEFINE PAGE .ALIGN 256
.DEFINE ORG .ORG
.CODE
;*
;* ACIA REGISTERS
;*
ACIADR EQU $C088
ACIASR EQU $C089
ACIACR EQU $C08A
ACIAMR EQU $C08B
;*
;* APPLE I/O LOCATIONS
;*
INDCTR EQU $0400
KEYBD EQU $C000
STROBE EQU $C010
XROMOFF EQU $CFFF
ROMEN EQU $C082
;*
;* DRIVER SCRATCHSCRTCH
;*
SCRTCH0 EQU $0478
SCRTCH1 EQU $04F8 ; SYNCED FLAG
SCRTCH2 EQU $0578
SCRTCH3 EQU $05F8
SCRTCH4 EQU $0678
SCRTCH5 EQU $06F8
SCRTCH6 EQU $0778
SCRTCH7 EQU $07F8
CMDACK EQU SCRTCH0
SYNCED EQU SCRTCH1
SAVE16 EQU SCRTCH2
IOSLOT EQU $07F8 ; CURRENT SLOT FOR IRQ HANDLING
;*
;* UTIL ROUTINES
;*
COUT EQU $FDED
CROUT EQU $FD8E
PRBYTE EQU $FDDA
PRHEX EQU $FDE3
PRNTAX EQU $F941
RDKEY EQU $FD0C
RDCHAR EQU $FD35
GETLN EQU $FD6A
MONITOR EQU $FF69
;*
;* ZERO PAGE PARAMETERS
;*
SLOT16 EQU $3C
PDCMD EQU $42
PDUNIT EQU $43
PDBUFF EQU $44
PDBUFL EQU $44
PDBUFH EQU $45
PDBLKL EQU $46
PDBLKH EQU $47
;*
;* PRODOS COMMANDS
;*
PDSTAT EQU 0
PDREAD EQU 1
PDWRITE EQU 2
PDFORMT EQU 3
;*
;* PRODOS ERRORS
;*
PDNOERR EQU $00
PDIOERR EQU $27
PDNODEV EQU $28
PDWRPRT EQU $2B
;*
;* SIDRIVE SYNC and SYNC_ACK
;*
SYNC_REQ EQU $80
SYNC_ACK EQU $81
;****************************************
;*
;* OPTION ROM SPACE @ $C800
;*
;****************************************
ORG $C800
;*
;* RETURN SLOT*16 IN X REG, SLOT IN Y REG
;*
GETSLOT:
TSX
LDA $102,X ; GET MSB OF RETURN ADDRESS
STA IOSLOT
AND #$0F
TAY
LDA SLOT16
STA SAVE16,Y ; SAVE SLOT16 LOCATION
TYA
ASL
ASL
ASL
ASL
STA SLOT16
TAX
RTS
;*
;* OUTPUT BYTE TO ACIA
;*
SENDACC:
PHA
LDA SLOT16
ORA #$89+1 ; ACIASR
TAX
SENDWT: LDA $C000-1,X
AND #$10
BEQ SENDWT
DEX ; ACIADR
PLA
STA $C000-1,X ; AVOID PHANTOM READ OF DATA REG
RTS
;*
;* INPUT BYTE FROM ACIA
;*
RECVACC:
LDX SLOT16
RECVWT: LDA ACIASR,X
AND #$08
BEQ RECVWT
LDA ACIADR,X
RTS
;*
;* WAIT FOR DELAY
;*
WAIT: SEC
WAIT2: PHA
WAIT3: SBC #$01
BNE WAIT3
PLA
SBC #$01
BNE WAIT2
RTS
;*
;* SYNC WITH HOST
;*
SYNC: LDA INDCTR
PHA
LDX SLOT16
LDA #$0B
STA ACIASR,X ; RESET STATUS REGISTER
STA ACIACR,X ; SET CONTROL REGISTER
LDA #$10
STA ACIAMR,X ; SET COMMAND REGISTER (115K BAUD)
LDA #$80
JSR WAIT
STA STROBE ; CLEAR KEYBOARD STROBE
SYNCLP: LDA #SYNC_REQ
JSR SENDACC
INY
TYA
AND #$07
TAY
LDA SPIN,Y
STA INDCTR
LDA #$FF
JSR WAIT
LDA KEYBD
BPL CHKRSP
STA STROBE
PLA
.IFNDEF DEBUG
STA INDCTR
.ENDIF
NODEV: LDA #PDNODEV
RTS
SPIN: DB $A1, $AF, $AD, $DC, $A1, $AF, $AD, $DC
CHKRSP: LDX SLOT16
LDA ACIASR,X
AND #$08
BEQ SYNCLP
LDA ACIADR,X
CMP #SYNC_ACK
BNE SYNCLP
LDA IOSLOT
AND #$0F
TAY
LDA #SYNC_ACK
STA SYNCED,Y
PLA
.IFNDEF DEBUG
STA INDCTR
.ENDIF
;*
;* DO STATUS, READ, WRITE COMMAND
;*
DOCMD:
LDA SYNCED,Y ; CHECK FOR ANY REASON TO RESYNC
CMP #SYNC_ACK
BNE SYNC
LDA ACIACR,X
CMP #$0B
BNE SYNC
LDA ACIAMR,X
CMP #$10
BNE SYNC
LDA PDUNIT ; FORMAT COMMAND FOR SIDRIVE AND SEND IT
ASL
LDA PDCMD
ROL
ASL
ORA #$A0
JSR SENDACC
CLC
ADC #$01
STA CMDACK,Y
LDA PDBLKL
JSR SENDACC
LDA PDBLKH
JSR SENDACC
CHKACK: JSR RECVACC ; WAIT FOR CORRECT ACK (MAY BE OUTSTANDING A2PI REQUESTS)
CMP CMDACK,Y
BNE CHKACK
;*
;* BRANCH TO COMMAND HANDLER
;*
LDY PDCMD ; CPY #PDSTATUS
BEQ STATUS
DEY ; CPY #PDREAD
BEQ RDBLK
DEY ; CPY #PDWRITE
BEQ WRBLK
.IFDEF DEBUG
LDA #'?'
STA INDCTR+6
.ENDIF
IOERR: LDA #PDIOERR
RTS
;*
;* SIDRIVE STATUS - RETURN NUMBER OF BLOCKS OR NODEV
;*
STATUS:
.IFDEF DEBUG
LDA #'S'-$40
STA INDCTR+3
.ENDIF
LDA IOSLOT
AND #$0F
TAY
JSR RECVACC
STA SCRTCH6,Y
JSR RECVACC
STA SCRTCH7,Y
JSR RECVACC
PHA
LDX SCRTCH6,Y
LDA SCRTCH7,Y
TAY
PLA
RTS
;*
;* READ A BLOCK (512 BYTES) FROM SIDRIVE
;*
RDBLK:
.IFDEF DEBUG
LDA #'R'-$40 ; LDY #$00
STA INDCTR+4
.ENDIF
RDBLKL: JSR RECVACC
STA (PDBUFF),Y
INY
BNE RDBLKL
INC PDBUFH
RDBLKH: JSR RECVACC
STA (PDBUFF),Y
INY
BNE RDBLKH
JMP RECVACC
;*
;* WRITE A BLOCK (512 BYTES) TO SIDRIVE
;*
WRBLK:
.IFDEF DEBUG
LDA #'W'-$40 ; LDY #$00
STA INDCTR+5
.ENDIF
WRBLKL: LDA (PDBUFF),Y
JSR SENDACC
INY
BNE WRBLKL
INC PDBUFH
WRBLKH: LDA (PDBUFF),Y
JSR SENDACC
INY
BNE WRBLKH
JMP RECVACC
;*
;* FILL REMAINING ROM WITH 0'S
;*
.REPEAT $CF00-*
DB $00
.ENDREP
.ASSERT * = $CF00, error, "Code not page size"
;****************************************
;*
;* SLOT INDEPENDENT ROM CODE @ $Cn00
;*
;****************************************
ORG $C700 ; EASY SLOT ADDRESS TO ASSEMBLE
;*
;* AUTOSTART BOOT SIGNATURE
;*
LDX #$20
LDY #$00
LDX #$03
STX $3C
;*
;* AUTOSTART/PR# ENTRYPOINT
;*
.IFDEF DEBUG
LDA #'*'
STA INDCTR+7
.ENDIF
PHP
SEI
STA XROMOFF
JSR GETSLOT
LDA #$00
STA SYNCED,Y ; CLEAR SYNCED FLAG
;*
;* CREATE COMMAND BUFFER FOR BOOT BLOCK
;*
STX PDUNIT ; SLOT * 16, DEV 0
LDX #$00
STX PDBLKL
STX PDBLKH
STX PDBUFL
INX ; LDX #PDREAD
STX PDCMD
LDX #$08
STX PDBUFH
JSR SYNC
BEQ BOOT
PLP
LDA $00
BEQ CONT
RTS
CONT: JMP $FABA ; JUMP BACK TO AUTOSTART BOOT SCANNER ROM
BOOT: PLP
JMP $801
;*
;* PRODOS INTELLIGENT DEVICE ENTRYPOINT
;*
CMDENTRY:
PHP
SEI
STA XROMOFF
JSR GETSLOT
.IFDEF DEBUG
LDA PDCMD
ORA #'0'
STA INDCTR+1
.ENDIF
JSR DOCMD
PLP
PHA ; RESTORE ORIGINAL SLOT16 VALUE
TYA
PHA
LDA IOSLOT
AND #$0F
TAY
LDA SAVE16,Y ; SAVED ORIGINAL SLOT16 VALUE
STA SLOT16
PLA
TAY
PLA
;*
;* CHECK FOR ERROR
;*
BNE CMDERR
CLC ; ALL GOOD, CLEAR ERROR FLAG
RTS
CMDERR:
.IFDEF DEBUG
PHA
STA $2FF
LDA #'E'-$40
STA INDCTR+2
: LDA KEYBD
BPL :-
STA STROBE
CMP #'M'+$80
BNE :+
LDA ROMEN
JMP MONITOR
: PLA
.ENDIF
SEC ; SET ERROR FLAG
RTS
ENDCMD:
.REPEAT $C700+250-*
DB $00
.ENDREP
DB "SI" ; SIGNATURE
DW 0 ; USE STATUS TO GET SIZE
DB $97 ; REMOVEABLE, 2 DEVICES, R/W
DB <CMDENTRY

10
pidrive/sirom.cfg Executable file
View File

@ -0,0 +1,10 @@
MEMORY {
ROM: start = $c800, size = $0800, file = %O;
}
SEGMENTS {
CODE: load = ROM, type = ro;
DATA: load = ROM, type = ro;
BSS: load = ROM, type = ro;
}

34
pidrive/sirom.s Executable file
View File

@ -0,0 +1,34 @@
;****************************************
;*
;* SIDRIVE (SERIAL INTERFACE DRIVE) ROM
;*
;****************************************
.DEFINE SIG "SI"
.INCLUDE "romincs.s"
;****************************************
;*
;* OPTION ROM SPACE @ $C800
;*
;****************************************
ORG $C800
.INCLUDE "c8rom.s"
;*
;* FILL REMAINING ROM WITH 0'S
;*
.REPEAT $CF00-*
DB $00
.ENDREP
.ASSERT * = $CF00, error, "Code not page size"
;****************************************
;*
;* SLOT INDEPENDENT ROM CODE @ $Cn00
;*
;****************************************
ORG $C700 ; EASY SLOT ADDRESS TO ASSEMBLE
.INCLUDE "cxrom.s"

BIN
share/A2PI.1.5.PO Normal file

Binary file not shown.

View File

@ -600,7 +600,7 @@ void main(int argc, char **argv)
if (devtty == deftty) if (devtty == deftty)
{ {
gpclk(271); /* divisor for ~1.8 MHz => (500/271) MHz */ gpclk(271); /* divisor for ~1.8 MHz => (500/271) MHz */
sleep(1); /* give clock chance to settle down */ //sleep(1); /* give clock chance to settle down */
} }
#endif #endif
/* /*

View File

@ -41,8 +41,8 @@ volatile unsigned int *setup_io(int reg_base)
// open /dev/mem // open /dev/mem
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0)
{ {
printf("can't open /dev/mem \n"); printf("can't open /dev/mem \n");
exit(-1); exit(-1);
} }
// mmap IO // mmap IO
io_map = mmap(NULL, //Any adddress in our space will do io_map = mmap(NULL, //Any adddress in our space will do
@ -54,8 +54,8 @@ volatile unsigned int *setup_io(int reg_base)
close(mem_fd); //No need to keep mem_fd open after mmap close(mem_fd); //No need to keep mem_fd open after mmap
if (io_map == MAP_FAILED) if (io_map == MAP_FAILED)
{ {
printf("mmap error %d\n", (int)io_map);//errno also set! printf("mmap error %d\n", (int)io_map);//errno also set!
exit(-1); exit(-1);
} }
return (volatile unsigned *)io_map; return (volatile unsigned *)io_map;
} }
@ -73,12 +73,12 @@ void gpclk(int idiv)
unsigned int arm_base = ARMv6_PERI_BASE; // Default to ARMv6 peripheral base unsigned int arm_base = ARMv6_PERI_BASE; // Default to ARMv6 peripheral base
FILE *cpuinfo; FILE *cpuinfo;
char keystr[256], valstr[128]; char keystr[1024], valstr[128];
if ((cpuinfo = fopen("/proc/cpuinfo", "r") ) == NULL) if ((cpuinfo = fopen("/proc/cpuinfo", "r") ) == NULL)
{ {
printf("can't open /proc/cpuinfo\n"); printf("can't open /proc/cpuinfo\n");
exit(-1); exit(-1);
} }
while (!feof(cpuinfo)) while (!feof(cpuinfo))
{ {