mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-10-27 17:25:19 +00:00
Merge pull request #2 from groessler/something_to_pull
a2vt100.s: use symbols instead of hard coded constants for screen dimensions
This commit is contained in:
commit
4649acfaf3
@ -10,6 +10,9 @@
|
|||||||
.exportzp vt100_screen_cols = 80
|
.exportzp vt100_screen_cols = 80
|
||||||
.exportzp vt100_screen_rows = 24
|
.exportzp vt100_screen_rows = 24
|
||||||
|
|
||||||
|
.define Cols vt100_screen_cols
|
||||||
|
.define Rows vt100_screen_rows
|
||||||
|
|
||||||
.import beep
|
.import beep
|
||||||
.import telnet_close
|
.import telnet_close
|
||||||
.import telnet_send_char
|
.import telnet_send_char
|
||||||
@ -228,7 +231,7 @@ LF jsr clPending
|
|||||||
bne D4a ; no -> branch
|
bne D4a ; no -> branch
|
||||||
jsr CUScrl ; yes -> scroll up
|
jsr CUScrl ; yes -> scroll up
|
||||||
rts
|
rts
|
||||||
D4a cpx #$17 ; end of screen?
|
D4a cpx #Rows-1 ; end of screen?
|
||||||
bne D4b ; no -> branch
|
bne D4b ; no -> branch
|
||||||
rts ; yes -> do nothing
|
rts ; yes -> do nothing
|
||||||
D4b inx ; next line
|
D4b inx ; next line
|
||||||
@ -244,9 +247,9 @@ D5 cmp #$09 ; TAB?
|
|||||||
and #$f8 ; (col DIV 8) * 8
|
and #$f8 ; (col DIV 8) * 8
|
||||||
clc ; col + 8
|
clc ; col + 8
|
||||||
adc #$08
|
adc #$08
|
||||||
cmp #$50 ; col=80?
|
cmp #Cols ; col=80?
|
||||||
bne D5a ; no -> skip
|
bne D5a ; no -> skip
|
||||||
lda #$4f ; yes -> col=79
|
lda #Cols-1 ; yes -> col=79
|
||||||
D5a tay ; col to y
|
D5a tay ; col to y
|
||||||
ldx CV ; line to x
|
ldx CV ; line to x
|
||||||
jsr CPlot ; set crsr
|
jsr CPlot ; set crsr
|
||||||
@ -467,11 +470,11 @@ LE3 cmp #$43 ; C ?
|
|||||||
LE3c lda CH ; get crsr col
|
LE3c lda CH ; get crsr col
|
||||||
clc
|
clc
|
||||||
adc EPar ; col = col + right
|
adc EPar ; col = col + right
|
||||||
cmp #$4f ; outside screen?
|
cmp #Cols-1 ; outside screen?
|
||||||
bcs LE3d ; yes -> branch
|
bcs LE3d ; yes -> branch
|
||||||
tay
|
tay
|
||||||
jmp LE3a
|
jmp LE3a
|
||||||
LE3d ldy #$4f ; y=col=left margin
|
LE3d ldy #Cols-1 ; y=col=left margin
|
||||||
LE3a ldx CV ; x is row
|
LE3a ldx CV ; x is row
|
||||||
jsr CPlot ; set crsr
|
jsr CPlot ; set crsr
|
||||||
jmp LEend
|
jmp LEend
|
||||||
@ -584,7 +587,7 @@ LE8a jsr GetNum
|
|||||||
bne LE8b ; 0 means 1
|
bne LE8b ; 0 means 1
|
||||||
iny
|
iny
|
||||||
LE8b dey ; line 1 -> line 0
|
LE8b dey ; line 1 -> line 0
|
||||||
cpy #$18 ; >= 24?..
|
cpy #Rows ; >= 24?..
|
||||||
bcs LE8d ; ..error!
|
bcs LE8d ; ..error!
|
||||||
sty xVector ; save row
|
sty xVector ; save row
|
||||||
; -- prepare col
|
; -- prepare col
|
||||||
@ -593,7 +596,7 @@ LE8b dey ; line 1 -> line 0
|
|||||||
bne LE8c ; 0 means 1
|
bne LE8c ; 0 means 1
|
||||||
iny
|
iny
|
||||||
LE8c dey ; col 1 -> col 0
|
LE8c dey ; col 1 -> col 0
|
||||||
cpy #$50 ; >= 80?..
|
cpy #Cols ; >= 80?..
|
||||||
bcs LE8d ; ..error!
|
bcs LE8d ; ..error!
|
||||||
ldx xVector ; restore row to X
|
ldx xVector ; restore row to X
|
||||||
jsr CPlot ; set crsr
|
jsr CPlot ; set crsr
|
||||||
@ -609,7 +612,7 @@ LE9 cmp #$4a ; J ?
|
|||||||
jsr ErEnLn ; del rest of line
|
jsr ErEnLn ; del rest of line
|
||||||
ldx CV ; get crsr line
|
ldx CV ; get crsr line
|
||||||
LE9b inx ; next line
|
LE9b inx ; next line
|
||||||
cpx #$18 ; line 24?
|
cpx #Rows ; line 24?
|
||||||
bcs LE9f ; then end
|
bcs LE9f ; then end
|
||||||
txa
|
txa
|
||||||
pha ; save X
|
pha ; save X
|
||||||
@ -633,7 +636,7 @@ LE9c dex ; previous line
|
|||||||
; -- 2 -- del screen
|
; -- 2 -- del screen
|
||||||
LE9e cmp #$02 ; unknown?
|
LE9e cmp #$02 ; unknown?
|
||||||
bne LE9f ; then ingnore
|
bne LE9f ; then ingnore
|
||||||
ldx #$17 ; start at ln 23
|
ldx #Rows-1 ; start at ln 23
|
||||||
LE9d txa
|
LE9d txa
|
||||||
pha ; save X
|
pha ; save X
|
||||||
jsr ErLn ; erase line
|
jsr ErLn ; erase line
|
||||||
@ -652,14 +655,14 @@ LE10 cmp #$72 ; r ?
|
|||||||
bne LE10e ; no -> error
|
bne LE10e ; no -> error
|
||||||
ldy EPar ; get top
|
ldy EPar ; get top
|
||||||
dey ; line 1 -> line 0
|
dey ; line 1 -> line 0
|
||||||
cpy #$18 ; >=24?..
|
cpy #Rows ; >=24?..
|
||||||
bcs LE10e ; ..error!
|
bcs LE10e ; ..error!
|
||||||
sty xVector ; save top
|
sty xVector ; save top
|
||||||
; -- prepare bottom --
|
; -- prepare bottom --
|
||||||
jsr GetNum
|
jsr GetNum
|
||||||
ldy EPar ; get bottom
|
ldy EPar ; get bottom
|
||||||
dey ; line 1 -> line 0
|
dey ; line 1 -> line 0
|
||||||
cpy #$18 ; >=24?..
|
cpy #Rows ; >=24?..
|
||||||
bcs LE10e ; ..error!
|
bcs LE10e ; ..error!
|
||||||
sty zVector ; save bottom
|
sty zVector ; save bottom
|
||||||
; -- validate lines --
|
; -- validate lines --
|
||||||
@ -1183,7 +1186,7 @@ PC3 sta (BASL),y ; char to screen
|
|||||||
ldy CH ; get crsr col
|
ldy CH ; get crsr col
|
||||||
|
|
||||||
; -- move on crsr --
|
; -- move on crsr --
|
||||||
cpy #$4f ; col = 79?
|
cpy #Cols-1 ; col = 79?
|
||||||
bne PC8 ; no -> skip
|
bne PC8 ; no -> skip
|
||||||
lda #$ff ; yes -> set..
|
lda #$ff ; yes -> set..
|
||||||
sta lbPending ; ..pending
|
sta lbPending ; ..pending
|
||||||
@ -1210,7 +1213,7 @@ NewLn pha ; save char
|
|||||||
ldx CV ; get crsr row
|
ldx CV ; get crsr row
|
||||||
cpx SRE ; end of scroll reg?
|
cpx SRE ; end of scroll reg?
|
||||||
beq NL1 ; yes -> branche
|
beq NL1 ; yes -> branche
|
||||||
cpx #$17 ; line 23?
|
cpx #Rows-1 ; line 23?
|
||||||
beq NLend ; yes -> crsr stays
|
beq NLend ; yes -> crsr stays
|
||||||
; --- normal wrap ---
|
; --- normal wrap ---
|
||||||
inx ; increase line
|
inx ; increase line
|
||||||
@ -1585,7 +1588,7 @@ InitVar lda #$00
|
|||||||
sta lbPending
|
sta lbPending
|
||||||
sta civis
|
sta civis
|
||||||
|
|
||||||
lda #$17 ; last line
|
lda #Rows-1 ; last line
|
||||||
sta SRE ; = 23
|
sta SRE ; = 23
|
||||||
|
|
||||||
rts
|
rts
|
||||||
@ -1617,7 +1620,7 @@ InitScr
|
|||||||
; --- limit SET80COL-HISCR to text ---
|
; --- limit SET80COL-HISCR to text ---
|
||||||
bit LORES
|
bit LORES
|
||||||
; --- erase screen ---
|
; --- erase screen ---
|
||||||
ldx #$17 ; start at ln 23
|
ldx #Rows-1 ; start at ln 23
|
||||||
IS1 txa
|
IS1 txa
|
||||||
pha ; save X
|
pha ; save X
|
||||||
jsr ErLn ; erase line
|
jsr ErLn ; erase line
|
||||||
|
Loading…
Reference in New Issue
Block a user