Created a target and a library for the Commander X16 prototype computer.

This commit is contained in:
Greg King
2019-09-27 03:38:51 -04:00
parent 0896deedef
commit 18afc7c703
49 changed files with 2440 additions and 59 deletions

43
libsrc/cx16/color.s Normal file
View File

@@ -0,0 +1,43 @@
;
; 2019-09-16, Greg King
;
; unsigned char __fastcall__ textcolor (unsigned char color);
; unsigned char __fastcall__ bgcolor (unsigned char color);
;
.export _textcolor, _bgcolor
.importzp tmp1
.include "cx16.inc"
_textcolor:
and #$0F
sta tmp1
ldx CHARCOLOR ; get old values
txa
and #<~$0F ; keep screen color, remove text color
ora tmp1
sta CHARCOLOR ; set new values
txa
and #$0F
rts
_bgcolor:
asl a ; move number to screen-color nybble
asl a
asl a
asl a
sta tmp1
ldx CHARCOLOR ; get old values
txa
and #<~$F0 ; remove screen color, keep text color
ora tmp1
sta CHARCOLOR ; set new values
txa
lsr a ; get screen color
lsr a
lsr a
lsr a
rts