00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef UCPROCESS_H
00020 #define UCPROCESS_H
00021
00022 #include <list>
00023 #include "Process.h"
00024 #include "UCStack.h"
00025
00026 class Usecode;
00027 class IDataSource;
00028 class ODataSource;
00029
00030
00031
00032 class UCProcess : public Process
00033 {
00034 friend class UCMachine;
00035 friend class Kernel;
00036 public:
00037 UCProcess();
00038 UCProcess(uint16 classid_, uint16 offset_, uint32 this_ptr = 0,
00039 int thissize = 0, const uint8* args = 0, int argsize = 0);
00040 ~UCProcess();
00041
00042
00043 ENABLE_RUNTIME_CLASSTYPE();
00044
00045 virtual bool run(const uint32 framenum);
00046
00047 virtual void terminate();
00048
00049 void freeOnTerminate(uint16 index, int type);
00050
00051 void setReturnValue(uint32 retval) { temp32 = retval; }
00052
00054 virtual void dumpInfo();
00055
00056 bool loadData(IDataSource* ids, uint32 version);
00057 protected:
00058 virtual void saveData(ODataSource* ods);
00059
00060 void load(uint16 classid_, uint16 offset_, uint32 this_ptr = 0,
00061 int thissize = 0, const uint8* args = 0, int argsize = 0);
00062 void call(uint16 classid_, uint16 offset_);
00063 bool ret();
00064
00065
00066 uint16 bp;
00067
00068 Usecode* usecode;
00069
00070 uint16 classid;
00071 uint16 ip;
00072
00073 uint32 temp32;
00074
00075
00076 UCStack stack;
00077
00078
00079 std::list<std::pair<uint16, int> > freeonterminate;
00080 };
00081
00082 #endif