diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index fb351eeb0..38afdda57 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -120,6 +120,7 @@ extern int hdd_format_type; /* (C) hard disk file format */ #ifdef USE_DISCORD extern int enable_discord; /* (C) enable Discord integration */ #endif +extern int enable_crashdump; /* (C) enable crash dump */ extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out, how to remove that hack from the ET4000/W32p. */ diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 70416d9dd..597ebaa59 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -90,9 +90,7 @@ extern WCHAR wopenfilestring[512]; extern uint8_t filterindex; -#ifdef USE_CRASHDUMP extern void InitCrashDump(void); -#endif extern HICON LoadIconEx(PCTSTR pszIconName); diff --git a/src/pc.c b/src/pc.c index c720e53ac..55c0f8356 100644 --- a/src/pc.c +++ b/src/pc.c @@ -131,6 +131,7 @@ int time_sync = 0; /* (C) enable time sync */ #ifdef USE_DISCORD int enable_discord = 0; /* (C) enable Discord integration */ #endif +int enable_crashdump = 0; /* (C) enable crash dump */ /* Statistics. */ extern int @@ -354,6 +355,7 @@ usage: #ifdef _WIN32 printf("-H or --hwnd id,hwnd - sends back the main dialog's hwnd\n"); #endif + printf("-R or --crashdump - enables crashdump on exception\n"); printf("\nA config file can be specified. If none is, the default file will be used.\n"); return(0); } else if (!wcscasecmp(argv[c], L"--dumpcfg") || @@ -383,6 +385,9 @@ usage: } else if (!wcscasecmp(argv[c], L"--noconfirm") || !wcscasecmp(argv[c], L"-N")) { no_quit_confirm = 1; + } else if (!wcscasecmp(argv[c], L"--crashdump") || + !wcscasecmp(argv[c], L"-R")) { + enable_crashdump = 1; #ifdef _WIN32 } else if (!wcscasecmp(argv[c], L"--hwnd") || !wcscasecmp(argv[c], L"-H")) { diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 08579e4e7..21c8c7ed2 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -44,9 +44,6 @@ ifeq ($(DEV_BUILD), y) ifndef CL5422 CL5422 := y endif - ifndef CRASHDUMP - CRASHDUMP := y - endif ifndef LASERXT LASERXT := y endif @@ -105,9 +102,6 @@ else ifndef CL5422 CL5422 := n endif - ifndef CRASHDUMP - CRASHDUMP := n - endif ifndef LASERXT LASERXT := n endif @@ -421,11 +415,6 @@ ifeq ($(CL5422), y) OPTS += -DUSE_CL5422 endif -ifeq ($(CRASHDUMPOBJ), y) -OPTS += -DUSE_CRASHDUMP -DEVBROBJ += win_crashdump.o -endif - ifeq ($(LASERXT), y) OPTS += -DUSE_LASERXT DEVBROBJ += m_xt_laserxt.o @@ -674,7 +663,7 @@ VIDOBJ := video.o \ PLATOBJ := win.o \ win_dynld.o win_thread.o \ win_cdrom.o win_keyboard.o \ - win_midi.o \ + win_crashdump.o win_midi.o \ win_mouse.o ifeq ($(DINPUT), y) @@ -704,7 +693,7 @@ endif ifneq ($(WX), n) LIBS += $(WX_LIBS) -lm endif -LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++ +LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++ ifneq ($(X64), y) LIBS += -Wl,--large-address-aware endif @@ -754,7 +743,7 @@ else endif -all: $(PROG).exe pcap_if.exe +all: $(PROG).exe 86Box.res: 86Box.rc diff --git a/src/win/Makefile_ndr.mingw b/src/win/Makefile_ndr.mingw index 6b3c572f4..6d05bccf7 100644 --- a/src/win/Makefile_ndr.mingw +++ b/src/win/Makefile_ndr.mingw @@ -44,9 +44,6 @@ ifeq ($(DEV_BUILD), y) ifndef CL5422 CL5422 := y endif - ifndef CRASHDUMP - CRASHDUMP := y - endif ifndef LASERXT LASERXT := y endif @@ -105,9 +102,6 @@ else ifndef CL5422 CL5422 := n endif - ifndef CRASHDUMP - CRASHDUMP := n - endif ifndef LASERXT LASERXT := n endif @@ -430,11 +424,6 @@ ifeq ($(CL5422), y) OPTS += -DUSE_CL5422 endif -ifeq ($(CRASHDUMPOBJ), y) -OPTS += -DUSE_CRASHDUMP -DEVBROBJ += win_crashdump.o -endif - ifeq ($(LASERXT), y) OPTS += -DUSE_LASERXT DEVBROBJ += m_xt_laserxt.o @@ -678,7 +667,7 @@ VIDOBJ := video.o \ PLATOBJ := win.o \ win_dynld.o win_thread.o \ win_cdrom.o win_keyboard.o \ - win_midi.o \ + win_crashdump.o win_midi.o \ win_mouse.o ifeq ($(DINPUT), y) @@ -705,7 +694,7 @@ endif ifneq ($(WX), n) LIBS += $(WX_LIBS) -lm endif -LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++ +LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++ ifneq ($(X64), y) LIBS += -Wl,--large-address-aware endif @@ -755,7 +744,7 @@ else endif -all: $(PROG).exe pcap_if.exe +all: $(PROG).exe 86Box.res: 86Box.rc diff --git a/src/win/win.c b/src/win/win.c index 1aa5a48fa..e79844528 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -354,10 +354,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) /* Set the application version ID string. */ sprintf(emu_version, "%s v%s", EMU_NAME, EMU_VERSION); -#ifdef USE_CRASHDUMP /* Enable crash dump services. */ - InitCrashDump(); -#endif + if (enable_crashdump) + InitCrashDump(); /* First, set our (default) language. */ set_language(0x0409);