]> git.sur5r.net Git - cc65/commitdiff
For the CBM platforms, make revers() machine dependent and use the RVS flag
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 19 Dec 2002 20:29:27 +0000 (20:29 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 19 Dec 2002 20:29:27 +0000 (20:29 +0000)
of the different machines instead of a separate one.
For the C128, make the textcolor() function work in 40 and 80 column mode.

git-svn-id: svn://svn.cc65.org/cc65/trunk@1787 b7a2c559-68d2-44c3-8de9-860c34a00d81

34 files changed:
libsrc/c128/Makefile
libsrc/c128/c128.inc
libsrc/c128/color.s
libsrc/c128/cputc.s
libsrc/c128/revers.s [new file with mode: 0644]
libsrc/c16/Makefile
libsrc/c16/cputc.s
libsrc/c16/revers.s [new file with mode: 0644]
libsrc/c64/Makefile
libsrc/c64/c64.inc
libsrc/c64/cputc.s
libsrc/c64/revers.s [new file with mode: 0644]
libsrc/cbm/Makefile
libsrc/cbm/revers.s [deleted file]
libsrc/cbm510/Makefile
libsrc/cbm510/cbm510.inc
libsrc/cbm510/cputc.s
libsrc/cbm510/revers.s [new file with mode: 0644]
libsrc/cbm610/Makefile
libsrc/cbm610/cbm610.inc
libsrc/cbm610/cputc.s
libsrc/cbm610/revers.s [new file with mode: 0644]
libsrc/pet/Makefile
libsrc/pet/cputc.s
libsrc/pet/pet.inc
libsrc/pet/revers.s [new file with mode: 0644]
libsrc/plus4/Makefile
libsrc/plus4/cputc.s
libsrc/plus4/plus4.inc
libsrc/plus4/revers.s [new file with mode: 0644]
libsrc/vic20/Makefile
libsrc/vic20/cputc.s
libsrc/vic20/revers.s [new file with mode: 0644]
libsrc/vic20/vic20.inc

index 80c76842346b91b5a9987464e315ecfac762e2a3..fc7e52a9bbda12fe9421462876db469d6463fa9d 100644 (file)
@@ -37,6 +37,7 @@ OBJS =        _scrsize.o      \
        mouse.o         \
         randomize.o     \
        readjoy.o       \
+        revers.o        \
        rs232.o         \
        tgi_mode_table.o
 
index 57441e3029efe6953150a10e709389a311c22b51..9e101d4f9c00c042358d862ea00b258e4e00e622 100644 (file)
@@ -16,6 +16,7 @@ FNAM_LO               = $BB           ; Address of filename
 FNAM_HI                = $BC
 FNAM_BANK              = $C7           ; Bank for filename
 KEY_COUNT              = $D0           ; Number of keys in input buffer
+FKEY_COUNT             = $D1           ; Characters for function key
 MODE                   = $D7           ; 40/80 column mode flag
 CURS_X                 = $EC           ; Cursor column
 CURS_Y                 = $EB           ; Cursor row
@@ -23,7 +24,7 @@ SCREEN_PTR            = $E0           ; Pointer to current char in text screen
 CRAM_PTR               = $E2           ; Pointer to current char in color RAM
 
 CHARCOLOR       = $F1
-FKEY_COUNT             = $D1           ; Characters for function key
+RVS             = $F3           ; Reverse output flag
 FETCH           = $2A2          ; Fetch subroutine in RAM
 FETVEC          = $2AA          ; Vector patch location for FETCH
 STASH           = $2AF          ; Stash routine in RAM
@@ -41,6 +42,7 @@ CURS_ON               = $CD6F
 CURS_OFF        = $CD9F
 CLRSCR         = $C142
 KBDREAD                = $C006
+PRINT          = $C00C
 
 ; Extended jump table
 SETBNK          = $FF68
index e58234373e59238bf41592dda5068285f13869ae..f60529b24eb19da730b2afc96b66f45a5ede4b4c 100644 (file)
 
 
 _textcolor:
-       ldx     CHARCOLOR       ; get old value
+       bit     MODE            ; Check 80/40 column mode
+       bpl     @L1             ; Jump if 40 columns
+       tax
+       lda     $CE5C,x         ; Translate VIC color -> VDC color
+@L1:   ldx     CHARCOLOR       ; get old value
        sta     CHARCOLOR       ; set new value
        txa
        rts
index 318aa6175928ddd6fa956e16f1d7eff752928f7b..9ba194290c829e1d1348f65a8b566ac48858a527 100644 (file)
@@ -8,7 +8,7 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
         .import         PLOT
 
        .include        "c128.inc"
@@ -98,7 +98,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        lda     CHARCOLOR
diff --git a/libsrc/c128/revers.s b/libsrc/c128/revers.s
new file mode 100644 (file)
index 0000000..f722c84
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "c128.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index 8577b66bba8c7df7650c6c5d88edc2e7f8167ed2..12b91c6a8d08f4b2e64df9ea9c94a858ae9726c6 100644 (file)
@@ -23,7 +23,8 @@ OBJS =        _scrsize.o      \
        kbhit.o         \
         kernal.o        \
         randomize.o     \
-       readjoy.o
+       readjoy.o       \
+        revers.o        
 
 all:   $(OBJS)
 
index 0d705892d4fb032708ea5081a93323726461f44e..680dc559398633f3cd0c1f9d4d62b59f90582fa8 100644 (file)
@@ -8,7 +8,7 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
         .import         PLOT
 
        .include        "../plus4/plus4.inc"
@@ -98,7 +98,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        lda     CHARCOLOR
diff --git a/libsrc/c16/revers.s b/libsrc/c16/revers.s
new file mode 100644 (file)
index 0000000..c9adac7
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "../plus4/plus4.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index c57920254eb831352d00045a61b0f382f80ed91f..a336320ec61ee4458561cfc82e0d6eab150ac1c4 100644 (file)
@@ -38,6 +38,7 @@ OBJS =        _scrsize.o              \
                mouse.o                 \
         randomize.o             \
                readjoy.o               \
+        revers.o                \
                rs232.o                 \
         tgi_mode_table.o
 
index 9d0130034b6ae3b0493ebff00a0455b6887363d7..913842fa3616354ec8092e27fc0a11f584fad757 100644 (file)
@@ -13,10 +13,10 @@ FNAM_LEN    = $B7           ; Length of filename
 SECADR         = $B9           ; Secondary address
 DEVNUM         = $BA           ; Device number
 KEY_COUNT              = $C6           ; Number of keys in input buffer
+RVS             = $C7           ; Reverse flag
 CURS_FLAG      = $CC           ; 1 = cursor off
 CURS_BLINK     = $CD           ; Blink counter
 CURS_CHAR      = $CE           ; Character under the cursor
-CURS_COLOR      = $287         ; Color under the cursor
 CURS_STATE     = $CF           ; Cursor blink state
 SCREEN_PTR     = $D1           ; Pointer to current char in text screen
 CURS_X         = $D3           ; Cursor column
@@ -24,6 +24,7 @@ CURS_Y                = $D6           ; Cursor row
 CRAM_PTR       = $F3           ; Pointer to current char in color RAM
 
 CHARCOLOR       = $286
+CURS_COLOR      = $287         ; Color under the cursor
 PALFLAG                = $2A6          ; $01 = PAL, $00 = NTSC
 
 
index 7bdcdc859cc5ec6518c87fb7bceba5927c876827..83a0c8b63f78d3b94d5a77c59a105152ac2e155f 100644 (file)
@@ -8,7 +8,7 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
         .import         PLOT
 
        .include        "c64.inc"
@@ -98,7 +98,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        lda     CHARCOLOR
diff --git a/libsrc/c64/revers.s b/libsrc/c64/revers.s
new file mode 100644 (file)
index 0000000..b6afa9c
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "c64.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index a77597bfa936cf4b7aeb260bbc2d68e40164802b..c8643855c497fc377fe381ee8f0378556e9c4a87 100644 (file)
@@ -56,7 +56,6 @@ S_OBJS =      c_acptr.o       \
                 oserrlist.o     \
                oserror.o       \
                 read.o          \
-               revers.o        \
                 rwcommon.o      \
                 scratch.o       \
                 sysremove.o     \
diff --git a/libsrc/cbm/revers.s b/libsrc/cbm/revers.s
deleted file mode 100644 (file)
index 64a0029..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-;
-; Ullrich von Bassewitz, 07.08.1998
-;
-; unsigned char revers (unsigned char onoff);
-;
-
-       .export         _revers
-       .export         revers
-
-_revers:
-       ldx     #$00            ; Assume revers off
-       tay                     ; Test onoff
-       beq     L1              ; Jump if off
-       ldx     #$80            ; Load on value
-L1:    ldy     #$00            ; Assume old value is zero
-       lda     revers          ; Load old value
-       stx     revers          ; Set new value
-       beq     L2              ; Jump if old value zero
-       iny                     ; Make old value = 1
-L2:    ldx     #$00            ; Load high byte of result
-       tya                     ; Load low byte, set CC
-       rts
-
-.bss
-
-revers:        .res    1
index e37d72bbe00c7c85a95e859e09baceedc6dd630f..7c0add7d99e16d052aed41b08d94297192f8eaa0 100644 (file)
@@ -49,6 +49,7 @@ OBJS =        _scrsize.o      \
        pokesys.o       \
         randomize.o     \
        readjoy.o       \
+       revers.o        \
        rs232.o         \
        tgi_mode_table.o
 
index d092f3d8477d9cfc0c5239e8085b6fa95afc9116..75ef374b7657667deb0e7923dca99d3c1413568f 100644 (file)
@@ -174,8 +174,7 @@ rs232head        = $037C
 rs232tail           = $037D
 PgmKeyEnd           = $0380
 PgmKeySeg           = $0382
-PgmKeySize          = $0383
-rvsFlag                     = $0397
+RVS                 = $0383
 linetmp                     = $0398
 LastPrtChar         = $0399
 InsertFlag          = $039A
@@ -188,7 +187,6 @@ SegSave                  = $03A0
 TabStopTable        = $03A1    ; 80 bits for tabstops
 KeyBuf              = $03AB    ; Keyboard buffer
 funvec              = $03B5    ; Vector for function key handline
-FunKeyTmp           = $03B7
 sedt3               = $03B9
 MoniSegSave         = $03f0
 wstvec              = $03F8
index 8b832614b3b82b84150a2791f429d979ebf2b865..e0c0e78374aeea20265d70f52549d2a51915e679 100644 (file)
@@ -10,7 +10,7 @@
 
         .import         PLOT
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
 
        .include        "cbm510.inc"
 
@@ -97,7 +97,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        ldx     IndReg
diff --git a/libsrc/cbm510/revers.s b/libsrc/cbm510/revers.s
new file mode 100644 (file)
index 0000000..47ed9ae
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "cbm510.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index ccd841b2cbdbc94324c93137a40252e2a3c51685..9fac393de9f552446ebd7b4e5ca660d2308b1371 100644 (file)
@@ -40,6 +40,7 @@ OBJS =        _scrsize.o      \
        peeksys.o       \
        pokesys.o       \
         randomize.o     \
+       revers.o        \
        rs232.o
 
 #--------------------------------------------------------------------------
index 32e41633d03079f1e46363945daf978700ea8af9..4f259ed2a5ca2e55e196cb9517ea6402a673b5a1 100644 (file)
@@ -167,7 +167,7 @@ rs232tail        = $037D
 PgmKeyEnd           = $0380
 PgmKeySeg           = $0382
 PgmKeySize          = $0383
-rvsFlag                     = $0397
+RVS                 = $0397
 linetmp                     = $0398
 LastPrtChar         = $0399
 InsertFlag          = $039A
index ac3224c6f1840b84f203e3da4cd140ee0991a78a..64988e4fef990ecbec65566bc8b2a49c5e18ad7d 100644 (file)
@@ -12,7 +12,7 @@
         .import         PLOT
        .import         _gotoxy
        .import         popa
-       .import         xsize, revers
+       .import         xsize
 
        .include        "cbm610.inc"
 
@@ -94,7 +94,7 @@ putchar:
        ldx     IndReg
        ldy     #$0F
        sty     IndReg
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (CharPtr),y     ; Set char
        stx     IndReg
diff --git a/libsrc/cbm610/revers.s b/libsrc/cbm610/revers.s
new file mode 100644 (file)
index 0000000..d5958a6
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "cbm610.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index 86eb5b5b4e845c57f0adba953f93ebf2ec78de80..80cdb6cea609756ecf3a26361d8d9f79247d8c6a 100644 (file)
@@ -32,7 +32,8 @@ OBJS =        _scrsize.o      \
         kreadst.o       \
         ksetlfs.o       \
         ksetnam.o       \
-        randomize.o
+        randomize.o    \
+       revers.o        
 
 all:   $(OBJS)
 
index 7dca231437f72e93a510c70a5e89eed4dad4f8b5..eb84305366e860399141d729dcaa776f041ab200 100644 (file)
@@ -8,10 +8,10 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
 
        .include        "pet.inc"
-       .include        "../cbm/cbm.inc"
+;      .include        "../cbm/cbm.inc"
 
 _cputcxy:
        pha                     ; Save C
@@ -98,7 +98,7 @@ plot: ldy     CURS_Y
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        rts
index 2bcbf57864f9cd8b11bafa6a68ab269eacb3f8fd..27a614b1601cc0176f1a4077e9f1374110b69d99 100644 (file)
@@ -10,6 +10,7 @@ MEMSIZE               = $34           ; Size of memory installed
 TIME            = $8D           ; 60HZ clock
 ST                     = $96           ; IEC status byte
 KEY_COUNT              = $9E           ; Number of keys in input buffer
+RVS            = $9F           ; Reverse flag
 CURS_FLAG      = $A7           ; 1 = cursor off
 CURS_BLINK     = $A8           ; Blink counter
 CURS_CHAR      = $A9           ; Character under the cursor
@@ -29,7 +30,7 @@ KEY_BUF               = $26F          ; Keyboard buffer
 ;----------------------------------------------------------------------------
 ; PET ROM type detection
 
-PET_DETECT      = $FFFB
+PET_DETECT      = $FFFB                              
 PET_2000        = $CA
 PET_3000        = $FC
 PET_4000        = $FD
diff --git a/libsrc/pet/revers.s b/libsrc/pet/revers.s
new file mode 100644 (file)
index 0000000..bbcf8e1
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "pet.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index 3b8ce23468de0afeca2ff70849edecd6cb7ac899..0e4c2633e08dfa791fbf91d0b75a669dbeac2711 100644 (file)
@@ -46,6 +46,7 @@ OBJS =        _scrsize.o      \
         kuntlk.o        \
         randomize.o     \
        readjoy.o       \
+        revers.o        \
        tgi_mode_table.o
 
 all:   $(OBJS)
index 1d3208c28cdd95f621c53582f7528ab0d6587e25..bbf4c5f12324641d829f9f25bb1e6c60b6775f8f 100644 (file)
@@ -8,7 +8,7 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
         .import         PLOT
 
        .include        "plus4.inc"
@@ -89,7 +89,7 @@ L11:  ora     #$40
 
 plot:  ldy     CURS_X
        ldx     CURS_Y
-       clc                 
+       clc
        jmp     PLOT            ; Set the new cursor
 
 
@@ -98,7 +98,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        lda     CHARCOLOR
index 825dda15f551cc25db2fd2fc2824b93a3b8fcf5a..01d02a6411d56a3758a14e1e53f82436a4eba0bf 100644 (file)
@@ -15,6 +15,7 @@ SECADR                = $AD           ; Secondary address
 DEVNUM         = $AE           ; Device number
 FNAM_ADR        = $AF           ; Pointer to filename for OPEN
 KEY_COUNT              = $EF           ; Number of keys in input buffer
+RVS             = $C2           ; Reverse flag
 CURS_X         = $CA           ; Cursor column
 CURS_Y         = $CD           ; Cursor row
 SCREEN_PTR     = $C8           ; Pointer to current char in text screen
diff --git a/libsrc/plus4/revers.s b/libsrc/plus4/revers.s
new file mode 100644 (file)
index 0000000..c48ff98
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "plus4.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index 4967c272051df12e74c6c1f192082b7d21a034f6..3b713f681eae99e714c309a43e423231722603a8 100644 (file)
@@ -23,7 +23,8 @@ OBJS =        _scrsize.o      \
         kernal.o        \
         kplot.o         \
         randomize.o     \
-       readjoy.o
+       readjoy.o       \
+       revers.o        
 
 all:   $(OBJS)
 
index c788d32af0b18ce3d0cc6149431e7a51ab9488f8..cf3c02fdfa2f9c3535e23a09029f882c0194c41c 100644 (file)
@@ -8,7 +8,7 @@
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
        .import         popa, _gotoxy
-       .import         xsize, revers
+       .import         xsize
         .import         PLOT
 
        .include        "vic20.inc"
@@ -98,7 +98,7 @@ plot: ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     revers          ; Set revers bit
+       ora     RVS             ; Set revers bit
                ldy     CURS_X
        sta     (SCREEN_PTR),y  ; Set char
        lda     CHARCOLOR
diff --git a/libsrc/vic20/revers.s b/libsrc/vic20/revers.s
new file mode 100644 (file)
index 0000000..da4d2ca
--- /dev/null
@@ -0,0 +1,27 @@
+;
+; Ullrich von Bassewitz, 07.08.1998
+;
+; unsigned char revers (unsigned char onoff);
+;
+
+       .export         _revers
+
+        .include        "vic20.inc"
+
+.proc   _revers
+
+       ldx     #$00            ; Assume revers off
+       tay                     ; Test onoff
+       beq     L1              ; Jump if off
+       ldx     #$80            ; Load on value
+        ldy    #$00            ; Assume old value is zero
+L1:     lda            RVS             ; Load old value
+       stx     RVS             ; Set new value
+       beq     L2              ; Jump if old value zero
+       iny                     ; Make old value = 1
+L2:    ldx     #$00            ; Load high byte of result
+       tya                     ; Load low byte, set CC
+       rts
+
+.endproc
+
index c24b99cc27f0315d627efe89fbfd6c0eba580996..3297fdbca6340be2e5903efa228b255c304d78f5 100644 (file)
@@ -13,10 +13,10 @@ FNAM_LEN    = $B7           ; Length of filename
 SECADR         = $B9           ; Secondary address
 DEVNUM         = $BA           ; Device number
 KEY_COUNT              = $C6           ; Number of keys in input buffer
+RVS            = $C7           ; Reverse flag
 CURS_FLAG      = $CC           ; 1 = cursor off
 CURS_BLINK     = $CD           ; Blink counter
 CURS_CHAR      = $CE           ; Character under the cursor
-CURS_COLOR      = $287         ; Color under the cursor
 CURS_STATE     = $CF           ; Cursor blink state
 SCREEN_PTR     = $D1           ; Pointer to current char in text screen
 CURS_X         = $D3           ; Cursor column
@@ -24,6 +24,7 @@ CURS_Y                = $D6           ; Cursor row
 CRAM_PTR       = $F3           ; Pointer to current char in color RAM
 
 CHARCOLOR       = $286
+CURS_COLOR      = $287         ; Color under the cursor
 PALFLAG                = $2A6          ; $01 = PAL, $00 = NTSC