Added VIC20 port changes from Steve Schmidtke
git-svn-id: svn://svn.cc65.org/cc65/trunk@1376 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
61
libsrc/vic20/color.s
Normal file
61
libsrc/vic20/color.s
Normal file
@@ -0,0 +1,61 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 06.08.1998
|
||||
; Adapted for Vic20 by Steve Schmidtke 05.08.2002
|
||||
;
|
||||
; unsigned char __fastcall__ textcolor (unsigned char color);
|
||||
; unsigned char __fastcall__ bgcolor (unsigned char color);
|
||||
; unsigned char __fastcall__ bordercolor (unsigned char color);
|
||||
;
|
||||
|
||||
|
||||
.export _textcolor, _bgcolor, _bordercolor
|
||||
|
||||
.include "vic20.inc"
|
||||
|
||||
.bss
|
||||
|
||||
clr_tmp: .res 1 ; tempory storage for bitfield ops
|
||||
|
||||
.code
|
||||
|
||||
_textcolor:
|
||||
ldx CHARCOLOR ; get old value
|
||||
sta CHARCOLOR ; set new value
|
||||
txa
|
||||
rts
|
||||
|
||||
|
||||
_bgcolor:
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
sei ; don't want anything messing around while we update
|
||||
sta clr_tmp
|
||||
lda VIC_COLOR ; get old value
|
||||
and #$0F
|
||||
tax
|
||||
ora clr_tmp
|
||||
sta VIC_COLOR ; set new value
|
||||
cli
|
||||
txa
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
rts
|
||||
|
||||
|
||||
_bordercolor:
|
||||
and #$07
|
||||
sei ; don't want anything messing around while we update
|
||||
sta clr_tmp
|
||||
lda VIC_COLOR ; get old value
|
||||
and #$F8
|
||||
tax
|
||||
ora clr_tmp
|
||||
sta VIC_COLOR ; set new value
|
||||
cli
|
||||
txa
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user