diff --git a/Gens/gens.vcxproj.user b/Gens/gens.vcxproj.user
index 0eefd34..f8afa5d 100644
--- a/Gens/gens.vcxproj.user
+++ b/Gens/gens.vcxproj.user
@@ -6,4 +6,9 @@
WindowsLocalDebugger
+
+ -nodebug 1
+ $(OutDir)
+ WindowsLocalDebugger
+
\ No newline at end of file
diff --git a/Gens/include/g_main.h b/Gens/include/g_main.h
index d17e5f3..0b8d44d 100644
--- a/Gens/include/g_main.h
+++ b/Gens/include/g_main.h
@@ -87,6 +87,8 @@ extern "C" {
extern char Gens_Path[1024];
extern POINT Window_Pos;
+ extern int no_debug; // -nodebug cmdline flag
+
#define MAX_RECENT_SCRIPTS 15
extern char Recent_Scripts[MAX_RECENT_SCRIPTS][1024];
diff --git a/Gens/src/g_main.cpp b/Gens/src/g_main.cpp
index 21f4bd0..dde7593 100644
--- a/Gens/src/g_main.cpp
+++ b/Gens/src/g_main.cpp
@@ -147,6 +147,7 @@ HWND RamCheatHWnd = NULL; // modeless dialog
std::vector LuaScriptHWnds; // modeless dialogs
HWND VolControlHWnd = NULL;
+int no_debug = 0;
char Str_Tmp[1024];
char Comment[256];
char Gens_Path[1024];
@@ -2654,7 +2655,9 @@ int GensLoadRom(const char* filename)
ReopenRamWindows();
- init_dbg_server();
+ if (!no_debug) {
+ init_dbg_server();
+ }
return loaded; // positive = success
}
diff --git a/Gens/src/parsecmdline.cpp b/Gens/src/parsecmdline.cpp
index 5826698..7131287 100644
--- a/Gens/src/parsecmdline.cpp
+++ b/Gens/src/parsecmdline.cpp
@@ -21,179 +21,182 @@ extern int Paused;
void ParseCmdLine(LPSTR lpCmdLine, HWND HWnd)
{
- std::string argumentList; //Complete command line argument
- argumentList.assign(lpCmdLine); //Assign command line to argumentList
- int argLength = argumentList.size(); //Size of command line argument
-
- //List of valid commandline args
- std::string argCmds[] = { "-cfg", "-rom", "-play", "-readwrite", "-loadstate", "-pause", "-lua", "" }; //Hint: to add new commandlines, start by inserting them here.
-
- //Strings that will get parsed:
- std::string CfgToLoad = ""; //Cfg filename
- std::string RomToLoad = ""; //ROM filename
- std::string MovieToLoad = ""; //Movie filename
- std::string StateToLoad = ""; //Savestate filename
- std::vector ScriptsToLoad; //Lua script filenames
- std::string FileToLoad = ""; //Any file
- std::string PauseGame = ""; //adelikat: If user puts anything after -pause it will flag true, documentation will probably say put "1". There is no case for "-paused 0" since, to my knowledge, it would serve no purpose
- std::string ReadWrite = ""; //adelikat: Read Only is the default so this will be the same situation as above, any value will set to read+write status
-
- //Temps for finding string list
- int commandBegin = 0; //Beginning of Command
- int commandEnd = 0; //End of Command
- std::string newCommand; //Will hold newest command being parsed in the loop
- std::string trunc; //Truncated argList (from beginning of command to end of argumentList
-
- //--------------------------------------------------------------------------------------------
- //Commandline parsing loop
- for (int x = 0; x < (sizeof argCmds / sizeof std::string); x++)
+ std::string argumentList; //Complete command line argument
+ argumentList.assign(lpCmdLine); //Assign command line to argumentList
+ int argLength = argumentList.size(); //Size of command line argument
+
+ //List of valid commandline args
+ std::string argCmds[] = { "-cfg", "-rom", "-play", "-readwrite", "-loadstate", "-pause", "-lua", "-nodebug", "" }; //Hint: to add new commandlines, start by inserting them here.
+
+ //Strings that will get parsed:
+ std::string CfgToLoad = ""; //Cfg filename
+ std::string RomToLoad = ""; //ROM filename
+ std::string MovieToLoad = ""; //Movie filename
+ std::string StateToLoad = ""; //Savestate filename
+ std::vector ScriptsToLoad; //Lua script filenames
+ std::string FileToLoad = ""; //Any file
+ std::string PauseGame = ""; //adelikat: If user puts anything after -pause it will flag true, documentation will probably say put "1". There is no case for "-paused 0" since, to my knowledge, it would serve no purpose
+ std::string ReadWrite = ""; //adelikat: Read Only is the default so this will be the same situation as above, any value will set to read+write status
+
+ //Temps for finding string list
+ int commandBegin = 0; //Beginning of Command
+ int commandEnd = 0; //End of Command
+ std::string newCommand; //Will hold newest command being parsed in the loop
+ std::string trunc; //Truncated argList (from beginning of command to end of argumentList
+
+ //--------------------------------------------------------------------------------------------
+ //Commandline parsing loop
+ for (int x = 0; x < (sizeof argCmds / sizeof std::string); x++)
+ {
+ if (argumentList.find(argCmds[x]) != std::string::npos)
{
- if (argumentList.find(argCmds[x]) != std::string::npos)
- {
- commandBegin = argumentList.find(argCmds[x]) + argCmds[x].size() + (argCmds[x].empty() ? 0 : 1); //Find beginning of new command
- trunc = argumentList.substr(commandBegin); //Truncate argumentList
- commandEnd = trunc.find(" "); //Find next space, if exists, new command will end here
- if (argumentList[commandBegin] == '\"') //Actually, if it's in quotes, extend to the end quote
- {
- commandEnd = trunc.find('\"', 1);
- if (commandEnd >= 0)
- commandBegin++, commandEnd--;
- }
- if (commandEnd < 0) commandEnd = argLength; //If no space, new command will end at the end of list
- newCommand = argumentList.substr(commandBegin, commandEnd); //assign freshly parsed command to newCommand
- }
- else
- newCommand.clear();
-
- //Assign newCommand to appropriate variable
- switch (x)
- {
- case 0: //-cfg
- CfgToLoad = newCommand;
- break;
- case 1: //-rom
- RomToLoad = newCommand;
- break;
- case 2: //-play
- MovieToLoad = newCommand;
- break;
- case 3: //-readwrite
- ReadWrite = newCommand;
- break;
- case 4: //-loadstate
- StateToLoad = newCommand;
- break;
- case 5: //-pause
- PauseGame = newCommand;
- break;
- case 6: //-lua
- ScriptsToLoad.push_back(newCommand);
- break;
- case 7: // (a filename on its own, this must come BEFORE any other options on the commandline)
- if (newCommand[0] != '-')
- FileToLoad = newCommand;
- break;
- }
+ commandBegin = argumentList.find(argCmds[x]) + argCmds[x].size() + (argCmds[x].empty() ? 0 : 1); //Find beginning of new command
+ trunc = argumentList.substr(commandBegin); //Truncate argumentList
+ commandEnd = trunc.find(" "); //Find next space, if exists, new command will end here
+ if (argumentList[commandBegin] == '\"') //Actually, if it's in quotes, extend to the end quote
+ {
+ commandEnd = trunc.find('\"', 1);
+ if (commandEnd >= 0)
+ commandBegin++, commandEnd--;
+ }
+ if (commandEnd < 0) commandEnd = argLength; //If no space, new command will end at the end of list
+ newCommand = argumentList.substr(commandBegin, commandEnd); //assign freshly parsed command to newCommand
}
- //--------------------------------------------------------------------------------------------
- //Execute commands
+ else
+ newCommand.clear();
- // anything (rom, movie, cfg, luascript, etc.)
- if (FileToLoad[0])
+ //Assign newCommand to appropriate variable
+ switch (x)
{
- GensOpenFile(FileToLoad.c_str());
+ case 0: //-cfg
+ CfgToLoad = newCommand;
+ break;
+ case 1: //-rom
+ RomToLoad = newCommand;
+ break;
+ case 2: //-play
+ MovieToLoad = newCommand;
+ break;
+ case 3: //-readwrite
+ ReadWrite = newCommand;
+ break;
+ case 4: //-loadstate
+ StateToLoad = newCommand;
+ break;
+ case 5: //-pause
+ PauseGame = newCommand;
+ break;
+ case 6: //-lua
+ ScriptsToLoad.push_back(newCommand);
+ break;
+ case 7: //-nodebug
+ no_debug = 1;
+ break;
+ case 8: // (a filename on its own, this must come BEFORE any other options on the commandline)
+ if (newCommand[0] != '-')
+ FileToLoad = newCommand;
+ break;
}
-
- //Cfg
- if (CfgToLoad[0])
- {
- Load_Config((char*)CfgToLoad.c_str(), NULL);
- strcpy(Str_Tmp, "config loaded from ");
- strcat(Str_Tmp, CfgToLoad.c_str());
- Put_Info(Str_Tmp);
- }
-
- //ROM
- if (RomToLoad[0])
+ }
+ //--------------------------------------------------------------------------------------------
+ //Execute commands
+
+ // anything (rom, movie, cfg, luascript, etc.)
+ if (FileToLoad[0])
+ {
+ GensOpenFile(FileToLoad.c_str());
+ }
+
+ //Cfg
+ if (CfgToLoad[0])
+ {
+ Load_Config((char*)CfgToLoad.c_str(), NULL);
+ strcpy(Str_Tmp, "config loaded from ");
+ strcat(Str_Tmp, CfgToLoad.c_str());
+ Put_Info(Str_Tmp);
+ }
+
+ //ROM
+ if (RomToLoad[0])
+ {
+ GensLoadRom(RomToLoad.c_str());
+ }
+
+ //Movie
+ if (MovieToLoad[0]) GensPlayMovie(MovieToLoad.c_str(), 1);
+
+ //Read+Write
+ if (ReadWrite[0] && MainMovie.ReadOnly != 2) MainMovie.ReadOnly = 0;
+
+ //Loadstate
+ if (StateToLoad[0])
+ {
+ Load_State((char*)StateToLoad.c_str());
+ }
+
+ //Lua Scripts
+ for (unsigned int i = 0; i < ScriptsToLoad.size(); i++)
+ {
+ if (ScriptsToLoad[i][0])
{
- GensLoadRom(RomToLoad.c_str());
+ const char* error = GensOpenScript(ScriptsToLoad[i].c_str());
+ if (error)
+ fprintf(stderr, "failed to start script \"%s\" because: %s\n", ScriptsToLoad[i].c_str(), error);
}
-
- //Movie
- if (MovieToLoad[0]) GensPlayMovie(MovieToLoad.c_str(), 1);
-
- //Read+Write
- if (ReadWrite[0] && MainMovie.ReadOnly != 2) MainMovie.ReadOnly = 0;
-
- //Loadstate
- if (StateToLoad[0])
- {
- Load_State((char*)StateToLoad.c_str());
- }
-
- //Lua Scripts
- for (unsigned int i = 0; i < ScriptsToLoad.size(); i++)
- {
- if (ScriptsToLoad[i][0])
- {
- const char* error = GensOpenScript(ScriptsToLoad[i].c_str());
- if (error)
- fprintf(stderr, "failed to start script \"%s\" because: %s\n", ScriptsToLoad[i].c_str(), error);
- }
- }
-
- //Paused
- if (PauseGame[0]) Paused = 1;
-
- /* OLD CODE
- char Str_Tmpy[1024];
- int src;
-
- #ifdef CC_SUPPORT
- // src = CC_Connect("CCGEN://Stef:gens@emu.consoleclassix.com/sonicthehedgehog2.gen", (char *) Rom_Data, CC_End_Callback);
- src = CC_Connect(lpCmdLine, (char *) Rom_Data, CC_End_Callback);
-
- if (src == 0)
- {
- Load_Rom_CC(CCRom.RName, CCRom.RSize);
- Build_Main_Menu();
- }
- else if (src == 1)
- {
- MessageBox(HWnd, "Error during connection", NULL, MB_OK);
- }
- else if (src == 2)
- {
- #endif
- src = 0;
-
- if (lpCmdLine[src] == '"')
- {
- src++;
-
- while ((lpCmdLine[src] != '"') && (lpCmdLine[src] != 0))
- {
- Str_Tmpy[src - 1] = lpCmdLine[src];
- src++;
- }
-
- Str_Tmpy[src - 1] = 0;
- }
- else
- {
- while (lpCmdLine[src] != 0)
- {
- Str_Tmpy[src] = lpCmdLine[src];
- src++;
- }
-
- Str_Tmpy[src] = 0;
- }
-
- Pre_Load_Rom(HWnd, Str_Tmpy);
-
- #ifdef CC_SUPPORT
- }
- #endif
- */
+ }
+
+ //Paused
+ if (PauseGame[0]) Paused = 1;
+
+ /* OLD CODE
+ char Str_Tmpy[1024];
+ int src;
+
+ #ifdef CC_SUPPORT
+ // src = CC_Connect("CCGEN://Stef:gens@emu.consoleclassix.com/sonicthehedgehog2.gen", (char *) Rom_Data, CC_End_Callback);
+ src = CC_Connect(lpCmdLine, (char *) Rom_Data, CC_End_Callback);
+
+ if (src == 0)
+ {
+ Load_Rom_CC(CCRom.RName, CCRom.RSize);
+ Build_Main_Menu();
+ }
+ else if (src == 1)
+ {
+ MessageBox(HWnd, "Error during connection", NULL, MB_OK);
+ }
+ else if (src == 2)
+ {
+ #endif
+ src = 0;
+
+ if (lpCmdLine[src] == '"')
+ {
+ src++;
+
+ while ((lpCmdLine[src] != '"') && (lpCmdLine[src] != 0))
+ {
+ Str_Tmpy[src - 1] = lpCmdLine[src];
+ src++;
+ }
+
+ Str_Tmpy[src - 1] = 0;
+ }
+ else
+ {
+ while (lpCmdLine[src] != 0)
+ {
+ Str_Tmpy[src] = lpCmdLine[src];
+ src++;
+ }
+
+ Str_Tmpy[src] = 0;
+ }
+
+ Pre_Load_Rom(HWnd, Str_Tmpy);
+
+ #ifdef CC_SUPPORT
+ }
+ #endif
+ */
}
\ No newline at end of file