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:
@@ -37,6 +37,7 @@ OBJS = _scrsize.o \
|
||||
mouse.o \
|
||||
randomize.o \
|
||||
readjoy.o \
|
||||
revers.o \
|
||||
rs232.o \
|
||||
tgi_mode_table.o
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
|
||||
|
||||
_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
|
||||
|
||||
@@ -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
|
||||
|
||||
27
libsrc/c128/revers.s
Normal file
27
libsrc/c128/revers.s
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user