From 2c8adb2660b1b4b148fc600976543ec88ddd79f9 Mon Sep 17 00:00:00 2001 From: Ralf Grillenberger Date: Sun, 27 Jan 2013 18:27:36 +0000 Subject: [PATCH] Use current address instead of (current page * page size) for the scroll window base. This is the implementation in S3 and IBM VGA. Tseng BIOSes have the previous, incompatible implementation. Fixes an advertisement program and possibly others I don't remember. Patch by ripsaw. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3815 --- src/ints/int10_char.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ints/int10_char.cpp b/src/ints/int10_char.cpp index f619f00f..9915b787 100644 --- a/src/ints/int10_char.cpp +++ b/src/ints/int10_char.cpp @@ -201,9 +201,11 @@ void INT10_ScrollWindow(Bit8u rul,Bit8u cul,Bit8u rlr,Bit8u clr,Bit8s nlines,Bit if(clr>=ncols) clr=(Bit8u)ncols-1; clr++; - /* Get the correct page */ - if(page==0xFF) page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); - PhysPt base=CurMode->pstart+page*real_readw(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE); + /* Get the correct page: current start address for current page (0xFF), + otherwise calculate from page number and page size */ + PhysPt base=CurMode->pstart; + if (page==0xff) base+=real_readw(BIOSMEM_SEG,BIOSMEM_CURRENT_START); + else base+=page*real_readw(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE); if (GCC_UNLIKELY(machine==MCH_PCJR)) { if (real_readb(BIOSMEM_SEG, BIOSMEM_CURRENT_MODE) >= 9) {