/*
PokeMini - Pokémon-Mini Emulator
Copyright (C) 2009-2015 JustBurn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
#include
#include
#include
#include
#include
#ifdef _WIN32
#include
#else
#include
#endif
#include "SDL.h"
#include "PokeMini.h"
#include "PokeMini_Debug.h"
#include "Hardware_Debug.h"
#include "CPUWindow.h"
#include "ExternalWindow.h"
#include "PokeMiniIcon_96x128.h"
#include "InstructionProc.h"
#include "InstructionInfo.h"
#include
#include "GtkXDialogs.h"
#include "SGtkXDrawingView.h"
int ExternalWindow_InConfigs = 0;
GtkWindow *ExternalWindow;
static GtkScrolledWindow *ExternalSW;
static GtkBox *VBox1;
static GtkTable *MTable;
static GtkLabel *MLabelTitle[10];
static GtkLabel *MLabelExec[10];
static GtkEntry *MEntryTitle[10];
static GtkEntry *MEntryExec[10];
static GtkToggleButton *MCurrDir[10];
static GtkLabel *LabelDesc;
static GtkButtonBox *HButtonBox;
static GtkButton *ButtonOk;
static GtkButton *ButtonCancel;
// Locals
GtkItemFactory *CPUItemFactory = NULL;
#define EXTMPV (4096)
// --------
// Launcher
// --------
static int RunCmdNoWait(const char *runcmd, int atcurrdir)
{
char **argv, *argpars = "", *launchdir;
int i, res = 1, argc;
// Select launch directory
launchdir = atcurrdir ? PokeMini_CurrDir : PokeMini_ExecDir;
// Decode arguments
argc = GetArgument(runcmd, 1, NULL, 0, &argpars);
argv = (char **)malloc((argc + 1) * sizeof(char *));
for (i=0; i 32;
#else
// Fork and execute
i = fork();
if (i == -1) {
fprintf(stderr, "Error: Couldn't fork()\n");
res = 0;
} else if (i == 0) {
// Child process
PokeMini_GotoCustomDir(launchdir);
execvp(argv[0], argv);
_exit(0);
}
#endif
// Free memory
for (i=0; i