From bb807af8c7e69e58afeff831594c35f2a86d5646 Mon Sep 17 00:00:00 2001 From: Ralf Grillenberger Date: Mon, 9 Jun 2014 19:07:14 +0000 Subject: [PATCH] Use PCJr specific method to clear the video RAM. Also don't scroll at unspecified video page. Fixes issues with KQ1 and KQ2. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3860 --- src/ints/int10_char.cpp | 3 ++- src/ints/int10_modes.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ints/int10_char.cpp b/src/ints/int10_char.cpp index 9915b787..415a0589 100644 --- a/src/ints/int10_char.cpp +++ b/src/ints/int10_char.cpp @@ -215,7 +215,8 @@ void INT10_ScrollWindow(Bit8u rul,Bit8u cul,Bit8u rlr,Bit8u clr,Bit8s nlines,Bit (real_readb(BIOSMEM_SEG, BIOSMEM_CRTCPU_PAGE) >> 3) & 0x7; base = cpupage << 14; - base += page*real_readw(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE); + if (page!=0xff) + base += page*real_readw(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE); } } diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index 4c8d4609..e27a4e31 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -385,9 +385,18 @@ static void FinishSetMode(bool clearmem) { /* Clear video memory if needs be */ if (clearmem) { switch (CurMode->type) { + case M_TANDY16: + if ((machine==MCH_PCJR) && (CurMode->mode >= 9)) { + // PCJR cannot access the full 32k at 0xb800 + for (Bit16u ct=0;ct<16*1024;ct++) { + // 0x1800 is the last 32k block in 128k, as set in the CRTCPU_PAGE register + real_writew(0x1800,ct*2,0x0000); + } + break; + } + // fall-through case M_CGA4: case M_CGA2: - case M_TANDY16: for (Bit16u ct=0;ct<16*1024;ct++) { real_writew( 0xb800,ct*2,0x0000); }