From ecd555183d37a515c4595af28ad0ea21fa3d12d4 Mon Sep 17 00:00:00 2001 From: z_demo_z <> Date: Mon, 15 Jul 2002 00:12:36 +0000 Subject: [PATCH] Some video fix (pagefault) --- zsnes/src/win/winintrf.asm | 1 + zsnes/src/win/winlink.cpp | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index 8579832d..5309b291 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -1255,6 +1255,7 @@ NEWSYM GUIDSIZE, db 0,0,0,1,0,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1, NEWSYM GUIRATIO, db 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 NEWSYM GUIBIFIL, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 NEWSYM GUITBWVID, db 0,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1 ; Triple Buffering (Win) +NEWSYM GUISMODE, db 0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,1,1,0,1,0,0,1,1,1,0,1,1,1,1,0,1 SECTION .text ; **************************** diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 4d4dc3fe..a466b359 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -1488,7 +1488,11 @@ char WinMessage[256]; extern unsigned char cvidmode; DWORD FirstVid=1; DWORD FirstFull=1; +DWORD SMode=0; +DWORD DSMode=0; extern BYTE GUIWFVID[]; +extern BYTE GUISMODE[]; +extern BYTE GUIDSIZE[]; extern unsigned short resolutn; void clearwin(); @@ -1510,6 +1514,8 @@ void initwinvideo(void) X=0; Y=0; FullScreen=GUIWFVID[cvidmode]; + SMode=GUISMODE[cvidmode]; + DSMode=GUIDSIZE[cvidmode]; switch (cvidmode) { @@ -1693,9 +1699,9 @@ void initwinvideo(void) BlitArea.left = 0; BlitArea.right = SurfaceX; - if (FullScreen == 0) + if (FullScreen == 0 && DSMode == 0) BlitArea.bottom = (SurfaceY/240)*resolutn; - else + else BlitArea.bottom = SurfaceY; if (PrevRes == 0) PrevRes = resolutn; @@ -2086,16 +2092,18 @@ void drawscreenwin(void) if (resolutn == 224 && FullScreen == 0 && PrevRes != resolutn) { - BlitArea.bottom = (SurfaceY/240)*224; - WindowHeight = (WindowHeight/239)*224; + if (DSMode == 0) BlitArea.bottom = (SurfaceY/240)*224; + else BlitArea.bottom = SurfaceY; + if (SMode == 0) WindowHeight = (WindowHeight/239)*224; initwinvideo(); PrevRes = resolutn; } if (resolutn == 239 && FullScreen == 0 && PrevRes != resolutn) { - BlitArea.bottom = (SurfaceY/240)*239; - WindowHeight = (WindowHeight/224)*239; + if (DSMode == 0) BlitArea.bottom = (SurfaceY/240)*224; + else BlitArea.bottom = SurfaceY; + if (SMode == 0) WindowHeight = (WindowHeight/239)*224; initwinvideo(); PrevRes = resolutn; }