From fdd8358de7cdc149ad8d9fdbc87bc28dd6bc2853 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 28 Jan 2019 14:26:19 +0000 Subject: [PATCH] Make feature checks consistent, include right header for memset, correct one off error in paging table size compare for when not using USE_FULL_TLB (jmarsh) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4185 --- include/paging.h | 2 +- src/gui/sdlmain.cpp | 4 ++-- src/hardware/opl.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/paging.h b/include/paging.h index 168a038f..7126e26b 100644 --- a/include/paging.h +++ b/include/paging.h @@ -224,7 +224,7 @@ void PAGING_InitTLBBank(tlb_entry **bank); static INLINE tlb_entry *get_tlb_entry(PhysPt address) { Bitu index=(address>>12); - if (TLB_BANKS && (index > TLB_SIZE)) { + if (TLB_BANKS && (index >= TLB_SIZE)) { Bitu bank=(address>>BANK_SHIFT) - 1; if (!paging.tlbh_banks[bank]) PAGING_InitTLBBank(&paging.tlbh_banks[bank]); diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index c05821bf..282e100e 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -234,7 +234,7 @@ SDL_Surface* SDL_SetVideoMode_Wrap(int width,int height,int bpp,Bit32u flags){ // I don't see a difference, so disabled for now, as the code isn't finished either #if SETMODE_SAVES_CLEAR //TODO clear it. -#ifdef C_OPENGL +#if C_OPENGL if ((flags & SDL_OPENGL)==0) SDL_FillRect(sdl.surface,NULL,SDL_MapRGB(sdl.surface->format,0,0,0)); else { @@ -309,7 +309,7 @@ static void GFX_SetIcon() { /* Set Icon (must be done before any sdl_setvideomode call) */ /* But don't set it on OS X, as we use a nicer external icon there. */ /* Made into a separate call, so it can be called again when we restart the graphics output on win32 */ -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0xff000000,0x00ff0000,0x0000ff00,0); #else SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0x000000ff,0x0000ff00,0x00ff0000,0); diff --git a/src/hardware/opl.cpp b/src/hardware/opl.cpp index ea42d656..a8f21f71 100644 --- a/src/hardware/opl.cpp +++ b/src/hardware/opl.cpp @@ -27,6 +27,7 @@ #include #include // rand() +#include // memset() #include "dosbox.h" #include "opl.h"