No credit, please

- put code not actually required in MAME into "#ifdef MESS"
- Moved global definition of sdl_cwd from sdl_file.c back to sdl_main.c
This commit is contained in:
Couriersud 2010-02-13 19:26:39 +00:00
parent 918bc4c77e
commit 5c2e28e845
6 changed files with 79 additions and 47 deletions

View File

@ -810,6 +810,22 @@ void osd_free_executable(void *ptr, size_t size);
void osd_break_into_debugger(const char *message); void osd_break_into_debugger(const char *message);
/*-----------------------------------------------------------------------------
MESS specific code below
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
osd_get_clipboard_text: retrieves text from the clipboard
Return value:
the returned string needs to be free()-ed!
-----------------------------------------------------------------------------*/
char *osd_get_clipboard_text(void);
#ifdef MESS
/*************************************************************************** /***************************************************************************
DIRECTORY INTERFACES DIRECTORY INTERFACES
***************************************************************************/ ***************************************************************************/
@ -865,16 +881,6 @@ file_error osd_get_full_path(char **dst, const char *path);
UNCATEGORIZED INTERFACES UNCATEGORIZED INTERFACES
***************************************************************************/ ***************************************************************************/
/*-----------------------------------------------------------------------------
osd_get_clipboard_text: retrieves text from the clipboard
Return value:
the returned string needs to be free()-ed!
-----------------------------------------------------------------------------*/
char *osd_get_clipboard_text(void);
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
osd_get_volume_name: retrieves the volume name osd_get_volume_name: retrieves the volume name
@ -888,5 +894,6 @@ char *osd_get_clipboard_text(void);
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
const char *osd_get_volume_name(int idx); const char *osd_get_volume_name(int idx);
#endif
#endif /* __OSDEPEND_H__ */ #endif /* __OSDEPEND_H__ */

View File

@ -27,7 +27,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
// MAME headers // MAME headers
@ -61,14 +60,7 @@ struct _osd_file
//============================================================ //============================================================
// Global variables // Prototypes
//============================================================
char sdl_cwd[512];
//============================================================
// Static variables
//============================================================ //============================================================
static UINT32 create_path_recursive(char *path); static UINT32 create_path_recursive(char *path);

View File

@ -14,6 +14,13 @@
#include <SDL/SDL_version.h> #include <SDL/SDL_version.h>
// standard includes // standard includes
#ifdef MESS
#include <unistd.h>
#endif
#ifdef SDLMAME_OS2
#define INCL_DOS
#include <os2.h>
#endif
// MAME headers // MAME headers
#include "osdepend.h" #include "osdepend.h"
@ -36,29 +43,6 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#endif #endif
#ifdef SDLMAME_OS2
#define INCL_DOS
#include <os2.h>
void MorphToPM()
{
PPIB pib;
PTIB tib;
DosGetInfoBlocks(&tib, &pib);
// Change flag from VIO to PM:
if (pib->pib_ultype==2) pib->pib_ultype = 3;
}
#endif
//============================================================
// LOCAL VARIABLES
//============================================================
#include <unistd.h>
extern char sdl_cwd[512];
//============================================================ //============================================================
// OPTIONS // OPTIONS
//============================================================ //============================================================
@ -75,6 +59,19 @@ extern char sdl_cwd[512];
#endif // MACOSX #endif // MACOSX
#endif // INI_PATH #endif // INI_PATH
//============================================================
// Global variables
//============================================================
#ifdef MESS
char sdl_cwd[512];
#endif
//============================================================
// Local variables
//============================================================
static const options_entry mame_sdl_options[] = static const options_entry mame_sdl_options[] =
{ {
{ SDLOPTION_INIPATH, INI_PATH, 0, "path to ini files" }, { SDLOPTION_INIPATH, INI_PATH, 0, "path to ini files" },
@ -233,6 +230,23 @@ static const options_entry mame_sdl_options[] =
{ NULL } { NULL }
}; };
//============================================================
// OS2 specific
//============================================================
#ifdef SDLMAME_OS2
void MorphToPM()
{
PPIB pib;
PTIB tib;
DosGetInfoBlocks(&tib, &pib);
// Change flag from VIO to PM:
if (pib->pib_ultype==2) pib->pib_ultype = 3;
}
#endif
//============================================================ //============================================================
// main // main
//============================================================ //============================================================
@ -270,8 +284,9 @@ int main(int argc, char *argv[])
#ifdef SDLMAME_OS2 #ifdef SDLMAME_OS2
MorphToPM(); MorphToPM();
#endif #endif
#ifdef MESS
getcwd(sdl_cwd, 511); getcwd(sdl_cwd, 511);
#endif
#if defined(SDLMAME_X11) && (SDL_MAJOR_VERSION == 1) && (SDL_MINOR_VERSION == 2) #if defined(SDLMAME_X11) && (SDL_MAJOR_VERSION == 1) && (SDL_MINOR_VERSION == 2)
if (SDL_Linked_Version()->patch < 10) if (SDL_Linked_Version()->patch < 10)

