mirror of
https://github.com/cc65/cc65.git
synced 2025-01-03 01:31:55 +00:00
Add mono conio files
This commit is contained in:
parent
4fc1270110
commit
45c4f7d46f
@ -8,6 +8,7 @@
|
||||
.include "atari7800_maria.inc"
|
||||
|
||||
; constants for the conio implementation
|
||||
mono_charsperline = 40
|
||||
charsperline = 20
|
||||
screenrows = 28
|
||||
|
||||
|
@ -10,7 +10,7 @@ SYMBOLS {
|
||||
__ENCRYPT_BOTTOM__: value = $ff7a, type = export;
|
||||
__ENCRYPT_SIZE__: value = $80, type = export;
|
||||
__MEMORY_TOP__: value = __ENCRYPT_BOTTOM__, type = export;
|
||||
__INIT_SIZE__: value = 154, type = export;
|
||||
__INIT_SIZE__: value = 156, type = export;
|
||||
__MEMORY_INIT__: value = __MEMORY_TOP__ - __INIT_SIZE__, type = export;
|
||||
__MEMORY_BOTTOM__: value = $10000 - __CARTSIZE__, type = weak;
|
||||
__FREE_ROM_SIZE__: value = __MEMORY_INIT__ - __MEMORY_BOTTOM__, type = export;
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
.proc _clrscr
|
||||
|
||||
lda #<(_screen)
|
||||
ldx #>(_screen)
|
||||
lda #<_screen
|
||||
ldx #>_screen
|
||||
sta ptr7800
|
||||
stx ptr7800+1
|
||||
ldx #screenrows
|
||||
|
@ -8,7 +8,8 @@
|
||||
|
||||
.constructor initconio
|
||||
.include "atari7800.inc"
|
||||
.import _font160
|
||||
.include "extzp.inc"
|
||||
.import _font
|
||||
.import _get_tv
|
||||
.export _screen
|
||||
.export _zones
|
||||
@ -57,7 +58,7 @@ _screen:
|
||||
; Cursor
|
||||
.byte 254
|
||||
.byte 0
|
||||
.byte >_font160
|
||||
.byte >_font
|
||||
.byte 0
|
||||
.endmacro
|
||||
|
||||
@ -205,12 +206,14 @@ vblankon:
|
||||
vblankoff:
|
||||
lda MSTAT
|
||||
bpl vblankoff
|
||||
lda #>_font160
|
||||
lda #>_font
|
||||
sta CHBASE
|
||||
lda #(CTRL_MODE160 | CTRL_KANGOFF | CTRL_BCBLACK | CTRL_CHAR2B | CTRL_DMAON | CTRL_CKOFF)
|
||||
sta CTRL
|
||||
lda #$00 ; Black background
|
||||
sta BKGRND
|
||||
sta CURS_X
|
||||
sta CURS_Y
|
||||
lda #$33 ; Red
|
||||
sta P0C1
|
||||
lda #$c8 ; Green
|
||||
|
@ -10,7 +10,6 @@
|
||||
.import _gotoxy, gotox, gotoy, pusha0
|
||||
.import pushax
|
||||
.import _screen
|
||||
.import CURS_X, CURS_Y
|
||||
.import txtcolor
|
||||
|
||||
.include "atari7800.inc"
|
||||
|
@ -10,4 +10,6 @@
|
||||
.global ptr7800: zp
|
||||
.global ptrtmp: zp
|
||||
.global cursorzone: zp
|
||||
.global CURS_X: zp
|
||||
.global CURS_Y: zp
|
||||
|
||||
|
@ -11,3 +11,5 @@
|
||||
ptr7800: .res 2
|
||||
ptrtmp: .res 2
|
||||
cursorzone: .res 2
|
||||
CURS_X: .res 1
|
||||
CURS_Y: .res 1
|
||||
|
@ -16,10 +16,10 @@
|
||||
; 0, 2, 4, 6, ... 254
|
||||
; Odd indices cannot be used.
|
||||
|
||||
.export _font160
|
||||
.export _font
|
||||
.rodata
|
||||
.align 256
|
||||
_font160:
|
||||
_font:
|
||||
.byte $0, $0, $41, $41, $0, $0, $14, $0
|
||||
.byte $0, $0, $0, $0, $1, $40, $0, $0
|
||||
.byte $0, $0, $0, $0, $0, $0, $0, $0
|
||||
|
@ -24,7 +24,6 @@
|
||||
;
|
||||
|
||||
.export gotoxy, _gotoxy, gotox, gotoy
|
||||
.export CURS_X, CURS_Y
|
||||
.constructor init_cursor
|
||||
.interruptor blink_cursor
|
||||
|
||||
@ -43,10 +42,6 @@
|
||||
; The variables used by cursor functions
|
||||
;
|
||||
|
||||
CURS_X:
|
||||
.byte 0
|
||||
CURS_Y:
|
||||
.byte 0
|
||||
blink_time:
|
||||
.byte 140
|
||||
|
||||
|
@ -51,9 +51,3 @@ txtcolor:
|
||||
@L4: lda #2
|
||||
rts ; Old colour was 2
|
||||
.endproc
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; force the init constructor to be imported
|
||||
|
||||
.import initconio
|
||||
conio_init = initconio
|
||||
|
@ -5,7 +5,7 @@
|
||||
;
|
||||
|
||||
.export _wherex
|
||||
.import CURS_X
|
||||
.include "extzp.inc"
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; Get cursor X position
|
||||
|
@ -5,7 +5,7 @@
|
||||
;
|
||||
|
||||
.export _wherey
|
||||
.import CURS_Y
|
||||
.include "extzp.inc"
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; Get cursor Y position
|
||||
|
Loading…
Reference in New Issue
Block a user