22 #ifndef ULTIMA8_USECODE_UCMACHINE_H 23 #define ULTIMA8_USECODE_UCMACHINE_H 25 #include "ultima/ultima8/misc/common_types.h" 26 #include "ultima/shared/std/string.h" 27 #include "ultima/shared/std/containers.h" 28 #include "ultima/ultima8/usecode/intrinsics.h" 44 UCMachine(
const Intrinsic *iset,
unsigned int icount);
58 void freeString(uint16 s);
59 void freeStringList(uint16 l);
60 void freeList(uint16 l);
62 uint16 duplicateString(uint16 str);
64 void usecodeStats()
const;
66 static uint32 listToPtr(uint16 l);
67 static uint32 stringToPtr(uint16 s);
68 static uint32 stackToPtr(uint16 pid, uint16 offset);
69 static uint32 globalToPtr(uint16 offset);
70 static uint32 objectToPtr(uint16 objID);
72 static uint16 ptrToObject(uint32 ptr);
74 bool assignPointer(uint32 ptr,
const uint8 *data, uint32 size);
75 bool dereferencePointer(uint32 ptr, uint8 *data, uint32 size);
87 INTRINSIC(I_dummyProcess);
90 INTRINSIC(I_rndRange);
91 INTRINSIC(I_numToStr);
94 void loadIntrinsics(
const Intrinsic *i,
unsigned int icount);
98 const Intrinsic *_intrinsics;
99 unsigned int _intrinsicCount;
107 uint16 assignString(
const char *str);
108 uint16 assignList(
UCList *l);
116 bool _tracingEnabled;
122 inline bool trace_show(ProcId pid, ObjId objid, uint16 ucclass) {
123 if (!_tracingEnabled)
return false;
124 if (_traceAll)
return true;
125 if (_traceObjIDs.
find(objid) != _traceObjIDs.end())
return true;
126 if (_tracePIDs.
find(pid) != _tracePIDs.end())
return true;
127 if (_traceClasses.
find(ucclass) != _traceClasses.end())
return true;
Definition: uc_process.h:34
Definition: convert_usecode.h:28
Definition: detection.h:27
Definition: uc_machine.h:41
iterator find(const T item)
Definition: containers.h:172
Definition: global_storage.h:32
Definition: debugger.h:37