Ticket #8654: xbox_wip.patch
File xbox_wip.patch, 42.4 KB (added by , 16 years ago) |
---|
-
backends/platform/sdl/main.cpp
23 23 * 24 24 */ 25 25 26 #if defined(WIN32) && !defined(__SYMBIAN32__) 26 #if defined(WIN32) && !defined(__SYMBIAN32__) && !defined(_XBOX) 27 27 #include <windows.h> 28 28 // winnt.h defines ARRAYSIZE, but we want our own one... 29 29 #undef ARRAYSIZE … … 39 39 40 40 #if !defined(__MAEMO__) && !defined(_WIN32_WCE) 41 41 42 #if defined (WIN32) 42 #if defined (WIN32) && !defined(_XBOX) 43 43 int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) { 44 44 SDL_SetModuleHandle(GetModuleHandle(NULL)); 45 45 return main(__argc, __argv); … … 95 95 // Create our OSystem instance 96 96 #if defined(__SYMBIAN32__) 97 97 g_system = new OSystem_SDL_Symbian(); 98 #elif defined(_XBOX) 99 g_system = new OSystem_XBOX(); 98 100 #else 99 101 g_system = new OSystem_SDL(); 100 102 #endif -
backends/platform/sdl/sdl.cpp
23 23 * 24 24 */ 25 25 26 #if defined(WIN32) 26 #if defined(WIN32) && !defined(_XBOX) 27 27 #include <windows.h> 28 28 #if defined(ARRAYSIZE) 29 29 // winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h … … 31 31 #endif 32 32 #endif 33 33 34 #if defined(_XBOX) 35 #include "backends/platform/xbox/osys_xbox.h" 36 #endif 37 34 38 #include "backends/platform/sdl/sdl.h" 35 39 #include "common/config-manager.h" 36 40 #include "common/events.h" -
backends/platform/xbox/oskeyboard.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #include "oskeyboard.h" 27 28 #include "graphics/imagedec.h" 29 #include "common/events.h" 30 #include "common/file.h" 31 32 using namespace Graphics; 33 34 const char KEYBOARD_MAPPING_ALPHA[][14] = { {"abcdefghijklm"}, {"nopqrstuvwxyz"} }; 35 const char KEYBOARD_MAPPING_NUMERIC[][6] = { {"12345"}, {"67890"} }; 36 const int KEYBOARD_MAPPING_SPECIAL[][3][2] = { { {1,SDLK_ESCAPE}, {224,SDLK_UP}, {32,SDLK_SPACE} }, 37 { {224,SDLK_LEFT}, {224,SDLK_DOWN}, {224,SDLK_RIGHT} } }; 38 39 40 OSKeyboard::OSKeyboard(OSystem *system) : _x(0), _y(0), _created(false), _visible(false), _surface(NULL) { 41 _system = system; 42 } 43 44 OSKeyboard::~OSKeyboard() { 45 if (_surface) { 46 delete _surface; 47 _surface = NULL; 48 } 49 } 50 51 bool OSKeyboard::checkInside(int16 x, int16 y) { 52 if (!_surface) 53 return false; 54 55 if (x >= _x && x <= _x + _surface->w && y >= _y && y <= _y + _surface->h) 56 return true; 57 else 58 return false; 59 } 60 61 bool OSKeyboard::create(Common::String filename, int16 x, int16 y) { 62 return create(SDL_RWFromFile(filename.c_str(), "rb"), x, y); 63 } 64 65 bool OSKeyboard::create(byte *data, uint32 datasize, int16 x, int16 y) { 66 if (!data || !datasize) 67 return false; 68 69 return create(SDL_RWFromMem(data, datasize), x, y); 70 } 71 72 bool OSKeyboard::create(SDL_RWops *rwops, int16 x, int16 y) { 73 _surface = SDL_LoadBMP_RW(rwops, 1); 74 75 if (!_surface) 76 return false; 77 78 _x = x; 79 _y = y; 80 81 _created = true; 82 83 return true; 84 } 85 86 bool OSKeyboard::draw(SDL_Surface *dest) { 87 SDL_Rect rect = getRect(); 88 89 if (!_visible || !_system || !_surface || !dest) 90 return false; 91 92 SDL_BlitSurface(_surface, 0, dest, &rect); 93 return true; 94 } 95 96 int16 OSKeyboard::getHeight() { 97 if (!_surface) 98 return 0; 99 100 return _surface->h; 101 } 102 103 void OSKeyboard::getPosition(int16* x, int16 *y) { 104 if (x) 105 *x = _x; 106 107 if (y) 108 *y = _y; 109 } 110 111 SDL_Rect OSKeyboard::getRect() { 112 SDL_Rect r = {0}; 113 114 if (_surface) { 115 r.x = _x; 116 r.y = _y; 117 r.w = _surface->w; 118 r.h = _surface->h; 119 } 120 121 return r; 122 } 123 124 int16 OSKeyboard::getWidth() { 125 if (!_surface) 126 return 0; 127 128 return _surface->w; 129 } 130 131 bool OSKeyboard::action(int16 x, int16 y, bool pushed) { 132 if (!_visible || !checkInside(x, y)) 133 return false; 134 135 int keyAscii = 0; 136 int keyCode = 0; 137 138 x -= _x; 139 //y -= _y; 140 141 if (x < 185) { 142 // Alpha selection 143 keyCode = keyAscii = KEYBOARD_MAPPING_ALPHA[y >= _y+20][((x + 10) / 14) - 1]; 144 } else if (x >= 186 && x <= 255) { 145 // Numeric selection 146 keyCode = keyAscii = KEYBOARD_MAPPING_NUMERIC[y >= _y+20][((x - 187 + 10) / 14) - 1]; 147 } else if (x >= 258 && x <= 300) { 148 // Special keys 149 keyAscii = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][0]; 150 keyCode = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][1]; 151 } else if (x >= 302 && x <= 316) { 152 if (y < _y +20) { 153 // Backspace 154 keyAscii = 1; //VK_BACK; 155 keyCode = SDLK_BACKSPACE; //keyAscii; 156 } else { 157 // Enter 158 keyAscii = 13; 159 keyCode = 10; 160 } 161 } 162 163 if (keyAscii != 0) { 164 _key.setAscii(keyAscii); 165 _key.setKeycode(tolower(keyCode)); 166 return simulateKey(&_key, pushed); 167 } 168 169 return false; 170 } 171 172 bool OSKeyboard::isCreated() { 173 return _created; 174 } 175 176 bool OSKeyboard::isVisible() { 177 return _visible; 178 } 179 180 void OSKeyboard::setPosition(int16 x, int16 y) { 181 _x = x; 182 _y = y; 183 } 184 185 void OSKeyboard::setVisible(bool visible) { 186 _visible = visible; 187 } 188 189 bool OSKeyboard::simulateKey(GUI::Key *key, bool pushed) { 190 SDL_Event ev = {0}; 191 192 if (!key->keycode()) 193 key->setKeycode(key->ascii()); 194 195 if (!key->ascii()) 196 key->setAscii(key->keycode()); 197 198 ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); 199 ev.key.keysym.mod = (SDLMod)key->flags(); 200 ev.key.keysym.sym = (SDLKey)key->keycode(); 201 ev.key.keysym.unicode = key->keycode(); 202 ev.key.keysym.mod = KMOD_RESERVED; 203 return (SDL_PushEvent(&ev) == 0); 204 } 205 206 void OSKeyboard::toggleVisible() { 207 _visible = !_visible; 208 } -
backends/platform/xbox/oskeyboard.h
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #ifndef OSKEYBOARD_H 27 #define OSKEYBOARD_H 28 29 #include "backends/platform/sdl/sdl-common.h" 30 #include "graphics/surface.h" 31 32 #include "common/stream.h" 33 #include "gui/key.h" 34 35 class OSKeyboard { 36 public: 37 OSKeyboard(OSystem* system); 38 virtual ~OSKeyboard(); 39 40 virtual bool create(byte *data, uint32 datasize, int16 x, int16 y); 41 virtual bool create(Common::String filename, int16 x, int16 y); 42 virtual bool draw(SDL_Surface *dest); 43 44 virtual int16 getHeight(); 45 virtual int16 getWidth(); 46 virtual void getPosition(int16 *x, int16 *y); 47 48 virtual SDL_Rect getRect(); 49 50 virtual bool action(int16 x, int16 y, bool pushed); 51 52 virtual bool isCreated(); 53 virtual bool isVisible(); 54 55 virtual void setPosition(int16 x, int16 y); 56 virtual void setVisible(bool visible); 57 58 virtual void toggleVisible(); 59 60 protected: 61 int16 _x; 62 int16 _y; 63 64 OSystem *_system; 65 66 bool _created; 67 bool _visible; 68 69 SDL_Surface *_surface; 70 71 GUI::Key _key; 72 73 virtual bool checkInside(int16 x, int16 y); 74 75 virtual bool create(SDL_RWops *rwops, int16 x, int16 y); 76 77 virtual bool simulateKey(GUI::Key *key, bool pushed); 78 }; 79 80 #endif -
backends/platform/xbox/osys_xbox.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #include <xtl.h> 27 #undef FORCEINLINE 28 29 #include "backends/platform/sdl/sdl-common.h" 30 #include "backends/platform/xbox/osys_xbox.h" 31 #include "backends/platform/xbox/xbox_saves.h" 32 #include "common/config-manager.h" 33 #include "common/events.h" 34 35 #include "xbox_utils.h" 36 37 // FIXME move joystick defines out and replace with confile file options 38 // we should really allow users to map any key to a joystick button 39 #define JOY_DEADZONE 3200 40 41 #define JOY_ANALOG 42 43 // #define JOY_INVERT_Y 44 45 #define XB_XAXIS_L 0 46 #define XB_YAXIS_L 1 47 48 #define XB_XAXIS_R 2 49 #define XB_YAXIS_R 3 50 51 #define XB_BUTTON_A 0 52 #define XB_BUTTON_B 1 53 #define XB_BUTTON_X 2 54 #define XB_BUTTON_Y 3 55 #define XB_BUTTON_BLACK 4 56 #define XB_BUTTON_WHITE 5 57 #define XB_BUTTON_LTRIG 6 58 #define XB_BUTTON_RTRIG 7 59 #define XB_BUTTON_START 8 60 #define XB_BUTTON_BACK 9 61 #define XB_BUTTON_LTHUMB 10 62 #define XB_BUTTON_RTHUMB 11 63 64 #define XB_DPAD_CENTERED SDL_HAT_CENTERED 65 #define XB_DPAD_UP SDL_HAT_UP 66 #define XB_DPAD_DOWN SDL_HAT_DOWN 67 #define XB_DPAD_LEFT SDL_HAT_LEFT 68 #define XB_DPAD_RIGHT SDL_HAT_RIGHT 69 70 //uint16 padValues[] = { 71 // 1, // XB_BUTTON_A 72 // 2, // XB_BUTTON_B 73 // 4, // XB_BUTTON_X 74 // 8, // XB_BUTTON_Y 75 // 16, // XB_BUTTON_BLACK 76 // 32, // XB_BUTTON_WHITE 77 // 64, // XB_BUTTON_LTRIG 78 // 128, // XB_BUTTON_RTRIG 79 // 256, // XB_BUTTON_START 80 // 512, // XB_BUTTON_BACK 81 // 1024, // XB_BUTTON_LTHUMB 82 // 2048 // XB_BUTTON_RTHUMB 83 //}; 84 85 void xbox_exit() { 86 XLaunchNewImage(NULL, NULL); 87 } 88 89 static byte SDLModToOSystemKeyFlags(SDLMod mod) { 90 byte b = 0; 91 #ifdef LINUPY 92 // Yopy has no ALT key, steal the SHIFT key 93 // (which isn't used much anyway) 94 if (mod & KMOD_SHIFT) 95 b |= Common::KBD_ALT; 96 #else 97 if (mod & KMOD_SHIFT) 98 b |= Common::KBD_SHIFT; 99 if (mod & KMOD_ALT) 100 b |= Common::KBD_ALT; 101 #endif 102 if (mod & KMOD_CTRL) 103 b |= Common::KBD_CTRL; 104 105 return b; 106 } 107 108 static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { 109 if (key >= SDLK_F1 && key <= SDLK_F9) { 110 return key - SDLK_F1 + 315; 111 } else if (key >= SDLK_KP0 && key <= SDLK_KP9) { 112 return key - SDLK_KP0 + '0'; 113 } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) { 114 return key; 115 } else if (unicode) { 116 return unicode; 117 } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { 118 return key & ~0x20; 119 } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) { 120 return 0; 121 } 122 return key; 123 } 124 125 OSystem_XBOX::OSystem_XBOX() : _keyboard(this), _padValues(0), _oldpadValues(0), _axisRYValue(0), _oldaxisRYValue(0) { 126 XBOXUtils::SetupDrives(); 127 } 128 129 OSystem_XBOX::~OSystem_XBOX() { 130 } 131 132 bool OSystem_XBOX::hasFeature(Feature f) { 133 return (f == kFeatureVirtualKeyboard) || 134 OSystem_SDL::hasFeature(f); 135 } 136 137 void OSystem_XBOX::setFeatureState(Feature f, bool enable) { 138 switch(f) { 139 case kFeatureVirtualKeyboard: 140 _keyboard.setVisible(enable); 141 break; 142 default: 143 OSystem_SDL::setFeatureState(f, enable); 144 break; 145 } 146 } 147 148 bool OSystem_XBOX::getFeatureState(Feature f) { 149 switch(f) { 150 case kFeatureVirtualKeyboard: 151 return _keyboard.isVisible(); 152 break; 153 } 154 return OSystem_SDL::getFeatureState(f); 155 } 156 157 void OSystem_XBOX::createOSKeyboard() { 158 void *pData = NULL; 159 uint32 dataSize = 0; 160 161 dataSize = XBOXUtils::LoadSectionData("IMG_KEYB", &pData); 162 163 if (_keyboard.create((byte*)pData, dataSize, 0, 0)) { 164 int posX = (this->getOverlayWidth() - _keyboard.getWidth()) / 2; 165 int posY = (this->getOverlayHeight() - _keyboard.getHeight()) - 20; 166 167 _keyboard.setPosition(posX, posY); 168 } 169 170 if (pData) { 171 delete [] pData; 172 pData = NULL; 173 } 174 } 175 176 void OSystem_XBOX::drawMouse() { 177 drawKeyboard(); 178 OSystem_SDL::drawMouse(); 179 } 180 181 void OSystem_XBOX::undrawMouse() { 182 undrawKeyboard(); 183 OSystem_SDL::undrawMouse(); 184 } 185 186 void OSystem_XBOX::undrawKeyboard() { 187 if (_keyboardBackup.w != 0 && _keyboardBackup.h != 0) 188 addDirtyRect(_keyboardBackup.x, _keyboardBackup.y, _keyboardBackup.w, _keyboardBackup.h); 189 } 190 191 void OSystem_XBOX::drawKeyboard() { 192 if (!_keyboard.isCreated() || !_keyboard.isVisible()) { 193 _keyboardBackup.x = _keyboardBackup.y = _keyboardBackup.w = _keyboardBackup.h = 0; 194 return; 195 } 196 197 int16 x, y; 198 _keyboard.getPosition(&x, &y); 199 if (x < 0 || y < 0) { 200 int w = _keyboard.getWidth(); 201 int h = _keyboard.getHeight(); 202 203 _keyboard.setPosition( (this->getOverlayWidth() - w) / 2, this->getOverlayHeight() - (h + 20) ); 204 } 205 206 SDL_Rect dst = _keyboard.getRect(); 207 208 _keyboardBackup.x = dst.x; 209 _keyboardBackup.y = dst.y; 210 _keyboardBackup.w = dst.w; 211 _keyboardBackup.h = dst.h; 212 213 _keyboard.draw(_hwscreen); 214 215 addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); 216 } 217 218 void OSystem_XBOX::initBackend() { 219 ConfMan.set("themepath", "media:\\"); 220 ConfMan.set("extrapath", "media:\\"); 221 ConfMan.set("savepath", "saves:\\"); 222 ConfMan.set("joystick_num", "0"); 223 224 if (_savefile == 0) { 225 _savefile = new XboxSaveFileManager(); 226 } 227 228 OSystem_SDL::initBackend(); 229 230 createOSKeyboard(); 231 } 232 233 void OSystem_XBOX::updateScreen() { 234 OSystem_SDL::updateScreen(); 235 } 236 237 bool OSystem_XBOX::pollEvent(Common::Event &event) { 238 SDL_Event ev; 239 int axis; 240 241 memset(&event, 0, sizeof(Common::Event)); 242 243 handleKbdMouse(); 244 245 // If the screen mode changed, send an Common::EVENT_SCREEN_CHANGED 246 if (_modeChanged) { 247 _modeChanged = false; 248 event.type = Common::EVENT_SCREEN_CHANGED; 249 _screenChangeCount++; 250 return true; 251 } 252 253 while (SDL_PollEvent(&ev)) { 254 switch (ev.type) { 255 case SDL_KEYDOWN: 256 event.type = Common::EVENT_KEYDOWN; 257 event.kbd.keycode = ev.key.keysym.sym; 258 event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); 259 260 return true; 261 262 case SDL_KEYUP: 263 event.type = Common::EVENT_KEYUP; 264 event.kbd.keycode = ev.key.keysym.sym; 265 event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); 266 267 return true; 268 269 case SDL_MOUSEMOTION: 270 event.type = Common::EVENT_MOUSEMOVE; 271 fillMouseEvent(event, ev.motion.x, ev.motion.y); 272 273 setMousePos(event.mouse.x, event.mouse.y); 274 return true; 275 276 case SDL_JOYBUTTONDOWN: 277 _padValues |= (1 << ev.jbutton.button); 278 break; 279 280 case SDL_JOYBUTTONUP: 281 _padValues ^= (1 << ev.jbutton.button); 282 break; 283 284 case SDL_JOYAXISMOTION: 285 axis = ev.jaxis.value; 286 if (axis > JOY_DEADZONE) { 287 axis -= JOY_DEADZONE; 288 event.type = Common::EVENT_MOUSEMOVE; 289 } else if (axis < -JOY_DEADZONE ) { 290 axis += JOY_DEADZONE; 291 event.type = Common::EVENT_MOUSEMOVE; 292 } else 293 axis = 0; 294 295 if (ev.jaxis.axis == XB_XAXIS_L) { 296 #ifdef JOY_ANALOG 297 _km.x_vel = axis/2000; 298 _km.x_down_count = 0; 299 #else 300 if (axis != 0) { 301 _km.x_vel = (axis > 0) ? 1:-1; 302 _km.x_down_count = 1; 303 } else { 304 _km.x_vel = 0; 305 _km.x_down_count = 0; 306 } 307 #endif 308 } else if (ev.jaxis.axis == XB_YAXIS_L) { 309 #ifndef JOY_INVERT_Y 310 axis = -axis; 311 #endif 312 #ifdef JOY_ANALOG 313 _km.y_vel = -axis / 2000; 314 _km.y_down_count = 0; 315 #else 316 if (axis != 0) { 317 _km.y_vel = (-axis > 0) ? 1: -1; 318 _km.y_down_count = 1; 319 } else { 320 _km.y_vel = 0; 321 _km.y_down_count = 0; 322 } 323 #endif 324 } 325 326 if (ev.jaxis.axis == XB_YAXIS_R) { 327 _axisRYValue = axis; 328 break; 329 } 330 331 fillMouseEvent(event, _km.x, _km.y); 332 333 return true; 334 335 case SDL_JOYHATMOTION: 336 if (_padValues & (1 << XB_BUTTON_RTRIG)) { 337 if (ev.jhat.value == SDL_HAT_CENTERED) { 338 event.type = Common::EVENT_KEYUP; 339 } 340 else { 341 event.type = Common::EVENT_KEYDOWN; 342 343 if (ev.jhat.value == SDL_HAT_UP) 344 event.kbd.keycode = SDLK_KP8; 345 346 if (ev.jhat.value == SDL_HAT_RIGHTUP) 347 event.kbd.keycode = SDLK_KP9; 348 349 if (ev.jhat.value == SDL_HAT_RIGHT) 350 event.kbd.keycode = SDLK_KP6; 351 352 if (ev.jhat.value == SDL_HAT_RIGHTDOWN) 353 event.kbd.keycode = SDLK_KP3; 354 355 if (ev.jhat.value == SDL_HAT_DOWN) 356 event.kbd.keycode = SDLK_KP2; 357 358 if (ev.jhat.value == SDL_HAT_LEFTDOWN) 359 event.kbd.keycode = SDLK_KP1; 360 361 if (ev.jhat.value == SDL_HAT_LEFT) 362 event.kbd.keycode = SDLK_KP4; 363 364 if (ev.jhat.value == SDL_HAT_LEFTUP) 365 event.kbd.keycode = SDLK_KP7; 366 } 367 368 event.kbd.ascii = mapKey((SDLKey)event.kbd.keycode, KMOD_NONE, 0); 369 event.kbd.flags = SDLModToOSystemKeyFlags(KMOD_NONE); 370 371 return true; 372 } 373 else { 374 if (ev.jhat.value == SDL_HAT_CENTERED) { 375 _km.x_vel = _km.x_down_count = 0; 376 _km.y_vel = _km.y_down_count = 0; 377 } 378 else { 379 if (ev.jhat.value & SDL_HAT_UP) { 380 _km.y_vel = -1; 381 _km.y_down_count = 1; 382 } 383 384 if (ev.jhat.value & SDL_HAT_DOWN) { 385 _km.y_vel = 1; 386 _km.y_down_count = 1; 387 } 388 389 if (ev.jhat.value & SDL_HAT_LEFT) { 390 _km.x_vel = -1; 391 _km.x_down_count = 1; 392 } 393 394 if (ev.jhat.value & SDL_HAT_RIGHT) { 395 _km.x_vel = 1; 396 _km.x_down_count = 1; 397 } 398 399 break; 400 } 401 } 402 403 case SDL_VIDEOEXPOSE: 404 _forceFull = true; 405 break; 406 407 case SDL_QUIT: 408 event.type = Common::EVENT_QUIT; 409 return true; 410 } 411 } 412 413 uint16 buttonsChanged = _padValues ^ _oldpadValues; 414 415 if (buttonsChanged) { 416 if (buttonsChanged & (1 << XB_BUTTON_A)) { 417 if (!_keyboard.action(_km.x, _km.y, (_padValues & (1 << XB_BUTTON_A)))) { 418 event.type = (_padValues & (1 << XB_BUTTON_A)) ? Common::EVENT_LBUTTONDOWN : Common::EVENT_LBUTTONUP; 419 fillMouseEvent(event, _km.x, _km.y); 420 } 421 } 422 else if (buttonsChanged & (1 << XB_BUTTON_B)) { 423 event.type = (_padValues & (1 << XB_BUTTON_B)) ? Common::EVENT_RBUTTONDOWN : Common::EVENT_RBUTTONUP; 424 fillMouseEvent(event, _km.x, _km.y); 425 } 426 else if (buttonsChanged & (1 << XB_BUTTON_LTRIG)) { 427 _keyboard.setVisible((_padValues & (1 << XB_BUTTON_LTRIG)) > 0); 428 } 429 else { 430 SDLMod mod = KMOD_NONE; 431 432 event.type = buttonsChanged & _padValues ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP; 433 event.kbd.flags = 0; 434 435 if (buttonsChanged & (1 << XB_BUTTON_START)) { 436 event.kbd.keycode = SDLK_ESCAPE; 437 } 438 else if (buttonsChanged & (1 << XB_BUTTON_BACK)) { 439 event.kbd.keycode = SDLK_F5; 440 } 441 else if (buttonsChanged & (1 << XB_BUTTON_X)) { 442 event.kbd.keycode = SDLK_PERIOD; 443 } 444 else if (buttonsChanged & (1 << XB_BUTTON_Y)) { 445 event.kbd.keycode = SDLK_SPACE; 446 } 447 else if (buttonsChanged & (1 << XB_BUTTON_BLACK)) { 448 event.kbd.keycode = SDLK_RETURN; 449 } 450 else if (buttonsChanged & (1 << XB_BUTTON_WHITE)) { 451 event.kbd.keycode = SDLK_LSHIFT; 452 if (event.type == Common::EVENT_KEYDOWN) 453 mod = KMOD_LSHIFT; 454 } 455 456 event.kbd.ascii = mapKey((SDLKey)event.kbd.keycode, mod, 0); 457 event.kbd.flags = SDLModToOSystemKeyFlags(mod); 458 } 459 460 _oldpadValues = _padValues; 461 return true; 462 } 463 464 bool axisRYChanged = _axisRYValue != _oldaxisRYValue; 465 if (axisRYChanged) { 466 if (_axisRYValue > 0) 467 event.type = Common::EVENT_WHEELDOWN; 468 else if (_axisRYValue < 0) 469 event.type = Common::EVENT_WHEELUP; 470 471 _oldaxisRYValue = _axisRYValue; 472 return true; 473 } 474 475 return false; 476 } 477 478 void OSystem_XBOX::quit() { 479 OSystem_SDL::quit(); 480 } 481 482 void OSystem_XBOX::showOSKeyboard() { 483 _keyboard.setVisible(true); 484 } 485 486 void OSystem_XBOX::hideOSKeyboard() { 487 _keyboard.setVisible(false); 488 } -
backends/platform/xbox/osys_xbox.h
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #ifndef OSYS_XBOX_H 27 #define OSYS_XBOX_H 28 29 #include "backends/platform/sdl/sdl-common.h" 30 #include "backends/platform/xbox/OSKeyboard.h" 31 32 class OSystem_XBOX : public OSystem_SDL { 33 public: 34 OSystem_XBOX(); 35 virtual ~OSystem_XBOX(); 36 37 virtual void initBackend(); 38 39 virtual void updateScreen(); 40 virtual bool pollEvent(Common::Event &event); 41 42 virtual void quit(); 43 44 virtual bool hasFeature(Feature f); 45 virtual void setFeatureState(Feature f, bool enable); 46 virtual bool getFeatureState(Feature f); 47 48 protected: 49 SDL_Rect _keyboardBackup; 50 51 virtual void drawMouse(); 52 virtual void undrawMouse(); 53 54 virtual void drawKeyboard(); 55 virtual void undrawKeyboard(); 56 57 private: 58 uint16 _padValues; 59 uint16 _oldpadValues; 60 61 int16 _axisRYValue; 62 int16 _oldaxisRYValue; 63 64 OSKeyboard _keyboard; 65 66 virtual void createOSKeyboard(); 67 68 virtual void showOSKeyboard(); 69 virtual void hideOSKeyboard(); 70 }; 71 72 #endif -
backends/platform/xbox/README.XBOX
1 ScummVM 0.10.0SVN XBOX README 2 ============================= 3 4 Running 5 ======= 6 7 Run the executable from an xbox format dvd or from the xbox hard drive. 8 9 Use the ScummVM launcher to add games and run them. 10 11 12 13 Controls 14 ======== 15 16 Left Stick - Mouse movement 17 Right Stick - Mouse wheel movement 18 D-Pad - Fine mouse movement 19 A - Mouse button 1 20 B - Mouse button 2 21 X - '.' (skip dialogue in some games) 22 Y - Space 23 Black - Enter 24 White - Shift 25 Start - Escape 26 Back - F5 27 Left Trigger - Hold to show virtual keyboard. Release to hide 28 Right Trigger - Hold and use D-Pad to emulate numeric keypad 29 30 31 32 Port Author 33 =========== 34 35 Carcharius (carcharius@gmail.com) 36 No newline at end of file -
backends/platform/xbox/xbox_saves.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #include <xtl.h> 27 #undef FORCEINLINE 28 #include <process.h> 29 30 #include "common/stdafx.h" 31 #include "common/savefile.h" 32 #include "common/config-manager.h" 33 #include "backends/platform/xbox/xbox_saves.h" 34 #include "backends/saves/compressed/compressed-saves.h" 35 36 #include "xbox_utils.h" 37 38 class XboxStdioSaveFile : public Common::InSaveFile, public Common::OutSaveFile { 39 private: 40 FILE *fh; 41 bool _saveContainer; 42 Common::String _savePath; 43 44 void finalizeSaveContainer(); 45 46 public: 47 XboxStdioSaveFile(const char *filename, bool saveOrLoad, bool saveContainer = false) { 48 fh = ::fopen(filename, (saveOrLoad? "wb" : "rb")); 49 _saveContainer = saveContainer; 50 _savePath = filename; 51 } 52 ~XboxStdioSaveFile() { 53 if (fh) 54 ::fclose(fh); 55 56 finalize(); 57 58 if (_saveContainer) 59 finalizeSaveContainer(); 60 } 61 62 bool eos() const { return feof(fh) != 0; } 63 bool ioFailed() const { return ferror(fh) != 0; } 64 void clearIOFailed() { clearerr(fh); } 65 66 bool isOpen() const { return fh != 0; } 67 68 uint32 read(void *dataPtr, uint32 dataSize) { 69 assert(fh); 70 return fread(dataPtr, 1, dataSize, fh); 71 } 72 uint32 write(const void *dataPtr, uint32 dataSize) { 73 assert(fh); 74 return fwrite(dataPtr, 1, dataSize, fh); 75 } 76 77 uint32 pos() const { 78 assert(fh); 79 return ftell(fh); 80 } 81 uint32 size() const { 82 assert(fh); 83 uint32 oldPos = ftell(fh); 84 fseek(fh, 0, SEEK_END); 85 uint32 length = ftell(fh); 86 fseek(fh, oldPos, SEEK_SET); 87 return length; 88 } 89 90 void seek(int32 offs, int whence = SEEK_SET) { 91 assert(fh); 92 fseek(fh, offs, whence); 93 } 94 95 void finalize() { 96 OutSaveFile::finalize(); 97 } 98 }; 99 100 void XboxStdioSaveFile::finalizeSaveContainer() { 101 XBOXUtils::CloseSaveContainer("saves"); 102 _saveContainer = false; 103 } 104 105 static void join_paths(const char *filename, const char *directory, 106 char *buf, int bufsize) { 107 buf[bufsize-1] = '\0'; 108 strncpy(buf, directory, bufsize - 1); 109 110 strncat(buf, filename, bufsize - 1); 111 } 112 113 XboxSaveFileManager::XboxSaveFileManager() { 114 } 115 116 Common::OutSaveFile *XboxSaveFileManager::openForSaving(const char *filename) { 117 char buf[256]; 118 join_paths(filename, getSavePath(), buf, sizeof(buf)); 119 120 bool needsCont = needsSaveContainer(buf); 121 if (needsCont) { 122 if (!openSaveContainer(filename, buf, sizeof(buf))) 123 return NULL; 124 } 125 126 XboxStdioSaveFile *sf = new XboxStdioSaveFile(buf, true, needsCont); 127 128 if (!sf->isOpen()) { 129 delete sf; 130 sf = 0; 131 } 132 return wrapOutSaveFile(sf); 133 } 134 135 Common::InSaveFile *XboxSaveFileManager::openForLoading(const char *filename) { 136 char buf[256]; 137 join_paths(filename, getSavePath(), buf, sizeof(buf)); 138 139 if (needsSaveContainer(buf)) { 140 if (!openSaveContainer(filename, buf, sizeof(buf))) 141 return NULL; 142 } 143 144 XboxStdioSaveFile *sf = new XboxStdioSaveFile(buf, false, needsSaveContainer(buf)); 145 146 if (!sf->isOpen()) { 147 delete sf; 148 sf = 0; 149 } 150 return wrapInSaveFile(sf); 151 } 152 153 void XboxSaveFileManager::listSavefiles(const char * /* prefix */, bool *marks, int num) { 154 // TODO: Implement this properly, at least on systems that support 155 // opendir/readdir. 156 // Even better, replace this with a better design... 157 memset(marks, true, num * sizeof(bool)); 158 } 159 160 bool XboxSaveFileManager::openSaveContainer(const char *filename, char *savepath, uint pathlen) 161 { 162 return XBOXUtils::OpenSaveContainer("saves", ConfMan.get("gameid").c_str(), ConfMan.get("description").c_str(), filename, savepath, pathlen); 163 } 164 165 bool XboxSaveFileManager::needsSaveContainer(const char *filename) 166 { 167 // If we're trying to save/load from the "saves:\" or the "u:\" drive 168 // we assume that we need to create/open a save game container 169 if (strnicmp(filename, "saves:\\", 7) == 0 || strnicmp(filename, "u:\\", 3) == 0) 170 return true; 171 172 return false; 173 } -
backends/platform/xbox/xbox_saves.h
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #ifndef XBOX_SAVES_H 27 #define XBOX_SAVES_H 28 29 #include "common/system.h" 30 #include "common/savefile.h" 31 32 33 class XboxSaveFileManager : public Common::SaveFileManager { 34 public: 35 XboxSaveFileManager(); 36 37 virtual Common::OutSaveFile *openForSaving(const char *filename); 38 virtual Common::InSaveFile *openForLoading(const char *filename); 39 virtual void listSavefiles(const char * /* prefix */, bool *marks, int num); 40 41 private: 42 virtual bool openSaveContainer(const char *filename, char *savepath, uint pathlen); 43 virtual bool needsSaveContainer(const char *filename); 44 }; 45 46 #endif -
backends/platform/xbox/xbox_utils.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #include <xtl.h> 27 #include <stdio.h> 28 29 #include "common/stdafx.h" 30 31 #include "xbox_utils.h" 32 #include "xbox/undocumented.h" 33 34 typedef ANSI_STRING OBJECT_STRING; 35 36 #define CREATE_SYMBOLIC_LINK(LinkName, DeviceName) IoCreateSymbolicLink(LinkName, DeviceName); 37 38 namespace XBOXUtils { 39 40 XBOX_DRIVE xbox_drives[] = { 41 {"game:\\", "game:\\"}, 42 {"media:\\", "media:\\"}, 43 {"saves:\\", "saves:\\"}, 44 {"dvd:\\", "dvd:\\"}, 45 {"e:\\", "e:\\"}, 46 {"f:\\", "f:\\"}, 47 {"g:\\", "g:\\"}, 48 {NULL, NULL} 49 }; 50 51 52 HRESULT GetPhysicalPath(char *szDrive, char *szPath) { 53 NTSTATUS st; 54 HANDLE hObject; 55 char szDestinationDrive[17]; 56 57 if (strlen(szDrive) > 12) 58 return E_FAIL; 59 60 sprintf(szDestinationDrive, "\\??\\%s", szDrive); 61 62 OBJECT_STRING DriveName = { 63 strlen(szDestinationDrive), 64 strlen(szDestinationDrive) + 1, 65 szDestinationDrive 66 }; 67 68 OBJECT_ATTRIBUTES DriveObject = { 69 NULL, 70 &DriveName, 71 OBJ_OPENLINK, 72 }; 73 74 st = NtOpenSymbolicLinkObject(&hObject, &DriveObject); 75 if (STATUS_SUCCESS != st) 76 return E_FAIL; 77 78 OBJECT_STRING objName; 79 DWORD dwLength = 0; 80 81 objName.Length = 0; 82 objName.MaximumLength = 1024; 83 objName.Buffer = new CHAR[1024]; 84 85 if (!objName.Buffer) 86 return E_FAIL; 87 88 ZeroMemory(objName.Buffer, sizeof(objName.Buffer)); 89 90 st = NtQuerySymbolicLinkObject(hObject, &objName, &dwLength ); 91 92 if (STATUS_SUCCESS == st) { 93 strncpy(szPath, objName.Buffer, dwLength); 94 szPath[dwLength] = 0; 95 return S_OK; 96 } 97 98 return E_FAIL; 99 } 100 101 102 HRESULT Mount(char* szDrive, char* szDevice) { 103 char *szSourceDevice; 104 char szDestinationDrive[17]; 105 106 if (strlen(szDrive) > 12) 107 return E_FAIL; 108 109 szSourceDevice = szDevice; 110 sprintf(szDestinationDrive, "\\??\\%s", szDrive); 111 112 OBJECT_STRING stPath = { 113 strlen(szSourceDevice), 114 strlen(szSourceDevice) + 1, 115 szSourceDevice 116 }; 117 OBJECT_STRING stDrive = { 118 strlen(szDestinationDrive), 119 strlen(szDestinationDrive) + 1, 120 szDestinationDrive 121 }; 122 123 NTSTATUS st = CREATE_SYMBOLIC_LINK(&stDrive, &stPath); 124 125 if (STATUS_SUCCESS != st) 126 return E_FAIL; 127 128 return S_OK; 129 } 130 131 132 void SetupDrives(void) { 133 char szPath[1024]; 134 135 XSetFileCacheSize(4 * 1024 * 1024); 136 137 if (SUCCEEDED(GetPhysicalPath("D:", szPath))) { 138 Mount("game:", szPath); 139 strcat(szPath, "\\media"); 140 Mount("media:", szPath); 141 } 142 143 if (SUCCEEDED(GetPhysicalPath("T:", szPath))) 144 Mount("scummvm:", szPath); 145 146 Mount("dvd:", "\\Device\\Cdrom0"); 147 Mount("e:", "\\Device\\Harddisk0\\Partition1"); 148 Mount("f:", "\\Device\\Harddisk0\\Partition6"); 149 Mount("g:", "\\Device\\Harddisk0\\Partition7"); 150 } 151 152 153 DWORD LoadSectionData(const char* sectionName, void **buf) { 154 void* pData; 155 DWORD dwSize; 156 157 if (!sectionName) 158 return 0; 159 160 HANDLE hSection = XGetSectionHandle(sectionName); 161 if (hSection == INVALID_HANDLE_VALUE) 162 return 0; 163 164 dwSize = XGetSectionSize(hSection); 165 pData = XLoadSectionByHandle(hSection); 166 if (!pData || dwSize == 0) { 167 CloseHandle(hSection); 168 return 0; 169 } 170 171 if (pData && dwSize) 172 *buf = new byte[dwSize]; 173 174 if (!*buf) 175 return 0; 176 177 memcpy(*buf, pData, dwSize); 178 return dwSize; 179 180 XFreeSectionByHandle(hSection); 181 CloseHandle(hSection); 182 183 return 0; 184 } 185 186 187 bool OpenSaveContainer(const char* container, const char* gameid, const char* description, const char *filename, char *savepath, unsigned int pathlen) { 188 WCHAR gameName[1024]; 189 wsprintfW(gameName, L"%S", description); 190 191 if (ERROR_SUCCESS != XCreateSaveGame("U:\\", gameName, OPEN_ALWAYS, 0, savepath, pathlen)) 192 return false; 193 194 strcat(savepath, filename); 195 196 return true; 197 } 198 199 200 void CloseSaveContainer(const char* container) { 201 } 202 203 } // end namespace XBOXUtils -
backends/platform/xbox/xbox_utils.h
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/iphone/blit_arm.h $ 22 * $Id: blit_arm.h 29718 2007-12-05 08:07:10Z vinterstum $ 23 * 24 */ 25 26 #ifndef XBOX_UTILS_H 27 #define XBOX_UTILS_H 28 29 namespace XBOXUtils { 30 31 typedef struct _XBOX_DRIVE { 32 char* szDriveName; 33 char* szDrivePath; 34 } XBOX_DRIVE; 35 36 extern XBOX_DRIVE xbox_drives[]; 37 38 HRESULT GetPhysicalPath(char *szDrive, char *szPath); 39 HRESULT Mount(char* szDrive, char* szDevice); 40 41 void SetupDrives(void); 42 43 DWORD LoadSectionData(const char* sectionName, void **buf); 44 45 bool OpenSaveContainer(const char* container, const char* gameid, const char* description, const char *filename, har *savepath, unsigned int pathlen); 46 47 void CloseSaveContainer(const char* container); 48 49 } // end namespace XBOXUtils 50 51 #endif -
base/commandLine.cpp
732 732 // environment variable. This is weaker than a --savepath on the 733 733 // command line, but overrides the default savepath, hence it is 734 734 // handled here, just before the command line gets parsed. 735 #if !defined(MACOS_CARBON) && !defined(_WIN32_WCE) && !defined(PALMOS_MODE) && !defined(__GP32__) 735 #if !defined(MACOS_CARBON) && !defined(_WIN32_WCE) && !defined(PALMOS_MODE) && !defined(__GP32__) && !defined(_XBOX) 736 736 if (!settings.contains("savepath")) { 737 737 const char *dir = getenv("SCUMMVM_SAVEPATH"); 738 738 if (dir && *dir && strlen(dir) < MAXPATHLEN) { -
base/plugins.cpp
146 146 #if PLUGIN_ENABLED_STATIC(TOUCHE) 147 147 LINK_PLUGIN(TOUCHE) 148 148 #endif 149 #if PLUGIN_ENABLED_STATIC(TINSEL) 150 LINK_PLUGIN(TINSEL) 151 #endif 149 152 150 153 // Music plugins 151 154 // TODO: Use defines to disable or enable each MIDI driver as a -
common/scummsys.h
227 227 228 228 #define FORCEINLINE __forceinline 229 229 #define NORETURN _declspec(noreturn) 230 #define PLUGIN_EXPORT __declspec(dllexport)231 230 231 #if !defined(_XBOX) 232 #define PLUGIN_EXPORT __declspec(dllexport) 233 #else 234 #define SCUMMVM_USE_LONG_INT 235 236 void xbox_exit(); 237 #define exit(x) xbox_exit() 238 #endif 239 232 240 typedef signed char int8_t; 233 241 typedef signed short int16_t; 234 242 typedef unsigned char uint8_t; -
common/system.cpp
156 156 ((OSystem_PS2*)g_system)->makeConfigPath(configFile); 157 157 #elif defined(__PSP__) 158 158 strcpy(configFile, "ms0:/" DEFAULT_CONFIG_FILE); 159 #elif defined(_XBOX) 160 strcpy(configFile, "scummvm:\\" DEFAULT_CONFIG_FILE); 159 161 #else 160 162 strcpy(configFile, DEFAULT_CONFIG_FILE); 161 163 #endif