mirror of
https://github.com/cc65/cc65.git
synced 2024-06-08 15:29:37 +00:00
atari5200: changes from discussions in #870
- rename screen_setup to initconio - use Greg King's version of bgcolor()
This commit is contained in:
parent
d7eecb57f8
commit
e1e6bec9ff
|
@ -1,36 +1,26 @@
|
||||||
;
|
;
|
||||||
; Christian Groessler, 05-Apr-2019
|
; Greg King, 10-Apr-2019
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _bgcolor
|
.export _bgcolor
|
||||||
|
|
||||||
.include "atari5200.inc"
|
.include "atari5200.inc"
|
||||||
|
|
||||||
.constructor init_old_bgcolor
|
.data
|
||||||
|
|
||||||
.bss
|
old_bg_index:
|
||||||
|
.byte COLOR_BLACK ; see conioscreen.s for default palette
|
||||||
old_bg_color:
|
|
||||||
.res 1
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
_bgcolor:
|
_bgcolor:
|
||||||
and #3
|
and #$03
|
||||||
tax
|
tax
|
||||||
lda COLOR0,x
|
ldy COLOR0,x
|
||||||
ldx old_bg_color
|
lda old_bg_index
|
||||||
sta COLOR4 ; set new value
|
sty COLOR4 ; set new value
|
||||||
sta old_bg_color
|
stx old_bg_index
|
||||||
txa
|
ldx #0 ; fix high byte
|
||||||
ldx #0 ; fix X
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.segment "ONCE"
|
.end
|
||||||
|
|
||||||
init_old_bgcolor:
|
|
||||||
lda COLOR0+3 ; see also conioscreen.s for initialization
|
|
||||||
sta old_bg_color
|
|
||||||
rts
|
|
||||||
|
|
||||||
.end
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
SCREEN_BUF_SIZE = 20 * 24
|
SCREEN_BUF_SIZE = 20 * 24
|
||||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||||
|
|
||||||
.export screen_setup
|
.export initconio
|
||||||
.export screen_width, screen_height
|
.export screen_width, screen_height
|
||||||
.export conio_color
|
.export conio_color
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ screen_height = 24
|
||||||
|
|
||||||
.segment "ONCE"
|
.segment "ONCE"
|
||||||
|
|
||||||
screen_setup:
|
; initialize color registers, display list, and screen memory
|
||||||
|
initconio:
|
||||||
|
|
||||||
; initialize SAVMSC
|
; initialize SAVMSC
|
||||||
lda #<SCREEN_BUF
|
lda #<SCREEN_BUF
|
||||||
|
@ -62,9 +63,9 @@ clrscr: sta (SAVMSC),y
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.data
|
.bss
|
||||||
|
|
||||||
conio_color: .byte 0
|
conio_color: .res 1
|
||||||
|
|
||||||
.segment "DLIST"
|
.segment "DLIST"
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
.importzp screen_width, screen_height
|
.importzp screen_width, screen_height
|
||||||
.importzp ptr4
|
.importzp ptr4
|
||||||
|
|
||||||
.import screen_setup
|
.import initconio
|
||||||
.constructor screen_setup_constructor, 26
|
.constructor initconio_constructor
|
||||||
screen_setup_constructor = screen_setup
|
initconio_constructor = initconio
|
||||||
|
|
||||||
_cputcxy:
|
_cputcxy:
|
||||||
pha ; Save C
|
pha ; Save C
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
SCREEN_BUF_SIZE = 20 * 12
|
SCREEN_BUF_SIZE = 20 * 12
|
||||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||||
|
|
||||||
.export screen_setup
|
.export initconio
|
||||||
.export screen_width, screen_height
|
.export screen_width, screen_height
|
||||||
.export conio_color
|
.export conio_color
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ screen_height = 12
|
||||||
|
|
||||||
.segment "ONCE"
|
.segment "ONCE"
|
||||||
|
|
||||||
screen_setup:
|
; initialize color registers, display list, and screen memory
|
||||||
|
initconio:
|
||||||
|
|
||||||
; initialize SAVMSC
|
; initialize SAVMSC
|
||||||
lda #<SCREEN_BUF
|
lda #<SCREEN_BUF
|
||||||
|
@ -62,9 +63,9 @@ clrscr: sta (SAVMSC),y
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.data
|
.bss
|
||||||
|
|
||||||
conio_color: .byte 0
|
conio_color: .res 1
|
||||||
|
|
||||||
.segment "DLIST"
|
.segment "DLIST"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user