diff --git a/libretro.cpp b/libretro.cpp index 12cfaa13..08f2ddb4 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -2,6 +2,7 @@ #include "mednafen/mempatcher.h" #include "mednafen/git.h" #include "mednafen/general.h" +#include "mednafen/settings.h" #include #include "mednafen/psx/gpu.h" #ifdef NEED_DEINTERLACER diff --git a/mednafen/MemoryStream.cpp b/mednafen/MemoryStream.cpp index baccf537..1175ae13 100644 --- a/mednafen/MemoryStream.cpp +++ b/mednafen/MemoryStream.cpp @@ -2,6 +2,7 @@ #include "MemoryStream.h" #include "error.h" #include +#include "math_ops.h" /* TODO: diff --git a/mednafen/driver.h b/mednafen/driver.h deleted file mode 100644 index dcca7734..00000000 --- a/mednafen/driver.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _MDFN_DRIVERH -#define _MDFN_DRIVERH - -#include "mednafen-types.h" -#include "git.h" -#include "mednafen-driver.h" -#include "mempatcher-driver.h" - -#endif diff --git a/mednafen/general.cpp b/mednafen/general.cpp index c8f5138b..56d42430 100644 --- a/mednafen/general.cpp +++ b/mednafen/general.cpp @@ -19,6 +19,8 @@ #include +#include + #include #include @@ -26,31 +28,11 @@ #include "error.h" #include "mednafen.h" #include "general.h" +#include "settings.h" #include "state.h" using namespace std; -static bool IsAbsolutePath(const char *path) -{ - if ( -#ifdef _WIN32 - path[0] == '\\' || -#endif - path[0] == '/' - ) - return true; - -#if defined(_WIN32) || defined(DOS) - if((path[0] >= 'a' && path[0] <= 'z') || (path[0] >= 'A' && path[0] <= 'Z')) - { - if(path[1] == ':') - return true; - } -#endif - - return(false); -} - bool MDFN_IsFIROPSafe(const std::string &path) { // We could make this more OS-specific, but it shouldn't hurt to try to weed out usage of characters that are path @@ -140,8 +122,8 @@ std::string MDFN_EvalFIP(const std::string &dir_path, const std::string &rel_pat if(!skip_safety_check && !MDFN_IsFIROPSafe(rel_path)) throw MDFN_Error(0, "Referenced path \"%s\" is potentially unsafe. See \"filesys.untrusted_fip_check\" setting.\n", rel_path.c_str()); - if(IsAbsolutePath(rel_path.c_str())) - return(rel_path); + if (path_is_absolute(rel_path.c_str())) + return rel_path; return(dir_path + slash + rel_path); } diff --git a/mednafen/git.h b/mednafen/git.h index acf855f6..0489898d 100644 --- a/mednafen/git.h +++ b/mednafen/git.h @@ -3,7 +3,7 @@ #include -#include "video.h" +#include "video/surface.h" #include "state.h" enum @@ -228,15 +228,6 @@ typedef struct // performance possible. HOWEVER, emulation modules must make sure the value is in a range(with minimum and maximum) that their code can handle // before they try to handle it. double soundmultiplier; - - // True if we want to rewind one frame. Set by the driver code. - bool NeedRewind; - - // Sound reversal during state rewinding is normally done in mednafen.cpp, but - // individual system emulation code can also do it if this is set, and clear it after it's done. - // (Also, the driver code shouldn't touch this variable) - bool NeedSoundReverse; - } EmulateSpecStruct; typedef enum @@ -295,11 +286,6 @@ typedef struct VideoSystems VideoSystem; GameMediumTypes GameType; - //int DiskLogicalCount; // A single double-sided disk would be 2 here. - //const char *DiskNames; // Null-terminated. - - const char *cspecial; /* Special cart expansion: DIP switches, barcode reader, etc. */ - // For absolute coordinates(IDIT_X_AXIS and IDIT_Y_AXIS), usually mapped to a mouse(hence the naming). float mouse_scale_x, mouse_scale_y; float mouse_offs_x, mouse_offs_y; diff --git a/mednafen/mednafen-driver.h b/mednafen/mednafen-driver.h deleted file mode 100644 index 8f21de7b..00000000 --- a/mednafen/mednafen-driver.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __MDFN_MEDNAFEN_DRIVER_H -#define __MDFN_MEDNAFEN_DRIVER_H - -#include - -#include -#include - -void MDFND_DispMessage( - unsigned priority, enum retro_log_level level, - enum retro_message_target target, enum retro_message_type type, - const char *msg); - -#ifdef __cplusplus -extern "C" { -#endif -void MDFN_DispMessage( - unsigned priority, enum retro_log_level level, - enum retro_message_target target, enum retro_message_type type, - const char *format, ...); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mednafen/mednafen.h b/mednafen/mednafen.h index 45784f68..4d860315 100644 --- a/mednafen/mednafen.h +++ b/mednafen/mednafen.h @@ -2,17 +2,12 @@ #define _MEDNAFEN_H #include - #include "mednafen-types.h" -#include #include #include #define _(String) (String) -#include "math_ops.h" -#include "git.h" - #ifdef _WIN32 #define strcasecmp _stricmp #endif @@ -28,10 +23,6 @@ #define GET_FSIZE_PTR(fp) (fp->size) #define GET_FEXTS_PTR(fp) (fp->ext) -extern MDFNGI *MDFNGameInfo; - -#include "settings.h" - void MDFND_DispMessage( unsigned priority, enum retro_log_level level, enum retro_message_target target, enum retro_message_type type, @@ -51,6 +42,4 @@ void MDFN_DispMessage( void MDFN_LoadGameCheats(void *override); void MDFN_FlushGameCheats(int nosave); -#include "mednafen-driver.h" - #endif diff --git a/mednafen/mempatcher.cpp b/mednafen/mempatcher.cpp index 4d651d46..371e4aa9 100644 --- a/mednafen/mempatcher.cpp +++ b/mednafen/mempatcher.cpp @@ -29,6 +29,7 @@ #include "mednafen.h" #include "general.h" +#include "settings.h" #include "mempatcher.h" #include diff --git a/mednafen/psx/cpu.cpp b/mednafen/psx/cpu.cpp index ca2574d4..11fa1527 100644 --- a/mednafen/psx/cpu.cpp +++ b/mednafen/psx/cpu.cpp @@ -26,6 +26,7 @@ #include "../state_helpers.h" #include "../math_ops.h" +#include "../mednafen.h" #include "../mednafen-endian.h" // iCB: PGXP STUFF diff --git a/mednafen/psx/input/dualshock.cpp b/mednafen/psx/input/dualshock.cpp index c9e881ec..421a9bec 100644 --- a/mednafen/psx/input/dualshock.cpp +++ b/mednafen/psx/input/dualshock.cpp @@ -19,6 +19,7 @@ #include "../frontio.h" #include "dualshock.h" +#include "../../mednafen.h" #include "../../mednafen-endian.h" /* diff --git a/mednafen/settings.c b/mednafen/settings.c index 34f4af39..a93f7735 100644 --- a/mednafen/settings.c +++ b/mednafen/settings.c @@ -21,7 +21,7 @@ #include -#include "mednafen-driver.h" +#include "mednafen.h" #include "settings.h" int setting_initial_scanline = 0; diff --git a/mednafen/video.h b/mednafen/video.h deleted file mode 100644 index 2227831a..00000000 --- a/mednafen/video.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __MDFN_VIDEO_H -#define __MDFN_VIDEO_H - -#include - -#include "video/surface.h" - -void MDFND_DispMessage( - unsigned priority, enum retro_log_level level, - enum retro_message_target target, enum retro_message_type type, - const char *msg); - -#ifdef __cplusplus -extern "C" { -#endif -void MDFN_DispMessage( - unsigned priority, enum retro_log_level level, - enum retro_message_target target, enum retro_message_type type, - const char *format, ...); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/mednafen/video/Deinterlacer.cpp b/mednafen/video/Deinterlacer.cpp index fd5eccfa..4649e6ac 100644 --- a/mednafen/video/Deinterlacer.cpp +++ b/mednafen/video/Deinterlacer.cpp @@ -1,8 +1,8 @@ #include "../mednafen.h" -#include "../video.h" #include "../general.h" #include "../state.h" -#include "../driver.h" + +#include "surface.h" extern "C" uint8_t psx_gpu_upscale_shift;