added extra check for graphical chars

This commit is contained in:
mrdudz
2015-09-28 15:10:57 +02:00
parent 257183fa55
commit 6cc654cca8
4 changed files with 32 additions and 21 deletions

View File

@@ -1,10 +1,8 @@
; ram under i/o
soft80_lo_charset = $d000 soft80_lo_charset = $d000
soft80_hi_charset = $d400 soft80_hi_charset = $d400
soft80_vram = $d800 soft80_vram = $d800 ; ram under i/o
soft80_colram = $d800 ; color ram (used for temp. storage) soft80_colram = $d800 ; color ram (used for temp. storage)
; ram under kernel
soft80_bitmap = $e000 soft80_bitmap = $e000
charsperline = 80 charsperline = 80
@@ -15,15 +13,11 @@ CH_HLINE = 96
CH_CROSS = 123 CH_CROSS = 123
CH_VLINE = 125 CH_VLINE = 125
CH_PI = 126 CH_PI = 126
CH_LTEE = 171
; FIXME: these are defined in cbm.h normally, the putchar stuff should accept CH_URCORNER = 174
; the regular codes instead of the following ones: CH_LLCORNER = 173
CH_ULCORNER = 176
CH_LTEE = 171-160 CH_BTEE = 177
CH_URCORNER = 174-160 CH_TTEE = 178
CH_LLCORNER = 173-160 CH_RTEE = 179
CH_ULCORNER = 176-160 CH_LRCORNER = 189
CH_BTEE = 177-160
CH_TTEE = 178-160
CH_RTEE = 179-160
CH_LRCORNER = 189-160

View File

@@ -7,6 +7,9 @@
.import popa, _gotoxy, soft80_cputdirect .import popa, _gotoxy, soft80_cputdirect
.importzp tmp1 .importzp tmp1
.include "c64.inc"
.include "soft80.inc"
soft80_chlinexy: soft80_chlinexy:
pha ; Save the length pha ; Save the length
jsr popa ; Get y jsr popa ; Get y
@@ -17,7 +20,7 @@ soft80_chline:
cmp #0 ; Is the length zero? cmp #0 ; Is the length zero?
beq L9 ; Jump if done beq L9 ; Jump if done
sta tmp1 sta tmp1
L1: lda #96 ; Horizontal line, petscii code L1: lda #CH_HLINE ; Horizontal line, petscii code
jsr soft80_cputdirect ; Direct output jsr soft80_cputdirect ; Direct output
dec tmp1 dec tmp1
bne L1 bne L1

View File

@@ -40,28 +40,39 @@ soft80_plot:
ldx CURS_Y ldx CURS_Y
ldy CURS_X ldy CURS_X
clc clc
jmp soft80_kplot ; Set the new cursor jmp soft80_kplot ; Set the new cursor
L1: cmp #$0D ; LF? L1: cmp #$0D ; LF?
beq soft80_newline ; Recalculate pointers beq soft80_newline ; Recalculate pointers
; Printable char of some sort ; Printable char of some sort
tay tay
bpl L10 bpl L10
; extra check for petscii codes 160-191, these have been moved to
; 0-31 in the charset
and #%11100000
cmp #%10100000
bne @sk
tya
and #%00011111
bpl L10 ; branch always
@sk:
tya
clc clc
adc #$20 adc #$20
and #$7F and #$7F
L10: L10:
soft80_cputdirect: soft80_cputdirect:
jsr soft80_putchar ; Write the character to the screen jsr soft80_putchar ; Write the character to the screen
; Advance cursor position ; Advance cursor position
advance: advance:
iny iny ; contains CURS_X
cpy #charsperline cpy #charsperline
beq L3 beq L3

View File

@@ -7,6 +7,9 @@
.import popa, _gotoxy, soft80_putchar, soft80_newline .import popa, _gotoxy, soft80_putchar, soft80_newline
.importzp tmp1 .importzp tmp1
.include "c64.inc"
.include "soft80.inc"
soft80_cvlinexy: soft80_cvlinexy:
pha ; Save the length pha ; Save the length
jsr popa ; Get y jsr popa ; Get y
@@ -17,7 +20,7 @@ soft80_cvline:
cmp #0 ; Is the length zero? cmp #0 ; Is the length zero?
beq L9 ; Jump if done beq L9 ; Jump if done
sta tmp1 sta tmp1
L1: lda #125 ; Vertical bar, petscii code L1: lda #CH_VLINE ; Vertical bar, petscii code
jsr soft80_putchar ; Write, no cursor advance jsr soft80_putchar ; Write, no cursor advance
jsr soft80_newline ; Advance cursor to next line jsr soft80_newline ; Advance cursor to next line
dec tmp1 dec tmp1