Ticket #7947: windbg.diff
File windbg.diff, 11.8 KB (added by , 23 years ago) |
---|
-
scummvm/Makefile.cygwin
diff -u -r -w -N scummvm/scummvm/Makefile.cygwin myscummvm/scummvm/Makefile.cygwin
old new 1 # Makefile CYGWIN 1.3.10 (gcc 2.95.3, sdl, mad) 2 3 CC = gcc 4 CFLAGS = -O2 -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar 5 DEFINES = -DUNIX -DUSE_WINDBG -DDUMP_SCRIPTS -DUSE_COMPRESSED_SOUND -DCOMPRESSED_SOUND_FILE 6 LDFLAGS := 7 INCLUDES:= `sdl-config --cflags` -I./ -I./sound 8 CPPFLAGS= $(DEFINES) $(INCLUDES) 9 EXE = .exe 10 11 # Add -lmad for -DCOMPRESSED_SOUND_FILE 12 LIBS = `sdl-config --libs` -lwinmm -lmad -mconsole 13 ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip 14 15 INCS = scumm.h scummsys.h stdafx.h 16 17 OBJS = actor.o boxes.o costume.o gfx.o object.o resource.o \ 18 saveload.o script.o scummvm.o sound.o string.o \ 19 sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \ 20 sound/imuse.o sound/fmopl.o sound/mixer.o debugrl.o \ 21 akos.o vars.o insane.o gameDetector.o init.o \ 22 v3/resource_v3.o v4/resource_v4.o 2xsai.o main.o \ 23 simon/midi.o simon/simon.o simon/simonsys.o sound/mididrv.o 24 25 DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \ 26 windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \ 27 scummvm.dsp scummvm.dsw sound/fmopl.h gui.h sound.h 28 29 .cpp.o: 30 $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o 31 32 all: scummvm install 33 34 install: scummvm 35 cp scummvm$(EXE) /usr/bin 36 37 scummvm: $(OBJS) 38 $(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) 39 40 clean: 41 rm -f $(OBJS) scummvm$(EXE) 42 rm -f -r *.bak *.stackdump *.rej *.orig 43 rm -f dumps/* 44 45 dist: 46 rm -f $(ZIPFILE) 47 zip -q $(ZIPFILE) $(DISTFILES) 48 49 check: 50 $(OBJS): $(INCS) -
scummvm/gameDetector.cpp
diff -u -r -w -N scummvm/scummvm/gameDetector.cpp myscummvm/scummvm/gameDetector.cpp
old new 32 32 static const char USAGE_STRING[] = 33 33 "ScummVM - Scumm Interpreter\n" 34 34 "Syntax:\n" 35 "\tscummvm [-v] [-d ] [-n] [-b<num>] [-t<num>] [-s<num>] [-p<path>] [-m<num>] [-f] game\n"35 "\tscummvm [-v] [-d[<num>]] [-n] [-b<num>] [-t<num>] [-s<num>] [-p<path>] [-m<num>] [-f] game\n" 36 36 "Flags:\n" 37 37 "\tv - show version info and exit\n" 38 38 "\tc<num> - use cdrom <num> for cd audio\n" 39 "\td - enable debug output\n"39 "\td[<num>]- enable debug output (level <num>)\n" 40 40 "\tn - no subtitles for speech\n" 41 41 "\tb<num> - start in room <num>\n" 42 42 "\tt<num> - set music tempo. Suggested: 1F0000\n" … … 83 83 break; 84 84 case 'd': 85 85 _debugMode = true; 86 break; 86 if (*(s+1) != '\0') 87 _debugLevel = atoi(s+1); 88 debug(1,"Debugmode (level %d) on",_debugLevel); 89 goto NextArg; 87 90 case 'n': 88 91 _noSubtitles = true; 89 92 break; -
scummvm/readme.txt
diff -u -r -w -N scummvm/scummvm/readme.txt myscummvm/scummvm/readme.txt
old new 130 130 .SOU files, you will need to install the MAD library and define 131 131 COMPRESSED_SOUND_FILE. Tools for compressing .SOU files to .SO3 files can be 132 132 found in the 'tools' CVS module, or in the 'scummvm-tools' package. 133 On Win9x/NT/XP you can define WIN_DBG and attach WinDbg to browse the debug 134 messages (see www.sysinternals.com/ntw2k/freeware/debugview.shtml). 133 135 134 136 GCC: 135 137 * Type make (or gmake if that's what GNU make is called on your … … 196 198 -t<num> - Set music tempo. Default is '2031616' 197 199 -e<mode> - Select sound engine. See below. 198 200 -g<mode> - Select graphics scaler. See below. 201 -d[<num>] - Set debug verbosity to <num> 199 202 -f - Full-screen mode. 200 203 -n - Disable subtitles. Use with games that have voice. 201 204 -r - Enable Roland conversion. Try if music sounds incorrect. -
scummvm/resource.cpp
diff -u -r -w -N scummvm/scummvm/resource.cpp myscummvm/scummvm/resource.cpp
old new 357 357 int num; 358 358 int i; 359 359 360 debug(9, "readResTypeList(% d,%x,%s)", id, FROM_LE_32(tag), name);360 debug(9, "readResTypeList(%s,%x,%s)", resTypeFromId(id), FROM_LE_32(tag), name); 361 361 362 362 num = fileReadWordLE(); 363 363 … … 388 388 #endif 389 389 } 390 390 391 char *Scumm::resTypeFromId(int id) { 392 static char buf[100]; 393 394 switch(id) { 395 case rtRoom: sprintf(buf, "Room"); break; 396 case rtScript: sprintf(buf, "Script"); break; 397 case rtCostume: sprintf(buf, "Costume"); break; 398 case rtSound: sprintf(buf, "Sound"); break; 399 case rtInventory: sprintf(buf, "Inventory"); break; 400 case rtCharset: sprintf(buf, "Charset"); break; 401 case rtString: sprintf(buf, "String"); break; 402 case rtVerb: sprintf(buf, "Verb"); break; 403 case rtActorName: sprintf(buf, "ActorName"); break; 404 case rtBuffer: sprintf(buf, "Buffer"); break; 405 case rtScaleTable:sprintf(buf, "ScaleTable"); break; 406 case rtTemp: sprintf(buf, "Temp"); break; 407 case rtFlObject: sprintf(buf, "FlObject"); break; 408 case rtMatrix: sprintf(buf, "Matrix"); break; 409 case rtBox: sprintf(buf, "Box"); break; 410 case rtLast: sprintf(buf, "Last"); break; 411 case rtNumTypes: sprintf(buf, "NumTypes"); break; 412 default: sprintf(buf,"%d", id); 413 } 414 return buf; 415 } 391 416 392 417 void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, 393 418 int mode) 394 419 { 395 debug(9, "allocResTypeData(%d,%x,%d,%s,%d)", id, FROM_LE_32(tag), num, name, 396 mode); 420 debug(9, "allocResTypeData(%s/%s,%x,%d,%d)", resTypeFromId(id), name, FROM_LE_32(tag), num, mode); 397 421 assert(id >= 0 && id < (int)(sizeof(res.mode) / sizeof(res.mode[0]))); 398 422 399 423 if (num >= 2000) { … … 444 468 { 445 469 void *addr; 446 470 447 debug(9, "ensureResourceLoaded(% d,%d)", type, i);471 debug(9, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); 448 472 449 473 if (type == rtRoom && i > 127) { 450 474 i = _resourceMapper[i & 127]; … … 470 494 uint32 fileOffs; 471 495 uint32 size, tag; 472 496 473 // debug(1, "loadResource(% d,%d)", type,idx);497 // debug(1, "loadResource(%s,%d)", resTypeFromId(type),idx); 474 498 475 499 if (type == rtCharset && (_features & GF_SMALL_HEADER)) { 476 500 loadCharset(idx); … … 545 569 int pri, best_pri; 546 570 uint32 best_size = 0, best_offs = 0; 547 571 548 debug(9, "readSoundResource(% d,%d)", type, idx);572 debug(9, "readSoundResource(%s,%d)", resTypeFromId(type), idx); 549 573 550 574 pos = 0; 551 575 … … 622 646 { 623 647 byte *ptr; 624 648 625 debug(9, "getResourceAddress(%d,%d)", type, idx);626 627 649 CHECK_HEAP validateResource("getResourceAddress", type, idx); 628 if (!res.address[type]) 650 if (!res.address[type]) { 651 debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); 629 652 return NULL; 653 } 630 654 631 655 if (res.mode[type] && !res.address[type][idx]) { 632 656 ensureResourceLoaded(type, idx); 633 657 } 634 658 635 659 636 if (!(ptr = (byte *)res.address[type][idx])) 660 if (!(ptr = (byte *)res.address[type][idx])) { 661 debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); 637 662 return NULL; 663 } 638 664 639 665 setResourceCounter(type, idx, 1); 640 666 667 debug(9, "getResourceAddress(%s,%d) == %ld", resTypeFromId(type), idx, ptr + sizeof(MemBlkHeader)); 641 668 return ptr + sizeof(MemBlkHeader); 642 669 } 643 670 … … 665 692 { 666 693 byte *ptr; 667 694 668 CHECK_HEAP debug(9, "createResource(% d,%d,%d)", type, idx, size);695 CHECK_HEAP debug(9, "createResource(%s,%d,%d)", resTypeFromId(type), idx, size); 669 696 670 697 if (size > 65536 * 4 + 37856) 671 698 warning("Probably invalid size allocating %d", size); … … 691 718 void Scumm::validateResource(const char *str, int type, int idx) 692 719 { 693 720 if (type < rtFirst || type > rtLast || (uint) idx >= (uint) res.num[type]) { 694 warning("%s Illegal Glob type % d num %d", str, type, idx);721 warning("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); 695 722 } 696 723 } 697 724 … … 699 726 { 700 727 byte *ptr; 701 728 702 debug(9, "nukeResource(% d,%d)", type, idx);729 debug(9, "nukeResource(%s,%d)", resTypeFromId(type), idx); 703 730 704 731 CHECK_HEAP if (!res.address[type]) 705 732 return; -
scummvm/script.cpp
diff -u -r -w -N scummvm/scummvm/script.cpp myscummvm/scummvm/script.cpp
old new 357 357 _vars[var] = value; 358 358 359 359 if ((_varwatch == (int)var) || (_varwatch == 0)) 360 printf("vars[%d] = %d (via script %d)\n", var, value,360 debug(0, "vars[%d] = %d (via script %d)", var, value, 361 361 vm.slot[_currentScript].number); 362 362 return; 363 363 } -
scummvm/scumm.h
diff -u -r -w -N scummvm/scummvm/scumm.h myscummvm/scummvm/scumm.h
old new 808 808 bool openResourceFile(const char *filename); 809 809 void loadPtrToResource(int type, int i, byte *ptr); 810 810 void readResTypeList(int id, uint32 tag, const char *name); 811 char *resTypeFromId(int id); 811 812 void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); 812 813 byte *createResource(int type, int index, uint32 size); 813 814 void nukeResource(int type, int i); … … 1826 1827 1827 1828 extern const uint32 IMxx_tags[]; 1828 1829 extern const byte default_scale_table[768]; 1830 extern uint16 _debugLevel; 1829 1831 1830 1832 void outputdisplay2(Scumm *s, int disp); 1831 1833 extern const byte revBitMask[8]; -
scummvm/scummsys.h
diff -u -r -w -N scummvm/scummvm/scummsys.h myscummvm/scummvm/scummsys.h
old new 65 65 #define FORCEINLINE inline 66 66 #define NORETURN __attribute__((__noreturn__)) 67 67 #define GCC_PACK __attribute__((packed)) 68 #define CDECL 68 /* #define CDECL */ 69 #define _HEAPOK 0 69 70 70 71 typedef unsigned char byte; 71 72 typedef unsigned char uint8; -
scummvm/scummvm.cpp
diff -u -r -w -N scummvm/scummvm/scummvm.cpp myscummvm/scummvm/scummvm.cpp
old new 1057 1057 void NORETURN CDECL error(const char *s, ...) 1058 1058 { 1059 1059 char buf[1024]; 1060 #if defined( USE_WINDBG ) 1061 char buf2[1024]; 1062 #endif 1060 1063 va_list va; 1061 1064 1062 1065 va_start(va, s); … … 1069 1072 g_scumm->_roomResource, 1070 1073 ss->number, 1071 1074 g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, buf); 1075 #if defined( USE_WINDBG ) 1076 sprintf(buf2, "Error(%d:%d:0x%X): %s!\n", 1077 g_scumm->_roomResource, 1078 ss->number, 1079 g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, 1080 buf); 1081 OutputDebugString(buf2); 1082 #endif 1072 1083 } else { 1073 1084 fprintf(stderr, "Error: %s!\n", buf); 1085 #if defined( USE_WINDBG ) 1086 sprintf(&buf[strlen(buf)], "\n"); 1087 OutputDebugString(buf); 1088 #endif 1074 1089 } 1075 1090 // Doesn't wait for any keypress!! Is it intended to? 1076 1091 exit(1); … … 1086 1101 va_end(va); 1087 1102 1088 1103 fprintf(stderr, "WARNING: %s!\n", buf); 1104 #if defined( USE_WINDBG ) 1105 sprintf(&buf[strlen(buf)], "\n"); 1106 OutputDebugString(buf); 1107 #endif 1089 1108 } 1090 1109 1110 uint16 _debugLevel = 1; 1111 1091 1112 void CDECL debug(int level, const char *s, ...) 1092 1113 { 1093 1114 char buf[1024]; 1094 1115 va_list va; 1095 1116 1096 if (level > 5)1117 if (level > _debugLevel) 1097 1118 return; 1098 1119 1099 1120 va_start(va, s); 1100 1121 vsprintf(buf, s, va); 1101 1122 va_end(va); 1102 1123 printf("%s\n", buf); 1124 #if defined( USE_WINDBG ) 1125 sprintf(&buf[strlen(buf)], "\n"); 1126 OutputDebugString(buf); 1127 #endif 1103 1128 fflush(stdout); 1104 1129 } 1105 1130 -
scummvm/simon/simon.h
diff -u -r -w -N scummvm/scummvm/simon/simon.h myscummvm/scummvm/simon/simon.h
old new 220 220 }; 221 221 222 222 /* dummy typedefs to make it compile in *nix */ 223 #if !defined(__CYGWIN__) 223 224 #if defined(UNIX) || defined(UNIX_X11) || defined(__MORPHOS__) || defined(__DC__) 224 225 typedef void* HMIDISTRM; 225 226 typedef void* HMIDIOUT; … … 238 239 239 240 int GetAsyncKeyState(int key); 240 241 242 #endif 241 243 #endif 242 244 243 245 class MidiDriver;