# HG changeset patch # User Laurens Holst # Date 1424729213 -3600 # Mon Feb 23 23:06:53 2015 +0100 # Node ID a4360b4a1f949317409400f3fde427323e266e37 # Parent 82bc5a3f383c009a6cef8e8dc4a6659329f87ccd VDP: Properly initialise V99X8 mirrors on MSX1 and MSX2. diff --git a/src/VDP.asm b/src/VDP.asm --- a/src/VDP.asm +++ b/src/VDP.asm @@ -11,6 +11,45 @@ VDP_MIRROR_8: equ 0FFE7H - 8 VDP_MIRROR_25: equ 0FFFAH - 25 +; +VDP_InitMirrorsOnVDPUpgrades: PROC + ld a,(EXPTBL) + ld hl,IDBYT2 + call RDSLT + ei + and a + cp 1 + jr c,MSX1 + jr z,MSX2 + ret +MSX1: + ld hl,VDP_initR8ToR23 + ld de,VDP_MIRROR_8 + 8 + ld bc,16 + ldir + ld hl,VDP_initR25ToR27 + ld de,VDP_MIRROR_25 + 25 + ld bc,3 + ldir + ld a,(EXPTBL) + ld hl,IDBYT0 + call RDSLT + ei + and 10000000B + ret z + ld a,(VDP_MIRROR_8 + 9) ; set PAL bit + or 00000010B + ld (VDP_MIRROR_8 + 9),a + ret +MSX2: + ld hl,VDP_initR25ToR27 + ld de,VDP_MIRROR_25 + 25 + ld bc,3 + ldir + ret + ENDP + +; VDP_InitScreen0: PROC xor a ld hl,0 @@ -46,14 +85,6 @@ ld (VDP_MIRROR_0 + 2),a ld b,2 call VDP_SetRegister - ld a,(EXPTBL) - ld hl,IDBYT0 - call RDSLT - ei - and 10000000B - rlca - rlca - ld (VDP_MIRROR_8 + 9),a ; Initialise MSX2 register mirror ret ENDP @@ -330,3 +361,9 @@ jp nz,Loop ret ENDP + +; +VDP_initR8ToR23: ; for NTSC + db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 5, 0 +VDP_initR25ToR27: + db 0, 0, 0 diff --git a/src/ui/UI.asm b/src/ui/UI.asm --- a/src/ui/UI.asm +++ b/src/ui/UI.asm @@ -17,6 +17,7 @@ INCLUDE "HorizontalScrollBarView.asm" UI_Init: + call VDP_InitMirrorsOnVDPUpgrades call VDP_InitScreen0 call VDP_Enable212Lines call VDP_Enable60Hz