1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-05 08:05:51 +00:00
cc65/libsrc/creativision/clrscr.s
Christian Groessler a3d8829be9 Creativison changes.
This change includes some cleanups, removal of mainargs.s (game console
programs never have arguments), and a workaround for a problem I'm seeing.

The problem is that sometimes (in fact, more often than not) the clrscr()
call in testcode/lib/joy-test.c writes some garbage chars on the screen (most
often a "P"). Could be my hardware (I haven't seen it on MAME), but to
me the root cause is still unknown.
2017-03-17 21:42:51 +01:00

42 lines
948 B
ArmAsm

;*
;* clrscr
;*
;* NB: All screen functions assume Graphics Mode 1 in a default configuration.
;* Therefore, this is hard coded to use $1000-$12FF as screen VRAM.
.export _clrscr
.include "creativision.inc"
_clrscr:
sei ; Disable interrupts. Default INT handler reads VDP_STATUS
; and would lose any setup done here.
lda #$00 ; VRAM offset low
sta VDP_CONTROL_W
lda #$50 ; VRAM offset high ($10 OR $40)
sta VDP_CONTROL_W
lda #$40 ; Space char from ROM setup
ldx #0
ldy #3
L1: sta VDP_DATA_W
inx
bne L1
dey
bne L1
cli ; Let interrupts go again
lda #0
sta CURSOR_X
sta CURSOR_Y
sta SCREEN_PTR
lda #$10
sta SCREEN_PTR+1
rts