Compare commits
7 Commits
4.0.1
...
4.0.1-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb3fc13385 | ||
|
|
35a6bd9b41 | ||
|
|
e87301e160 | ||
|
|
e96ea63479 | ||
|
|
c24e028960 | ||
|
|
5a12d0c120 | ||
|
|
785549a9c8 |
4
Makefile
4
Makefile
@@ -113,9 +113,9 @@ $(BUILDDIR)/$(TARGET)/script/builtin.c: scripts/*.te
|
||||
@mkdir -p "$(@D)"
|
||||
@mkdir -p "$(BUILDDIR)/$(TARGET)/scripts"
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@py ts-minifier.py -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te)
|
||||
@py ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te)
|
||||
@py te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts"
|
||||
else
|
||||
@python3 ts-minifier.py -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te)
|
||||
@python3 ts-minifier.py --such-meme -d "$(BUILDDIR)/$(TARGET)/scripts" $(wildcard scripts/*.te)
|
||||
@python3 te2c.py "$(BUILDDIR)/$(TARGET)/script/builtin" "$(BUILDDIR)/$(TARGET)/scripts"
|
||||
endif
|
||||
|
||||
@@ -42,7 +42,8 @@ static const pkg1_id_t _pkg1_ids[] = {
|
||||
{ "20210129", 10}, //12.0.0 - 12.0.1
|
||||
{ "20210422", 10}, //12.0.2 - 12.0.3
|
||||
{ "20210607", 11}, //12.1.0
|
||||
{ "20210805", 11 },
|
||||
{ "20210805", 12}, //13.0.0 - 13.2.0
|
||||
{ "20220105", 12}, //13.2.1+
|
||||
{ NULL } //End.
|
||||
};
|
||||
|
||||
|
||||
@@ -180,11 +180,11 @@ ClassFunction(arrayContains) {
|
||||
|
||||
if (caller->variableType == StringArrayClass) {
|
||||
if (!strcmp(arg->string.value, iter.string.value))
|
||||
return newIntVariablePtr(1);
|
||||
return newIntVariablePtr(i + 1);
|
||||
}
|
||||
else {
|
||||
if (arg->integer.value == iter.integer.value)
|
||||
return newIntVariablePtr(1);
|
||||
return newIntVariablePtr(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,13 +234,8 @@ char *powNames[] = {
|
||||
"volminus",
|
||||
};
|
||||
|
||||
// Takes [int]. Returns dict[a,b,x,y,down,up,right,left,power,volplus,volminus,raw]. int: mask for hidWaitMask
|
||||
ClassFunction(stdPauseMask){
|
||||
Variable_t *hidToVar(u32 raw){
|
||||
Variable_t ret = {.variableType = DictionaryClass, .dictionary.vector = newVec(sizeof(Dict_t), 9)};
|
||||
Input_t *i = hidWaitMask((u32)getIntValue(*args));
|
||||
|
||||
u32 raw = i->buttons;
|
||||
|
||||
addIntToDict(&ret, "raw", raw);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(abxyNames); i++){
|
||||
@@ -265,6 +260,19 @@ ClassFunction(stdPauseMask){
|
||||
return copyVariableToPtr(ret);
|
||||
}
|
||||
|
||||
ClassFunction(stdRead){
|
||||
Input_t *i = hidRead();
|
||||
u32 raw = i->buttons;
|
||||
return hidToVar(raw);
|
||||
}
|
||||
|
||||
// Takes [int]. Returns dict[a,b,x,y,down,up,right,left,power,volplus,volminus,raw]. int: mask for hidWaitMask
|
||||
ClassFunction(stdPauseMask){
|
||||
Input_t *i = hidWaitMask((u32)getIntValue(*args));
|
||||
u32 raw = i->buttons;
|
||||
return hidToVar(raw);
|
||||
}
|
||||
|
||||
// Takes none. Returns dict (same as stdPauseMask).
|
||||
ClassFunction(stdPause){
|
||||
Variable_t a = {.integer.value = 0xFFFFFFFF};
|
||||
@@ -482,6 +490,7 @@ STUBBED(stdMkdir)
|
||||
STUBBED(stdGetMemUsage)
|
||||
STUBBED(stdGetNcaType)
|
||||
STUBBED(stdPause)
|
||||
STUBBED(stdRead)
|
||||
STUBBED(stdPauseMask)
|
||||
STUBBED(stdColor)
|
||||
STUBBED(stdMenuFull)
|
||||
@@ -541,6 +550,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||
{"timer", stdGetMs, 0, 0},
|
||||
{"pause", stdPauseMask, 1, threeIntsStd},
|
||||
{"pause", stdPause, 0, 0},
|
||||
{"hidread", stdRead, 0, 0},
|
||||
{"color", stdColor, 1, threeIntsStd},
|
||||
{"menu", stdMenuFull, 3, menuArgsStd},
|
||||
{"menu", stdMenuFull, 2, menuArgsStd},
|
||||
|
||||
@@ -152,7 +152,12 @@ Variable_t createUnsolvedArrayVariable(Function_t* f) {
|
||||
return var;
|
||||
}
|
||||
|
||||
ClassFunction(retZero){
|
||||
return newIntVariablePtr(0);
|
||||
}
|
||||
|
||||
u8 anotherOneVarArg[] = { VARARGCOUNT };
|
||||
u8 unsolvedArrayStr[] = { StringClass };
|
||||
|
||||
ClassFunction(createTypedArray) {
|
||||
Vector_t v = { 0 };
|
||||
@@ -180,6 +185,7 @@ ClassFunction(createTypedArray) {
|
||||
ClassFunctionTableEntry_t unsolvedArrayFunctions[] = {
|
||||
{"+", createTypedArray, 1, anotherOneVarArg},
|
||||
{"add", createTypedArray, 1, anotherOneVarArg},
|
||||
{"len", retZero, 0, 0},
|
||||
};
|
||||
|
||||
Variable_t getUnsolvedArrayMember(Variable_t* var, char* memberName) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Copyright (c) 2021 bleck9999
|
||||
# https://github.com/bleck9999/ts-minifier
|
||||
# Version: 339183b2
|
||||
# Version: e276c417
|
||||
|
||||
import argparse
|
||||
import itertools
|
||||
@@ -14,7 +14,7 @@ stdlib = ['if', 'while', 'print', 'println', 'mountsys', 'mountemu', 'readsave',
|
||||
'readdir', 'copyfile', 'mkdir', 'ncatype', 'pause', 'color', 'menu', 'emu', 'clear', 'timer', 'deldir',
|
||||
'fsexists', 'delfile', 'copydir', 'movefile', 'payload', 'readfile', 'writefile', 'setpixels', 'printpos',
|
||||
'emmcread', 'emmcwrite', 'emummcread', 'emummcwrite', 'escapepath', 'combinepath', 'cwd', 'power',
|
||||
'fuse_patched', 'fuse_hwtype']
|
||||
'fuse_patched', 'fuse_hwtype', 'hidread']
|
||||
|
||||
|
||||
class Code:
|
||||
@@ -427,6 +427,8 @@ if __name__ == '__main__':
|
||||
"and attempt to generate shorter names for reused variables \ndefault: false")
|
||||
argparser.add_argument("-v", action="store_true", default=False,
|
||||
help="prints even more information to the console than usual")
|
||||
argparser.add_argument("--such-meme", action="store_true", default=False,
|
||||
help="replaces destination file if it already exists \ndefault: false")
|
||||
|
||||
args = argparser.parse_args()
|
||||
files = args.source
|
||||
@@ -448,7 +450,7 @@ if __name__ == '__main__':
|
||||
logging.info("Stripping whitespace (pass 2)")
|
||||
r = whitespacent(r)
|
||||
file = path.splitext(path.basename(file))[0]
|
||||
if path.exists(path.join(dest, f"{file}.te")):
|
||||
if path.exists(path.join(dest, f"{file}.te")) and not args.such_meme:
|
||||
f = open(path.join(dest, f"{file}_min.te"), 'w')
|
||||
else:
|
||||
f = open(path.join(dest, f"{file}.te"), 'w')
|
||||
|
||||
Reference in New Issue
Block a user