diff --git a/core/cfg/cfg.cpp b/core/cfg/cfg.cpp index 3f70c7729..5b01d4968 100644 --- a/core/cfg/cfg.cpp +++ b/core/cfg/cfg.cpp @@ -5,9 +5,12 @@ */ #define _CRT_SECURE_NO_DEPRECATE (1) -#include + #include "cfg.h" #include "ini.h" +#include "stdclass.h" + +#include static string cfgPath; static bool save_config = true; diff --git a/core/deps/coreio/coreio.cpp b/core/deps/coreio/coreio.cpp index 4f73716cc..df5627df6 100644 --- a/core/deps/coreio/coreio.cpp +++ b/core/deps/coreio/coreio.cpp @@ -26,6 +26,7 @@ #include #include #else + #include #pragma comment (lib, "wsock32.lib") #endif #endif diff --git a/core/hw/aica/aica_if.h b/core/hw/aica/aica_if.h index 8ce44ba1c..fe1f3cc4c 100644 --- a/core/hw/aica/aica_if.h +++ b/core/hw/aica/aica_if.h @@ -1,5 +1,6 @@ #pragma once #include "types.h" +#include "stdclass.h" extern u32 VREG; extern VArray2 aica_ram; diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index c0009ca0f..831a5165a 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -5,6 +5,7 @@ #include "hw/naomi/naomi_cart.h" #include "hw/pvr/spg.h" #include "input/gamepad_device.h" +#include "stdclass.h" #include #include diff --git a/core/hw/modem/picoppp.cpp b/core/hw/modem/picoppp.cpp index d9fd740e3..c22b19740 100644 --- a/core/hw/modem/picoppp.cpp +++ b/core/hw/modem/picoppp.cpp @@ -21,6 +21,8 @@ #if !defined(_MSC_VER) && !defined(TARGET_NO_THREADS) +#include "stdclass.h" + #ifdef __MINGW32__ #define _POSIX_SOURCE #endif diff --git a/core/hw/naomi/gdcartridge.cpp b/core/hw/naomi/gdcartridge.cpp index f96732f8b..df48f7ce4 100644 --- a/core/hw/naomi/gdcartridge.cpp +++ b/core/hw/naomi/gdcartridge.cpp @@ -11,6 +11,7 @@ */ #include "gdcartridge.h" +#include "stdclass.h" /* diff --git a/core/hw/naomi/naomi_cart.cpp b/core/hw/naomi/naomi_cart.cpp index 545bac95b..ccd6b87bc 100644 --- a/core/hw/naomi/naomi_cart.cpp +++ b/core/hw/naomi/naomi_cart.cpp @@ -22,7 +22,6 @@ #include #include "naomi_cart.h" #include "naomi_regs.h" -#include "cfg/cfg.h" #include "naomi.h" #include "decrypt.h" #include "naomi_roms.h" @@ -33,6 +32,7 @@ #include "awcartridge.h" #include "gdcartridge.h" #include "archive/archive.h" +#include "stdclass.h" Cartridge *CurrentCartridge; bool bios_loaded = false; diff --git a/core/hw/pvr/pvr_mem.h b/core/hw/pvr/pvr_mem.h index ee0345081..04bab6cae 100644 --- a/core/hw/pvr/pvr_mem.h +++ b/core/hw/pvr/pvr_mem.h @@ -1,5 +1,6 @@ #pragma once #include "types.h" +#include "stdclass.h" f32 vrf(u32 addr); u32 vri(u32 addr); diff --git a/core/hw/pvr/ta_ctx.h b/core/hw/pvr/ta_ctx.h index 481d47f56..6854733de 100644 --- a/core/hw/pvr/ta_ctx.h +++ b/core/hw/pvr/ta_ctx.h @@ -3,6 +3,7 @@ #include "ta_structs.h" #include "pvr_regs.h" #include "helper_classes.h" +#include "stdclass.h" // helper for 32 byte aligned memory allocation void* OS_aligned_malloc(size_t align, size_t size); diff --git a/core/hw/sh4/dyna/blockmanager.h b/core/hw/sh4/dyna/blockmanager.h index 264f09dc1..c3f3c1f91 100644 --- a/core/hw/sh4/dyna/blockmanager.h +++ b/core/hw/sh4/dyna/blockmanager.h @@ -3,9 +3,11 @@ */ #pragma once -#include #include "types.h" #include "decoder.h" +#include "stdclass.h" + +#include typedef void (*DynarecCodeEntryPtr)(); typedef std::shared_ptr RuntimeBlockInfoPtr; diff --git a/core/hw/sh4/modules/ccn.cpp b/core/hw/sh4/modules/ccn.cpp index 20b220d7e..a71f595c5 100644 --- a/core/hw/sh4/modules/ccn.cpp +++ b/core/hw/sh4/modules/ccn.cpp @@ -1,14 +1,14 @@ //gah , ccn emulation //CCN: Cache and TLB controller -#include "types.h" -#include "hw/sh4/sh4_mmr.h" #include "ccn.h" -#include "../sh4_core.h" -#include "hw/pvr/pvr_mem.h" +#include "mmu.h" #include "hw/mem/_vmem.h" #include "hw/mem/vmem32.h" -#include "mmu.h" +#include "hw/pvr/pvr_mem.h" +#include "hw/sh4/sh4_if.h" +#include "hw/sh4/sh4_mmr.h" +#include "hw/sh4/sh4_core.h" //Types diff --git a/core/hw/sh4/modules/tmu.cpp b/core/hw/sh4/modules/tmu.cpp index 0c71d5581..7a38ea375 100644 --- a/core/hw/sh4/modules/tmu.cpp +++ b/core/hw/sh4/modules/tmu.cpp @@ -3,7 +3,7 @@ */ #include "types.h" -#include "../sh4_sched.h" +#include "hw/sh4/sh4_sched.h" #include "hw/sh4/sh4_interrupts.h" #include "hw/sh4/sh4_mmr.h" diff --git a/core/hw/sh4/sh4_if.h b/core/hw/sh4/sh4_if.h index 480f9faca..e6b739810 100644 --- a/core/hw/sh4/sh4_if.h +++ b/core/hw/sh4/sh4_if.h @@ -1,5 +1,6 @@ #pragma once #include "types.h" +#include "stdclass.h" enum Sh4RegType { @@ -245,6 +246,7 @@ struct sh4_if StartFP* Start; }; +extern sh4_if sh4_cpu; struct Sh4Context { diff --git a/core/hw/sh4/sh4_mem.h b/core/hw/sh4/sh4_mem.h index 426e98406..4dd1b5c5f 100644 --- a/core/hw/sh4/sh4_mem.h +++ b/core/hw/sh4/sh4_mem.h @@ -1,5 +1,6 @@ #pragma once #include "types.h" +#include "stdclass.h" //main system mem extern VArray2 mem_b; diff --git a/core/input/mapping.cpp b/core/input/mapping.cpp index d8371e664..45243574e 100644 --- a/core/input/mapping.cpp +++ b/core/input/mapping.cpp @@ -18,6 +18,7 @@ */ #include "mapping.h" #include "cfg/ini.h" +#include "stdclass.h" static struct { diff --git a/core/linux/posix_vmem.cpp b/core/linux/posix_vmem.cpp index 51b42a51f..2e5c543aa 100644 --- a/core/linux/posix_vmem.cpp +++ b/core/linux/posix_vmem.cpp @@ -11,6 +11,7 @@ #include #include "hw/mem/_vmem.h" +#include "hw/sh4/sh4_if.h" #include "stdclass.h" #ifndef MAP_NOSYNC diff --git a/core/nullDC.cpp b/core/nullDC.cpp index cdcd9877c..a6d94deae 100755 --- a/core/nullDC.cpp +++ b/core/nullDC.cpp @@ -15,6 +15,7 @@ #include "hw/naomi/naomi_cart.h" #include "reios/reios.h" #include "hw/sh4/sh4_sched.h" +#include "hw/sh4/sh4_if.h" #include "hw/pvr/Renderer_if.h" #include "hw/pvr/spg.h" #include "hw/aica/dsp.h" diff --git a/core/oslib/audiobackend_coreaudio.cpp b/core/oslib/audiobackend_coreaudio.cpp index dd7bdb7dc..3e77344f1 100644 --- a/core/oslib/audiobackend_coreaudio.cpp +++ b/core/oslib/audiobackend_coreaudio.cpp @@ -15,6 +15,8 @@ #include "audiostream.h" #if HOST_OS == OS_DARWIN +#include "stdclass.h" + #include //#include diff --git a/core/sdl/sdl.cpp b/core/sdl/sdl.cpp index ff72c485f..b4ebf6263 100644 --- a/core/sdl/sdl.cpp +++ b/core/sdl/sdl.cpp @@ -312,6 +312,8 @@ void sdl_window_destroy() } #ifdef _WIN32 +#include + HWND sdl_get_native_hwnd() { SDL_SysWMinfo wmInfo; diff --git a/core/sdl/sdl.h b/core/sdl/sdl.h index f449df28b..41750d3df 100644 --- a/core/sdl/sdl.h +++ b/core/sdl/sdl.h @@ -8,6 +8,8 @@ extern void sdl_window_create(); extern void sdl_window_set_text(const char* text); extern void sdl_window_destroy(); extern void sdl_recreate_window(u32 flags); + #ifdef _WIN32 +#include HWND sdl_get_native_hwnd(); #endif diff --git a/core/stdclass.h b/core/stdclass.h index 6431d7d96..8316f221c 100644 --- a/core/stdclass.h +++ b/core/stdclass.h @@ -1,9 +1,6 @@ #pragma once #include "types.h" -#include -#include - #ifndef _WIN32 #include #else @@ -174,9 +171,3 @@ public: return data[i]; } }; - -int msgboxf(const char* text,unsigned int type,...); - -#define MBX_OK 0 -#define MBX_ICONEXCLAMATION 0 -#define MBX_ICONERROR 0 diff --git a/core/types.h b/core/types.h index 2ecbebdaa..bda9f3d48 100644 --- a/core/types.h +++ b/core/types.h @@ -68,6 +68,7 @@ #include #include +#include //basic types typedef int8_t s8; @@ -271,9 +272,6 @@ using namespace std; #define unlikely(x) __builtin_expect((x),0) #endif -//basic includes -#include "stdclass.h" - #include "log/Log.h" #ifndef NO_MMU @@ -310,6 +308,12 @@ bool dc_unserialize(void **data, unsigned int *total_size); #define stricmp strcasecmp #endif +int msgboxf(const char* text, unsigned int type, ...); + +#define MBX_OK 0 +#define MBX_ICONEXCLAMATION 0 +#define MBX_ICONERROR 0 + #define verify(x) do { if ((x) == false){ msgboxf("Verify Failed : " #x "\n in %s -> %s : %d \n", MBX_ICONERROR, (__FUNCTION__), (__FILE__), __LINE__); dbgbreak;}} while (false) #define die(reason) do { msgboxf("Fatal error : %s\n in %s -> %s : %d \n", MBX_ICONERROR,(reason), (__FUNCTION__), (__FILE__), __LINE__); dbgbreak;} while (false) @@ -554,12 +558,8 @@ inline bool is_u8(u32 v) { return (u8)v==(s32)v; } inline bool is_s16(u32 v) { return (s16)v==(s32)v; } inline bool is_u16(u32 v) { return (u16)v==(u32)v; } -#include "hw/sh4/sh4_if.h" - //more to come -extern sh4_if sh4_cpu; - //sh4 thread s32 plugins_Init(); void plugins_Term(); diff --git a/core/windows/win_vmem.cpp b/core/windows/win_vmem.cpp index 593e72972..48c920c3c 100644 --- a/core/windows/win_vmem.cpp +++ b/core/windows/win_vmem.cpp @@ -4,6 +4,7 @@ #include #include "hw/mem/_vmem.h" +#include "hw/sh4/sh4_if.h" // Implementation of the vmem related function for Windows platforms. // For now this probably does some assumptions on the CPU/platform. diff --git a/shell/apple/emulator-osx/emulator-osx/osx-main.mm b/shell/apple/emulator-osx/emulator-osx/osx-main.mm index 29cb5b090..d3b1ba0bf 100644 --- a/shell/apple/emulator-osx/emulator-osx/osx-main.mm +++ b/shell/apple/emulator-osx/emulator-osx/osx-main.mm @@ -19,6 +19,7 @@ #if defined(USE_SDL) #include "sdl/sdl.h" #endif +#include "stdclass.h" #include "wsi/context.h" OSXKeyboardDevice keyboard(0);