1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Fix race condition

This commit is contained in:
Karri Kaksonen 2022-04-19 20:01:47 +03:00 committed by mrdudz
parent 7f9909ef81
commit 4ee3e59f19
6 changed files with 29 additions and 42 deletions

View File

@ -4,7 +4,7 @@
.export _clrscr
.import _screen
.import pusha0,pushax
.import pushax, __bzero
.include "extzp.inc"
.code
@ -13,22 +13,10 @@
lda #<_screen
ldx #>_screen
sta ptr7800
stx ptr7800+1
ldx #screenrows
@L1: ldy #charsperline
lda #0
@L2: sta (ptr7800),y
dey
bne @L2
lda ptr7800
clc
adc #charsperline
bcc @L3
inc ptr7800+1
@L3: dex
bne @L1
rts
jsr pushax
ldx #>(charsperline * screenrows)
lda #<(charsperline * screenrows)
jmp __bzero
.endproc

View File

@ -9,7 +9,7 @@
.constructor initconio
.include "atari7800.inc"
.include "extzp.inc"
.import _font
.import _conio_font
.import _get_tv
.export _screen
.export _zones
@ -58,7 +58,7 @@ _screen:
; Cursor
.byte 254
.byte 0
.byte >_font
.byte >_conio_font
.byte 0
.endmacro
@ -206,7 +206,7 @@ vblankon:
vblankoff:
lda MSTAT
bpl vblankoff
lda #>_font
lda #>_conio_font
sta CHBASE
lda #(CTRL_MODE160 | CTRL_KANGOFF | CTRL_BCBLACK | CTRL_CHAR2B | CTRL_DMAON | CTRL_CKOFF)
sta CTRL

View File

@ -16,10 +16,10 @@
; 0, 2, 4, 6, ... 254
; Odd indices cannot be used.
.export _font
.export _conio_font
.rodata
.align 256
_font:
_conio_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

@ -4,7 +4,7 @@
.export _mono_clrscr
.import _mono_screen
.import pusha0,pushax
.import pushax, __bzero
.include "extzp.inc"
.code
@ -13,22 +13,10 @@
lda #<_mono_screen
ldx #>_mono_screen
sta ptr7800
stx ptr7800+1
ldx #screenrows
@L1: ldy #mono_charsperline
lda #0
@L2: sta (ptr7800),y
dey
bne @L2
lda ptr7800
clc
adc #mono_charsperline
bcc @L3
inc ptr7800+1
@L3: dex
bne @L1
rts
jsr pushax
ldx #>(mono_charsperline * screenrows)
lda #<(mono_charsperline * screenrows)
jmp __bzero
.endproc

View File

@ -42,7 +42,7 @@
;
blink_time:
.byte 140
.byte 255
.code
@ -175,6 +175,9 @@ umula0:
; Offset to cursor zone 5.
;
.proc mono_blink_cursor
lda blink_time
cmp #255
beq @L3
inc blink_time
bne @L3
lda #140
@ -197,7 +200,10 @@ umula0:
.segment "ONCE"
mono_init_cursor:
lda #0
jmp calccursorzone
jsr calccursorzone
lda #0
sta blink_time
rts
;-----------------------------------------------------------------------------

View File

@ -42,7 +42,7 @@
;
blink_time:
.byte 140
.byte 255
.code
@ -177,6 +177,9 @@ umula0:
; Offset to cursor zone 5.
;
.proc blink_cursor
lda blink_time
cmp #255
beq @L3
inc blink_time
bne @L3
lda #140
@ -199,6 +202,8 @@ umula0:
init_cursor:
lda #0
jsr calccursorzone
lda #0
sta blink_time
rts
;-----------------------------------------------------------------------------