Ticket #8574: scummvmds_090_branch.patch
File scummvmds_090_branch.patch, 12.5 KB (added by , 18 years ago) |
---|
-
C:/ndsdev/branch090/common/scummsys.h
355 355 typedef unsigned long uint32_t; 356 356 #endif 357 357 358 #elif defined (__DS__) //NeilM 359 360 #define scumm_stricmp stricmp 361 #define scumm_strnicmp strnicmp 362 363 #define SCUMM_NEED_ALIGNMENT 364 #define SCUMM_LITTLE_ENDIAN 365 366 #include "nds/jtypes.h" 367 #include <stdarg.h> 368 #include <ctype.h> 369 #include <string.h> 370 #include <math.h> 371 #include <time.h> 372 373 #define STRINGBUFLEN 256 374 358 375 #else 359 376 360 377 #error No system type defined -
C:/ndsdev/branch090/common/system.h
440 440 */ 441 441 virtual void setShakePos(int shakeOffset) = 0; 442 442 443 /** 444 * Sets the area of the screen that has the focus. For example, when a character 445 * is speaking, they will have the focus. Allows for pan-and-scan style views 446 * where the backend could follow the speaking character or area of interest on 447 * the screen. 448 * 449 * The backend is responsible for clipping the rectangle and deciding how best to 450 * zoom the screen to show any shape and size rectangle the engine provides. 451 * 452 * @param rect A rectangle on the screen to be focused on 453 * @see clearFocusRectangle 454 */ 455 virtual void setFocusRectangle(const Common::Rect& rect) {} 456 457 /** 458 * Clears the focus set by a call to setFocusRectangle(). This allows the engine 459 * to clear the focus during times when no particular area of the screen has the 460 * focus. 461 * @see setFocusRectangle 462 */ 463 virtual void clearFocusRectangle() {} 464 465 443 466 //@} 444 467 445 468 -
C:/ndsdev/branch090/engines/queen/display.cpp
851 851 } 852 852 } 853 853 854 void Display::setFocusRect(const Common::Rect& rect) { 855 _system->setFocusRectangle(rect); 856 } 857 854 858 int Display::textCenterX(const char *text) const { 855 859 return (GAME_SCREEN_WIDTH - textWidth(text)) / 2; 856 860 } -
C:/ndsdev/branch090/engines/queen/display.h
149 149 //! change the text color for the specified texts list entry 150 150 void textColor(uint16 y, uint8 color) { _texts[y].color = color; } 151 151 152 //! Set the focus rectangle to the speaking character 153 void setFocusRect(const Common::Rect& rect); 154 152 155 int textCenterX(const char *text) const; 153 156 uint16 textWidth(const char *text) const; 154 157 uint16 textWidth(const char *text, uint16 len) const; -
C:/ndsdev/branch090/engines/queen/talk.cpp
865 865 textY = bob->y; 866 866 } 867 867 868 // Set the focus rectangle 869 // FIXME: This may not be correct! 870 BobFrame *pbf = _vm->bankMan()->fetchFrame(bob->frameNum); 871 872 int height = (pbf->height * bob->scale) / 100; 873 874 Common::Rect focus(textX - 96, textY - height - 64, textX + 96, textY + height + 64); 875 _vm->display()->setFocusRect(focus); 876 868 877 //int SF = _vm->grid()->findScale(textX, textY); 869 878 870 879 const SpeechParameters *parameters = NULL; -
C:/ndsdev/branch090/engines/scumm/actor.cpp
22 22 */ 23 23 24 24 #include "common/stdafx.h" 25 #include "common/system.h" // for setFocusRectangle/clearFocusRectangle 25 26 #include "scumm/scumm.h" 26 27 #include "scumm/actor.h" 27 28 #include "scumm/akos.h" … … 845 846 } 846 847 847 848 void ScummEngine::setTalkingActor(int value) { 849 850 if (value == 255) { 851 _system->clearFocusRectangle(); 852 } else { 853 // Work out the screen co-ordinates of the actor 854 int x = _actors[value]._pos.x - (camera._cur.x - (_screenWidth >> 1)); 855 int y = _actors[value]._top - (camera._cur.y - (_screenHeight >> 1)); 856 857 // Set the focus area to the calculated position 858 // TODO: Make the size adjust depending on what it's focusing on. 859 Common::Rect rect(x - 96, y - 64, x + 96, y + 64); 860 _system->setFocusRectangle(rect); 861 } 862 848 863 if (_game.id == GID_MANIAC && _game.version <= 1 && !(_game.platform == Common::kPlatformNES)) 849 864 _V1TalkingActor = value; 850 865 else -
C:/ndsdev/branch090/engines/scumm/dialogs.cpp
43 43 #include "sound/mididrv.h" 44 44 #include "sound/mixer.h" 45 45 46 #ifdef __DS__ 47 #include "scummhelp.h" 48 #endif 49 46 50 #ifndef DISABLE_HELP 47 51 #include "scumm/help.h" 48 52 #endif … … 710 714 711 715 String titleStr, *keyStr, *dscStr; 712 716 717 #ifndef __DS__ 713 718 ScummHelp::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr); 719 #else 720 // DS version has a different help screen 721 DS::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr); 722 #endif 714 723 715 724 _title->setLabel(titleStr); 716 725 for (int i = 0; i < HELP_NUM_LINES; i++) { -
C:/ndsdev/branch090/engines/scumm/gfx.cpp
32 32 #include "scumm/resource.h" 33 33 #include "scumm/usage_bits.h" 34 34 #include "scumm/he/wiz_he.h" 35 #ifdef __DS__ 36 #include "blitters.h" 37 #endif 35 38 36 39 namespace Scumm { 37 40 … … 543 546 if (_game.version < 7) { 544 547 // Handle the text mask in older games; newer (V7/V8) games do not use it anymore. 545 548 const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch; 546 549 550 #ifdef __DS__ 551 DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _charset->_textSurface.pitch); 552 #else 553 547 554 // Compose the text over the game graphics 548 555 for (int h = 0; h < height; ++h) { 549 556 for (int w = 0; w < width; ++w) { … … 556 563 dst += _screenWidth; 557 564 text += _charset->_textSurface.pitch; 558 565 } 566 #endif 567 559 568 } else { 560 569 // Just do a simple blit in V7/V8 games. 561 570 blit(dst, _screenWidth, src, vs->pitch, width, height); … … 973 982 } 974 983 975 984 static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) { 976 do { 985 #ifndef __DS__ 986 do { 977 987 #if defined(SCUMM_NEED_ALIGNMENT) 978 988 memcpy(dst, src, 8); 979 989 #else … … 983 993 dst += dstPitch; 984 994 src += dstPitch; 985 995 } while (--height); 996 #else 997 DS::asmCopy8Col(dst, dstPitch, src, height); 998 #endif 986 999 } 987 1000 988 1001 static void clear8Col(byte *dst, int dstPitch, int height) { -
C:/ndsdev/branch090/engines/scumm/thumbnail.cpp
104 104 void ScummEngine::saveThumbnail(Common::OutSaveFile *file) { 105 105 Graphics::Surface thumb; 106 106 107 #if ndef PALMOS_68K107 #if !defined(PALMOS_68K) && !defined(__DS__) 108 108 if (!createThumbnailFromScreen(&thumb)) 109 109 #endif 110 110 thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16)); -
C:/ndsdev/branch090/engines/simon/simon.cpp
491 491 _textIndexBase = 1500 / 4; 492 492 _numTextBoxes = 20; 493 493 _numVideoOpcodes = 75; 494 #ifndef PALMOS_68K 494 #if defined(PALMOS_68K) 495 _vgaMemSize = gVars->memory[kMemSimon2Games]; 496 #elif defined(__DS__) 497 _vgaMemSize = 1450000; 498 #else 495 499 _vgaMemSize = 2000000; 496 #else497 _vgaMemSize = gVars->memory[kMemSimon2Games];498 500 #endif 499 501 _tableMemSize = 100000; 500 502 // Check whether to use MT-32 MIDI tracks in Simon the Sorcerer 2 -
C:/ndsdev/branch090/engines/sky/logic.cpp
2511 2511 bool speechFileFound = false; 2512 2512 if (SkyEngine::isCDVersion()) 2513 2513 speechFileFound = _skySound->startSpeech((uint16)textNum); 2514 2515 // Calculate the point where the character is 2516 int x = (((uint32) (target->xcood)) * GAME_SCREEN_WIDTH) >> 9; 2517 int y = ((((uint32) (target->ycood)) * GAME_SCREEN_HEIGHT) >> 9); 2514 2518 2519 // Set the focus region to that area 2520 // TODO: Make the box size change based on the object that has the focus 2521 Common::Rect rect(x - 96, y - 64, x + 96, y + 64); 2522 _skyScreen->setFocusRectangle(rect); 2523 2515 2524 if ((SkyEngine::_systemVars.systemFlags & SF_ALLOW_TEXT) || !speechFileFound) { 2516 2525 // form the text sprite, if player wants subtitles or 2517 2526 // if we couldn't find the speech file -
C:/ndsdev/branch090/engines/sky/screen.cpp
105 105 _system->updateScreen(); 106 106 } 107 107 108 void Screen::setFocusRectangle(const Common::Rect& rect) { 109 _system->setFocusRectangle(rect); 110 } 111 108 112 //set a new palette, pal is a pointer to dos vga rgb components 0..63 109 113 void Screen::setPalette(uint8 *pal) { 110 114 -
C:/ndsdev/branch090/engines/sky/screen.h
88 88 89 89 void paintBox(uint16 x, uint16 y); 90 90 void showGrid(uint8 *gridBuf); 91 void setFocusRectangle(const Common::Rect& rect); 91 92 92 93 private: 93 94 OSystem *_system; -
C:/ndsdev/branch090/gui/options.cpp
35 35 #include "sound/mididrv.h" 36 36 #include "sound/mixer.h" 37 37 38 #if (!( defined(PALMOS_MODE) || defined(__DC__) || defined(__GP32__) || defined(__amigaos4__) ) && !defined(_MSC_VER))38 #if (!( defined(PALMOS_MODE) || defined(__DC__) || defined(__GP32__) || defined(__amigaos4__) || defined(__DS__) ) && !defined(_MSC_VER)) 39 39 #include <sys/param.h> 40 40 #include <unistd.h> 41 41 #endif -
C:/ndsdev/branch090/sound/fmopl.cpp
35 35 36 36 #include "common/util.h" 37 37 38 #if defined (_WIN32_WCE) || defined (__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined (__MAEMO__) 38 #if defined (_WIN32_WCE) || defined (__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined (__MAEMO__) || defined(__DS__) 39 39 #include "common/config-manager.h" 40 40 #endif 41 41 … … 637 637 /* allocate dynamic tables */ 638 638 if((TL_TABLE = (int *)malloc(TL_MAX * 2 * sizeof(int))) == NULL) 639 639 return 0; 640 #ifdef __DS__ 641 // On the DS, use fast RAM for the sine table, since it thrashes the cache otherwise 642 // Unfotunately, this doesn't stop OPL emulation from taking up far too much CPU time, but it helps a fair bit. 643 SIN_TABLE = ((int **) (0x37F8000)); 644 #else 640 645 if((SIN_TABLE = (int **)malloc(SIN_ENT * 4 * sizeof(int *))) == NULL) { 641 646 free(TL_TABLE); 642 647 return 0; 643 648 } 649 #endif 644 650 if((AMS_TABLE = (int *)malloc(AMS_ENT * 2 * sizeof(int))) == NULL) { 645 651 free(TL_TABLE); 646 652 free(SIN_TABLE); … … 1172 1178 // We need to emulate one YM3812 chip 1173 1179 int env_bits = FMOPL_ENV_BITS_HQ; 1174 1180 int eg_ent = FMOPL_EG_ENT_HQ; 1175 #if defined (_WIN32_WCE) || defined(__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined(__MAEMO__) 1181 #if defined (_WIN32_WCE) || defined(__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined(__MAEMO__) || defined(__DS__) 1176 1182 if (ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) { 1177 1183 env_bits = FMOPL_ENV_BITS_HQ; 1178 1184 eg_ent = FMOPL_EG_ENT_HQ;