-; ram under i/o
soft80_lo_charset = $d000
soft80_hi_charset = $d400
-soft80_vram = $d800
+soft80_vram = $d800 ; ram under i/o
soft80_colram = $d800 ; color ram (used for temp. storage)
-; ram under kernel
soft80_bitmap = $e000
charsperline = 80
CH_CROSS = 123
CH_VLINE = 125
CH_PI = 126
-
-; FIXME: these are defined in cbm.h normally, the putchar stuff should accept
-; the regular codes instead of the following ones:
-
-CH_LTEE = 171-160
-CH_URCORNER = 174-160
-CH_LLCORNER = 173-160
-CH_ULCORNER = 176-160
-CH_BTEE = 177-160
-CH_TTEE = 178-160
-CH_RTEE = 179-160
-CH_LRCORNER = 189-160
+CH_LTEE = 171
+CH_URCORNER = 174
+CH_LLCORNER = 173
+CH_ULCORNER = 176
+CH_BTEE = 177
+CH_TTEE = 178
+CH_RTEE = 179
+CH_LRCORNER = 189
.import popa, _gotoxy, soft80_cputdirect
.importzp tmp1
+ .include "c64.inc"
+ .include "soft80.inc"
+
soft80_chlinexy:
pha ; Save the length
jsr popa ; Get y
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
sta tmp1
-L1: lda #96 ; Horizontal line, petscii code
+L1: lda #CH_HLINE ; Horizontal line, petscii code
jsr soft80_cputdirect ; Direct output
dec tmp1
bne L1
ldx CURS_Y
ldy CURS_X
clc
- jmp soft80_kplot ; Set the new cursor
+ jmp soft80_kplot ; Set the new cursor
L1: cmp #$0D ; LF?
- beq soft80_newline ; Recalculate pointers
+ beq soft80_newline ; Recalculate pointers
; Printable char of some sort
tay
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
adc #$20
and #$7F
L10:
soft80_cputdirect:
- jsr soft80_putchar ; Write the character to the screen
+ jsr soft80_putchar ; Write the character to the screen
; Advance cursor position
advance:
- iny
+ iny ; contains CURS_X
cpy #charsperline
beq L3
.import popa, _gotoxy, soft80_putchar, soft80_newline
.importzp tmp1
+ .include "c64.inc"
+ .include "soft80.inc"
+
soft80_cvlinexy:
pha ; Save the length
jsr popa ; Get y
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
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_newline ; Advance cursor to next line
dec tmp1