View File

@ -207,7 +207,6 @@ int osd_setenv(const char *name, const char *value, int overwrite)
return setenv(name, value, overwrite); return setenv(name, value, overwrite);
} }
//============================================================ //============================================================
// osd_get_clipboard_text // osd_get_clipboard_text
//============================================================ //============================================================
@ -307,6 +306,12 @@ char *osd_get_clipboard_text(void)
return result; return result;
} }
//============================================================
// MESS specific code below
//============================================================
#ifdef MESS
//============================================================ //============================================================
// osd_stat // osd_stat
//============================================================ //============================================================
@ -392,3 +397,4 @@ void osd_get_emulator_directory(char *dir, size_t dir_size)
{ {
strncpy(dir, sdl_cwd, dir_size); strncpy(dir, sdl_cwd, dir_size);
} }
#endif

View File

@ -124,7 +124,6 @@ int osd_setenv(const char *name, const char *value, int overwrite)
return setenv(name, value, overwrite); return setenv(name, value, overwrite);
} }
#if defined(SDL_VIDEO_DRIVER_X11) && defined(SDLMAME_X11) #if defined(SDL_VIDEO_DRIVER_X11) && defined(SDLMAME_X11)
//============================================================ //============================================================
@ -227,6 +226,13 @@ char *osd_get_clipboard_text(void)
} }
#endif #endif
//============================================================
// MESS specific code below
// Disabled for MAME until it compiles
//============================================================
#ifdef MESS
//============================================================ //============================================================
// osd_stat // osd_stat
//============================================================ //============================================================
@ -312,3 +318,4 @@ void osd_get_emulator_directory(char *dir, size_t dir_size)
{ {
strncpy(dir, sdl_cwd, dir_size); strncpy(dir, sdl_cwd, dir_size);
} }
#endif

View File

@ -273,6 +273,9 @@ int osd_setenv(const char *name, const char *value, int overwrite)
return result; return result;
} }
//============================================================
// MESS specific code below
//============================================================
//============================================================ //============================================================
// get_clipboard_text_by_format // get_clipboard_text_by_format
@ -314,7 +317,6 @@ static char *get_clipboard_text_by_format(UINT format, char *(*convert)(LPCVOID
} }
//============================================================ //============================================================
// convert_wide // convert_wide
//============================================================ //============================================================
@ -356,6 +358,8 @@ char *osd_get_clipboard_text(void)
return result; return result;
} }
#ifdef MESS
//============================================================ //============================================================
// astring_from_utf8 // astring_from_utf8
//============================================================ //============================================================
@ -582,3 +586,4 @@ void osd_get_emulator_directory(char *dir, size_t dir_size)
if (s) if (s)
s[1] = '\0'; s[1] = '\0';
} }
#endif