]> git.sur5r.net Git - cc65/commitdiff
added extra check for graphical chars
authormrdudz <mrdudz@users.noreply.github.com>
Mon, 28 Sep 2015 13:10:57 +0000 (15:10 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Mon, 28 Sep 2015 13:10:57 +0000 (15:10 +0200)
libsrc/c64/soft80.inc
libsrc/c64/soft80_chline.s
libsrc/c64/soft80_cputc.s
libsrc/c64/soft80_cvline.s

index d67011b4a0e9b471e9a9062eb10c7a740a9e68aa..d534cac692e908919a211d8750a0672963472c15 100644 (file)
@@ -1,10 +1,8 @@
 
-; 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
@@ -15,15 +13,11 @@ CH_HLINE                = 96
 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
index ac9d123d380754b35b5bf43163fc133e31e1c279..e15d0c483c4bb00082bc2df7e13a01cf8c2a2c68 100644 (file)
@@ -7,6 +7,9 @@
         .import         popa, _gotoxy, soft80_cputdirect
         .importzp       tmp1
 
+        .include        "c64.inc"
+        .include        "soft80.inc"
+
 soft80_chlinexy:
         pha                             ; Save the length
         jsr     popa                    ; Get y
@@ -17,7 +20,7 @@ soft80_chline:
         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
index c819134762865dde775dec593d37ddc39c234346..d4c7e3050470b52b5a1ebdaf3c3f53849c87dd0b 100644 (file)
@@ -40,28 +40,39 @@ soft80_plot:
         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
 
index 847186a3bca6c29d67c34ebd83fdf81503066d03..eaa8501189d8806311fbb1e92523556f9b8b71ab 100644 (file)
@@ -7,6 +7,9 @@
         .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
@@ -17,7 +20,7 @@ soft80_cvline:
         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