1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 06:30:16 +00:00
This commit is contained in:
mrdudz 2021-03-26 22:18:31 +01:00
commit d2bc449598
5 changed files with 77 additions and 39 deletions

View File

@ -1,8 +1,7 @@
;
; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
; VIC-20 generic definitions. Stolen mostly from c64.inc -- Steve Schmidtke
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
@ -12,8 +11,8 @@ TXTPTR := $7A ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
TIME := $A0 ; 60HZ clock
FNAM_LEN := $B7 ; Length of filename
SECADR := $B9 ; Secondary address
DEVNUM := $BA ; Device number
SECADR := $B9 ; Second address
DEVNUM := $BA ; Device number (first address)
FNAM := $BB ; Pointer to filename
KEY_COUNT := $C6 ; Number of keys in input buffer
RVS := $C7 ; Reverse flag
@ -36,6 +35,8 @@ KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
RSSTAT := $297 ; RS-232 device driver status
; ---------------------------------------------------------------------------
; Screen size

View File

@ -142,13 +142,20 @@ The functions listed below are special for the CX16. See the <url
url="funcref.html" name="function reference"> for declarations and usage.
<itemize>
<item>get_ostype
<item>set_tv
<item>videomode
<item>vpeek
<item>vpoke
<item>get_ostype()
<item>set_tv()
<item>videomode()
<item>vpeek()
<item>vpoke()
</itemize>
<tt/cpeekcolor()/ works differently on the Commander X16 than it does on other
platforms. Each character has two colors: background and text (foreground).
<tt/cpeekcolor()/ returns both colors. The high nybble describes the
background color, the low nybble describes the text color. For example, if the
function is used on the default screen, then it returns &dollar;61, which means
white-on-blue.
<sect1>CBM-specific functions<p>
@ -157,32 +164,32 @@ machines. See the <url url="funcref.html" name="function reference"> for
declarations and usage.
<itemize>
<item>cbm_close
<item>cbm_closedir
<item>cbm_k_basin
<item>cbm_k_bsout
<item>cbm_k_chkin
<item>cbm_k_ckout
<item>cbm_k_close
<item>cbm_k_clrch
<item>cbm_k_getin
<item>cbm_k_load
<item>cbm_k_open
<item>cbm_k_readst
<item>cbm_k_save
<item>cbm_k_second
<item>cbm_k_setlfs
<item>cbm_k_setnam
<item>cbm_k_tksa
<item>cbm_load
<item>cbm_open
<item>cbm_opendir
<item>cbm_read
<item>cbm_readdir
<item>cbm_save
<item>cbm_write
<item>get_tv
<item>waitvsync
<item>cbm_close()
<item>cbm_closedir()
<item>cbm_k_basin()
<item>cbm_k_bsout()
<item>cbm_k_chkin()
<item>cbm_k_ckout()
<item>cbm_k_close()
<item>cbm_k_clrch()
<item>cbm_k_getin()
<item>cbm_k_load()
<item>cbm_k_open()
<item>cbm_k_readst()
<item>cbm_k_save()
<item>cbm_k_second()
<item>cbm_k_setlfs()
<item>cbm_k_setnam()
<item>cbm_k_tksa()
<item>cbm_load()
<item>cbm_open()
<item>cbm_opendir()
<item>cbm_read()
<item>cbm_readdir()
<item>cbm_save()
<item>cbm_write()
<item>get_tv()
<item>waitvsync()
</itemize>

View File

@ -2813,6 +2813,8 @@ location of the cursor in the display screen RAM. That number can be passed to
done to make it obvious that peeking doesn't move the cursor in any way. Your
program must place the cursor where it wants to peek before it calls any of
those functions.
<item>On the cx16 (Commander X16) target, this function returns two values: the
background color, in the high nybble, and the text color, in the low nybble.
</itemize>
<tag/Availability/cc65
<tag/See also/

View File

@ -1,5 +1,6 @@
;
; Ullrich von Bassewitz, 03.06.1999
; 1999-06-03, Ullrich von Bassewitz
; 2021-01-12, Greg King
;
; unsigned char cbm_k_readst (void);
;
@ -10,6 +11,5 @@
_cbm_k_readst:
jsr READST
ldx #0 ; Clear high byte
rts
ldx #>$0000
jmp READST

28
libsrc/vic20/c_readst.s Normal file
View File

@ -0,0 +1,28 @@
;
; 1999-06-03, Ullrich von Bassewitz
; 2021-01-12, Greg King
;
; unsigned char cbm_k_readst (void);
;
; This version works around a bug in VIC-20 Kernal's READST function.
;
.include "vic20.inc"
.include "../cbm/cbm.inc"
.export _cbm_k_readst
_cbm_k_readst:
ldx #>$0000
lda DEVNUM
cmp #CBMDEV_RS232
beq @L1
jmp READST
; Work-around: Read the RS-232 status variable directly.
@L1: lda RSSTAT
stx RSSTAT ; reset the status bits
rts