-
Notifications
You must be signed in to change notification settings - Fork 84
/
getact.src
92 lines (92 loc) · 2 KB
/
getact.src
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