From 103dec9ab9807420f5d5daf5d8515e5c9837d25b Mon Sep 17 00:00:00 2001 From: sezero Date: Mon, 20 Aug 2018 14:00:02 +0300 Subject: [PATCH] glide2x,sst96: merged dborca commit 2506470 (Rush: fixed grLfbLock(AUXBUFFER)) --- glide2x/sst1/init/init96/dxdrvr.c | 12 ++++++++++++ glide2x/sst1/init/init96/init96.c | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/glide2x/sst1/init/init96/dxdrvr.c b/glide2x/sst1/init/init96/dxdrvr.c index fbb1409..7e2178c 100644 --- a/glide2x/sst1/init/init96/dxdrvr.c +++ b/glide2x/sst1/init/init96/dxdrvr.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** 35 11/03/98 11:13a Peter +** release exclusive mode in the fullscreen case of restoreVideo * * 34 1/12/98 10:22p Dow * H3D Stereo Support @@ -732,6 +735,15 @@ dxClose(void) * to only create lpDD1 once per application execution. /PGJ */ #if 1 + /* If we're fullscreen then we need to release exclusive mode access + * to the hw otherwise re-opens won't work. DD seems to take care of + * this if the app just quits, but nuking the surfaces does not seem + * to be sufficient in the normal case. + */ + if (IsFullScreen) { + IDirectDraw2_SetCooperativeLevel(lpDD, hWndApp, DDSCL_NORMAL ); + } + // Release any allocated buffers if( lpClipper) IDirectDrawSurface2_Release( lpClipper); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); diff --git a/glide2x/sst1/init/init96/init96.c b/glide2x/sst1/init/init96/init96.c index 35ea013..bd0f5a4 100644 --- a/glide2x/sst1/init/init96/init96.c +++ b/glide2x/sst1/init/init96/init96.c @@ -1638,7 +1638,7 @@ INITVG96ENTRY(init96Idle, void , (Init96WriteMethod *wcb) ) Return: void opinter to buffer -------------------------------------------------------------------*/ -#define LFB_OFFSET( X ) ( X & 0x3fffff ) +#define LFB_OFFSET( X ) ( X & 0x3fffff ) /* was 0x1fffff */ INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes)) { @@ -1665,7 +1665,12 @@ INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes) break; case INIT_BUFFER_AUXBUFFER: - rv = (void*)(((char*)sstHW) + LFB_OFFSET(ab0)); + rv = (void*)(((char*)sstHW) + LFB_OFFSET(ab0Base)); + /* [dBorca] + * used to be ab0, but I changed it to ab0Base. + * VG96STRIDE(ab0Stride) doesn't really matter, + * because we stripped off the high bits anyway! + */ *strideBytes = ab0Stride; GDBG_INFO((80, " get aux buffer pointer" )); break;