New code from Oliver Schmidt

git-svn-id: svn://svn.cc65.org/cc65/trunk@3351 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2005-01-06 12:26:47 +00:00
parent 2ebb276929
commit 8188795240
15 changed files with 123 additions and 144 deletions

View File

@@ -8,11 +8,7 @@
.include "../apple2/apple2.inc"
.proc screensize
screensize:
ldx WNDWDTH
ldy #24
rts
.endproc

View File

@@ -26,13 +26,13 @@ _chline:
chlinedirect:
cmp #$00 ; Is the length zero?
beq L9 ; Jump if done
beq done ; Jump if done
sta tmp1
L1: txa ; Screen code
: txa ; Screen code
jsr cputdirect ; Direct output
dec tmp1
bne L1
L9: rts
bne :-
done: rts

View File

@@ -14,7 +14,6 @@
.include "../apple2/apple2.inc"
initconio:
lda #$FF ; Normal character display mode
sta INVFLG
@@ -33,10 +32,7 @@ _cputcxy:
_cputc:
cmp #$0D ; Test for \r = carrage return
bne L1
stz CH ; Goto left edge of screen
rts ; That's all we do
L1:
beq left
cmp #$0A ; Test for \n = line feed
beq newline
ora #$80 ; Turn on high bit
@@ -46,9 +42,18 @@ cputdirect:
inc CH ; Bump to next column
lda CH
cmp WNDWDTH
bne return
stz CH
return:
bne done
left: stz CH ; Goto left edge of screen
done: rts
newline:
inc CV
lda CV
cmp #24
bne :+
lda #$00
sta CV
: jsr BASCALC
rts
putchar:
@@ -56,13 +61,11 @@ putchar:
cpy #$FF ; Normal character display mode?
beq put
cmp #$E0 ; Lowercase?
bmi mask
bcc mask
and #$7F ; Inverse lowercase
bra put
mask:
and INVFLG ; Apply normal, inverse, flash
put:
ldy CH
mask: and INVFLG ; Apply normal, inverse, flash
put: ldy CH
bit RD80VID ; In 80 column mode?
bpl col40 ; No, in 40 cols
pha
@@ -75,23 +78,7 @@ put:
sta (BASL),Y
bit LOWSCR
rts
col40:
sta (BASL),Y
rts
newline:
lda CH
pha
inc CV
lda CV
cmp #24
bne L2
lda #$00
sta CV
L2:
jsr BASCALC
pla
sta CH
col40: sta (BASL),Y
rts
_gotoxy:

View File

@@ -20,11 +20,11 @@ _cvline:
cvlinedirect:
cmp #$00 ; Is the length zero?
beq L9 ; Jump if done
beq done ; Jump if done
sta tmp1
L1: txa ; Screen code
: txa ; Screen code
jsr putchar ; Write, no cursor advance
jsr newline ; Advance cursor to next line
dec tmp1
bne L1
L9: rts
bne :-
done: rts

View File

@@ -47,15 +47,15 @@ noxy: sta XORIGIN
plx ; Restore index
loop: lda XOFFS,x
clc
bpl L1 ; Relative to left edge?
bpl :+ ; Relative to left edge?
adc WIDTH
L1: adc XORIGIN
: adc XORIGIN
jsr pusha
lda YOFFS,x
clc
bpl L2 ; Relative to top?
bpl :+ ; Relative to top?
adc HEIGHT
L2: adc YORIGIN
: adc YORIGIN
jsr _gotoxy ; Call this one, will pop params
txa
tay