X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fyapi%2Flib%2FdolSupport.cpp;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fyapi%2Flib%2FdolSupport.cpp;h=164e1a60e899cd32177737737a170e1b8a1a2ca8;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/yapi/lib/dolSupport.cpp b/dol/src/dol/visitor/yapi/lib/dolSupport.cpp new file mode 100644 index 0000000..164e1a6 --- /dev/null +++ b/dol/src/dol/visitor/yapi/lib/dolSupport.cpp @@ -0,0 +1,81 @@ +#include "dolSupport.h" +#include "ProcessWrapper.h" + +/** + * + */ +unsigned dolwrite(OutPort *out, const void *buf, unsigned len, const DOLProcess *process) +{ + write(*out, (char*)buf, len); + return len; +} + + +/** + * + */ +unsigned dolread(InPort *in, const void *buf, unsigned len, const DOLProcess *process) { + read(*in, (char*)buf, len); + return len; +} + +/** + * + */ +void DOL_detach(DOLProcess* p) { + static_cast(p->wptr)->detach(); +} + + +/** + * + */ +void createPort(void** port, + void* base, + int number_of_indices, + int index0, int range0) { + *port = (void**)((void**)base)[index0]; +} + + +/** + * + */ +void createPort(void** port, + void* base, + int number_of_indices, + int index0, int range0, + int index1, int range1) { + *port = (void**)((void**)base)[index0 * range1 + index1]; +} + + +/** + * + */ +void createPort(void** port, + void* base, + int number_of_indices, + int index0, int range0, + int index1, int range1, + int index2, int range2) { + *port = (void**)((void**)base)[index0 * range1 * range2 + + index1 * range2 + index2]; +} + + +/** + * + */ +void createPort(void** port, + void* base, + int number_of_indices, + int index0, int range0, + int index1, int range1, + int index2, int range2, + int index3, int range3) { + *port = (void**)((void**)base)[index0 * range1 * range2 * range3 + + index1 * range2 * range3 + + index2 * range3 + + index3]; +}