conio with fixed width and proortional font support

git-svn-id: svn://svn.cc65.org/cc65/trunk@1180 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst
2002-03-08 16:49:31 +00:00
parent ae74057353
commit 93fd8803c1
7 changed files with 525 additions and 29 deletions

View File

@@ -0,0 +1,31 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; Screen size variables
;
; 6.3.2001
.include "../inc/geossym.inc"
.export xsize, ysize
.constructor initscrsize
.code
initscrsize:
lda graphMode
bpl L1
lda #80 ; 80 columns (more or less)
.byte $2c
L1: lda #40 ; 40 columns (more or less)
sta xsize
lda #24 ; something like that for Y size
sta ysize
rts
.bss
xsize: .res 1
ysize: .res 1

View File

@@ -1,29 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 27.10.2001
; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
; void cclear (unsigned char length);
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
; void chline (unsigned char length);
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
; void cvline (unsigned char length);
.export _cclearxy, _cclear
.export _chlinexy, _chline
.export _cvlinexy, _cvline
.import popa
; unimplemented, will do nothing now
_cclearxy:
_chlinexy:
_cvlinexy:
jsr popa
_cclear:
_chline:
_cvline:
rts

View File

@@ -0,0 +1,47 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 06.03.2002
; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
; void cclear (unsigned char length);
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/cursor.inc"
.export _cclearxy, _cclear
.import popa, _gotoxy, fixcursor
_cclearxy:
pha ; Save the length
jsr popa ; Get y
jsr _gotoxy ; Call this one, will pop params
pla ; Restore the length
_cclear:
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
tax
lda cursor_x ; left start
sta r3L
lda cursor_x+1
sta r3L+1
lda cursor_y ; level
sta r2L
clc
adc #8
sta r2H
txa ; right end
clc
adc cursor_c
sta cursor_c
sta r4L
ldx #r4
ldy #3
jsr DShiftLeft
lda #0 ; pattern
jsr SetPattern
jsr Rectangle
jsr fixcursor
L9: rts

View File

@@ -0,0 +1,45 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 06.03.2002
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
; void chline (unsigned char length);
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/cursor.inc"
.export _chlinexy, _chline
.import popa, _gotoxy, fixcursor
_chlinexy:
pha ; Save the length
jsr popa ; Get y
jsr _gotoxy ; Call this one, will pop params
pla ; Restore the length
_chline:
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
tax
lda cursor_x ; left start
sta r3L
lda cursor_x+1
sta r3L+1
lda cursor_y ; level
sec
sbc #4 ; in the middle of a cell
sta r11L
txa ; right end
clc
adc cursor_c
sta cursor_c
sta r4L
ldx #r4
ldy #3
jsr DShiftLeft
lda #%11111111 ; pattern
jsr HorizontalLine
jsr fixcursor
L9: rts

View File

@@ -0,0 +1,45 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 27.10.2001
; 05.03.2002
; void cpputsxy (unsigned char x, unsigned char y, char* s);
; void cpputs (char* s);
; same as cputsxy and cputs but faster and use proportional font spacing
; does not update cursor position
.export _cpputsxy, _cpputs
.import _gotoxy
.import popa
.include "../inc/const.inc"
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
.include "../inc/cursor.inc"
_cpputsxy:
sta r0L ; Save s for later
stx r0H
jsr popa ; Get Y
jsr _gotoxy ; Set cursor, pop x
jmp L0 ; Same as cputs...
_cpputs:
sta r0L ; Save s
stx r0H
L0: ldy #0
lda (r0),y
bne L1 ; Jump if there's something
rts
L1: lda cursor_x
sta r11L
lda cursor_x+1
sta r11H
lda cursor_y
sta r1H
jmp PutString

View File

@@ -0,0 +1,46 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 06.03.2002
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
; void cvline (unsigned char length);
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/cursor.inc"
.export _cvlinexy, _cvline
.import popa, _gotoxy, fixcursor
_cvlinexy:
pha ; Save the length
jsr popa ; Get y
jsr _gotoxy ; Call this one, will pop params
pla ; Restore the length
_cvline:
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
tax
lda cursor_x ; x position
clc
adc #4 ; in the middle of cell
sta r4L
lda cursor_x+1
adc #0
sta r4L+1
lda cursor_y ; top start
sta r3L
txa ; bottom end
clc
adc cursor_r
sta cursor_r
sta r3H
asl r3H
asl r3H
asl r3H
lda #%11111111 ; pattern
jsr VerticalLine
jsr fixcursor
L9: rts