00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pent_include.h"
00020
00021 #include "ConApp.h"
00022
00023 #include "Kernel.h"
00024
00025 #include "DisasmProcess.h"
00026 #include "CompileProcess.h"
00027
00028 ConApp::ConApp(int argc, const char* const* argv)
00029 : CoreApp(argc, argv), kernel(0),
00030 weAreDisasming(false), weAreCompiling(false)
00031
00032 {
00033 application = this;
00034 }
00035
00036 void ConApp::startup()
00037 {
00038 CoreApp::startup();
00039
00040 kernel = new Kernel();
00041
00042 if(weAreDisasming==true)
00043 {
00044
00045 con.Print(MM_INFO, "We Are Diassembling...\n");
00046 kernel->addProcess(new DisasmProcess());
00047 }
00048 else if(weAreCompiling==true)
00049 {
00050
00051 con.Print(MM_INFO, "We Are Compiling...\n");
00052 kernel->addProcess(new CompileProcess(filesystem));
00053 }
00054 else
00055 {
00056
00057 con.Print(MM_INFO, "We Are Compiling...\n");
00058 kernel->addProcess(new CompileProcess(filesystem));
00059
00060 }
00061 }
00062
00063 void ConApp::DeclareArgs()
00064 {
00065 CoreApp::DeclareArgs();
00066
00067 parameters.declare("--disasm", &weAreDisasming, true);
00068 parameters.declare("--compile", &weAreCompiling, true);
00069 }
00070
00071 void ConApp::helpMe()
00072 {
00073 CoreApp::helpMe();
00074
00075
00076
00077
00078
00079 con.Print("\t--disasm\t- disassemble\n");
00080 con.Print("\t--compile\t- compile\n");
00081 }
00082
00083 ConApp::~ConApp()
00084 {
00085
00086 }
00087
00088 void ConApp::run()
00089 {
00090 isRunning = true;
00091
00092
00093
00094 bool repaint;
00095
00096 while (isRunning) {
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 if (kernel->runProcesses()) repaint = true;
00107
00108 if (kernel->getNumProcesses(0, 6) == 0)
00109 isRunning=false;
00110
00111 }
00112 }
00113