Previous 15994 Revisions Next

r2875 Friday 20th June, 2008 at 13:03:49 UTC by R. Belmont
[SDLMESS] Updates to compile with latest. Includes GCC 4.3.x fix also submitted to MAMEdev.
[src/emu/machine]idectrl.c
[src/mess/osd/sdl]sdlmess.c
[src/osd/sdl]drawogl.c drawsdl.c input.c window.c

src/osd/sdl/drawogl.c
r2874r2875
2121#include "osdcomm.h"
2222#include "render.h"
2323#include "options.h"
24#include "driver.h"
2425#include "deprecat.h"
2526
2627// standard SDL headers
src/osd/sdl/input.c
r2874r2875
1919
2020// MAME headers
2121#include "osdepend.h"
22#include "driver.h"
23#include "ui.h"
2224
2325// MAMEOS headers
2426#include "window.h"
src/osd/sdl/drawsdl.c
r2874r2875
1717#include "osdcomm.h"
1818#include "render.h"
1919#include "options.h"
20#include "driver.h"
2021
2122// standard SDL headers
2223#include <SDL/SDL.h>
src/osd/sdl/window.c
r2874r2875
3131#include "osdcomm.h"
3232#include "osdepend.h"
3333#include "options.h"
34#include "driver.h"
3435#include "ui.h"
3536
3637// OSD headers
r2874r2875
10911092
10921093static void set_starting_view(running_machine *machine, int index, sdl_window_info *window, const char *view)
10931094{
1094   int viewindex = -1;
1095   const char *defview = options_get_string(mame_options(), SDLOPTION_VIEW( ));
1096   int viewindex;
10951097
10961098   ASSERT_MAIN_THREAD();
10971099
1098   // NULL is the same as auto
1099   if (view == NULL)
1100      view = SDLOPTVAL_AUTO;
1100   // choose non-auto over auto
1101   if (strcmp(view, "auto") == 0 && strcmp(defview, "auto") != 0)
1102      view = defview;
11011103
1102   // auto view just selects the nth view
1104   // query the video system to help us pick a view
1105   viewindex = video_get_view_for_target(machine, window->target, view, index, video_config.numscreens);
11031106
1104   if (strcmp(view, SDLOPTVAL_AUTO) != 0)
1105   {
1106      // scan for a matching view name
1107      for (viewindex = 0; ; viewindex++)
1108      {
1109         const char *name = render_target_get_view_name(window->target, viewindex);
1110
1111         // stop scanning if we hit NULL
1112         if (name == NULL)
1113         {
1114            viewindex = -1;
1115            break;
1116         }
1117         if (mame_strnicmp(name, view, strlen(view)) == 0)
1118            break;
1119      }
1120   }
1121
1122   // if we don't have a match, default to the nth view
1123   if (viewindex == -1)
1124   {
1125      int scrcount;
1126
1127      // count the number of screens
1128      scrcount = video_screen_count(machine->config);
1129     
1130      // if we have enough screens to be one per monitor, assign in order
1131      if (video_config.numscreens >= scrcount)
1132      {
1133         // find the first view with this screen and this screen only
1134         for (viewindex = 0; ; viewindex++)
1135         {
1136            UINT32 viewscreens = render_target_get_view_screens(window->target, viewindex);
1137            if (viewscreens == (1 << index))
1138               break;
1139            if (viewscreens == 0)
1140            {
1141               viewindex = -1;
1142               break;
1143            }
1144         }
1145      }
1146
1147      // otherwise, find the first view that has all the screens
1148      if (viewindex == -1)
1149      {
1150         for (viewindex = 0; ; viewindex++)
1151         {
1152            UINT32 viewscreens = render_target_get_view_screens(window->target, viewindex);
1153            if (viewscreens == (1 << scrcount) - 1)
1154               break;
1155            if (viewscreens == 0)
1156               break;
1157         }
1158      }
1159   }
1160
1161   // make sure it's a valid view
1162   if (render_target_get_view_name(window->target, viewindex) == NULL)
1163      viewindex = 0;
1164
11651107   // set the view
11661108   render_target_set_view(window->target, viewindex);
11671109   window->start_viewscreen=viewindex;
src/emu/machine/idectrl.c
r2874r2875
418418{
419419   int i;
420420
421   for (i = 0; i < field_size_in_words * 2 && src[i] != 0; i++)
421   assert(strlen(src) <= (field_size_in_words*2));
422
423   for (i = 0; i < strlen(src); i++)
422424      dst[i ^ 1] = src[i];
423425   for ( ; i < field_size_in_words * 2; i++)
424426      dst[i ^ 1] = ' ';
src/mess/osd/sdl/sdlmess.c
r2874r2875
3636{
3737   file_error filerr = FILERR_NONE;
3838
39   if (getcwd(buffer, buffer_len) == 0)
39   if (getcwd(buffer, buffer_len) == NULL)
4040   {
4141      filerr = FILERR_FAILURE;
4242   }
r2874r2875
5151
5252   return filerr;
5353}
54
5455//============================================================
56//   osd_get_full_path
57//============================================================
58
59file_error osd_get_full_path(char **dst, const char *path)
60{
61   file_error err;
62   char path_buffer[512];
63
64   err = FILERR_NONE;
65
66   if (getcwd(path_buffer, 511) == NULL)
67   {
68      printf("osd_get_full_path: failed!\n");
69      err = FILERR_FAILURE;
70   }
71   else
72   {
73      *dst = (char *)malloc(strlen(path_buffer)+strlen(path)+3);
74
75      sprintf(*dst, "%s%s%s", path_buffer, PATH_SEPARATOR, path);
76      printf("osd_get_full_path: cwd [%s] path [%s] out [%s]\n", path_buffer, path, *dst);
77   }
78
79   return err;
80}
81
82//============================================================
5583//   osd_setcurdir
5684//============================================================
5785

Previous 15994 Revisions Next


© 1998-2018 The MESS Team