-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathbwdisp
117 lines (117 loc) · 2.11 KB
/
bwdisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.PAG 'BWDISP 11/12/82'
;********************************
;
; DISPLAY A CHARACTER
;
;********************************
;
DOBLNK
LDA #$20
;
DSPP
LDY PNTR ;GET CHAR INDEX
JSR PAGSET ;MAKE SURE RAM 0
STA (PNT)Y ;PUT CHAR ON SCREEN
JSR PAGRES ;RESTORE RAM PAGE
RTS
.SKIP 3
;SUBROUTINE TO CLEAR ONE LINE
; X = LINE NUMBER
; CLRLN : BLANK ENTIRE LINE
; CLRPRT: Y = STARTING COLUMN POSITION
;
CLRLN
LDY SCLF
JSR CLRBIT ;MAKE SURE NON-CONTINUED LINE
CLRPRT
TXA ;SAVE .X
PHA
LDA PNTR
PHA
DEY
CLR10
INY
STY PNTR
JSR DOBLNK ;PRINT A BLANK
CPY SCRT ;LINE COMPLETELY BLANK?
BNE CLR10 ;BRANCH IF NOT
PLA
STA PNTR
PLA
TAX
RTS
.SKIP 3
; GRAB A CHARACTER
;
GET1CH
LDY PNTR ;GET CHAR/COLOR INDEX
JSR PAGSET ;MAKE SURE RAM PAGE 0
LDA (PNT)Y ;GET THE CHARACTER
JSR PAGRES ;RESTORE RAM PAGE
RTS
.SKIP 3
;*******************************************
;
; SET TEXT/GRAPHIC MODE
;
CTEXT
LDY #$10
BCS CRTSET ;SKIP IF GRAPHIC MODE
TXCRT
LDY #0
CRTSET
STY GRMODE ;SET TEXT/GRAPHIC MODE
LDA TPI1+CREG
AND #$EF ;MASK OUT TEXT/GRAPHIC BIT
ORA GRMODE ;ADD NEW TEXT/GRAPHIC BIT
STA TPI1+CREG
RTS
;
; CRTINT -- INTIALIZE CRT
;
CRTINT
LDY #17 ;18 BYTE TABLE BUILT IN -1 FOR OFFSET
BIT TPI2+PC ;CHECK FOR TYPE
BMI CRT10 ;BUIT-IN
LDY #18+17 ;VALUES FOR NTSC
BVS CRT10
LDY #18+18+17 ;VALUES FOR PAL
CRT10
LDX #17
CRT20
LDA ATEXT,Y
STX VDC+ADREG ;INDEX TO REG.
STA VDC+DAREG
DEY
DEX
BPL CRT20
RTS
.SKI 3
;**************************************************
;
; HANDLE RAM PAGING
;
;**************************************************
PAGSET
PHA
LDA #$3F ;FOR ROM PAGE
BNE PAGSUB
PAGST2
PHA
LDA KEYSEG ;FOR FUNCTION KEY PAGE
PAGSUB
PHA
LDA I6509 ;GET CURRENT PAGE NUMBER
STA PAGSAV ;- AND SAVE IT
PLA
STA I6509 ;SET TO RAM PAGE 0
PLA ;RESTORE A-REG
RTS
.SKI 2
PAGRES PHA ;SAVE A-REG
LDA PAGSAV ;GET SAVED RAM PAGE NUMBER
STA I6509 ;RESTORE RAM PAGE NUMBER
PLA ;RESTORE A-REG
RTS
.SKI
.END