Add mono conio files

This commit is contained in:
Karri Kaksonen 2022-04-18 11:59:54 +03:00
parent 4fc1270110
commit 45c4f7d46f
12 changed files with 18 additions and 22 deletions

View File

@ -8,6 +8,7 @@
.include "atari7800_maria.inc"
; constants for the conio implementation
mono_charsperline = 40
charsperline = 20
screenrows = 28

View File

@ -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;

View File

@ -11,8 +11,8 @@
.proc _clrscr
lda #<(_screen)
ldx #>(_screen)
lda #<_screen
ldx #>_screen
sta ptr7800
stx ptr7800+1
ldx #screenrows

View File

@ -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

View File

@ -10,7 +10,6 @@
.import _gotoxy, gotox, gotoy, pusha0
.import pushax
.import _screen
.import CURS_X, CURS_Y
.import txtcolor
.include "atari7800.inc"

View File

@ -10,4 +10,6 @@
.global ptr7800: zp
.global ptrtmp: zp
.global cursorzone: zp
.global CURS_X: zp
.global CURS_Y: zp

View File

@ -11,3 +11,5 @@
ptr7800: .res 2
ptrtmp: .res 2
cursorzone: .res 2
CURS_X: .res 1
CURS_Y: .res 1

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -5,7 +5,7 @@
;
.export _wherex
.import CURS_X
.include "extzp.inc"
;-----------------------------------------------------------------------------
; Get cursor X position

View File

@ -5,7 +5,7 @@
;
.export _wherey
.import CURS_Y
.include "extzp.inc"
;-----------------------------------------------------------------------------
; Get cursor Y position