For the CBM platforms, make revers() machine dependent and use the RVS flag

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
This commit is contained in:
cuz
2002-12-19 20:29:27 +00:00
parent 0b496a9daa
commit 36fe6284a8
33 changed files with 243 additions and 38 deletions

View File

@@ -23,7 +23,8 @@ OBJS = _scrsize.o \
kernal.o \
kplot.o \
randomize.o \
readjoy.o
readjoy.o \
revers.o
all: $(OBJS)

View 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

27
libsrc/vic20/revers.s Normal file
View File

@@ -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

View 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