mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-26 05:42:07 +00:00
implement the most important function
This commit is contained in:
parent
3c640e23b1
commit
00fc334764
2 changed files with 11 additions and 3 deletions
|
@ -111,6 +111,11 @@ ClassFunction(stdMountSave){
|
||||||
var.save = save;
|
var.save = save;
|
||||||
return copyVariableToPtr(var);
|
return copyVariableToPtr(var);
|
||||||
}
|
}
|
||||||
|
ClassFunction(stdSetPixel) {
|
||||||
|
u32 color = getIntValue(args[2]);
|
||||||
|
gfx_set_pixel_horz(args[0]->integer.value, args[1]->integer.value, color);
|
||||||
|
return &emptyClass;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
ClassFunction(stdMountSysmmc){
|
ClassFunction(stdMountSysmmc){
|
||||||
return newIntVariablePtr(0);
|
return newIntVariablePtr(0);
|
||||||
|
@ -118,6 +123,9 @@ ClassFunction(stdMountSysmmc){
|
||||||
ClassFunction(stdMountSave){
|
ClassFunction(stdMountSave){
|
||||||
return newIntVariablePtr(0);
|
return newIntVariablePtr(0);
|
||||||
}
|
}
|
||||||
|
ClassFunction(stdSetPixel) {
|
||||||
|
return newIntVariablePtr(0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum standardFunctionIndexes {
|
enum standardFunctionIndexes {
|
||||||
|
@ -129,11 +137,13 @@ enum standardFunctionIndexes {
|
||||||
STD_EXIT,
|
STD_EXIT,
|
||||||
STD_BREAK,
|
STD_BREAK,
|
||||||
STD_DICT,
|
STD_DICT,
|
||||||
|
STD_SETPIXEL,
|
||||||
};
|
};
|
||||||
|
|
||||||
u8 oneIntoneFunction[] = { IntClass, FunctionClass };
|
u8 oneIntoneFunction[] = { IntClass, FunctionClass };
|
||||||
u8 doubleFunctionClass[] = { FunctionClass, FunctionClass };
|
u8 doubleFunctionClass[] = { FunctionClass, FunctionClass };
|
||||||
u8 oneStringArgStd[] = {StringClass};
|
u8 oneStringArgStd[] = {StringClass};
|
||||||
|
u8 threeIntsStd[] = { IntClass, IntClass, IntClass };
|
||||||
|
|
||||||
ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||||
[STD_IF] = {"if", stdIf, 2, oneIntoneFunction},
|
[STD_IF] = {"if", stdIf, 2, oneIntoneFunction},
|
||||||
|
@ -144,6 +154,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||||
[STD_EXIT] = {"exit", stdExit, 0, 0},
|
[STD_EXIT] = {"exit", stdExit, 0, 0},
|
||||||
[STD_BREAK] = {"break", stdBreak, 0, 0},
|
[STD_BREAK] = {"break", stdBreak, 0, 0},
|
||||||
[STD_DICT] = {"dict", stdDict, 0, 0},
|
[STD_DICT] = {"dict", stdDict, 0, 0},
|
||||||
|
[STD_SETPIXEL] = {"setpixel", stdSetPixel, 3, threeIntsStd},
|
||||||
};
|
};
|
||||||
|
|
||||||
ClassFunctionTableEntry_t* searchStdLib(char* funcName) {
|
ClassFunctionTableEntry_t* searchStdLib(char* funcName) {
|
||||||
|
|
|
@ -50,9 +50,6 @@ int vecAddElem(Vector_t* v, void* elem, u8 sz) {
|
||||||
u32 usedbytes = v->count * sz;
|
u32 usedbytes = v->count * sz;
|
||||||
if (usedbytes >= v->capacity)
|
if (usedbytes >= v->capacity)
|
||||||
{
|
{
|
||||||
if (v->capacity > 5000) {
|
|
||||||
printf("uhhhh");
|
|
||||||
}
|
|
||||||
v->capacity *= 2;
|
v->capacity *= 2;
|
||||||
void* buff = malloc(v->capacity);
|
void* buff = malloc(v->capacity);
|
||||||
if (!buff)
|
if (!buff)
|
||||||
|
|
Loading…
Reference in a new issue