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