mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 02:55:20 +00:00
some CONIO fixes
This commit is contained in:
parent
8cb68071cd
commit
0f2f19ef5b
@ -57,8 +57,8 @@ PADDL7 = $18 ;POT7 "
|
|||||||
|
|
||||||
; cc65 runtime zero page variables
|
; cc65 runtime zero page variables
|
||||||
|
|
||||||
COLCRS_5200 = $19
|
ROWCRS_5200 = $19
|
||||||
ROWCRS_5200 = $1A
|
COLCRS_5200 = $1A
|
||||||
SAVMSC = $1B ; pointer to screen memory (conio)
|
SAVMSC = $1B ; pointer to screen memory (conio)
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
@ -1,44 +1,57 @@
|
|||||||
|
|
||||||
.include "atari5200.inc"
|
.include "atari5200.inc"
|
||||||
|
|
||||||
SCREEN_BUF_SIZE = 20 * 24
|
SCREEN_BUF_SIZE = 20 * 24
|
||||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||||
|
|
||||||
.code
|
.code
|
||||||
.export screen_setup_20x24
|
.export screen_setup_20x24
|
||||||
|
|
||||||
screen_setup_20x24:
|
screen_setup_20x24:
|
||||||
|
|
||||||
; initialize SAVMSC
|
; initialize SAVMSC
|
||||||
lda #<SCREEN_BUF
|
lda #<SCREEN_BUF
|
||||||
sta SAVMSC
|
sta SAVMSC
|
||||||
lda #>SCREEN_BUF
|
lda #>SCREEN_BUF
|
||||||
sta SAVMSC+1
|
sta SAVMSC+1
|
||||||
|
|
||||||
; initialize cursor position
|
; initialize cursor position
|
||||||
lda #0
|
lda #0
|
||||||
sta COLCRS_5200
|
sta COLCRS_5200
|
||||||
sta ROWCRS_5200
|
sta ROWCRS_5200
|
||||||
|
|
||||||
; clear screen buffer
|
; clear screen buffer
|
||||||
ldy #<(SCREEN_BUF_SIZE-1)
|
ldy #<(SCREEN_BUF_SIZE-1)
|
||||||
ldx #>(SCREEN_BUF_SIZE-1)
|
ldx #>(SCREEN_BUF_SIZE-1)
|
||||||
clrscr: sta (SAVMSC),y
|
clrscr: sta (SAVMSC),y
|
||||||
dey
|
dey
|
||||||
cpy #$FF
|
cpy #$FF
|
||||||
bne clrscr
|
bne clrscr
|
||||||
dex
|
dex
|
||||||
cpx #$FF
|
cpx #$FF
|
||||||
bne clrscr
|
bne clrscr
|
||||||
|
|
||||||
; set display list
|
; set default colors
|
||||||
|
|
||||||
lda #<dlist
|
lda #40
|
||||||
sta SDLSTL
|
sta COLOR0
|
||||||
lda #>dlist
|
lda #202
|
||||||
sta SDLSTH
|
sta COLOR1
|
||||||
|
lda #148
|
||||||
|
sta COLOR2
|
||||||
|
lda #70
|
||||||
|
sta COLOR3
|
||||||
|
lda #0
|
||||||
|
sta COLOR4
|
||||||
|
|
||||||
rts
|
; set display list
|
||||||
|
|
||||||
|
lda #<dlist
|
||||||
|
sta SDLSTL
|
||||||
|
lda #>dlist
|
||||||
|
sta SDLSTH
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
.segment "RODATA"
|
.segment "RODATA"
|
||||||
|
@ -54,7 +54,7 @@ cputdirect: ; accepts screen code
|
|||||||
; advance cursor
|
; advance cursor
|
||||||
inc COLCRS_5200
|
inc COLCRS_5200
|
||||||
lda COLCRS_5200
|
lda COLCRS_5200
|
||||||
cmp #40
|
cmp #20
|
||||||
bcc plot
|
bcc plot
|
||||||
lda #0
|
lda #0
|
||||||
sta COLCRS_5200
|
sta COLCRS_5200
|
||||||
@ -72,7 +72,6 @@ plot: jsr setcursor
|
|||||||
ldx ROWCRS_5200
|
ldx ROWCRS_5200
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; turn off cursor, update screen, turn on cursor
|
|
||||||
putchar:
|
putchar:
|
||||||
pha ; save char
|
pha ; save char
|
||||||
|
|
||||||
|
@ -10,6 +10,4 @@
|
|||||||
|
|
||||||
_gotox:
|
_gotox:
|
||||||
sta COLCRS_5200 ; Set X
|
sta COLCRS_5200 ; Set X
|
||||||
lda #0
|
|
||||||
sta COLCRS_5200+1
|
|
||||||
jmp setcursor
|
jmp setcursor
|
||||||
|
@ -14,6 +14,4 @@ _gotoxy: ; Set the cursor position
|
|||||||
sta ROWCRS_5200 ; Set Y
|
sta ROWCRS_5200 ; Set Y
|
||||||
jsr popa ; Get X
|
jsr popa ; Get X
|
||||||
sta COLCRS_5200 ; Set X
|
sta COLCRS_5200 ; Set X
|
||||||
lda #0
|
|
||||||
sta COLCRS_5200+1 ;
|
|
||||||
jmp setcursor
|
jmp setcursor
|
||||||
|
Loading…
Reference in New Issue
Block a user