diff options
| author | Wiimm <wiimm@wiimm.de> | 2022-10-28 14:09:27 +0200 |
|---|---|---|
| committer | Wiimm <wiimm@wiimm.de> | 2022-10-28 14:09:27 +0200 |
| commit | b1fcd305ebc1525df971f9d937e61fcbd386be67 (patch) | |
| tree | e238e1838a9449280e7af4635c5c90c734d2ae10 | |
| parent | 6d27524f61a141dfa7c1c66b36bcb1f6b5728f3d (diff) | |
SZS v2.29b
Diffstat (limited to '')
| -rw-r--r-- | project/Makefile | 2 | ||||
| -rw-r--r-- | project/dclib/dclib-numeric.c | 2 | ||||
| -rw-r--r-- | project/revision.sh | 2 | ||||
| -rw-r--r-- | project/src/lib-analyze.c | 75 | ||||
| -rw-r--r-- | project/src/lib-lecode.c | 66 | ||||
| -rw-r--r-- | project/src/lib-lecode.h | 44 | ||||
| -rw-r--r-- | project/src/lib-std.c | 1 | ||||
| -rw-r--r-- | project/src/ui/tab-wszst.inc | 4 | ||||
| -rw-r--r-- | project/src/ui/ui-wszst.c | 3 | ||||
| -rw-r--r-- | project/src/ui/ui.def | 3 | ||||
| -rw-r--r-- | project/src/wszst.c | 2 | ||||
| -rw-r--r-- | project/templates/HISTORY.txt | 21 | ||||
| -rw-r--r-- | project/templates/module/last-history.txt | 20 |
13 files changed, 169 insertions, 76 deletions
diff --git a/project/Makefile b/project/Makefile index 74552a6..a55b2d7 100644 --- a/project/Makefile +++ b/project/Makefile @@ -57,7 +57,7 @@ WPATT_LONG = Wiimms PAT Tool WSTRT_SHORT = wstrt WSTRT_LONG = Wiimms StaticR Tool -VERSION_NUM = 2.29a +VERSION_NUM = 2.29b BETA_VERSION = 0 # 0:off -1:"beta" >0:"beta#" diff --git a/project/dclib/dclib-numeric.c b/project/dclib/dclib-numeric.c index 7a420c3..500d3bc 100644 --- a/project/dclib/dclib-numeric.c +++ b/project/dclib/dclib-numeric.c @@ -4303,7 +4303,7 @@ char * ScanDateTime memset(&tm,0,sizeof(tm)); src = strptime(src,"%Y-%m-%d",&tm); - PRINT1(" %4u-%02u-%02u %2u:%02u:%02u |%s|\n", + PRINT0(" %4u-%02u-%02u %2u:%02u:%02u |%s|\n", tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, src ); diff --git a/project/revision.sh b/project/revision.sh index 1a57c56..ad26d03 100644 --- a/project/revision.sh +++ b/project/revision.sh @@ -1 +1 @@ -revision=8691 +revision=8696 diff --git a/project/src/lib-analyze.c b/project/src/lib-analyze.c index 9d0c0ca..710fbf5 100644 --- a/project/src/lib-analyze.c +++ b/project/src/lib-analyze.c @@ -664,46 +664,51 @@ enumError ExecAnalyzeLECODE ( analyze_param_t *ap ) AnalyzeLEBinary(&ana,ap->szs.data,ap->szs.size); const u_usec_t duration_usec = GetTimerUSec() - start_usec; - + const bool valid = ( ana.valid & LE_HEAD_VALID ) != 0; //--- print result PrintHeaderAP(ap,"lecode"); - PrintScriptVars(&ap->ps,0, - "phase=%d\n" - "version=%d\n" - "build=%d\n" - "region=\"%s\"\n" - "debug=%d\n" - "header_size=%d\n" - "file_size=%d\n" - "creation_time=\"%u, %s\"\n" - "edit_time=\"%u, %s\"\n" - "required_szs_tool=\"%u, %s\"\n" - "edit_by_szs_tool=\"%u, %s\"\n" - - ,ana.head->phase - ,ana.header_vers - ,ntohl(ana.head->build_number) - ,ana.head->region == 'P' ? "PAL" - :ana.head->region == 'E' ? "USA" - :ana.head->region == 'J' ? "Japan" - :ana.head->region == 'K' ? "Korea" - : "?" - ,ana.head->debug == 'D' - ,ana.header_size - ,ntohl(ana.head->file_size) - ,ana.creation_time - ,ana.creation_time ? PrintTimeByFormat("%F %T %Z",ana.creation_time) : "-" - ,ana.edit_time - ,ana.edit_time ? PrintTimeByFormat("%F %T %Z",ana.edit_time) : "-" - ,ana.szs_version - ,ana.szs_version ? DecodeVersion(ana.szs_version) : "-" - ,ana.edit_version - ,ana.edit_version ? DecodeVersion(ana.edit_version) : "-" - ); + if (valid) + { + PrintScriptVars(&ap->ps,0, + "phase=%d\n" + "version=%d\n" + "build=%d\n" + "region=\"%s\"\n" + "debug=%d\n" + "header_size=%d\n" + "file_size=%d\n" + "creation_time=\"%u, %s\"\n" + "edit_time=\"%u, %s\"\n" + "required_szs=\"%u, %s\"\n" + "recommended_szs=\"%u, %s\"\n" + "edit_by_szs=\"%u, %s\"\n" - PrintFooterAP(ap,ana.valid>0,duration_usec,0); + ,ana.head->phase + ,ana.header_vers + ,ntohl(ana.head->build_number) + ,ana.head->region == 'P' ? "PAL" + :ana.head->region == 'E' ? "USA" + :ana.head->region == 'J' ? "Japan" + :ana.head->region == 'K' ? "Korea" + : "?" + ,ana.head->debug == 'D' + ,ana.header_size + ,ntohl(ana.head->file_size) + ,ana.creation_time + ,ana.creation_time ? PrintTimeByFormat("%F %T %Z",ana.creation_time) : "-" + ,ana.edit_time + ,ana.edit_time ? PrintTimeByFormat("%F %T %Z",ana.edit_time) : "-" + ,ana.szs_required + ,ana.szs_required ? DecodeVersion(ana.szs_required) : "-" + ,ana.szs_recommended + ,ana.szs_recommended ? DecodeVersion(ana.szs_recommended) : "-" + ,ana.edit_version + ,ana.edit_version ? DecodeVersion(ana.edit_version) : "-" + ); + } + PrintFooterAP(ap,valid,duration_usec,0); ResetLEAnalyze(&ana); return ERR_OK; } diff --git a/project/src/lib-lecode.c b/project/src/lib-lecode.c index 59b1024..2ff7377 100644 --- a/project/src/lib-lecode.c +++ b/project/src/lib-lecode.c @@ -79,8 +79,8 @@ ccp GetLecodeSupportWarning ( const le_analyze_t *ana ) DASSERT(ana); return !( ana->valid & LE_HEAD_VALID ) ? "LE-CODE file header is invalid" - : GetEncodedVersion() < ana->szs_version - ? PrintCircBuf("SZS Tools v%s or younger required",DecodeVersion(ana->szs_version)) + : GetEncodedVersion() < ana->szs_required + ? PrintCircBuf("SZS Tools v%s or younger required",DecodeVersion(ana->szs_required)) : IsLecodeSupported(ana->valid) ? 0 : PrintCircBuf("LE-CODE v%u is not supported",ana->header_vers); @@ -1773,15 +1773,18 @@ enumError AnalyzeLEBinary break; case 5: - if ( ana->data_size > sizeof(le_binary_head_v5_t) ) + if ( ana->data_size > sizeof(le_binary_head_v5_34_t) ) { off_param = ntohl(ana->head_v5->off_param); - ana->szs_version = ntohl(ana->head_v5->szs_version); + ana->szs_required = ntohl(ana->head_v5->szs_required); ana->edit_version = ntohl(ana->head_v5->edit_version); ana->header_size = ntohl(ana->head_v5->head_size); ana->creation_time = ntohl(ana->head_v5->creation_time); ana->edit_time = ntohl(ana->head_v5->edit_time); + if ( ana->header_size > offsetof(le_binary_head_v5_t,szs_recommended) ) + ana->szs_recommended = ntohl(ana->head_v5->szs_recommended); + if ( ana->edit_version != 0x32303232 ) // first 4 bytes of "2022-10-23" => invalid ana->valid |= LE_HEAD_VALID | LE_HEAD_KNOWN; } @@ -1797,7 +1800,7 @@ enumError AnalyzeLEBinary break; } - if ( GetEncodedVersion() >= ana->szs_version ) + if ( GetEncodedVersion() >= ana->szs_required ) ana->valid |= LE_HEAD_VERSION; @@ -2921,16 +2924,53 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyze_t *ana ) "%*s" "Time of last edit: %s\n", indent,"", PrintTimeByFormat("%F %T %Z",ana->edit_time)); - if (ana->szs_version) + if ( ana->szs_required || ana->szs_recommended ) { - const bool valid = GetEncodedVersion() >= ana->szs_version; fprintf(f, - "%*s" "SZS Tool required: v%s (current: %sv%s,%s%s)\n" - ,indent,"" - ,DecodeVersion(ana->szs_version) - ,valid ? col.success : col.warn, BASE_VERSION - ,valid ? "ok" : "outdated", col.reset - ); + "%*s" "Current SZS Tool: v%s\n", indent,"", BASE_VERSION ); + + int fw = 0; + ccp required = 0, recommended = 0; + + if (ana->szs_required) + { + required = DecodeVersion(ana->szs_required); + int len = strlen(required); + if ( fw < len ) + fw = len; + } + + if (ana->szs_recommended) + { + recommended = DecodeVersion(ana->szs_recommended); + int len = strlen(recommended); + if ( fw < len ) + fw = len; + } + + if (ana->szs_required) + { + const bool valid = GetEncodedVersion() >= ana->szs_required; + fprintf(f, + "%*s" "Required SZS: v%-*s (%s%s%s)\n" + ,indent,"" + ,fw,required + ,valid ? col.success : col.warn + ,valid ? "ok" : "outdated", col.reset + ); + } + + if (ana->szs_recommended) + { + const bool valid = GetEncodedVersion() >= ana->szs_recommended; + fprintf(f, + "%*s" "Recommended SZS: v%-*s (%s%s%s)\n" + ,indent,"" + ,fw,recommended + ,valid ? col.success : col.warn + ,valid ? "ok" : "outdated", col.reset + ); + } } if (ana->edit_version) diff --git a/project/src/lib-lecode.h b/project/src/lib-lecode.h index af97078..992cb14 100644 --- a/project/src/lib-lecode.h +++ b/project/src/lib-lecode.h @@ -446,9 +446,35 @@ typedef struct le_binary_head_v4_t __attribute__ ((packed)) le_binary_head_v4_t; //----------------------------------------------------------------------------- -// [[le_binary_head_v5_t]] +// [[le_binary_head_v5_34_t]] + +typedef struct le_binary_head_v5_34_t +{ + /*00*/ char magic[4]; // LE_BINARY_MAGIC + /*04*/ u32 version; // always 5 for v5 + /*08*/ u32 build_number; // current code version + /*0c*/ u32 base_address; // memory address of binary (destination) + /*10*/ u32 entry_point; // memory address (prolog function) + /*14*/ u32 file_size; // size of complete file + /*18*/ u32 off_param; // offset of LPAR section + /*1c*/ char region; // one of: P, E, J, K + /*1d*/ char debug; // one of: D (debug) or R (release) + /*1e*/ u8 phase; // >0: PHASE (usually 2) + /*1f*/ char unknown_1f; + + /*20*/ u32 szs_required; // minimal encoded version number of szs-tools required to edit + /*24*/ u32 edit_version; // >0: encoded version number of szs-tools, that did last edit + /*28*/ u32 head_size; // size of file header + /*2c*/ u32 creation_time; // unixtime of LE-CODE creation + /*30*/ u32 edit_time; // >0: unixtime of last LE-CODE edit + /*34*/ +} +__attribute__ ((packed)) le_binary_head_v5_34_t; -typedef struct le_binary_head_v5_t +//----------------------------------------------------------------------------- +// [[le_binary_head_v5_38_t]] + +typedef struct le_binary_head_v5_38_t { /*00*/ char magic[4]; // LE_BINARY_MAGIC /*04*/ u32 version; // always 5 for v5 @@ -462,13 +488,20 @@ typedef struct le_binary_head_v5_t /*1e*/ u8 phase; // >0: PHASE (usually 2) /*1f*/ char unknown_1f; - /*20*/ u32 szs_version; // minimal encoded version number of szs-tools required to edit + /*20*/ u32 szs_required; // minimal encoded version number of szs-tools required to edit /*24*/ u32 edit_version; // >0: encoded version number of szs-tools, that did last edit /*28*/ u32 head_size; // size of file header /*2c*/ u32 creation_time; // unixtime of LE-CODE creation /*30*/ u32 edit_time; // >0: unixtime of last LE-CODE edit + /*34*/ u32 szs_recommended;// recommended version number of szs-tools to manage LE binaries + /*38*/ } -__attribute__ ((packed)) le_binary_head_v5_t; +__attribute__ ((packed)) le_binary_head_v5_38_t; + +//----------------------------------------------------------------------------- +// [[le_binary_head_v5_t]] + +typedef le_binary_head_v5_38_t le_binary_head_v5_t; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -833,7 +866,8 @@ typedef struct le_analyze_t le_region_t region; // one of LEREG_* u32 creation_time; // unixtime of LE-CODE creation u32 edit_time; // >0: unixtime of last LE-CODE edit - uint szs_version; // minimal encoded version number of szs-tools required to edit + uint szs_required; // minimal encoded version number of szs-tools required to edit + uint szs_recommended;// >0: recommended version number of szs-tools to manage LE binaries uint edit_version; // >0: encoded version number of szs-tools, that did last edit const u8 *data; // pointer to raw data diff --git a/project/src/lib-std.c b/project/src/lib-std.c index 6a42013..bf8aea6 100644 --- a/project/src/lib-std.c +++ b/project/src/lib-std.c @@ -5189,6 +5189,7 @@ void SetupPrintScriptByOptions ( PrintScript_t *ps ) InitializePrintScript(ps); ps->force_case = opt_case; ps->create_array = script_array > 0; + ps->var_size = 20; ps->var_name = script_varname ? script_varname : "res"; ps->var_prefix = script_varname ? script_varname : "res_"; ps->eq_tabstop = 2; diff --git a/project/src/ui/tab-wszst.inc b/project/src/ui/tab-wszst.inc index 5c094da..ef9292c 100644 --- a/project/src/ui/tab-wszst.inc +++ b/project/src/ui/tab-wszst.inc @@ -367,7 +367,9 @@ { T_DEF_CMD, "ANALYZE", "ANALYZE|ANA|ANALYSE", "wszst ANALYZE [source]...", - "Analyse track files and print results in machine readable format." }, + "Analyse track files and LE-CODE binaries." + " Print the results in machine-readable form." + " The output format is selected by options." }, { T_DEF_CMD, "SPLIT", "SPLIT", "wszst SPLIT [source]...", diff --git a/project/src/ui/ui-wszst.c b/project/src/ui/ui-wszst.c index 643ad4f..f35eba4 100644 --- a/project/src/ui/ui-wszst.c +++ b/project/src/ui/ui-wszst.c @@ -7852,7 +7852,8 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "ANALYZE", "ANA", "wszst ANALYZE [source]...", - "Analyse track files and print results in machine readable format.", + "Analyse track files and LE-CODE binaries. Print the results in" + " machine-readable form. The output format is selected by options.", 0, 16, option_tab_cmd_ANALYZE, diff --git a/project/src/ui/ui.def b/project/src/ui/ui.def index 8670d01..8ed8fc1 100644 --- a/project/src/ui/ui.def +++ b/project/src/ui/ui.def @@ -264,7 +264,8 @@ #:def_cmd( "ANALYZE", "ANALYZE|ANA|ANALYSE", \ "wszst ANALYZE [source]...", \ - "Analyse track files and print results in machine readable format." ) + "Analyse track files and LE-CODE binaries. Print the results in" \ + " machine-readable form. The output format is selected by options." ) #:def_cmd( "SPLIT", "SPLIT", \ "wszst SPLIT [source]...", \ diff --git a/project/src/wszst.c b/project/src/wszst.c index 73e88c4..79b8ab2 100644 --- a/project/src/wszst.c +++ b/project/src/wszst.c @@ -2302,6 +2302,8 @@ static enumError cmd_sha1() static enumError cmd_analyze() { + SetupPager(); + static ccp def_path = "\1P/\1F\1?T"; CheckOptDest("-",false); char dest[PATH_MAX]; diff --git a/project/templates/HISTORY.txt b/project/templates/HISTORY.txt index 5be7bb7..bf778ff 100644 --- a/project/templates/HISTORY.txt +++ b/project/templates/HISTORY.txt @@ -615,6 +615,27 @@ szs v2.28a r8636 - 2022-08-27 mistake, only RETORE was recognized so far. +szs v2.29a r8691 - 2022-10-27 + + - Updated prefix, object and porting databases. + - Updated integrated LE-CODE binaries to v4 build 34. + - Support of LE-CODE v4.b34 with 8-bits flags and v5.b35 with 16-bits flags. + - Added LE-CODE protection against changes by SZS tools that are too old. + - LPAR: Support of new features BT-TEXTURES, VS-TEXTURES and BLOCK-TEXTURES. + - Bug fix: If creating a LPAR file (by "wlect create lpar" or by decoding), + some lines are terminated by LF instead of CR+LF. This could lead to + problems with some Windows editors and other Windows programs. + - Bug fix: The wildcard ** did not work correctly. The recursion depth was + always 1 level higher than specified. So level 0 was never possible. + See https://szs.wiimm.de/doc/wildcards#2stars for details. + - wszst ANALYZE: Added support for LE-CODE binaries. + - wszst ANALYZE: A track can be valid, even if vrcorn_model.brres is missed. + - wszst ANALYZE: Support of edit-slot ('e12' or 'ea12'). + - wszst SPLIT: Added support for "(author1,author2,,editor1,editor2)", + LE-CODE flags + group, order by attribute, and for track category. + - New file type: MTCAT: Import and export 'MKW Track Category' files. + + @@MODULE(last-history.txt)@@ diff --git a/project/templates/module/last-history.txt b/project/templates/module/last-history.txt index 2e9ec0c..5893a22 100644 --- a/project/templates/module/last-history.txt +++ b/project/templates/module/last-history.txt @@ -1,22 +1,8 @@ szs v@@VERSION@@ r@@REV-NEXT@@ - @@@@-@@-@@ - - Updated prefix, object and porting databases. - - Updated integrated LE-CODE binaries to v4 build 34. - - Support of LE-CODE v4.b34 and v5.b35 with 16-bits flags. - - Added LE-CODE protection against changes by SZS tools that are too old. - - LPAR: Support of new features BT-TEXTURES, VS-TEXTURES and BLOCK-TEXTURES. - - Bug fix: If creating a LPAR file (by "wlect create lpar" or by decoding), - some lines are terminated by LF instead of CR+LF. This could lead to - problems with some Windows editors and other Windows programs. - - Bug fix: The wildcard ** did not work correctly. The recursion depth was - always 1 level higher than specified. So level 0 was never possible. - See https://szs.wiimm.de/doc/wildcards#2stars for details. - - wszst ANALYZE: Added support of LE-CODE binaries. - - wszst ANALYZE: A track can be valid, even if vrcorn_model.brres is missed. - - wszst ANALYZE: Support of edit-slot ('e12' or 'ea12'). - - wszst SPLIT: Added support for "(author1,author2,,editor1,editor2)", - LE-CODE flags + group, order by attribute, and for track category. - - New file type: MTCAT: Import and export 'MKW Track Category' files. + - Removed a forgotten debug instruction, that created file _trace-wszst.tmp + when reading an LE-CODE binary file of version 4 (builds up to 34). + - wszst ANALYZE lecode: Changed output names. ~ - MDL support: Scanning a MDL file and transferring the data into an internal ~ format was already implemented, but only used for analysis purposes. Now it |
