mirror of
https://github.com/cc65/cc65.git
synced 2024-11-15 11:05:56 +00:00
Split files
This commit is contained in:
parent
cdc6e1c61f
commit
422d245cab
@ -6,23 +6,16 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export _cputc
|
.export _cputc
|
||||||
.export _textcolor
|
.export umula0
|
||||||
.import _gotoxy, gotox, gotoy, pusha0
|
.import _gotoxy, gotox, gotoy, pusha0
|
||||||
.import pushax
|
.import pushax
|
||||||
.import _screen
|
.import _screen
|
||||||
.import CURS_X, CURS_Y
|
.import CURS_X, CURS_Y
|
||||||
|
.import txtcolor
|
||||||
|
|
||||||
.include "atari7800.inc"
|
.include "atari7800.inc"
|
||||||
.include "extzp.inc"
|
.include "extzp.inc"
|
||||||
|
|
||||||
.data
|
|
||||||
;-----------------------------------------------------------------------------
|
|
||||||
; Holder of the text colour offset
|
|
||||||
; 0 = red, 42 = green, 84 = white
|
|
||||||
;
|
|
||||||
txtcolor:
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
;---------------------------------------------------------------------------
|
;---------------------------------------------------------------------------
|
||||||
@ -52,39 +45,6 @@ umula0:
|
|||||||
lda ptr7800 ; Load the result
|
lda ptr7800 ; Load the result
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
|
||||||
; Change the text colour
|
|
||||||
;
|
|
||||||
; Logical colour names are
|
|
||||||
; 0 = red
|
|
||||||
; 1 = green
|
|
||||||
; 2 = white
|
|
||||||
;
|
|
||||||
; The routine will also return the previous textcolor
|
|
||||||
;
|
|
||||||
.proc _textcolor
|
|
||||||
|
|
||||||
beq @L2
|
|
||||||
sec
|
|
||||||
sbc #1
|
|
||||||
beq @L1
|
|
||||||
lda #84
|
|
||||||
jmp @L2
|
|
||||||
@L1: lda #42
|
|
||||||
@L2: ldy txtcolor
|
|
||||||
sta txtcolor ; Store new textcolor
|
|
||||||
tya
|
|
||||||
bne @L3
|
|
||||||
rts ; Old colour was 0
|
|
||||||
@L3: sec
|
|
||||||
sbc #42
|
|
||||||
bne @L4
|
|
||||||
lda #1
|
|
||||||
rts ; Old colour was 1
|
|
||||||
@L4: lda #2
|
|
||||||
rts ; Old colour was 2
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; Put a character on screen
|
; Put a character on screen
|
||||||
;
|
;
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
.import _zones
|
.import _zones
|
||||||
.import cursor
|
.import cursor
|
||||||
.import pusha, incsp1, pusha0, pushax, popa
|
.import pusha, incsp1, pusha0, pushax, popa
|
||||||
|
.import umula0
|
||||||
.include "atari7800.inc"
|
.include "atari7800.inc"
|
||||||
.include "extzp.inc"
|
.include "extzp.inc"
|
||||||
|
|
||||||
@ -51,32 +52,6 @@ blink_time:
|
|||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
;---------------------------------------------------------------------------
|
|
||||||
; 8x16 routine
|
|
||||||
|
|
||||||
umula0:
|
|
||||||
ldy #8 ; Number of bits
|
|
||||||
lda #0
|
|
||||||
lsr ptr7800 ; Get first bit into carry
|
|
||||||
@L0: bcc @L1
|
|
||||||
|
|
||||||
clc
|
|
||||||
adc ptrtmp
|
|
||||||
tax
|
|
||||||
lda ptrtmp+1 ; hi byte of left op
|
|
||||||
adc ptr7800+1
|
|
||||||
sta ptr7800+1
|
|
||||||
txa
|
|
||||||
|
|
||||||
@L1: ror ptr7800+1
|
|
||||||
ror a
|
|
||||||
ror ptr7800
|
|
||||||
dey
|
|
||||||
bne @L0
|
|
||||||
tax
|
|
||||||
lda ptr7800 ; Load the result
|
|
||||||
rts
|
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; Calculate cursorzone address
|
; Calculate cursorzone address
|
||||||
; You also need to set the cursorzone to point to the correct cursor Header
|
; You also need to set the cursorzone to point to the correct cursor Header
|
||||||
|
58
libsrc/atari7800/textcolor.s
Normal file
58
libsrc/atari7800/textcolor.s
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
;
|
||||||
|
; Karri Kaksonen, 2022-04-16
|
||||||
|
;
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _textcolor
|
||||||
|
.export txtcolor
|
||||||
|
|
||||||
|
.include "atari7800.inc"
|
||||||
|
|
||||||
|
.data
|
||||||
|
;-----------------------------------------------------------------------------
|
||||||
|
; Holder of the text colour offset
|
||||||
|
; 0 = red, 42 = green, 84 = white
|
||||||
|
;
|
||||||
|
txtcolor:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
;-----------------------------------------------------------------------------
|
||||||
|
; Change the text colour
|
||||||
|
;
|
||||||
|
; Logical colour names are
|
||||||
|
; 0 = red
|
||||||
|
; 1 = green
|
||||||
|
; 2 = white
|
||||||
|
;
|
||||||
|
; The routine will also return the previous textcolor
|
||||||
|
;
|
||||||
|
.proc _textcolor
|
||||||
|
|
||||||
|
beq @L2
|
||||||
|
sec
|
||||||
|
sbc #1
|
||||||
|
beq @L1
|
||||||
|
lda #84
|
||||||
|
jmp @L2
|
||||||
|
@L1: lda #42
|
||||||
|
@L2: ldy txtcolor
|
||||||
|
sta txtcolor ; Store new textcolor
|
||||||
|
tya
|
||||||
|
bne @L3
|
||||||
|
rts ; Old colour was 0
|
||||||
|
@L3: sec
|
||||||
|
sbc #42
|
||||||
|
bne @L4
|
||||||
|
lda #1
|
||||||
|
rts ; Old colour was 1
|
||||||
|
@L4: lda #2
|
||||||
|
rts ; Old colour was 2
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; force the init constructor to be imported
|
||||||
|
|
||||||
|
.import initconio
|
||||||
|
conio_init = initconio
|
Loading…
Reference in New Issue
Block a user