diff options
Diffstat (limited to '')
61 files changed, 4470 insertions, 1845 deletions
diff --git a/project/src/lib-bzip2.h b/project/src/lib-bzip2.h index b3662f2..4e2ea8c 100644 --- a/project/src/lib-bzip2.h +++ b/project/src/lib-bzip2.h @@ -297,7 +297,7 @@ typedef struct BZ2Source_t //--- search files ccp search; // Semicolon separated list of filenames - // or sub-pathes to search. + // or sub-paths to search. // NULL terminate source lists. //--- internal fall back data diff --git a/project/src/lib-checksum.c b/project/src/lib-checksum.c index a96cd79..ed45e7a 100644 --- a/project/src/lib-checksum.c +++ b/project/src/lib-checksum.c @@ -942,7 +942,7 @@ ParamFieldItem_t * StoreSZSCache } bool found; - ParamFieldItem_t *it = InsertParamFieldEx(&szs_cache,checksum,false,0,&found); + ParamFieldItem_t *it = FindInsertParamField(&szs_cache,checksum,false,0,&found); if (found) { DASSERT(it); diff --git a/project/src/lib-ctcode.c b/project/src/lib-ctcode.c index a24ecb2..c89dd38 100644 --- a/project/src/lib-ctcode.c +++ b/project/src/lib-ctcode.c @@ -1745,7 +1745,9 @@ static enumError ScanRTL_Slot n1 = 0; if ( ++n2 > ctcode->max_tracks ) n2 = ctcode->max_tracks; - noPRINT("SLOT: %02lx:%02lx = %lu:%lu%s\n",n1,n2,n1,n2,force ? " /FORCE" : ""); + PRINT0("SLOT: %02lx:%02lx = %lu:%lu%s%s\n",n1,n2,n1,n2, + mark_reserved ? " /X" : "", + force ? " /FORCE" : ""); if ( n1 >= n2 ) continue; @@ -1773,8 +1775,10 @@ static enumError ScanRTL_Slot ctcode->n_next_slot = ctcode->max_tracks - idx; if (ctcode->n_next_slot) { - memmove(ctcode->next_slot,ctcode->next_slot+idx,ctcode->n_next_slot); - memmove(ctcode->force_slot,ctcode->force_slot+idx,ctcode->n_next_slot); + memmove( ctcode->next_slot, ctcode->next_slot + idx, + ctcode->n_next_slot * sizeof(*ctcode->next_slot) ); + memmove( ctcode->force_slot, ctcode->force_slot + idx, + ctcode->n_next_slot * sizeof(*ctcode->force_slot) ); } } diff --git a/project/src/lib-file.c b/project/src/lib-file.c index 3d6b65a..c4cce3d 100644 --- a/project/src/lib-file.c +++ b/project/src/lib-file.c @@ -44,6 +44,7 @@ #include <time.h> #include <utime.h> #include <dirent.h> +#include <stddef.h> #include "lib-std.h" #include "lib-szs.h" @@ -63,6 +64,7 @@ #include "lib-common.h" #include "lib-bzip2.h" #include "lib-checksum.h" +#include "config.inc" // /////////////////////////////////////////////////////////////////////////////// @@ -75,7 +77,7 @@ { if ( param->arg && *param->arg ) { - char *res = AllocNormalizedFilenameCygwin(param->arg); + char *res = AllocNormalizedFilenameCygwin(param->arg,false); FREE(param->arg); param->arg = res; } @@ -89,7 +91,7 @@ void SetSource ( ccp source ) { #ifdef __CYGWIN__ opt_source = IsWindowsDriveSpec(source) - ? AllocNormalizedFilenameCygwin(source) + ? AllocNormalizedFilenameCygwin(source,false) : source; #else opt_source = source; @@ -106,7 +108,7 @@ void SetDest ( ccp dest, bool mkdir ) { #ifdef __CYGWIN__ opt_dest = IsWindowsDriveSpec(dest) - ? AllocNormalizedFilenameCygwin(dest) + ? AllocNormalizedFilenameCygwin(dest,false) : dest; #else opt_dest = dest; @@ -1821,53 +1823,382 @@ bool PATCH_ACTION_LOG ( ccp action, ccp object, ccp format, ... ) // /////////////////////////////////////////////////////////////////////////////// -/////////////// auto add support /////////////// +/////////////// scan configuration /////////////// +/////////////////////////////////////////////////////////////////////////////// + +void ResetConfig ( config_t *config ) +{ + DASSERT(config); + FreeString(config->config_file); + FreeString(config->base_path); + FreeString(config->install_path); + FreeString(config->install_config); + FreeString(config->share_path); + FreeString(config->autoadd_path); + InitializeConfig(config); +} + /////////////////////////////////////////////////////////////////////////////// -bool SetupAutoAdd() +enumError ScanConfig +( + config_t *config, // store configuration here + ccp path, // NULL or path + bool silent // true: suppress printing of error messages +) { + ASSERT(config); + ResetConfig(config); + config->config_file = path ? STRDUP(path) : 0; + + + //--- setup paths + + exmem_list_t paths; + InitializeEML(&paths); + + #ifdef __CYGWIN__ + ccp base_path = "$(programfiles)"; + ccp install_path = opt_install ? "$(base)/Wiimm/SZS" : ProgramDirectory(); + ccp share_path = opt_install ? "$(install)" : std_share_path; + #else + ccp base_path = "/usr/local"; + ccp install_path = opt_install ? "$(base)/bin" : ProgramDirectory(); + ccp share_path = opt_install ? "$(base)/share/szs" : std_share_path; + #endif + + ccp install_config = opt_install ? "" : config->config_file; + + struct assign_t { ccp name; ccp init; ccp *var; }; + const struct assign_t assign_tab[] = + { + { "base", base_path, &config->base_path }, + { "install", install_path, &config->install_path }, + { "config", install_config, &config->install_config }, + { "share", share_path, &config->share_path }, + { "autoadd", "$(share)/auto-add", &config->autoadd_path }, + {0,0,0} + }; + + const struct assign_t *assign; + for ( assign = assign_tab; assign->name; assign++ ) + if (assign->init) + { + exmem_t data = ExMemByString(assign->init); + InsertEML(&paths,assign->name,CPM_LINK,&data,CPM_COPY); + } + + AddStandardSymbolsEML(&paths,false); + //DumpEML(stdout,2,&paths,0); + + + //--- scan file + + const ListDef_t list_def[] = + { + { "paths", 0, 0, &paths }, + {0,0,0,0} + }; + + const enumError err = path && *path + ? ScanSetupFile(0,list_def,path,0,0,silent) + : ERR_OK; + + ResolveAllSymbolsEML(&paths); + //DumpEML(stdout,2,&paths,0); + + + //--- assign known values + + char buf[1000]; + for ( assign = assign_tab; assign->name; assign++ ) + { + if (assign->var) + { + exmem_key_t *ref = FindEML(&paths,assign->name); + if (ref) + { + FreeString(*assign->var); + NormalizeFileName(buf,sizeof(buf),ref->data.data.ptr,true,true,TRSL_REMOVE); + *assign->var = STRDUP(buf); + } + else + *assign->var = EmptyString; + } + } + + ResetEML(&paths); + return err; +} + +/////////////////////////////////////////////////////////////////////////////// + +void SearchConfigHelper ( search_file_list_t *sfl, int stop_mode ) +{ + DASSERT(sfl); + InitializeSearchFile(sfl); + + ccp opt[] = { opt_config, opt_install ? "$(prog)/install.conf" : 0, 0, }; + ccp xdg_home = "szs"; + ccp home = ".szs"; + ccp etc[] = { "wiimm", "" }; + + SearchConfig(sfl,CONFIG_FILE, opt,2, &xdg_home,1, &home,1, etc,2, etc+1,1, 0,0, stop_mode ); + if (logging>3) + DumpSearchFile(stdout,2,sfl,logging>4,"Config search list"); +} + +//----------------------------------------------------------------------------- + +const config_t * GetConfig() +{ + static config_t config; static bool done = false; if (!done) { done = true; - ccp *spath = search_path; - ccp *apath = auto_add_path; - while (*spath) + search_file_list_t sfl; + SearchConfigHelper(&sfl,2); + + uint i; + ccp found = 0; + search_file_t *sf = sfl.list; + for ( i = 0; i < sfl.used; i++, sf++ ) + if ( sf->itype >= INTY_REG ) + { + found = sf->fname; + break; + } + + InitializeConfig(&config); + ScanConfig(&config,found,false); + ResetSearchFile(&sfl); + + if ( verbose >= 3 ) + PrintConfig(stderr,&config,true); + } + + return &config; +} + +//----------------------------------------------------------------------------- + +void PrintConfig ( FILE *f, const config_t *config, bool verbose ) +{ + if ( f && config ) + { + fprintf(f, + "\nConfiguration:\n" + " config file: %s\n" + ,config->config_file ? config->config_file : "" + ); + if (verbose) + fprintf(f, + " base path: %s\n" + " install path: %s\n" + " install config: %s\n" + ,config->base_path + ,config->install_path + ,config->install_config + ); + fprintf(f, + " share path: %s\n" + " auto-add path: %s\n" + ,config->share_path + ,config->autoadd_path + ); + } +} + +//----------------------------------------------------------------------------- + +struct config_offset_t { uint mode; ccp name; uint offset; }; +static const struct config_offset_t config_offset_tab[] = +{ + { 0,"config", offsetof(config_t,config_file) }, + { 1,"base", offsetof(config_t,base_path) }, + { 1,"install", offsetof(config_t,install_path) }, + { 1,"config", offsetof(config_t,install_config) }, + { 1,"share", offsetof(config_t,share_path) }, + { 1,"autoadd", offsetof(config_t,autoadd_path) }, + {0,0} +}; + +//----------------------------------------------------------------------------- + +void PrintConfigScript ( FILE *f, const config_t *config ) +{ + if ( f && config ) + { + PrintScript_t ps; + SetupPrintScriptByOptions(&ps); + ps.f = f; + ps.eq_tabstop = 1; + ps.auto_quote = true; + + PrintScriptVars(&ps,3, + "base=\"%s\"\n" + "install=\"%s\"\n" + "config=\"%s\"\n" + "share=\"%s\"\n" + "autoadd=\"%s\"\n" + ,config->base_path + ,config->install_path + ,config->install_config ? config->install_config : "" + ,config->share_path + ,config->autoadd_path + ); + } +} + +//----------------------------------------------------------------------------- + +void PrintConfigFile ( FILE *f, const config_t *config ) +{ + if ( f && config ) + { + config_t dest; + InitializeConfig(&dest); + + const struct config_offset_t *ptr; + for ( ptr = config_offset_tab; ptr->name; ptr++ ) { - char path_buf[PATH_MAX]; - ccp path = PathCatPP(path_buf,sizeof(path_buf),*spath++,"auto-add"); - if (IsDirectory(path,0)) + if (!ptr->mode) + continue; + + ccp *destval = (ccp*)((char*)&dest + ptr->offset); + + bool done = false; + ccp val = *(ccp*)((char*)config + ptr->offset); + if (val) { - PRINT("AUTO-PATH[%u] = %s\n",(int)(apath-auto_add_path),path); - *apath++ = STRDUP(path); - DASSERT( apath - auto_add_path - < sizeof(auto_add_path)/sizeof(*auto_add_path) ); + const int len = strlen(val); + const struct config_offset_t *ptr2; + for ( ptr2 = ptr-1; ptr2 >= config_offset_tab; ptr2-- ) + { + ccp val2 = *(ccp*)((char*)config + ptr2->offset); + if ( ptr2->mode && val2 ) + { + const int len2 = strlen(val2); + if ( len2 > 1 && ( len2 == len || len2 < len && val[len2] == '/' ) + && !memcmp(val,val2,len2) ) + { + ccp res = PRINTDUP("$(%s)%s",ptr2->name,val+len2); + *destval = QuoteStringCircS(res,EmptyQuote,CHMD__MODERN); + FreeString(res); + done = true; + break; + } + } + } } + + if (!done) + *destval = QuoteStringCircS(val,EmptyQuote,CHMD__MODERN); } - *apath = 0; + + if ( brief_count > 0 ) + fprintf(f,"[PATHS]\n" + "base\t= %s\n" + "install\t= %s\n" + "config\t= %s\n" + "share\t= %s\n" + "autoadd\t= %s\n" + ,dest.base_path + ,dest.install_path + ,dest.install_config + ,dest.share_path + ,dest.autoadd_path + ); + else + fprintf(f,text_config_paths_cr + ,dest.base_path + ,dest.install_path + ,dest.install_config + ,dest.share_path + ,dest.autoadd_path + ); + + ResetConfig(&dest); } +} + +/////////////////////////////////////////////////////////////////////////////// - return auto_add_path[0] != 0; +const StringField_t * GetSearchList() +{ + static StringField_t search_list = {0}; + if (!search_list.field) + { + InitializeStringField(&search_list); + const config_t *config = GetConfig(); + AppendUniqueStringField(&search_list,config->share_path,false); + AppendUniqueStringField(&search_list,std_share_path,false); + AppendUniqueStringField(&search_list,ProgramDirectory(),false); + } + return &search_list; } /////////////////////////////////////////////////////////////////////////////// -bool DefineAutoAddPath ( ccp path ) +ccp autoadd_destination = 0; +static StringField_t opt_autoadd = {0}; + +//----------------------------------------------------------------------------- + +const StringField_t * GetAutoaddList() { - SetupAutoAdd(); - if (path) + static StringField_t autoadd_list = {0}; + if (!autoadd_list.field) { - uint i; - for ( i = 0; i < sizeof(auto_add_path)/sizeof(*auto_add_path); i++ ) + InitializeStringField(&autoadd_list); + + if (autoadd_destination) + AppendUniqueStringField(&autoadd_list,autoadd_destination,false); + + int i; + ccp *str = opt_autoadd.field; + for ( i = 0; i < opt_autoadd.used; i++, str++ ) + AppendUniqueStringField(&autoadd_list,*str,false); + + const config_t *config = GetConfig(); + if (IsDirectory(config->autoadd_path,0)) + AppendUniqueStringField(&autoadd_list,config->autoadd_path,false); + + if (IsDirectory("auto-add",false)) + AppendUniqueStringField(&autoadd_list,"auto-add",false); + + char buf[PATH_MAX]; + const StringField_t *sf = GetSearchList(); + str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) { - FreeString(auto_add_path[i]); - auto_add_path[i] = 0; + PathCatPP(buf,sizeof(buf),*str,"auto-add"); + if (IsDirectory(buf,false)) + AppendUniqueStringField(&autoadd_list,buf,false); } - auto_add_path[0] = STRDUP(path); } + return &autoadd_list; +} + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// auto add support /////////////// +/////////////////////////////////////////////////////////////////////////////// - return auto_add_path[0] != 0; +bool IsAutoAddAvailable() +{ + const StringField_t *al = GetAutoaddList(); + return al->used > 0; +} + +/////////////////////////////////////////////////////////////////////////////// + +void DefineAutoAddPath ( ccp path ) +{ + if (IsDirectory(path,false)) + AppendUniqueStringField(&opt_autoadd,path,false); } /////////////////////////////////////////////////////////////////////////////// @@ -1878,22 +2209,17 @@ s64 FindAutoAdd ( ccp fname, ccp ext, char *buf, uint buf_size ) DASSERT(buf); DASSERT( buf_size > 100 ); - if (!SetupAutoAdd()) - return -1; - - ccp *apath = auto_add_path; - while (*apath) + int i; + const StringField_t *al = GetAutoaddList(); + ccp *str = al->field; + for ( i = 0; i < al->used; i++, str++ ) { - PathCatBufPPE(buf,buf_size,*apath++,fname,ext); + PathCatBufPPE(buf,buf_size,*str,fname,ext); struct stat st; if ( !stat(buf,&st) && S_ISREG(st.st_mode) ) - { - noPRINT("FindAutoAdd(%s) -> %llu %s\n",fname,(u64)st.st_size,buf); return st.st_size; - } } - noPRINT("FindAutoAdd(%s) FAILED\n",fname); *buf = 0; return -1; } @@ -2183,24 +2509,37 @@ size_t ResetSetup /////////////////////////////////////////////////////////////////////////////// -static char * trim_line ( char * ptr, char ** begin ) +static char * trim_line ( char * ptr, bool allow_quote, char ** begin ) { DASSERT(ptr); while ( *ptr > 0 && *ptr <= ' ' ) ptr++; - char *start = ptr; - if (begin) - *begin = ptr; + if ( allow_quote && (*ptr == '"' || *ptr == '\'') ) + { + const int slen = strlen(ptr); + uint scanned_len; + int elen = ScanEscapedString(ptr,slen,ptr,slen,true,-1,&scanned_len); + if (begin) + *begin = ptr; + ptr[elen] = 0; + ptr += scanned_len; + } + else + { + char *start = ptr; + if (begin) + *begin = ptr; - while (*ptr) - ptr++; + while ( *ptr) + ptr++; - ptr--; - while ( *ptr > 0 && *ptr <= ' ' && ptr > start ) ptr--; - *++ptr = 0; + while ( *ptr > 0 && *ptr <= ' ' && ptr > start ) + ptr--; + *++ptr = 0; + } return ptr; } @@ -2208,19 +2547,19 @@ static char * trim_line ( char * ptr, char ** begin ) enumError ScanSetupFile ( - SetupDef_t * sdef, // object list terminated with an element 'name=NULL' - ListDef_t * ldef, // NULL or object list terminated - // with an element 'name=NULL' - ccp path1, // filename of text file, part 1 - ccp path2, // filename of text file, part 2 - SubDir_t * sdir, // not NULL: use it and ignore 'path1' - bool silent // true: suppress error message if file not found + SetupDef_t * sdef, // object list terminated with an element 'name=NULL' + const ListDef_t * ldef, // NULL or object list terminated + // with an element 'name=NULL' + ccp path1, // filename of text file, part 1 + ccp path2, // filename of text file, part 2 + SubDir_t * sdir, // not NULL: use it and ignore 'path1' + bool silent // true: suppress error message if file not found ) { - DASSERT(sdef); DASSERT(path1||path2); - ResetSetup(sdef); + if (sdef) + ResetSetup(sdef); char pathbuf[PATH_MAX]; ccp path; @@ -2265,7 +2604,7 @@ enumError ScanSetupFile if ( *ptr == '[' ) { - ptr = trim_line(ptr,0); + ptr = trim_line(ptr,false,0); if ( ptr[-1] == ']' ) { section_found = true; @@ -2274,6 +2613,10 @@ enumError ScanSetupFile continue; } + if (!sdef) + continue; + + //----- find end of name char * name = ptr; @@ -2284,6 +2627,7 @@ enumError ScanSetupFile char * name_end = ptr; + //----- skip spaces and check for '=' while ( *ptr > 0 && *ptr <= ' ' ) @@ -2303,11 +2647,11 @@ enumError ScanSetupFile if (!item->name) continue; + //----- trim parameter - ptr++; // skip '=' char * param; - ptr = trim_line(ptr,¶m); + trim_line(ptr+1,true,¶m); item->param = STRDUP(param); if (item->factor) @@ -2321,7 +2665,7 @@ enumError ScanSetupFile while ( section_found && ldef ) { char * beg; - char * ptr = trim_line(iobuf,&beg) - 1; + char * ptr = trim_line(iobuf,false,&beg) - 1; if ( *beg != '[' || *ptr != ']' ) break; @@ -2329,19 +2673,22 @@ enumError ScanSetupFile beg++; TRACE("SECTION |%s|\n",beg); StringField_t *sf = 0; + exmem_list_t *eml = 0; bool append = false; - ListDef_t * ld; + const ListDef_t * ld; for ( ld = ldef; ld->name; ld++ ) - if (!strcmp(beg,ld->name)) + if (!strcasecmp(beg,ld->name)) { - sf = ld->sf; + sf = ld->sf; + eml = ld->eml; append = ld->append; break; } + int index = 0; while (fgets(iobuf,sizeof(iobuf)-1,f)) { - char * ptr = trim_line(iobuf,&beg); + char * ptr = trim_line(iobuf,false,&beg); if ( *beg == '[' ) { if ( ptr[-1] == ']' ) @@ -2349,15 +2696,40 @@ enumError ScanSetupFile continue; } - if ( *beg == '.' && beg[1] == '/' ) - beg += 2; - if ( !sf || !*beg || *beg == '#' ) + if ( !*beg || *beg == '#' ) continue; - TRACE("INSERT |%s|\n",beg); - if (append) - AppendStringField(sf,beg,false); - else - InsertStringField(sf,beg,false); + + if (sf) + { + ccp path = beg; + if ( *path == '.' && path[1] == '/' ) + path += 2; + PRINT("INSERT SP |%s|\n",path); + if (append) + AppendStringField(sf,path,false); + else + InsertStringField(sf,path,false); + } + + if (eml) + { + char *eq = strchr(beg,'='); + if (eq) + { + *eq++ = 0; + char *name, *val; + trim_line(beg,false,&name); + trim_line(eq,true,&val); + + StringLowerS(pathbuf,sizeof(pathbuf),name); + exmem_t data = ExMemByString(val); + data.attrib = index++; + if (append) + AppendEML(eml,pathbuf,CPM_COPY,&data,CPM_MOVE); + else + ReplaceEML(eml,pathbuf,CPM_COPY,&data,CPM_MOVE); + } + } } } @@ -2462,7 +2834,7 @@ enumError ScanSetupParam InitializeStringField(&encode_helper); InitializeStringField(&order_helper); - ListDef_t list_def[] = + const ListDef_t list_def[] = { { "include-pattern", 0, &sp->include_pattern }, { "include", 0, &sp->include_name }, @@ -3254,13 +3626,15 @@ void AnalyzeSlotAttrib ( slot_info_t *si, bool reset_si, mem_t attrib ) if ( src[0]=='r' && src[1]>='1' && src[1]<='8' && src[2]>='1' && src[2]<='4' ) { const u16 slot = strtoul(src+1,0,10); - if (!si->have_31_71) + if ( !si->have_31_71 && !si->have_31_42_71 && !si->have_31_62_71 ) { si->race_mode = SIT_RECOMMEND; si->race_slot = slot; StringCopySM(si->race_info,sizeof(si->race_info),src,3); } - else if ( slot == 31 || slot == 71 ) + else if ( slot == 31 || slot == 71 + || slot == 42 && si->have_31_42_71 + || slot == 62 && si->have_31_62_71 ) { si->race_mode = SIT_MANDATORY; si->race_slot = slot; @@ -3326,6 +3700,41 @@ void AnalyzeSlotAttrib ( slot_info_t *si, bool reset_si, mem_t attrib ) StringCopySM(si->arena_info,sizeof(si->arena_info),src,5); } break; + + case 8: + if (!memcmp(src,"31+42+71",8)) + { + si->have_31_42_71 = true; + if ( si->race_mode != SIT_MANDATORY3 + && (si->race_slot == 31 || si->race_slot == 42 || si->race_slot == 71 )) + { + si->race_mode = SIT_MANDATORY; + snprintf(si->race_info,sizeof(si->race_info),"%u",si->race_slot); + } + else + { + si->race_mode = SIT_MANDATORY3; + si->race_slot = 31; + StringCopySM(si->race_info,sizeof(si->race_info),src,8); + } + } + else if (!memcmp(src,"31+62+71",8)) + { + si->have_31_62_71 = true; + if ( si->race_mode != SIT_MANDATORY3 + && (si->race_slot == 31 || si->race_slot == 62 || si->race_slot == 71 )) + { + si->race_mode = SIT_MANDATORY; + snprintf(si->race_info,sizeof(si->race_info),"%u",si->race_slot); + } + else + { + si->race_mode = SIT_MANDATORY3; + si->race_slot = 31; + StringCopySM(si->race_info,sizeof(si->race_info),src,8); + } + } + break; } } } @@ -3386,7 +3795,7 @@ void FinalizeSlotInfo ( slot_info_t *si, bool minus_for_empty ) //--- create slot info - char slot_attrib[20], *dest = slot_attrib, *end = slot_attrib + sizeof(slot_attrib); + char slot_attrib[24], *dest = slot_attrib, *end = slot_attrib + sizeof(slot_attrib); if (si->race_info[0]) dest = StringCat2E(dest,end,",",si->race_info); if (si->arena_info[0]) diff --git a/project/src/lib-kcl.c b/project/src/lib-kcl.c index 1257ef0..6c4de32 100644 --- a/project/src/lib-kcl.c +++ b/project/src/lib-kcl.c @@ -3697,7 +3697,7 @@ enumError ScanTextKCL && !k && (KCL_MODE & KCLMD_AUTO) ) { - PRINT1("NORMAL FOUND: %u\n",idx-1); + PRINT("NORMAL FOUND: %u\n",idx-1); norm = idx - 1; } } diff --git a/project/src/lib-kmp-draw.c b/project/src/lib-kmp-draw.c index 11d6293..23f573b 100644 --- a/project/src/lib-kmp-draw.c +++ b/project/src/lib-kmp-draw.c @@ -2466,7 +2466,7 @@ enumError DrawPosFile ( DrawKCL_t *draw, pos_file_t *pf ) bool old; ParamFieldItem_t *it - = FindInsertParamField(&pos_autocolor,cols[pp->autocolor],false,&old); + = FindInsertParamField(&pos_autocolor,cols[pp->autocolor],false,0,&old); if (it) { if (!old) diff --git a/project/src/lib-kmp-pflags.c b/project/src/lib-kmp-pflags.c index f62b246..9e3e674 100644 --- a/project/src/lib-kmp-pflags.c +++ b/project/src/lib-kmp-pflags.c @@ -320,10 +320,10 @@ uint CountDefObjUsage ( const kmp_t *kmp, u16 obj_id ) ccp GetDefObjConditionName ( u16 cond ) { - const gobj_cond_ref_t *rc; - for ( rc = cond_ref_tab; rc->ref_id; rc++ ) - if ( rc->cond_mask == cond && !(rc->option & 4) ) - return PrintCircBuf("C$%s",rc->name); + const gobj_cond_ref_t *gcr; + for ( gcr = cond_ref_tab; gcr->ref_id; gcr++ ) + if ( gcr->cond_mask == cond && !(gcr->option & 4) ) + return PrintCircBuf("C$%s",gcr->name); return PrintCircBuf("0x%04x",cond); } diff --git a/project/src/lib-kmp.c b/project/src/lib-kmp.c index 5ffe9f0..7c39d97 100644 --- a/project/src/lib-kmp.c +++ b/project/src/lib-kmp.c @@ -1257,7 +1257,7 @@ void SetupClassNamePH const struct inttab_t *ptr; for ( ptr = inttab; ptr->name; ptr++ ) { - ParamFieldItem_t *it = FindInsertParamField(&ph->class_name,ptr->name,false,0); + ParamFieldItem_t *it = FindInsertParamField(&ph->class_name,ptr->name,false,0,0); DASSERT(it); it->num = ptr->val; } @@ -1285,7 +1285,7 @@ int InsertClassNamePH SetupClassNamePH(ph); bool old_found; - ParamFieldItem_t *it = FindInsertParamField(&ph->class_name,cname,false,&old_found); + ParamFieldItem_t *it = FindInsertParamField(&ph->class_name,cname,false,0,&old_found); DASSERT(it); if (!old_found) { @@ -1489,7 +1489,7 @@ void RenameGroupKMP // /////////////////////////////////////////////////////////////////////////////// -/////////////// KMP pathes /////////////// +/////////////// KMP paths /////////////// /////////////////////////////////////////////////////////////////////////////// typedef struct kmp_link_t @@ -5755,12 +5755,14 @@ void EvaluateUsedPosObj ( kmp_usedpos_obj_t *obj ) value = temp; const float fail = obj->allowed.v[i]; + const float err = fail - 2500.0; const float warn = fail - 5000.0; const float hint = fail - 10000.0; - if ( rating < WLEVEL_FAIL && value > fail ) rating = WLEVEL_FAIL; - else if ( rating < WLEVEL_WARN && value > warn ) rating = WLEVEL_WARN; - else if ( rating < WLEVEL_HINT && value > hint ) rating = WLEVEL_HINT; + if ( rating < WLEVEL_FAIL && value > fail ) rating = WLEVEL_FAIL; + else if ( rating < WLEVEL_ERROR && value > err ) rating = WLEVEL_ERROR; + else if ( rating < WLEVEL_WARN && value > warn ) rating = WLEVEL_WARN; + else if ( rating < WLEVEL_HINT && value > hint ) rating = WLEVEL_HINT; if ( i == 1 ) { @@ -6050,7 +6052,14 @@ void CheckWarnKMP ( kmp_t *kmp, kmp_usedpos_t *up ) } CheckUsedPos(kmp,up); - if ( up->suggest->max_rating >= WLEVEL_WARN ) + #if 0 + PRINT1("O: "); PrintUsedPosObj(stderr,0,&up->orig); + PRINT1("OL: "); PrintUsedPosObj(stderr,0,&up->orig_lex); + PRINT1("C: "); PrintUsedPosObj(stderr,0,&up->center); + PRINT1("CL: "); PrintUsedPosObj(stderr,0,&up->center_lex); + PRINT1("S: "); PrintUsedPosObj(stderr,0,up->suggest); + #endif + if ( up->orig_lex.max_rating >= WLEVEL_ERROR ) kmp->warn_bits |= 1 << WARNSZS_ITEMPOS; //------------------------------------------------------------------------- diff --git a/project/src/lib-lecode.c b/project/src/lib-lecode.c index 0222315..05d3c00 100644 --- a/project/src/lib-lecode.c +++ b/project/src/lib-lecode.c @@ -61,11 +61,8 @@ OffOn_t opt_200cc = OFFON_AUTO; OffOn_t opt_perfmon = OFFON_AUTO; OffOn_t opt_custom_tt = OFFON_AUTO; OffOn_t opt_xpflags = OFFON_AUTO; -OffOn_t opt_speedo = OFFON_AUTO; - -int opt_reserved_1b9 = -1; -int opt_reserved_1ba = -1; -int opt_reserved_1bb = -1; +int opt_speedo = OFFON_AUTO; +int opt_lecode_debug = OFFON_AUTO; bool opt_complete = false; @@ -154,11 +151,39 @@ int ScanOptXPFlags ( ccp arg ) } /////////////////////////////////////////////////////////////////////////////// +// [[speedo_mode_t]] [[copy-lecode]] copy changes to LE-CODE + +typedef enum speedo_mode_t +{ + SPEEDO_OFF = 0, + SPEEDO_ON, + SPEEDO_FRACTION1, + SPEEDO_FRACTION2, + SPEEDO_FRACTION3, + SPEEDO_MAX = SPEEDO_FRACTION3, // max allowed value +} +speedo_mode_t; + +//----------------------------------------------------------------------------- int ScanOptSpeedometer ( ccp arg ) { + const KeywordTab_t keytab[] = + { + { OFFON_OFF, "OFF", "-1", 0 }, + { OFFON_AUTO, "AUTO", 0, 0 }, + { SPEEDO_ON, "ON", 0, 0 }, + { SPEEDO_ON, "FORCE", 0, 0 }, // legacy, [[obsolete]], remove in 2022 + { SPEEDO_ON, "0DIGITS", "0", 0 }, + { SPEEDO_FRACTION1,"FRACTION", 0, 0 }, + { SPEEDO_FRACTION1,"1DIGITS", "1", 0 }, + { SPEEDO_FRACTION2,"2DIGITS", "2", 0 }, + { SPEEDO_FRACTION3,"3DIGITS", "3", 0 }, + { 0,0,0,0 } + }; + const int stat - = ScanKeywordOffAutoOn(arg,OFFON_ON,OFFON_ON,"Option --speedo"); + = ScanKeywordOffAutoOnEx(keytab,arg,OFFON_ON,0,"Option --speedo"); if ( stat == OFFON_ERROR ) return 1; @@ -167,28 +192,94 @@ int ScanOptSpeedometer ( ccp arg ) return 0; } +//----------------------------------------------------------------------------- + +ccp GetLecodeSpeedoName ( speedo_mode_t mode ) +{ + switch (mode) + { + case SPEEDO_OFF: break; + case SPEEDO_ON: return "0"; + case SPEEDO_FRACTION1: return "1"; + case SPEEDO_FRACTION2: return "2"; + case SPEEDO_FRACTION3: return "3"; + // no default! => compiler warnings for missed values + } + return "OFF"; +} + /////////////////////////////////////////////////////////////////////////////// -int ScanOptReserved_1b9 ( ccp arg ) +ccp GetLecodeDebugName ( le_debug_mode_t mode ) { - opt_reserved_1b9 = str2l(arg,0,10); - PRINT("RESERVED_1B9=%d\n",opt_reserved_1b9); - return 0; + switch (mode) + { + case DEBUGMD_OFF: + case DEBUGMD__N: break; + case DEBUGMD_ENABLED: return "ENABLED"; + case DEBUGMD_DEBUG1: + case DEBUGMD_DEBUG2: + case DEBUGMD_DEBUG3: + case DEBUGMD_DEBUG4: return PrintCircBuf("%u",mode-DEBUGMD_DEBUG1+1); + // no default! => compiler warnings for missed values + } + return "OFF"; } -int ScanOptReserved_1ba ( ccp arg ) +//----------------------------------------------------------------------------- + +ccp GetLecodeDebugInfo ( le_debug_mode_t mode ) { - opt_reserved_1ba = str2l(arg,0,10); - PRINT("RESERVED_1BA=%d\n",opt_reserved_1ba); + switch (mode) + { + case DEBUGMD_OFF: return "disabled"; + case DEBUGMD_ENABLED: return "enabled but hidden"; + case DEBUGMD_DEBUG1: + case DEBUGMD_DEBUG2: + case DEBUGMD_DEBUG3: + case DEBUGMD_DEBUG4: return PrintCircBuf("view DEBUG-%u",mode-DEBUGMD_DEBUG1+1); + case DEBUGMD__N: break; + // no default! => compiler warnings for missed values + } + return "?"; +} + +//----------------------------------------------------------------------------- + +int ScanOptDebug ( ccp arg ) +{ + const KeywordTab_t keytab[] = + { + { OFFON_OFF, "OFF", "-1", 0 }, + { OFFON_AUTO, "AUTO", "0", 0 }, + { DEBUGMD_ENABLED,"USER", "1", 0 }, + { DEBUGMD_DEBUG1, "DEBUG1", "D1", 0 }, + { DEBUGMD_DEBUG2, "DEBUG2", "D2", 0 }, + { DEBUGMD_DEBUG3, "DEBUG3", "D3", 0 }, + { DEBUGMD_DEBUG4, "DEBUG4", "D4", 0 }, + { 0,0,0,0 } + }; + + const int stat + = ScanKeywordOffAutoOnEx(keytab,arg,OFFON_ON,DEBUGMD__N-1,"Option --debug"); + if ( stat == OFFON_ERROR ) + return 1; + + opt_lecode_debug = stat; + PRINT("LE-DEBUG=%d (%s)\n",opt_lecode_debug,GetLecodeDebugInfo(opt_lecode_debug)); return 0; } +/////////////////////////////////////////////////////////////////////////////// + +#if 0 int ScanOptReserved_1bb ( ccp arg ) { opt_reserved_1bb = str2l(arg,0,10); - PRINT("RESERVED_1BB=%d\n",opt_reserved_1b9); + PRINT("RESERVED_1BB=%d\n",opt_reserved_1bb); return 0; } +#endif /////////////////////////////////////////////////////////////////////////////// @@ -287,12 +378,273 @@ const VarMap_t * SetupVarsLECODE() { static VarMap_t vm = {0}; if (!vm.used) + { DefineMkwVars(&vm); + //DefineParserFuncTab(lex_func_tab,FF_LPAR); + DefineParserVars(&vm); + + //--- setup integer variables + + struct inttab_t { ccp name; int val; }; + static const struct inttab_t inttab[] = + { + { "DEBUG$OFF", PREDEBUG_OFF }, + { "DEBUG$CLEAR", PREDEBUG_CLEAR }, + { "DEBUG$STANDARD", PREDEBUG_STANDARD }, + { "DEBUG$OPPONENT", PREDEBUG_OPPONENT }, + { "DEBUG$VERTICAL", PREDEBUG_VERTICAL }, + + { "DEBUG$ENABLED", DEBUGMD_ENABLED }, + { "DEBUG$0", DEBUGMD_ENABLED }, + { "DEBUG$1", DEBUGMD_DEBUG1 }, + { "DEBUG$2", DEBUGMD_DEBUG2 }, + { "DEBUG$3", DEBUGMD_DEBUG3 }, + { "DEBUG$4", DEBUGMD_DEBUG4 }, + + { "SPEEDO$OFF", SPEEDO_OFF }, + { "SPEEDO$0", SPEEDO_ON }, + { "SPEEDO$1", SPEEDO_FRACTION1 }, + { "SPEEDO$2", SPEEDO_FRACTION2 }, + { "SPEEDO$3", SPEEDO_FRACTION3 }, + + {0,0} + }; + + const struct inttab_t * ip; + for ( ip = inttab; ip->name; ip++ ) + DefineIntVar(&vm,ip->name,ip->val); + } return &vm; } // /////////////////////////////////////////////////////////////////////////////// +/////////////// LE-CODE Debug /////////////// +/////////////////////////////////////////////////////////////////////////////// + +ccp GetDebugModeSummary ( const lecode_debug_info_t *ldi ) +{ + DASSERT(ldi); + return PrintCircBuf("I=%d,%d, M:%02x,%02x, %s=%u", + ldi->index, ldi->filter_active, ldi->mode, ldi->relevant, + ldi->name ? ldi->name : "-", ldi->value ); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool GetFirstDebugMode + ( lecode_debug_info_t *ldi, lecode_debug_t mode, bool filter_active ) +{ + DASSERT(ldi); + memset(ldi,0,sizeof(*ldi)); + ldi->mode = mode & LEDEB__ALL; + ldi->filter_active = filter_active; + + return GetNextDebugMode(ldi); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool GetNextDebugMode ( lecode_debug_info_t *ldi ) +{ + struct tab_t + { + lecode_debug_t mode; + int shift; + const char name[12]; + }; + + static const struct tab_t tab[] = + { + { LEDEB_ENABLED, 0, "ENABLED" }, + { LEDEB_OPPONENT, 0, "OPPONENT" }, + { LEDEB_SPACE, 0, "SPACE" }, + { LEDEB_POSITION, 0, "POSITION" }, + { LEDEB_CHECK_POINT, LEDEB_S_CHECK_POINT, "CHECK-POINT" }, + { LEDEB_RESPAWN, 0, "RESPAWN" }, + { LEDEB_LAP_POS, 0, "LAP-POS" }, + }; + + while ( ldi->index >= 0 && ldi->index < sizeof(tab)/sizeof(*tab) ) + { + const struct tab_t *ptr = tab + ldi->index++; + if ( ldi->filter_active && !(ptr->mode&ldi->mode) ) + continue; + + ldi->relevant = ptr->mode; + ldi->name = ptr->name; + ldi->value = ldi->mode & ptr->mode; + if (ptr->shift) + ldi->value >>= ptr->shift; + else + ldi->value = ldi->value != 0; + return true; + } + + ldi->index = -1; + ldi->relevant = 0; + ldi->name = 0; + ldi->value = 0; + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +lecode_debug_t DecodeLecodeDebug ( lecode_debug_ex_t *lde, lecode_debug_t mode ) +{ + DASSERT(lde); + memset(lde,0,sizeof(*lde)); + + mode &= LEDEB__ALL; + lde->mode = mode; + lde->enabled = ( mode & LEDEB_ENABLED ) > 0; + lde->opponent = ( mode & LEDEB_OPPONENT ) > 0; + lde->space = ( mode & LEDEB_SPACE ) > 0; + lde->position = ( mode & LEDEB_POSITION ) > 0; + lde->check_point = mode >> LEDEB_S_CHECK_POINT & LEDEB_M_CHECK_POINT; + lde->respawn = ( mode & LEDEB_RESPAWN ) > 0; + lde->lap_pos = ( mode & LEDEB_LAP_POS ) > 0; + + lde->have_output = isDebugModeOutput(mode); + lde->is_active = isDebugModeActive(mode); + + return mode; +} + +/////////////////////////////////////////////////////////////////////////////// + +lecode_debug_t EncodeLecodeDebug ( lecode_debug_ex_t *lde ) +{ + DASSERT(lde); + + lecode_debug_t mode = ( lde->check_point & LEDEB_M_CHECK_POINT ) << LEDEB_S_CHECK_POINT; + if ( lde->enabled ) mode |= LEDEB_ENABLED; + if ( lde->opponent ) mode |= LEDEB_OPPONENT; + if ( lde->space ) mode |= LEDEB_SPACE; + if ( lde->position ) mode |= LEDEB_POSITION; + if ( lde->respawn ) mode |= LEDEB_RESPAWN; + if ( lde->lap_pos ) mode |= LEDEB_LAP_POS; + + return DecodeLecodeDebug(lde,mode); // normalize all settings +} + +/////////////////////////////////////////////////////////////////////////////// + +ccp GetPredefDebugName ( predef_debug_t pd_mode ) +{ + switch ( pd_mode ) + { + case PREDEBUG_OFF: break; + case PREDEBUG_CLEAR: return "CLEAR"; + case PREDEBUG_STANDARD: return "STANDARD"; + case PREDEBUG_OPPONENT: return "OPPONENT"; + case PREDEBUG_VERTICAL: return "VERTICAL"; + // no default! => compiler warnings for missed values + } + return "OFF"; +} + +/////////////////////////////////////////////////////////////////////////////// + +bool SetupLecodeDebugLPAR +( + le_lpar_t *lpar, // LE-CODE parameters + uint config, // configuration index 0.. + uint setup_mode, // setup mode, one of PREDEBUG_* + int *hide_speedo // if not NULL: store new mode here +) +{ + DASSERT(lpar); + DASSERT( config >= 0 && config < DEBUGMD__N-DEBUGMD_DEBUG1 ); + + + //--- setup data table + + struct setup_t + { + u16 predef; + s16 line; + u32 mode; + }; + + static const struct setup_t setup_tab[] = + { + { PREDEBUG_CLEAR, 0, 0 }, + + { PREDEBUG_STANDARD, 1, LEDEB__STD }, + + { PREDEBUG_OPPONENT, 1, LEDEB__STD }, + { PREDEBUG_OPPONENT, 2, LEDEB__STD|LEDEB_OPPONENT }, + + { PREDEBUG_VERTICAL,-1, 0 }, // hide speedo + { PREDEBUG_VERTICAL, 1, LEDEB_CHECK_POINT }, + { PREDEBUG_VERTICAL, 2, LEDEB_RESPAWN }, + { PREDEBUG_VERTICAL, 3, LEDEB_LAP_POS }, + { PREDEBUG_VERTICAL, 4, LEDEB_POSITION }, + + {0,0,0} + }; + + const struct setup_t *ptr; + for ( ptr = setup_tab; ptr->predef; ptr++ ) + { + if ( ptr->predef == setup_mode ) + { + lpar->debug_predef[config] = setup_mode; + int my_hide_speedo = 0; + + u32 *debug_list = lpar->debug[config]; + for ( int line = 0; line < LEDEB__N_LINE; line++ ) + debug_list[line] = LEDEB_ENABLED; + + for ( ; ptr->predef == setup_mode; ptr++ ) + { + if ( ptr->line < 0 ) + my_hide_speedo++; + else + debug_list[ptr->line] = ptr->mode | LEDEB_ENABLED; + } + + if (hide_speedo) + *hide_speedo = my_hide_speedo; + + const u8 hide_mask = 1 << config; + if ( my_hide_speedo > 0 ) + lpar->no_speedo_if_debug |= hide_mask; + else + lpar->no_speedo_if_debug &= ~hide_mask; + + return true; + } + } + return false; +} + +/////////////////////////////////////////////////////////////////////////////// + +bool SetupLecodeDebugIfEmptyLPAR ( le_lpar_t *lpar ) +{ + DASSERT(lpar); + + for ( int config = 0; config < LEDEB__N_CONFIG; config++ ) + for ( int line = 0; line < LEDEB__N_LINE; line++ ) + if ( isDebugModeOutput(lpar->debug[config][line]) ) + return false; + + for ( int config = 0; config < LEDEB__N_CONFIG; config++ ) + for ( int line = 0; line < LEDEB__N_LINE; line++ ) + lpar->debug[config][line] = LEDEB_ENABLED; + + SetupLecodeDebugLPAR(lpar,0,PREDEBUG_STANDARD,0); + SetupLecodeDebugLPAR(lpar,1,PREDEBUG_OPPONENT,0); + SetupLecodeDebugLPAR(lpar,2,PREDEBUG_VERTICAL,0); + + return true; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// LPAR support /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -306,11 +658,13 @@ lpar_mode_t CalcCurrentLparMode ( const le_lpar_t * lp, bool use_limit_param ) return temp > lp->limit_mode ? temp : lp->limit_mode; } - if ( lp->enable_perfmon > 1 || lp->enable_speedo > 1 ) + if ( lp->enable_perfmon > 1 ) return LPM_EXPERIMENTAL; - return lp->enable_perfmon || !lp->enable_xpflags - ? LPM_TESTING : LPM_PRODUCTIVE; + return lp->enable_perfmon + || !lp->enable_xpflags + || lp->enable_speedo > SPEEDO_FRACTION1 + ? LPM_TESTING : LPM_PRODUCTIVE; } //----------------------------------------------------------------------------- @@ -343,15 +697,13 @@ bool LimitToLparMode ( le_lpar_t * lp, lpar_mode_t lpmode ) { lp->enable_perfmon = 0; modified = true; } if (!lp->enable_xpflags) { lp->enable_xpflags = 1; modified = true; } - if ( lp->enable_speedo > 1 ) - { lp->enable_speedo = 1; modified = true; } + if ( lp->enable_speedo > SPEEDO_MAX ) + { lp->enable_speedo = SPEEDO_MAX; modified = true; } } else if ( lpmode == LPM_TESTING ) { if ( lp->enable_perfmon > 1 ) { lp->enable_perfmon = 1; modified = true; } - if ( lp->enable_speedo > 1 ) - { lp->enable_speedo = 1; modified = true; } } return modified; @@ -546,6 +898,8 @@ static void NormalizeLPAR ( le_lpar_t * lp ) { DASSERT(lp); + SetupLecodeDebugIfEmptyLPAR(lp); + int sum = lp->engine[0] + lp->engine[1] + lp->engine[2]; if ( sum != 0 && sum != 100 ) { @@ -562,9 +916,13 @@ static void NormalizeLPAR ( le_lpar_t * lp ) lp->enable_perfmon = lp->enable_perfmon < 2 ? lp->enable_perfmon : 2; lp->enable_custom_tt = lp->enable_custom_tt > 0; lp->enable_xpflags = lp->enable_xpflags > 0; - lp->enable_speedo = lp->enable_speedo < 2 ? lp->enable_speedo : 2; + lp->enable_speedo = lp->enable_speedo < SPEEDO_MAX ? lp->enable_speedo : SPEEDO_MAX; lp->block_track = lp->block_track < LE_MAX_BLOCK_TRACK ? lp->block_track : LE_MAX_BLOCK_TRACK; + + for ( int c = 0; c < LEDEB__N_CONFIG; c++ ) + for ( int l = 0; l < LEDEB__N_LINE; l++ ) + lp->debug[c][l] &= LEDEB__ALL; } /////////////////////////////////////////////////////////////////////////////// @@ -595,6 +953,21 @@ static void CopyLPAR2Data ( le_analyse_t * ana ) if ( offsetof(le_binpar_v1_t,enable_speedo) < ana->param_size ) h->enable_speedo = lp->enable_speedo; + if ( offsetof(le_binpar_v1_t,enable_speedo) < ana->param_size ) + h->no_speedo_if_debug = lp->no_speedo_if_debug; + + if ( offsetof(le_binpar_v1_t,debug_mode) < ana->param_size ) + h->debug_mode = lp->debug_mode; + + if ( offsetof(le_binpar_v1_t,item_cheat) < ana->param_size ) + h->item_cheat = lp->item_cheat; + + if ( offsetof(le_binpar_v1_t,debug_predef[LEDEB__N_CONFIG]) <= ana->param_size ) + memcpy( h->debug_predef,lp->debug_predef,sizeof(h->debug_predef)); + + if ( offsetof(le_binpar_v1_t,debug[LEDEB__N_CONFIG][0]) <= ana->param_size ) + write_be32n( h->debug[0], lp->debug[0], LEDEB__N_CONFIG*LEDEB__N_LINE ); + if ( offsetof(le_binpar_v1_t,block_track) < ana->param_size ) h->block_track = lp->block_track; @@ -603,15 +976,6 @@ static void CopyLPAR2Data ( le_analyse_t * ana ) if ( offsetof(le_binpar_v1_t,chat_mode_2) + sizeof(h->chat_mode_2) <= ana->param_size ) write_be16n(h->chat_mode_2,lp->chat_mode_2,BMG_N_CHAT); - - // reserved (for future extensions) - - if ( offsetof(le_binpar_v1_t,reserved_1b9) < ana->param_size ) - h->reserved_1b9 = lp->reserved_1b9; - if ( offsetof(le_binpar_v1_t,reserved_1ba) < ana->param_size ) - h->reserved_1ba = lp->reserved_1ba; - if ( offsetof(le_binpar_v1_t,reserved_1bb) < ana->param_size ) - h->reserved_1bb = lp->reserved_1bb; } // @@ -620,7 +984,7 @@ static void CopyLPAR2Data ( le_analyse_t * ana ) enumError SaveTextLPAR ( - const le_lpar_t *lpar, // LE-CODE parameters + le_lpar_t *lpar, // LE-CODE parameters ccp fname, // filename of destination bool set_time // true: set time stamps ) @@ -648,6 +1012,7 @@ enumError SaveTextLPAR //--- print section + SetupLecodeDebugIfEmptyLPAR(lpar); err = WriteSectionLPAR(F.f,lpar); @@ -703,9 +1068,6 @@ enumError WriteSectionLPAR fprintf(f,"\r\n#\f\r\n%.79s\r\n\r\n[LECODE-PARAMETERS]\r\n",Hash200); const bool verbose = print_header && !brief_count && !export_count; - const bool have_reserved = lpar->reserved_1b9 - || lpar->reserved_1ba - || lpar->reserved_1bb; if (verbose) { @@ -716,13 +1078,11 @@ enumError WriteSectionLPAR ,lpar->enable_perfmon ,lpar->enable_custom_tt ,lpar->enable_xpflags - ,lpar->enable_speedo - ,LE_MAX_BLOCK_TRACK - ,lpar->block_track + ,LE_MAX_BLOCK_TRACK,lpar->block_track + ,GetLecodeSpeedoName(lpar->enable_speedo) + ,GetLecodeDebugName(lpar->debug_mode) + ,lpar->item_cheat ); - - if (have_reserved) - fputs(text_lpar_sect_reserved_cr,f); } else { @@ -734,25 +1094,23 @@ enumError WriteSectionLPAR "PERF-MONITOR = %u\r\n" "CUSTOM-TT = %u\r\n" "XPFLAGS = %u\r\n" - "SPEEDOMETER = %u\r\n" "BLOCK-TRACK = %u\r\n" + "SPEEDOMETER = SPEEDO$%s\r\n" + "DEBUG = DEBUG$%s\r\n" + "ITEM-CHEATS = %u\r\n" ,GetLparModeName(CalcCurrentLparMode(lpar,true),export_count>0) ,lpar->engine[0],lpar->engine[1],lpar->engine[2] ,lpar->enable_200cc ,lpar->enable_perfmon ,lpar->enable_custom_tt ,lpar->enable_xpflags - ,lpar->enable_speedo ,lpar->block_track + ,GetLecodeSpeedoName(lpar->enable_speedo) + ,GetLecodeDebugName(lpar->debug_mode) + ,lpar->item_cheat ); - - if (have_reserved) - fputs("\r\n",f); } - if ( lpar->reserved_1b9 > 0 ) fprintf(f,"RESERVED-1B9\t= %u\r\n",lpar->reserved_1b9); - if ( lpar->reserved_1ba > 0 ) fprintf(f,"RESERVED-1BA\t= %u\r\n",lpar->reserved_1ba); - if ( lpar->reserved_1bb > 0 ) fprintf(f,"RESERVED-1BB\t= %u\r\n",lpar->reserved_1bb); //--- chat modes @@ -770,8 +1128,8 @@ enumError WriteSectionLPAR fputs(text_lpar_sect_chat_example_cr,f); } - int i, last_group = -1; - for ( i = 0; i < BMG_N_CHAT; i++ ) + int last_group = -1; + for ( int i = 0; i < BMG_N_CHAT; i++ ) { const u16 mode1 = lpar->chat_mode_1[i]; const u16 mode2 = lpar->chat_mode_2[i]; @@ -786,6 +1144,65 @@ enumError WriteSectionLPAR fprintf(f,"%s\n",PrintChatMode(i,mode1,mode2,export_count)); } } + + + //--- debug modes + + if (verbose) + fprintf(f,text_lpar_sect_debug_docu_cr, + LEDEB__N_LINE, LEDEB__N_LINE-1, LEDEB__N_LINE-1 ); + + for ( int conf = 0; conf < LEDEB__N_CONFIG; conf++ ) + { + fprintf(f,"\r\n#\f\r\n%.79s\r\n\r\n[DEBUG-%u]\r\n",Hash200,conf+1); + if (verbose) + fputs("# See section [DEBUG-DOCU] for details.\n",f); + + fprintf(f,"\r\n" + "SETUP\t\t= DEBUG$%s\n" + "HIDE-SPEEDO\t= %u\n", + GetPredefDebugName(lpar->debug_predef[conf]), + ( 1<<conf & lpar->no_speedo_if_debug ) != 0 ); + + int done = 0; + for ( int line = 0; line <= LEDEB__N_LINE; line++ ) + { + int idx; + lecode_debug_t mode; + + if ( line < LEDEB__N_LINE ) + { + mode = lpar->debug[conf][line]; + if (!isDebugModeOutput(mode)) + continue; + idx = line; + } + else + { + if (done) + break; + mode = 0; + idx = 1; + } + done++; + + bool line_printed = false; + lecode_debug_info_t ldi; + for ( GetFirstDebugMode(&ldi,mode,!verbose); ldi.name; GetNextDebugMode(&ldi) ) + { + if (!line_printed) + { + fprintf(f,"\nLINE\t\t= %u\r\n",idx); + line_printed = true; + } + fprintf(f,"%s%.*s= %u\r\n", + ldi.name, + (23-(int)strlen(ldi.name))/8, Tabs20, + ldi.value ); + } + } + } + return ERR_OK; } @@ -983,13 +1400,21 @@ enumError AnalyseLEBinary le_binpar_v1_1b8_t *p = (le_binpar_v1_1b8_t*)(data+off_param); be16n(ana->lpar.chat_mode_2,p->chat_mode_2,BMG_N_CHAT); } + if ( param_size >= sizeof(le_binpar_v1_1bc_t) ) { le_binpar_v1_1bc_t *p = (le_binpar_v1_1bc_t*)(data+off_param); ana->lpar.enable_speedo = p->enable_speedo; - ana->lpar.reserved_1b9 = p->reserved_1b9; - ana->lpar.reserved_1ba = p->reserved_1ba; - ana->lpar.reserved_1bb = p->reserved_1bb; + ana->lpar.no_speedo_if_debug= p->no_speedo_if_debug; + ana->lpar.debug_mode = p->debug_mode; + } + + if ( param_size >= sizeof(le_binpar_v1_260_t) ) + { + le_binpar_v1_260_t *p = (le_binpar_v1_260_t*)(data+off_param); + memcpy(ana->lpar.debug_predef,p->debug_predef,sizeof(ana->lpar.debug_predef)); + be32n(ana->lpar.debug[0],p->debug[0],LEDEB__N_CONFIG*LEDEB__N_LINE); + ana->lpar.item_cheat = p->item_cheat; } break; @@ -1834,23 +2259,42 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) if ( ana->param_size >= sizeof(le_binpar_v1_1bc_t) ) { + ccp comment; + char buf[50]; + if ( h->enable_speedo < SPEEDO_ON ) + comment = " = disabled"; + else if ( h->enable_speedo <= SPEEDO_MAX ) + { + snprintf(buf,sizeof(buf)," = format \"%.*f km/h\"", + h->enable_speedo - SPEEDO_ON, 123.12345 ); + comment = buf; + } + else + comment = ""; + fprintf(f, - "%*s" "Speedometer: %u = %s\n" - ,indent,"", h->enable_speedo, - h->enable_speedo > 1 ? "Wii(U)+Dolphin" - : h->enable_speedo ? "Wii(U) only" :"disabled" + "%*s" "Speedometer: %u%s\n", + indent,"", h->enable_speedo, comment ); + } + + if ( ana->param_size >= sizeof(le_binpar_v1_260_t) ) + { + fprintf(f, + "%*s" "Debug mode: %u = %s\n" + "%*s" "Item cheat: %u = %s\n" + ,indent,"", h->debug_mode, GetLecodeDebugInfo(h->debug_mode) + ,indent,"", h->item_cheat, h->item_cheat ? "enabled" : "disabled" ); + } - if (h->reserved_1b9) - fprintf(f,"%*s" "Reserved 1B9: %u\n", - indent,"", h->reserved_1b9 ); - if (h->reserved_1ba) - fprintf(f,"%*s" "Reserved 1BA: %u\n", - indent,"", h->reserved_1ba ); + #if 0 // for later use + if ( ana->param_size >= sizeof(le_binpar_v1_1bc_t) ) + { if (h->reserved_1bb) fprintf(f,"%*s" "Reserved 1BB: %u\n", indent,"", h->reserved_1bb ); } + #endif #if defined(DEBUG) && defined(TEST) && 0 const uint po = ana->param_offset; @@ -1870,7 +2314,6 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) ); #endif - const bool hard_coded = ana->param_size < sizeof(le_binpar_v1_f8_t); const u16 *chat_mode_1 = hard_coded ? chat_mode_legacy : ana->lpar.chat_mode_1; const u16 *chat_mode_2 = hard_coded ? chat_mode_legacy : ana->lpar.chat_mode_2; @@ -2328,11 +2771,11 @@ void PatchLPAR ( le_lpar_t * lp ) if ( opt_xpflags != OFFON_AUTO ) lp->enable_xpflags = opt_xpflags >= OFFON_ON; if ( opt_speedo != OFFON_AUTO ) - lp->enable_speedo = opt_speedo >= OFFON_FORCE ? 2 : opt_speedo >= OFFON_ON; - - if ( opt_reserved_1b9 >= 0 ) lp->reserved_1b9 = opt_reserved_1b9; - if ( opt_reserved_1ba >= 0 ) lp->reserved_1ba = opt_reserved_1ba; - if ( opt_reserved_1bb >= 0 ) lp->reserved_1bb = opt_reserved_1bb; + lp->enable_speedo = opt_speedo >= SPEEDO_MAX ? SPEEDO_MAX + : opt_speedo >= SPEEDO_ON ? opt_speedo : 0; + if ( opt_lecode_debug != OFFON_AUTO ) + lp->debug_mode = opt_lecode_debug >= DEBUGMD_ENABLED && opt_lecode_debug < DEBUGMD__N + ? opt_lecode_debug : DEBUGMD_OFF; } /////////////////////////////////////////////////////////////////////////////// @@ -2340,7 +2783,7 @@ void PatchLPAR ( le_lpar_t * lp ) void PatchLECODE ( le_analyse_t * ana ) { DASSERT(ana); - PRINT("PatchLECODE() opt_lpar=%s)\n",opt_lpar); + PRINT("PatchLECODE() opt_lpar=%s\n",opt_lpar); if (opt_lpar) LoadLPAR(&ana->lpar,false,0,false); @@ -2359,6 +2802,246 @@ void PatchLECODE ( le_analyse_t * ana ) // /////////////////////////////////////////////////////////////////////////////// +/////////////// ScanTextLPAR() helpers /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError ScanTextLPAR_PARAM +( + le_lpar_t *lpar, // LE-CODE parameters + ScanInfo_t *si, // valid data + bool is_pass2 // false: pass1; true: pass2 +) +{ + DASSERT(lpar); + DASSERT(si); + PRINT(">> ScanTextLPAR_PARAM(pass=%u)\n",is_pass2+1); + + + //--- setup data + + int limit_mode = -1; + const ScanParam_t ptab[] = + { + { "LIMIT-MODE", SPM_INT, &limit_mode }, + { "ENGINE", SPM_U8, lpar->engine, 3,3 }, + { "ENABLE-200CC", SPM_U8, &lpar->enable_200cc }, + { "PERF-MONITOR", SPM_U8, &lpar->enable_perfmon }, + { "CUSTOM-TT", SPM_S8, &lpar->enable_custom_tt }, + { "XPFLAGS", SPM_U8, &lpar->enable_xpflags }, + { "BLOCK-TRACK", SPM_U8, &lpar->block_track }, + { "SPEEDOMETER", SPM_U8, &lpar->enable_speedo }, + { "DEBUG", SPM_U8, &lpar->debug_mode }, + { "ITEM-CHEAT", SPM_U8, &lpar->item_cheat }, + {0} + }; + + + //--- main loop + + for(;;) + { + char ch = NextCharSI(si,true); + if ( !ch || ch == '[' ) + break; + + ScanParamSI(si,ptab); + } + CheckLevelSI(si); + + if ( limit_mode >= 0 ) + LimitToLparMode(lpar,limit_mode); + + return ERR_OK; +} + +/////////////////////////////////////////////////////////////////////////////// + +static enumError ScanTextLPAR_CHAT +( + le_lpar_t *lpar, // LE-CODE parameters + ScanInfo_t * si, // valid data + bool is_pass2 // false: pass1; true: pass2 +) +{ + PRINT(">> ScanTextLPAR_CHAT(pass=%u)\n",is_pass2+1); + // [[2do]] ??? + + + //--- setup data + + bool reset = true, legacy = false, mkwfun = false; + const ScanParam_t ptab[] = + { + { "RESET", SPM_BOOL, &reset }, + { "LEGACY", SPM_BOOL, &legacy }, + { "MKW-FUN", SPM_BOOL, &mkwfun }, + {0} + }; + + + //--- main loop + + for(;;) + { + char ch = NextCharSI(si,true); + if ( !ch || ch == '[' ) + break; + + if ( ch == '@' ) + { + ScanParamSI(si,ptab); + if (reset) + { + reset = false; + ClearLparChat(lpar); + } + + if ( legacy || mkwfun ) + { + const u16 *chat_mode = legacy ? chat_mode_legacy : chat_mode_mkwfun; + uint i; + for ( i = 0; i < BMG_N_CHAT; i++ ) + if (!lpar->chat_mode_1[i]) + lpar->chat_mode_1[i] = chat_mode[i]; + legacy = mkwfun = false; + } + continue; + } + + if (reset) + { + reset = false; + ClearLparChat(lpar); + } + + char name[20]; + ScanNameSI(si,name,sizeof(name),true,true,0); + if ( name[0] != 'M' ) + { + wrong_name:; + ScanFile_t *sf = si->cur_file; + sf->ptr = sf->prev_ptr; + WarnIgnoreSI(si,"Message name (M01..M96) expected: %s\n",name); + continue; + } + + char *end; + long num = strtol(name+1,&end,10); + if ( *end || num < 1 || num > BMG_N_CHAT ) + goto wrong_name; + + CheckWarnSI(si,'=',ERR_OK); + + DEFINE_VAR(var); + if (ScanExprSI(si,&var)) + continue; + lpar->chat_mode_1[num-1] = GetIntV(&var); + + if ( NextCharSI(si,false) == ',' ) + { + si->cur_file->ptr++; + if (!ScanExprSI(si,&var)) + lpar->chat_mode_2[num-1] = GetIntV(&var); + } + + FreeV(&var); + CheckEolSI(si); + } + CheckLevelSI(si); + + if (reset) + ClearLparChat(lpar); + + //HEXDUMP16(0,0,fb->buf,fb->ptr-fb->buf); + return ERR_OK; +} + +/////////////////////////////////////////////////////////////////////////////// + +static enumError ScanTextLPAR_DEBUG +( + le_lpar_t *lpar, // LE-CODE parameters + ScanInfo_t *si, // valid data + bool is_pass2, // false: pass1; true: pass2 + uint config // configuration index 0.. +) +{ + DASSERT(lpar); + DASSERT(si); + DASSERT( config < LEDEB__N_CONFIG ); + PRINT(">> ScanTextLPAR_PARAM(pass=%u)\n",is_pass2+1); + u32 *debug_list = lpar->debug[config]; + + + //--- setup data + + const int hide_mask = 1 << config; + int hide_speedo = hide_mask & lpar->no_speedo_if_debug; + int line = -1, next_line = -1, setup = PREDEBUG_OFF; + lecode_debug_ex_t debug; + DecodeLecodeDebug(&debug,0); + + const ScanParam_t ptab[] = + { + { "SETUP", SPM_INT, &setup }, + { "HIDE-SPEEDO", SPM_INT, &hide_speedo }, + { "LINE", SPM_INT, &next_line }, + { "ENABLED", SPM_U8, &debug.enabled }, + { "OPPONENT", SPM_U8, &debug.opponent }, + { "SPACE", SPM_U8, &debug.space }, + { "POSITION", SPM_U8, &debug.position }, + { "CHECK-POINT", SPM_U8, &debug.check_point }, + { "RESPAWN", SPM_U8, &debug.respawn }, + { "LAP-POS", SPM_U8, &debug.lap_pos }, + {0} + }; + + + //--- main loop + + for(;;) + { + char ch = NextCharSI(si,true); + if ( !ch || ch == '[' ) + break; + + ScanParamSI(si,ptab); + + if ( setup != PREDEBUG_OFF ) + { + if ( SetupLecodeDebugLPAR(lpar,config,setup,&hide_speedo) && line >= 0 ) + DecodeLecodeDebug(&debug,debug_list[line]); + setup = PREDEBUG_OFF; + } + + if ( line != next_line ) + { + if ( line >= 0 ) + debug_list[line] = EncodeLecodeDebug(&debug); + + if ( next_line < 0 || next_line >= LEDEB__N_LINE ) + next_line = -1; + else + DecodeLecodeDebug(&debug,debug_list[next_line]); + line = next_line; + } + } + + if ( line >= 0 ) + debug_list[line] = EncodeLecodeDebug(&debug); + + if ( hide_speedo > 0 ) + lpar->no_speedo_if_debug |= hide_mask; + else + lpar->no_speedo_if_debug &= ~hide_mask; + + CheckLevelSI(si); + + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// ScanTextLPAR() /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -2420,18 +3103,23 @@ enumError ScanTextLPAR if (init_lpar) InitializeLPAR(lpar,false); - enum { C_PARAM, C_CHAT, C_END }; + enum { C_PARAM, C_CHAT, C_DEBUG1, C_DEBUG2, C_DEBUG3, C_DEBUG4, C_END }; static const KeywordTab_t section_name[] = { { C_PARAM, "LECODE-PARAMETERS", 0, 0 }, { C_CHAT, "CHAT-MESSAGE-MODES", 0, 0 }, + { C_END, "DEBUG-DOCU", 0, 0 }, + { C_DEBUG1, "DEBUG-1", 0, 0 }, + { C_DEBUG2, "DEBUG-2", 0, 0 }, + { C_DEBUG3, "DEBUG-3", 0, 0 }, + { C_DEBUG4, "DEBUG-4", 0, 0 }, { C_END, "END", 0, 0 }, {0,0,0,0} }; ScanInfo_t si; InitializeSI(&si,data,data_size,fname,0); - si.predef = SetupVarsLEX(); + si.predef = SetupVarsLECODE(); bool is_pass2 = false; enumError max_err = ERR_OK; @@ -2481,6 +3169,13 @@ enumError ScanTextLPAR err = ScanTextLPAR_CHAT(lpar,&si,is_pass2); break; + case C_DEBUG1: + case C_DEBUG2: + case C_DEBUG3: + case C_DEBUG4: + err = ScanTextLPAR_DEBUG(lpar,&si,is_pass2,cmd->id-C_DEBUG1); + break; + default: // ignore all other section without any warnings break; @@ -2511,161 +3206,6 @@ enumError ScanTextLPAR return max_err; } -/////////////////////////////////////////////////////////////////////////////// - -enumError ScanTextLPAR_PARAM -( - le_lpar_t *lpar, // LE-CODE parameters - ScanInfo_t *si, // valid data - bool is_pass2 // false: pass1; true: pass2 -) -{ - DASSERT(lpar); - DASSERT(si); - PRINT(">> ScanTextLPAR_PARAM(pass=%u)\n",is_pass2+1); - - - //--- setup data - - int limit_mode = -1; - const ScanParam_t ptab[] = - { - { "LIMIT-MODE", SPM_INT, &limit_mode }, - { "ENGINE", SPM_U8, lpar->engine, 3,3 }, - { "ENABLE-200CC", SPM_U8, &lpar->enable_200cc }, - { "PERF-MONITOR", SPM_U8, &lpar->enable_perfmon }, - { "CUSTOM-TT", SPM_S8, &lpar->enable_custom_tt }, - { "XPFLAGS", SPM_U8, &lpar->enable_xpflags }, - { "SPEEDOMETER", SPM_U8, &lpar->enable_speedo }, - { "BLOCK-TRACK", SPM_U8, &lpar->block_track }, - - { "RESERVED-1B9", SPM_U8, &lpar->reserved_1b9 }, - { "RESERVED-1BA", SPM_U8, &lpar->reserved_1ba }, - { "RESERVED-1BB", SPM_U8, &lpar->reserved_1bb }, - {0} - }; - - - //--- main loop - - for(;;) - { - char ch = NextCharSI(si,true); - if ( !ch || ch == '[' ) - break; - - ScanParamSI(si,ptab); - } - CheckLevelSI(si); - - if ( limit_mode >= 0 ) - LimitToLparMode(lpar,limit_mode); - - return ERR_OK; -} - -/////////////////////////////////////////////////////////////////////////////// - -enumError ScanTextLPAR_CHAT -( - le_lpar_t *lpar, // LE-CODE parameters - ScanInfo_t * si, // valid data - bool is_pass2 // false: pass1; true: pass2 -) -{ - PRINT(">> ScanTextLPAR_CHAT(pass=%u)\n",is_pass2+1); - // [[2do]] ??? - - - //--- setup data - - bool reset = true, legacy = false, mkwfun = false; - const ScanParam_t ptab[] = - { - { "RESET", SPM_BOOL, &reset }, - { "LEGACY", SPM_BOOL, &legacy }, - { "MKW-FUN", SPM_BOOL, &mkwfun }, - {0} - }; - - - //--- main loop - - for(;;) - { - char ch = NextCharSI(si,true); - if ( !ch || ch == '[' ) - break; - - if ( ch == '@' ) - { - ScanParamSI(si,ptab); - if (reset) - { - reset = false; - ClearLparChat(lpar); - } - - if ( legacy || mkwfun ) - { - const u16 *chat_mode = legacy ? chat_mode_legacy : chat_mode_mkwfun; - uint i; - for ( i = 0; i < BMG_N_CHAT; i++ ) - if (!lpar->chat_mode_1[i]) - lpar->chat_mode_1[i] = chat_mode[i]; - legacy = mkwfun = false; - } - continue; - } - - if (reset) - { - reset = false; - ClearLparChat(lpar); - } - - char name[20]; - ScanNameSI(si,name,sizeof(name),true,true,0); - if ( name[0] != 'M' ) - { - wrong_name:; - ScanFile_t *sf = si->cur_file; - sf->ptr = sf->prev_ptr; - WarnIgnoreSI(si,"Message name (M01..M96) expected: %s\n",name); - continue; - } - - char *end; - long num = strtol(name+1,&end,10); - if ( *end || num < 1 || num > BMG_N_CHAT ) - goto wrong_name; - - CheckWarnSI(si,'=',ERR_OK); - - DEFINE_VAR(var); - if (ScanExprSI(si,&var)) - continue; - lpar->chat_mode_1[num-1] = GetIntV(&var); - - if ( NextCharSI(si,false) == ',' ) - { - si->cur_file->ptr++; - if (!ScanExprSI(si,&var)) - lpar->chat_mode_2[num-1] = GetIntV(&var); - } - - FreeV(&var); - CheckEolSI(si); - } - CheckLevelSI(si); - - if (reset) - ClearLparChat(lpar); - - //HEXDUMP16(0,0,fb->buf,fb->ptr-fb->buf); - return ERR_OK; -} - // /////////////////////////////////////////////////////////////////////////////// /////////////// END /////////////// diff --git a/project/src/lib-lecode.h b/project/src/lib-lecode.h index edb1630..2f2acc2 100644 --- a/project/src/lib-lecode.h +++ b/project/src/lib-lecode.h @@ -102,6 +102,132 @@ __attribute__ ((packed)) le_usage_t; // /////////////////////////////////////////////////////////////////////////////// +/////////////// lecode debug /////////////// +/////////////////////////////////////////////////////////////////////////////// +// [[lecode_debug_t]] [[copy-lecode]] copy changes to LE-CODE + +typedef enum lecode_debug_t +{ + LEDEB_ENABLED = 0x0001, + LEDEB_OPPONENT = 0x0002, + LEDEB_SPACE = 0x0004, + + LEDEB_POSITION = 0x0008, + LEDEB_CHECK_POINT = 0x0030, // 2 bits! + LEDEB_RESPAWN = 0x0040, + LEDEB_LAP_POS = 0x0080, + + //--- derived values + + LEDEB__STD = 0x00f9, // standard output + LEDEB__OUTPUT = 0x00f8, // flags that produce output + LEDEB__ALL = 0x00ff, // all flags + + LEDEB_S_CHECK_POINT = 4, // shift for LEDEB_CHECKPOINT + LEDEB_M_CHECK_POINT = 3, // mask after shift + + //--- special values + + LEDEB__N_CONFIG = 4, // number of debug configurations + LEDEB__N_LINE = 10, // number of debug lines of each configuration +} +lecode_debug_t; + +//----------------------------------------------------------------------------- +// [[lecode_debug_info_t]] + +typedef struct lecode_debug_info_t +{ + lecode_debug_t mode; // mode to iterate + bool filter_active; // true: iterate only values >0 + + int index; // internal index + lecode_debug_t relevant; // relevant bits for name=value + ccp name; // NULL or name of parameter + uint value; // related value +} +lecode_debug_info_t; + +//----------------------------------------------------------------------------- + +ccp GetDebugModeSummary ( const lecode_debug_info_t *ldi ); + +bool GetFirstDebugMode + ( lecode_debug_info_t *ldi, lecode_debug_t mode, bool filter_active ); +bool GetNextDebugMode ( lecode_debug_info_t *ldi ); + + +static inline bool isDebugModeOutput ( lecode_debug_t mode ) + { return mode & LEDEB__OUTPUT; } + +static inline bool isDebugModeActive ( lecode_debug_t mode ) + { return mode & LEDEB_ENABLED && mode & LEDEB__OUTPUT; } + +//----------------------------------------------------------------------------- +// [[lecode_debug_ex_t]] + +typedef struct lecode_debug_ex_t +{ + // encoded data + lecode_debug_t mode; + + // decoded data + u8 enabled; + u8 opponent; + u8 space; + u8 position; + u8 check_point; + u8 respawn; + u8 lap_pos; + + // status + bool have_output; // would produce output if ENABLED + bool is_active; // will produce output +} +lecode_debug_ex_t; + +//----------------------------------------------------------------------------- + +lecode_debug_t DecodeLecodeDebug ( lecode_debug_ex_t *lde, lecode_debug_t mode ); +lecode_debug_t EncodeLecodeDebug ( lecode_debug_ex_t *lde ); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// [[le_debug_mode_t]] [[copy-lecode]] copy changes to LE-CODE + +typedef enum le_debug_mode_t +{ + DEBUGMD_OFF, // debug disabled at all + DEBUGMD_ENABLED, // debug enabled, but hidden + DEBUGMD_DEBUG1, // debug enabled, start with config #0 [DEBUG-1] + DEBUGMD_DEBUG2, // debug enabled, start with config #1 [DEBUG-2] + DEBUGMD_DEBUG3, // debug enabled, start with config #2 [DEBUG-3] + DEBUGMD_DEBUG4, // debug enabled, start with config #3 [DEBUG-4] + + DEBUGMD__N // number of debug modes +} +le_debug_mode_t; + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// [[predef_debug_t]] + +typedef enum predef_debug_t +{ + PREDEBUG_OFF, // no predefinition + PREDEBUG_CLEAR, // clear all + PREDEBUG_STANDARD, // 1 line: standard setup + PREDEBUG_OPPONENT, // 2 lines: standard for player + opponent + PREDEBUG_VERTICAL, // vertical output +} +predef_debug_t; + +//----------------------------------------------------------------------------- + +ccp GetPredefDebugName ( predef_debug_t pd_mode ); + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// le_lpar_t /////////////// /////////////////////////////////////////////////////////////////////////////// // [[le_lpar_t]] @@ -112,16 +238,19 @@ typedef struct le_lpar_t u8 engine[3]; // 100cc, 150cc, mirror (sum always 100) u8 enable_200cc; // TRUE: 200C enabled => 150cc, 200cc, mirror - u8 enable_perfmon; // TRUE: performance monitor enabled + u8 enable_perfmon; // >0: performance monitor enabled; >1: for dolphin too u8 enable_custom_tt; // TRUE: time trial for cusotm tracks enabled u8 enable_xpflags; // TRUE: extended presence flags enabled - u8 enable_speedo; // TRUE: speedometer is enabled + u8 enable_speedo; // speedometer selection (0..3), see SPEEDO_* u8 block_track; // block used tracks for 0..20 races + u8 no_speedo_if_debug; // 1 bit for each debug configuration + u8 item_cheat; // 0:disabled, 1:enabled - // reserved for future extensions - u8 reserved_1b9; - u8 reserved_1ba; - u8 reserved_1bb; + u8 debug_mode; // debug mode + u8 debug_predef[LEDEB__N_CONFIG]; + // information about used predefined mode + u32 debug[LEDEB__N_CONFIG][LEDEB__N_LINE]; + // debug line settings, see LEDEB_* u16 chat_mode_1[BMG_N_CHAT]; // first set of modes for each chat message u16 chat_mode_2[BMG_N_CHAT]; // second set of modes for each chat message @@ -163,36 +292,31 @@ enumError ScanTextLPAR uint data_size // size of 'data' ); -enumError ScanTextLPAR_PARAM -( - le_lpar_t *lpar, // LE-CODE parameters - ScanInfo_t *si, // valid data - bool is_pass2 // false: pass1; true: pass2 -); - -enumError ScanTextLPAR_CHAT -( - le_lpar_t *lpar, // LE-CODE parameters - ScanInfo_t *si, // valid data - bool is_pass2 // false: pass1; true: pass2 -); - //----------------------------------------------------------------------------- enumError SaveTextLPAR ( - const le_lpar_t *lpar, // LE-CODE parameters + le_lpar_t *lpar, // LE-CODE parameters ccp fname, // filename of destination bool set_time // true: set time stamps ); - enumError WriteSectionLPAR ( FILE *f, // output files const le_lpar_t *lpar // LE-CODE parameters ); +//----------------------------------------------------------------------------- + +bool SetupLecodeDebugLPAR +( + le_lpar_t *lpar, // LE-CODE parameters + uint config, // configuration index 0.. + uint setup_mode, // setup mode, one of PREDEBUG_* + int *hide_speedo // if not NULL: store new mode here +); + // /////////////////////////////////////////////////////////////////////////////// /////////////// binary headers /////////////// @@ -274,6 +398,8 @@ typedef struct le_binpar_v1_35_t } __attribute__ ((packed)) le_binpar_v1_35_t; +_Static_assert(sizeof(le_binpar_v1_35_t)==0x35,"le_binpar_v1_35_t"); + //----------------------------------------------------------------------------- // [[le_binpar_v1_37_t]] @@ -301,6 +427,8 @@ typedef struct le_binpar_v1_37_t } __attribute__ ((packed)) le_binpar_v1_37_t; +_Static_assert(sizeof(le_binpar_v1_37_t)==0x37,"le_binpar_v1_37_t"); + //----------------------------------------------------------------------------- // [[le_binpar_v1_f8_t]] @@ -330,6 +458,8 @@ typedef struct le_binpar_v1_f8_t } __attribute__ ((packed)) le_binpar_v1_f8_t; +_Static_assert(sizeof(le_binpar_v1_f8_t)==0xf8,"le_binpar_v1_f8_t"); + //----------------------------------------------------------------------------- // [[le_binpar_v1_1b8_t]] @@ -360,46 +490,92 @@ typedef struct le_binpar_v1_1b8_t } __attribute__ ((packed)) le_binpar_v1_1b8_t; +_Static_assert(sizeof(le_binpar_v1_1b8_t)==0x1b8,"le_binpar_v1_1b8_t"); + //----------------------------------------------------------------------------- // [[le_binpar_v1_1bc_t]] typedef struct le_binpar_v1_1bc_t { - /*000*/ char magic[8]; // LE_PARAM_MAGIC - /*008*/ u32 version; // always 1 for v1 - /*00c*/ u32 size; // size (and minor version) - /*010*/ u32 off_eod; // offset of end-of-data + /*000*/ char magic[8]; // LE_PARAM_MAGIC + /*008*/ u32 version; // always 1 for v1 + /*00c*/ u32 size; // size (and minor version) + /*010*/ u32 off_eod; // offset of end-of-data - /*014*/ u32 off_cup_par; // offset to cup param - /*018*/ u32 off_cup_track; // offset of cup-track list - /*01c*/ u32 off_cup_arena; // offset of cup-arena list - /*020*/ u32 off_course_par; // offset of course param - /*024*/ u32 off_property; // offset of property list - /*028*/ u32 off_music; // offset of music list - /*02c*/ u32 off_flags; // offset of music list + /*014*/ u32 off_cup_par; // offset to cup param + /*018*/ u32 off_cup_track; // offset of cup-track list + /*01c*/ u32 off_cup_arena; // offset of cup-arena list + /*020*/ u32 off_course_par; // offset of course param + /*024*/ u32 off_property; // offset of property list + /*028*/ u32 off_music; // offset of music list + /*02c*/ u32 off_flags; // offset of music list - /*030*/ u8 engine[3]; // 100cc, 150cc, mirror (sum always 100) - /*033*/ u8 enable_200cc; // TRUE: 200C enabled => 150cc, 200cc, mirror - /*034*/ u8 enable_perfmon; // TRUE: performance monitor enabled - /*035*/ u8 enable_custom_tt;// TRUE: time trial for cusotm tracks enabled - /*036*/ u8 enable_xpflags; // TRUE: extended presence flags enabled - /*037*/ u8 block_track; // block used track for 0.. tracks - /*038*/ u16 chat_mode_1[BMG_N_CHAT]; // mode for each chat message - /*0f8*/ u16 chat_mode_2[BMG_N_CHAT]; // mode for each chat message - /*1b8*/ u8 enable_speedo; // TRUE: speedometer is enabled + /*030*/ u8 engine[3]; // 100cc, 150cc, mirror (sum always 100) + /*033*/ u8 enable_200cc; // TRUE: 200C enabled => 150cc, 200cc, mirror + /*034*/ u8 enable_perfmon; // >0: performance monitor enabled; >1: for dolphin too + /*035*/ u8 enable_custom_tt; // TRUE: time trial for cusotm tracks enabled + /*036*/ u8 enable_xpflags; // TRUE: extended presence flags enabled + /*037*/ u8 block_track; // block used track for 0.. tracks + /*038*/ u16 chat_mode_1[BMG_N_CHAT]; // mode for each chat message + /*0f8*/ u16 chat_mode_2[BMG_N_CHAT]; // mode for each chat message + /*1b8*/ u8 enable_speedo; // speedometer mode (0..2), see SPEEDO_* + /*1b9*/ u8 no_speedo_if_debug; // if bit is set: suppress speedometer + /*1ba*/ u8 debug_mode; // debug mode (0..), see DEBUGMD_* //--- reserved for future extensions - /*1b9*/ u8 reserved_1b9; - /*1ba*/ u8 reserved_1ba; /*1bb*/ u8 reserved_1bb; + /*1bc*/ } __attribute__ ((packed)) le_binpar_v1_1bc_t; +_Static_assert(sizeof(le_binpar_v1_1bc_t)==0x1bc,"le_binpar_v1_1bc_t"); + +//----------------------------------------------------------------------------- +// [[le_binpar_v1_260_t]] + +typedef struct le_binpar_v1_260_t +{ + /*000*/ char magic[8]; // LE_PARAM_MAGIC + /*008*/ u32 version; // always 1 for v1 + /*00c*/ u32 size; // size (and minor version) + /*010*/ u32 off_eod; // offset of end-of-data + + /*014*/ u32 off_cup_par; // offset to cup param + /*018*/ u32 off_cup_track; // offset of cup-track list + /*01c*/ u32 off_cup_arena; // offset of cup-arena list + /*020*/ u32 off_course_par; // offset of course param + /*024*/ u32 off_property; // offset of property list + /*028*/ u32 off_music; // offset of music list + /*02c*/ u32 off_flags; // offset of music list + + /*030*/ u8 engine[3]; // 100cc, 150cc, mirror (sum always 100) + /*033*/ u8 enable_200cc; // TRUE: 200C enabled => 150cc, 200cc, mirror + /*034*/ u8 enable_perfmon; // >0: performance monitor enabled; >1: for dolphin too + /*035*/ u8 enable_custom_tt; // TRUE: time trial for cusotm tracks enabled + /*036*/ u8 enable_xpflags; // TRUE: extended presence flags enabled + /*037*/ u8 block_track; // block used track for 0.. tracks + /*038*/ u16 chat_mode_1[BMG_N_CHAT]; // mode for each chat message + /*0f8*/ u16 chat_mode_2[BMG_N_CHAT]; // mode for each chat message + /*1b8*/ u8 enable_speedo; // speedometer selection (0..2), see SPEEDO_* + /*1b9*/ u8 no_speedo_if_debug; // if bit is set: suppress speedometer + /*1ba*/ u8 debug_mode; // debug mode (0..), see DEBUGMD_* + /*1bb*/ u8 item_cheat; // 0:disabled, 1:enabled + + /*1bc*/ u8 debug_predef[LEDEB__N_CONFIG]; + // information about used predefined mode + /*1c0*/ u32 debug[LEDEB__N_CONFIG][LEDEB__N_LINE]; + // debug line settings, see LEDEB_* + /*260*/ +} +__attribute__ ((packed)) le_binpar_v1_260_t; + +_Static_assert(sizeof(le_binpar_v1_260_t)==0x260,"le_binpar_v1_260_t"); + //----------------------------------------------------------------------------- // [[le_binpar_v1_t]] -typedef struct le_binpar_v1_1bc_t le_binpar_v1_t; +typedef struct le_binpar_v1_260_t le_binpar_v1_t; // /////////////////////////////////////////////////////////////////////////////// @@ -568,11 +744,8 @@ extern OffOn_t opt_200cc; extern OffOn_t opt_perfmon; extern OffOn_t opt_custom_tt; extern OffOn_t opt_xpflags; -extern OffOn_t opt_speedo; - -extern int opt_reserved_1b9; -extern int opt_reserved_1ba; -extern int opt_reserved_1bb; +extern int opt_speedo; +extern int opt_lecode_debug; extern bool opt_complete; @@ -584,10 +757,7 @@ int ScanOptPerfMon ( ccp arg ); int ScanOptCustomTT ( ccp arg ); int ScanOptXPFlags ( ccp arg ); int ScanOptSpeedometer ( ccp arg ); - -int ScanOptReserved_1b9 ( ccp arg ); -int ScanOptReserved_1ba ( ccp arg ); -int ScanOptReserved_1bb ( ccp arg ); +int ScanOptDebug ( ccp arg ); // /////////////////////////////////////////////////////////////////////////////// diff --git a/project/src/lib-lex.c b/project/src/lib-lex.c index 357e062..6ad3e00 100644 --- a/project/src/lib-lex.c +++ b/project/src/lib-lex.c @@ -125,6 +125,8 @@ static const feature_var_t szs_feature_list[] = DEF_VAR( 0,HAVESZS_GHT_KART, f_ght_kart, "File common/GeoHitTableKart.bin" ), DEF_VAR( 0,HAVESZS_GHT_KART_OBJ, f_ght_kart_obj, "File common/GeoHitTableKartObj.bin" ), DEF_VAR( 0,HAVESZS_MINIGAME, f_minigame, "File common/minigame.kmg" ), + DEF_VAR( 0,HAVESZS_AIPARAM_BAA, f_aiparam_baa, "File AIParam/AIParam.baa" ), + DEF_VAR( 0,HAVESZS_AIPARAM_BAS, f_aiparam_bas, "File AIParam/AIParam.bas" ), {0,0,0,0,0} }; @@ -507,6 +509,8 @@ const features_szs_t * GetFeaturesModes() m.f_ght_kart = FZM_GAMEPLAY | FZM_M_TYPE | FZM_M_WHERE; m.f_ght_kart_obj = FZM_GAMEPLAY | FZM_M_TYPE | FZM_M_WHERE; m.f_minigame = FZM_GAMEPLAY | FZM_BATTLE | FZM_M_WHERE; + m.f_aiparam_baa = FZM_GAMEPLAY | FZM_M_TYPE | FZM_OFFLINE; + m.f_aiparam_bas = FZM_GAMEPLAY | FZM_M_TYPE | FZM_OFFLINE; m.kmp_woodbox_ht = FZM_GAMEPLAY | FZM_M_TYPE | no_timetrial; m.kmp_mushroom_car = FZM_VISUAL | FZM_GAMEPLAY | FZM_M_TYPE | FZM_M_WHERE; @@ -1661,7 +1665,8 @@ static enumError ScanLEXElement_SET1 //--- setup data - lex_set1_t set1 = {0}; + lex_set1_t set1; + memset(&set1,0,sizeof(set1)); const ScanParam_t ptab[] = { @@ -2654,6 +2659,17 @@ int ScanOptLtRandom ( ccp arg ) /////////////// lex_info_t /////////////// /////////////////////////////////////////////////////////////////////////////// +void InitializeLexInfo ( lex_info_t *info ) +{ + DASSERT(info); + memset(info,0,sizeof(*info)); + info->item_factor.x = 1.0; + info->item_factor.y = 1.0; + info->item_factor.z = 1.0; +} + +/////////////////////////////////////////////////////////////////////////////// + void SetupLexInfo ( lex_info_t *info, const lex_t *lex ) { DASSERT(info); @@ -2672,6 +2688,7 @@ void SetupLexInfo ( lex_info_t *info, const lex_t *lex ) info->set1_found = true; memcpy(&info->set1,item->elem.data,sizeof(info->set1)); bef4n(info->set1.item_factor.v,info->set1.item_factor.v,3); + memcpy(&info->item_factor,&info->set1.item_factor,sizeof(info->item_factor)); } item = FindElementLEX(lex,LEXS_TEST); diff --git a/project/src/lib-lex.h b/project/src/lib-lex.h index 3667703..96c2d4f 100644 --- a/project/src/lib-lex.h +++ b/project/src/lib-lex.h @@ -72,6 +72,8 @@ typedef struct features_szs_t u8 f_ght_kart; // HAVESZS_GHT_KART u8 f_ght_kart_obj; // HAVESZS_GHT_KART_OBJ u8 f_minigame; // HAVESZS_MINIGAME + u8 f_aiparam_baa; // HAVESZS_AIPARAM_BAA + u8 f_aiparam_bas; // HAVESZS_AIPARAM_BAS //--- KMP features (initial list) @@ -495,14 +497,16 @@ typedef struct lex_info_t bool test_found; // true: section TEST found lex_set1_t test; // data of section TEST + + + // data + float3 item_factor; // 1.0 or copy of set1.item_factor } lex_info_t; /////////////////////////////////////////////////////////////////////////////// -static inline void InitializeLexInfo ( lex_info_t *info ) - { DASSERT(info); memset(info,0,sizeof(*info)); } - +void InitializeLexInfo ( lex_info_t *info ); static inline void ResetLexInfo ( lex_info_t *info ) { if (info) memset(info,0,sizeof(*info)); } diff --git a/project/src/lib-pat.c b/project/src/lib-pat.c index 632a2d3..0a37c90 100644 --- a/project/src/lib-pat.c +++ b/project/src/lib-pat.c @@ -921,7 +921,7 @@ static enumError ScanText_SIMPLE continue; ParamFieldItem_t *it - = FindInsertParamField( &pat->s1_str, str, true, 0 ); + = FindInsertParamField( &pat->s1_str, str, true, 0, 0 ); const uint sidx = it ? it - pat->s1_str.field : 0; if ( elem.selem_used == elem.selem_size ) diff --git a/project/src/lib-std.c b/project/src/lib-std.c index f23d3c6..6e5ea84 100644 --- a/project/src/lib-std.c +++ b/project/src/lib-std.c @@ -36,9 +36,7 @@ ***************************************************************************/ #include <sys/types.h> -#ifndef WIN_SZS_LIB - #include <sys/ioctl.h> -#endif +#include <sys/ioctl.h> #include <fcntl.h> #include "lib-std.h" @@ -66,10 +64,6 @@ #include "crypt.h" #include "logo.inc" -#ifdef WIN_SZS_LIB - #include <direct.h> -#endif - #if defined(TEST) && !defined(__APPLE__) && !defined(__CYGWIN__) #include <mcheck.h> #endif @@ -79,10 +73,10 @@ /////////////// vars /////////////// /////////////////////////////////////////////////////////////////////////////// +ccp opt_config = 0; ccp tool_name = "?"; +ccp std_share_path = 0; ccp share_path = 0; -ccp search_path[6] = {0}; -ccp auto_add_path[6] = {0}; // same size as search path volatile int SIGINT_level = 0; volatile int verbose = 0; volatile int logging = 0; @@ -119,12 +113,13 @@ file_format_t opt_fform = FF_UNKNOWN; file_format_t fform_compr = FF_YAZ0; file_format_t fform_compr_force = 0; file_format_t script_fform = FF_TXT; -ccp script_varname = "res"; +ccp script_varname = 0; int script_array = 0; LowerUpper_t opt_case = LOUP_AUTO; int opt_pmodes = 0; uint opt_fmodes_include = 0; uint opt_fmodes_exclude = 0; +int opt_install = 0; int opt_pt_dir = 0; bool opt_links = false; bool opt_rm_aiparam = false; @@ -361,10 +356,8 @@ void SetupColors() // [[2do]] #if defined(TEST) || defined(DEBUG) - #define USE_PROGINFO 2 // 0:off, 1:both, 2:new proginfo only #define LOG_PROGINFO 1 // 0:off, 1:on #else - #define USE_PROGINFO 2 // 0:off, 1:both, 2:new proginfo only #define LOG_PROGINFO 0 // 0:off, 1:on #endif @@ -372,12 +365,7 @@ void SetupColors() void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) { - #if USE_PROGINFO SetupProgname(argc,argv,tname,tvers,ttitle); - #else - if ( tname && *tname ) - ProgInfo.progname = tname; - #endif #if LOG_PROGINFO PRINT1("PROG1: %s | %s | %s\n",ProgInfo.progname,ProgInfo.progdir,ProgInfo.progpath); @@ -430,7 +418,6 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) TRACE_SIZEOF(size_t); TRACE_SIZEOF(off_t); - #ifndef WIN_SZS_LIB TRACE_SIZEOF(int8_t); TRACE_SIZEOF(int16_t); TRACE_SIZEOF(int32_t); @@ -439,7 +426,6 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) TRACE_SIZEOF(uint16_t); TRACE_SIZEOF(uint32_t); TRACE_SIZEOF(uint64_t); - #endif TRACE_SIZEOF(u8); TRACE_SIZEOF(u16); @@ -453,6 +439,7 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) TRACE_SIZEOF(be32_t); TRACE_SIZEOF(be64_t); + TRACE("- numeric vectors\n"); TRACE_SIZEOF(float); TRACE_SIZEOF(float32); TRACE_SIZEOF(float3); @@ -466,6 +453,12 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) TRACE_SIZEOF(double34); TRACE_SIZEOF(MatrixD_t); + TRACE("- mem\n"); + TRACE_SIZEOF(mem_t); + TRACE_SIZEOF(exmem_t); + TRACE_SIZEOF(exmem_key_t); + TRACE_SIZEOF(exmem_list_t); + TRACE("- arch\n"); TRACE_SIZEOF(yaz0_header_t); TRACE_SIZEOF(wbz_header_t); @@ -714,7 +707,7 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) //----- some assertion - #if HAVE_ASSERT && !defined(WIN_SZS_LIB) // ??? [[mvc]] + #if HAVE_ASSERT { double3 d3; ASSERT( (double*)&d3 == d3.v ); @@ -744,115 +737,27 @@ void SetupLib ( int argc, char ** argv, ccp tname, ccp tvers, ccp ttitle ) MySeedByTime(); - //----- setup progname - - #if USE_PROGINFO < 2 - - tool_name = tname; - if ( argc > 0 && *argv && **argv ) - tname = *argv; - ProgInfo.progname = strrchr(tname,'/'); - ProgInfo.progname = ProgInfo.progname ? ProgInfo.progname+1 : tname; - //argv[0] = (char*)ProgInfo.progname; - if ( !tool_name || !*tool_name ) - tool_name = ProgInfo.progname; - - TRACE("##PROG## PROG-NAME=%s\n",ProgInfo.progname); - - #endif - - - //----- setup search_path + //----- setup std_share_path - char path[PATH_MAX]; - ccp *sp = search_path, *sp2; - DASSERT( sizeof(search_path)/sizeof(*search_path) > 5 ); - - #ifndef WIN_SZS_LIB - // determine program path - #if !USE_PROGINFO - char proc_path[30]; - snprintf(proc_path,sizeof(proc_path),"/proc/%u/exe",getpid()); - TRACE("PROC-PATH: %s\n",proc_path); - #endif - static char share[] = "/share/szs/"; - static char local_share[] = "/usr/local/share/szs/"; #ifndef __CYGWIN__ - share_path = local_share; + static const char share[] = "/share/szs"; + std_share_path = "/usr/local/share/szs"; #endif - #if USE_PROGINFO - if (GetProgramPath(path,sizeof(path),true,argv[0])) - #else - if (readlink(proc_path,path,sizeof(path))) - #endif + ccp progdir = ProgramDirectory(); + PRINT0("progdir=%s\n",progdir); + if (progdir) { - // program path found! - TRACE("PROG-PATH: %s\n",path); - - char * file_ptr = strrchr(path,'/'); - if ( file_ptr ) - { - // seems to be a real path -> terminate string behind '/' - *++file_ptr = 0; - - #ifdef TEST - // for development: append 'share' dir - StringCopyE(file_ptr,path+sizeof(path),"share/"); - *sp = STRDUP(path); - TRACE("SEARCH_PATH[%zd] = %s\n",sp-search_path,*sp); - sp++; - *file_ptr = 0; - #endif - - *sp = STRDUP(path); - TRACE("SEARCH_PATH[%zd] = %s\n",sp-search_path,*sp); - #ifdef __CYGWIN__ - share_path = *sp; - #endif - sp++; - - if ( file_ptr-5 >= path && !memcmp(file_ptr-4,"/bin/",5) ) - { - StringCopyS(file_ptr-5,sizeof(path),share); - *sp = STRDUP(path); - TRACE("SEARCH_PATH[%zd] = %s\n",sp-search_path,*sp); - sp++; - } - } - } - - // insert 'local_share' if not already done - - for ( sp2 = search_path; sp2 < sp && strcmp(*sp2,local_share); sp2++ ) - ; - if ( sp2 == sp ) - { - *sp = STRDUP(local_share); - TRACE("SEARCH_PATH[%zd] = %s\n",sp-search_path,*sp); - sp++; - } - #endif - - // insert CWD if not already done - getcwd(path,sizeof(path)-1); - strcat(path,"/"); - for ( sp2 = search_path; sp2 < sp && strcmp(*sp2,path); sp2++ ) - ; - if ( sp2 == sp ) - { - *sp = STRDUP("./"); - TRACE("SEARCH_PATH[%zd] = %s\n",sp-search_path,*sp); - sp++; + #ifdef __CYGWIN__ + std_share_path = progdir; + #else + uint plen = strlen(progdir); + if ( plen >= 4 && !strcmp(progdir+plen-4,"/bin") ) + std_share_path = MEMDUP2(progdir,plen-4,share,strlen(share)); + #endif } - *sp = 0; - ASSERT( sp - search_path < sizeof(search_path)/sizeof(*search_path) ); - - #ifdef TEST0 - CHECK_TRACE_ALLOC; - MEM_CHECK_SETUP(search_path[1]-0x20,0x40); - #endif + //--- misc SetupStandardSZS(); @@ -874,8 +779,14 @@ void NormalizeOptions { SetupColors(); + //--- load configuration + + const config_t *config = GetConfig(); + if (config) + share_path = config->share_path; + - //--- diff, delta and minimze + //--- diff, delta and minimize minimize_level = delta_count < 9 ? delta_count : 9; if ( diff_count > 0 ) @@ -928,21 +839,24 @@ void NormalizeOptions fprintf(stdlog,"PROGRAM_NAME = %s\n",ProgInfo.progname); if ( compatible != COMPAT_CURRENT ) fprintf(stdlog,"COMPATIBILITY = %s\n",PrintOptCompatible()); + fprintf(stdlog,"CONFIG_FILE = %s\n",config->config_file); - if ( log_level > 2 ) { - fprintf(stdlog,"SHARE_PATH = %s\n",share_path); + const config_t *config = GetConfig(); + fprintf(stdlog,"CONFIG_FILE = %s\n",config->config_file); + fprintf(stdlog,"STD_SHARE_PATH = %s\n",std_share_path); + fprintf(stdlog,"SHARE_PATH = %s\n",config->share_path); - ccp * sp; - for ( sp = search_path; *sp; sp++ ) - fprintf(stdlog,"SEARCH_PATH[%td] = %s\n",sp-search_path,*sp); + int i; + const StringField_t *sf = GetSearchList(); + ccp *str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) + fprintf(stdlog,"SEARCH_PATH[%d] = %s\n",i,*str); - if ( log_level > 1 ) - { - SetupAutoAdd(); - for ( sp = auto_add_path; *sp; sp++ ) - fprintf(stdlog,"AUTOADD_PATH[%td] = %s\n",sp-auto_add_path,*sp); - } + sf = GetAutoaddList(); + str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) + fprintf(stdlog,"AUTOADD_PATH[%d] = %s\n",i,*str); } fprintf(stdlog,"\n"); } @@ -1143,6 +1057,7 @@ const ccp warn_szs_name[WARNSZS__N] = { "itempos", // WARNSZS_ITEMPOS "self-it", // WARNSZS_SELF_ITPH + "no-minimap", // WARNSZS_NO_MINIMAP }; /////////////////////////////////////////////////////////////////////////////// @@ -1153,9 +1068,10 @@ ccp GetWarnSZSNames ( warn_bits_t ws, char sep ) { WARNSZS_ITEMPOS, WARNSZS_SELF_ITPH, + WARNSZS_NO_MINIMAP, -1 }; - + char buf[100], *dest = buf; const int *op; @@ -1859,7 +1775,7 @@ char * SubstString tempbuf[count] = 0; } char * new_dest - = NormalizeFileName(dest,end-dest,tempbuf,ptr->allow_slash,use_utf8); + = NormalizeFileName(dest,end-dest,tempbuf,ptr->allow_slash,use_utf8,TRSL_NONE); if ( check_prev && *dest == '.' ) { int len = new_dest - dest; @@ -1980,6 +1896,11 @@ int SubstDest /////////////// FormatField_t /////////////// /////////////////////////////////////////////////////////////////////////////// +#undef FORMAT_FIELD_GROW +#define FORMAT_FIELD_GROW(s) (s)/4+100 + +/////////////////////////////////////////////////////////////////////////////// + void InitializeFormatField ( FormatField_t * ff ) { DASSERT(ff); @@ -2110,7 +2031,7 @@ static FormatFieldItem_t * InsertFormatFieldHelper ( FormatField_t * ff, int idx noPRINT("+FF: %u/%u/%u\n",idx,ff->used,ff->size); if ( ff->used == ff->size ) { - ff->size += 0x100; + ff->size += FORMAT_FIELD_GROW(ff->size); ff->list = REALLOC(ff->list,ff->size*sizeof(*ff->list)); } DASSERT( idx <= ff->used ); @@ -2329,7 +2250,7 @@ FormatFieldItem_t * AppendFormatField noPRINT(">FF: %u/%u\n",ff->used,ff->size); if ( ff->used == ff->size ) { - ff->size += 0x100; + ff->size += FORMAT_FIELD_GROW(ff->size); ff->list = REALLOC(ff->list,ff->size*sizeof(*ff->list)); } TRACE("AppendFormatField(%s,%d) %d/%d\n",key,move_key,ff->used,ff->size); @@ -3910,6 +3831,98 @@ void cmd_version_section // /////////////////////////////////////////////////////////////////////////////// +/////////////// command config & support /////////////// +/////////////////////////////////////////////////////////////////////////////// + +enumError cmd_config() +{ + uint i; + search_file_list_t sfl; + SearchConfigHelper(&sfl,0); + + PrintScript_t ps; + SetupPrintScriptByOptions(&ps); + const bool print_info = ps.fform == PSFF_UNKNOWN; + + if (print_info) + printf("\nList of %u searched configuration file%s (*=relevant, +=found):\n", + sfl.used, sfl.used == 1 ? "" : "s" ); + + search_file_t *found = 0, *sf = sfl.list; + for ( i = 0; i < sfl.used; i++, sf++ ) + { + char ch; + if ( sf->itype < INTY_REG ) + ch = '-'; + else if ( !found && ( !opt_config || sf->hint & CONF_HINT_OPT )) + { + found = sf; + ch = '*'; + } + else + ch = '+'; + + if (print_info) + printf(" %c %s\n",ch,sf->fname); + } + + if (print_info) + { + if (found) + printf("\nRelevant configuration file: %s\n",found->fname); + else + fputs("\nNo valid configuration file found!\n",stdout); + } + + config_t config; + InitializeConfig(&config); + if (found) + ScanConfig(&config,found->fname,!opt_config); + #ifdef TEST + else if (opt_config) + ScanConfig(&config,opt_config,false); + #endif + else + ScanConfig(&config,0,true); + + if (print_sections) + PrintConfigFile(stdout,&config); + else if (print_info) + PrintConfig( stdout, &config, verbose>0 || opt_install ); + else + PrintConfigScript(stdout,&config); + + ResetConfig(&config); + ResetSearchFile(&sfl); + + if (print_info) + { + if ( long_count > 0 ) + { + const StringField_t *sf = GetSearchList(); + fputs("\nSearch list:\n",stdout); + ccp *str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) + printf(" %s\n",*str); + + if ( long_count > 1 ) + { + const StringField_t *sf = GetAutoaddList(); + fputs("\nAuto-add search list:\n",stdout); + ccp *str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) + printf(" %s\n",*str); + } + } + putchar('\n'); + } + + ResetPrintScript(&ps); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// command argtest /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -5105,6 +5118,32 @@ file_format_t RepairMagicByOpt /////////////// misc /////////////// /////////////////////////////////////////////////////////////////////////////// +void SetupPrintScriptByOptions ( PrintScript_t *ps ) +{ + DASSERT(ps); + + InitializePrintScript(ps); + ps->force_case = opt_case; + ps->create_array = script_array > 0; + ps->var_name = script_varname ? script_varname : "res"; + ps->var_prefix = script_varname ? script_varname : "res_"; + ps->eq_tabstop = 2; + ps->ena_empty = brief_count < 2; + ps->ena_comments = brief_count < 1; + + switch(script_fform) + { + case FF_JSON: ps->fform = PSFF_JSON; break; + case FF_BASH: ps->fform = PSFF_BASH; break; + case FF_SH: ps->fform = PSFF_SH; break; + case FF_PHP: ps->fform = PSFF_PHP; break; + case FF_MAKEDOC: ps->fform = PSFF_MAKEDOC; break; + default: ps->fform = print_sections ? PSFF_CONFIG : PSFF_UNKNOWN; break; + } +} + +/////////////////////////////////////////////////////////////////////////////// + void SHA1_to_ID ( sha1_id_t id, const sha1_hash_t hash ) { //--- create a smaller hash value (20->5 bytes with 3 bytes padding) @@ -6453,7 +6492,7 @@ valid_t IsValidKMP "KMP header declares file size as %u bytes, but it has only %u bytes: %s", hi.file_size, file_size, fname ); hi.file_size = file_size; - + kmp_file_gen_t *kfile = (kmp_file_gen_t*)data; write_be32(&kfile->file_size,hi.file_size); } diff --git a/project/src/lib-std.h b/project/src/lib-std.h index 2fcb06b..2d68f85 100644 --- a/project/src/lib-std.h +++ b/project/src/lib-std.h @@ -49,12 +49,9 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> - -#ifndef WIN_SZS_LIB - #include <sys/time.h> - #include <unistd.h> - #include <arpa/inet.h> -#endif +#include <sys/time.h> +#include <unistd.h> +#include <arpa/inet.h> #include "dclib-system.h" #include "dclib-basics.h" @@ -98,6 +95,7 @@ void LogSHA1 ( ccp func, ccp file, uint line, cvp data, uint size, ccp info ); /////////////////////////////////////////////////////////////////////////////// // also used by UI +#define CONFIG_FILE "wiimms-szs-tools.conf" #define SZS_SETUP_FILE "wszst-setup.txt" #define CHECK_FILE_SIZE 0x800 #define OPT_PNG_TYPE_CLASS 0x7fef0bff @@ -233,6 +231,7 @@ typedef enum warn_enum_t { WARNSZS_ITEMPOS, // item-pos bug WARNSZS_SELF_ITPH, // self linked ITPT route + WARNSZS_NO_MINIMAP, // no minimap found WARNSZS__N } warn_enum_t; @@ -824,8 +823,8 @@ uint IsolateFilename /////////////////////////////////////////////////////////////////////////////// -bool SetupAutoAdd(); -bool DefineAutoAddPath ( ccp path ); +bool IsAutoAddAvailable(); +void DefineAutoAddPath ( ccp path ); s64 FindAutoAdd ( ccp fname, ccp ext, char *buf, uint buf_size ); // @@ -1287,6 +1286,7 @@ typedef enum slot_info_type_t SIT_NOT, // not defined SIT_GENERIC, // generic slot: "arena" or music by race/arena slot SIT_RECOMMEND, // recommended slot: "r##" | "a##" | "m*" + SIT_MANDATORY3, // mandatory alternative: "31+42+71" | "31+62+71" SIT_MANDATORY2, // mandatory alternative: "31+71" SIT_MANDATORY, // mandatory slot: "##" } @@ -1308,11 +1308,13 @@ typedef struct slot_info_t slot_info_type_t arena_mode; // 0:not, 1:"arena", 2:"a##" slot_info_type_t music_mode; // 0:not, 1:generic, 2:"m*" bool have_31_71; // true: "31+71" found! + bool have_31_42_71; // true: "31+42+71" found! + bool have_31_62_71; // true: "31+62+71" found! - char race_info[6]; // race slot as text: "##" | "r##" | "31+71" + char race_info[9]; // race slot as text: "##" | "r##" | "31+71" | "31+41+71" char arena_info[6]; // arena slot as text: "arena" | "a##" char music_info[5]; // music slot as text: "m##" | "ma##" - char slot_attrib[17];// normalized slot atribute, combi of race+arena+music + char slot_attrib[20];// normalized slot atribute, combi of race+arena+music } slot_info_t; @@ -1355,6 +1357,7 @@ typedef struct FormatFieldItem_t } FormatFieldItem_t; //----------------------------------------------------------------------------- +// [[FormatField_t]] typedef struct FormatField_t { @@ -1650,6 +1653,7 @@ void DumpTrackFileList /////////////////////////////////////////////////////////////////////////////// /////////////// scan setup files /////////////// /////////////////////////////////////////////////////////////////////////////// +// [[SetupDef_t]] typedef struct SetupDef_t { @@ -1661,12 +1665,14 @@ typedef struct SetupDef_t } SetupDef_t; //----------------------------------------------------------------------------- +// [[ListDef_t]] typedef struct ListDef_t { ccp name; // section name bool append; // true: append string instead of insert - StringField_t *sf; // valid pointer to string field + StringField_t *sf; // NULL or valid pointer to string field + exmem_list_t *eml; // NULL or valid pointer to exmem list } ListDef_t; @@ -1679,13 +1685,13 @@ size_t ResetSetup enumError ScanSetupFile ( - SetupDef_t * sdef, // object list terminated with an element 'name=NULL' - ListDef_t * ldef, // NULL or object list terminated - // with an element 'name=NULL' - ccp path1, // filename of text file, part 1 - ccp path2, // filename of text file, part 2 - SubDir_t * sdir, // not NULL: use it and ignore 'path1' - bool silent // true: suppress error message if file not found + SetupDef_t * sdef, // object list terminated with an element 'name=NULL' + const ListDef_t * ldef, // NULL or object list terminated + // with an element 'name=NULL' + ccp path1, // filename of text file, part 1 + ccp path2, // filename of text file, part 2 + SubDir_t * sdir, // not NULL: use it and ignore 'path1' + bool silent // true: suppress error message if file not found ); /////////////////////////////////////////////////////////////////////////////// @@ -1961,7 +1967,48 @@ valid_t IsValidCTCODE ccp fname // not NULL: print warnings with file ref ); -// +//// +/////////////////////////////////////////////////////////////////////////////// +/////////////// scan configuration /////////////// +/////////////////////////////////////////////////////////////////////////////// +// [[config_t]] + +typedef struct config_t +{ + ccp config_file; + ccp base_path; + ccp install_path; + ccp install_config; + ccp share_path; + ccp autoadd_path; +} +config_t; + +//----------------------------------------------------------------------------- + +static inline void InitializeConfig ( config_t *config ) + { DASSERT(config); memset(config,0,sizeof(*config)); } + +void ResetConfig ( config_t *config ); + +enumError ScanConfig +( + config_t *config, // store configuration here + ccp path, // NULL or path + bool silent // true: suppress printing of error messages +); + +void SearchConfigHelper ( search_file_list_t *sfl, int stop_mode ); +const config_t * GetConfig(void); +void PrintConfig ( FILE *f, const config_t *config, bool verbose ); +void PrintConfigScript ( FILE *f, const config_t *config ); +void PrintConfigFile ( FILE *f, const config_t *config ); + +const StringField_t * GetSearchList(void); +const StringField_t * GetAutoaddList(void); + +extern ccp autoadd_destination; + /////////////////////////////////////////////////////////////////////////////// /////////////// misc /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -2001,6 +2048,7 @@ data_tab_t; void cmd_version_section ( bool sect_header, ccp name_short, ccp name_long, int verbose ); +enumError cmd_config(); enumError cmd_argtest ( int argc, char ** argv ); enumError cmd_error(); enumError cmd_filetype(); @@ -2102,6 +2150,8 @@ extern const char *TableEncode64BySetup; int ScanOptCoding64 ( ccp arg ); EncodeMode_t SetupCoding64 ( EncodeMode_t mode, EncodeMode_t fallback ); +void SetupPrintScriptByOptions ( PrintScript_t *ps ); + /////////////////////////////////////////////////////////////////////////////// uint GetMkwMusicSlot ( uint tid ); @@ -2160,10 +2210,11 @@ extern const u8 TestDataLEX[8*1]; /////////////// vars /////////////// /////////////////////////////////////////////////////////////////////////////// +extern ccp opt_config; +extern ccp config_path; extern ccp tool_name; +extern ccp std_share_path; extern ccp share_path; -extern ccp search_path[]; -extern ccp auto_add_path[6]; extern volatile int SIGINT_level; extern volatile int verbose; extern volatile int logging; @@ -2206,6 +2257,7 @@ extern LowerUpper_t opt_case; extern int opt_pmodes; extern uint opt_fmodes_include; extern uint opt_fmodes_exclude; +extern int opt_install; extern int opt_pt_dir; extern bool opt_links; extern bool opt_rm_aiparam; diff --git a/project/src/lib-szs-create.c b/project/src/lib-szs-create.c index e622e17..1523d2e 100644 --- a/project/src/lib-szs-create.c +++ b/project/src/lib-szs-create.c @@ -1107,12 +1107,14 @@ enumError LoadObjFileListSZS } - //--- slot analysis: 31+71, 62 + //--- slot analysis: 31+71, 31+x+71, 62 szs->slot_analyzed = true; - szs->slot_31_71 = ( used_obj.d[GOBJ_SUN_DS] ? SLOT_31_71_SUNDS : 0 ) - | ( used_obj.d[GOBJ_PYLON01] ? SLOT_31_71_PYLON01 : 0 ); +// [[31+42+71+]] + szs->slot_31_xx_71 + = ( used_obj.d[GOBJ_SUN_DS] ? SLOT_31_71_SUNDS : 0 ) + | ( used_obj.d[GOBJ_PYLON01] ? SLOT_31_71_PYLON01 : 0 ); szs->slot_62 = used_obj.d[GOBJ_HEYHO_SHIP] != 0; @@ -1199,7 +1201,7 @@ static void AddSpecialFile snprintf(buf,sizeof(buf),"%s %s",GetNameFF(fform,0),fname); ParamFieldItem_t *it - = InsertParamFieldEx(szs->special_file,buf,false,size,0); + = FindInsertParamField(szs->special_file,buf,false,size,0); if (!it->data) { sha1_hash_t *hash = MALLOC(sizeof(sha1_hash_t)); @@ -1818,7 +1820,7 @@ enumError AddMissingFiles DASSERT(szs); DASSERT( sd || norm ); - if (!SetupAutoAdd()) + if (!IsAutoAddAvailable()) return ERR_OK; char path_buf[PATH_MAX]; @@ -3518,19 +3520,19 @@ int CheckSZS } - //--- slot 3.1 and 7.1 + //--- slot 3.1, 4.2 and 7.1 - if (szs->slot_31_71) + if (szs->slot_31_xx_71) { - if ( szs->slot_31_71 == (SLOT_31_71_SUNDS|SLOT_31_71_PYLON01) ) + if ( szs->slot_31_xx_71 == (SLOT_31_71_SUNDS|SLOT_31_71_PYLON01) ) print_check_error( &chk, CMOD_SLOT, - "Track will only run at slots 3.1 and 7.1," + "Track will only run at slots 3.1, 4.2, 6.2 and 7.1," " because objects 'sunDS' and 'pylon01' are used.\n" ); else print_check_error( &chk, CMOD_SLOT, - "Track will only run at slots 3.1 and 7.1," + "Track will only run at slots 3.1, 4.2, 6.2 and 7.1," " because object '%s' is used.\n", - szs->slot_31_71 & SLOT_31_71_SUNDS ? "sunDS" : "pylon01" ); + szs->slot_31_xx_71 & SLOT_31_71_SUNDS ? "sunDS" : "pylon01" ); } @@ -3757,12 +3759,14 @@ static void set_required_slot ( int slot[MKW_N_TRACKS], // status vector uint slot1, // first required slot index - uint slot2 // second required slot index + uint slot2, // second required slot index + uint slot3, // third required slot index + uint slot4 // fourth required slot index ) { uint i; for ( i = 0; i < MKW_N_TRACKS; i++ ) - if ( i != slot1 && i != slot2 ) + if ( i != slot1 && i != slot2 && i != slot3 && i != slot4 ) slot[i] = -1; else if (!slot[i]) slot[i] = 1; @@ -3792,7 +3796,7 @@ int FindSlotsSZS // 0: unknown // +1: slot possible int *required_slot // if not NULL: return 0|31|61|62 - // 31 is an alias for "31+71" + // 31 is an alias for "31+71" or "31+41+71" ) { DASSERT(szs); @@ -3854,11 +3858,11 @@ int FindSlotsSZS int stat = 1; - //--- analyze slots 3.1 & 7.1 + //--- analyze slots 3.1 & 4.2 & 7.1 - if (szs->slot_31_71) + if (szs->slot_31_xx_71) { - set_required_slot(slot,ISLOT(3,1),ISLOT(7,1)); + set_required_slot(slot,ISLOT(3,1),ISLOT(4,2),ISLOT(6,2),ISLOT(7,1)); stat = -1; if (required_slot) *required_slot = 31; @@ -3876,7 +3880,7 @@ int FindSlotsSZS if (need_ice_brres) { - set_required_slot(slot,ISLOT(6,1),ISLOT(6,1)); + set_required_slot(slot,ISLOT(6,1),ISLOT(6,1),ISLOT(6,1),ISLOT(6,1)); if (!szs->have_ice_brres) SLOT(6,1) = -1; else @@ -3895,7 +3899,7 @@ int FindSlotsSZS if (szs->slot_62) { stat = -1; - set_required_slot(slot,ISLOT(6,2),ISLOT(6,2)); + set_required_slot(slot,ISLOT(6,2),ISLOT(6,2),ISLOT(6,2),ISLOT(6,2)); if (required_slot) *required_slot = 62; } @@ -3912,9 +3916,6 @@ int FindSlotsSZS return stat; } -#undef SLOT -#undef ISLOT - /////////////////////////////////////////////////////////////////////////////// void AnalyzeSlot ( slot_ana_t *sa, szs_file_t *szs ) @@ -3960,50 +3961,29 @@ void AnalyzeSlot ( slot_ana_t *sa, szs_file_t *szs ) StringCopyS(sa->slot_info,sizeof(sa->slot_info),buf); if ( sa->required_slot == 31 ) - StringCopyS(sa->mandatory_slot,sizeof(sa->mandatory_slot),"31+71"); + { + if ( sa->slot[ISLOT(6,2)] > 0 ) + StringCopyS(sa->mandatory_slot,sizeof(sa->mandatory_slot),"31+62+71"); + else if ( sa->slot[ISLOT(4,2)] > 0 ) + StringCopyS(sa->mandatory_slot,sizeof(sa->mandatory_slot),"31+42+71"); + else + StringCopyS(sa->mandatory_slot,sizeof(sa->mandatory_slot),"31+71"); + } else if ( sa->required_slot ) snprintf(sa->mandatory_slot,sizeof(sa->mandatory_slot),"%u",sa->required_slot); } +#undef SLOT +#undef ISLOT + /////////////////////////////////////////////////////////////////////////////// ccp CreateSlotInfo ( szs_file_t *szs ) { DASSERT(szs); - #if 1 slot_ana_t sa; AnalyzeSlot(&sa,szs); return CopyCircBuf(sa.slot_info,strlen(sa.slot_info)+1); - #else - int slot[MKW_N_TRACKS]; - int required_slot; - const int stat = FindSlotsSZS(szs,slot,&required_slot); - - if ( szs->is_arena >= ARENA_FOUND ) - return "arena"; - - static char buf[500]; - char *dest = buf; - - uint i; - for ( i = 0; i < MKW_N_TRACKS; i++ ) - if ( slot[i] != stat ) - { - if ( dest > buf ) - *dest++ = ','; - dest = snprintfE(dest,buf+sizeof(buf),"%c%u.%u", - slot[i] < 0 ? '-' : slot[i] > 0 ? '+' : '?' , - i/4+1, i%4+1 ); - } - - if ( dest == buf ) - *dest++ = '%'; - *dest++ = 0; - const uint size = dest - buf; - char *res = GetCircBuf(size); - memcpy(res,buf,size); - return res; - #endif } // @@ -5115,6 +5095,12 @@ void AnalyseSZS if ( szs->have.szs[HAVESZS_MINIGAME] >= HFM_MODIFIED ) ct_dest = StringCopyE(ct_dest,ct_end,",minigame"); + if ( szs->have.szs[HAVESZS_AIPARAM_BAA] >= HFM_ORIGINAL + || szs->have.szs[HAVESZS_AIPARAM_BAS] >= HFM_ORIGINAL + ) + { + ct_dest = StringCopyE(ct_dest,ct_end,",aiparam"); + } //--- scan KCL @@ -5162,7 +5148,7 @@ void AnalyseSZS Sha1Bin2Hex(as->sha1_minimap,sha1_data.hash); } else - valid_track = false; + szs->warn_bits |= 1 << WARNSZS_NO_MINIMAP; //--- finalize ct_attrib by "lex" and "warn" diff --git a/project/src/lib-szs.c b/project/src/lib-szs.c index e359f26..f541186 100644 --- a/project/src/lib-szs.c +++ b/project/src/lib-szs.c @@ -67,6 +67,8 @@ const ccp have_szs_name[HAVESZS__N] = "ght_kartobj", // HAVESZS_GHT_KART_OBJ "itemslot", // HAVESZS_ITEM_SLOT_TABLE "minigame", // HAVESZS_MINIGAME + "aiparam_baa", // HAVESZS_AIPARAM_BAA + "aiparam_bas", // HAVESZS_AIPARAM_BAS }; const ccp have_szs_file[HAVESZS__N] = @@ -79,6 +81,8 @@ const ccp have_szs_file[HAVESZS__N] = "common/GeoHitTableKartObj.bin", // HAVESZS_GHT_KART_OBJ "ItemSlotTable/ItemSlotTable.slt", // HAVESZS_ITEM_SLOT_TABLE "common/minigame.kmg", // HAVESZS_MINIGAME + "AIParam/AIParam.baa", // HAVESZS_AIPARAM_BAA + "AIParam/AIParam.bas", // HAVESZS_AIPARAM_BAS }; const file_format_t have_szs_fform[HAVESZS__N] = @@ -91,6 +95,8 @@ const file_format_t have_szs_fform[HAVESZS__N] = FF_GH_KOBJ, // HAVESZS_GHT_KART_OBJ FF_ITEMSLT, // HAVESZS_ITEM_SLOT_TABLE FF_KMG, // HAVESZS_MINIGAME + FF_UNKNOWN, // HAVESZS_AIPARAM_BAA + FF_UNKNOWN, // HAVESZS_AIPARAM_BAS }; // @@ -1707,7 +1713,7 @@ static enumError SetupWU8Info ( wu8_info_t *wu8, szs_file_t *szs, bool encode ) memset(wu8,0,sizeof(*wu8)); - if (!SetupAutoAdd()) + if (!IsAutoAddAvailable()) return ERROR0(ERR_CANT_OPEN, "WU8-%sCODE: Can't find autoadd library.\n", encode ? "EN" : "DE" ); @@ -3265,7 +3271,7 @@ static int iterate_sub_files if ( it->off > it->szs->size || it->off + it->size > it->szs->size ) { ERROR0(ERR_WARNING, - "Illegal offset [%x..%x, size=%zx] for subfile.\n" + "Invalid offset [%x..%x, size=%zx] for subfile.\n" "=> File ignored: %s%s%s\n", it->off, it->off+it->size, it->szs->size, it->szs->fname, *it->szs->fname ? "/" : "", @@ -4620,7 +4626,7 @@ u32 InsertStringPool if (!sp->data) { ParamFieldItem_t *pi - = InsertParamFieldEx(&sp->pf,string,move_string,sp->pf.used+1,0); + = FindInsertParamField(&sp->pf,string,move_string,sp->pf.used+1,0); if (pi) { if (data) diff --git a/project/src/lib-szs.h b/project/src/lib-szs.h index 4d09f00..eea6912 100644 --- a/project/src/lib-szs.h +++ b/project/src/lib-szs.h @@ -258,8 +258,8 @@ CmpFuncSubFile GetCmpFunc enum szs_marker_t { - SLOT_31_71_SUNDS = 0x01, // bit for 'szs_file_t:slot_31_71' - SLOT_31_71_PYLON01 = 0x02, // bit for 'szs_file_t:slot_31_71' + SLOT_31_71_SUNDS = 0x01, // bit for 'szs_file_t:slot_31_xx_71' + SLOT_31_71_PYLON01 = 0x02, // bit for 'szs_file_t:slot_31_xx_71' SLOT_42_KART_TRUCK_U = 0x01, // bit for 'szs_file_t:slot_42' SLOT_42_CAR_BODY_U = 0x02, // bit for 'szs_file_t:slot_42' @@ -288,6 +288,8 @@ typedef enum have_szs_file_t HAVESZS_GHT_KART_OBJ, // common/GeoHitTableKartObj.bin HAVESZS_ITEM_SLOT_TABLE, // ItemSlotTable/ItemSlotTable.slt HAVESZS_MINIGAME, // common/minigame.kmg + HAVESZS_AIPARAM_BAA, // AIParam/AIParam.baa + HAVESZS_AIPARAM_BAS, // AIParam/AIParam.bas HAVESZS__N } __attribute__ ((packed)) have_szs_file_t; @@ -391,7 +393,7 @@ typedef struct szs_file_t IsArena_t is_arena; // one of ARENA_* bool slot_analyzed; // true: slot values are valid - uint slot_31_71; // slot required because of objects + uint slot_31_xx_71; // slot required because of objects uint slot_42; // slot possible because of objects uint slot_62; // slot required because of objects @@ -798,8 +800,8 @@ typedef struct slot_ana_t int slot[MKW_N_TRACKS]; // set by FindSlotsSZS() int required_slot; // set by FindSlotsSZS() - char mandatory_slot[6]; // empty | "arena" | "31+71" | "61" | "62" - char slot_info[30]; // slot info text + char mandatory_slot[9]; // empty | "arena" | "31+71" | "31+41+71" | "61" | "62" + char slot_info[31]; // slot info text } slot_ana_t; @@ -815,7 +817,7 @@ int FindSlotsSZS // 0: unknown // +1: slot possible int *required_slot // if not NULL: return 0|31|61|62 - // 31 is an alias for "31+71" + // 31 is an alias for "31+71" or "31+41+71" ); void AnalyzeSlot ( slot_ana_t *sa, szs_file_t *szs ); diff --git a/project/src/ui/gen-ui.c b/project/src/ui/gen-ui.c index d8518ce..3e072cf 100644 --- a/project/src/ui/gen-ui.c +++ b/project/src/ui/gen-ui.c @@ -75,6 +75,11 @@ bool DefineIntVar ( VarMap_t * vm, ccp varname, int value ) { return false; } #define ARCHIVES_AND "SZS, U8, PACK, BRRES, BREFF, BREFT and RARC" #define ARCHIVES_COMMA "SZS, U8, PACK, BRRES, BREFF, BREFT, RARC" +// create archives +#define CARCHIVES_OR "SZS, U8, PACK, BRRES, BREFF or BREFT" +#define CARCHIVES_AND "SZS, U8, PACK, BRRES, BREFF and BREFT" +#define CARCHIVES_COMMA "SZS, U8, PACK, BRRES, BREFT" + #define MAX_GAMEMODES "1573" #define NO_HEAD_SYNTAX "Suppress the syntax information section in decoded text files." @@ -145,6 +150,10 @@ bool DefineIntVar ( VarMap_t * vm, ccp varname, int value ) { return false; } #define DEPRECATED "[DEPRECATED] " +#define CONFIG_CMD \ + "Show all information about the search" \ + " for the configuration file and its content." + // /////////////////////////////////////////////////////////////////////////////// /////////////// the info table /////////////// diff --git a/project/src/ui/tab-wbmgt.inc b/project/src/ui/tab-wbmgt.inc index 7f63fde..86cb2c7 100644 --- a/project/src/ui/tab-wbmgt.inc +++ b/project/src/ui/tab-wbmgt.inc @@ -59,6 +59,10 @@ "wbmgt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wbmgt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wbmgt ARGTEST ...", 0 /* copy of wszst */ }, @@ -191,6 +195,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -450,6 +457,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wbmgt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wbmgt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wctct.inc b/project/src/ui/tab-wctct.inc index 9d4bbdf..b4f72bc 100644 --- a/project/src/ui/tab-wctct.inc +++ b/project/src/ui/tab-wctct.inc @@ -60,6 +60,10 @@ "wctct HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wctct CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wctct ARGTEST ...", 0 /* copy of wszst */ }, @@ -178,6 +182,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -568,6 +575,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wctct CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wctct ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wimgt.inc b/project/src/ui/tab-wimgt.inc index 6198c13..c41c210 100644 --- a/project/src/ui/tab-wimgt.inc +++ b/project/src/ui/tab-wimgt.inc @@ -60,6 +60,10 @@ "wimgt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wimgt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wimgt ARGTEST ...", 0 /* copy of wszst */ }, @@ -148,6 +152,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -398,6 +405,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wimgt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wimgt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wkclt.inc b/project/src/ui/tab-wkclt.inc index 931b061..9842709 100644 --- a/project/src/ui/tab-wkclt.inc +++ b/project/src/ui/tab-wkclt.inc @@ -59,6 +59,10 @@ "wkclt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wkclt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wkclt ARGTEST ...", 0 /* copy of wszst */ }, @@ -245,6 +249,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -539,6 +546,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wkclt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wkclt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wkmpt.inc b/project/src/ui/tab-wkmpt.inc index 686b547..8fce206 100644 --- a/project/src/ui/tab-wkmpt.inc +++ b/project/src/ui/tab-wkmpt.inc @@ -59,6 +59,10 @@ "wkmpt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wkmpt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wkmpt ARGTEST ...", 0 /* copy of wszst */ }, @@ -245,6 +249,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -664,6 +671,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wkmpt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wkmpt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wlect.inc b/project/src/ui/tab-wlect.inc index e107ced..ae427ea 100644 --- a/project/src/ui/tab-wlect.inc +++ b/project/src/ui/tab-wlect.inc @@ -59,6 +59,10 @@ "wlect HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wlect CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wlect ARGTEST ...", 0 /* copy of wszst */ }, @@ -108,6 +112,10 @@ "This hidden command exports some definitions to standard output." " Use keyword @HELP@ to get a list of possible keywords." }, + { H_DEF_CMD, "DPAD", "_DPAD", + "wszst DPAD number_or_code...", + "This hidden command decodes and encodes D-Pad suquences for LE-CODE." }, + { T_SEP_CMD, 0,0,0,0 }, //----- separator ----- { T_DEF_CMD, "DUMP", "DUMP|D", @@ -197,6 +205,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -470,24 +481,14 @@ "[=mode]", "Enable or disable the speedometer." " Mode is one of @OFF@, @AUTO@ (default, don't change setting)," - " @ON@ (enable it for Wii and WiiU only;" - " default, if option is used without parameter)" - " or @FORCE@ (enable it for Wii, Wii U and for Dolphin)." }, - - { H_OPT_CP, "RESERVED_1B9", "reserved-1b9|reserved1b9", - "[=mode]", - "Set LPAR byte at offset 0x1b9 to this value." - " Value -1 disables this option." }, - - { H_OPT_CP, "RESERVED_1BA", "reserved-1ba|reserved1ba", - "[=mode]", - "Set LPAR byte at offset 0x1ba to this value." - " Value -1 disables this option." }, + " @ON@ (default, if option is used without parameter)" + " or @FRACTION@ (=@1DIGIT@), @2DIGITS@ and @3DIGITS@." }, - { H_OPT_CP, "RESERVED_1BB", "reserved-1bb|reserved1bb", - "[=mode]", - "Set LPAR byte at offset 0x1bb to this value." - " Value -1 disables this option." }, + { T_OPT_CP, "DEBUG", "debug", + "mode", + "Enable or disable the debug output while racing." + " Mode is one of @OFF@, @AUTO@ (default, don't change setting)," + " @USER@ or @100@ to @199@ for predefined setups." }, { T_SEP_OPT, 0,0,0,0 }, //----- separator ----- @@ -629,9 +630,7 @@ { T_COPT, "CUSTOM_TT", 0,0,0 }, { T_COPT, "XPFLAGS", 0,0,0 }, { T_COPT, "SPEEDOMETER", 0,0,0 }, - { H_COPT, "RESERVED_1B9", 0,0,0 }, - { H_COPT, "RESERVED_1BA", 0,0,0 }, - { H_COPT, "RESERVED_1BB", 0,0,0 }, + { T_COPT, "DEBUG", 0,0,0 }, //---------- wlect GROUP PATCH ---------- @@ -701,6 +700,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wlect CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wlect ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, @@ -781,6 +788,10 @@ { T_CMD_BEG, "EXPORT", 0,0,0 }, + //---------- COMMAND wlect _DPAD ---------- + + { T_CMD_BEG, "DPAD", 0,0,0 }, + //---------- COMMAND wlect DUMP ---------- { T_CMD_BEG, "DUMP", 0,0,0 }, diff --git a/project/src/ui/tab-wmdlt.inc b/project/src/ui/tab-wmdlt.inc index d68652a..d95afd1 100644 --- a/project/src/ui/tab-wmdlt.inc +++ b/project/src/ui/tab-wmdlt.inc @@ -59,6 +59,10 @@ "wmdlt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wmdlt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wmdlt ARGTEST ...", 0 /* copy of wszst */ }, @@ -171,6 +175,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -436,6 +443,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wmdlt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wmdlt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wpatt.inc b/project/src/ui/tab-wpatt.inc index fc86f58..e8b2693 100644 --- a/project/src/ui/tab-wpatt.inc +++ b/project/src/ui/tab-wpatt.inc @@ -59,6 +59,10 @@ "wpatt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wpatt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wpatt ARGTEST ...", 0 /* copy of wszst */ }, @@ -139,6 +143,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, 0 /* copy of wszst */ }, @@ -334,6 +341,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wpatt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wpatt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wstrt.inc b/project/src/ui/tab-wstrt.inc index 19ecfa3..291c635 100644 --- a/project/src/ui/tab-wstrt.inc +++ b/project/src/ui/tab-wstrt.inc @@ -60,6 +60,10 @@ "wstrt HELP [--width=wd] [ignored]...", 0 /* copy of wszst */ }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wstrt CONFIG [options]...", + CONFIG_CMD }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wstrt ARGTEST ...", 0 /* copy of wszst */ }, @@ -179,6 +183,9 @@ { T_OPT_S, "XHELP", "xhelp", 0, 0 /* copy of wszst */ }, + { T_OPT_GP, "CONFIG", "config", + 0, 0 /* copy of wszst */ }, + { H_OPT_G, "AT_DUMMY", "@|@", 0, "" }, { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", @@ -860,6 +867,14 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wstrt CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." }, + //---------- COMMAND wstrt ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/tab-wszst.inc b/project/src/ui/tab-wszst.inc index e9e511c..c36da8c 100644 --- a/project/src/ui/tab-wszst.inc +++ b/project/src/ui/tab-wszst.inc @@ -44,7 +44,8 @@ "wszst [option]... command [option|parameter|@file]...", WSZST_LONG " :" " List, compare, (de-)compress, extract and create" - " " ARCHIVES_AND " archives." + " " CARCHIVES_AND " archives." + " Additonally, RARC archive can be extracted." " It is also a wrapper to all other tools." }, // @@ -74,6 +75,12 @@ " The fourth variant prints an overview about all commands" " and all global options." }, + { T_DEF_CMD, "CONFIG", "CONFIG", + "wszst CONFIG [options]...", + CONFIG_CMD + " The command can also export the settings for scripts" + " or can create or update configuration files." }, + { T_DEF_CMD, "ARGTEST", "ARGTEST", "wszst ARGTEST ...", "This debug command accepts all kinds of parameters" @@ -488,7 +495,7 @@ { T_DEF_CMD, "CREATE", "CREATE|C", "wszst CREATE [source_dir]...", - "Create " ARCHIVES_OR " archives by adding all not hidden files" + "Create " CARCHIVES_OR " archives by adding all not hidden files" " of the directory structure." " Create and/or encode sub files if necessary." " The default destination is @'%P/%N%T'@." }, @@ -598,7 +605,7 @@ { T_DEF_CMD, "YAZDUMP", "YAZDUMP|YD", "wszst YAZDUMP [szs]...", - "Analyze YAZ compression print a dump to stdout." + "Analyze YAZ compression and print a dump to stdout." " Ignore files without YAZ compression." }, { T_SEP_CMD, 0,0,0,0 }, //----- separator ----- @@ -623,6 +630,15 @@ "Stop parsing the command line and print a help message" " with all commands included. Exit after printing." }, + { T_OPT_GP, "CONFIG", "config", + "file", + "Define a configuration file or a directory as source." + " In later case, file @'" CONFIG_FILE "'@ is searched." + "\n " + " If option is not not set," + " then file @'" CONFIG_FILE "'@ is searched in different directories." + " Use command @'wszst CONFIG'@ to get more details." }, + { T_OPT_G, "ALLOW_ALL", "allow-all|allowall", 0, "Usually commands accept only options with impact to the command." @@ -1696,7 +1712,7 @@ "Define an alternative directory as autoadd library." " The default is, that the sub-directory called './auto-add/'" " of all search paths are used." - " Use {wszst test -vvvv} for tests." }, + " Use {wszst config -ll} for tests." }, { T_SEP_OPT, 0,0,0,0 }, //----- separator ----- @@ -1836,7 +1852,7 @@ { T_OPT_GP, "VAR", "var", "varname", "Use @VARNAME@ as variable name or prefix on script output." - " The default variabe name is 'res'." }, + " The default value is 'res' for variables and 'res_' as prefix." }, { T_OPT_G, "ARRAY", "array", 0, @@ -1874,6 +1890,10 @@ " a second condition. In this case the feature is excluded" " from printing if *any* set keywords match." }, + { T_OPT_C, "INSTALL", "install", + 0, + "Manage configuration for an installation." }, + { T_SEP_OPT, 0,0,0,0 }, //----- separator ----- { H_OPT_CP, "ANALYZE", "analyze|analyse", @@ -2431,6 +2451,9 @@ { T_GRP_BEG, "SCRIPT", 0,0,0 }, + { T_COPT, "SECTIONS", 0,0, + "Dump info using configuration or section syntax." + " Use {--var name} as prefix." }, { T_COPT, "SH", 0,0,0 }, { T_COPT, "BASH", 0,0,0 }, { T_COPT, "JSON", 0,0,0 }, @@ -2577,6 +2600,22 @@ { T_COPT, "MAX_WIDTH", 0,0,0 }, { T_ALL_OPT, 0, 0,0,0 }, + //---------- COMMAND wszst CONFIG ---------- + + { T_CMD_BEG, "CONFIG", 0,0,0 }, + + { T_COPT, "CONFIG", 0,0,0 }, + { T_COPT, "INSTALL", 0,0,0 }, + { T_COPT, "AUTOADD_PATH", 0,0,0 }, + { T_COPT, "LONG", 0,0, + "If set, print the search list too." + " If set twice, print the auto-add search list too." + " This option is ignored, if any script output is enabled." }, + { T_SEP_OPT, 0,0,0,0 }, + { T_COPY_GRP, "SCRIPT", 0,0,0 }, + { T_COPT, "BRIEF", 0,0, + "If printed as sections, exclude all comments." }, + //---------- COMMAND wszst ARGTEST ---------- { T_CMD_BEG, "ARGTEST", 0,0,0 }, diff --git a/project/src/ui/ui-wbmgt.c b/project/src/ui/ui-wbmgt.c index 598864e..1ab1049 100644 --- a/project/src/ui/ui-wbmgt.c +++ b/project/src/ui/ui-wbmgt.c @@ -313,6 +313,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -522,7 +531,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 62 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 63 }; @@ -544,6 +553,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -607,6 +622,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -644,6 +660,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -800,43 +817,44 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_POINTS, - /* 0x08c */ OPT_UTF_8, - /* 0x08d */ OPT_NO_UTF_8, - /* 0x08e */ OPT_FORCE, - /* 0x08f */ OPT_REPAIR_MAGICS, - /* 0x090 */ OPT_OLD, - /* 0x091 */ OPT_STD, - /* 0x092 */ OPT_NEW, - /* 0x093 */ OPT_EXTRACT, - /* 0x094 */ OPT_NUMBER, - /* 0x095 */ OPT_ALIGN, - /* 0x096 */ OPT_MACRO_BMG, - /* 0x097 */ OPT_FILTER_BMG, - /* 0x098 */ OPT_BMG_ENDIAN, - /* 0x099 */ OPT_BMG_ENCODING, - /* 0x09a */ OPT_BMG_INF_SIZE, - /* 0x09b */ OPT_BMG_MID, - /* 0x09c */ OPT_FORCE_ATTRIB, - /* 0x09d */ OPT_DEF_ATTRIB, - /* 0x09e */ OPT_NO_ATTRIB, - /* 0x09f */ OPT_X_ESCAPES, - /* 0x0a0 */ OPT_OLD_ESCAPES, - /* 0x0a1 */ OPT_NO_BMG_COLORS, - /* 0x0a2 */ OPT_BMG_COLORS, - /* 0x0a3 */ OPT_NO_BMG_INLINE, - /* 0x0a4 */ OPT_SECTIONS, - /* 0x0a5 */ 0,0,0,0, 0,0,0,0, 0,0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_POINTS, + /* 0x08d */ OPT_UTF_8, + /* 0x08e */ OPT_NO_UTF_8, + /* 0x08f */ OPT_FORCE, + /* 0x090 */ OPT_REPAIR_MAGICS, + /* 0x091 */ OPT_OLD, + /* 0x092 */ OPT_STD, + /* 0x093 */ OPT_NEW, + /* 0x094 */ OPT_EXTRACT, + /* 0x095 */ OPT_NUMBER, + /* 0x096 */ OPT_ALIGN, + /* 0x097 */ OPT_MACRO_BMG, + /* 0x098 */ OPT_FILTER_BMG, + /* 0x099 */ OPT_BMG_ENDIAN, + /* 0x09a */ OPT_BMG_ENCODING, + /* 0x09b */ OPT_BMG_INF_SIZE, + /* 0x09c */ OPT_BMG_MID, + /* 0x09d */ OPT_FORCE_ATTRIB, + /* 0x09e */ OPT_DEF_ATTRIB, + /* 0x09f */ OPT_NO_ATTRIB, + /* 0x0a0 */ OPT_X_ESCAPES, + /* 0x0a1 */ OPT_OLD_ESCAPES, + /* 0x0a2 */ OPT_NO_BMG_COLORS, + /* 0x0a3 */ OPT_BMG_COLORS, + /* 0x0a4 */ OPT_NO_BMG_INLINE, + /* 0x0a5 */ OPT_SECTIONS, + /* 0x0a6 */ 0,0,0,0, 0,0,0,0, 0,0, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -865,115 +883,121 @@ static u8 option_allowed_cmd_HELP[32] = // cmd #2 1,1 }; -static u8 option_allowed_cmd_ARGTEST[32] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[32] = // cmd #3 +{ + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[32] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_TEST[32] = // cmd #4 +static u8 option_allowed_cmd_TEST[32] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_COLORS[32] = // cmd #5 +static u8 option_allowed_cmd_COLORS[32] = // cmd #6 { 0,1,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ERROR[32] = // cmd #6 +static u8 option_allowed_cmd_ERROR[32] = // cmd #7 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1 }; -static u8 option_allowed_cmd_FILETYPE[32] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[32] = // cmd #8 { 0,1,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FILEATTRIB[32] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[32] = // cmd #9 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_POINTS[32] = // cmd #9 +static u8 option_allowed_cmd_POINTS[32] = // cmd #10 { 0,1,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_REGEXP[32] = // cmd #10 +static u8 option_allowed_cmd_REGEXP[32] = // cmd #11 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_EXTRACT[32] = // cmd #11 +static u8 option_allowed_cmd_EXTRACT[32] = // cmd #12 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_SECTIONS[32] = // cmd #12 +static u8 option_allowed_cmd_SECTIONS[32] = // cmd #13 { 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_LIST[32] = // cmd #13 +static u8 option_allowed_cmd_LIST[32] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_SLOTS[32] = // cmd #14 +static u8 option_allowed_cmd_SLOTS[32] = // cmd #15 { 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_DIFF[32] = // cmd #15 +static u8 option_allowed_cmd_DIFF[32] = // cmd #16 { 0,0,0,0,1, 0,1,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CAT[32] = // cmd #16 +static u8 option_allowed_cmd_CAT[32] = // cmd #17 { 0,1,1,1,0, 0,0,0,0,0, 0,0,1,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_MIX[32] = // cmd #17 +static u8 option_allowed_cmd_MIX[32] = // cmd #18 { 0,1,1,1,0, 0,0,0,0,0, 0,0,1,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_IDENTIFIER[32] = // cmd #18 +static u8 option_allowed_cmd_IDENTIFIER[32] = // cmd #19 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_DECODE[32] = // cmd #19 +static u8 option_allowed_cmd_DECODE[32] = // cmd #20 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_ENCODE[32] = // cmd #20 +static u8 option_allowed_cmd_ENCODE[32] = // cmd #21 { 0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_PATCH[32] = // cmd #21 +static u8 option_allowed_cmd_PATCH[32] = // cmd #22 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 @@ -990,6 +1014,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1035,6 +1060,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1369,7 +1402,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wbmgt [option]... command [option|parameter|file]...", "Wiimms BMG Tool : Convert and patch raw and text BMG (message) files.", 0, - 24, + 25, option_tab_tool, 0 }, @@ -1412,6 +1445,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wbmgt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wbmgt.h b/project/src/ui/ui-wbmgt.h index 722ed02..f828bab 100644 --- a/project/src/ui/ui-wbmgt.h +++ b/project/src/ui/ui-wbmgt.h @@ -95,6 +95,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -123,7 +124,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 62 + OPT__N_TOTAL // == 63 } enumOptions; @@ -205,6 +206,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -297,6 +300,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -320,7 +324,7 @@ typedef enum enumCommands CMD_PATCH, - CMD__N // == 22 + CMD__N // == 23 } enumCommands; @@ -361,6 +365,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wctct.c b/project/src/ui/ui-wctct.c index 8569f2c..2edbaab 100644 --- a/project/src/ui/ui-wctct.c +++ b/project/src/ui/ui-wctct.c @@ -413,6 +413,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -653,7 +662,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " 0x3b:0x41 and 0x44:0xfe." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 81 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 82 }; @@ -681,6 +690,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -800,6 +815,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -835,6 +851,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -1018,61 +1035,62 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_OLD_SPINY, - /* 0x08b */ OPT_CRS1, - /* 0x08c */ OPT_CHDIR, - /* 0x08d */ OPT_ROUND, - /* 0x08e */ OPT_RAW, - /* 0x08f */ OPT_BMG_ENDIAN, - /* 0x090 */ OPT_BMG_ENCODING, - /* 0x091 */ OPT_BMG_INF_SIZE, - /* 0x092 */ OPT_BMG_MID, - /* 0x093 */ OPT_FORCE_ATTRIB, - /* 0x094 */ OPT_DEF_ATTRIB, - /* 0x095 */ OPT_NO_ATTRIB, - /* 0x096 */ OPT_X_ESCAPES, - /* 0x097 */ OPT_OLD_ESCAPES, - /* 0x098 */ OPT_NO_BMG_COLORS, - /* 0x099 */ OPT_BMG_COLORS, - /* 0x09a */ OPT_NO_BMG_INLINE, - /* 0x09b */ OPT_NO_ECHO, - /* 0x09c */ OPT_UTF_8, - /* 0x09d */ OPT_NO_UTF_8, - /* 0x09e */ OPT_FORCE, - /* 0x09f */ OPT_REPAIR_MAGICS, - /* 0x0a0 */ OPT_OLD, - /* 0x0a1 */ OPT_STD, - /* 0x0a2 */ OPT_NEW, - /* 0x0a3 */ OPT_EXTRACT, - /* 0x0a4 */ OPT_LIST, - /* 0x0a5 */ OPT_REF, - /* 0x0a6 */ OPT_FULL, - /* 0x0a7 */ OPT_HEX, - /* 0x0a8 */ OPT_CT_DIR, - /* 0x0a9 */ OPT_CT_LOG, - /* 0x0aa */ OPT_ALLOW_SLOTS, - /* 0x0ab */ OPT_IMAGES, - /* 0x0ac */ OPT_LOAD_BMG, - /* 0x0ad */ OPT_PATCH_BMG, - /* 0x0ae */ OPT_MACRO_BMG, - /* 0x0af */ OPT_FILTER_BMG, - /* 0x0b0 */ OPT_PATCH_NAMES, - /* 0x0b1 */ OPT_ORDER_BY, - /* 0x0b2 */ OPT_ORDER_ALL, - /* 0x0b3 */ OPT_DYNAMIC, - /* 0x0b4 */ OPT_WRITE_TRACKS, - /* 0x0b5 */ OPT_NUMBER, - /* 0x0b6 */ OPT_SECTIONS, - /* 0x0b7 */ 0,0,0,0, 0,0,0,0, 0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_OLD_SPINY, + /* 0x08c */ OPT_CRS1, + /* 0x08d */ OPT_CHDIR, + /* 0x08e */ OPT_ROUND, + /* 0x08f */ OPT_RAW, + /* 0x090 */ OPT_BMG_ENDIAN, + /* 0x091 */ OPT_BMG_ENCODING, + /* 0x092 */ OPT_BMG_INF_SIZE, + /* 0x093 */ OPT_BMG_MID, + /* 0x094 */ OPT_FORCE_ATTRIB, + /* 0x095 */ OPT_DEF_ATTRIB, + /* 0x096 */ OPT_NO_ATTRIB, + /* 0x097 */ OPT_X_ESCAPES, + /* 0x098 */ OPT_OLD_ESCAPES, + /* 0x099 */ OPT_NO_BMG_COLORS, + /* 0x09a */ OPT_BMG_COLORS, + /* 0x09b */ OPT_NO_BMG_INLINE, + /* 0x09c */ OPT_NO_ECHO, + /* 0x09d */ OPT_UTF_8, + /* 0x09e */ OPT_NO_UTF_8, + /* 0x09f */ OPT_FORCE, + /* 0x0a0 */ OPT_REPAIR_MAGICS, + /* 0x0a1 */ OPT_OLD, + /* 0x0a2 */ OPT_STD, + /* 0x0a3 */ OPT_NEW, + /* 0x0a4 */ OPT_EXTRACT, + /* 0x0a5 */ OPT_LIST, + /* 0x0a6 */ OPT_REF, + /* 0x0a7 */ OPT_FULL, + /* 0x0a8 */ OPT_HEX, + /* 0x0a9 */ OPT_CT_DIR, + /* 0x0aa */ OPT_CT_LOG, + /* 0x0ab */ OPT_ALLOW_SLOTS, + /* 0x0ac */ OPT_IMAGES, + /* 0x0ad */ OPT_LOAD_BMG, + /* 0x0ae */ OPT_PATCH_BMG, + /* 0x0af */ OPT_MACRO_BMG, + /* 0x0b0 */ OPT_FILTER_BMG, + /* 0x0b1 */ OPT_PATCH_NAMES, + /* 0x0b2 */ OPT_ORDER_BY, + /* 0x0b3 */ OPT_ORDER_ALL, + /* 0x0b4 */ OPT_DYNAMIC, + /* 0x0b5 */ OPT_WRITE_TRACKS, + /* 0x0b6 */ OPT_NUMBER, + /* 0x0b7 */ OPT_SECTIONS, + /* 0x0b8 */ 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -1100,115 +1118,121 @@ static u8 option_allowed_cmd_HELP[47] = // cmd #2 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_ARGTEST[47] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[47] = // cmd #3 +{ + 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[47] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_TEST[47] = // cmd #4 +static u8 option_allowed_cmd_TEST[47] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_COLORS[47] = // cmd #5 +static u8 option_allowed_cmd_COLORS[47] = // cmd #6 { 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ERROR[47] = // cmd #6 +static u8 option_allowed_cmd_ERROR[47] = // cmd #7 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1 }; -static u8 option_allowed_cmd_FILETYPE[47] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[47] = // cmd #8 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[47] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[47] = // cmd #9 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_SYMBOLS[47] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[47] = // cmd #10 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[47] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[47] = // cmd #11 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CALCULATE[47] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[47] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FLOAT[47] = // cmd #12 +static u8 option_allowed_cmd_FLOAT[47] = // cmd #13 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_EXPORT[47] = // cmd #13 +static u8 option_allowed_cmd_EXPORT[47] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_RAWDUMP[47] = // cmd #14 +static u8 option_allowed_cmd_RAWDUMP[47] = // cmd #15 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_DUMP[47] = // cmd #15 +static u8 option_allowed_cmd_DUMP[47] = // cmd #16 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CAT[47] = // cmd #16 +static u8 option_allowed_cmd_CAT[47] = // cmd #17 { 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_BMG[47] = // cmd #17 +static u8 option_allowed_cmd_BMG[47] = // cmd #18 { 0,0,1,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_TRACKS[47] = // cmd #18 +static u8 option_allowed_cmd_TRACKS[47] = // cmd #19 { 0,0,1,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_DECODE[47] = // cmd #19 +static u8 option_allowed_cmd_DECODE[47] = // cmd #20 { 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,1,1,1, 1,1,0,1,1, 1,1,1,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_CREATE[47] = // cmd #20 +static u8 option_allowed_cmd_CREATE[47] = // cmd #21 { 0,0,1,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,1,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_PATCH[47] = // cmd #21 +static u8 option_allowed_cmd_PATCH[47] = // cmd #22 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,1,1, 1,1,1,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,0 @@ -1225,6 +1249,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1275,6 +1300,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1601,7 +1634,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Wiimms CT-CODE Tool : Manage the CT-CODE extension. BRRES, TEX0," " CT-CODE, CT-TEXT and LE-BIN files are accepted as input.", 0, - 26, + 27, option_tab_tool, 0 }, @@ -1644,6 +1677,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wctct CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wctct.h b/project/src/ui/ui-wctct.h index cfe351a..624b94a 100644 --- a/project/src/ui/ui-wctct.h +++ b/project/src/ui/ui-wctct.h @@ -110,6 +110,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -142,7 +143,7 @@ typedef enum enumOptions OPT_CT_LOG, OPT_ALLOW_SLOTS, - OPT__N_TOTAL // == 81 + OPT__N_TOTAL // == 82 } enumOptions; @@ -241,6 +242,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -367,6 +370,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -389,7 +393,7 @@ typedef enum enumCommands CMD_PATCH, - CMD__N // == 22 + CMD__N // == 23 } enumCommands; @@ -431,6 +435,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wimgt.c b/project/src/ui/ui-wimgt.c index 0fae748..b2742d6 100644 --- a/project/src/ui/ui-wimgt.c +++ b/project/src/ui/ui-wimgt.c @@ -276,6 +276,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -473,7 +482,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 55 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 56 }; @@ -495,6 +504,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -554,6 +569,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -585,6 +601,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -725,36 +742,37 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x078 x */ OPT_TRANSFORM, /* 0x079 */ 0,0,0,0, 0,0,0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_UTF_8, - /* 0x08c */ OPT_NO_UTF_8, - /* 0x08d */ OPT_FORCE, - /* 0x08e */ OPT_REPAIR_MAGICS, - /* 0x08f */ OPT_OLD, - /* 0x090 */ OPT_STD, - /* 0x091 */ OPT_NEW, - /* 0x092 */ OPT_EXTRACT, - /* 0x093 */ OPT_NUMBER, - /* 0x094 */ OPT_MIPMAPS, - /* 0x095 */ OPT_NO_MIPMAPS, - /* 0x096 */ OPT_N_MIPMAPS, - /* 0x097 */ OPT_MAX_MIPMAPS, - /* 0x098 */ OPT_MIPMAP_SIZE, - /* 0x099 */ OPT_FAST_MIPMAPS, - /* 0x09a */ OPT_CMPR_DEFAULT, - /* 0x09b */ OPT_PRE_CONVERT, - /* 0x09c */ OPT_STRIP, - /* 0x09d */ OPT_SECTIONS, - /* 0x09e */ 0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_UTF_8, + /* 0x08d */ OPT_NO_UTF_8, + /* 0x08e */ OPT_FORCE, + /* 0x08f */ OPT_REPAIR_MAGICS, + /* 0x090 */ OPT_OLD, + /* 0x091 */ OPT_STD, + /* 0x092 */ OPT_NEW, + /* 0x093 */ OPT_EXTRACT, + /* 0x094 */ OPT_NUMBER, + /* 0x095 */ OPT_MIPMAPS, + /* 0x096 */ OPT_NO_MIPMAPS, + /* 0x097 */ OPT_N_MIPMAPS, + /* 0x098 */ OPT_MAX_MIPMAPS, + /* 0x099 */ OPT_MIPMAP_SIZE, + /* 0x09a */ OPT_FAST_MIPMAPS, + /* 0x09b */ OPT_CMPR_DEFAULT, + /* 0x09c */ OPT_PRE_CONVERT, + /* 0x09d */ OPT_STRIP, + /* 0x09e */ OPT_SECTIONS, + /* 0x09f */ 0, /* 0x0a0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -782,67 +800,72 @@ static u8 option_allowed_cmd_HELP[26] = // cmd #2 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1 }; -static u8 option_allowed_cmd_ARGTEST[26] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[26] = // cmd #3 +{ + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 +}; + +static u8 option_allowed_cmd_ARGTEST[26] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1 }; -static u8 option_allowed_cmd_TEST[26] = // cmd #4 +static u8 option_allowed_cmd_TEST[26] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1 }; -static u8 option_allowed_cmd_COLORS[26] = // cmd #5 +static u8 option_allowed_cmd_COLORS[26] = // cmd #6 { 0,1,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_ERROR[26] = // cmd #6 +static u8 option_allowed_cmd_ERROR[26] = // cmd #7 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1 }; -static u8 option_allowed_cmd_FILETYPE[26] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[26] = // cmd #8 { 0,1,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_FILEATTRIB[26] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[26] = // cmd #9 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_LIST[26] = // cmd #9 +static u8 option_allowed_cmd_LIST[26] = // cmd #10 { 0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_LIST_L[26] = // cmd #10 +static u8 option_allowed_cmd_LIST_L[26] = // cmd #11 { 0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_LIST_LL[26] = // cmd #11 +static u8 option_allowed_cmd_LIST_LL[26] = // cmd #12 { 0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_DECODE[26] = // cmd #12 +static u8 option_allowed_cmd_DECODE[26] = // cmd #13 { 0,0,0,0,1, 1,1,1,1,1, 1,1,1,0,1, 1,1,1,1,1, 1,1,1,1,1, 0 }; -static u8 option_allowed_cmd_ENCODE[26] = // cmd #13 +static u8 option_allowed_cmd_ENCODE[26] = // cmd #14 { 0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0 }; -static u8 option_allowed_cmd_CONVERT[26] = // cmd #14 +static u8 option_allowed_cmd_CONVERT[26] = // cmd #15 { 0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0 }; -static u8 option_allowed_cmd_COPY[26] = // cmd #15 +static u8 option_allowed_cmd_COPY[26] = // cmd #16 { 0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0 }; @@ -858,6 +881,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -900,6 +924,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1135,7 +1167,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Wiimms Image Tool : Extract and convert graphic images. The file" " formats TPL, TEX, BTI, BREFT and PNG are supported.", 0, - 21, + 22, option_tab_tool, 0 }, @@ -1178,6 +1210,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wimgt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wimgt.h b/project/src/ui/ui-wimgt.h index 42d5994..e7cfe21 100644 --- a/project/src/ui/ui-wimgt.h +++ b/project/src/ui/ui-wimgt.h @@ -89,6 +89,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -116,7 +117,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 55 + OPT__N_TOTAL // == 56 } enumOptions; @@ -186,6 +187,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -237,6 +240,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -254,7 +258,7 @@ typedef enum enumCommands CMD_COPY, - CMD__N // == 16 + CMD__N // == 17 } enumCommands; @@ -294,6 +298,7 @@ typedef enum enumGetOpt GO_TRANSFORM = 'x', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wkclt.c b/project/src/ui/ui-wkclt.c index 2102123..5918bdc 100644 --- a/project/src/ui/ui-wkclt.c +++ b/project/src/ui/ui-wkclt.c @@ -385,6 +385,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -633,7 +642,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 71 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 72 }; @@ -661,6 +670,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_TEST_VERBOSE = { OPT_VERBOSE, false, false, false, false, false, 'v', "verbose", 0, @@ -840,6 +855,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -883,6 +899,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -1035,53 +1052,53 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_SCALE, - /* 0x08c */ OPT_SHIFT, - /* 0x08d */ OPT_XSS, - /* 0x08e */ OPT_YSS, - /* 0x08f */ OPT_ZSS, - /* 0x090 */ OPT_ROT, - /* 0x091 */ OPT_XROT, - /* 0x092 */ OPT_YROT, - /* 0x093 */ OPT_ZROT, - /* 0x094 */ OPT_TRANSLATE, - /* 0x095 */ OPT_NULL, - /* 0x096 */ OPT_NEXT, - /* 0x097 */ OPT_ASCALE, - /* 0x098 */ OPT_AROT, - /* 0x099 */ OPT_TFORM_SCRIPT, - /* 0x09a */ OPT_KCL, - /* 0x09b */ OPT_KCL_FLAG, - /* 0x09c */ OPT_KCL_SCRIPT, - /* 0x09d */ OPT_TRI_AREA, - /* 0x09e */ OPT_TRI_HEIGHT, - /* 0x09f */ OPT_FLAG_FILE, - /* 0x0a0 */ OPT_XTRIDATA, - /* 0x0a1 */ OPT_SLOT, - /* 0x0a2 */ OPT_ROUND, - /* 0x0a3 */ OPT_NO_ECHO, - /* 0x0a4 */ OPT_UTF_8, - /* 0x0a5 */ OPT_NO_UTF_8, - /* 0x0a6 */ OPT_FORCE, - /* 0x0a7 */ OPT_REPAIR_MAGICS, - /* 0x0a8 */ OPT_TINY, - /* 0x0a9 */ OPT_OLD, - /* 0x0aa */ OPT_STD, - /* 0x0ab */ OPT_NEW, - /* 0x0ac */ OPT_EXTRACT, - /* 0x0ad */ OPT_NUMBER, - /* 0x0ae */ OPT_SECTIONS, - /* 0x0af */ 0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_SCALE, + /* 0x08d */ OPT_SHIFT, + /* 0x08e */ OPT_XSS, + /* 0x08f */ OPT_YSS, + /* 0x090 */ OPT_ZSS, + /* 0x091 */ OPT_ROT, + /* 0x092 */ OPT_XROT, + /* 0x093 */ OPT_YROT, + /* 0x094 */ OPT_ZROT, + /* 0x095 */ OPT_TRANSLATE, + /* 0x096 */ OPT_NULL, + /* 0x097 */ OPT_NEXT, + /* 0x098 */ OPT_ASCALE, + /* 0x099 */ OPT_AROT, + /* 0x09a */ OPT_TFORM_SCRIPT, + /* 0x09b */ OPT_KCL, + /* 0x09c */ OPT_KCL_FLAG, + /* 0x09d */ OPT_KCL_SCRIPT, + /* 0x09e */ OPT_TRI_AREA, + /* 0x09f */ OPT_TRI_HEIGHT, + /* 0x0a0 */ OPT_FLAG_FILE, + /* 0x0a1 */ OPT_XTRIDATA, + /* 0x0a2 */ OPT_SLOT, + /* 0x0a3 */ OPT_ROUND, + /* 0x0a4 */ OPT_NO_ECHO, + /* 0x0a5 */ OPT_UTF_8, + /* 0x0a6 */ OPT_NO_UTF_8, + /* 0x0a7 */ OPT_FORCE, + /* 0x0a8 */ OPT_REPAIR_MAGICS, + /* 0x0a9 */ OPT_TINY, + /* 0x0aa */ OPT_OLD, + /* 0x0ab */ OPT_STD, + /* 0x0ac */ OPT_NEW, + /* 0x0ad */ OPT_EXTRACT, + /* 0x0ae */ OPT_NUMBER, + /* 0x0af */ OPT_SECTIONS, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -1110,163 +1127,169 @@ static u8 option_allowed_cmd_HELP[37] = // cmd #2 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_ARGTEST[37] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[37] = // cmd #3 +{ + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[37] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_TEST[37] = // cmd #4 +static u8 option_allowed_cmd_TEST[37] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_COLORS[37] = // cmd #5 +static u8 option_allowed_cmd_COLORS[37] = // cmd #6 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ERROR[37] = // cmd #6 +static u8 option_allowed_cmd_ERROR[37] = // cmd #7 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,1 }; -static u8 option_allowed_cmd_FILETYPE[37] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[37] = // cmd #8 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[37] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[37] = // cmd #9 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_SYMBOLS[37] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[37] = // cmd #10 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[37] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[37] = // cmd #11 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CALCULATE[37] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[37] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_MATRIX[37] = // cmd #12 +static u8 option_allowed_cmd_MATRIX[37] = // cmd #13 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FLOAT[37] = // cmd #13 +static u8 option_allowed_cmd_FLOAT[37] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_EXPORT[37] = // cmd #14 +static u8 option_allowed_cmd_EXPORT[37] = // cmd #15 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CAT[37] = // cmd #15 +static u8 option_allowed_cmd_CAT[37] = // cmd #16 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_DECODE[37] = // cmd #16 +static u8 option_allowed_cmd_DECODE[37] = // cmd #17 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_ENCODE[37] = // cmd #17 +static u8 option_allowed_cmd_ENCODE[37] = // cmd #18 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_COPY[37] = // cmd #18 +static u8 option_allowed_cmd_COPY[37] = // cmd #19 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_CFF[37] = // cmd #19 +static u8 option_allowed_cmd_CFF[37] = // cmd #20 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,1,0,1,0, 1,1,1,1,1, 1,1,1,1,1, 1,0 }; -static u8 option_allowed_cmd_FLAGS[37] = // cmd #20 +static u8 option_allowed_cmd_FLAGS[37] = // cmd #21 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,1,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_DUMP[37] = // cmd #21 +static u8 option_allowed_cmd_DUMP[37] = // cmd #22 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_DBRIEF[37] = // cmd #22 +static u8 option_allowed_cmd_DBRIEF[37] = // cmd #23 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_LIST[37] = // cmd #23 +static u8 option_allowed_cmd_LIST[37] = // cmd #24 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_TRIANGLES[37] = // cmd #24 +static u8 option_allowed_cmd_TRIANGLES[37] = // cmd #25 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_TRAVERSE[37] = // cmd #25 +static u8 option_allowed_cmd_TRAVERSE[37] = // cmd #26 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_FALL[37] = // cmd #26 +static u8 option_allowed_cmd_FALL[37] = // cmd #27 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,1,0,1,0, 0,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_CHECK[37] = // cmd #27 +static u8 option_allowed_cmd_CHECK[37] = // cmd #28 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,1,0, 1,1,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_ANALYZE[37] = // cmd #28 +static u8 option_allowed_cmd_ANALYZE[37] = // cmd #29 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_BLOW[37] = // cmd #29 +static u8 option_allowed_cmd_BLOW[37] = // cmd #30 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0 @@ -1283,6 +1306,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1329,6 +1353,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1970,7 +2002,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Wiimms KCL Tool : Analyze, modify, export and create KCL and OBJ" " files.", 0, - 25, + 26, option_tab_tool, 0 }, @@ -2013,6 +2045,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wkclt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wkclt.h b/project/src/ui/ui-wkclt.h index 41097b5..9d389d4 100644 --- a/project/src/ui/ui-wkclt.h +++ b/project/src/ui/ui-wkclt.h @@ -100,6 +100,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -132,7 +133,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 71 + OPT__N_TOTAL // == 72 } enumOptions; @@ -225,6 +226,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -341,6 +344,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -371,7 +375,7 @@ typedef enum enumCommands CMD_BLOW, - CMD__N // == 30 + CMD__N // == 31 } enumCommands; @@ -410,6 +414,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wkmpt.c b/project/src/ui/ui-wkmpt.c index 5a47964..a8c041e 100644 --- a/project/src/ui/ui-wkmpt.c +++ b/project/src/ui/ui-wkmpt.c @@ -505,6 +505,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -858,7 +867,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 92 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 93 }; @@ -886,6 +895,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_TEST_VERBOSE = { OPT_VERBOSE, false, false, false, false, false, 'v', "verbose", 0, @@ -1091,6 +1106,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -1135,6 +1151,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -1326,71 +1343,72 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x077 w */ OPT_DRAW, /* 0x078 */ 0,0,0,0, 0,0,0,0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_SCALE, - /* 0x08c */ OPT_SHIFT, - /* 0x08d */ OPT_XSS, - /* 0x08e */ OPT_YSS, - /* 0x08f */ OPT_ZSS, - /* 0x090 */ OPT_ROT, - /* 0x091 */ OPT_XROT, - /* 0x092 */ OPT_YROT, - /* 0x093 */ OPT_ZROT, - /* 0x094 */ OPT_YPOS, - /* 0x095 */ OPT_TRANSLATE, - /* 0x096 */ OPT_NULL, - /* 0x097 */ OPT_NEXT, - /* 0x098 */ OPT_ASCALE, - /* 0x099 */ OPT_AROT, - /* 0x09a */ OPT_TFORM_SCRIPT, - /* 0x09b */ OPT_RM_GOBJ, - /* 0x09c */ OPT_BATTLE, - /* 0x09d */ OPT_EXPORT_FLAGS, - /* 0x09e */ OPT_ROUTE_OPTIONS, - /* 0x09f */ OPT_WIM0, - /* 0x0a0 */ OPT_SLOT, - /* 0x0a1 */ OPT_POS_MODE, - /* 0x0a2 */ OPT_POS_FILE, - /* 0x0a3 */ OPT_PNG, - /* 0x0a4 */ OPT_LOAD_KCL, - /* 0x0a5 */ OPT_KCL, - /* 0x0a6 */ OPT_KCL_FLAG, - /* 0x0a7 */ OPT_KCL_SCRIPT, - /* 0x0a8 */ OPT_TRI_AREA, - /* 0x0a9 */ OPT_TRI_HEIGHT, - /* 0x0aa */ OPT_FLAG_FILE, - /* 0x0ab */ OPT_XTRIDATA, - /* 0x0ac */ OPT_KMP, - /* 0x0ad */ OPT_SPEED_MOD, - /* 0x0ae */ OPT_KTPT2, - /* 0x0af */ OPT_TFORM_KMP, - /* 0x0b0 */ OPT_REPAIR_XPF, - /* 0x0b1 */ OPT_GAMEMODES, - /* 0x0b2 */ OPT_ROUND, - /* 0x0b3 */ OPT_EPSILON, - /* 0x0b4 */ OPT_DIFF, - /* 0x0b5 */ OPT_NO_ECHO, - /* 0x0b6 */ OPT_UTF_8, - /* 0x0b7 */ OPT_NO_UTF_8, - /* 0x0b8 */ OPT_FORCE, - /* 0x0b9 */ OPT_REPAIR_MAGICS, - /* 0x0ba */ OPT_TINY, - /* 0x0bb */ OPT_OLD, - /* 0x0bc */ OPT_STD, - /* 0x0bd */ OPT_NEW, - /* 0x0be */ OPT_EXTRACT, - /* 0x0bf */ OPT_NUMBER, - /* 0x0c0 */ OPT_SECTIONS, - /* 0x0c1 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_SCALE, + /* 0x08d */ OPT_SHIFT, + /* 0x08e */ OPT_XSS, + /* 0x08f */ OPT_YSS, + /* 0x090 */ OPT_ZSS, + /* 0x091 */ OPT_ROT, + /* 0x092 */ OPT_XROT, + /* 0x093 */ OPT_YROT, + /* 0x094 */ OPT_ZROT, + /* 0x095 */ OPT_YPOS, + /* 0x096 */ OPT_TRANSLATE, + /* 0x097 */ OPT_NULL, + /* 0x098 */ OPT_NEXT, + /* 0x099 */ OPT_ASCALE, + /* 0x09a */ OPT_AROT, + /* 0x09b */ OPT_TFORM_SCRIPT, + /* 0x09c */ OPT_RM_GOBJ, + /* 0x09d */ OPT_BATTLE, + /* 0x09e */ OPT_EXPORT_FLAGS, + /* 0x09f */ OPT_ROUTE_OPTIONS, + /* 0x0a0 */ OPT_WIM0, + /* 0x0a1 */ OPT_SLOT, + /* 0x0a2 */ OPT_POS_MODE, + /* 0x0a3 */ OPT_POS_FILE, + /* 0x0a4 */ OPT_PNG, + /* 0x0a5 */ OPT_LOAD_KCL, + /* 0x0a6 */ OPT_KCL, + /* 0x0a7 */ OPT_KCL_FLAG, + /* 0x0a8 */ OPT_KCL_SCRIPT, + /* 0x0a9 */ OPT_TRI_AREA, + /* 0x0aa */ OPT_TRI_HEIGHT, + /* 0x0ab */ OPT_FLAG_FILE, + /* 0x0ac */ OPT_XTRIDATA, + /* 0x0ad */ OPT_KMP, + /* 0x0ae */ OPT_SPEED_MOD, + /* 0x0af */ OPT_KTPT2, + /* 0x0b0 */ OPT_TFORM_KMP, + /* 0x0b1 */ OPT_REPAIR_XPF, + /* 0x0b2 */ OPT_GAMEMODES, + /* 0x0b3 */ OPT_ROUND, + /* 0x0b4 */ OPT_EPSILON, + /* 0x0b5 */ OPT_DIFF, + /* 0x0b6 */ OPT_NO_ECHO, + /* 0x0b7 */ OPT_UTF_8, + /* 0x0b8 */ OPT_NO_UTF_8, + /* 0x0b9 */ OPT_FORCE, + /* 0x0ba */ OPT_REPAIR_MAGICS, + /* 0x0bb */ OPT_TINY, + /* 0x0bc */ OPT_OLD, + /* 0x0bd */ OPT_STD, + /* 0x0be */ OPT_NEW, + /* 0x0bf */ OPT_EXTRACT, + /* 0x0c0 */ OPT_NUMBER, + /* 0x0c1 */ OPT_SECTIONS, + /* 0x0c2 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0f0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -1417,163 +1435,169 @@ static u8 option_allowed_cmd_HELP[49] = // cmd #2 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 }; -static u8 option_allowed_cmd_ARGTEST[49] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[49] = // cmd #3 +{ + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[49] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 }; -static u8 option_allowed_cmd_TEST[49] = // cmd #4 +static u8 option_allowed_cmd_TEST[49] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 }; -static u8 option_allowed_cmd_COLORS[49] = // cmd #5 +static u8 option_allowed_cmd_COLORS[49] = // cmd #6 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_ERROR[49] = // cmd #6 +static u8 option_allowed_cmd_ERROR[49] = // cmd #7 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[49] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[49] = // cmd #8 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[49] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[49] = // cmd #9 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[49] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[49] = // cmd #10 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[49] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[49] = // cmd #11 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[49] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[49] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_MATRIX[49] = // cmd #12 +static u8 option_allowed_cmd_MATRIX[49] = // cmd #13 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,1,0,0,1, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_FLOAT[49] = // cmd #13 +static u8 option_allowed_cmd_FLOAT[49] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_STARTPOS[49] = // cmd #14 +static u8 option_allowed_cmd_STARTPOS[49] = // cmd #15 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_OBJECTS[49] = // cmd #15 +static u8 option_allowed_cmd_OBJECTS[49] = // cmd #16 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_EXPORT[49] = // cmd #16 +static u8 option_allowed_cmd_EXPORT[49] = // cmd #17 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_XEXPORT[49] = // cmd #17 +static u8 option_allowed_cmd_XEXPORT[49] = // cmd #18 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_CAT[49] = // cmd #18 +static u8 option_allowed_cmd_CAT[49] = // cmd #19 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,1,0,0,0, 1,1,1,1,0, 0,1,1,1,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_DECODE[49] = // cmd #19 +static u8 option_allowed_cmd_DECODE[49] = // cmd #20 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,1,0,0,0, 1,1,1,1,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_ENCODE[49] = // cmd #20 +static u8 option_allowed_cmd_ENCODE[49] = // cmd #21 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_DIFF[49] = // cmd #21 +static u8 option_allowed_cmd_DIFF[49] = // cmd #22 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,0,0,0,1, 0,1,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_DRAW[49] = // cmd #22 +static u8 option_allowed_cmd_DRAW[49] = // cmd #23 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,1, 0,1,0,0,0, 1,1,1,1,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_CHECK[49] = // cmd #23 +static u8 option_allowed_cmd_CHECK[49] = // cmd #24 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,0,0,0, 0,1,1,1,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_STGI[49] = // cmd #24 +static u8 option_allowed_cmd_STGI[49] = // cmd #25 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_KTPT[49] = // cmd #25 +static u8 option_allowed_cmd_KTPT[49] = // cmd #26 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_ROUTES[49] = // cmd #26 +static u8 option_allowed_cmd_ROUTES[49] = // cmd #27 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_GOBJ[49] = // cmd #27 +static u8 option_allowed_cmd_GOBJ[49] = // cmd #28 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_GAMEMODES[49] = // cmd #28 +static u8 option_allowed_cmd_GAMEMODES[49] = // cmd #29 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 }; -static u8 option_allowed_cmd_WIM0[49] = // cmd #29 +static u8 option_allowed_cmd_WIM0[49] = // cmd #30 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0 @@ -1590,6 +1614,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1645,6 +1670,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -2143,7 +2176,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Wiimms KMP Tool : Analyze, modify, export and create (compile) KMP" " files.", 0, - 34, + 35, option_tab_tool, 0 }, @@ -2186,6 +2219,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wkmpt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wkmpt.h b/project/src/ui/ui-wkmpt.h index 2b8541d..af16b9e 100644 --- a/project/src/ui/ui-wkmpt.h +++ b/project/src/ui/ui-wkmpt.h @@ -112,6 +112,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -153,7 +154,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 92 + OPT__N_TOTAL // == 93 } enumOptions; @@ -260,6 +261,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -375,6 +378,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -405,7 +409,7 @@ typedef enum enumCommands CMD_WIM0, - CMD__N // == 30 + CMD__N // == 31 } enumCommands; @@ -447,6 +451,7 @@ typedef enum enumGetOpt GO_DRAW = 'w', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wlect.c b/project/src/ui/ui-wlect.c index 309da13..ea96afd 100644 --- a/project/src/ui/ui-wlect.c +++ b/project/src/ui/ui-wlect.c @@ -171,27 +171,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = { OPT_SPEEDOMETER, true, false, false, false, false, 0, "speedometer", "[=mode]", "Enable or disable the speedometer. Mode is one of OFF, AUTO (default," - " don't change setting), ON (enable it for Wii and WiiU only; default," - " if option is used without parameter) or FORCE (enable it for Wii," - " Wii U and for Dolphin)." + " don't change setting), ON (default, if option is used without" + " parameter) or FRACTION (=1DIGIT), 2DIGITS and 3DIGITS." }, - { OPT_RESERVED_1B9, false, true, false, false, false, 0, "reserved-1b9", - "[=mode]", - "Set LPAR byte at offset 0x1b9 to this value. Value -1 disables this" - " option." - }, - - { OPT_RESERVED_1BA, false, true, false, false, false, 0, "reserved-1ba", - "[=mode]", - "Set LPAR byte at offset 0x1ba to this value. Value -1 disables this" - " option." - }, - - { OPT_RESERVED_1BB, false, true, false, false, false, 0, "reserved-1bb", - "[=mode]", - "Set LPAR byte at offset 0x1bb to this value. Value -1 disables this" - " option." + { OPT_DEBUG, false, false, false, false, false, 0, "debug", + "mode", + "Enable or disable the debug output while racing. Mode is one of OFF," + " AUTO (default, don't change setting), USER or 100 to 199 for" + " predefined setups." }, { OPT_TRACK_DIR, false, false, false, false, true, 0, "track-dir", @@ -363,7 +351,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Print in machine readable sections and parameter lines." }, - {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 45 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 43 //----- global options ----- @@ -383,6 +371,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -598,7 +595,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 78 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 77 }; @@ -626,6 +623,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -713,6 +716,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -724,6 +728,7 @@ static const KeywordTab_t CommandTab[] = { CMD_CALCULATE, "CALCULATE", 0, 0 }, { CMD_FLOAT, "FLOAT", 0, 0 }, { CMD_EXPORT, "_EXPORT", 0, 0 }, + { CMD_DPAD, "_DPAD", 0, 0 }, { CMD_DUMP, "DUMP", "D", 0 }, { CMD_DL, "DL", 0, 0 }, { CMD_DLL, "DLL", 0, 0 }, @@ -751,6 +756,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -830,12 +836,7 @@ static const struct option OptionLong[] = { "customtt", 2, 0, GO_CUSTOM_TT }, { "xpflags", 2, 0, GO_XPFLAGS }, { "speedometer", 2, 0, GO_SPEEDOMETER }, - { "reserved-1b9", 1, 0, GO_RESERVED_1B9 }, - { "reserved1b9", 1, 0, GO_RESERVED_1B9 }, - { "reserved-1ba", 1, 0, GO_RESERVED_1BA }, - { "reserved1ba", 1, 0, GO_RESERVED_1BA }, - { "reserved-1bb", 1, 0, GO_RESERVED_1BB }, - { "reserved1bb", 1, 0, GO_RESERVED_1BB }, + { "debug", 1, 0, GO_DEBUG }, { "track-dir", 1, 0, GO_TRACK_DIR }, { "trackdir", 1, 0, GO_TRACK_DIR }, { "copy-tracks", 1, 0, GO_COPY_TRACKS }, @@ -929,61 +930,60 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_ROUND, - /* 0x08c */ OPT_NO_ECHO, - /* 0x08d */ OPT_UTF_8, - /* 0x08e */ OPT_NO_UTF_8, - /* 0x08f */ OPT_LT_CLEAR, - /* 0x090 */ OPT_LT_ONLINE, - /* 0x091 */ OPT_LT_N_PLAYERS, - /* 0x092 */ OPT_LT_COND_BIT, - /* 0x093 */ OPT_LT_GAME_MODE, - /* 0x094 */ OPT_LT_ENGINE, - /* 0x095 */ OPT_LT_RANDOM, - /* 0x096 */ OPT_LEX_PURGE, - /* 0x097 */ OPT_LEX_RM_FEAT, - /* 0x098 */ OPT_FORCE, - /* 0x099 */ OPT_REPAIR_MAGICS, - /* 0x09a */ OPT_OLD, - /* 0x09b */ OPT_STD, - /* 0x09c */ OPT_NEW, - /* 0x09d */ OPT_EXTRACT, - /* 0x09e */ OPT_LE_DEFINE, - /* 0x09f */ OPT_LPAR, - /* 0x0a0 */ OPT_ALIAS, - /* 0x0a1 */ OPT_ENGINE, - /* 0x0a2 */ OPT_200CC, - /* 0x0a3 */ OPT_PERFMON, - /* 0x0a4 */ OPT_CUSTOM_TT, - /* 0x0a5 */ OPT_XPFLAGS, - /* 0x0a6 */ OPT_SPEEDOMETER, - /* 0x0a7 */ OPT_RESERVED_1B9, - /* 0x0a8 */ OPT_RESERVED_1BA, - /* 0x0a9 */ OPT_RESERVED_1BB, - /* 0x0aa */ OPT_TRACK_DIR, - /* 0x0ab */ OPT_COPY_TRACKS, - /* 0x0ac */ OPT_MOVE_TRACKS, - /* 0x0ad */ OPT_MOVE1_TRACKS, - /* 0x0ae */ OPT_LINK_TRACKS, - /* 0x0af */ OPT_LOAD_BMG, - /* 0x0b0 */ OPT_PATCH_BMG, - /* 0x0b1 */ OPT_MACRO_BMG, - /* 0x0b2 */ OPT_PATCH_NAMES, - /* 0x0b3 */ OPT_ORDER_BY, - /* 0x0b4 */ OPT_ORDER_ALL, - /* 0x0b5 */ OPT_NUMBER, - /* 0x0b6 */ OPT_SECTIONS, - /* 0x0b7 */ 0,0,0,0, 0,0,0,0, 0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_ROUND, + /* 0x08d */ OPT_NO_ECHO, + /* 0x08e */ OPT_UTF_8, + /* 0x08f */ OPT_NO_UTF_8, + /* 0x090 */ OPT_LT_CLEAR, + /* 0x091 */ OPT_LT_ONLINE, + /* 0x092 */ OPT_LT_N_PLAYERS, + /* 0x093 */ OPT_LT_COND_BIT, + /* 0x094 */ OPT_LT_GAME_MODE, + /* 0x095 */ OPT_LT_ENGINE, + /* 0x096 */ OPT_LT_RANDOM, + /* 0x097 */ OPT_LEX_PURGE, + /* 0x098 */ OPT_LEX_RM_FEAT, + /* 0x099 */ OPT_FORCE, + /* 0x09a */ OPT_REPAIR_MAGICS, + /* 0x09b */ OPT_OLD, + /* 0x09c */ OPT_STD, + /* 0x09d */ OPT_NEW, + /* 0x09e */ OPT_EXTRACT, + /* 0x09f */ OPT_LE_DEFINE, + /* 0x0a0 */ OPT_LPAR, + /* 0x0a1 */ OPT_ALIAS, + /* 0x0a2 */ OPT_ENGINE, + /* 0x0a3 */ OPT_200CC, + /* 0x0a4 */ OPT_PERFMON, + /* 0x0a5 */ OPT_CUSTOM_TT, + /* 0x0a6 */ OPT_XPFLAGS, + /* 0x0a7 */ OPT_SPEEDOMETER, + /* 0x0a8 */ OPT_DEBUG, + /* 0x0a9 */ OPT_TRACK_DIR, + /* 0x0aa */ OPT_COPY_TRACKS, + /* 0x0ab */ OPT_MOVE_TRACKS, + /* 0x0ac */ OPT_MOVE1_TRACKS, + /* 0x0ad */ OPT_LINK_TRACKS, + /* 0x0ae */ OPT_LOAD_BMG, + /* 0x0af */ OPT_PATCH_BMG, + /* 0x0b0 */ OPT_MACRO_BMG, + /* 0x0b1 */ OPT_PATCH_NAMES, + /* 0x0b2 */ OPT_ORDER_BY, + /* 0x0b3 */ OPT_ORDER_ALL, + /* 0x0b4 */ OPT_NUMBER, + /* 0x0b5 */ OPT_SECTIONS, + /* 0x0b6 */ 0,0,0,0, 0,0,0,0, 0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -999,142 +999,154 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[45] = // cmd #1 +static u8 option_allowed_cmd_VERSION[43] = // cmd #1 { 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,1 }; -static u8 option_allowed_cmd_HELP[45] = // cmd #2 +static u8 option_allowed_cmd_HELP[43] = // cmd #2 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_ARGTEST[45] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[43] = // cmd #3 +{ + 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[43] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_TEST[45] = // cmd #4 +static u8 option_allowed_cmd_TEST[43] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_COLORS[45] = // cmd #5 +static u8 option_allowed_cmd_COLORS[43] = // cmd #6 { 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_ERROR[45] = // cmd #6 +static u8 option_allowed_cmd_ERROR[43] = // cmd #7 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[45] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[43] = // cmd #8 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0 + 0,0,0,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[45] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[43] = // cmd #9 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[45] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[43] = // cmd #10 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[45] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[43] = // cmd #11 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[45] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[43] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FLOAT[45] = // cmd #12 +static u8 option_allowed_cmd_FLOAT[43] = // cmd #13 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_EXPORT[45] = // cmd #13 +static u8 option_allowed_cmd_EXPORT[43] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_DUMP[45] = // cmd #14 +static u8 option_allowed_cmd_DPAD[43] = // cmd #15 { - 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_DL[45] = // cmd #15 +static u8 option_allowed_cmd_DUMP[43] = // cmd #16 { - 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_DLL[45] = // cmd #16 +static u8 option_allowed_cmd_DL[43] = // cmd #17 { - 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_BIN_DIFF[45] = // cmd #17 +static u8 option_allowed_cmd_DLL[43] = // cmd #18 +{ + 0,0,1,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 +}; + +static u8 option_allowed_cmd_BIN_DIFF[43] = // cmd #19 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_PATCH[45] = // cmd #18 +static u8 option_allowed_cmd_PATCH[43] = // cmd #20 { - 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, - 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 + 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_LPAR[45] = // cmd #19 +static u8 option_allowed_cmd_LPAR[43] = // cmd #21 { - 0,0,0,1,1, 1,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 + 0,0,0,1,1, 1,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_CREATE[45] = // cmd #20 +static u8 option_allowed_cmd_CREATE[43] = // cmd #22 { - 0,0,0,1,1, 1,0,1,1,1, 1,0,1,0,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 + 0,0,0,1,1, 1,0,1,1,1, 1,0,1,0,1, 1,1,1,1,1, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_CAT[45] = // cmd #21 +static u8 option_allowed_cmd_CAT[43] = // cmd #23 { - 0,0,0,1,1, 1,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0 + 0,0,0,1,1, 1,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_DECODE[45] = // cmd #22 +static u8 option_allowed_cmd_DECODE[43] = // cmd #24 { - 0,0,0,1,1, 1,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, - 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 + 0,0,0,1,1, 1,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_ENCODE[45] = // cmd #23 +static u8 option_allowed_cmd_ENCODE[43] = // cmd #25 { - 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, - 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 + 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 1,1,0 }; @@ -1148,6 +1160,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1198,6 +1211,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1281,6 +1302,12 @@ static const InfoOption_t * option_tab_cmd_EXPORT[] = 0 }; +static const InfoOption_t * option_tab_cmd_DPAD[] = +{ + + 0 +}; + static const InfoOption_t * option_tab_cmd_DUMP[] = { OptionInfo + OPT_LE_DEFINE, @@ -1292,6 +1319,7 @@ static const InfoOption_t * option_tab_cmd_DUMP[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, OptionInfo + OPT_NONE, // separator @@ -1312,6 +1340,7 @@ static const InfoOption_t * option_tab_cmd_DL[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, OptionInfo + OPT_NONE, // separator @@ -1332,6 +1361,7 @@ static const InfoOption_t * option_tab_cmd_DLL[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, OptionInfo + OPT_NONE, // separator @@ -1360,6 +1390,7 @@ static const InfoOption_t * option_tab_cmd_PATCH[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, OptionInfo + OPT_TRACK_DIR, OptionInfo + OPT_COPY_TRACKS, OptionInfo + OPT_MOVE_TRACKS, @@ -1395,6 +1426,7 @@ static const InfoOption_t * option_tab_cmd_LPAR[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, OptionInfo + OPT_NONE, // separator @@ -1456,6 +1488,7 @@ static const InfoOption_t * option_tab_cmd_CREATE[] = OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, OptionInfo + OPT_SPEEDOMETER, + OptionInfo + OPT_DEBUG, 0 }; @@ -1532,7 +1565,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wlect [option]... command [option|parameter|file]...", "Wiimms LE-CODE Tool : Manage the LE-CODE and LEX extensions.", 0, - 26, + 27, option_tab_tool, 0 }, @@ -1575,6 +1608,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wlect CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, @@ -1750,6 +1798,20 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_EXPORT }, + { CMD_DPAD, + true, + false, + false, + "_DPAD", + 0, + "wszst DPAD number_or_code...", + "This hidden command decodes and encodes D-Pad suquences for LE-CODE.", + 0, + 0, + option_tab_cmd_DPAD, + option_allowed_cmd_DPAD + }, + { CMD_DUMP, false, false, @@ -1760,7 +1822,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Print an information dump for each source file. LE-CODE binaries and" " LEX binaries are accepted as input.", 0, - 11, + 12, option_tab_cmd_DUMP, option_allowed_cmd_DUMP }, @@ -1774,7 +1836,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wlect DL [source]...", "Short cut for 'DUMP --long'.", 0, - 11, + 12, option_tab_cmd_DL, option_allowed_cmd_DL }, @@ -1788,7 +1850,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wlect DLL [source]...", "Short cut for 'DUMP --long --long'.", 0, - 11, + 12, option_tab_cmd_DLL, option_allowed_cmd_DLL }, @@ -1825,7 +1887,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Read each LE-BIN file and patch it. Use --le-define to setup cups and" " tracks.", 0, - 23, + 24, option_tab_cmd_PATCH, option_allowed_cmd_PATCH }, @@ -1841,7 +1903,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " parameters and store them as LPAR text file. Print the result to" " standard output if no other destination is defined.", 0, - 21, + 22, option_tab_cmd_LPAR, option_allowed_cmd_LPAR }, @@ -1862,7 +1924,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " names) for a LEX text file with 1 section only. LPAR for an example" " LE-CODE parameter file.", 0, - 28, + 29, option_tab_cmd_CREATE, option_allowed_cmd_CREATE }, diff --git a/project/src/ui/ui-wlect.h b/project/src/ui/ui-wlect.h index f6a6d1e..6298234 100644 --- a/project/src/ui/ui-wlect.h +++ b/project/src/ui/ui-wlect.h @@ -75,9 +75,7 @@ typedef enum enumOptions OPT_CUSTOM_TT, OPT_XPFLAGS, OPT_SPEEDOMETER, - OPT_RESERVED_1B9, - OPT_RESERVED_1BA, - OPT_RESERVED_1BB, + OPT_DEBUG, OPT_TRACK_DIR, OPT_COPY_TRACKS, OPT_MOVE_TRACKS, @@ -101,13 +99,14 @@ typedef enum enumOptions OPT_IGNORE, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 45 + OPT__N_SPECIFIC, // == 43 //----- global options ----- OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -139,7 +138,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 78 + OPT__N_TOTAL // == 77 } enumOptions; @@ -173,9 +172,7 @@ typedef enum enumOptions // OB_CUSTOM_TT = 1llu << OPT_CUSTOM_TT, // OB_XPFLAGS = 1llu << OPT_XPFLAGS, // OB_SPEEDOMETER = 1llu << OPT_SPEEDOMETER, -// OB_RESERVED_1B9 = 1llu << OPT_RESERVED_1B9, -// OB_RESERVED_1BA = 1llu << OPT_RESERVED_1BA, -// OB_RESERVED_1BB = 1llu << OPT_RESERVED_1BB, +// OB_DEBUG = 1llu << OPT_DEBUG, // OB_TRACK_DIR = 1llu << OPT_TRACK_DIR, // OB_COPY_TRACKS = 1llu << OPT_COPY_TRACKS, // OB_MOVE_TRACKS = 1llu << OPT_MOVE_TRACKS, @@ -216,9 +213,7 @@ typedef enum enumOptions // | OB_CUSTOM_TT // | OB_XPFLAGS // | OB_SPEEDOMETER -// | OB_RESERVED_1B9 -// | OB_RESERVED_1BA -// | OB_RESERVED_1BB, +// | OB_DEBUG, // // OB_GRP_PATCH = OB_LE_DEFINE // | OB_LPAR @@ -244,6 +239,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -273,6 +270,8 @@ typedef enum enumOptions // // OB_CMD_EXPORT = 0, // +// OB_CMD_DPAD = 0, +// // OB_CMD_DUMP = OB_GRP_PATCH // | OB_LONG // | OB_GRP_PATCH, @@ -330,6 +329,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -341,6 +341,7 @@ typedef enum enumCommands CMD_CALCULATE, CMD_FLOAT, CMD_EXPORT, + CMD_DPAD, CMD_DUMP, CMD_DL, @@ -355,7 +356,7 @@ typedef enum enumCommands CMD_ENCODE, - CMD__N // == 24 + CMD__N // == 26 } enumCommands; @@ -393,6 +394,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, @@ -431,9 +433,7 @@ typedef enum enumGetOpt GO_CUSTOM_TT, GO_XPFLAGS, GO_SPEEDOMETER, - GO_RESERVED_1B9, - GO_RESERVED_1BA, - GO_RESERVED_1BB, + GO_DEBUG, GO_TRACK_DIR, GO_COPY_TRACKS, GO_MOVE_TRACKS, diff --git a/project/src/ui/ui-wmdlt.c b/project/src/ui/ui-wmdlt.c index ed922c2..d5822de 100644 --- a/project/src/ui/ui-wmdlt.c +++ b/project/src/ui/ui-wmdlt.c @@ -335,6 +335,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -553,7 +562,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 64 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 65 }; @@ -581,6 +590,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_TEST_VERBOSE = { OPT_VERBOSE, false, false, false, false, false, 'v', "verbose", 0, @@ -669,6 +684,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -703,6 +719,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -838,46 +855,47 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_MDL, - /* 0x08c */ OPT_SCALE, - /* 0x08d */ OPT_SHIFT, - /* 0x08e */ OPT_XSS, - /* 0x08f */ OPT_YSS, - /* 0x090 */ OPT_ZSS, - /* 0x091 */ OPT_ROT, - /* 0x092 */ OPT_XROT, - /* 0x093 */ OPT_YROT, - /* 0x094 */ OPT_ZROT, - /* 0x095 */ OPT_TRANSLATE, - /* 0x096 */ OPT_NULL, - /* 0x097 */ OPT_NEXT, - /* 0x098 */ OPT_ASCALE, - /* 0x099 */ OPT_AROT, - /* 0x09a */ OPT_TFORM_SCRIPT, - /* 0x09b */ OPT_ROUND, - /* 0x09c */ OPT_NO_ECHO, - /* 0x09d */ OPT_UTF_8, - /* 0x09e */ OPT_NO_UTF_8, - /* 0x09f */ OPT_FORCE, - /* 0x0a0 */ OPT_REPAIR_MAGICS, - /* 0x0a1 */ OPT_TINY, - /* 0x0a2 */ OPT_OLD, - /* 0x0a3 */ OPT_STD, - /* 0x0a4 */ OPT_NEW, - /* 0x0a5 */ OPT_EXTRACT, - /* 0x0a6 */ OPT_NUMBER, - /* 0x0a7 */ OPT_SECTIONS, - /* 0x0a8 */ 0,0,0,0, 0,0,0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_MDL, + /* 0x08d */ OPT_SCALE, + /* 0x08e */ OPT_SHIFT, + /* 0x08f */ OPT_XSS, + /* 0x090 */ OPT_YSS, + /* 0x091 */ OPT_ZSS, + /* 0x092 */ OPT_ROT, + /* 0x093 */ OPT_XROT, + /* 0x094 */ OPT_YROT, + /* 0x095 */ OPT_ZROT, + /* 0x096 */ OPT_TRANSLATE, + /* 0x097 */ OPT_NULL, + /* 0x098 */ OPT_NEXT, + /* 0x099 */ OPT_ASCALE, + /* 0x09a */ OPT_AROT, + /* 0x09b */ OPT_TFORM_SCRIPT, + /* 0x09c */ OPT_ROUND, + /* 0x09d */ OPT_NO_ECHO, + /* 0x09e */ OPT_UTF_8, + /* 0x09f */ OPT_NO_UTF_8, + /* 0x0a0 */ OPT_FORCE, + /* 0x0a1 */ OPT_REPAIR_MAGICS, + /* 0x0a2 */ OPT_TINY, + /* 0x0a3 */ OPT_OLD, + /* 0x0a4 */ OPT_STD, + /* 0x0a5 */ OPT_NEW, + /* 0x0a6 */ OPT_EXTRACT, + /* 0x0a7 */ OPT_NUMBER, + /* 0x0a8 */ OPT_SECTIONS, + /* 0x0a9 */ 0,0,0,0, 0,0,0, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -906,109 +924,115 @@ static u8 option_allowed_cmd_HELP[33] = // cmd #2 1,1,1 }; -static u8 option_allowed_cmd_ARGTEST[33] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[33] = // cmd #3 +{ + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[33] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_TEST[33] = // cmd #4 +static u8 option_allowed_cmd_TEST[33] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_COLORS[33] = // cmd #5 +static u8 option_allowed_cmd_COLORS[33] = // cmd #6 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_ERROR[33] = // cmd #6 +static u8 option_allowed_cmd_ERROR[33] = // cmd #7 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[33] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[33] = // cmd #8 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[33] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[33] = // cmd #9 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[33] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[33] = // cmd #10 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[33] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[33] = // cmd #11 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[33] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[33] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_MATRIX[33] = // cmd #12 +static u8 option_allowed_cmd_MATRIX[33] = // cmd #13 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FLOAT[33] = // cmd #13 +static u8 option_allowed_cmd_FLOAT[33] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_EXPORT[33] = // cmd #14 +static u8 option_allowed_cmd_EXPORT[33] = // cmd #15 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_CAT[33] = // cmd #15 +static u8 option_allowed_cmd_CAT[33] = // cmd #16 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_DECODE[33] = // cmd #16 +static u8 option_allowed_cmd_DECODE[33] = // cmd #17 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_ENCODE[33] = // cmd #17 +static u8 option_allowed_cmd_ENCODE[33] = // cmd #18 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_STRINGS[33] = // cmd #18 +static u8 option_allowed_cmd_STRINGS[33] = // cmd #19 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_GEOMETRY[33] = // cmd #19 +static u8 option_allowed_cmd_GEOMETRY[33] = // cmd #20 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_XTEST[33] = // cmd #20 +static u8 option_allowed_cmd_XTEST[33] = // cmd #21 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 @@ -1025,6 +1049,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1069,6 +1094,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1398,7 +1431,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wmdlt [option]... command [option|parameter|file]...", "Wiimms MDL Tool : Decode raw MDL and encode text MDL files.", 0, - 23, + 24, option_tab_tool, 0 }, @@ -1441,6 +1474,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wmdlt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wmdlt.h b/project/src/ui/ui-wmdlt.h index 5eda1ff..f3a6a45 100644 --- a/project/src/ui/ui-wmdlt.h +++ b/project/src/ui/ui-wmdlt.h @@ -96,6 +96,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -125,7 +126,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 64 + OPT__N_TOTAL // == 65 } enumOptions; @@ -210,6 +211,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -293,6 +296,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -314,7 +318,7 @@ typedef enum enumCommands CMD_GEOMETRY, CMD_XTEST, - CMD__N // == 21 + CMD__N // == 22 } enumCommands; @@ -353,6 +357,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wpatt.c b/project/src/ui/ui-wpatt.c index 8078f4e..72d6cc8 100644 --- a/project/src/ui/ui-wpatt.c +++ b/project/src/ui/ui-wpatt.c @@ -177,6 +177,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -384,7 +393,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 48 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 49 }; @@ -412,6 +421,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -470,6 +485,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -500,6 +516,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -617,30 +634,31 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_ROUND, - /* 0x08c */ OPT_NO_ECHO, - /* 0x08d */ OPT_PAT, - /* 0x08e */ OPT_UTF_8, - /* 0x08f */ OPT_NO_UTF_8, - /* 0x090 */ OPT_FORCE, - /* 0x091 */ OPT_REPAIR_MAGICS, - /* 0x092 */ OPT_OLD, - /* 0x093 */ OPT_STD, - /* 0x094 */ OPT_NEW, - /* 0x095 */ OPT_EXTRACT, - /* 0x096 */ OPT_NUMBER, - /* 0x097 */ OPT_SECTIONS, - /* 0x098 */ 0,0,0,0, 0,0,0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_ROUND, + /* 0x08d */ OPT_NO_ECHO, + /* 0x08e */ OPT_PAT, + /* 0x08f */ OPT_UTF_8, + /* 0x090 */ OPT_NO_UTF_8, + /* 0x091 */ OPT_FORCE, + /* 0x092 */ OPT_REPAIR_MAGICS, + /* 0x093 */ OPT_OLD, + /* 0x094 */ OPT_STD, + /* 0x095 */ OPT_NEW, + /* 0x096 */ OPT_EXTRACT, + /* 0x097 */ OPT_NUMBER, + /* 0x098 */ OPT_SECTIONS, + /* 0x099 */ 0,0,0,0, 0,0,0, /* 0x0a0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -668,72 +686,77 @@ static u8 option_allowed_cmd_HELP[18] = // cmd #2 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_ARGTEST[18] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[18] = // cmd #3 +{ + 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[18] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_TEST[18] = // cmd #4 +static u8 option_allowed_cmd_TEST[18] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 }; -static u8 option_allowed_cmd_COLORS[18] = // cmd #5 +static u8 option_allowed_cmd_COLORS[18] = // cmd #6 { 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_ERROR[18] = // cmd #6 +static u8 option_allowed_cmd_ERROR[18] = // cmd #7 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[18] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[18] = // cmd #8 { 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[18] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[18] = // cmd #9 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[18] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[18] = // cmd #10 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[18] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[18] = // cmd #11 { 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[18] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[18] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_FLOAT[18] = // cmd #12 +static u8 option_allowed_cmd_FLOAT[18] = // cmd #13 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_EXPORT[18] = // cmd #13 +static u8 option_allowed_cmd_EXPORT[18] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 }; -static u8 option_allowed_cmd_CAT[18] = // cmd #14 +static u8 option_allowed_cmd_CAT[18] = // cmd #15 { 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 }; -static u8 option_allowed_cmd_DECODE[18] = // cmd #15 +static u8 option_allowed_cmd_DECODE[18] = // cmd #16 { 0,0,0,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 }; -static u8 option_allowed_cmd_ENCODE[18] = // cmd #16 +static u8 option_allowed_cmd_ENCODE[18] = // cmd #17 { 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 }; @@ -749,6 +772,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -792,6 +816,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -947,7 +979,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wpatt [option]... command [option|parameter|file]...", "Wiimms PAT Tool : Decode raw PAT and encode text PAT files.", 0, - 22, + 23, option_tab_tool, 0 }, @@ -990,6 +1022,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wpatt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wpatt.h b/project/src/ui/ui-wpatt.h index 59b7c5f..4f510dc 100644 --- a/project/src/ui/ui-wpatt.h +++ b/project/src/ui/ui-wpatt.h @@ -81,6 +81,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -109,7 +110,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 48 + OPT__N_TOTAL // == 49 } enumOptions; @@ -163,6 +164,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -221,6 +224,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -237,7 +241,7 @@ typedef enum enumCommands CMD_DECODE, CMD_ENCODE, - CMD__N // == 17 + CMD__N // == 18 } enumCommands; @@ -276,6 +280,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wstrt.c b/project/src/ui/ui-wstrt.c index 3796b3b..8b83b7c 100644 --- a/project/src/ui/ui-wstrt.c +++ b/project/src/ui/ui-wstrt.c @@ -479,6 +479,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_AT_DUMMY, false, true, false, false, false, '@', "@", 0, "" @@ -840,7 +849,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " directory." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 112 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 113 }; @@ -862,6 +871,12 @@ static const InfoOption_t option_cmd_VERSION_LONG = "Print in long format. Ignored if option --sections is set." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too." + }; + static const InfoOption_t option_cmd_COLORS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -967,6 +982,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -1003,6 +1019,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "@", 0, 0, '@' }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, @@ -1212,95 +1229,96 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x076 v */ OPT_VERBOSE, /* 0x077 */ 0,0,0,0, 0,0,0,0, 0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_VS_REGION, - /* 0x08c */ OPT_BT_REGION, - /* 0x08d */ OPT_ALL_RANKS, - /* 0x08e */ OPT_POINTS, - /* 0x08f */ OPT_CHEAT, - /* 0x090 */ OPT_HTTPS, - /* 0x091 */ OPT_DOMAIN, - /* 0x092 */ OPT_WIIMMFI, - /* 0x093 */ OPT_TWIIMMFI, - /* 0x094 */ OPT_WC24, - /* 0x095 */ OPT_WCODE, - /* 0x096 */ OPT_ADD_WCODE, - /* 0x097 */ OPT_PB_MODE, - /* 0x098 */ OPT_PATCHED_BY, - /* 0x099 */ OPT_VS, - /* 0x09a */ OPT_VS2, - /* 0x09b */ OPT_BT, - /* 0x09c */ OPT_BT2, - /* 0x09d */ OPT_CANNON, - /* 0x09e */ OPT_MENO, - /* 0x09f */ OPT_UTF_8, - /* 0x0a0 */ OPT_NO_UTF_8, - /* 0x0a1 */ OPT_FORCE, - /* 0x0a2 */ OPT_REPAIR_MAGICS, - /* 0x0a3 */ OPT_OLD, - /* 0x0a4 */ OPT_STD, - /* 0x0a5 */ OPT_NEW, - /* 0x0a6 */ OPT_EXTRACT, - /* 0x0a7 */ OPT_NUMBER, - /* 0x0a8 */ OPT_CLEAN_DOL, - /* 0x0a9 */ OPT_ADD_LECODE, - /* 0x0aa */ OPT_ADD_CTCODE, - /* 0x0ab */ OPT_CT_DIR, - /* 0x0ac */ OPT_MOVE_D8, - /* 0x0ad */ OPT_ADD_SECTION, - /* 0x0ae */ OPT_FULL_GCH, - /* 0x0af */ OPT_GCT_NO_SEP, - /* 0x0b0 */ OPT_GCT_SEP, - /* 0x0b1 */ OPT_GCT_ASM_SEP, - /* 0x0b2 */ OPT_GCT_LIST, - /* 0x0b3 */ OPT_GCT_MOVE, - /* 0x0b4 */ OPT_GCT_ADDR, - /* 0x0b5 */ OPT_GCT_SPACE, - /* 0x0b6 */ OPT_ALLOW_USER_GCH, - /* 0x0b7 */ OPT_CREATE_SECT, - /* 0x0b8 */ OPT_WPF, - /* 0x0b9 */ OPT_SECTIONS, - /* 0x0ba */ OPT_VADDR, - /* 0x0bb */ OPT_FADDR, - /* 0x0bc */ OPT_SNAME, - /* 0x0bd */ OPT_INT1, - /* 0x0be */ OPT_INT2, - /* 0x0bf */ OPT_INT3, - /* 0x0c0 */ OPT_INT4, - /* 0x0c1 */ OPT_INT5, - /* 0x0c2 */ OPT_INT6, - /* 0x0c3 */ OPT_INT7, - /* 0x0c4 */ OPT_INT8, - /* 0x0c5 */ OPT_FLOAT, - /* 0x0c6 */ OPT_DOUBLE, - /* 0x0c7 */ OPT_LE, - /* 0x0c8 */ OPT_BE, - /* 0x0c9 */ OPT_ZEROS, - /* 0x0ca */ OPT_HEX, - /* 0x0cb */ OPT_DEC, - /* 0x0cc */ OPT_C_SYNTAX, - /* 0x0cd */ OPT_ADDR, - /* 0x0ce */ OPT_ALIGN, - /* 0x0cf */ OPT_TRIGGER, - /* 0x0d0 */ OPT_NO_ADDR, - /* 0x0d1 */ OPT_NO_NUMBERS, - /* 0x0d2 */ OPT_NO_TEXT, - /* 0x0d3 */ OPT_FORMAT, - /* 0x0d4 */ OPT_NO_NULL, - /* 0x0d5 */ OPT_NARROW, - /* 0x0d6 */ OPT_SMALL, - /* 0x0d7 */ OPT_WIDE, - /* 0x0d8 */ OPT_BYTES, - /* 0x0d9 */ 0,0,0,0, 0,0,0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_VS_REGION, + /* 0x08d */ OPT_BT_REGION, + /* 0x08e */ OPT_ALL_RANKS, + /* 0x08f */ OPT_POINTS, + /* 0x090 */ OPT_CHEAT, + /* 0x091 */ OPT_HTTPS, + /* 0x092 */ OPT_DOMAIN, + /* 0x093 */ OPT_WIIMMFI, + /* 0x094 */ OPT_TWIIMMFI, + /* 0x095 */ OPT_WC24, + /* 0x096 */ OPT_WCODE, + /* 0x097 */ OPT_ADD_WCODE, + /* 0x098 */ OPT_PB_MODE, + /* 0x099 */ OPT_PATCHED_BY, + /* 0x09a */ OPT_VS, + /* 0x09b */ OPT_VS2, + /* 0x09c */ OPT_BT, + /* 0x09d */ OPT_BT2, + /* 0x09e */ OPT_CANNON, + /* 0x09f */ OPT_MENO, + /* 0x0a0 */ OPT_UTF_8, + /* 0x0a1 */ OPT_NO_UTF_8, + /* 0x0a2 */ OPT_FORCE, + /* 0x0a3 */ OPT_REPAIR_MAGICS, + /* 0x0a4 */ OPT_OLD, + /* 0x0a5 */ OPT_STD, + /* 0x0a6 */ OPT_NEW, + /* 0x0a7 */ OPT_EXTRACT, + /* 0x0a8 */ OPT_NUMBER, + /* 0x0a9 */ OPT_CLEAN_DOL, + /* 0x0aa */ OPT_ADD_LECODE, + /* 0x0ab */ OPT_ADD_CTCODE, + /* 0x0ac */ OPT_CT_DIR, + /* 0x0ad */ OPT_MOVE_D8, + /* 0x0ae */ OPT_ADD_SECTION, + /* 0x0af */ OPT_FULL_GCH, + /* 0x0b0 */ OPT_GCT_NO_SEP, + /* 0x0b1 */ OPT_GCT_SEP, + /* 0x0b2 */ OPT_GCT_ASM_SEP, + /* 0x0b3 */ OPT_GCT_LIST, + /* 0x0b4 */ OPT_GCT_MOVE, + /* 0x0b5 */ OPT_GCT_ADDR, + /* 0x0b6 */ OPT_GCT_SPACE, + /* 0x0b7 */ OPT_ALLOW_USER_GCH, + /* 0x0b8 */ OPT_CREATE_SECT, + /* 0x0b9 */ OPT_WPF, + /* 0x0ba */ OPT_SECTIONS, + /* 0x0bb */ OPT_VADDR, + /* 0x0bc */ OPT_FADDR, + /* 0x0bd */ OPT_SNAME, + /* 0x0be */ OPT_INT1, + /* 0x0bf */ OPT_INT2, + /* 0x0c0 */ OPT_INT3, + /* 0x0c1 */ OPT_INT4, + /* 0x0c2 */ OPT_INT5, + /* 0x0c3 */ OPT_INT6, + /* 0x0c4 */ OPT_INT7, + /* 0x0c5 */ OPT_INT8, + /* 0x0c6 */ OPT_FLOAT, + /* 0x0c7 */ OPT_DOUBLE, + /* 0x0c8 */ OPT_LE, + /* 0x0c9 */ OPT_BE, + /* 0x0ca */ OPT_ZEROS, + /* 0x0cb */ OPT_HEX, + /* 0x0cc */ OPT_DEC, + /* 0x0cd */ OPT_C_SYNTAX, + /* 0x0ce */ OPT_ADDR, + /* 0x0cf */ OPT_ALIGN, + /* 0x0d0 */ OPT_TRIGGER, + /* 0x0d1 */ OPT_NO_ADDR, + /* 0x0d2 */ OPT_NO_NUMBERS, + /* 0x0d3 */ OPT_NO_TEXT, + /* 0x0d4 */ OPT_FORMAT, + /* 0x0d5 */ OPT_NO_NULL, + /* 0x0d6 */ OPT_NARROW, + /* 0x0d7 */ OPT_SMALL, + /* 0x0d8 */ OPT_WIDE, + /* 0x0d9 */ OPT_BYTES, + /* 0x0da */ 0,0,0,0, 0,0, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0f0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x100 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -1328,133 +1346,140 @@ static u8 option_allowed_cmd_HELP[62] = // cmd #2 1,1 }; -static u8 option_allowed_cmd_ARGTEST[62] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[62] = // cmd #3 +{ + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0 +}; + +static u8 option_allowed_cmd_ARGTEST[62] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_TEST[62] = // cmd #4 +static u8 option_allowed_cmd_TEST[62] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_COLORS[62] = // cmd #5 +static u8 option_allowed_cmd_COLORS[62] = // cmd #6 { 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ERROR[62] = // cmd #6 +static u8 option_allowed_cmd_ERROR[62] = // cmd #7 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FILETYPE[62] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[62] = // cmd #8 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FILEATTRIB[62] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[62] = // cmd #9 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_RAWDUMP[62] = // cmd #9 +static u8 option_allowed_cmd_RAWDUMP[62] = // cmd #10 { 0,0,0,0,0, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_DUMP[62] = // cmd #10 +static u8 option_allowed_cmd_DUMP[62] = // cmd #11 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_CDUMP[62] = // cmd #11 +static u8 option_allowed_cmd_CDUMP[62] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_HEXDUMP[62] = // cmd #12 +static u8 option_allowed_cmd_HEXDUMP[62] = // cmd #13 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_HTTPS[62] = // cmd #13 +static u8 option_allowed_cmd_HTTPS[62] = // cmd #14 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_EXTRACT[62] = // cmd #14 +static u8 option_allowed_cmd_EXTRACT[62] = // cmd #15 { 0,0,0,0,0, 0,1,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_TRACKS[62] = // cmd #15 +static u8 option_allowed_cmd_TRACKS[62] = // cmd #16 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ARENAS[62] = // cmd #16 +static u8 option_allowed_cmd_ARENAS[62] = // cmd #17 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FILES[62] = // cmd #17 +static u8 option_allowed_cmd_FILES[62] = // cmd #18 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FIND[62] = // cmd #18 +static u8 option_allowed_cmd_FIND[62] = // cmd #19 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_POINTS[62] = // cmd #19 +static u8 option_allowed_cmd_POINTS[62] = // cmd #20 { 0,1,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_ANALYZE[62] = // cmd #20 +static u8 option_allowed_cmd_ANALYZE[62] = // cmd #21 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_PATCH[62] = // cmd #21 +static u8 option_allowed_cmd_PATCH[62] = // cmd #22 { 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, @@ -1472,6 +1497,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -1534,6 +1560,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + &option_cmd_CONFIG_LONG, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -1850,7 +1884,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "Wiimms StaticR Tool : Manipulate the 'main.dol' and 'StaticR.rel'" " files of Mario Kart Wii.", 0, - 38, + 39, option_tab_tool, 0 }, @@ -1893,6 +1927,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wstrt CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content.", + 0, + 2, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, diff --git a/project/src/ui/ui-wstrt.h b/project/src/ui/ui-wstrt.h index 21a3b74..9c23bd8 100644 --- a/project/src/ui/ui-wstrt.h +++ b/project/src/ui/ui-wstrt.h @@ -125,6 +125,7 @@ typedef enum enumOptions OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_AT_DUMMY, OPT_ALLOW_ALL, OPT_COMPATIBLE, @@ -173,7 +174,7 @@ typedef enum enumOptions OPT_CLEAN_DOL, OPT_CT_DIR, - OPT__N_TOTAL // == 112 + OPT__N_TOTAL // == 113 } enumOptions; @@ -298,6 +299,8 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_LONG, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -385,6 +388,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -408,7 +412,7 @@ typedef enum enumCommands CMD_ANALYZE, CMD_PATCH, - CMD__N // == 22 + CMD__N // == 23 } enumCommands; @@ -447,6 +451,7 @@ typedef enum enumGetOpt GO_VERBOSE = 'v', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, diff --git a/project/src/ui/ui-wszst.c b/project/src/ui/ui-wszst.c index b35a60c..4504bc0 100644 --- a/project/src/ui/ui-wszst.c +++ b/project/src/ui/ui-wszst.c @@ -689,6 +689,11 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " if *any* set keywords match." }, + { OPT_INSTALL, false, false, false, false, false, 0, "install", + 0, + "Manage configuration for an installation." + }, + { OPT_ANALYZE, false, true, false, false, true, 0, "analyze", "outfile", "Run in analyze mode and write results to the entered file." @@ -1122,7 +1127,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Print in machine readable sections and parameter lines." }, - {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 133 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 134 //----- global options ----- @@ -1142,6 +1147,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " commands included. Exit after printing." }, + { OPT_CONFIG, false, false, false, false, false, 0, "config", + "file", + "Define a configuration file or a directory as source. In later case," + " file 'wiimms-szs-tools.conf' is searched.\n" + " If option is not not set, then file 'wiimms-szs-tools.conf' is" + " searched in different directories. Use command 'wszst CONFIG' to get" + " more details." + }, + { OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all", 0, "Usually commands accept only options with impact to the command. All" @@ -1590,7 +1604,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "directory", "Define an alternative directory as autoadd library. The default is," " that the sub-directory called './auto-add/' of all search paths are" - " used. Use 'wszst test -vvvv' for tests." + " used. Use 'wszst config -ll' for tests." }, { OPT_UTF_8, false, true, false, false, true, 0, "utf-8", @@ -1691,7 +1705,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = { OPT_VAR, false, false, false, false, false, 0, "var", "varname", "Use VARNAME as variable name or prefix on script output. The default" - " variabe name is 'res'." + " value is 'res' for variables and 'res_' as prefix." }, { OPT_ARRAY, false, false, false, false, false, 0, "array", @@ -1739,7 +1753,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 207 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 209 }; @@ -1748,6 +1762,13 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = /////////////// alternate option infos /////////////// /////////////////////////////////////////////////////////////////////////////// +static const InfoOption_t option_grp_SCRIPT_SECTIONS = + { OPT_SECTIONS, false, false, false, false, false, 0, "sections", + 0, + "Dump info using configuration or section syntax. Use '--var name' as" + " prefix." + }; + static const InfoOption_t option_grp_TEXTOUT_NO_HEADER = { OPT_NO_HEADER, false, false, false, false, false, 'H', "no-header", 0, @@ -1782,6 +1803,20 @@ static const InfoOption_t option_cmd_VERSION_LONG = " twice, append developing settings." }; +static const InfoOption_t option_cmd_CONFIG_LONG = + { OPT_LONG, false, false, false, false, false, 'l', "long", + 0, + "If set, print the search list too. If set twice, print the auto-add" + " search list too. This option is ignored, if any script output is" + " enabled." + }; + +static const InfoOption_t option_cmd_CONFIG_BRIEF = + { OPT_BRIEF, false, false, false, false, false, 'B', "brief", + 0, + "If printed as sections, exclude all comments." + }; + static const InfoOption_t option_cmd_TEST_VERBOSE = { OPT_VERBOSE, false, false, false, false, false, 'v', "verbose", 0, @@ -2202,6 +2237,7 @@ static const KeywordTab_t CommandTab[] = { CMD_VERSION, "VERSION", 0, 0 }, { CMD_HELP, "HELP", "H", 0 }, { CMD_HELP, "?", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, { CMD_ARGTEST, "ARGTEST", 0, 0 }, { CMD_TEST, "TEST", 0, 0 }, { CMD_COLORS, "COLORS", 0, 0 }, @@ -2299,6 +2335,7 @@ static const struct option OptionLong[] = { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { "xhelp", 0, 0, GO_XHELP }, + { "config", 1, 0, GO_CONFIG }, { "allow-all", 0, 0, GO_ALLOW_ALL }, { "allowall", 0, 0, GO_ALLOW_ALL }, { "compatible", 1, 0, GO_COMPATIBLE }, @@ -2523,6 +2560,7 @@ static const struct option OptionLong[] = { "fmodes", 1, 0, GO_FMODES }, { "feature-modes", 1, 0, GO_FMODES }, { "featuremodes", 1, 0, GO_FMODES }, + { "install", 0, 0, GO_INSTALL }, { "analyze", 1, 0, GO_ANALYZE }, { "analyse", 1, 0, GO_ANALYZE }, { "analyze-mode", 1, 0, GO_ANALYZE_MODE }, @@ -2708,179 +2746,181 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x078 x */ OPT_TRANSFORM, /* 0x079 */ 0,0,0,0, 0,0,0, /* 0x080 */ OPT_XHELP, - /* 0x081 */ OPT_ALLOW_ALL, - /* 0x082 */ OPT_COMPATIBLE, - /* 0x083 */ OPT_WIDTH, - /* 0x084 */ OPT_MAX_WIDTH, - /* 0x085 */ OPT_DE, - /* 0x086 */ OPT_COLORS, - /* 0x087 */ OPT_NO_COLORS, - /* 0x088 */ OPT_CT_CODE, - /* 0x089 */ OPT_LE_CODE, - /* 0x08a */ OPT_CHDIR, - /* 0x08b */ OPT_TOUCH, - /* 0x08c */ OPT_AUTO, - /* 0x08d */ OPT_SET_FLAGS, - /* 0x08e */ OPT_SET_SCALE, - /* 0x08f */ OPT_SET_ROT, - /* 0x090 */ OPT_SET_X, - /* 0x091 */ OPT_SET_Y, - /* 0x092 */ OPT_SET_Z, - /* 0x093 */ OPT_XCENTER, - /* 0x094 */ OPT_YCENTER, - /* 0x095 */ OPT_ZCENTER, - /* 0x096 */ OPT_CENTER, - /* 0x097 */ OPT_SCALE, - /* 0x098 */ OPT_SHIFT, - /* 0x099 */ OPT_XSS, - /* 0x09a */ OPT_YSS, - /* 0x09b */ OPT_ZSS, - /* 0x09c */ OPT_ROT, - /* 0x09d */ OPT_XROT, - /* 0x09e */ OPT_YROT, - /* 0x09f */ OPT_ZROT, - /* 0x0a0 */ OPT_YPOS, - /* 0x0a1 */ OPT_TRANSLATE, - /* 0x0a2 */ OPT_NULL, - /* 0x0a3 */ OPT_NEXT, - /* 0x0a4 */ OPT_ASCALE, - /* 0x0a5 */ OPT_AROT, - /* 0x0a6 */ OPT_TFORM_SCRIPT, - /* 0x0a7 */ OPT_MINIMAP, - /* 0x0a8 */ OPT_RM_GOBJ, - /* 0x0a9 */ OPT_BATTLE, - /* 0x0aa */ OPT_EXPORT_FLAGS, - /* 0x0ab */ OPT_ROUTE_OPTIONS, - /* 0x0ac */ OPT_WIM0, - /* 0x0ad */ OPT_SLOT, - /* 0x0ae */ OPT_LOAD_KCL, - /* 0x0af */ OPT_KCL, - /* 0x0b0 */ OPT_KCL_FLAG, - /* 0x0b1 */ OPT_KCL_SCRIPT, - /* 0x0b2 */ OPT_TRI_AREA, - /* 0x0b3 */ OPT_TRI_HEIGHT, - /* 0x0b4 */ OPT_FLAG_FILE, - /* 0x0b5 */ OPT_XTRIDATA, - /* 0x0b6 */ OPT_KMP, - /* 0x0b7 */ OPT_SPEED_MOD, - /* 0x0b8 */ OPT_KTPT2, - /* 0x0b9 */ OPT_TFORM_KMP, - /* 0x0ba */ OPT_REPAIR_XPF, - /* 0x0bb */ OPT_GAMEMODES, - /* 0x0bc */ OPT_MDL, - /* 0x0bd */ OPT_PAT, - /* 0x0be */ OPT_PATCH_FILE, - /* 0x0bf */ OPT_KMG_LIMIT, - /* 0x0c0 */ OPT_KMG_COPY, - /* 0x0c1 */ OPT_LT_CLEAR, - /* 0x0c2 */ OPT_LT_ONLINE, - /* 0x0c3 */ OPT_LT_N_PLAYERS, - /* 0x0c4 */ OPT_LT_COND_BIT, - /* 0x0c5 */ OPT_LT_GAME_MODE, - /* 0x0c6 */ OPT_LT_ENGINE, - /* 0x0c7 */ OPT_LT_RANDOM, - /* 0x0c8 */ OPT_LEX_PURGE, - /* 0x0c9 */ OPT_LEX_FEATURES, - /* 0x0ca */ OPT_LEX_RM_FEAT, - /* 0x0cb */ OPT_LOAD_BMG, - /* 0x0cc */ OPT_PATCH_BMG, - /* 0x0cd */ OPT_MACRO_BMG, - /* 0x0ce */ OPT_FILTER_BMG, - /* 0x0cf */ OPT_CACHE, - /* 0x0d0 */ OPT_CNAME, - /* 0x0d1 */ OPT_ID, - /* 0x0d2 */ OPT_BASE64, - /* 0x0d3 */ OPT_DB64, - /* 0x0d4 */ OPT_CODING, - /* 0x0d5 */ OPT_VERIFY, - /* 0x0d6 */ OPT_ROUND, - /* 0x0d7 */ OPT_PIPE, - /* 0x0d8 */ OPT_DELTA, - /* 0x0d9 */ OPT_DIFF, - /* 0x0da */ OPT_EPSILON, - /* 0x0db */ OPT_BMG_ENDIAN, - /* 0x0dc */ OPT_BMG_ENCODING, - /* 0x0dd */ OPT_BMG_INF_SIZE, - /* 0x0de */ OPT_BMG_MID, - /* 0x0df */ OPT_FORCE_ATTRIB, - /* 0x0e0 */ OPT_DEF_ATTRIB, - /* 0x0e1 */ OPT_NO_ATTRIB, - /* 0x0e2 */ OPT_X_ESCAPES, - /* 0x0e3 */ OPT_OLD_ESCAPES, - /* 0x0e4 */ OPT_NO_BMG_COLORS, - /* 0x0e5 */ OPT_BMG_COLORS, - /* 0x0e6 */ OPT_NO_BMG_INLINE, - /* 0x0e7 */ OPT_AUTOADD_PATH, - /* 0x0e8 */ OPT_STRIP, - /* 0x0e9 */ OPT_UTF_8, - /* 0x0ea */ OPT_NO_UTF_8, - /* 0x0eb */ OPT_FORCE, - /* 0x0ec */ OPT_REPAIR_MAGICS, - /* 0x0ed */ OPT_TINY, - /* 0x0ee */ OPT_YAZ0, - /* 0x0ef */ OPT_YAZ1, - /* 0x0f0 */ OPT_XYZ, - /* 0x0f1 */ OPT_BZ, - /* 0x0f2 */ OPT_SH, - /* 0x0f3 */ OPT_BASH, - /* 0x0f4 */ OPT_JSON, - /* 0x0f5 */ OPT_PHP, - /* 0x0f6 */ OPT_MAKEDOC, - /* 0x0f7 */ OPT_VAR, - /* 0x0f8 */ OPT_ARRAY, - /* 0x0f9 */ OPT_AVAR, - /* 0x0fa */ OPT_CASE, - /* 0x0fb */ OPT_PMODES, - /* 0x0fc */ OPT_FMODES, - /* 0x0fd */ OPT_ANALYZE, - /* 0x0fe */ OPT_ANALYZE_MODE, - /* 0x0ff */ OPT_OLD, - /* 0x100 */ OPT_STD, - /* 0x101 */ OPT_NEW, - /* 0x102 */ OPT_EXTRACT, - /* 0x103 */ OPT_NUMBER, - /* 0x104 */ OPT_REMOVE_SRC, - /* 0x105 */ OPT_IGNORE_SETUP, - /* 0x106 */ OPT_PURGE, - /* 0x107 */ OPT_ALIGN_U8, - /* 0x108 */ OPT_ALIGN_PACK, - /* 0x109 */ OPT_ALIGN_BRRES, - /* 0x10a */ OPT_ALIGN_BREFF, - /* 0x10b */ OPT_ALIGN_BREFT, - /* 0x10c */ OPT_ALIGN, - /* 0x10d */ OPT_ENCODE_ALL, - /* 0x10e */ OPT_ENCODE_IMG, - /* 0x10f */ OPT_NO_ENCODE, - /* 0x110 */ OPT_NO_RECURSE, - /* 0x111 */ OPT_AUTO_ADD, - /* 0x112 */ OPT_NO_ECHO, - /* 0x113 */ OPT_PT_DIR, - /* 0x114 */ OPT_RM_AIPARAM, - /* 0x115 */ OPT_U8, - /* 0x116 */ OPT_SZS, - /* 0x117 */ OPT_WU8, - /* 0x118 */ OPT_XWU8, - /* 0x119 */ OPT_WBZ, - /* 0x11a */ OPT_PACK, - /* 0x11b */ OPT_BRRES, - /* 0x11c */ OPT_BREFF, - /* 0x11d */ OPT_BREFT, - /* 0x11e */ OPT_NO_COMPRESS, - /* 0x11f */ OPT_FAST, - /* 0x120 */ OPT_LINKS, - /* 0x121 */ OPT_BASEDIR, - /* 0x122 */ OPT_DECODE, - /* 0x123 */ OPT_MIPMAPS, - /* 0x124 */ OPT_NO_MIPMAPS, - /* 0x125 */ OPT_N_MIPMAPS, - /* 0x126 */ OPT_MAX_MIPMAPS, - /* 0x127 */ OPT_MIPMAP_SIZE, - /* 0x128 */ OPT_FAST_MIPMAPS, - /* 0x129 */ OPT_CMPR_DEFAULT, - /* 0x12a */ OPT_CUT, - /* 0x12b */ OPT_RAW, - /* 0x12c */ OPT_SECTIONS, - /* 0x12d */ 0,0,0,0, 0,0,0,0, 0, + /* 0x081 */ OPT_CONFIG, + /* 0x082 */ OPT_ALLOW_ALL, + /* 0x083 */ OPT_COMPATIBLE, + /* 0x084 */ OPT_WIDTH, + /* 0x085 */ OPT_MAX_WIDTH, + /* 0x086 */ OPT_DE, + /* 0x087 */ OPT_COLORS, + /* 0x088 */ OPT_NO_COLORS, + /* 0x089 */ OPT_CT_CODE, + /* 0x08a */ OPT_LE_CODE, + /* 0x08b */ OPT_CHDIR, + /* 0x08c */ OPT_TOUCH, + /* 0x08d */ OPT_AUTO, + /* 0x08e */ OPT_SET_FLAGS, + /* 0x08f */ OPT_SET_SCALE, + /* 0x090 */ OPT_SET_ROT, + /* 0x091 */ OPT_SET_X, + /* 0x092 */ OPT_SET_Y, + /* 0x093 */ OPT_SET_Z, + /* 0x094 */ OPT_XCENTER, + /* 0x095 */ OPT_YCENTER, + /* 0x096 */ OPT_ZCENTER, + /* 0x097 */ OPT_CENTER, + /* 0x098 */ OPT_SCALE, + /* 0x099 */ OPT_SHIFT, + /* 0x09a */ OPT_XSS, + /* 0x09b */ OPT_YSS, + /* 0x09c */ OPT_ZSS, + /* 0x09d */ OPT_ROT, + /* 0x09e */ OPT_XROT, + /* 0x09f */ OPT_YROT, + /* 0x0a0 */ OPT_ZROT, + /* 0x0a1 */ OPT_YPOS, + /* 0x0a2 */ OPT_TRANSLATE, + /* 0x0a3 */ OPT_NULL, + /* 0x0a4 */ OPT_NEXT, + /* 0x0a5 */ OPT_ASCALE, + /* 0x0a6 */ OPT_AROT, + /* 0x0a7 */ OPT_TFORM_SCRIPT, + /* 0x0a8 */ OPT_MINIMAP, + /* 0x0a9 */ OPT_RM_GOBJ, + /* 0x0aa */ OPT_BATTLE, + /* 0x0ab */ OPT_EXPORT_FLAGS, + /* 0x0ac */ OPT_ROUTE_OPTIONS, + /* 0x0ad */ OPT_WIM0, + /* 0x0ae */ OPT_SLOT, + /* 0x0af */ OPT_LOAD_KCL, + /* 0x0b0 */ OPT_KCL, + /* 0x0b1 */ OPT_KCL_FLAG, + /* 0x0b2 */ OPT_KCL_SCRIPT, + /* 0x0b3 */ OPT_TRI_AREA, + /* 0x0b4 */ OPT_TRI_HEIGHT, + /* 0x0b5 */ OPT_FLAG_FILE, + /* 0x0b6 */ OPT_XTRIDATA, + /* 0x0b7 */ OPT_KMP, + /* 0x0b8 */ OPT_SPEED_MOD, + /* 0x0b9 */ OPT_KTPT2, + /* 0x0ba */ OPT_TFORM_KMP, + /* 0x0bb */ OPT_REPAIR_XPF, + /* 0x0bc */ OPT_GAMEMODES, + /* 0x0bd */ OPT_MDL, + /* 0x0be */ OPT_PAT, + /* 0x0bf */ OPT_PATCH_FILE, + /* 0x0c0 */ OPT_KMG_LIMIT, + /* 0x0c1 */ OPT_KMG_COPY, + /* 0x0c2 */ OPT_LT_CLEAR, + /* 0x0c3 */ OPT_LT_ONLINE, + /* 0x0c4 */ OPT_LT_N_PLAYERS, + /* 0x0c5 */ OPT_LT_COND_BIT, + /* 0x0c6 */ OPT_LT_GAME_MODE, + /* 0x0c7 */ OPT_LT_ENGINE, + /* 0x0c8 */ OPT_LT_RANDOM, + /* 0x0c9 */ OPT_LEX_PURGE, + /* 0x0ca */ OPT_LEX_FEATURES, + /* 0x0cb */ OPT_LEX_RM_FEAT, + /* 0x0cc */ OPT_LOAD_BMG, + /* 0x0cd */ OPT_PATCH_BMG, + /* 0x0ce */ OPT_MACRO_BMG, + /* 0x0cf */ OPT_FILTER_BMG, + /* 0x0d0 */ OPT_CACHE, + /* 0x0d1 */ OPT_CNAME, + /* 0x0d2 */ OPT_ID, + /* 0x0d3 */ OPT_BASE64, + /* 0x0d4 */ OPT_DB64, + /* 0x0d5 */ OPT_CODING, + /* 0x0d6 */ OPT_VERIFY, + /* 0x0d7 */ OPT_ROUND, + /* 0x0d8 */ OPT_PIPE, + /* 0x0d9 */ OPT_DELTA, + /* 0x0da */ OPT_DIFF, + /* 0x0db */ OPT_EPSILON, + /* 0x0dc */ OPT_BMG_ENDIAN, + /* 0x0dd */ OPT_BMG_ENCODING, + /* 0x0de */ OPT_BMG_INF_SIZE, + /* 0x0df */ OPT_BMG_MID, + /* 0x0e0 */ OPT_FORCE_ATTRIB, + /* 0x0e1 */ OPT_DEF_ATTRIB, + /* 0x0e2 */ OPT_NO_ATTRIB, + /* 0x0e3 */ OPT_X_ESCAPES, + /* 0x0e4 */ OPT_OLD_ESCAPES, + /* 0x0e5 */ OPT_NO_BMG_COLORS, + /* 0x0e6 */ OPT_BMG_COLORS, + /* 0x0e7 */ OPT_NO_BMG_INLINE, + /* 0x0e8 */ OPT_AUTOADD_PATH, + /* 0x0e9 */ OPT_STRIP, + /* 0x0ea */ OPT_UTF_8, + /* 0x0eb */ OPT_NO_UTF_8, + /* 0x0ec */ OPT_FORCE, + /* 0x0ed */ OPT_REPAIR_MAGICS, + /* 0x0ee */ OPT_TINY, + /* 0x0ef */ OPT_YAZ0, + /* 0x0f0 */ OPT_YAZ1, + /* 0x0f1 */ OPT_XYZ, + /* 0x0f2 */ OPT_BZ, + /* 0x0f3 */ OPT_SH, + /* 0x0f4 */ OPT_BASH, + /* 0x0f5 */ OPT_JSON, + /* 0x0f6 */ OPT_PHP, + /* 0x0f7 */ OPT_MAKEDOC, + /* 0x0f8 */ OPT_VAR, + /* 0x0f9 */ OPT_ARRAY, + /* 0x0fa */ OPT_AVAR, + /* 0x0fb */ OPT_CASE, + /* 0x0fc */ OPT_PMODES, + /* 0x0fd */ OPT_FMODES, + /* 0x0fe */ OPT_INSTALL, + /* 0x0ff */ OPT_ANALYZE, + /* 0x100 */ OPT_ANALYZE_MODE, + /* 0x101 */ OPT_OLD, + /* 0x102 */ OPT_STD, + /* 0x103 */ OPT_NEW, + /* 0x104 */ OPT_EXTRACT, + /* 0x105 */ OPT_NUMBER, + /* 0x106 */ OPT_REMOVE_SRC, + /* 0x107 */ OPT_IGNORE_SETUP, + /* 0x108 */ OPT_PURGE, + /* 0x109 */ OPT_ALIGN_U8, + /* 0x10a */ OPT_ALIGN_PACK, + /* 0x10b */ OPT_ALIGN_BRRES, + /* 0x10c */ OPT_ALIGN_BREFF, + /* 0x10d */ OPT_ALIGN_BREFT, + /* 0x10e */ OPT_ALIGN, + /* 0x10f */ OPT_ENCODE_ALL, + /* 0x110 */ OPT_ENCODE_IMG, + /* 0x111 */ OPT_NO_ENCODE, + /* 0x112 */ OPT_NO_RECURSE, + /* 0x113 */ OPT_AUTO_ADD, + /* 0x114 */ OPT_NO_ECHO, + /* 0x115 */ OPT_PT_DIR, + /* 0x116 */ OPT_RM_AIPARAM, + /* 0x117 */ OPT_U8, + /* 0x118 */ OPT_SZS, + /* 0x119 */ OPT_WU8, + /* 0x11a */ OPT_XWU8, + /* 0x11b */ OPT_WBZ, + /* 0x11c */ OPT_PACK, + /* 0x11d */ OPT_BRRES, + /* 0x11e */ OPT_BREFF, + /* 0x11f */ OPT_BREFT, + /* 0x120 */ OPT_NO_COMPRESS, + /* 0x121 */ OPT_FAST, + /* 0x122 */ OPT_LINKS, + /* 0x123 */ OPT_BASEDIR, + /* 0x124 */ OPT_DECODE, + /* 0x125 */ OPT_MIPMAPS, + /* 0x126 */ OPT_NO_MIPMAPS, + /* 0x127 */ OPT_N_MIPMAPS, + /* 0x128 */ OPT_MAX_MIPMAPS, + /* 0x129 */ OPT_MIPMAP_SIZE, + /* 0x12a */ OPT_FAST_MIPMAPS, + /* 0x12b */ OPT_CMPR_DEFAULT, + /* 0x12c */ OPT_CUT, + /* 0x12d */ OPT_RAW, + /* 0x12e */ OPT_SECTIONS, + /* 0x12f */ 0,0,0,0, 0,0,0, }; // @@ -2888,670 +2928,679 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[133] = // cmd #1 +static u8 option_allowed_cmd_VERSION[134] = // cmd #1 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_HELP[133] = // cmd #2 +static u8 option_allowed_cmd_HELP[134] = // cmd #2 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 +}; + +static u8 option_allowed_cmd_CONFIG[134] = // cmd #3 +{ + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_ARGTEST[133] = // cmd #3 +static u8 option_allowed_cmd_ARGTEST[134] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 }; -static u8 option_allowed_cmd_TEST[133] = // cmd #4 +static u8 option_allowed_cmd_TEST[134] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1 }; -static u8 option_allowed_cmd_COLORS[133] = // cmd #5 +static u8 option_allowed_cmd_COLORS[134] = // cmd #6 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_ERROR[133] = // cmd #6 +static u8 option_allowed_cmd_ERROR[134] = // cmd #7 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[133] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[134] = // cmd #8 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_FILEATTRIB[133] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[134] = // cmd #9 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_BRSUB[133] = // cmd #9 +static u8 option_allowed_cmd_BRSUB[134] = // cmd #10 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[133] = // cmd #10 +static u8 option_allowed_cmd_SYMBOLS[134] = // cmd #11 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[133] = // cmd #11 +static u8 option_allowed_cmd_FUNCTIONS[134] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[133] = // cmd #12 +static u8 option_allowed_cmd_CALCULATE[134] = // cmd #13 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_MATRIX[133] = // cmd #13 +static u8 option_allowed_cmd_MATRIX[134] = // cmd #14 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_FLOAT[133] = // cmd #14 +static u8 option_allowed_cmd_FLOAT[134] = // cmd #15 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_VR_CALC[133] = // cmd #15 +static u8 option_allowed_cmd_VR_CALC[134] = // cmd #16 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_VR_RACE[133] = // cmd #16 +static u8 option_allowed_cmd_VR_RACE[134] = // cmd #17 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_AUTOADD[133] = // cmd #17 +static u8 option_allowed_cmd_AUTOADD[134] = // cmd #18 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 1,0,0,1,0, 1,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,1,0,0,1, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_TRACKS[133] = // cmd #18 +static u8 option_allowed_cmd_TRACKS[134] = // cmd #19 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0 }; -static u8 option_allowed_cmd_SCANCACHE[133] = // cmd #19 +static u8 option_allowed_cmd_SCANCACHE[134] = // cmd #20 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_EXPORT[133] = // cmd #20 +static u8 option_allowed_cmd_EXPORT[134] = // cmd #21 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_CODE[133] = // cmd #21 +static u8 option_allowed_cmd_CODE[134] = // cmd #22 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_RECODE[133] = // cmd #22 +static u8 option_allowed_cmd_RECODE[134] = // cmd #23 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_SUBFILE[133] = // cmd #23 +static u8 option_allowed_cmd_SUBFILE[134] = // cmd #24 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_TESTNORM[133] = // cmd #24 +static u8 option_allowed_cmd_TESTNORM[134] = // cmd #25 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_LIST[133] = // cmd #25 +static u8 option_allowed_cmd_LIST[134] = // cmd #26 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_LIST_L[133] = // cmd #26 +static u8 option_allowed_cmd_LIST_L[134] = // cmd #27 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_LIST_LL[133] = // cmd #27 +static u8 option_allowed_cmd_LIST_LL[134] = // cmd #28 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_LIST_LLL[133] = // cmd #28 +static u8 option_allowed_cmd_LIST_LLL[134] = // cmd #29 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_LIST_A[133] = // cmd #29 +static u8 option_allowed_cmd_LIST_A[134] = // cmd #30 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_LIST_LA[133] = // cmd #30 +static u8 option_allowed_cmd_LIST_LA[134] = // cmd #31 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,0,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,0,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_NAME_REF[133] = // cmd #31 +static u8 option_allowed_cmd_NAME_REF[134] = // cmd #32 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_ILIST[133] = // cmd #32 +static u8 option_allowed_cmd_ILIST[134] = // cmd #33 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_ILIST_L[133] = // cmd #33 +static u8 option_allowed_cmd_ILIST_L[134] = // cmd #34 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_ILIST_LL[133] = // cmd #34 +static u8 option_allowed_cmd_ILIST_LL[134] = // cmd #35 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_ILIST_A[133] = // cmd #35 +static u8 option_allowed_cmd_ILIST_A[134] = // cmd #36 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_ILIST_LA[133] = // cmd #36 +static u8 option_allowed_cmd_ILIST_LA[134] = // cmd #37 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_MEMORY[133] = // cmd #37 +static u8 option_allowed_cmd_MEMORY[134] = // cmd #38 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_MEMORY_A[133] = // cmd #38 +static u8 option_allowed_cmd_MEMORY_A[134] = // cmd #39 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,0,0 }; -static u8 option_allowed_cmd_DUMP[133] = // cmd #39 +static u8 option_allowed_cmd_DUMP[134] = // cmd #40 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_SHA1[133] = // cmd #40 +static u8 option_allowed_cmd_SHA1[134] = // cmd #41 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,1, 1,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_ANALYZE[133] = // cmd #41 +static u8 option_allowed_cmd_ANALYZE[134] = // cmd #42 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_FEATURES[133] = // cmd #42 +static u8 option_allowed_cmd_FEATURES[134] = // cmd #43 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,1,1,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_DISTRIBUTION[133] = // cmd #43 +static u8 option_allowed_cmd_DISTRIBUTION[134] = // cmd #44 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,1,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,1,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_DIFF[133] = // cmd #44 +static u8 option_allowed_cmd_DIFF[134] = // cmd #45 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, - 0,0,0,0,0, 0,0,0,0,1, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 1,0,0,0,0, 0,0,0,0,0, 1,1,0,0 }; -static u8 option_allowed_cmd_CHECK[133] = // cmd #45 +static u8 option_allowed_cmd_CHECK[134] = // cmd #46 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_SLOTS[133] = // cmd #46 +static u8 option_allowed_cmd_SLOTS[134] = // cmd #47 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,0,0, 0,0,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_STGI[133] = // cmd #47 +static u8 option_allowed_cmd_STGI[134] = // cmd #48 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_ISARENA[133] = // cmd #48 +static u8 option_allowed_cmd_ISARENA[134] = // cmd #49 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_NORMALIZE[133] = // cmd #49 +static u8 option_allowed_cmd_NORMALIZE[134] = // cmd #50 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_PATCH[133] = // cmd #50 +static u8 option_allowed_cmd_PATCH[134] = // cmd #51 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 1,1,1,1,0, 0,0,0,0,1, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_COPY[133] = // cmd #51 +static u8 option_allowed_cmd_COPY[134] = // cmd #52 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 1,1,1,1,0, 0,0,0,0,1, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_DUPLICATE[133] = // cmd #52 +static u8 option_allowed_cmd_DUPLICATE[134] = // cmd #53 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,1,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 1,1,1,1,0, 0,0,0,0,1, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_MINIMAP[133] = // cmd #53 +static u8 option_allowed_cmd_MINIMAP[134] = // cmd #54 { 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_COMPRESS[133] = // cmd #54 +static u8 option_allowed_cmd_COMPRESS[134] = // cmd #55 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 1,1,1,1,0, 0,0,0,0,1, 1,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,1,1,1,1, 0,0,0,0,0, 1,1,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_DECOMPRESS[133] = // cmd #55 +static u8 option_allowed_cmd_DECOMPRESS[134] = // cmd #56 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,1,1,1, 1,1,0,0,1, - 1,1,1,1,1, 0,0,0,0,1, 0,0,1,1,1, 0,1,0,0,0, 0,0,0,0,0, 0,1,1,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,0,0, + 1,1,1,1,1, 1,0,0,0,0, 1,0,0,1,1, 1,0,1,0,0, 0,0,0,0,0, 0,0,1,1,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_ENCODE[133] = // cmd #56 +static u8 option_allowed_cmd_ENCODE[134] = // cmd #57 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,1, - 1,1,1,1,1, 1,1,1,1,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, + 1,1,1,1,1, 1,1,1,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_CREATE[133] = // cmd #57 +static u8 option_allowed_cmd_CREATE[134] = // cmd #58 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,0,1,0,1, - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,0,1,0,0, - 0,0,1,1,1, 1,1,1,1,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,0,1,0, + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,0,1,0, + 0,0,0,1,1, 1,1,1,1,1, 0,1,0,0 }; -static u8 option_allowed_cmd_UPDATE[133] = // cmd #58 +static u8 option_allowed_cmd_UPDATE[134] = // cmd #59 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,1,1,1,1, 1,1,0,1,1, 1,1,0,0,0, - 0,0,0,0,0, 1,1,1,1,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,0,0,0,1, - 0,0,0,0,0, 0,0,0,0,0, 1,0,0 + 0,0,0,0,0, 0,0,0,0,0, 1,1,0,0,0, 0,0,1,1,1, 1,1,1,0,1, 1,1,1,0,0, + 0,0,0,0,0, 0,1,1,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,1, 1,1,0,0,0, + 1,0,0,0,0, 0,0,0,0,0, 0,1,0,0 }; -static u8 option_allowed_cmd_EXTRACT[133] = // cmd #59 +static u8 option_allowed_cmd_EXTRACT[134] = // cmd #60 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,1, 1,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, - 1,1,1,1,0, 0,0,1,1,1, 1,1,0 + 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 1,1,0,1,1, 1,1,1,0,1, 1,1,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, + 1,1,1,1,1, 0,0,0,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_XDECODE[133] = // cmd #60 +static u8 option_allowed_cmd_XDECODE[134] = // cmd #61 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,1, 1,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, - 1,1,1,1,0, 0,0,1,1,1, 1,1,0 + 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 1,1,0,1,1, 1,1,1,0,1, 1,1,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, + 1,1,1,1,1, 0,0,0,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_XEXPORT[133] = // cmd #61 +static u8 option_allowed_cmd_XEXPORT[134] = // cmd #62 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,1, 1,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, - 1,1,1,1,0, 0,0,1,1,1, 1,1,0 + 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 1,1,0,1,1, 1,1,1,0,1, 1,1,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, + 1,1,1,1,1, 0,0,0,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_XALL[133] = // cmd #62 +static u8 option_allowed_cmd_XALL[134] = // cmd #63 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,1, 1,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, - 1,1,1,1,0, 0,0,1,1,1, 1,1,0 + 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 1,1,0,1,1, 1,1,1,0,1, 1,1,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, + 1,1,1,1,1, 0,0,0,1,1, 1,1,1,0 }; -static u8 option_allowed_cmd_XCOMMON[133] = // cmd #63 +static u8 option_allowed_cmd_XCOMMON[134] = // cmd #64 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_BINARY[133] = // cmd #64 +static u8 option_allowed_cmd_BINARY[134] = // cmd #65 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_TEXT[133] = // cmd #65 +static u8 option_allowed_cmd_TEXT[134] = // cmd #66 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,1,1,0,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,1,0,0,0, + 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,1,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_CAT[133] = // cmd #66 +static u8 option_allowed_cmd_CAT[134] = // cmd #67 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,1,1,0,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 1,1,1,1,1, 1,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,1,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_BMG[133] = // cmd #67 +static u8 option_allowed_cmd_BMG[134] = // cmd #68 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,0,0,0,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 1,1,1,1,1, 1,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_KCL[133] = // cmd #68 +static u8 option_allowed_cmd_KCL[134] = // cmd #69 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_KMP[133] = // cmd #69 +static u8 option_allowed_cmd_KMP[134] = // cmd #70 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,0, 1,0,0,1,1, 1,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_LEX[133] = // cmd #70 +static u8 option_allowed_cmd_LEX[134] = // cmd #71 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_INFO[133] = // cmd #71 +static u8 option_allowed_cmd_INFO[134] = // cmd #72 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_GHOST[133] = // cmd #72 +static u8 option_allowed_cmd_GHOST[134] = // cmd #73 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,0,0,0, 0,1,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1 }; -static u8 option_allowed_cmd_YAZDUMP[133] = // cmd #73 +static u8 option_allowed_cmd_YAZDUMP[134] = // cmd #74 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,1,0,1,1, 1,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,1, 1,1,1,0,1, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; -static u8 option_allowed_cmd_VEHICLE[133] = // cmd #74 +static u8 option_allowed_cmd_VEHICLE[134] = // cmd #75 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,1,1,0, 1,0,0,0,0, 0,0,0,0,0, + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0 }; @@ -3565,6 +3614,7 @@ static const InfoOption_t * option_tab_tool[] = OptionInfo + OPT_VERSION, OptionInfo + OPT_HELP, OptionInfo + OPT_XHELP, + OptionInfo + OPT_CONFIG, OptionInfo + OPT_ALLOW_ALL, OptionInfo + OPT_COMPATIBLE, OptionInfo + OPT_WIDTH, @@ -3654,6 +3704,30 @@ static const InfoOption_t * option_tab_cmd_HELP[] = 0 }; +static const InfoOption_t * option_tab_cmd_CONFIG[] = +{ + OptionInfo + OPT_CONFIG, + OptionInfo + OPT_INSTALL, + OptionInfo + OPT_AUTOADD_PATH, + &option_cmd_CONFIG_LONG, + + OptionInfo + OPT_NONE, // separator + + &option_grp_SCRIPT_SECTIONS, + OptionInfo + OPT_SH, + OptionInfo + OPT_BASH, + OptionInfo + OPT_JSON, + OptionInfo + OPT_PHP, + OptionInfo + OPT_MAKEDOC, + OptionInfo + OPT_VAR, + OptionInfo + OPT_ARRAY, + OptionInfo + OPT_AVAR, + OptionInfo + OPT_CASE, + &option_cmd_CONFIG_BRIEF, + + 0 +}; + static const InfoOption_t * option_tab_cmd_ARGTEST[] = { @@ -4804,6 +4878,7 @@ static const InfoOption_t * option_tab_cmd_ANALYZE[] = OptionInfo + OPT_NONE, // separator + &option_grp_SCRIPT_SECTIONS, OptionInfo + OPT_SH, OptionInfo + OPT_BASH, OptionInfo + OPT_JSON, @@ -4831,6 +4906,7 @@ static const InfoOption_t * option_tab_cmd_FEATURES[] = OptionInfo + OPT_NONE, // separator + &option_grp_SCRIPT_SECTIONS, OptionInfo + OPT_SH, OptionInfo + OPT_BASH, OptionInfo + OPT_JSON, @@ -6664,6 +6740,7 @@ static const InfoOption_t * option_tab_cmd_GHOST[] = OptionInfo + OPT_NONE, // separator + &option_grp_SCRIPT_SECTIONS, OptionInfo + OPT_SH, OptionInfo + OPT_BASH, OptionInfo + OPT_JSON, @@ -6728,10 +6805,10 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = 0, "wszst [option]... command [option|parameter|file]...", "Wiimms SZS Tool : List, compare, (de-)compress, extract and create" - " SZS, U8, PACK, BRRES, BREFF, BREFT and RARC archives. It is also a" - " wrapper to all other tools.", + " SZS, U8, PACK, BRRES, BREFF and BREFT archives. Additonally, RARC" + " archive can be extracted. It is also a wrapper to all other tools.", 0, - 65, + 66, option_tab_tool, 0 }, @@ -6774,6 +6851,22 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HELP }, + { CMD_CONFIG, + false, + false, + false, + "CONFIG", + 0, + "wszst CONFIG [options]...", + "Show all information about the search for the configuration file and" + " its content. The command can also export the settings for scripts or" + " can create or update configuration files.", + 0, + 15, + option_tab_cmd_CONFIG, + option_allowed_cmd_CONFIG + }, + { CMD_ARGTEST, false, false, @@ -7394,7 +7487,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wszst ANALYZE [source]...", "Analyse track files and print results in machine readable format.", 0, - 14, + 15, option_tab_cmd_ANALYZE, option_allowed_cmd_ANALYZE }, @@ -7408,7 +7501,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wszst FEATURES [source]...", "Analyse track files and a feature list in machine readable format.", 0, - 17, + 18, option_tab_cmd_FEATURES, option_allowed_cmd_FEATURES }, @@ -7683,9 +7776,9 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "CREATE", "C", "wszst CREATE [source_dir]...", - "Create SZS, U8, PACK, BRRES, BREFF, BREFT or RARC archives by adding" - " all not hidden files of the directory structure. Create and/or" - " encode sub files if necessary. The default destination is '%P/%N%T'.", + "Create SZS, U8, PACK, BRRES, BREFF or BREFT archives by adding all" + " not hidden files of the directory structure. Create and/or encode" + " sub files if necessary. The default destination is '%P/%N%T'.", 0, 95, option_tab_cmd_CREATE, @@ -7933,7 +8026,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wszst GHOST [source]...", "Analyse each file and print a summary about the ghost data.", 0, - 13, + 14, option_tab_cmd_GHOST, option_allowed_cmd_GHOST }, @@ -7945,8 +8038,8 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "YAZDUMP", "YD", "wszst YAZDUMP [szs]...", - "Analyze YAZ compression print a dump to stdout. Ignore files without" - " YAZ compression.", + "Analyze YAZ compression and print a dump to stdout. Ignore files" + " without YAZ compression.", 0, 8, option_tab_cmd_YAZDUMP, diff --git a/project/src/ui/ui-wszst.h b/project/src/ui/ui-wszst.h index fabeee1..bcbc993 100644 --- a/project/src/ui/ui-wszst.h +++ b/project/src/ui/ui-wszst.h @@ -129,6 +129,7 @@ typedef enum enumOptions OPT_STRIP, OPT_PMODES, OPT_FMODES, + OPT_INSTALL, OPT_ANALYZE, OPT_ANALYZE_MODE, OPT_SOURCE, @@ -189,13 +190,14 @@ typedef enum enumOptions OPT_RAW, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 133 + OPT__N_SPECIFIC, // == 134 //----- global options ----- OPT_VERSION, OPT_HELP, OPT_XHELP, + OPT_CONFIG, OPT_ALLOW_ALL, OPT_COMPATIBLE, OPT_WIDTH, @@ -268,7 +270,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 207 + OPT__N_TOTAL // == 209 } enumOptions; @@ -356,6 +358,7 @@ typedef enum enumOptions // OB_STRIP = 1llu << OPT_STRIP, // OB_PMODES = 1llu << OPT_PMODES, // OB_FMODES = 1llu << OPT_FMODES, +// OB_INSTALL = 1llu << OPT_INSTALL, // OB_ANALYZE = 1llu << OPT_ANALYZE, // OB_ANALYZE_MODE = 1llu << OPT_ANALYZE_MODE, // OB_SOURCE = 1llu << OPT_SOURCE, @@ -471,7 +474,7 @@ typedef enum enumOptions // | OB_XWU8 // | OB_WBZ, // -// OB_GRP_SCRIPT = 0, +// OB_GRP_SCRIPT = OB_SECTIONS, // // OB_GRP_ALIGN = OB_ALIGN_U8 // | OB_ALIGN_PACK @@ -558,6 +561,11 @@ typedef enum enumOptions // // OB_CMD_HELP = ~(u64)0, // +// OB_CMD_CONFIG = OB_INSTALL +// | OB_LONG +// | OB_GRP_SCRIPT +// | OB_BRIEF, +// // OB_CMD_ARGTEST = ~(u64)0, // // OB_CMD_TEST = ~(u64)0, @@ -925,6 +933,7 @@ typedef enum enumCommands CMD_VERSION, CMD_HELP, + CMD_CONFIG, CMD_ARGTEST, CMD_TEST, CMD_COLORS, @@ -1006,7 +1015,7 @@ typedef enum enumCommands CMD_VEHICLE, - CMD__N // == 75 + CMD__N // == 76 } enumCommands; @@ -1056,6 +1065,7 @@ typedef enum enumGetOpt GO_TRANSFORM = 'x', GO_XHELP = 0x80, + GO_CONFIG, GO_ALLOW_ALL, GO_COMPATIBLE, GO_WIDTH, @@ -1180,6 +1190,7 @@ typedef enum enumGetOpt GO_CASE, GO_PMODES, GO_FMODES, + GO_INSTALL, GO_ANALYZE, GO_ANALYZE_MODE, GO_OLD, diff --git a/project/src/ui/ui.def b/project/src/ui/ui.def index 722bdb5..0c8671f 100644 --- a/project/src/ui/ui.def +++ b/project/src/ui/ui.def @@ -7,8 +7,8 @@ #:def_tool( "wszst", \ "wszst [option]... command [option|parameter|@file]...", \ "Wiimms SZS Tool : List, compare, (de-)compress, extract and create" \ - " SZS, U8, PACK, BRRES, BREFF, BREFT and RARC archives. It is also a" \ - " wrapper to all other tools." ) + " SZS, U8, PACK, BRRES, BREFF and BREFT archives. Additonally, RARC" \ + " archive can be extracted. It is also a wrapper to all other tools." ) #:def_cmd( "VERSION", "VERSION", \ "wszst VERSION [ignored]...", \ @@ -29,6 +29,12 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wszst CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content. The command can also export the settings for scripts or" \ + " can create or update configuration files." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wszst ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -366,10 +372,9 @@ #:def_cmd( "CREATE", "CREATE|C", \ "wszst CREATE [source_dir]...", \ - "Create SZS, U8, PACK, BRRES, BREFF, BREFT or RARC archives by adding" \ - " all not hidden files of the directory structure. Create and/or" \ - " encode sub files if necessary. The default destination is" \ - " @'%P/%N%T'@." ) + "Create SZS, U8, PACK, BRRES, BREFF or BREFT archives by adding all" \ + " not hidden files of the directory structure. Create and/or encode" \ + " sub files if necessary. The default destination is @'%P/%N%T'@." ) #:def_cmd( "UPDATE", "UPDATE|U", \ "wszst UPDATE [source]... [--source=] [--dest=]", \ @@ -465,8 +470,8 @@ #:def_cmd( "YAZDUMP", "YAZDUMP|YD", \ "wszst YAZDUMP [szs]...", \ - "Analyze YAZ compression print a dump to stdout. Ignore files without" \ - " YAZ compression." ) + "Analyze YAZ compression and print a dump to stdout. Ignore files" \ + " without YAZ compression." ) #:def_opt( "VERSION", "V|version", "G", \ "", \ @@ -481,6 +486,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -1379,7 +1392,7 @@ "directory", \ "Define an alternative directory as autoadd library. The default is," \ " that the sub-directory called './auto-add/' of all search paths are" \ - " used. Use {wszst test -vvvv} for tests." ) + " used. Use {wszst config -ll} for tests." ) #:def_opt( "TRANSFORM", "x|transform", "CP", \ "list", \ @@ -1485,7 +1498,7 @@ #:def_opt( "VAR", "var", "GP", \ "varname", \ "Use @VARNAME@ as variable name or prefix on script output. The" \ - " default variabe name is 'res'." ) + " default value is 'res' for variables and 'res_' as prefix." ) #:def_opt( "ARRAY", "array", "G", \ "", \ @@ -1504,6 +1517,10 @@ " @UPPER@ are set, then the lower/upper case of the variable names is" \ " adjusted accordingly." ) +#:def_opt( "INSTALL", "install", "C", \ + "", \ + "Manage configuration for an installation." ) + #:def_opt( "SOURCE", "s|source|src", "CP", \ "path", \ "Define a secondary source path (directory/file).\n" \ @@ -1883,6 +1900,69 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "INSTALL", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "AUTOADD_PATH", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too. If set twice, print the auto-add" \ + " search list too. This option is ignored, if any script output is" \ + " enabled." ) + +#:def_cmd_opt( "CONFIG", "SECTIONS", \ + "", \ + "Dump info using configuration or section syntax. Use {--var name} as" \ + " prefix." ) + +#:def_cmd_opt( "CONFIG", "SH", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "BASH", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "JSON", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "PHP", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "MAKEDOC", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "VAR", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "ARRAY", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "AVAR", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "CASE", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "BRIEF", \ + "", \ + "If printed as sections, exclude all comments." ) + #:def_cmd_opt( "TEST", "VERBOSE", \ "", \ "Print the matrices of transformations." ) @@ -5011,6 +5091,11 @@ "", \ "Suppress logging of input and output files." ) +#:def_cmd_opt( "ANALYZE", "SECTIONS", \ + "", \ + "Dump info using configuration or section syntax. Use {--var name} as" \ + " prefix." ) + #:def_cmd_opt( "ANALYZE", "SH", \ "", \ "" ) @@ -5072,6 +5157,11 @@ "", \ "Suppress logging of input and output files." ) +#:def_cmd_opt( "FEATURES", "SECTIONS", \ + "", \ + "Dump info using configuration or section syntax. Use {--var name} as" \ + " prefix." ) + #:def_cmd_opt( "FEATURES", "SH", \ "", \ "" ) @@ -10947,6 +11037,11 @@ "", \ "Suppress output of the printed filename." ) +#:def_cmd_opt( "GHOST", "SECTIONS", \ + "", \ + "Dump info using configuration or section syntax. Use {--var name} as" \ + " prefix." ) + #:def_cmd_opt( "GHOST", "SH", \ "", \ "" ) @@ -11081,6 +11176,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wbmgt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wbmgt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -11210,6 +11310,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -11591,6 +11699,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) @@ -12317,6 +12433,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wctct CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wctct ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -12436,6 +12557,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -12902,6 +13031,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) @@ -13675,6 +13812,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wimgt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wimgt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -13763,6 +13905,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -14087,6 +14237,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) @@ -14541,6 +14699,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wkclt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wkclt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -14728,6 +14891,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -15187,6 +15358,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "TEST", "VERBOSE", \ "", \ "Print the matrices of transformations." ) @@ -16865,6 +17044,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wkmpt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wkmpt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -17052,6 +17236,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -17720,6 +17912,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "TEST", "VERBOSE", \ "", \ "Print the matrices of transformations." ) @@ -18951,6 +19151,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wlect CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wlect ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -19087,6 +19292,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -19341,9 +19554,15 @@ #:def_opt( "SPEEDOMETER", "speedometer", "CO", \ "[=mode]", \ "Enable or disable the speedometer. Mode is one of @OFF@, @AUTO@" \ - " (default, don't change setting), @ON@ (enable it for Wii and WiiU" \ - " only; default, if option is used without parameter) or @FORCE@" \ - " (enable it for Wii, Wii U and for Dolphin)." ) + " (default, don't change setting), @ON@ (default, if option is used" \ + " without parameter) or @FRACTION@ (=@1DIGIT@), @2DIGITS@ and" \ + " @3DIGITS@." ) + +#:def_opt( "DEBUG", "debug", "CP", \ + "mode", \ + "Enable or disable the debug output while racing. Mode is one of" \ + " @OFF@, @AUTO@ (default, don't change setting), @USER@ or @100@ to" \ + " @199@ for predefined setups." ) #:def_opt( "TRACK_DIR", "track-dir|trackdir", "CP", \ "directory", \ @@ -19512,6 +19731,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) @@ -19621,6 +19848,10 @@ "", \ "" ) +#:def_cmd_opt( "DUMP", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "DUMP", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19670,6 +19901,10 @@ "", \ "" ) +#:def_cmd_opt( "DL", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "DL", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19719,6 +19954,10 @@ "", \ "" ) +#:def_cmd_opt( "DLL", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "DLL", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19776,6 +20015,10 @@ "", \ "" ) +#:def_cmd_opt( "PATCH", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "PATCH", "TRACK_DIR", \ "", \ "" ) @@ -19868,6 +20111,10 @@ "", \ "" ) +#:def_cmd_opt( "LPAR", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "LPAR", "DEST", \ "", \ "" ) @@ -20028,6 +20275,10 @@ "", \ "" ) +#:def_cmd_opt( "CREATE", "DEBUG", \ + "", \ + "" ) + #:def_cmd_opt( "CAT", "COMPLETE", \ "", \ "" ) @@ -20181,6 +20432,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wmdlt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wmdlt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -20293,6 +20549,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -20686,6 +20950,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "TEST", "VERBOSE", \ "", \ "Print the matrices of transformations." ) @@ -21434,6 +21706,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wpatt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wpatt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -21523,6 +21800,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -21763,6 +22048,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) @@ -21990,6 +22283,11 @@ " details about the declared command. The fourth variant prints an" \ " overview about all commands and all global options." ) +#:def_cmd( "CONFIG", "CONFIG", \ + "wstrt CONFIG [options]...", \ + "Show all information about the search for the configuration file and" \ + " its content." ) + #:def_cmd( "ARGTEST", "ARGTEST", \ "wstrt ARGTEST ...", \ "This debug command accepts all kinds of parameters and prints one" \ @@ -22095,6 +22393,14 @@ "Stop parsing the command line and print a help message with all" \ " commands included. Exit after printing." ) +#:def_opt( "CONFIG", "config", "GP", \ + "file", \ + "Define a configuration file or a directory as source. In later case," \ + " file @'wiimms-szs-tools.conf'@ is searched.\n" \ + " If option is not not set, then file @'wiimms-szs-tools.conf'@ is" \ + " searched in different directories. Use command @'wszst CONFIG'@ to" \ + " get more details." ) + #:def_opt( "ALLOW_ALL", "allow-all|allowall", "G", \ "", \ "Usually commands accept only options with impact to the command. All" \ @@ -22644,6 +22950,14 @@ "", \ "" ) +#:def_cmd_opt( "CONFIG", "CONFIG", \ + "", \ + "" ) + +#:def_cmd_opt( "CONFIG", "LONG", \ + "", \ + "If set, print the search list too." ) + #:def_cmd_opt( "COLORS", "COLORS", \ "", \ "" ) diff --git a/project/src/wbmgt.c b/project/src/wbmgt.c index a7f1cfc..c5726b6 100644 --- a/project/src/wbmgt.c +++ b/project/src/wbmgt.c @@ -764,6 +764,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -888,6 +889,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wbmgt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wctct.c b/project/src/wctct.c index adc80c9..815126f 100644 --- a/project/src/wctct.c +++ b/project/src/wctct.c @@ -741,6 +741,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -893,6 +894,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wctct,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wimgt.c b/project/src/wimgt.c index 820a812..8625693 100644 --- a/project/src/wimgt.c +++ b/project/src/wimgt.c @@ -577,6 +577,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -693,6 +694,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wimgt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wkclt.c b/project/src/wkclt.c index c85b0d1..10d7232 100644 --- a/project/src/wkclt.c +++ b/project/src/wkclt.c @@ -1117,6 +1117,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -1250,6 +1251,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wkclt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wkmpt.c b/project/src/wkmpt.c index 1a4040b..80d44c2 100644 --- a/project/src/wkmpt.c +++ b/project/src/wkmpt.c @@ -1573,6 +1573,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -1729,6 +1730,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wkmpt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wlect.c b/project/src/wlect.c index 6e38f3b..123a3a8 100644 --- a/project/src/wlect.c +++ b/project/src/wlect.c @@ -240,6 +240,53 @@ static enumError cmd_export() // /////////////////////////////////////////////////////////////////////////////// +/////////////// command dpad /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError cmd_dpad() +{ + ParamList_t *param; + for ( param = first_param; param; param = param->next ) + { + ccp arg = param->arg; + while ( *arg && (uint)*arg <= ' ' ) + arg++; + u32 num = 0; + if ( *arg >= '0' && *arg <= '9' || *arg >= 'a' && *arg <= 'f' || *arg >= 'A' && *arg <= 'F' ) + num = str2l(arg,0,16); + else + { + while (*arg) + { + switch (*arg++) + { + case 'U': case 'u': num = num << 2 | 0; break; + case 'L': case 'l': num = num << 2 | 1; break; + case 'R': case 'r': num = num << 2 | 2; break; + case 'D': case 'd': num = num << 2 | 3; break; + } + } + } + + char buf[20], *dest = buf + sizeof(buf) -1; + *dest = 0; + for ( u32 n = num; n && dest > buf; n >>= 2 ) + { + switch (n&3) + { + case 0: *--dest = '.'; break; + case 1: *--dest = 'L'; break; + case 2: *--dest = 'R'; break; + case 3: *--dest = 'D'; break; + } + } + printf(" case 0x%08x: // %s\n",num,dest); + } + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// command dump /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -1053,6 +1100,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -1110,9 +1158,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_CUSTOM_TT: err += ScanOptCustomTT(optarg); break; case GO_XPFLAGS: err += ScanOptXPFlags(optarg); break; case GO_SPEEDOMETER: err += ScanOptSpeedometer(optarg); break; - case GO_RESERVED_1B9: err += ScanOptReserved_1b9(optarg); break; - case GO_RESERVED_1BA: err += ScanOptReserved_1ba(optarg); break; - case GO_RESERVED_1BB: err += ScanOptReserved_1bb(optarg); break; + case GO_DEBUG: err += ScanOptDebug(optarg); break; case GO_TRACK_DIR: opt_track_dest = optarg; break; case GO_COPY_TRACKS: err += ScanOptTrackSource(optarg,TFMD_COPY); break; @@ -1217,6 +1263,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wlect,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; @@ -1224,6 +1271,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_FILETYPE: err = cmd_filetype(); break; case CMD_FILEATTRIB: err = cmd_fileattrib(); break; case CMD_EXPORT: err = cmd_export(); break; + case CMD_DPAD: err = cmd_dpad(); break; case CMD_SYMBOLS: err = DumpSymbols(SetupVarsLECODE()); break; case CMD_FUNCTIONS: SetupVarsLECODE(); err = ListParserFunctions(); break; diff --git a/project/src/wmdlt.c b/project/src/wmdlt.c index d35799c..bb705cc 100644 --- a/project/src/wmdlt.c +++ b/project/src/wmdlt.c @@ -534,6 +534,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -660,6 +661,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wmdlt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wpatt.c b/project/src/wpatt.c index f551399..0f28c97 100644 --- a/project/src/wpatt.c +++ b/project/src/wpatt.c @@ -343,6 +343,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -454,6 +455,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wpatt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); break; diff --git a/project/src/wstrt.c b/project/src/wstrt.c index fddb894..31265d7 100644 --- a/project/src/wstrt.c +++ b/project/src/wstrt.c @@ -1172,6 +1172,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -1375,6 +1376,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wstrt,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); diff --git a/project/src/wszst.c b/project/src/wszst.c index 8bc93ea..a169ccf 100644 --- a/project/src/wszst.c +++ b/project/src/wszst.c @@ -144,7 +144,7 @@ static void list_compressions_exit() "This {cmd|YAZ} compression uses a back tracking" " algorithm with recursion depth between {par|0 and 50} (last 2 digits)." " Depths 0 and 1 are similar to mode {par|9}." - " Each new depth doubles the number of calculated pathes." + " Each new depth doubles the number of calculated paths." " Because of some optimizations, a depth of +5 results" " in 10 to 15 times and not in 32 (2^5) times like expected." " This algorithm needs 4 times as much memory as the uncompressed file." @@ -562,14 +562,15 @@ static enumError cmd_autoadd() { SetPatchFileModeReadonly(); - char dest_path[PATH_MAX], path_buf[PATH_MAX]; - PathCatBufPP(dest_path,sizeof(dest_path),share_path,"auto-add/"); - CheckOptDest(dest_path,true); + char path_buf[PATH_MAX]; + const config_t *config = GetConfig(); + CheckOptDest(config->autoadd_path,true); if ( !opt_mkdir && !ExistDirectory(opt_dest,0) ) return ERROR0(ERR_CANT_CREATE_DIR, "Directory does not exist: %s\n",opt_dest); opt_mkdir = true; + autoadd_destination = opt_dest; if (!n_param) opt_overwrite = false; @@ -579,11 +580,11 @@ static enumError cmd_autoadd() if ( !n_param || verbose >= 1 ) { - SetupAutoAdd(); - ccp *aap; - for ( aap = auto_add_path; *aap; aap++ ) - fprintf(stdlog," SEARCH PATH[%td]: %s\n", - aap-auto_add_path,*aap); + const StringField_t *sf = GetAutoaddList(); + int i; + ccp *str = sf->field; + for ( i = 0; i < sf->used; i++, str++ ) + fprintf(stdlog," SEARCH PATH[%d]: %s\n",i,*str); } @@ -1885,30 +1886,6 @@ static enumError cmd_sha1() /////////////// command analyze /////////////// /////////////////////////////////////////////////////////////////////////////// -static void SetupPrintScript ( PrintScript_t *ps ) -{ - DASSERT(ps); - - InitializePrintScript(ps); - ps->varname = script_varname; - ps->force_case = opt_case; - ps->create_array = script_array > 0; - ps->ena_empty = brief_count < 2 ; - ps->ena_comments = brief_count < 1 ; - - switch(script_fform) - { - case FF_JSON: ps->fform = PSFF_JSON; break; - case FF_BASH: ps->fform = PSFF_BASH; break; - case FF_SH: ps->fform = PSFF_SH; break; - case FF_PHP: ps->fform = PSFF_PHP; break; - case FF_MAKEDOC: ps->fform = PSFF_MAKEDOC; break; - default: ps->fform = PSFF_UNKNOWN; break; - } -} - -/////////////////////////////////////////////////////////////////////////////// - static enumError cmd_analyze() { static ccp def_path = "\1P/\1F\1?T"; @@ -1928,7 +1905,7 @@ static enumError cmd_analyze() InitializeFile(&fo); PrintScript_t ps; - SetupPrintScript(&ps); + SetupPrintScriptByOptions(&ps); ParamList_t *param; for ( param = first_param; param; param = param->next ) @@ -2028,6 +2005,7 @@ static enumError cmd_analyze() "race_slot=\"%u %s\"\n" "arena_slot=\"%u %s\"\n" "music_index=\"%u %s\"\n" + "itempos_factors=\"%5.3f %5.3f %5.3f\"\n" "used_x_pos=\"%u=%s %3.2f %3.2f %3.2f %3.2f\"\n" "used_y_pos=\"%u=%s %3.2f %3.2f %3.2f %3.2f\"\n" "used_z_pos=\"%u=%s %3.2f %3.2f %3.2f %3.2f\"\n" @@ -2066,6 +2044,7 @@ static enumError cmd_analyze() ,as.slotinfo.race_slot,as.slotinfo.race_info ,as.slotinfo.arena_slot,as.slotinfo.arena_info ,as.slotinfo.music_index,as.slotinfo.music_info + ,as.lexinfo.item_factor.x,as.lexinfo.item_factor.y,as.lexinfo.item_factor.z ,as.used_pos.orig.rating[0] ,WarnLevelNameLo[as.used_pos.orig.rating[0]] ,as.used_pos.orig.min.x,as.used_pos.orig.max.x @@ -2158,7 +2137,8 @@ static enumError cmd_features() InitializeFile(&fo); PrintScript_t ps; - SetupPrintScript(&ps); + SetupPrintScriptByOptions(&ps); + ps.eq_tabstop = 3; if ( ps.fform == PSFF_UNKNOWN && comments >= 0 ) ps.fform = PSFF_ASSIGN; @@ -4928,7 +4908,7 @@ static enumError cmd_ghost() InitializeFile(&fo); PrintScript_t ps; - SetupPrintScript(&ps); + SetupPrintScriptByOptions(&ps); ParamList_t *param; for ( param = first_param; param; param = param->next ) @@ -5101,6 +5081,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_VERSION: version_exit(); case GO_HELP: help_exit(false); case GO_XHELP: help_exit(true); + case GO_CONFIG: opt_config = optarg; break; case GO_ALLOW_ALL: allow_all = true; break; case GO_COMPATIBLE: err += ScanOptCompatible(optarg); break; case GO_WIDTH: err += ScanOptWidth(optarg); break; @@ -5243,6 +5224,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_CASE: err += ScanOptCase(optarg); break; case GO_PMODES: opt_pmodes++; break; case GO_FMODES: err += ScanOptFModes(optarg); break; + case GO_INSTALL: opt_install++; break; case GO_PT_DIR: err += ScanOptPtDir(optarg); break; case GO_LINKS: opt_links = true; break; @@ -5403,6 +5385,7 @@ static enumError CheckCommand ( int argc, char ** argv ) case CMD_VERSION: version_exit(); case CMD_HELP: PrintHelp(&InfoUI_wszst,stdout,0,"HELP",0,URI_HOME, first_param ? first_param->arg : 0 ); break; + case CMD_CONFIG: err = cmd_config(); break; case CMD_ARGTEST: err = cmd_argtest(argc,argv); break; case CMD_TEST: err = cmd_test(); break; case CMD_COLORS: err = Command_COLORS(brief_count?-brief_count:long_count,0,0); diff --git a/project/src/wtest.c b/project/src/wtest.c index 361e08b..dc4cca0 100644 --- a/project/src/wtest.c +++ b/project/src/wtest.c @@ -3782,7 +3782,7 @@ static enumError test_endian ( int argc, char ** argv ) putchar('\n'); //------------------------------------------------------------------------- - + printf("BE: h2n(1) = %x %x %llx / n2h(1) = %x %x %llx\n", be_func.h2ns(1), be_func.h2nl(1), be_func.h2n64(1), be_func.n2hs(1), be_func.n2hl(1), be_func.n2h64(1) ); @@ -3795,6 +3795,211 @@ static enumError test_endian ( int argc, char ** argv ) // /////////////////////////////////////////////////////////////////////////////// +/////////////// test_config() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError test_config ( int argc, char ** argv ) +{ + config_t config; + InitializeConfig(&config); + + int i; + for ( i = 1; i < argc; i++ ) + { + ScanConfig(&config,argv[i],false); + printf( "--\n> %s\n",argv[i]); + PrintConfig(stdout,&config,true); + + #if 0 + char buf[100]; + NormalizeFileName(buf,sizeof(buf),config.autoadd_path,true,true,TRSL_AUTO); + printf( ">> |%s|\n",buf); + #endif + } + + ResetConfig(&config); + putchar('\n'); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// test_search() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static void print_search ( const search_file_list_t *sfl, ccp title ) +{ + if (title) + printf("> %s\n",title); + + uint i; + search_file_t *sf = sfl->list; + for ( i = 1; i <= sfl->used; i++, sf++ ) + printf("%5d. [a=%d,it=%d,h:%x] %s\n", + i, sf->alloced, sf->itype, sf->hint, sf->fname ); +} + +//----------------------------------------------------------------------------- + +static enumError test_search ( int argc, char ** argv ) +{ + search_file_list_t sfl; + InitializeSearchFile(&sfl); + print_search(&sfl,"init"); + + int i; + for ( i = 1; i < argc; i++ ) + { + ccp arg = argv[i]; + CopyMode_t cm = CPM_LINK; + if ( *arg == '+' ) + { + arg = STRDUP(arg+1); + cm = CPM_MOVE; + if ( i == 1 ) + { + int res = SearchConfig1(&sfl,"wiimms-szs-tools.conf",arg, + ".szs","/etc",std_share_path,0); + printf("SearchConfig1(), res=%d\n",res); + continue; + } + } + AppendSearchFile(&sfl,arg,cm,"config0.txt"); + } + print_search(&sfl,"argv[]"); + + ResetSearchFile(&sfl); + putchar('\n'); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// test_quote() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static void print_quote_result ( ccp str, ccp info ) +{ + printf("[%-2.2s,EQM=%d%d%d,C=%d] |%s|\n", + info, str == EmptyString, str == EmptyQuote, + str == MinusString, IsCircBuf(str), str ); + FreeString(str); +} + +static void test_quote_helper ( ccp str ) +{ + printf("\n--- %p\n",str); + print_quote_result(EscapeStringS(str,0,CHMD__MODERN),"E"); + print_quote_result(EscapeStringCircS(str,0,CHMD__MODERN),"EC"); + print_quote_result(QuoteStringS(str,0,CHMD__MODERN),"Q"); + print_quote_result(QuoteStringCircS(str,0,CHMD__MODERN),"QC"); + print_quote_result(QuoteBashS(str,0,CHMD__MODERN),"B"); + print_quote_result(QuoteBashCircS(str,0,CHMD__MODERN),"BC"); +} + +static enumError test_quote ( int argc, char ** argv ) +{ + test_quote_helper(0); + test_quote_helper(EmptyString); + test_quote_helper("ab\ec\td\n \"xyz\' ghi"); + + int i; + for ( i = 1; i < argc; i++ ) + test_quote_helper(argv[i]); + putchar('\n'); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// test_eml() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError test_eml ( int argc, char ** argv ) +{ + exmem_list_t eml; + InitializeEML(&eml); + AddStandardSymbolsEML(&eml,false); + // DumpEML(stdout,3,&eml,"symbols(false)"); + + int i; + for ( i = 1; i < argc; i++ ) + { + ccp arg = argv[i]; + exmem_t res = ResolveSymbolsEML(&eml,arg); + printf(">ADD: %s\n",PrintExMem(&res)); + FreeExMem(&res); + + char *eq = strchr(arg,'='); + if (eq) + *eq++ = 0; + exmem_t data = ExMemByString(eq?eq:arg); + + if ( *arg == '-' ) + RemoveEML(&eml,arg+1); + else if ( *arg == '+' ) + ReplaceEML(&eml,arg+1,CPM_COPY,&data,CPM_COPY); + else if ( *arg == '%' ) + OverwriteEML(&eml,arg+1,CPM_COPY,&data,CPM_COPY); + else + InsertEML(&eml,arg,CPM_COPY,&data,CPM_COPY); + } + + DumpEML(stdout,3,&eml,0); + + #if 0 + AddStandardSymbolsEML(&eml,false); + DumpEML(stdout,3,&eml,"symbols(false)"); + AddStandardSymbolsEML(&eml,true); + DumpEML(stdout,3,&eml,"symbols(true)"); + #endif + + #if 1 + ResolveAllSymbolsEML(&eml); + DumpEML(stdout,3,&eml,"ResolveAllSymbolsEML()"); + #endif + + ResetEML(&eml); + + putchar('\n'); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// test_cygpath() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError test_cygpath ( int argc, char ** argv ) +{ + int i; + for ( i = 1; i < argc; i++ ) + { + ccp arg = argv[i]; + bool try_circ = *arg != '-'; + if (!try_circ) + arg++; + ccp cyg = AllocNormalizedFilenameCygwin(arg,try_circ); + exmem_t mem = GetNormalizeFilenameCygwin(arg,try_circ); + printf( "---\n" + "< %s\n" + ">[%u,%c] %s\n" + ">%s\n" + ,arg + ,IsWindowsDriveSpec(arg) + ,IsCircBuf(cyg) ? 'C' : '-' + ,cyg + ,PrintExMem(&mem) + ); + FreeString(cyg); + FreeExMem(&mem); + } + putchar('\n'); + return ERR_OK; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// develop() /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -3822,6 +4027,45 @@ const gobj_cond_ref_t * FindConditionRef2 ( u16 ref_id ) static enumError develop ( int argc, char ** argv ) { #if 1 + bool filter_active = false; + for ( int i = 1; i < argc; i++ ) + { + ccp arg = argv[i]; + if (!strcmp(arg,"+a")) + filter_active = true; + else if (!strcmp(arg,"-a")) + filter_active = false; + else + { + lecode_debug_t mode = str2l(arg,0,10) & LEDEB__ALL; + printf("-----\n%02x\n",mode); + lecode_debug_info_t ldi; + for ( GetFirstDebugMode(&ldi,mode,filter_active); + ldi.name; + GetNextDebugMode(&ldi) ) + { + printf("\t%s\n",GetDebugModeSummary(&ldi)); + } + } + } + #elif 1 + ccp test = + "n=123\n" + "s=\"ab\e[0m c\"\n" + "t=\"ab\ncd\"\n"; + + printf("%s\n",test); + + PrintScript_t ps; + script_fform = FF_BASH; + SetupPrintScriptByOptions(&ps); + ps.f = stdout; + PutScriptVars(&ps,3,test); + + ps.auto_quote = true; + PutScriptVars(&ps,3,test); + + #elif 1 static const char text[] = "abc/def/ghi\0jkl/mno/pqr"; uint i; for ( i = 0; i < sizeof(text); i++ ) @@ -4028,6 +4272,11 @@ enum CMD_SLOT_INFO, // test_slot_info(argc,argv) CMD_CLOCK, // test_clock(argc,argv) CMD_ENDIAN, // test_endian(argc,argv) + CMD_CONFIG, // test_config(argc,argv) + CMD_SEARCH, // test_search(argc,argv) + CMD_QUOTE, // test_quote(argc,argv) + CMD_EML, // test_eml(argc,argv) + CMD_CYGPATH, // test_cygpath(argc,argv) CMD__N }; @@ -4086,6 +4335,11 @@ static const KeywordTab_t CommandTab[] = { CMD_SLOT_INFO, "SLOT-INFO", "SI", 0 }, { CMD_CLOCK, "CLOCK", 0, 0 }, { CMD_ENDIAN, "ENDIAN", 0, 0 }, + { CMD_CONFIG, "CONFIG", 0, 0 }, + { CMD_SEARCH, "SEARCH", 0, 0 }, + { CMD_QUOTE, "QUOTE", "Q", 0 }, + { CMD_EML, "EML", 0, 0 }, + { CMD_CYGPATH, "CYGPATH", 0, 0 }, { CMD__N,0,0,0 } }; @@ -4146,7 +4400,7 @@ int main ( int argc, char ** argv ) float *f = f3.v; printf("%zu/%zu=%zu\n",sizeof(f3.v),sizeof(*f),sizeof(f3.v)/sizeof(*f)); } - + if (0) { double34 x; @@ -4226,6 +4480,11 @@ int main ( int argc, char ** argv ) case CMD_SLOT_INFO: test_slot_info(argc,argv); break; case CMD_CLOCK: test_clock(argc,argv); break; case CMD_ENDIAN: test_endian(argc,argv); break; + case CMD_CONFIG: test_config(argc,argv); break; + case CMD_SEARCH: test_search(argc,argv); break; + case CMD_QUOTE: test_quote(argc,argv); break; + case CMD_EML: test_eml(argc,argv); break; + case CMD_CYGPATH: test_cygpath(argc,argv); break; //case CMD_HELP: default: help_exit(); |
