diff --git a/glide2x/cvg/glide/src/gsst.c b/glide2x/cvg/glide/src/gsst.c index 93935ae..38966ef 100644 --- a/glide2x/cvg/glide/src/gsst.c +++ b/glide2x/cvg/glide/src/gsst.c @@ -633,8 +633,7 @@ __tryReOpen: ** oem map board */ if (gc->oemInit) { - FARPROC oemInitMapBoard = NULL; - oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); + FARPROC oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); if (oemInitMapBoard != NULL) oemInitMapBoard(&gc->oemi); else @@ -676,8 +675,8 @@ __tryReOpen: gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; if (gc->oemInit) { - FARPROC oemInitVideoTiming = NULL; - if (oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) { + FARPROC oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); + if (oemInitVideoTiming) { if (oemInitVideoTiming(&gc->oemi.vid)) { /* ** video timing is updated by oem dll @@ -792,10 +791,12 @@ __tryReOpen: FARPROC oemGet; FxI32 tv_connected = 0; FxI32 slimaster[2], slislave[2]; - if (oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) + oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); + if (oemInitSetVideo) oemInitSetVideo(&gc->oemi); - if (oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12")) { + oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12"); + if (oemGet) { oemGet(FX_OEM_TVOUT, 4, &tv_connected); /* Is tv connected to the board? */ if (tv_connected) { @@ -1572,9 +1573,9 @@ __errSliExit: --------------------------------------------------------*/ #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash; + HMODULE newSplash = LoadLibrary("3dfxspl2.dll"); - if (newSplash = LoadLibrary("3dfxspl2.dll")) { + if (newSplash) { GrState glideState; FxBool didLoad; GrSplashProc fxSplash; @@ -1619,7 +1620,7 @@ __errSliExit: grGlideSetState((const void*)&glideState); } } - + FreeLibrary(newSplash); } } @@ -1883,16 +1884,16 @@ GR_ENTRY(grSstControl, FxBool, (GrControl_t code)) if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { - FARPROC oemControl = NULL; if (gc->oemInit) { - if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) + FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); + if (oemControl) oemControl(code); } } #endif } -#endif +#endif } GDBG_INFO(41, "%s: Returning TRUE\n", FN_NAME); diff --git a/glide2x/h3/glide/src/gsst.c b/glide2x/h3/glide/src/gsst.c index fc11b33..bbb97f9 100644 --- a/glide2x/h3/glide/src/gsst.c +++ b/glide2x/h3/glide/src/gsst.c @@ -1422,7 +1422,8 @@ GR_ENTRY(grSstWinClose, void, (void)) #if defined(GLIDE3) && defined(GLIDE3_ALPHA) if (gc->oemInit) { - if (oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0")) + oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0"); + if (oemRestoreVideo) oemRestoreVideo(); FreeLibrary(gc->oemInit); } @@ -1430,7 +1431,7 @@ GR_ENTRY(grSstWinClose, void, (void)) #endif /* !GLIDE_INIT_HAL */ /* Unmap the board */ - hwcUnmapBoard(gc->bInfo); + hwcUnmapBoard(gc->bInfo); /*-------------------------- GC Reset diff --git a/glide2x/sst1/glide/src/gsst.c b/glide2x/sst1/glide/src/gsst.c index 93f4ee7..106c211 100644 --- a/glide2x/sst1/glide/src/gsst.c +++ b/glide2x/sst1/glide/src/gsst.c @@ -607,8 +607,8 @@ GR_ENTRY(grSstWinOpen, FxBool, ( oemi.subvendorID = OEMINIT_INVALID_BOARD_ID; oemi.linearAddress = gc->base_ptr; oemi.slaveAddress = NULL; - if (gc->oemInit = LoadLibrary("fxoem2x.dll")) { - if (oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) { + if ((gc->oemInit = LoadLibrary("fxoem2x.dll")) != NULL) { + if ((oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) != NULL) { oemInitMapBoard(&oemi); } } @@ -955,15 +955,15 @@ GR_ENTRY(grSstWinOpen, FxBool, ( grSstOrigin( GR_ORIGIN_LOWER_LEFT ); if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash; + HMODULE newSplash = LoadLibrary("3dfxsplash2.dll"); - if (newSplash = LoadLibrary("3dfxsplash2.dll")) { - FARPROC fxSplash; + if (newSplash) { + FARPROC fxSplash = GetProcAddress(newSplash, "_fxSplash@16"); - if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) { + if (fxSplash) { fxSplash(hWnd, gc->state.screen_width, - gc->state.screen_height, nAuxBuffers); - _GlideRoot.environment.noSplash = 1; + gc->state.screen_height, nAuxBuffers); + _GlideRoot.environment.noSplash = 1; } } } diff --git a/glide3x/cvg/glide3/src/gsst.c b/glide3x/cvg/glide3/src/gsst.c index 22e9565..2dd5384 100644 --- a/glide3x/cvg/glide3/src/gsst.c +++ b/glide3x/cvg/glide3/src/gsst.c @@ -629,8 +629,7 @@ __tryReOpen: ** oem map board */ if (gc->oemInit) { - FARPROC oemInitMapBoard = NULL; - oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); + FARPROC oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); if (oemInitMapBoard != NULL) oemInitMapBoard(&gc->oemi); else @@ -672,8 +671,8 @@ __tryReOpen: gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; if (gc->oemInit) { - FARPROC oemInitVideoTiming = NULL; - if (oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) { + FARPROC oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); + if (oemInitVideoTiming) { if (oemInitVideoTiming(&gc->oemi.vid)) { /* ** video timing is updated by oem dll @@ -779,10 +778,12 @@ __tryReOpen: FARPROC oemGet; FxI32 tv_connected = 0; FxI32 slimaster[2], slislave[2]; - if (oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) + oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); + if (oemInitSetVideo) oemInitSetVideo(&gc->oemi); - if (oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12")) { + oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12"); + if (oemGet) { oemGet(FX_OEM_TVOUT, 4, &tv_connected); /* Is tv connected to the board? */ if (tv_connected) { @@ -1526,9 +1527,9 @@ __errSliExit: #ifdef GLIDE_SPLASH #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash; + HMODULE newSplash = LoadLibrary("3dfxspl3.dll"); - if (newSplash = LoadLibrary("3dfxspl3.dll")) { + if (newSplash) { GrState glideState; FxBool didLoad; GrSplashProc fxSplash; @@ -1573,7 +1574,7 @@ __errSliExit: grGlideSetState((const void*)&glideState); } } - + FreeLibrary(newSplash); } } @@ -1828,9 +1829,9 @@ _grSstControl(GrControl_t code) if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { - FARPROC oemControl = NULL; if (gc->oemInit) { - if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) + FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); + if (oemControl) oemControl(code); } } diff --git a/glide3x/sst1/glide3/src/gsst.c b/glide3x/sst1/glide3/src/gsst.c index 9edc52d..d32fa14 100644 --- a/glide3x/sst1/glide3/src/gsst.c +++ b/glide3x/sst1/glide3/src/gsst.c @@ -632,8 +632,8 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, oemi.subvendorID = OEMINIT_INVALID_BOARD_ID; oemi.linearAddress = gc->base_ptr; oemi.slaveAddress = NULL; - if (gc->oemInit = LoadLibrary("fxoem2x.dll")) { - if (oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) { + if ((gc->oemInit = LoadLibrary("fxoem2x.dll")) != NULL) { + if ((oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) != NULL) { oemInitMapBoard(&oemi); } }