-
Notifications
You must be signed in to change notification settings - Fork 84
/
getact
45 lines (45 loc) · 803 Bytes
/
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
.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
STA LBUSED
LDA BUF1,X
GA3
STA T1
AND #$1F
BIT T1
RTS
;
.END