-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathgetact
92 lines (92 loc) · 1.49 KB
/
getact
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
.PAGE 'GETACT'
;*********************************
;* GETACT: GET ACTIVE BUFFER # *
;* VARS: BUF0,BUF1,LINDX *
;* REGS: OUT: .A= ACT BUFFER # *
;* .X= LINDX *
;* FLAGS: .N=1: NO ACT-BUF *
;*********************************
;
GETACT
LDX LINDX
LDA BUF0,X
BPL GA1
LDA BUF1,X
GA1
AND #$BF ; STRIP DIRTY BIT
RTS
;
;*********************************
;* GAFLG: GET ACTIVE BUFFER #; *
;* SET LBUSED & FLAGS. *
;* REGS: OUT: .A= ACT BUFFER # *
;* .X= LINDX *
;* FLAGS: .N=1: NO ACT-BUF *
;* .V=1: DIRTY BUF *
;*********************************
;
GAFLGS
LDX LINDX
GA2 STX LBUSED ;SAVE BUF #
LDA BUF0,X
BPL GA3
;
TXA
CLC
ADC #MXCHNS+1
STA LBUSED
LDA BUF1,X
GA3
STA T1
AND #$1F
BIT T1
RTS
;
;******************************
;******************************
;
; GET CHANNELS INACTIVE
; BUFFER NUMBER.
;
; INPUT PARAMETERS:
; LINDX - CHANNEL #
;
; OUTPUT PARAMETERS:
; A <== INACTIVE BUFFER #
; OR
; A <== $FF IF NO
; INACTIVE BUFFER.
;
;******************************
;
GETINA LDX LINDX
LDA BUF0,X
BMI GI10
LDA BUF1,X
GI10 CMP #$FF
RTS
;
;*****************************
;********** P U T I N A ****
;*****************************
;
; PUT INACTIVE BUFFER
;
; INPUT PARAMTERS:
; A = BUFFER #
;
; OUTPUT PARAMTERS:
; NONE
;
;*****************************
;
PUTINA LDX LINDX
ORA #$80
LDY BUF0,X
BPL PI1
STA BUF0,X
RTS
PI1 STA BUF1,X
RTS
;
.END