Ejemplo n.º 1
0
        private void RunNdsTool(string romname, string dirname, bool bexport)
        {
            string args = " \"" + romname + "\" " +
                          "-9 \"" + dirname + "/arm9.bin\" " +
                          "-7 \"" + dirname + "/arm7.bin\" " +
                          "-y9 \"" + dirname + "/y9.bin\" " +
                          "-y7 \"" + dirname + "/y7.bin\" " +
                          "-d \"" + dirname + "/data\" " +
                          "-y \"" + dirname + "/overlay\" " +
                          "-t \"" + dirname + "/banner.bin\" " +
                          "-h \"" + dirname + "/header.bin\" " +
                          "-v";

            if (bexport)
            {
                args = "-x" + args;
            }
            else
            {
                args = "-c" + args;
            }

            UtilityLauncher runndstool = new UtilityLauncher(this, NdsToolName);

            //First extract the data
            if (runndstool.StartUtil(args))
            {
                runndstool.WaitUntilFinished();
            }

            if (runndstool.GetReturnCode() != 0)
            {
                throw new Exception("ndstool.exe encountered an error.");
            }
        }
Ejemplo n.º 2
0
 public void RunGameLoop()
 {
     if (!IsRunning)
     {
         IsRunning = true;
         UtilityLauncher.PreGameLoopLaunch();
         Console.WriteLine("Starting Game Loop");
         base.Run();
     }
 }
Ejemplo n.º 3
0
        public bool InitialiseGameWindow()
        {
            GC.AddMemoryPressure(33554432);
            FullscreenToggle = new ToggleButton((isToggled) =>
            {
                if (isToggled)
                {
                    WindowState = WindowState.Fullscreen;
                }
                else
                {
                    WindowState = WindowState.Normal;
                }
            });
            CursorGrappedToggle = new ToggleButton((isToggled) =>
            {
                if (isToggled)
                {
                    CursorVisible = true;
                    CursorGrabbed = false;
                }
                else
                {
                    CursorVisible = false;
                    CursorGrabbed = true;
                }
            });

            Size      = new OpenTK.Mathematics.Vector2i(1280, 720);
            IsRunning = false;

            UtilityLauncher.PreOpenGLLaunch();

            if (InitialiseOpenGL())
            {
                UtilityLauncher.AfterOpenGLLaunch();
                LogManager.OpenGLLogger.Log("Successfully initialised Game Engine");
                return(true);
            }
            else
            {
                LogManager.OpenGLLogger.Log("Failed to initialise Game Engine");
                return(false);
            }
        }
Ejemplo n.º 4
0
        //-----------------------------------------------------------------
        //  Step #2 Stuff
        //-----------------------------------------------------------------



        private void DoRunStatsUtil(string extractedromdir, bool bexport, bool doitem, bool domoves, bool dopkstats, bool dotext)
        {
            UtilityLauncher runstatutil = new UtilityLauncher(this, StatsUtil_Name);

            string argsstats = string.Empty;

            if (bexport)
            {
                argsstats = "-e \""; //+ System.IO.Path.Combine(extractedromdir, "data"); //+ "\" \"" + m_lastExportDirectory + "\" -log";
            }
            else
            {
                argsstats = "-i \"";// + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" -log";
            }
            //Then check for the strings, as we have to do them separately
            if (dotext)
            {
                if (bexport)
                {
                    if (runstatutil.StartUtil("-e \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" \"" + m_lastExportDirectory + "\"" + " -str -log"))
                    {
                        runstatutil.WaitUntilFinished();
                    }
                }
                else
                {
                    if (runstatutil.StartUtil("-i \"" + System.IO.Path.Combine(m_lastExportDirectory, DefaultGameStrName) + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\"" + " -str -log"))
                    {
                        runstatutil.WaitUntilFinished();
                    }
                }

                Thread.Sleep(100);

                if (runstatutil.GetReturnCode() != 0)
                {
                    throw new Exception("ppmd_statsutil.exe encountered an error!");
                }
            }


            //Run exportall
            if (doitem && domoves && dopkstats)
            {
                string myargs = argsstats;
                if (bexport)
                {
                    myargs = myargs + System.IO.Path.Combine(extractedromdir, "data") + "\" \"" + m_lastExportDirectory + "\" -log";
                }
                else
                {
                    myargs = myargs + m_lastExportDirectory + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" -log";
                }


                if (runstatutil.StartUtil(myargs))
                {
                    runstatutil.WaitUntilFinished();
                }

                if (runstatutil.GetReturnCode() != 0)
                {
                    throw new Exception("ppmd_statsutil.exe encountered an error!");
                }
            }
            else
            {
                if (doitem)
                {
                    string myargs = argsstats;
                    if (bexport)
                    {
                        myargs = myargs + System.IO.Path.Combine(extractedromdir, "data") + "\" \"" + System.IO.Path.Combine(m_lastExportDirectory, DefaultItemDir) + "\" -log";
                    }
                    else
                    {
                        myargs = myargs + System.IO.Path.Combine(m_lastExportDirectory, DefaultItemDir) + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" -log";
                    }

                    if (runstatutil.StartUtil(myargs + " -items"))
                    {
                        runstatutil.WaitUntilFinished();
                    }

                    Thread.Sleep(100);

                    if (runstatutil.GetReturnCode() != 0)
                    {
                        throw new Exception("ppmd_statsutil.exe encountered an error!");
                    }
                }
                if (domoves)
                {
                    string myargs = argsstats;
                    if (bexport)
                    {
                        myargs = myargs + System.IO.Path.Combine(extractedromdir, "data") + "\" \"" + System.IO.Path.Combine(m_lastExportDirectory, DefaultMoveDir) + "\" -log";
                    }
                    else
                    {
                        myargs = myargs + System.IO.Path.Combine(m_lastExportDirectory, DefaultMoveDir) + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" -log";
                    }


                    if (runstatutil.StartUtil(myargs + " -mv"))
                    {
                        runstatutil.WaitUntilFinished();
                    }

                    Thread.Sleep(100);

                    if (runstatutil.GetReturnCode() != 0)
                    {
                        throw new Exception("ppmd_statsutil.exe encountered an error!");
                    }
                }
                if (dopkstats)
                {
                    string myargs = argsstats;
                    if (bexport)
                    {
                        myargs = myargs + System.IO.Path.Combine(extractedromdir, "data") + "\" \"" + System.IO.Path.Combine(m_lastExportDirectory, DefaultPkmnDir) + "\" -log";
                    }
                    else
                    {
                        myargs = myargs + System.IO.Path.Combine(m_lastExportDirectory, DefaultPkmnDir) + "\" \"" + System.IO.Path.Combine(extractedromdir, "data") + "\" -log";
                    }


                    if (runstatutil.StartUtil(myargs + " -pk"))
                    {
                        runstatutil.WaitUntilFinished();
                    }

                    Thread.Sleep(100);

                    if (runstatutil.GetReturnCode() != 0)
                    {
                        throw new Exception("ppmd_statsutil.exe encountered an error!");
                    }
                }
            }
        }