2015-10-02 14:50:22 +00:00
|
|
|
.export vdc_init
|
|
|
|
|
2015-08-29 13:58:57 +00:00
|
|
|
.include "pce.inc"
|
2014-11-29 13:18:48 +00:00
|
|
|
|
2015-08-29 13:58:57 +00:00
|
|
|
; FIXME: implement selection of different video modes at runtime
|
|
|
|
HIRES = 1
|
2014-11-29 13:18:48 +00:00
|
|
|
|
|
|
|
vdc_init:
|
2015-09-29 16:39:58 +00:00
|
|
|
lda VDC_CTRL
|
2015-08-29 13:58:57 +00:00
|
|
|
|
2015-11-26 20:06:20 +00:00
|
|
|
VREG VDC_CR , $0000 ; disable display and interrupts
|
|
|
|
VREG VDC_BXR, $0000 ; no scrolling
|
|
|
|
VREG VDC_BYR, $0000
|
|
|
|
VREG VDC_MWR, $0070 ; 128 x 64 tiles (1024 x 512 pixels)
|
|
|
|
VREG VDC_VSR, $1702 ; CRTC
|
|
|
|
VREG VDC_VDR, $00DF ; CRTC - VDS
|
|
|
|
VREG VDC_VCR, $000C ; CRTC - VDE
|
|
|
|
VREG VDC_DCR, $0000
|
2014-11-29 13:18:48 +00:00
|
|
|
|
2015-07-15 11:18:12 +00:00
|
|
|
.if HIRES
|
2015-11-26 20:06:20 +00:00
|
|
|
VREG VDC_HSR, $0C02 ; CRTC
|
|
|
|
VREG VDC_HDR, $043C ; CRTC - HDS
|
2015-08-29 13:58:57 +00:00
|
|
|
lda #$06
|
2015-07-15 11:18:12 +00:00
|
|
|
.else
|
2015-11-26 20:06:20 +00:00
|
|
|
VREG VDC_HSR, $0202 ; CRTC
|
|
|
|
VREG VDC_HDR, $041F ; CRTC - HDS
|
2015-08-29 13:58:57 +00:00
|
|
|
lda #$04
|
2015-07-15 11:18:12 +00:00
|
|
|
.endif
|
2015-11-26 20:06:20 +00:00
|
|
|
sta VCE_CTRL
|
2014-11-29 13:18:48 +00:00
|
|
|
|
2015-09-29 16:39:58 +00:00
|
|
|
lda VDC_CTRL
|
2015-08-29 13:58:57 +00:00
|
|
|
rts
|