mirror of
https://github.com/JohnSnape/6502code.git
synced 2024-10-04 01:57:21 +00:00
Add files via upload
This commit is contained in:
parent
c28a0bd5ac
commit
949a6902e8
261
source/PARALLEL_CARD.txt
Normal file
261
source/PARALLEL_CARD.txt
Normal file
@ -0,0 +1,261 @@
|
||||
org $1000
|
||||
*********************************
|
||||
* PRINTER CARD I FIRMWARE *
|
||||
* *
|
||||
* P1-2 (341-0005) *
|
||||
* *
|
||||
* WOZ 11/1/77 *
|
||||
* APPLE COMPUTER INC. *
|
||||
* ALL RIGHTS RESERVED *
|
||||
* *
|
||||
* REVISED 3 / 17 / 1978 *
|
||||
* HUSTON AND SANDER *
|
||||
* *
|
||||
* --------------------------- *
|
||||
* PROM ADDRESSING *
|
||||
* --------------------------- *
|
||||
* *
|
||||
* $CN00.CN3F --> $CN40.CN7F *
|
||||
* $CN40.CN7F --> $CN00.CN3F *
|
||||
* $CN80.CNBF --> $CNC0.CNFF *
|
||||
* $CNC0.CNFF --> $CN80.CNBF *
|
||||
* *
|
||||
* --------------------------- *
|
||||
* DEFAULT SETTINGS *
|
||||
* --------------------------- *
|
||||
* *
|
||||
* ESCAPE CHARACTER IS CTRL-I *
|
||||
* VIDEO-ALSO AND CRLF ON *
|
||||
* *
|
||||
* --------------------------- *
|
||||
* AFTER ESCAPE CHARACTER *
|
||||
* --------------------------- *
|
||||
* *
|
||||
* (OPTIONAL SET PRINTER WIDTH) *
|
||||
* *
|
||||
* I: SET VIDEO ALSO *
|
||||
* J: CLR CRLF, VID-ALSO *
|
||||
* K: CLR CRLF *
|
||||
* L: SET CRLF *
|
||||
* M: SET CRLF, VID-ALSO *
|
||||
* N: CLR VIDEO ALSO *
|
||||
* *
|
||||
*********************************
|
||||
*
|
||||
CH EQU $24 ;CURSOR HORIZONTAL INDEX
|
||||
CSWL EQU $36 ;LOW ORDER COUT SWITCH BYTE
|
||||
PWDTH EQU $4B8 ;PRINTER WIDTH
|
||||
MSTRT EQU $538 ;MARGIN START
|
||||
MODE EQU $5B8 ;AFTER ESC CHAR
|
||||
ESCHAR EQU $638 ;CURRENT ESC CHAR
|
||||
FLAGS EQU $6B8 ;B7=VID-ALSO, B0=CRLF
|
||||
COL EQU $738 ;COLUMN COUNT
|
||||
DEV EQU $C080 ;+$N0 ACTIVATES THE DEV LINE
|
||||
COUT1 EQU $FDF0 ;VIDEO OUTPUT ENTRY
|
||||
IORTS EQU $FF58 ;FIXED RTS INSTRUCTION
|
||||
*
|
||||
*
|
||||
ENT0 CLC ;DEFAULT ENTRY
|
||||
HEX BO
|
||||
ENT1 SEC ;NORMAL ENTRY
|
||||
PHA
|
||||
TXA
|
||||
PHA
|
||||
TYA
|
||||
PHA
|
||||
PHP
|
||||
SEI ;DISABLE INTERRUPTS
|
||||
JSR IORTS ;RETURNS $CN ABOVE STACK
|
||||
TSX
|
||||
PLA
|
||||
PLA
|
||||
PLA
|
||||
PLA
|
||||
TAY ;CHAR TO Y-REGISTER
|
||||
DEX
|
||||
TXS ;GET $CN FROM ABOVE STACK
|
||||
PLA
|
||||
PLP ;RESTORE STATUS
|
||||
TAX ;$CN TO REG X
|
||||
BCC DEFAULT
|
||||
LDA MODE,X ;AFTER ESC CHAR?
|
||||
BPL ESCTEST ;BRANCH IF NO
|
||||
TYA
|
||||
AND #$7F ;MASK OUT BIT 7
|
||||
EOR #$30 ;ALTER BITS
|
||||
CMP #$0A ;"0"-"9"?
|
||||
BCC DIG ;BRANCH IF YES
|
||||
CMP #$78 ;"H"-"O"?
|
||||
BCS SETFLG ;YES, SET OR CLR FLAGS
|
||||
EOR #$3D ;CHECK FOR CARRIAGE RETURN
|
||||
BEQ ESCTEST ;DON'T CHANGE ESC CHAR IF CR
|
||||
TYA ;GET ORIGINAL CHAR AGAIN
|
||||
AND #$9F ;MAKE IT A CTRL CHAR
|
||||
STA ESCHAR,X ;STORE NEW ESC CHAR
|
||||
BCC DONE ;BRANCH ALWAYS TAKEN
|
||||
*
|
||||
*
|
||||
ESCTEST LDA FLAGS,X
|
||||
BMI ESCTST
|
||||
LDA CH
|
||||
CMP COL,X
|
||||
BCS ESCTST
|
||||
CMP #$11
|
||||
BCS ESCTST
|
||||
ORA #$F0
|
||||
AND COL,X
|
||||
ASC CH
|
||||
STA CH
|
||||
ESCTST LSR ;MAKE IT POSITIVE
|
||||
DEFAULT SEC
|
||||
BCS ESCTST1 ;BRANCH ALWAYS TAKEN
|
||||
*
|
||||
*
|
||||
SETFLG CLC
|
||||
ROR
|
||||
AND FLAGS,X
|
||||
BCC SETFLG1
|
||||
EOR #$81
|
||||
SETFLG1 STA FLAGS,X
|
||||
BNE DONE
|
||||
*
|
||||
*
|
||||
DIG LDY #$0A
|
||||
DLOOP ADC MSTRT,X ;ADD 10*MSTRT TO DIG AND STORE
|
||||
DEY ; IN PRINTER WIDTH (MARGIN)
|
||||
BNE DLOOP
|
||||
STA PWDTH,X
|
||||
MINIT STA MSTRT,X ;UPDATE MARGIN START
|
||||
SEC ; INDICATE 'AFTER ESC CHAR'
|
||||
BCS DONE1 ;BRANCH ALWAYS
|
||||
*
|
||||
*
|
||||
VIDEO EQU * ;MUST KEEP CURSOR HORIZ.
|
||||
CMP CH ;IN RANGE OF PRWDTH
|
||||
BCC SETCH ;BRANCH IF >40
|
||||
PLA
|
||||
TAY
|
||||
PLA
|
||||
TAX ;RESTORE REGISTERS AND
|
||||
PLA ;END WITH VIDEO OUT
|
||||
JMP COUT1
|
||||
*
|
||||
*
|
||||
ORG ENT0+#$80
|
||||
BCC * ;IMAGE 'WAIT FOR READY'
|
||||
BCS * ;IMAGE (ESCTST & DEFAULT)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
OUT STA DEV,Y ;OUTPUT CHAR TO PRINTER
|
||||
BCC PRNT ;LOOP IF WAS TAB
|
||||
EOR #$7 ;IF CR, MAKE IT LF
|
||||
TAY ; COPY TO REG,Y
|
||||
EOR #$0A
|
||||
ASL ;CARRIAGE RETURN IN 7 LSB'S?
|
||||
BNE FINISH ;BRANCH IF NOT CR
|
||||
CLV ; INDICATE THAT IT WAS CR
|
||||
STA CH ;RESET CURSOR HORIZ.
|
||||
STA COL,X ;CLEAR COLUMN COUNT
|
||||
FINISH LDA FLAGS,X ;FOR CRLF CHECK (BIT 0)
|
||||
LSR
|
||||
BVS FINISH1 ;BRANCH IF LAST CHAR NOT CR
|
||||
BCS ESCTST1
|
||||
FINISH1 ASL ;CHECK HI ORDER BIT OF FLAGS
|
||||
ASL
|
||||
LDA #$27 ;LOADED JUST FOR VIDEO MODE
|
||||
BCS VIDEO
|
||||
LDA COL,X ;CHECK FOR WITHIN 8 CHARS
|
||||
SBC PWDTH,X ;OF PRINTER WIDTH
|
||||
CMP #$F8
|
||||
BCC SETCH ;IF NO, THEN DONE
|
||||
ADC #$27 ;ADD 32 (FORMING 32-29)
|
||||
LDY IORTS ;DUMMY LDY ABSOLUTE
|
||||
ORG *-2
|
||||
SETCH LDA #$00
|
||||
STA CH
|
||||
DONE CLC
|
||||
DONE1 ROR MODE,X
|
||||
PLA
|
||||
TAY
|
||||
PLA
|
||||
TAX
|
||||
PLA
|
||||
RTS
|
||||
*
|
||||
*
|
||||
ORG ENT0+#$C0
|
||||
PRNT BCC PRNT1 ;TAKEN WHEN PRINTER READY
|
||||
ESCTST1 BCS *+2
|
||||
BPL ESCTST2
|
||||
*
|
||||
*
|
||||
LDA #$89 ;DEFAULT CHARACTER (CONTROL-I)
|
||||
STA ESCHAR,X
|
||||
STA FLAGS,C ;VIDEO ALSO, CRLF ON
|
||||
LDA #$28
|
||||
STA PWDTH,X
|
||||
LDA #>ENT1
|
||||
STA CSWL ;SET FOR NORMAL ENTRY
|
||||
ESCTST2 TYA ; MOVE CHAR TO REG-A
|
||||
EOR ESCHAR,X
|
||||
ASL ;ESC CHAR? (7LSB'S)
|
||||
BEQ MINIT ;BRANCH IF YES
|
||||
LSR MODE,X ;NO, CLR 'AFTER ESC CHAR'
|
||||
TYA
|
||||
PHA ; SAVE CHAR ON THE STACK
|
||||
TXA
|
||||
ASL
|
||||
ASL ;GENERATE N*$10 AS AN INDEX TO
|
||||
ASL ; THE DEVICE LINE (REG-Y)
|
||||
ASL
|
||||
TAY
|
||||
PRNT1 LDA COL,X
|
||||
CMP CH ;IF COLUMN>= CURSOR HORIZ
|
||||
PLA ; THEN USE CHAR
|
||||
BCS CTLTST
|
||||
PHA
|
||||
AND #$80 ;ELSE GEN BLANK (7 LSB'S)
|
||||
ORA #$20 ; FOR TAB CATCH-UP
|
||||
CTLTST BIT IORTS
|
||||
BEQ PRNT2 ;INCR COLUMN COUNT
|
||||
INC COL,X ; IF NOT A CONTROL CHAR
|
||||
PRNT2 BVS OUT ;TAKEN WHEN PRINTER READY
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
11355
source/PRODOS8.TXT
Normal file
11355
source/PRODOS8.TXT
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user