diff options
Diffstat (limited to '')
62 files changed, 3055 insertions, 1152 deletions
diff --git a/project/src/analyze.c b/project/src/analyze.c index 0c294b0..152b439 100644 --- a/project/src/analyze.c +++ b/project/src/analyze.c @@ -1124,9 +1124,9 @@ void AnalyzeBREFF ( szs_file_t * szs, u8 * data, uint data_size, ccp name ) szs_file_t szs2; // [[fname-]] InitializeSubSZS(&szs2,szs,data-szs->data,szs->size,fform,0,false); - IterateFilesSZS(&szs2, + IterateFilesParSZS(&szs2, fform == FF_BREFF ? ana_breff_subfile : ana_breft_subfile, - f, true, false, -1, SORT_NONE ); + f, false, true, false, -1, SORT_NONE ); ResetSZS(&szs2); } diff --git a/project/src/crypt.h b/project/src/crypt.h index c541bc8..6bf4359 100644 --- a/project/src/crypt.h +++ b/project/src/crypt.h @@ -38,8 +38,12 @@ #ifndef WIIMM_CRYPT_H #define WIIMM_CRYPT_H 1 -#include "crypto/wiimm-sha.h" -#define SHA1 WIIMM_SHA1 +#ifdef USE_SHA_LIB + #include <openssl/sha.h> +#else + #include "crypto/wiimm-sha.h" + #define SHA1 WIIMM_SHA1 +#endif #endif // WIIMM_CRYPT_H diff --git a/project/src/crypto/sha1-586-cygwin.s b/project/src/crypto/sha1-586-cygwin.s index 2751a8f..fb10e3c 100644 --- a/project/src/crypto/sha1-586-cygwin.s +++ b/project/src/crypto/sha1-586-cygwin.s @@ -1,4 +1,4 @@ -.file "sha1-586.s" +.file "sha1-586-cygwin.s" .text .globl _wit_sha1_block_data_order .def _wit_sha1_block_data_order; .scl 2; .type 32; .endef diff --git a/project/src/crypto/sha1-cygwin64.s b/project/src/crypto/sha1-cygwin64.s new file mode 100644 index 0000000..7a7421f --- /dev/null +++ b/project/src/crypto/sha1-cygwin64.s @@ -0,0 +1,1284 @@ +.file "sha1-cygwin64.s" +.text +.globl wit_sha1_block_data_order +.def wit_sha1_block_data_order; .scl 2; .type 32; .endef + +.align 16 +wit_sha1_block_data_order: +.Lwit_sha1_block_data_order_begin: + pushq %rbx + pushq %rbp + pushq %r12 + movq %rsp,%r11 + movq %rdi,%r8 + subq $72,%rsp + movq %rsi,%r9 + andq $-64,%rsp + movq %rdx,%r10 + movq %r11,64(%rsp) +.Lprologue: + + movl 0(%r8),%edx + movl 4(%r8),%esi + movl 8(%r8),%edi + movl 12(%r8),%ebp + movl 16(%r8),%r11d +.align 4 +.Lloop: + movl 0(%r9),%eax + bswapl %eax + movl %eax,0(%rsp) + leal 1518500249(%rax,%r11,1),%r12d + movl %edi,%ebx + movl 4(%r9),%eax + movl %edx,%r11d + xorl %ebp,%ebx + bswapl %eax + roll $5,%r11d + andl %esi,%ebx + movl %eax,4(%rsp) + addl %r11d,%r12d + xorl %ebp,%ebx + roll $30,%esi + addl %ebx,%r12d + leal 1518500249(%rax,%rbp,1),%r11d + movl %esi,%ebx + movl 8(%r9),%eax + movl %r12d,%ebp + xorl %edi,%ebx + bswapl %eax + roll $5,%ebp + andl %edx,%ebx + movl %eax,8(%rsp) + addl %ebp,%r11d + xorl %edi,%ebx + roll $30,%edx + addl %ebx,%r11d + leal 1518500249(%rax,%rdi,1),%ebp + movl %edx,%ebx + movl 12(%r9),%eax + movl %r11d,%edi + xorl %esi,%ebx + bswapl %eax + roll $5,%edi + andl %r12d,%ebx + movl %eax,12(%rsp) + addl %edi,%ebp + xorl %esi,%ebx + roll $30,%r12d + addl %ebx,%ebp + leal 1518500249(%rax,%rsi,1),%edi + movl %r12d,%ebx + movl 16(%r9),%eax + movl %ebp,%esi + xorl %edx,%ebx + bswapl %eax + roll $5,%esi + andl %r11d,%ebx + movl %eax,16(%rsp) + addl %esi,%edi + xorl %edx,%ebx + roll $30,%r11d + addl %ebx,%edi + leal 1518500249(%rax,%rdx,1),%esi + movl %r11d,%ebx + movl 20(%r9),%eax + movl %edi,%edx + xorl %r12d,%ebx + bswapl %eax + roll $5,%edx + andl %ebp,%ebx + movl %eax,20(%rsp) + addl %edx,%esi + xorl %r12d,%ebx + roll $30,%ebp + addl %ebx,%esi + leal 1518500249(%rax,%r12,1),%edx + movl %ebp,%ebx + movl 24(%r9),%eax + movl %esi,%r12d + xorl %r11d,%ebx + bswapl %eax + roll $5,%r12d + andl %edi,%ebx + movl %eax,24(%rsp) + addl %r12d,%edx + xorl %r11d,%ebx + roll $30,%edi + addl %ebx,%edx + leal 1518500249(%rax,%r11,1),%r12d + movl %edi,%ebx + movl 28(%r9),%eax + movl %edx,%r11d + xorl %ebp,%ebx + bswapl %eax + roll $5,%r11d + andl %esi,%ebx + movl %eax,28(%rsp) + addl %r11d,%r12d + xorl %ebp,%ebx + roll $30,%esi + addl %ebx,%r12d + leal 1518500249(%rax,%rbp,1),%r11d + movl %esi,%ebx + movl 32(%r9),%eax + movl %r12d,%ebp + xorl %edi,%ebx + bswapl %eax + roll $5,%ebp + andl %edx,%ebx + movl %eax,32(%rsp) + addl %ebp,%r11d + xorl %edi,%ebx + roll $30,%edx + addl %ebx,%r11d + leal 1518500249(%rax,%rdi,1),%ebp + movl %edx,%ebx + movl 36(%r9),%eax + movl %r11d,%edi + xorl %esi,%ebx + bswapl %eax + roll $5,%edi + andl %r12d,%ebx + movl %eax,36(%rsp) + addl %edi,%ebp + xorl %esi,%ebx + roll $30,%r12d + addl %ebx,%ebp + leal 1518500249(%rax,%rsi,1),%edi + movl %r12d,%ebx + movl 40(%r9),%eax + movl %ebp,%esi + xorl %edx,%ebx + bswapl %eax + roll $5,%esi + andl %r11d,%ebx + movl %eax,40(%rsp) + addl %esi,%edi + xorl %edx,%ebx + roll $30,%r11d + addl %ebx,%edi + leal 1518500249(%rax,%rdx,1),%esi + movl %r11d,%ebx + movl 44(%r9),%eax + movl %edi,%edx + xorl %r12d,%ebx + bswapl %eax + roll $5,%edx + andl %ebp,%ebx + movl %eax,44(%rsp) + addl %edx,%esi + xorl %r12d,%ebx + roll $30,%ebp + addl %ebx,%esi + leal 1518500249(%rax,%r12,1),%edx + movl %ebp,%ebx + movl 48(%r9),%eax + movl %esi,%r12d + xorl %r11d,%ebx + bswapl %eax + roll $5,%r12d + andl %edi,%ebx + movl %eax,48(%rsp) + addl %r12d,%edx + xorl %r11d,%ebx + roll $30,%edi + addl %ebx,%edx + leal 1518500249(%rax,%r11,1),%r12d + movl %edi,%ebx + movl 52(%r9),%eax + movl %edx,%r11d + xorl %ebp,%ebx + bswapl %eax + roll $5,%r11d + andl %esi,%ebx + movl %eax,52(%rsp) + addl %r11d,%r12d + xorl %ebp,%ebx + roll $30,%esi + addl %ebx,%r12d + leal 1518500249(%rax,%rbp,1),%r11d + movl %esi,%ebx + movl 56(%r9),%eax + movl %r12d,%ebp + xorl %edi,%ebx + bswapl %eax + roll $5,%ebp + andl %edx,%ebx + movl %eax,56(%rsp) + addl %ebp,%r11d + xorl %edi,%ebx + roll $30,%edx + addl %ebx,%r11d + leal 1518500249(%rax,%rdi,1),%ebp + movl %edx,%ebx + movl 60(%r9),%eax + movl %r11d,%edi + xorl %esi,%ebx + bswapl %eax + roll $5,%edi + andl %r12d,%ebx + movl %eax,60(%rsp) + addl %edi,%ebp + xorl %esi,%ebx + roll $30,%r12d + addl %ebx,%ebp + leal 1518500249(%rax,%rsi,1),%edi + movl 0(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 8(%rsp),%eax + xorl %edx,%ebx + roll $5,%esi + xorl 32(%rsp),%eax + andl %r11d,%ebx + addl %esi,%edi + xorl 52(%rsp),%eax + xorl %edx,%ebx + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,0(%rsp) + leal 1518500249(%rax,%rdx,1),%esi + movl 4(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 12(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edx + xorl 36(%rsp),%eax + andl %ebp,%ebx + addl %edx,%esi + xorl 56(%rsp),%eax + xorl %r12d,%ebx + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,4(%rsp) + leal 1518500249(%rax,%r12,1),%edx + movl 8(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 16(%rsp),%eax + xorl %r11d,%ebx + roll $5,%r12d + xorl 40(%rsp),%eax + andl %edi,%ebx + addl %r12d,%edx + xorl 60(%rsp),%eax + xorl %r11d,%ebx + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,8(%rsp) + leal 1518500249(%rax,%r11,1),%r12d + movl 12(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 20(%rsp),%eax + xorl %ebp,%ebx + roll $5,%r11d + xorl 44(%rsp),%eax + andl %esi,%ebx + addl %r11d,%r12d + xorl 0(%rsp),%eax + xorl %ebp,%ebx + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,12(%rsp) + leal 1518500249(%rax,%rbp,1),%r11d + movl 16(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 24(%rsp),%eax + xorl %edi,%ebx + roll $5,%ebp + xorl 48(%rsp),%eax + andl %edx,%ebx + addl %ebp,%r11d + xorl 4(%rsp),%eax + xorl %edi,%ebx + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,16(%rsp) + leal 1859775393(%rax,%rdi,1),%ebp + movl 20(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 28(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 52(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 8(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,20(%rsp) + leal 1859775393(%rax,%rsi,1),%edi + movl 24(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 32(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 56(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 12(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,24(%rsp) + leal 1859775393(%rax,%rdx,1),%esi + movl 28(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 36(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 60(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 16(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,28(%rsp) + leal 1859775393(%rax,%r12,1),%edx + movl 32(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 40(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 0(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 20(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,32(%rsp) + leal 1859775393(%rax,%r11,1),%r12d + movl 36(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 44(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 4(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 24(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,36(%rsp) + leal 1859775393(%rax,%rbp,1),%r11d + movl 40(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 48(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 8(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 28(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,40(%rsp) + leal 1859775393(%rax,%rdi,1),%ebp + movl 44(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 52(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 12(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 32(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,44(%rsp) + leal 1859775393(%rax,%rsi,1),%edi + movl 48(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 56(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 16(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 36(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,48(%rsp) + leal 1859775393(%rax,%rdx,1),%esi + movl 52(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 60(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 20(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 40(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,52(%rsp) + leal 1859775393(%rax,%r12,1),%edx + movl 56(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 0(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 24(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 44(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,56(%rsp) + leal 1859775393(%rax,%r11,1),%r12d + movl 60(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 4(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 28(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 48(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,60(%rsp) + leal 1859775393(%rax,%rbp,1),%r11d + movl 0(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 8(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 32(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 52(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,0(%rsp) + leal 1859775393(%rax,%rdi,1),%ebp + movl 4(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 12(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 36(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 56(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,4(%rsp) + leal 1859775393(%rax,%rsi,1),%edi + movl 8(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 16(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 40(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 60(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,8(%rsp) + leal 1859775393(%rax,%rdx,1),%esi + movl 12(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 20(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 44(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 0(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,12(%rsp) + leal 1859775393(%rax,%r12,1),%edx + movl 16(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 24(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 48(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 4(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,16(%rsp) + leal 1859775393(%rax,%r11,1),%r12d + movl 20(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 28(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 52(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 8(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,20(%rsp) + leal 1859775393(%rax,%rbp,1),%r11d + movl 24(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 32(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 56(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 12(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,24(%rsp) + leal 1859775393(%rax,%rdi,1),%ebp + movl 28(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 36(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 60(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 16(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,28(%rsp) + leal 1859775393(%rax,%rsi,1),%edi + movl 32(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 40(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 0(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 20(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,32(%rsp) + leal -1894007588(%rax,%rdx,1),%esi + movl 36(%rsp),%eax + movl %ebp,%ebx + movl %ebp,%ecx + xorl 44(%rsp),%eax + movl %edi,%edx + andl %r11d,%ebx + xorl 4(%rsp),%eax + orl %r11d,%ecx + roll $5,%edx + xorl 24(%rsp),%eax + andl %r12d,%ecx + addl %edx,%esi + roll $1,%eax + orl %ecx,%ebx + roll $30,%ebp + movl %eax,36(%rsp) + addl %ebx,%esi + leal -1894007588(%rax,%r12,1),%edx + movl 40(%rsp),%eax + movl %edi,%ebx + movl %edi,%ecx + xorl 48(%rsp),%eax + movl %esi,%r12d + andl %ebp,%ebx + xorl 8(%rsp),%eax + orl %ebp,%ecx + roll $5,%r12d + xorl 28(%rsp),%eax + andl %r11d,%ecx + addl %r12d,%edx + roll $1,%eax + orl %ecx,%ebx + roll $30,%edi + movl %eax,40(%rsp) + addl %ebx,%edx + leal -1894007588(%rax,%r11,1),%r12d + movl 44(%rsp),%eax + movl %esi,%ebx + movl %esi,%ecx + xorl 52(%rsp),%eax + movl %edx,%r11d + andl %edi,%ebx + xorl 12(%rsp),%eax + orl %edi,%ecx + roll $5,%r11d + xorl 32(%rsp),%eax + andl %ebp,%ecx + addl %r11d,%r12d + roll $1,%eax + orl %ecx,%ebx + roll $30,%esi + movl %eax,44(%rsp) + addl %ebx,%r12d + leal -1894007588(%rax,%rbp,1),%r11d + movl 48(%rsp),%eax + movl %edx,%ebx + movl %edx,%ecx + xorl 56(%rsp),%eax + movl %r12d,%ebp + andl %esi,%ebx + xorl 16(%rsp),%eax + orl %esi,%ecx + roll $5,%ebp + xorl 36(%rsp),%eax + andl %edi,%ecx + addl %ebp,%r11d + roll $1,%eax + orl %ecx,%ebx + roll $30,%edx + movl %eax,48(%rsp) + addl %ebx,%r11d + leal -1894007588(%rax,%rdi,1),%ebp + movl 52(%rsp),%eax + movl %r12d,%ebx + movl %r12d,%ecx + xorl 60(%rsp),%eax + movl %r11d,%edi + andl %edx,%ebx + xorl 20(%rsp),%eax + orl %edx,%ecx + roll $5,%edi + xorl 40(%rsp),%eax + andl %esi,%ecx + addl %edi,%ebp + roll $1,%eax + orl %ecx,%ebx + roll $30,%r12d + movl %eax,52(%rsp) + addl %ebx,%ebp + leal -1894007588(%rax,%rsi,1),%edi + movl 56(%rsp),%eax + movl %r11d,%ebx + movl %r11d,%ecx + xorl 0(%rsp),%eax + movl %ebp,%esi + andl %r12d,%ebx + xorl 24(%rsp),%eax + orl %r12d,%ecx + roll $5,%esi + xorl 44(%rsp),%eax + andl %edx,%ecx + addl %esi,%edi + roll $1,%eax + orl %ecx,%ebx + roll $30,%r11d + movl %eax,56(%rsp) + addl %ebx,%edi + leal -1894007588(%rax,%rdx,1),%esi + movl 60(%rsp),%eax + movl %ebp,%ebx + movl %ebp,%ecx + xorl 4(%rsp),%eax + movl %edi,%edx + andl %r11d,%ebx + xorl 28(%rsp),%eax + orl %r11d,%ecx + roll $5,%edx + xorl 48(%rsp),%eax + andl %r12d,%ecx + addl %edx,%esi + roll $1,%eax + orl %ecx,%ebx + roll $30,%ebp + movl %eax,60(%rsp) + addl %ebx,%esi + leal -1894007588(%rax,%r12,1),%edx + movl 0(%rsp),%eax + movl %edi,%ebx + movl %edi,%ecx + xorl 8(%rsp),%eax + movl %esi,%r12d + andl %ebp,%ebx + xorl 32(%rsp),%eax + orl %ebp,%ecx + roll $5,%r12d + xorl 52(%rsp),%eax + andl %r11d,%ecx + addl %r12d,%edx + roll $1,%eax + orl %ecx,%ebx + roll $30,%edi + movl %eax,0(%rsp) + addl %ebx,%edx + leal -1894007588(%rax,%r11,1),%r12d + movl 4(%rsp),%eax + movl %esi,%ebx + movl %esi,%ecx + xorl 12(%rsp),%eax + movl %edx,%r11d + andl %edi,%ebx + xorl 36(%rsp),%eax + orl %edi,%ecx + roll $5,%r11d + xorl 56(%rsp),%eax + andl %ebp,%ecx + addl %r11d,%r12d + roll $1,%eax + orl %ecx,%ebx + roll $30,%esi + movl %eax,4(%rsp) + addl %ebx,%r12d + leal -1894007588(%rax,%rbp,1),%r11d + movl 8(%rsp),%eax + movl %edx,%ebx + movl %edx,%ecx + xorl 16(%rsp),%eax + movl %r12d,%ebp + andl %esi,%ebx + xorl 40(%rsp),%eax + orl %esi,%ecx + roll $5,%ebp + xorl 60(%rsp),%eax + andl %edi,%ecx + addl %ebp,%r11d + roll $1,%eax + orl %ecx,%ebx + roll $30,%edx + movl %eax,8(%rsp) + addl %ebx,%r11d + leal -1894007588(%rax,%rdi,1),%ebp + movl 12(%rsp),%eax + movl %r12d,%ebx + movl %r12d,%ecx + xorl 20(%rsp),%eax + movl %r11d,%edi + andl %edx,%ebx + xorl 44(%rsp),%eax + orl %edx,%ecx + roll $5,%edi + xorl 0(%rsp),%eax + andl %esi,%ecx + addl %edi,%ebp + roll $1,%eax + orl %ecx,%ebx + roll $30,%r12d + movl %eax,12(%rsp) + addl %ebx,%ebp + leal -1894007588(%rax,%rsi,1),%edi + movl 16(%rsp),%eax + movl %r11d,%ebx + movl %r11d,%ecx + xorl 24(%rsp),%eax + movl %ebp,%esi + andl %r12d,%ebx + xorl 48(%rsp),%eax + orl %r12d,%ecx + roll $5,%esi + xorl 4(%rsp),%eax + andl %edx,%ecx + addl %esi,%edi + roll $1,%eax + orl %ecx,%ebx + roll $30,%r11d + movl %eax,16(%rsp) + addl %ebx,%edi + leal -1894007588(%rax,%rdx,1),%esi + movl 20(%rsp),%eax + movl %ebp,%ebx + movl %ebp,%ecx + xorl 28(%rsp),%eax + movl %edi,%edx + andl %r11d,%ebx + xorl 52(%rsp),%eax + orl %r11d,%ecx + roll $5,%edx + xorl 8(%rsp),%eax + andl %r12d,%ecx + addl %edx,%esi + roll $1,%eax + orl %ecx,%ebx + roll $30,%ebp + movl %eax,20(%rsp) + addl %ebx,%esi + leal -1894007588(%rax,%r12,1),%edx + movl 24(%rsp),%eax + movl %edi,%ebx + movl %edi,%ecx + xorl 32(%rsp),%eax + movl %esi,%r12d + andl %ebp,%ebx + xorl 56(%rsp),%eax + orl %ebp,%ecx + roll $5,%r12d + xorl 12(%rsp),%eax + andl %r11d,%ecx + addl %r12d,%edx + roll $1,%eax + orl %ecx,%ebx + roll $30,%edi + movl %eax,24(%rsp) + addl %ebx,%edx + leal -1894007588(%rax,%r11,1),%r12d + movl 28(%rsp),%eax + movl %esi,%ebx + movl %esi,%ecx + xorl 36(%rsp),%eax + movl %edx,%r11d + andl %edi,%ebx + xorl 60(%rsp),%eax + orl %edi,%ecx + roll $5,%r11d + xorl 16(%rsp),%eax + andl %ebp,%ecx + addl %r11d,%r12d + roll $1,%eax + orl %ecx,%ebx + roll $30,%esi + movl %eax,28(%rsp) + addl %ebx,%r12d + leal -1894007588(%rax,%rbp,1),%r11d + movl 32(%rsp),%eax + movl %edx,%ebx + movl %edx,%ecx + xorl 40(%rsp),%eax + movl %r12d,%ebp + andl %esi,%ebx + xorl 0(%rsp),%eax + orl %esi,%ecx + roll $5,%ebp + xorl 20(%rsp),%eax + andl %edi,%ecx + addl %ebp,%r11d + roll $1,%eax + orl %ecx,%ebx + roll $30,%edx + movl %eax,32(%rsp) + addl %ebx,%r11d + leal -1894007588(%rax,%rdi,1),%ebp + movl 36(%rsp),%eax + movl %r12d,%ebx + movl %r12d,%ecx + xorl 44(%rsp),%eax + movl %r11d,%edi + andl %edx,%ebx + xorl 4(%rsp),%eax + orl %edx,%ecx + roll $5,%edi + xorl 24(%rsp),%eax + andl %esi,%ecx + addl %edi,%ebp + roll $1,%eax + orl %ecx,%ebx + roll $30,%r12d + movl %eax,36(%rsp) + addl %ebx,%ebp + leal -1894007588(%rax,%rsi,1),%edi + movl 40(%rsp),%eax + movl %r11d,%ebx + movl %r11d,%ecx + xorl 48(%rsp),%eax + movl %ebp,%esi + andl %r12d,%ebx + xorl 8(%rsp),%eax + orl %r12d,%ecx + roll $5,%esi + xorl 28(%rsp),%eax + andl %edx,%ecx + addl %esi,%edi + roll $1,%eax + orl %ecx,%ebx + roll $30,%r11d + movl %eax,40(%rsp) + addl %ebx,%edi + leal -1894007588(%rax,%rdx,1),%esi + movl 44(%rsp),%eax + movl %ebp,%ebx + movl %ebp,%ecx + xorl 52(%rsp),%eax + movl %edi,%edx + andl %r11d,%ebx + xorl 12(%rsp),%eax + orl %r11d,%ecx + roll $5,%edx + xorl 32(%rsp),%eax + andl %r12d,%ecx + addl %edx,%esi + roll $1,%eax + orl %ecx,%ebx + roll $30,%ebp + movl %eax,44(%rsp) + addl %ebx,%esi + leal -1894007588(%rax,%r12,1),%edx + movl 48(%rsp),%eax + movl %edi,%ebx + movl %edi,%ecx + xorl 56(%rsp),%eax + movl %esi,%r12d + andl %ebp,%ebx + xorl 16(%rsp),%eax + orl %ebp,%ecx + roll $5,%r12d + xorl 36(%rsp),%eax + andl %r11d,%ecx + addl %r12d,%edx + roll $1,%eax + orl %ecx,%ebx + roll $30,%edi + movl %eax,48(%rsp) + addl %ebx,%edx + leal -899497514(%rax,%r11,1),%r12d + movl 52(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 60(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 20(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 40(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,52(%rsp) + leal -899497514(%rax,%rbp,1),%r11d + movl 56(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 0(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 24(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 44(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,56(%rsp) + leal -899497514(%rax,%rdi,1),%ebp + movl 60(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 4(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 28(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 48(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,60(%rsp) + leal -899497514(%rax,%rsi,1),%edi + movl 0(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 8(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 32(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 52(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,0(%rsp) + leal -899497514(%rax,%rdx,1),%esi + movl 4(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 12(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 36(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 56(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,4(%rsp) + leal -899497514(%rax,%r12,1),%edx + movl 8(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 16(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 40(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 60(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,8(%rsp) + leal -899497514(%rax,%r11,1),%r12d + movl 12(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 20(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 44(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 0(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,12(%rsp) + leal -899497514(%rax,%rbp,1),%r11d + movl 16(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 24(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 48(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 4(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,16(%rsp) + leal -899497514(%rax,%rdi,1),%ebp + movl 20(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 28(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 52(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 8(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,20(%rsp) + leal -899497514(%rax,%rsi,1),%edi + movl 24(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 32(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 56(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 12(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,24(%rsp) + leal -899497514(%rax,%rdx,1),%esi + movl 28(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 36(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 60(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 16(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + movl %eax,28(%rsp) + leal -899497514(%rax,%r12,1),%edx + movl 32(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 40(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 0(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 20(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + movl %eax,32(%rsp) + leal -899497514(%rax,%r11,1),%r12d + movl 36(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 44(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 4(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 24(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + movl %eax,36(%rsp) + leal -899497514(%rax,%rbp,1),%r11d + movl 40(%rsp),%eax + movl %esi,%ebx + movl %r12d,%ebp + xorl 48(%rsp),%eax + xorl %edx,%ebx + roll $5,%ebp + xorl 8(%rsp),%eax + xorl %edi,%ebx + addl %ebp,%r11d + xorl 28(%rsp),%eax + roll $30,%edx + addl %ebx,%r11d + roll $1,%eax + movl %eax,40(%rsp) + leal -899497514(%rax,%rdi,1),%ebp + movl 44(%rsp),%eax + movl %edx,%ebx + movl %r11d,%edi + xorl 52(%rsp),%eax + xorl %r12d,%ebx + roll $5,%edi + xorl 12(%rsp),%eax + xorl %esi,%ebx + addl %edi,%ebp + xorl 32(%rsp),%eax + roll $30,%r12d + addl %ebx,%ebp + roll $1,%eax + movl %eax,44(%rsp) + leal -899497514(%rax,%rsi,1),%edi + movl 48(%rsp),%eax + movl %r12d,%ebx + movl %ebp,%esi + xorl 56(%rsp),%eax + xorl %r11d,%ebx + roll $5,%esi + xorl 16(%rsp),%eax + xorl %edx,%ebx + addl %esi,%edi + xorl 36(%rsp),%eax + roll $30,%r11d + addl %ebx,%edi + roll $1,%eax + movl %eax,48(%rsp) + leal -899497514(%rax,%rdx,1),%esi + movl 52(%rsp),%eax + movl %r11d,%ebx + movl %edi,%edx + xorl 60(%rsp),%eax + xorl %ebp,%ebx + roll $5,%edx + xorl 20(%rsp),%eax + xorl %r12d,%ebx + addl %edx,%esi + xorl 40(%rsp),%eax + roll $30,%ebp + addl %ebx,%esi + roll $1,%eax + leal -899497514(%rax,%r12,1),%edx + movl 56(%rsp),%eax + movl %ebp,%ebx + movl %esi,%r12d + xorl 0(%rsp),%eax + xorl %edi,%ebx + roll $5,%r12d + xorl 24(%rsp),%eax + xorl %r11d,%ebx + addl %r12d,%edx + xorl 44(%rsp),%eax + roll $30,%edi + addl %ebx,%edx + roll $1,%eax + leal -899497514(%rax,%r11,1),%r12d + movl 60(%rsp),%eax + movl %edi,%ebx + movl %edx,%r11d + xorl 4(%rsp),%eax + xorl %esi,%ebx + roll $5,%r11d + xorl 28(%rsp),%eax + xorl %ebp,%ebx + addl %r11d,%r12d + xorl 48(%rsp),%eax + roll $30,%esi + addl %ebx,%r12d + roll $1,%eax + leal -899497514(%rax,%rbp,1),%r11d + movl %esi,%ebx + movl %r12d,%ebp + xorl %edx,%ebx + roll $5,%ebp + xorl %edi,%ebx + addl %ebp,%r11d + roll $30,%edx + addl %ebx,%r11d + addl 0(%r8),%r11d + addl 4(%r8),%r12d + addl 8(%r8),%edx + addl 12(%r8),%esi + addl 16(%r8),%edi + movl %r11d,0(%r8) + movl %r12d,4(%r8) + movl %edx,8(%r8) + movl %esi,12(%r8) + movl %edi,16(%r8) + + xchgl %r11d,%edx + xchgl %r12d,%esi + xchgl %r11d,%edi + xchgl %r12d,%ebp + + leaq 64(%r9),%r9 + subq $1,%r10 + jnz .Lloop + movq 64(%rsp),%rsi + movq (%rsi),%r12 + movq 8(%rsi),%rbp + movq 16(%rsi),%rbx + leaq 24(%rsi),%rsp +.Lepilogue: + .byte 0xf3,0xc3 +.byte 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.align 16 diff --git a/project/src/crypto/sha1-x86_64.s b/project/src/crypto/sha1-x86_64.s index f0ae885..c94edd0 100644 --- a/project/src/crypto/sha1-x86_64.s +++ b/project/src/crypto/sha1-x86_64.s @@ -1,3 +1,4 @@ +.file "sha1-x86_64.s" .text .globl wit_sha1_block_data_order .type wit_sha1_block_data_order,@function diff --git a/project/src/crypto/sha1_one.c b/project/src/crypto/sha1_one.c index a47b78b..15c482d 100644 --- a/project/src/crypto/sha1_one.c +++ b/project/src/crypto/sha1_one.c @@ -60,8 +60,10 @@ #include <string.h> #include "wiimm-sha.h" -unsigned char *WIIMM_SHA1(const unsigned char *d, size_t n, unsigned char *md) -{ +#ifndef USE_SHA_LIB + + unsigned char *WIIMM_SHA1(const unsigned char *d, size_t n, unsigned char *md) + { WIIMM_SHA_CTX c; static unsigned char m[SHA_DIGEST_LENGTH]; @@ -71,4 +73,7 @@ unsigned char *WIIMM_SHA1(const unsigned char *d, size_t n, unsigned char *md) WIIMM_SHA1_Update(&c,d,n); WIIMM_SHA1_Final(md,&c); return(md); -} + } + +#endif + diff --git a/project/src/crypto/ssl-asm.h b/project/src/crypto/ssl-asm.h index aef71db..0d1e49b 100644 --- a/project/src/crypto/ssl-asm.h +++ b/project/src/crypto/ssl-asm.h @@ -35,12 +35,17 @@ * * ***************************************************************************/ -#ifdef __CYGWIN__ +#ifndef USE_SHA_LIB + #ifdef __CYGWIN__ #define SHA1_ASM #ifdef WIIMM_INCLUDE_SSL_ASM - #include "sha1-586-cygwin.s" + #if defined(__x86_64__) + #include "sha1-cygwin64.s" + #else + #include "sha1-586-cygwin.s" + #endif #endif -#elif defined(__linux__) + #elif defined(__linux__) #if defined(__i386__) #define SHA1_ASM #ifdef WIIMM_INCLUDE_SSL_ASM @@ -52,5 +57,6 @@ #include "sha1-x86_64.s" #endif #endif -#endif + #endif +#endif // !USE_SHA_LIB diff --git a/project/src/lib-brres.c b/project/src/lib-brres.c index 128fb33..f19cada 100644 --- a/project/src/lib-brres.c +++ b/project/src/lib-brres.c @@ -829,7 +829,11 @@ static int iterate_brres_group const brres_entry_t * entry_end = entry + n_entries; int stat = 0; + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->index = 0; it->fst_item = 0; @@ -957,7 +961,11 @@ int IterateFilesBRRES //----- cut files? + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->index = 0; it->fst_item = 0; @@ -1326,12 +1334,16 @@ int IterateStringsBRSUB it->fform = FF_UNKNOWN; - szs_iterator_t it2; - memset(&it2,0,sizeof(it2)); + szs_iterator_t it2 = {0}; it2.szs = it->szs; it2.size = it->file_size; it2.endian = it->endian; + //it2.clean_path = ; + #if USE_ITERATOR_PARAM // [[itpar]] copy itpar + it2.itpar.cut_files = true; + #else it2.cut_files = true; + #endif CutFilesBRSUB( &it2, brsub_string_func, it, 0, 0 ); return count + it2.index; } @@ -1721,7 +1733,7 @@ int DumpStructureBRRES if ( szs->fform_arch != FF_BRRES ) return -1; - return IterateFilesSZS(szs,dump_func,f,false,0,-1,SORT_NONE); + return IterateFilesParSZS(szs,dump_func,f,false,false,0,-1,SORT_NONE); } // @@ -1982,7 +1994,7 @@ enumError CreateNameRef nr->brief = brief; if ( szs->fform_arch == FF_BRRES ) - IterateFilesSZS( szs, iterate_nr_brres,nr, true,0,-1, SORT_NONE ); + IterateFilesParSZS( szs, iterate_nr_brres,nr, false,true,0,-1, SORT_NONE ); else iterate_nr_brsub(nr,szs,szs->data,szs->file_size,FF_UNKNOWN); #if 0 diff --git a/project/src/lib-bzip2.c b/project/src/lib-bzip2.c index 69ff271..aaefe2b 100644 --- a/project/src/lib-bzip2.c +++ b/project/src/lib-bzip2.c @@ -584,9 +584,17 @@ enumError DecodeBZIP2buf DASSERT(src); uint dest_need = ntohl(*(u32*)src); - *dest_written = dest_need; PRINT("DecodeBZIP2buf() %u -> %u,%u bytes\n",src_size,dest_size,dest_need); + if ( be32(src+4) == 0x52415730 ) // "RAW0" == not compressed + { + const uint copy_len = dest_size < dest_need ? dest_size : dest_need; + *dest_written = copy_len; + memcpy(dest,(u8*)src+8,copy_len); + return ERR_OK; + } + + *dest_written = dest_need; int bzerror = BZ2_bzBuffToBuffDecompress ( (char*)dest, dest_written, (char*)src+4, src_size-4, 0, 0 ); diff --git a/project/src/lib-bzip2.h b/project/src/lib-bzip2.h index 0b59c11..508f18f 100644 --- a/project/src/lib-bzip2.h +++ b/project/src/lib-bzip2.h @@ -175,7 +175,7 @@ typedef struct BZ2Manager_t //--- source cvp src_data; // BZ2 is automatically detected and - // decoded by DecodeBZIP2. Nver NULL + // decoded by DecodeBZIP2(). Never NULL uint src_size; // size of 'src_data' //--- decoded @@ -304,7 +304,7 @@ typedef struct BZ2Source_t cvp src_data; // NULL or internal fall back data. // BZ2 is automatically detected and - // decoded by DecodeBZIP2. + // decoded by DecodeBZIP2(). uint src_size; // size of 'src_data' file_format_t fform; // not FF_UNKNOWN: Allow only this type diff --git a/project/src/lib-ctcode.c b/project/src/lib-ctcode.c index dd954c6..ed0e7b1 100644 --- a/project/src/lib-ctcode.c +++ b/project/src/lib-ctcode.c @@ -2525,7 +2525,7 @@ enumError ScanBrresCTCODE szs_file_t szs; AssignSZS(&szs,true,(void*)data,data_size,false,FF_BRRES,0); - IterateFilesSZS(&szs,iter_brres_ctcode,ctcode,false,0,-1,SORT_NONE); + IterateFilesParSZS(&szs,iter_brres_ctcode,ctcode,false,false,0,-1,SORT_NONE); ResetSZS(&szs); return ERR_OK; @@ -2928,7 +2928,7 @@ enumError SaveTextCTCODE MARK_USED(keybuf,namebuf); fprintf( F.f, text_ctcode_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, ctcode->ctb.ct_mode, ctcode->n_racing_cups, ctcode->max_racing_cups, diff --git a/project/src/lib-ctcode.h b/project/src/lib-ctcode.h index facd900..15520f9 100644 --- a/project/src/lib-ctcode.h +++ b/project/src/lib-ctcode.h @@ -305,7 +305,7 @@ typedef struct ctcode_t //--- text scan support u8 used_slot[CODE_MAX_TRACKS]; // 0:free, 1:used, 2:reserved - u8 next_slot[CODE_MAX_TRACKS]; // predefined slots + u16 next_slot[CODE_MAX_TRACKS]; // predefined slots u8 force_slot[CODE_MAX_TRACKS]; // 0:std, 1:force slot usage uint n_next_slot; // >0: index-1 into 'next_slot' and 'force_slot' uint tracks_defined; // number of really defined tracks diff --git a/project/src/lib-file.c b/project/src/lib-file.c index d5a01f2..979d875 100644 --- a/project/src/lib-file.c +++ b/project/src/lib-file.c @@ -3107,255 +3107,6 @@ enumError SaveSubFiles ( SubDir_t *sd, ccp basepath ) // /////////////////////////////////////////////////////////////////////////////// -/////////////// PrintScript /////////////// -/////////////////////////////////////////////////////////////////////////////// - -void PrintScriptHeader ( PrintScript_t *ps ) -{ - DASSERT(ps); - - ps->index = 0; - ps->add_index = false; - ps->sep[0] = ps->sep[1] = 0; - - if ( ps->fo && ps->fo->f ) - { - switch (script_fform) - { - case FF_JSON: - if ( script_array > 0 ) - fputs("[",ps->fo->f); - break; - - case FF_SH: - ps->add_index = script_array > 0; - break; - - case FF_PHP: - if ( script_array > 0 ) - fprintf(ps->fo->f,"$%s = array();\n\n",script_varname); - break; - - case FF_MAKEDOC: - if ( script_array > 0 ) - fprintf(ps->fo->f,"%s = @LIST\n\n",script_varname); - break; - - default: - //fputc('\n',ps->fo->f); - break; - } - } -} - -/////////////////////////////////////////////////////////////////////////////// - -void PrintScriptFooter ( PrintScript_t *ps ) -{ - DASSERT(ps); - - if ( ps && ps->fo && ps->fo->f ) - { - switch (script_fform) - { - case FF_JSON: - if ( script_array > 0 ) - fputs("]\n",ps->fo->f); - break; - - case FF_SH: - if (script_array) - fprintf(ps->fo->f,"%s_N=%u\n\n",script_varname,ps->index); - break; - - case FF_PHP: - fputs("?>\n",ps->fo->f); - break; - - default: - break; - } - } -} - -/////////////////////////////////////////////////////////////////////////////// - -int PutScriptVars -( - PrintScript_t *ps, // valid control struct - uint mode, // bit field: 1=open var, 2:close var - ccp text // text with line of format NAME=VALUE -) -{ - DASSERT(ps); - - FILE * f = ps->fo ? ps->fo->f : 0; - if (!f) - return 0; - - - //--- begin of output - - if ( mode & 1 ) - { - if ( ps->add_index ) - snprintf( ps->prefix, sizeof(ps->prefix), - "%s_%u", script_varname, ps->index ); - else - snprintf( ps->prefix, sizeof(ps->prefix), - "%s", script_varname ); - - switch (script_fform) - { - case FF_JSON: - fprintf(f,"%s{",ps->sep); - ps->sep[0] = ','; - break; - - case FF_PHP: - fputs("$d = new \\stdClass;\n",f); - break; - - case FF_MAKEDOC: - fprintf(f,"d = @MAP\n"); - break; - - default: - break; - } - } - - - //--- print var lines - - if (!text) - text = ""; - - uint count; - for( count = 0; ; count++ ) - { - while ( *text && (uchar)*text <= ' ' ) - text++; - - ccp ptr = text; - while ( *ptr && *ptr != '=' ) - ptr++; - if ( *ptr != '=' || ptr == text ) - break; - - ccp param = ptr++; - while ( (uchar)*ptr >= ' ' ) - ptr++; - - switch (script_fform) - { - case FF_JSON: - fprintf(f, "%s\"%.*s\":%.*s", - count ? "," : "", - (int)( param - text ), text, - (int)( ptr - param - 1 ), param+1 ); - break; - - case FF_BASH: - if (script_array) - { - fprintf(f, "%s_%.*s%s=(%.*s)\n", ps->prefix, - (int)( param - text ), text, - ps->index ? "+" : "", - (int)( ptr - param - 1 ), param+1 ); - break; - } - // fall through - - case FF_SH: - fprintf(f, "%s_%.*s=%.*s\n", ps->prefix, - (int)( param - text ), text, - (int)( ptr - param - 1 ), param+1 ); - break; - - case FF_PHP: - fprintf(f, "$d->%.*s = %.*s;\n", - (int)( param - text ), text, - (int)( ptr - param - 1 ), param+1 ); - break; - - case FF_MAKEDOC: - fprintf(f, "d[\"%.*s\"] = %.*s\n", - (int)( param - text ), text, - (int)( ptr - param - 1 ), param+1 ); - break; - - default: - fprintf(f, "%20.*s = %.*s\n", - (int)( param - text ), text, - (int)( ptr - param - 1 ), param+1 ); - break; - } - - text = ptr; - } - - - //--- end of output - - if ( mode & 2 ) - { - switch (script_fform) - { - case FF_JSON: - fputs("}\n",f); - break; - - case FF_PHP: - fprintf(f, "$%s%s = $d;\n\n", - ps->prefix, script_array ? "[]" : "" ); - break; - - case FF_MAKEDOC: - fprintf(f, "%s %s= move(d);\n\n", - ps->prefix, script_array ? "#" : "" ); - break; - - default: - fputc('\n',f); - break; - } - fflush(f); - } - - ps->index++; - return count; -} - -/////////////////////////////////////////////////////////////////////////////// - -int PrintScriptVars -( - PrintScript_t *ps, // valid control struct - uint mode, // bit field: 1=open var, 2:close var - ccp format, // format of message - ... // arguments - -) -{ - DASSERT(ps); - - char buf[5000]; - if (format) - { - va_list arg; - va_start(arg,format); - vsnprintf(buf,sizeof(buf),format,arg); - va_end(arg); - } - else - *buf = 0; - - return PutScriptVars(ps,mode,buf); -} - -// -/////////////////////////////////////////////////////////////////////////////// /////////////// Base64 coding /////////////// /////////////////////////////////////////////////////////////////////////////// diff --git a/project/src/lib-geohit.c b/project/src/lib-geohit.c index 55d13c9..8090e0c 100644 --- a/project/src/lib-geohit.c +++ b/project/src/lib-geohit.c @@ -668,7 +668,7 @@ enumError SaveTextGEOHIT if (!tiny) fprintf(F.f,text_geohit_kart_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); #if USE_OBJECT_MANAGER > 1 WriteObjMgrToSetupSection( F.f, &geohit->obj_mgr, @@ -684,7 +684,7 @@ enumError SaveTextGEOHIT if (!tiny) fprintf(F.f,text_geohit_item_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); #if USE_OBJECT_MANAGER > 1 WriteObjMgrToSetupSection( F.f, &geohit->obj_mgr, diff --git a/project/src/lib-itemslot.c b/project/src/lib-itemslot.c index 20d0060..a7b7727 100644 --- a/project/src/lib-itemslot.c +++ b/project/src/lib-itemslot.c @@ -672,7 +672,7 @@ enumError SaveTextITEMSLOT const bool tiny = brief_count > 1 || export_count; if (!tiny) fprintf(F.f,text_itemslot_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); //--- print parameters diff --git a/project/src/lib-kcl.c b/project/src/lib-kcl.c index 86acd6b..b78a632 100644 --- a/project/src/lib-kcl.c +++ b/project/src/lib-kcl.c @@ -3585,7 +3585,9 @@ enumError ScanTextKCL { uint idx; double3 pt; - } tab[KCL_MAX_PT_PER_TRI]; + } + tab_buf[KCL_MAX_PT_PER_TRI], *tab = tab_buf; + uint tab_size = KCL_MAX_PT_PER_TRI; kcl_tri_param_t par; InitializeTriParam(&par,kcl,0); @@ -3655,11 +3657,23 @@ enumError ScanTextKCL //--- scan points uint k, norm = ~0; - for ( k = 0; k < KCL_MAX_PT_PER_TRI; k++ ) + for ( k = 0;; k++ ) { if ( k >= 3 && !NextCharSI(&si,false) ) break; + if ( k >= tab_size ) + { + const uint new_size = 2*tab_size; + struct tab_t *new_tab = MALLOC(new_size*sizeof(*new_tab)); + memcpy(new_tab,tab,tab_size*sizeof(*tab)); + PRINT("KCMD_F/TAB: grow %d -> %d\n",tab_size,new_size); + if ( tab != tab_buf ) + FREE(tab); + tab = new_tab; + tab_size = new_size; + } + u32 idx; err = ScanU32SI(&si,&idx,1,0); if (err) @@ -3683,7 +3697,7 @@ enumError ScanTextKCL && !k && (KCL_MODE & KCLMD_AUTO) ) { - noPRINT("NORMAL FOUND: %u\n",idx-1); + PRINT1("NORMAL FOUND: %u\n",idx-1); norm = idx - 1; } } @@ -3829,6 +3843,8 @@ enumError ScanTextKCL //--- terminate + if ( tab != tab_buf ) + FREE(tab); ResetD3L(&vertex); ResetD3L(&normal); return max_err; @@ -4938,7 +4954,7 @@ enumError SaveTextKCL //--- print header fprintf(F.f, text_kcl_head_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, GetKclMode(), + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, GetKclMode(), n_vert, n_norm, n_valid_tri, n_grp ); uint i; diff --git a/project/src/lib-kmp-text.c b/project/src/lib-kmp-text.c index 15f93c8..22bc664 100644 --- a/project/src/lib-kmp-text.c +++ b/project/src/lib-kmp-text.c @@ -6369,7 +6369,7 @@ enumError SaveTextKMP fprintf(F.f, "%s[SETUP]\r\n\r\n" "TOOL = %s\r\n" - "SYSTEM = %s\r\n" + "SYSTEM2 = %s\r\n" "VERSION = %s\r\n" "REVISION = %u\r\n" "DATE = %s\r\n" @@ -6381,14 +6381,14 @@ enumError SaveTextKMP "KMP-WIM0 = %d\r\n" "\r\n", section_sep, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, kmp->info ? kmp->info : "", kmp->kmp_version, kmp->battle_mode, kmp->wim0_export ); } else { fprintf(F.f, text_kmp_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, kmp->info ? kmp->info : "", kmp->kmp_version, kmp->battle_mode, kmp->wim0_export ); diff --git a/project/src/lib-kmp.c b/project/src/lib-kmp.c index ba31951..66de994 100644 --- a/project/src/lib-kmp.c +++ b/project/src/lib-kmp.c @@ -6571,7 +6571,7 @@ static void check_ph if ( ph->pt_len == 1 ) print_check_error(chk,CMOD_WARNING,sect_ph,i,0, "Self linked item route with exact 1 point:" - " This will force a heavy lag if a red shell arrive.\n" ); + " This will force a heavy lag if a red shell arrives.\n" ); else print_check_error(chk,CMOD_HINT,sect_ph,i,0, "Self linked item route.\n" ); diff --git a/project/src/lib-lecode.c b/project/src/lib-lecode.c index b63909c..0974ed8 100644 --- a/project/src/lib-lecode.c +++ b/project/src/lib-lecode.c @@ -62,6 +62,11 @@ 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; bool opt_complete = false; @@ -188,6 +193,43 @@ int ScanOptXPFlags ( ccp arg ) /////////////////////////////////////////////////////////////////////////////// +int ScanOptSpeedometer ( ccp arg ) +{ + const int stat + = ScanKeywordOffAutoOn(arg,OFFON_ON,OFFON_ON,"Option --speedo"); + if ( stat == OFFON_ERROR ) + return 1; + + opt_speedo = stat; + PRINT("SPEEDO=%d\n",opt_speedo); + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// + +int ScanOptReserved_1b9 ( ccp arg ) +{ + opt_reserved_1b9 = str2l(arg,0,10); + PRINT("RESERVED_1B9=%d\n",opt_reserved_1b9); + return 0; +} + +int ScanOptReserved_1ba ( ccp arg ) +{ + opt_reserved_1ba = str2l(arg,0,10); + PRINT("RESERVED_1BA=%d\n",opt_reserved_1ba); + return 0; +} + +int ScanOptReserved_1bb ( ccp arg ) +{ + opt_reserved_1bb = str2l(arg,0,10); + PRINT("RESERVED_1BB=%d\n",opt_reserved_1b9); + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// + int ScanOptAlias ( ccp arg ) { if ( arg && *arg ) @@ -302,7 +344,7 @@ 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 ) + if ( lp->enable_perfmon > 1 || lp->enable_speedo > 1 ) return LPM_EXPERIMENTAL; return lp->enable_perfmon || !lp->enable_xpflags @@ -339,11 +381,15 @@ 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; } } 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; @@ -554,6 +600,7 @@ 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->block_track = lp->block_track < LE_MAX_BLOCK_TRACK ? lp->block_track : LE_MAX_BLOCK_TRACK; } @@ -583,6 +630,9 @@ static void CopyLPAR2Data ( le_analyse_t * ana ) if ( offsetof(le_binpar_v1_t,enable_xpflags) < ana->param_size ) h->enable_xpflags = lp->enable_xpflags; + if ( offsetof(le_binpar_v1_t,enable_speedo) < ana->param_size ) + h->enable_speedo = lp->enable_speedo; + if ( offsetof(le_binpar_v1_t,block_track) < ana->param_size ) h->block_track = lp->block_track; @@ -591,6 +641,15 @@ 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; } // @@ -606,7 +665,7 @@ enumError SaveTextLPAR { DASSERT(lpar); DASSERT(fname); - PRINT("SaveTextLEX(%s,%d)\n",fname,set_time); + PRINT("SaveTextLPAR(%s,%d)\n",fname,set_time); //--- open file @@ -682,7 +741,12 @@ 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) + { fprintf(f,text_lpar_sect_param_cr ,GetLparModeName(CalcCurrentLparMode(lpar,true),export_count>0) ,lpar->engine[0],lpar->engine[1],lpar->engine[2] @@ -690,10 +754,16 @@ enumError WriteSectionLPAR ,lpar->enable_perfmon ,lpar->enable_custom_tt ,lpar->enable_xpflags + ,lpar->enable_speedo ,LE_MAX_BLOCK_TRACK ,lpar->block_track ); + + if (have_reserved) + fputs(text_lpar_sect_reserved_cr,f); + } else + { fprintf(f, "\r\n" "LIMIT-MODE = %s\r\n\r\n" @@ -702,6 +772,7 @@ 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" ,GetLparModeName(CalcCurrentLparMode(lpar,true),export_count>0) ,lpar->engine[0],lpar->engine[1],lpar->engine[2] @@ -709,9 +780,17 @@ enumError WriteSectionLPAR ,lpar->enable_perfmon ,lpar->enable_custom_tt ,lpar->enable_xpflags + ,lpar->enable_speedo ,lpar->block_track ); + 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 @@ -942,6 +1021,14 @@ 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; + } break; default: @@ -1644,7 +1731,7 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) ColorSet_t col; SetupColorSet(&col,f); - fprintf(f,"%*s%sLE-CODE binary, valid=%s, file size: %x/hex = %u%s\n", + fprintf(f,"%*s%sLE-CODE binary, valid=%s, file size: %x/hex = %u bytes%s\n", indent,"", col.caption, GetLEValid(ana->valid), ana->size, ana->size, col.reset ); @@ -1688,10 +1775,10 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) "%*s" "Build number: %u\n" "%*s" "Base address: %8x/hex\n" "%*s" "Entry point: %8x/hex\n" - "%*s" "Total size: %8x/hex = %u\n" + "%*s" "Total size: %8x/hex = %u bytes\n" "%*s" "Offset param: %8x/hex\n" - "%*s" "Region code: %c (%s)\n" - "%*s" "Debug flag: %c (%s)\n" + "%*s" "Region code: %c = %s\n" + "%*s" "Debug flag: %c = %s\n" "%*s" "LE version/phase: %u\n" ,indent-2,"", col.heading, col.reset ,indent,"", h->magic @@ -1744,7 +1831,7 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) "\n%*s%s" "Parameters:%s\n" "%*s" "Magic: %.4s\n" "%*s" "Version: %u\n" - "%*s" "Param size: %x/hex = %u\n" + "%*s" "Param size: %x/hex = %u bytes\n" ,indent-2,"", col.heading, col.reset ,indent,"", h->magic ,indent,"", ntohl(h->version) @@ -1760,29 +1847,49 @@ void DumpLEAnalyse ( FILE *f, uint indent, const le_analyse_t *ana ) DASSERT(h); fprintf(f, "%*s" "Engine chances: " - "%u + %u + %u = %u (1%s0cc,mirror)\n" - "%*s" "200cc: %u (%sabled)\n" - "%*s" "Perform. monitor: %u (%s)\n" + "%u + %u + %u = %u (1%s0cc+mirror=total)\n" + "%*s" "200cc: %u = %sabled\n" + "%*s" "Perform. monitor: %u = %s\n" ,indent,"" ,h->engine[0], h->engine[1], h->engine[2] ,h->engine[0] + h->engine[1] + h->engine[2] - ,h->enable_200cc ? "50cc,20" : "00cc,15" + ,h->enable_200cc ? "50cc+20" : "00cc+15" ,indent,"", h->enable_200cc, h->enable_200cc ? "en" :"dis" ,indent,"", h->enable_perfmon, - h->enable_perfmon > 1 ? "Wii+Dolphin" - : h->enable_perfmon ? "Wii only" :"disabled" + h->enable_perfmon > 1 ? "Wii(U)+Dolphin" + : h->enable_perfmon ? "Wii(U) only" :"disabled" ); if ( ana->param_size >= sizeof(le_binpar_v1_37_t) ) fprintf(f, - "%*s" "Custom Timetrial: %u (%sabled)\n" - "%*s" "Extended P-Flags: %u (%sabled)\n" - "%*s" "Block tracks for: %u races\n" + "%*s" "Custom Timetrial: %u = %sabled\n" + "%*s" "Extended P-Flags: %u = %sabled\n" + "%*s" "Block tracks for: %u race%s\n" ,indent,"", h->enable_custom_tt, h->enable_custom_tt ? "en" :"dis" ,indent,"", h->enable_xpflags, h->enable_xpflags ? "en" :"dis" - ,indent,"", h->block_track + ,indent,"", h->block_track, h->block_track == 1 ? "" : "s" ); + if ( ana->param_size >= sizeof(le_binpar_v1_1bc_t) ) + { + 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" + ); + + 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 (h->reserved_1bb) + fprintf(f,"%*s" "Reserved 1BB: %u\n", + indent,"", h->reserved_1bb ); + } + #if defined(DEBUG) && defined(TEST) && 0 const uint po = ana->param_offset; fprintf(f, @@ -2241,6 +2348,30 @@ uint PatchAliasLE ( le_analyse_t * ana, ccp list ) /////////////////////////////////////////////////////////////////////////////// +void PatchLPAR ( le_lpar_t * lp ) +{ + DASSERT(lp); + + if (opt_engine_valid) + memcpy(lp->engine,opt_engine,sizeof(lp->engine)); + if ( opt_200cc != OFFON_AUTO ) + lp->enable_200cc = opt_200cc >= OFFON_ON; + if ( opt_perfmon != OFFON_AUTO ) + lp->enable_perfmon = opt_perfmon >= OFFON_FORCE ? 2 : opt_perfmon >= OFFON_ON; + if ( opt_custom_tt != OFFON_AUTO ) + lp->enable_custom_tt = opt_custom_tt >= OFFON_ON; + 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; +} + +/////////////////////////////////////////////////////////////////////////////// + void PatchLECODE ( le_analyse_t * ana ) { DASSERT(ana); @@ -2252,23 +2383,9 @@ void PatchLECODE ( le_analyse_t * ana ) switch (ana->param_vers) { case 1: - { - if (opt_le_alias) - PatchAliasLE(ana,opt_le_alias); - - le_lpar_t *lp = &ana->lpar; - if (opt_engine_valid) - memcpy(lp->engine,opt_engine,sizeof(lp->engine)); - if ( opt_200cc != OFFON_AUTO ) - lp->enable_200cc = opt_200cc >= OFFON_ON; - if ( opt_perfmon != OFFON_AUTO ) - lp->enable_perfmon = opt_perfmon >= OFFON_FORCE ? 2 - : opt_perfmon >= OFFON_ON; - if ( opt_custom_tt != OFFON_AUTO ) - lp->enable_custom_tt = opt_custom_tt >= OFFON_ON; - if ( opt_xpflags != OFFON_AUTO ) - lp->enable_xpflags = opt_xpflags >= OFFON_ON; - } + if (opt_le_alias) + PatchAliasLE(ana,opt_le_alias); + PatchLPAR(&ana->lpar); break; } @@ -2454,7 +2571,12 @@ enumError ScanTextLPAR_PARAM { "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} }; @@ -2693,6 +2815,8 @@ static void FixLEXElement_SET1 ( lex_set1_t *set1 ) if ( !isnormal(f) || f < 1.0 ) write_bef4(set1->item_factor.v+i,1.0); } + + set1->fix_online_delay = set1->fix_online_delay > 0; } //----------------------------------------------------------------------------- @@ -3042,7 +3166,7 @@ lex_item_t * AppendSet1LEX ( lex_t * lex, bool overwrite ) { lex_set1_t set1; memset(&set1,0,sizeof(set1)); - // AppendElementLE() do call FixLEXItem_SET1() + // AppendElementLE() does call FixLEXItem_SET1() return AppendElementLEX(lex,LEXS_SET1,&set1,sizeof(set1),false); } @@ -3406,6 +3530,7 @@ static enumError ScanLEXElement_SET1 const ScanParam_t ptab[] = { { "ITEM-POS-FACTOR", SPM_FLOAT3_BE, &set1.item_factor }, + { "FIX-ONLINE-DELAY", SPM_U8, &set1.fix_online_delay }, {0} }; @@ -3942,6 +4067,11 @@ static enumError SaveTextLEX_SET1 ,bef4(&set1->item_factor.z) ); + if (set1->fix_online_delay) + fprintf(f,text_lex_elem_set1_develop_cr + ,set1->fix_online_delay + ); + if ( size > sizeof(lex_set1_t) ) { fputs("\n# Hex dump for unknown settings:\n",f); @@ -4123,18 +4253,18 @@ enumError SaveTextLEX fprintf(F.f, "%s[SETUP]\r\n\r\n" "TOOL = %s\r\n" - "SYSTEM = %s\r\n" + "SYSTEM2 = %s\r\n" "VERSION = %s\r\n" "REVISION = %u\r\n" "DATE = %s\r\n" "\r\n", section_sep, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); } else { fprintf(F.f, text_lex_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); uint i; for ( i = 0; i < lex->item_used; i++ ) diff --git a/project/src/lib-lecode.h b/project/src/lib-lecode.h index 79788c9..6f314a2 100644 --- a/project/src/lib-lecode.h +++ b/project/src/lib-lecode.h @@ -115,8 +115,14 @@ typedef struct le_lpar_t u8 enable_perfmon; // TRUE: performance monitor enabled 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 block_track; // block used tracks for 0..20 races + // reserved for future extensions + u8 reserved_1b9; + u8 reserved_1ba; + u8 reserved_1bb; + 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 } @@ -355,9 +361,45 @@ typedef struct le_binpar_v1_1b8_t __attribute__ ((packed)) 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 + + /*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 + + //--- reserved for future extensions + /*1b9*/ u8 reserved_1b9; + /*1ba*/ u8 reserved_1ba; + /*1bb*/ u8 reserved_1bb; + /*1bc*/ +} +__attribute__ ((packed)) le_binpar_v1_1bc_t; + +//----------------------------------------------------------------------------- // [[le_binpar_v1_t]] -typedef struct le_binpar_v1_1b8_t le_binpar_v1_t; +typedef struct le_binpar_v1_1bc_t le_binpar_v1_t; // /////////////////////////////////////////////////////////////////////////////// @@ -497,6 +539,7 @@ const ctcode_t * LoadLEFile ( uint le_phase ); enumError ApplyLEFile ( le_analyse_t * ana ); enumError ApplyCTCODE ( le_analyse_t * ana, const ctcode_t * ctcode ); void PatchLECODE ( le_analyse_t * ana ); +void PatchLPAR ( le_lpar_t * lp ); // /////////////////////////////////////////////////////////////////////////////// @@ -583,7 +626,9 @@ __attribute__ ((packed)) lex_element_t; typedef struct lex_set1_t { - float3 item_factor; // factor for item positions, always >=1.0 + float3 item_factor; // factor for item positions, always >=1.0 + u8 fix_online_delay; // fix delay of GOBJ objects + u8 padding[3]; } __attribute__ ((packed,aligned(4))) lex_set1_t; @@ -876,16 +921,26 @@ 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 bool opt_complete; -int ScanOptTrackSource ( ccp arg, int mode ); -int ScanOptAlias ( ccp arg ); -int ScanOptEngine ( ccp arg ); -int ScanOpt200cc ( ccp arg ); -int ScanOptPerfMon ( ccp arg ); -int ScanOptCustomTT( ccp arg ); -int ScanOptXPFlags ( ccp arg ); +int ScanOptTrackSource ( ccp arg, int mode ); +int ScanOptAlias ( ccp arg ); +int ScanOptEngine ( ccp arg ); +int ScanOpt200cc ( ccp arg ); +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 ); // /////////////////////////////////////////////////////////////////////////////// diff --git a/project/src/lib-mdl.c b/project/src/lib-mdl.c index b05b260..72c055b 100644 --- a/project/src/lib-mdl.c +++ b/project/src/lib-mdl.c @@ -1629,7 +1629,7 @@ enumError IterateRawDataMDL szs_file_t szs; // [[fname+]] AssignSZS(&szs,true,raw->data,raw->data_size,false,raw->fform,raw->fname); - IterateFilesSZS(&szs,iter_raw_data_mdl,&iparam,false,-1,-1,SORT_NONE); + IterateFilesParSZS(&szs,iter_raw_data_mdl,&iparam,false,false,-1,-1,SORT_NONE); ResetSZS(&szs); return iparam.max_err; } @@ -2505,7 +2505,7 @@ enumError SaveTextMDL fprintf(F.f, "%s[SETUP]\r\n\r\n" "TOOL = %s\r\n" - "SYSTEM = %s\r\n" + "SYSTEM2 = %s\r\n" "VERSION = %s\r\n" "REVISION = %u\r\n" "DATE = %s\r\n" @@ -2515,14 +2515,14 @@ enumError SaveTextMDL "N-SECTIONS = %2u\r\n" "\r\n", section_sep, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, mdl->name ? mdl->name : "", mdl->version, mdl->n_sect ); } else { fprintf(F.f, text_mdl_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, mdl->name ? mdl->name : "", mdl->version, mdl->n_sect ); } @@ -3478,8 +3478,8 @@ static int find_minimap_brres PRINT("MDL FOUND: %x |%s|%s| fn=%s\n",it->fform,it->path,it->name,it->szs->fname); szs_file_t szs; InitializeSubSZS(&szs,it->szs,it->off,it->size,FF_MDL,it->path,false); - int stat = IterateFilesSZS ( &szs, find_minimap_mdl, it->param, - true, 0, 1, SORT_NONE ); + int stat = IterateFilesParSZS ( &szs, find_minimap_mdl, it->param, + false, true, 0, 1, SORT_NONE ); ResetSZS(&szs); return stat; } @@ -3507,8 +3507,8 @@ static int find_minimap_szs PRINT("MAP MODEL FOUND: %x |%s|%s|\n",it->fform,it->path,it->name); szs_file_t szs; InitializeSubSZS(&szs,it->szs,it->off,it->size,FF_BRRES,it->path,false); - int stat = IterateFilesSZS ( &szs, find_minimap_brres, it->param, - true, 0, -1, SORT_NONE ); + int stat = IterateFilesParSZS ( &szs, find_minimap_brres, it->param, + false, true, 0, -1, SORT_NONE ); ResetSZS(&szs); return stat; } @@ -3532,11 +3532,11 @@ bool FindMinimapData mmap->max.x = mmap->max.y = mmap->max.z = -INFINITY; if ( szs->fform_arch == FF_MDL ) - IterateFilesSZS ( szs, find_minimap_mdl, mmap, true, 0, 1, SORT_NONE ); + IterateFilesParSZS ( szs, find_minimap_mdl, mmap, false, true, 0, 1, SORT_NONE ); else if ( szs->fform_arch == FF_BRRES ) - IterateFilesSZS ( szs, find_minimap_brres, mmap, true, 0, -1, SORT_NONE ); + IterateFilesParSZS ( szs, find_minimap_brres, mmap, false, true, 0, -1, SORT_NONE ); else if (IsArchiveFF(szs->fform_arch)) - IterateFilesSZS ( szs, find_minimap_szs, mmap, true, 0, -1, SORT_NONE ); + IterateFilesParSZS ( szs, find_minimap_szs, mmap, false, true, 0, -1, SORT_NONE ); PRINT_IF(mmap->posLD," posLD found, in=%d\n", (u8*)mmap->posLD >= szs->data && (u8*)mmap->posLD < szs->data + szs->size ); @@ -3883,8 +3883,8 @@ static int ana_slot42_brres szs_file_t szs; // [[fname+]] InitializeSubSZS(&szs,it->szs,it->off,it->size,FF_MDL,it->path,false); - int stat = IterateFilesSZS ( &szs, ana_slot42_mdl, it->param, - true, 0, 1, SORT_NONE ); + int stat = IterateFilesParSZS ( &szs, ana_slot42_mdl, it->param, + false, true, 0, 1, SORT_NONE ); Slot42MaterialStat_t *stat42 = it->param; DASSERT(stat42); @@ -3963,8 +3963,8 @@ static int ana_slot42_szs szs_file_t szs; // [[fname+]] InitializeSubSZS(&szs,it->szs,it->off,it->size,FF_BRRES,it->path,false); - int stat = IterateFilesSZS ( &szs, ana_slot42_brres, it->param, - true, 0, -1, SORT_NONE ); + int stat = IterateFilesParSZS ( &szs, ana_slot42_brres, it->param, + false, true, 0, -1, SORT_NONE ); ResetSZS(&szs); return stat; } @@ -3987,11 +3987,11 @@ Slot42MaterialStat_t GetSlot42SupportSZS ( struct szs_file_t *szs ) PRINT("CHECK MOONVIEW [%zu] %s\n",szs->size,GetNameFF(szs->fform_arch,0)); if ( szs->fform_arch == FF_MDL ) - IterateFilesSZS ( szs, ana_slot42_mdl, &stat42, true, 0, 1, SORT_NONE ); + IterateFilesParSZS ( szs, ana_slot42_mdl, &stat42, false, true, 0, 1, SORT_NONE ); else if ( szs->fform_arch == FF_BRRES ) - IterateFilesSZS ( szs, ana_slot42_brres, &stat42, true, 0, -1, SORT_NONE ); + IterateFilesParSZS ( szs, ana_slot42_brres, &stat42, false, true, 0, -1, SORT_NONE ); else if (IsArchiveFF(szs->fform_arch)) - IterateFilesSZS ( szs, ana_slot42_szs, &stat42, true, 0, -1, SORT_NONE ); + IterateFilesParSZS ( szs, ana_slot42_szs, &stat42, false, true, 0, -1, SORT_NONE ); PRINT("MOONVIEW [%zu] %s: found=%x, mod=%x -> all=%d, content=%d -> ok=%d\n", szs->size, GetNameFF(szs->fform_arch,0), @@ -4540,7 +4540,7 @@ uint PatchRawDataMDL // [[fname+]] AssignSZS(&szs,true,data_ptr,data_size,false,FF_MDL,fname); szs.fname = fname; - IterateFilesSZS(&szs,patch_mdl,&mdlpat,true,0,1,SORT_NONE); + IterateFilesParSZS(&szs,patch_mdl,&mdlpat,false,true,0,1,SORT_NONE); szs.fname = 0; ResetSZS(&szs); diff --git a/project/src/lib-minigame.c b/project/src/lib-minigame.c index d13fe21..59eead7 100644 --- a/project/src/lib-minigame.c +++ b/project/src/lib-minigame.c @@ -718,7 +718,7 @@ enumError SaveTextMINIGAME const bool tiny = brief_count > 1 || export_count; if (!tiny) fprintf(F.f,text_minigame_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); //--- print parameters diff --git a/project/src/lib-numeric.h b/project/src/lib-numeric.h index 5414c7f..2239a0f 100644 --- a/project/src/lib-numeric.h +++ b/project/src/lib-numeric.h @@ -1833,17 +1833,24 @@ ccp FindEndOfLineSI ccp FindLineFeedSI ( - ScanInfo_t * si, // valid data + const ScanInfo_t * si, // valid data ccp ptr, // start search here - bool mark_error // true: increment error counter + bool mark_error // true: increment error counter (ignore const) ); //----------------------------------------------------------------------------- ccp FindNextLineFeedSI ( - ScanInfo_t * si, // valid data - bool mark_error // true: increment error counter + const ScanInfo_t * si, // valid data + bool mark_error // true: increment error counter (ignore const) +); + +//----------------------------------------------------------------------------- + +mem_t GetLineSI +( + const ScanInfo_t * si // valid data ); /////////////////////////////////////////////////////////////////////////////// diff --git a/project/src/lib-objflow.c b/project/src/lib-objflow.c index ddecb37..773b0dc 100644 --- a/project/src/lib-objflow.c +++ b/project/src/lib-objflow.c @@ -575,7 +575,7 @@ enumError SaveTextOBJFLOW const bool tiny = brief_count > 1 || export_count; if (!tiny) fprintf(F.f,text_objflow_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE ); + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE ); #if USE_OBJECT_MANAGER>1 WriteObjMgrToSetupSection( F.f, &objflow->obj_mgr, diff --git a/project/src/lib-pack.c b/project/src/lib-pack.c index 5961839..3edaafb 100644 --- a/project/src/lib-pack.c +++ b/project/src/lib-pack.c @@ -77,7 +77,11 @@ int IterateFilesPACK //--- cut file header + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->index = 0; it->fst_item = 0; diff --git a/project/src/lib-parser.c b/project/src/lib-parser.c index 6437b2c..3224c12 100644 --- a/project/src/lib-parser.c +++ b/project/src/lib-parser.c @@ -2377,6 +2377,7 @@ void GotoEolSI ScanInfo_t * si // valid data ) { + DASSERT(si); ScanFile_t *sf = si->cur_file; DASSERT(sf); sf->prev_ptr = sf->ptr; @@ -2511,9 +2512,9 @@ ccp FindEndOfLineSI ccp FindLineFeedSI ( - ScanInfo_t * si, // valid data + const ScanInfo_t * si, // valid data ccp ptr, // start search here - bool mark_error // true: increment error counter + bool mark_error // true: increment error counter (ignore const) ) { DASSERT(si); @@ -2523,7 +2524,7 @@ ccp FindLineFeedSI if (mark_error) { sf->line_err++; - si->total_err++; + ((ScanInfo_t*)si)->total_err++; } while ( ptr < sf->end && *ptr != '\n' ) @@ -2536,8 +2537,8 @@ ccp FindLineFeedSI ccp FindNextLineFeedSI ( - ScanInfo_t * si, // valid data - bool mark_error // true: increment error counter + const ScanInfo_t * si, // valid data + bool mark_error // true: increment error counter (ignore const) ) { DASSERT(si); @@ -2545,6 +2546,22 @@ ccp FindNextLineFeedSI return FindLineFeedSI(si,si->cur_file->ptr,mark_error); } +/////////////////////////////////////////////////////////////////////////////// + +mem_t GetLineSI +( + const ScanInfo_t * si // valid data +) +{ + DASSERT(si); + DASSERT(si->cur_file); + ccp eol = FindNextLineFeedSI(si,false); + mem_t mem; + mem.ptr = si->cur_file->ptr; + mem.len = eol ? eol - mem.ptr : 0; + return mem; +} + // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// diff --git a/project/src/lib-pat.c b/project/src/lib-pat.c index ad3131c..f1cbf6a 100644 --- a/project/src/lib-pat.c +++ b/project/src/lib-pat.c @@ -1907,7 +1907,7 @@ enumError SaveTextPAT fprintf(F.f, "%s[SETUP]\r\n\r\n" "TOOL = %s\r\n" - "SYSTEM = %s\r\n" + "SYSTEM2 = %s\r\n" "VERSION = %s\r\n" "REVISION = %u\r\n" "DATE = %s\r\n" @@ -1917,13 +1917,13 @@ enumError SaveTextPAT "OUTPUT-MODE = %s\r\n" "\r\n", section_sep, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, pat->version, pat->n_sect, outmode_info ); } else { fprintf(F.f, text_pat_setup_cr, - tool_name, SYSTEM, VERSION, REVISION_NUM, DATE, + tool_name, SYSTEM2, VERSION, REVISION_NUM, DATE, pat->version, pat->n_sect, outmode_info ); } diff --git a/project/src/lib-rarc.c b/project/src/lib-rarc.c index a38b4b5..e6dc911 100644 --- a/project/src/lib-rarc.c +++ b/project/src/lib-rarc.c @@ -223,7 +223,11 @@ int IterateFilesRARC } #endif + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->index = 0; it->fst_item = 0; diff --git a/project/src/lib-rkc.c b/project/src/lib-rkc.c index c7bbb51..c3deb92 100644 --- a/project/src/lib-rkc.c +++ b/project/src/lib-rkc.c @@ -105,7 +105,11 @@ int IterateFilesRKC it->fst_item = 0; it->is_dir = 0; + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->no_recurse++; it->off = 0; @@ -136,7 +140,11 @@ int IterateFilesRKC return it->func_it(it,false); } + #if USE_ITERATOR_PARAM + if ( it->itpar.cut_files && sizeof(rkct_t)+sizeof(rkco_t) < u8_off ) + #else if ( it->cut_files && sizeof(rkct_t)+sizeof(rkco_t) < u8_off ) + #endif { it->off = sizeof(rkct_t)+sizeof(rkco_t); it->size = u8_off - it->off; @@ -157,8 +165,13 @@ int IterateFilesRKC // [[fname+]] InitializeSubSZS(&szs2,szs,u8_off,u8_end-u8_off,FF_UNKNOWN,it->path,true); + #if USE_ITERATOR_PARAM + szs_iterator_func it_func + = GetIteratorFunction(szs2.fform_arch,it->itpar.cut_files); + #else szs_iterator_func it_func = GetIteratorFunction(szs2.fform_arch,it->cut_files); + #endif if (it_func) { diff --git a/project/src/lib-staticr.c b/project/src/lib-staticr.c index 2125714..bd49760 100644 --- a/project/src/lib-staticr.c +++ b/project/src/lib-staticr.c @@ -1316,6 +1316,115 @@ static BZ2Manager_t * GetLecodeLoader ( str_mode_t mode ) // /////////////////////////////////////////////////////////////////////////////// +/////////////// fix_51420 data /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static const u8 fix_51420_pal_bz2[] = +{ + // decompressed size: 0x88 = 136 bytes + 0x00,0x00,0x00,0x88, + + // raw data + 0x52,0x41,0x57,0x30, 0x00,0xd0,0xc0,0xde, 0x00,0xd0,0xc0,0xde, 0xc2,0x65,0x8c,0xe4, + 0x00,0x00,0x00,0x0f, 0x48,0x00,0x00,0x0d, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x7c,0xc8,0x03,0xa6, 0x80,0x86,0x00,0x00, 0x7c,0x04,0x18,0x00, 0x41,0x82,0x00,0x4c, + 0x80,0xa6,0x00,0x04, 0x38,0xa5,0x00,0x01, 0x2c,0x05,0x00,0x03, 0x41,0x82,0x00,0x3c, + 0x90,0xa6,0x00,0x04, 0x90,0x66,0x00,0x00, 0x38,0x61,0x00,0x10, 0x3c,0xa0,0x80,0x66, + 0x38,0xa5,0x84,0x18, 0x3c,0x80,0x80,0x66, 0x38,0x84,0x84,0x98, 0x90,0xa1,0x00,0x10, + 0x90,0x81,0x00,0x14, 0x3c,0xe0,0x80,0x66, 0x38,0xe7,0x8c,0xe4, 0x38,0xe7,0xfe,0xf0, + 0x7c,0xe9,0x03,0xa6, 0x4e,0x80,0x04,0x20, 0x3c,0x80,0x80,0x1d, 0x38,0x84,0x15,0xf4, + 0x7c,0x88,0x03,0xa6, 0x4e,0x80,0x00,0x21, 0x60,0x00,0x00,0x00, + // 0x88 = 136 data bytes (103%) +}; + +static BZ2Manager_t fix_51420_pal_mgr + = { fix_51420_pal_bz2, sizeof(fix_51420_pal_bz2), 0, 0 }; + +//----------------------------------------------------------------------------- + +static const u8 fix_51420_usa_bz2[] = +{ + // decompressed size: 0x88 = 136 bytes + 0x00,0x00,0x00,0x88, + + // raw data + 0x52,0x41,0x57,0x30, 0x00,0xd0,0xc0,0xde, 0x00,0xd0,0xc0,0xde, 0xc2,0x65,0x48,0x5c, + 0x00,0x00,0x00,0x0f, 0x48,0x00,0x00,0x0d, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x7c,0xc8,0x03,0xa6, 0x80,0x86,0x00,0x00, 0x7c,0x04,0x18,0x00, 0x41,0x82,0x00,0x4c, + 0x80,0xa6,0x00,0x04, 0x38,0xa5,0x00,0x01, 0x2c,0x05,0x00,0x03, 0x41,0x82,0x00,0x3c, + 0x90,0xa6,0x00,0x04, 0x90,0x66,0x00,0x00, 0x38,0x61,0x00,0x10, 0x3c,0xa0,0x80,0x65, + 0x38,0xa5,0x3f,0x90, 0x3c,0x80,0x80,0x65, 0x38,0x84,0x40,0x10, 0x90,0xa1,0x00,0x10, + 0x90,0x81,0x00,0x14, 0x3c,0xe0,0x80,0x65, 0x38,0xe7,0x48,0x5c, 0x38,0xe7,0xfe,0xf0, + 0x7c,0xe9,0x03,0xa6, 0x4e,0x80,0x04,0x20, 0x3c,0x80,0x80,0x1d, 0x38,0x84,0x15,0x54, + 0x7c,0x88,0x03,0xa6, 0x4e,0x80,0x00,0x21, 0x60,0x00,0x00,0x00, + // 0x88 = 136 data bytes (103%) +}; + +static BZ2Manager_t fix_51420_usa_mgr + = { fix_51420_usa_bz2, sizeof(fix_51420_usa_bz2), 0, 0 }; + +//----------------------------------------------------------------------------- + +static const u8 fix_51420_jap_bz2[] = +{ + // decompressed size: 0x88 = 136 bytes + 0x00,0x00,0x00,0x88, + + // raw data + 0x52,0x41,0x57,0x30, 0x00,0xd0,0xc0,0xde, 0x00,0xd0,0xc0,0xde, 0xc2,0x65,0x83,0x50, + 0x00,0x00,0x00,0x0f, 0x48,0x00,0x00,0x0d, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x7c,0xc8,0x03,0xa6, 0x80,0x86,0x00,0x00, 0x7c,0x04,0x18,0x00, 0x41,0x82,0x00,0x4c, + 0x80,0xa6,0x00,0x04, 0x38,0xa5,0x00,0x01, 0x2c,0x05,0x00,0x03, 0x41,0x82,0x00,0x3c, + 0x90,0xa6,0x00,0x04, 0x90,0x66,0x00,0x00, 0x38,0x61,0x00,0x10, 0x3c,0xa0,0x80,0x65, + 0x38,0xa5,0x7a,0x84, 0x3c,0x80,0x80,0x65, 0x38,0x84,0x7b,0x04, 0x90,0xa1,0x00,0x10, + 0x90,0x81,0x00,0x14, 0x3c,0xe0,0x80,0x66, 0x38,0xe7,0x83,0x50, 0x38,0xe7,0xfe,0xf0, + 0x7c,0xe9,0x03,0xa6, 0x4e,0x80,0x04,0x20, 0x3c,0x80,0x80,0x1d, 0x38,0x84,0x15,0x14, + 0x7c,0x88,0x03,0xa6, 0x4e,0x80,0x00,0x21, 0x60,0x00,0x00,0x00, + // 0x88 = 136 data bytes (103%) +}; + +static BZ2Manager_t fix_51420_jap_mgr + = { fix_51420_jap_bz2, sizeof(fix_51420_jap_bz2), 0, 0 }; + +//----------------------------------------------------------------------------- + +static const u8 fix_51420_kor_bz2[] = +{ + // decompressed size: 0x88 = 136 bytes + 0x00,0x00,0x00,0x88, + + // raw data + 0x52,0x41,0x57,0x30, 0x00,0xd0,0xc0,0xde, 0x00,0xd0,0xc0,0xde, 0xc2,0x64,0x6f,0xfc, + 0x00,0x00,0x00,0x0f, 0x48,0x00,0x00,0x0d, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, + 0x7c,0xc8,0x03,0xa6, 0x80,0x86,0x00,0x00, 0x7c,0x04,0x18,0x00, 0x41,0x82,0x00,0x4c, + 0x80,0xa6,0x00,0x04, 0x38,0xa5,0x00,0x01, 0x2c,0x05,0x00,0x03, 0x41,0x82,0x00,0x3c, + 0x90,0xa6,0x00,0x04, 0x90,0x66,0x00,0x00, 0x38,0x61,0x00,0x10, 0x3c,0xa0,0x80,0x64, + 0x38,0xa5,0x67,0x30, 0x3c,0x80,0x80,0x64, 0x38,0x84,0x67,0xb0, 0x90,0xa1,0x00,0x10, + 0x90,0x81,0x00,0x14, 0x3c,0xe0,0x80,0x64, 0x38,0xe7,0x6f,0xfc, 0x38,0xe7,0xfe,0xf0, + 0x7c,0xe9,0x03,0xa6, 0x4e,0x80,0x04,0x20, 0x3c,0x80,0x80,0x1d, 0x38,0x84,0x19,0x50, + 0x7c,0x88,0x03,0xa6, 0x4e,0x80,0x00,0x21, 0x60,0x00,0x00,0x00, + // 0x88 = 136 data bytes (103%) +}; + +static BZ2Manager_t fix_51420_kor_mgr + = { fix_51420_kor_bz2, sizeof(fix_51420_kor_bz2), 0, 0 }; + +//----------------------------------------------------------------------------- + +static BZ2Manager_t * GetFix51420 ( str_mode_t mode ) +{ + switch (mode) + { + case STR_M_PAL: return &fix_51420_pal_mgr; + case STR_M_USA: return &fix_51420_usa_mgr; + case STR_M_JAP: return &fix_51420_jap_mgr; + case STR_M_KOR: return &fix_51420_kor_mgr; + default: return 0; + } +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// more data /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -5012,21 +5121,24 @@ static enumError AddSectionHelper /////////////////////////////////////////////////////////////////////////////// -static enumError ReadCodeFile ( staticr_t *str, ccp fname, u8 **data, uint *size ) +static enumError ReadCodeFile + ( staticr_t *str, ccp fname, u8 **data, uint *size, bool *alloced ) { DASSERT(str); DASSERT(fname); DASSERT(data); DASSERT(size); + DASSERT(alloced); *data = 0; *size = 0; + *alloced = false; if ( fname && fname[0] == '@' ) { BZ2Manager_t *wcm = 0; if (!strcmp(fname,"@LECODE")) wcm = GetLecodeLoader(str->mode); -// else if (!strcmp(fname,"@XXX")) wcm = GetXXXX(str->mode); + else if (!strcmp(fname,"@FIX51420")) wcm = GetFix51420(str->mode); if (wcm) { @@ -5051,6 +5163,7 @@ static enumError ReadCodeFile ( staticr_t *str, ccp fname, u8 **data, uint *size } } + *alloced = true; return ERR_OK; } @@ -5222,7 +5335,8 @@ enumError AddWCodeFile ( staticr_t *str, ccp fname ) u8 *data; uint size; - enumError err = ReadCodeFile(str,fname,&data,&size); + bool alloced; + enumError err = ReadCodeFile(str,fname,&data,&size,&alloced); if (err) return err; @@ -5237,7 +5351,8 @@ enumError AddWCodeFile ( staticr_t *str, ccp fname ) else err = ERROR0(ERR_WARNING,"Not a GCT file: %s\n",fname); - FREE(data); + if(alloced) + FREE(data); return err; } @@ -5338,12 +5453,14 @@ static uint AddSectionDOL u8 *gh_data = 0; uint gh_size = 0; - enumError err = ReadCodeFile(str,fname,&gh_data,&gh_size); + bool gh_alloced; + enumError err = ReadCodeFile(str,fname,&gh_data,&gh_size,&gh_alloced); if (err) return err; const uint stat = AddSectionGCH(str,gh_data,gh_size,fname,get_min_addr); - FREE(gh_data); + if (gh_alloced) + FREE(gh_data); return stat; } @@ -6872,6 +6989,18 @@ const data_tab_t maindol_data_tab[] = DEF_BZIP(codehandler) DEF_BZIP(codehandleronly) + #if HAVE_WIIMM_EXT + DEF_BZIP(lecode_loader_pal) + DEF_BZIP(lecode_loader_usa) + DEF_BZIP(lecode_loader_jap) + DEF_BZIP(lecode_loader_kor) + + DEF_BZIP(fix_51420_pal) + DEF_BZIP(fix_51420_usa) + DEF_BZIP(fix_51420_jap) + DEF_BZIP(fix_51420_kor) + #endif + {0,0,0} }; diff --git a/project/src/lib-std.c b/project/src/lib-std.c index 9346208..74d7cf8 100644 --- a/project/src/lib-std.c +++ b/project/src/lib-std.c @@ -3792,7 +3792,7 @@ void cmd_version_section "version=" VERSION "\n" "beta=%d\n" "revision=" REVISION "\n" - "system=" SYSTEM "\n" + "system=" SYSTEM2 "\n" "endian=%u%u%u%u %s\n" "author=" AUTHOR "\n" "date=" DATE "\n" diff --git a/project/src/lib-std.h b/project/src/lib-std.h index e049a64..2230199 100644 --- a/project/src/lib-std.h +++ b/project/src/lib-std.h @@ -56,7 +56,7 @@ #include <arpa/inet.h> #endif -#include "system.h" +#include "dclib-system.h" #include "dclib-basics.h" #include "dclib-file.h" #include "dclib-debug.h" @@ -1939,49 +1939,6 @@ valid_t IsValidCTCODE // /////////////////////////////////////////////////////////////////////////////// -/////////////// PrintScript /////////////// -/////////////////////////////////////////////////////////////////////////////// -// [[PrintScript_t]] - -typedef struct PrintScript_t -{ - File_t *fo; // pointer output file - bool add_index; // true: add index to varname - uint index; // index for array operations - char sep[2]; // separator for JSON - char prefix[100]; // varname prefix -} -PrintScript_t; - -static inline void InitializePrintScript ( PrintScript_t *ps ) - { DASSERT(ps); memset(ps,0,sizeof(*ps)); } - -static inline void ResetPrintScript ( PrintScript_t *ps ) - { DASSERT(ps); memset(ps,0,sizeof(*ps)); } - -/////////////////////////////////////////////////////////////////////////////// - -void PrintScriptHeader ( PrintScript_t *ps ); -void PrintScriptFooter ( PrintScript_t *ps ); - -int PutScriptVars -( - PrintScript_t *ps, // valid control struct - uint mode, // bit field: 1=open var, 2:close var - ccp text // text with line of format NAME=VALUE -); - -int PrintScriptVars -( - PrintScript_t *ps, // valid control struct - uint mode, // bit field: 1=open var, 2:close var - ccp format, // format of message - ... // arguments -) -__attribute__ ((__format__(__printf__,3,4))); - -// -/////////////////////////////////////////////////////////////////////////////// /////////////// misc /////////////// /////////////////////////////////////////////////////////////////////////////// // [[IsArena_t]] diff --git a/project/src/lib-szs-create.c b/project/src/lib-szs-create.c index ccf4f1d..007d2cb 100644 --- a/project/src/lib-szs-create.c +++ b/project/src/lib-szs-create.c @@ -1519,7 +1519,7 @@ bool NormalizeExSZS memset(&norm,0,sizeof(norm)); norm.rm_aiparam = rm_aiparam; norm.clean_lex = clean_lex; - IterateFilesSZS(szs,norm_collect_func,&norm,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,norm_collect_func,&norm,false,false,0,-1,SORT_NONE); if (autoadd) AddMissingFiles(szs,0,0,&norm,2); @@ -2643,7 +2643,7 @@ bool PatchSZS ( szs_file_t * szs ) { PRINT("** PatchSZS() **\n"); ScanTformBegin(); - IterateFilesSZS(szs,transform_collect_func,&dirty,false,-1,-1,SORT_NONE); + IterateFilesParSZS(szs,transform_collect_func,&dirty,false,false,-1,-1,SORT_NONE); TformScriptEnd(); ClearSpecialFilesSZS(szs); } @@ -2965,7 +2965,7 @@ static int check_file_func // [[fname+]] InitializeSubSZS(&subszs,it->szs,it->off,it->size,fform,it->path,false); subszs.fname = it->path; - IterateFilesSZS(&subszs,check_mdl_func,chk,true,0,1,SORT_NONE); + IterateFilesParSZS(&subszs,check_mdl_func,chk,false,true,0,1,SORT_NONE); subszs.fname = 0; ResetSZS(&subszs); } @@ -3117,7 +3117,7 @@ int CheckSZS //--- check BRRES + BRSUB - IterateFilesSZS(szs,check_brres_func,&chk,false,-1,0,SORT_AUTO); + IterateFilesParSZS(szs,check_brres_func,&chk,false,false,-1,0,SORT_AUTO); //--- find KCL @@ -3377,7 +3377,7 @@ int CheckSZS //--- check images - IterateFilesSZS(szs,check_file_func,&chk,false,-1,0,SORT_AUTO); + IterateFilesParSZS(szs,check_file_func,&chk,false,false,-1,0,SORT_AUTO); if (chk.img_count) print_check_error( &chk, CMOD_INFO, "Geometry of %u images checked.\n",chk.img_count); @@ -3666,7 +3666,7 @@ int CheckBRRES SetupColorSet(&chk.col,stdlog); chk.szs = szs; chk.mode = check_mode; - IterateFilesSZS(szs,check_brres,&chk,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,check_brres,&chk,false,false,0,-1,SORT_NONE); if (parent_chk) { @@ -4621,7 +4621,7 @@ enumError ExtractFilesSZS ? 1 : recurse_level || IsArchiveFF(szs->fform_arch) ? -1 : 0; PRINT("cut_files=%d\n",cut_files); - IterateFilesSZS(szs,extract_func,&ep,false,0,cut_files,SORT_NONE); + IterateFilesParSZS(szs,extract_func,&ep,true,false,0,cut_files,SORT_NONE); //----- write setup file diff --git a/project/src/lib-szs.c b/project/src/lib-szs.c index e002da5..bea7884 100644 --- a/project/src/lib-szs.c +++ b/project/src/lib-szs.c @@ -1845,13 +1845,13 @@ static void iterate_wu8 wu8_info_t *wu8 // valud wu8 ) { - IterateFilesSZS(szs,code_wu8_pass_1,wu8,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,code_wu8_pass_1,wu8,false,false,0,-1,SORT_NONE); PRINT("PASS1-COUNT = %d, ERR-COUNT = %d\n",wu8->pass1_count,wu8->err_count); if (!wu8->err_count) { if (!wu8->pass1_count) load_wu8(wu8,"itembox.brres",0); - IterateFilesSZS(szs,code_wu8_pass_2,wu8,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,code_wu8_pass_2,wu8,false,false,0,-1,SORT_NONE); } } @@ -2406,7 +2406,7 @@ enumError CreateU8 if ( logging > 0 ) { printf("----- internal file list -----\n"); - IterateFilesSZS(szs,PrintFileSZS,0,true,0,0,SORT_NONE); + IterateFilesParSZS(szs,PrintFileSZS,0,false,true,0,0,SORT_NONE); printf("------------------------------\n"); } @@ -2641,7 +2641,7 @@ enumError ExtractSZS eszs->szs_found = true; eszs->subpath = subpath + 1; eszs->subpath_len = strlen(eszs->subpath); - IterateFilesSZS(&szs,extract_data_func,eszs,false,0,-1,SORT_NONE); + IterateFilesParSZS(&szs,extract_data_func,eszs,false,false,0,-1,SORT_NONE); PRINT("### FOUND: lev=%d n=%d off=%x siz=%x %s\n", eszs->exlevel, eszs->found_count, @@ -2916,7 +2916,11 @@ int IterateFilesU8 //----- cut files? + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->index = 0; it->fst_item = 0; @@ -2955,7 +2959,11 @@ int IterateFilesU8 int stat = 0; const u8_node_t *fst; + #if USE_ITERATOR_PARAM + for ( fst = fst_base + !it->itpar.show_root_node; fst < fst_end && !stat; fst++ ) + #else for ( fst = fst_base + !it->show_root_node; fst < fst_end && !stat; fst++ ) + #endif { while ( fst >= dir_end && stack > stack_buf ) { @@ -2968,9 +2976,27 @@ int IterateFilesU8 ccp fname = (ccp)fst_end + (ntohl(fst->name_off)&0xffffff); it->name = fname; - char * path_dest = it->trail_path = path_ptr; + char *path_dest = it->trail_path = path_ptr; + #if USE_ITERATOR_PARAM + while ( path_dest < path_end && *fname ) + { + const char ch = *fname++; + if ( ch != '\\' && ch != '/' || !it->itpar.clean_path ) + *path_dest++ = ch; + } + if ( it->itpar.clean_path && path_dest == path_ptr+2 + && path_ptr[0] == '.' && path_ptr[1] == '.' ) + path_dest--; + #else while ( path_dest < path_end && *fname ) - *path_dest++ = *fname++; + { + const char ch = *fname++; + if ( ch != '\\' && ch != '/' || !it->clean_path ) + *path_dest++ = ch; + } + if ( it->clean_path && path_dest == path_ptr+2 && path_ptr[0] == '.' && path_ptr[1] == '.' ) + path_dest--; + #endif it->index = fst - fst_base; it->fst_item = (u8_node_t*)fst; @@ -3137,7 +3163,11 @@ static int iterate_sort_files return 0; } + #if USE_ITERATOR_PARAM + SortSubFilesSZS(it->szs,it->itpar.sort_mode); + #else SortSubFilesSZS(it->szs,it->sort_mode); + #endif const szs_subfile_t * ptr = it->szs->subfile.list; const szs_subfile_t * end = ptr + it->szs->subfile.used; @@ -3212,9 +3242,17 @@ static int iterate_sub_files szs_iterator_func it_func = 0; if ( it->recurse_level < it->recurse_max ) { + #if USE_ITERATOR_PARAM + it_func = GetIteratorFunction(fform,it->itpar.cut_files); + #else it_func = GetIteratorFunction(fform,it->cut_files); + #endif } + #if USE_ITERATOR_PARAM + else if ( it->itpar.cut_files ) + #else else if ( it->cut_files ) + #endif { it_func = GetIteratorFunction(fform,true); if (GetIteratorFunction(fform,false)) @@ -3262,6 +3300,71 @@ int IterateFilesSZS szs_file_t * szs, // valid szs szs_iterator_func func, // call back function void * param, // user defined parameter + const iterator_param_t + *p_itpar, // NULL or iteration parameters + int recurse // 0:off, <0:unlimited, >0:max depth +) +{ + DASSERT(szs); + DASSERT(func); + + iterator_param_t itpar; + if (p_itpar) + memcpy(&itpar,p_itpar,sizeof(itpar)); + else + memset(&itpar,0,sizeof(itpar)); + + PRINT("IterateFilesParSZS(ipar=%d,clean=%d,rec=%d,cut=%d,sort=%d) ff=%s\n", + p_itpar!=0, itpar.clean_path, recurse, itpar.cut_files, itpar.sort_mode, + GetNameFF(szs->fform_file,szs->fform_arch)); + + szs_iterator_func ifunc + = GetIteratorFunction( szs->fform_arch, itpar.cut_files>=0 ); + if (!ifunc) + return -1; + + if ( itpar.sort_mode == SORT_NONE && IsBRSUB(szs->fform_arch) ) + itpar.sort_mode = SORT_OFFSET; + const bool sort_files = itpar.sort_mode != SORT_NONE; + if ( sort_files && szs->subfile.used ) + ResetFileSZS(szs,false); + + szs_iterator_t it = {0}; + it.szs = szs; + #if USE_ITERATOR_PARAM + it.itpar = itpar; + #else + it.cut_files = itpar->cut_files > 0; + it.sort_mode = itpar->sort_mode; + it.clean_path = itpar->clean_path; + it.show_root_node = itpar->show_root_node; + #endif + + it.func_sub = func; + it.func_sort = recurse || itpar.cut_files ? iterate_sub_files : func; + it.func_it = sort_files ? iterate_sort_files : it.func_sort; + it.param = param; + it.endian = &be_func; + it.recurse_max = recurse >= 0 ? recurse : INT_MAX; + it.group = GROUP_INVALID; + it.entry = ENTRY_INVALID; + + const int stat = ifunc(&it,false); + it.name = 0; + *it.path = 0; + const int stat_term = it.func_it(&it,true); + return stat ? stat : stat_term; +} + +/////////////////////////////////////////////////////////////////////////////// +// [[IterateFilesParSZS]] + +int IterateFilesParSZS +( + szs_file_t * szs, // valid szs + szs_iterator_func func, // call back function + void * param, // user defined parameter + bool clean_path, // true: clean path from ../ and more bool show_root_node, // true: include root node in iteration int recurse, // 0:off, <0:unlimited, >0:max depth int cut_files, // <0:never, =0:auto(first level), >0:always @@ -3271,10 +3374,19 @@ int IterateFilesSZS DASSERT(szs); DASSERT(func); - PRINT("IterateFilesSZS(rec=%d,cut=%d,sort=%d) ff=%s\n", - recurse, cut_files, sort_mode, + #if USE_ITERATOR_PARAM + iterator_param_t itpar = {0}; + itpar.cut_files = cut_files > 0; + itpar.sort_mode = sort_mode; + itpar.clean_path = clean_path; + itpar.show_root_node = show_root_node; + return IterateFilesSZS(szs,func,param,&itpar,recurse); + #else + PRINT("IterateFilesParSZS(clean=%d,rec=%d,cut=%d,sort=%d) ff=%s\n", + clean_path,recurse, cut_files, sort_mode, GetNameFF(szs->fform_file,szs->fform_arch)); + szs_iterator_func ifunc = GetIteratorFunction(szs->fform_arch,cut_files>=0); if (!ifunc) return -1; @@ -3285,8 +3397,7 @@ int IterateFilesSZS if ( sort_files && szs->subfile.used ) ResetFileSZS(szs,false); - szs_iterator_t it; - memset(&it,0,sizeof(it)); + szs_iterator_t it = {0}; it.szs = szs; it.cut_files = cut_files > 0; it.sort_mode = sort_mode; @@ -3295,6 +3406,7 @@ int IterateFilesSZS it.func_it = sort_files ? iterate_sort_files : it.func_sort; it.param = param; it.endian = &be_func; + it.clean_path = clean_path; it.show_root_node = show_root_node; it.recurse_max = recurse >= 0 ? recurse : INT_MAX; it.group = GROUP_INVALID; @@ -3305,6 +3417,7 @@ int IterateFilesSZS *it.path = 0; const int stat_term = it.func_it(&it,true); return stat ? stat : stat_term; + #endif } /////////////////////////////////////////////////////////////////////////////// @@ -3431,10 +3544,10 @@ uint CollectFilesSZS cr.szs = szs; cr.path_end = cr.path; cr.last_path = EmptyString; - IterateFilesSZS(szs,collect_r_func,&cr,false,recurse,cut_files,SORT_NONE); + IterateFilesParSZS(szs,collect_r_func,&cr,false,false,recurse,cut_files,SORT_NONE); } else - IterateFilesSZS(szs,collect_func,0,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,collect_func,0,false,false,0,-1,SORT_NONE); SortSubFilesSZS(szs,sort_mode); noPRINT("%d/%d files collected.\n", szs->subfile.used - base, szs->subfile.used ); @@ -3460,7 +3573,7 @@ int IterateFilesData szs_file_t szs; AssignSZS(&szs,true,(u8*)data,data_size,false,fform,fname); const int stat - = IterateFilesSZS ( &szs, func, param, true, -1, 1, SORT_OFFSET ); + = IterateFilesParSZS ( &szs, func, param, false, true, -1, 1, SORT_OFFSET ); ResetSZS(&szs); return stat; } @@ -3567,7 +3680,11 @@ int CutFilesBRSUB (brsub_header_t*)data,n_grp,it->endian); u32 name_off = bcut.endian->rd32(data+brsub_header_size-4); ccp name_str = GETSTR(name_off,0); + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { it->name = name_str; stat = func(&bcut,GROUP_IDX_BRSUB_HEADER,ENTRY_IDX_ETC); @@ -3615,7 +3732,11 @@ int CutFilesBRSUB if ( x_size > bg_size ) goto plain; + #if USE_ITERATOR_PARAM + if (it->itpar.cut_files) + #else if (it->cut_files) + #endif { bcut.path_end = it->path + snprintf(it->path,sizeof(it->path),".%s.s%0*u%s.header.n%u.bin", @@ -3629,8 +3750,17 @@ int CutFilesBRSUB bcut.eptr = bcut.gptr->entry + 1; int cur_entry; + const u8* max_eptr = bcut.data + bcut.size - sizeof(*bcut.eptr); for ( cur_entry = 0; cur_entry < bg_n_entry; cur_entry++, bcut.eptr++ ) { + if ( (u8*)bcut.eptr > max_eptr ) + { + ERROR0(ERR_WARNING, + "Invalid offset for BRSUB file => %u of %u entries ignored: %s%s%s\n", + bg_n_entry - cur_entry, bg_n_entry, + it->szs->fname, *it->szs->fname ? "/" : "", it->path ); + break; + } u32 data_off = bcut.endian->rd32(&bcut.eptr->data_off); u32 name_off = bcut.endian->rd32(&bcut.eptr->name_off); ccp name_ptr = GETSTR(name_off+((u8*)bcut.gptr-data),""); @@ -3698,7 +3828,11 @@ int CutFilesBRSUB } } + #if USE_ITERATOR_PARAM + if ( it->itpar.cut_files && bcut.brsub_size < bcut.size ) + #else if ( it->cut_files && bcut.brsub_size < bcut.size ) + #endif { it->off = bcut.brsub_size; it->size = bcut.size - bcut.brsub_size; diff --git a/project/src/lib-szs.h b/project/src/lib-szs.h index eff7eed..aac60b8 100644 --- a/project/src/lib-szs.h +++ b/project/src/lib-szs.h @@ -773,6 +773,20 @@ typedef int (*szs_iterator_func) ); //----------------------------------------------------------------------------- +// [[iterator_param_t]] + +typedef struct iterator_param_t +{ + bool clean_path; // true: clean path + bool show_root_node; // true: show root node + bool cut_files; // true: cut files into peaces + SortMode_t sort_mode; // sort files +} +iterator_param_t; + +#define USE_ITERATOR_PARAM 1 + +//----------------------------------------------------------------------------- // [[szs_iterator_t]] typedef struct szs_iterator_t @@ -781,9 +795,14 @@ typedef struct szs_iterator_t szs_file_t * szs; // valid szs pointer const endian_func_t * endian; // endian functions + #if USE_ITERATOR_PARAM + iterator_param_t itpar; // global parameters + #else + bool clean_path; // true: clean path bool show_root_node; // true: show root node bool cut_files; // true: cut files into peaces SortMode_t sort_mode; // sort files + #endif //--- client values @@ -830,8 +849,8 @@ typedef struct szs_iterator_t int brsub_version; // 0 or version of parent brsub file s16 group; // group index, type grp_entry_t s16 entry; // entry index, type grp_entry_t - -} szs_iterator_t; +} +szs_iterator_t; //----------------------------------------------------------------------------- @@ -852,6 +871,17 @@ int IterateFilesSZS szs_file_t * szs, // valid szs szs_iterator_func func, // call back function void * param, // user defined parameter + const iterator_param_t + *p_itpar, // NULL or iteration parameters + int recurse // 0:off, <0:unlimited, >0:max depth +); + +int IterateFilesParSZS +( + szs_file_t * szs, // valid szs + szs_iterator_func func, // call back function + void * param, // user defined parameter + bool clean_path, // true: clean path from ../ and more bool show_root_node, // true: include root node in iteration int recurse, // 0:off, <0:unlimited, >0:max depth int cut_files, // <0:never, =0:auto(first level), >0:always diff --git a/project/src/lib-xbmg.c b/project/src/lib-xbmg.c index 2648091..8eb09ce 100644 --- a/project/src/lib-xbmg.c +++ b/project/src/lib-xbmg.c @@ -323,7 +323,7 @@ enumError LoadXBMG if ( allow_archive && IsArchiveFF(szs.fform_arch) ) { bmg->src_is_arch = true; - IterateFilesSZS(&szs,read_bmg,bmg,false,0,-1,SORT_NONE); + IterateFilesParSZS(&szs,read_bmg,bmg,false,false,0,-1,SORT_NONE); bmg->fname = szs.fname; szs.fname = 0; ResetSZS(&szs); @@ -380,7 +380,7 @@ enumError ScanRawDataBMG AssignSZS(&szs,true,raw->data,raw->data_size,false,raw->fform,bmg->fname); szs.fname = raw->fname; raw->fname = 0; - IterateFilesSZS(&szs,read_bmg,bmg,false,0,-1,SORT_NONE); + IterateFilesParSZS(&szs,read_bmg,bmg,false,false,0,-1,SORT_NONE); bmg->fname = szs.fname; szs.fname = 0; noPRINT("BMG/FNAME=%s\n",bmg->fname); @@ -1402,6 +1402,22 @@ enumError cmd_bmg_identifier() /////////////// scan options /////////////// /////////////////////////////////////////////////////////////////////////////// +int ScanOptBmgEndian ( ccp arg ) +{ + const KeywordTab_t *cmd = ScanKeyword(0,arg,TabEndianBMG); + if (!cmd) + { + ERROR0(ERR_SYNTAX, + "Option --bmg-endian: Invalid mode: '%s'\n",arg); + return 1; + } + + opt_bmg_endian = cmd->id; + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// + int ScanOptBmgEncoding ( ccp arg ) { const KeywordTab_t *cmd = ScanKeyword(0,arg,TabEncodingBMG); diff --git a/project/src/lib-xbmg.h b/project/src/lib-xbmg.h index 6c16316..cdc40fa 100644 --- a/project/src/lib-xbmg.h +++ b/project/src/lib-xbmg.h @@ -122,6 +122,7 @@ enumError DiffBMG //----------------------------------------------------------------------------- +int ScanOptBmgEndian ( ccp arg ); int ScanOptBmgEncoding ( ccp arg ); int ScanOptBmgInfSize ( ccp arg, bool is_wbmgt ); int ScanOptBmgMid ( ccp arg ); diff --git a/project/src/system.h b/project/src/system.h deleted file mode 100644 index 375c75d..0000000 --- a/project/src/system.h +++ /dev/null @@ -1,88 +0,0 @@ - -/*************************************************************************** - * _______ _______ _______ * - * | ___ |____ | ___ | * - * | | |_| / /| | |_| * - * | |_____ / / | |_____ * - * |_____ | / / |_____ | * - * _ | | / / _ | | * - * | |___| |/ /____| |___| | * - * |_______|_______|_______| * - * * - * Wiimms SZS Tools * - * https://szs.wiimm.de/ * - * * - *************************************************************************** - * * - * This file is part of the SZS project. * - * Visit https://szs.wiimm.de/ for project details and sources. * - * * - * Copyright (c) 2011-2020 by Dirk Clemens <wiimm@wiimm.de> * - * * - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * See file gpl-2.0.txt or http://www.gnu.org/licenses/gpl-2.0.txt * - * * - ***************************************************************************/ - -#ifndef SZS_SYSTEM_H -#define SZS_SYSTEM_H 1 - -/////////////////////////////////////////////////////////////////////////////// - -typedef enum enumSystemID -{ - SYSID_UNKNOWN = 0x00000000, - SYSID_I386 = 0x01000000, - SYSID_X86_64 = 0x02000000, - SYSID_CYGWIN = 0x03000000, - SYSID_APPLE = 0x04000000, - SYSID_LINUX = 0x05000000, - SYSID_UNIX = 0x06000000, - -} enumSystemID; - -/////////////////////////////////////////////////////////////////////////////// - -#undef SYSTEM_LINUX - -#ifdef __CYGWIN__ - #define SYSTEM "cygwin" - #define SYSTEMID SYSID_CYGWIN -#elif __APPLE__ - #define SYSTEM "mac" - #define SYSTEMID SYSID_APPLE -#elif __linux__ - #define SYSTEM_LINUX 1 - #ifdef __i386__ - #define SYSTEM "i386" - #define SYSTEMID SYSID_I386 - #elif __x86_64__ - #define SYSTEM "x86_64" - #define SYSTEMID SYSID_X86_64 - #else - #define SYSTEM "linux" - #define SYSTEMID SYSID_LINUX - #endif -#elif __unix__ - #define SYSTEM "unix" - #define SYSTEMID SYSID_UNIX -#else - #define SYSTEM "unknown" - #define SYSTEMID SYSID_UNKNOWN -#endif - -/////////////////////////////////////////////////////////////////////////////// - -#endif // SZS_SYSTEM_H 1 - diff --git a/project/src/ui/tab-wbmgt.inc b/project/src/ui/tab-wbmgt.inc index 86eb2ba..f16a615 100644 --- a/project/src/ui/tab-wbmgt.inc +++ b/project/src/ui/tab-wbmgt.inc @@ -337,6 +337,9 @@ { T_OPT_CMP, "FILTER_BMG", "filter-bmg|filterbmg|fb|msg", 0, 0 /* copy of wszst */ }, + { T_OPT_CP, "BMG_ENDIAN", "endian|bmg-endian|bmgendian", + 0, 0 /* copy of wszst */ }, + { T_OPT_CP, "BMG_ENCODING", "encoding|bmg-encoding|bmgencoding", 0, 0 /* copy of wszst */ }, @@ -406,6 +409,8 @@ { T_COPT, "NO_HEADER", 0,0,0 }, { T_COPT, "BRIEF", 0,0,0 }, + { T_SEP_OPT, 0,0,0,0 }, + { T_COPT, "BMG_ENDIAN", 0,0,0 }, { T_COPT, "BMG_ENCODING", 0,0,0 }, { T_COPT, "BMG_INF_SIZE", 0,0,0 }, { T_COPT, "BMG_MID", 0,0,0 }, @@ -578,6 +583,8 @@ { T_CMD_BEG, "ENCODE", 0,0,0 }, { T_COPY_GRP, "DEST", 0,0,0 }, + { T_SEP_OPT, 0,0,0,0 }, + { T_COPT, "BMG_ENDIAN", 0,0,0 }, { T_COPT, "BMG_ENCODING", 0,0,0 }, { T_COPT, "BMG_INF_SIZE", 0,0,0 }, { T_COPT, "BMG_MID", 0,0,0 }, diff --git a/project/src/ui/tab-wctct.inc b/project/src/ui/tab-wctct.inc index 1a4c166..af35de7 100644 --- a/project/src/ui/tab-wctct.inc +++ b/project/src/ui/tab-wctct.inc @@ -248,6 +248,9 @@ 0, "Print BMG messages as UTF-8 text without escape sequences." }, + { T_OPT_CP, "BMG_ENDIAN", "bmg-endian|bmgendian", + 0, 0 /* copy of wszst */ }, + { T_OPT_CP, "BMG_ENCODING", "bmg-encoding|bmgencoding", 0, 0 /* copy of wszst */ }, @@ -669,6 +672,7 @@ " If set, cup names are exported too as MID 4200-423F." " If set twice, cup/track relations are also exported as MID 4300-43FF."}, { T_COPY_GRP, "TEXTOUT", 0,0,0 }, + { T_COPT, "BMG_ENDIAN", 0,0,0 }, { T_COPT, "BMG_ENCODING", 0,0,0 }, { T_COPT, "BMG_INF_SIZE", 0,0,0 }, { T_COPT, "BMG_MID", 0,0,0 }, @@ -733,6 +737,7 @@ { T_COPY_GRP, "DEST", 0,0,0 }, { T_COPT, "IGNORE", 0,0,0 }, { T_COPY_GRP, "TEXTOPT", 0,0,0 }, + { T_COPT, "BMG_ENDIAN", 0,0,0 }, { T_COPT, "BMG_ENCODING", 0,0,0 }, { T_COPT, "BMG_INF_SIZE", 0,0,0 }, { T_COPT, "BMG_MID", 0,0,0 }, diff --git a/project/src/ui/tab-wlect.inc b/project/src/ui/tab-wlect.inc index 1eec891..e4b4772 100644 --- a/project/src/ui/tab-wlect.inc +++ b/project/src/ui/tab-wlect.inc @@ -260,6 +260,9 @@ 0, "Print BMG messages as UTF-8 text without escape sequences." }, + { T_OPT_CP, "BMG_ENDIAN", "bmg-endian|bmgendian", + 0, 0 /* copy of wszst */ }, + { T_OPT_CP, "BMG_ENCODING", "bmg-encoding|bmgencoding", 0, 0 /* copy of wszst */ }, @@ -436,8 +439,9 @@ "[=mode]", "Enable or disable the performance monitor." " Mode is one of @OFF@, @AUTO@ (default, don't change setting)," - " @ON@ (enable it for Wii only; default, if option is used without parameter)" - " or @FORCE@ (enable it for Wii and for Dolphin)." }, + " @ON@ (enable it for Wii and Wii U only;" + " default, if option is used without parameter)" + " or @FORCE@ (enable it for Wii, Wii U and for Dolphin)." }, { T_OPT_CO, "CUSTOM_TT", "custom-tt|customtt", "[=mode]", @@ -452,6 +456,29 @@ " (default, if option is used without parameter)." " Disable it only for tests!" }, + { T_OPT_CO, "SPEEDOMETER", "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)." }, + + { 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." }, + + { H_OPT_CP, "RESERVED_1BB", "reserved-1bb|reserved1bb", + "[=mode]", + "Set LPAR byte at offset 0x1bb to this value." + " Value -1 disables this option." }, + { T_SEP_OPT, 0,0,0,0 }, //----- separator ----- { T_OPT_CP, "TRACK_DIR", "track-dir|trackdir", @@ -582,18 +609,28 @@ { T_COPT, "UPDATE", 0,0,0 }, { T_COPT, "PRESERVE", 0,0,0 }, - //---------- wlect GROUP PATCH ---------- + //---------- wlect GROUP PARAM ---------- - { T_GRP_BEG, "PATCH", 0,0,0 }, + { T_GRP_BEG, "PARAM", 0,0,0 }, - { T_COPT, "LE_DEFINE", 0,0,0 }, - { T_COPT, "LPAR", 0,0,0 }, - { T_COPT, "ALIAS", 0,0,0 }, { T_COPT, "ENGINE", 0,0,0 }, { T_COPT, "200CC", 0,0,0 }, { T_COPT, "PERFMON", 0,0,0 }, { 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 }, + + //---------- wlect GROUP PATCH ---------- + + { T_GRP_BEG, "PATCH", 0,0,0 }, + + { T_COPT, "LE_DEFINE", 0,0,0 }, + { T_COPT, "LPAR", 0,0,0 }, + { T_COPT, "ALIAS", 0,0,0 }, + { T_COPY_GRP, "PARAM", 0,0,0 }, //---------- wlect GROUP PATCH_LEX ---------- @@ -797,6 +834,7 @@ { T_COPT, "NO_ECHO", 0,0,0 }, { T_COPY_GRP, "DEST", 0,0,0 }, { T_COPT, "LPAR", 0,0,0 }, + { T_SEP_OPT, 0,0,0,0 }, { T_COPT, "LT_CLEAR", 0,0,0 }, { T_COPT, "LT_ONLINE", 0,0,0 }, { T_COPT, "LT_N_PLAYERS", 0,0,0 }, @@ -805,6 +843,8 @@ { T_COPT, "LT_ENGINE", 0,0,0 }, { T_COPT, "LT_RANDOM", 0,0,0 }, { T_COPT, "LEX_PURGE", 0,0,0 }, + { T_SEP_OPT, 0,0,0,0 }, + { T_COPY_GRP, "PARAM", 0,0,0 }, //---------- COMMAND wlect CAT ---------- diff --git a/project/src/ui/tab-wszst.inc b/project/src/ui/tab-wszst.inc index e8f85a2..e84695d 100644 --- a/project/src/ui/tab-wszst.inc +++ b/project/src/ui/tab-wszst.inc @@ -1522,10 +1522,19 @@ " if their difference is less than or equal to epsilon." " The default value is @" CONVERT_TO_STRING(DEF_EPSILON_POS) "@." }, + { T_OPT_CP, "BMG_ENDIAN", "bmg-endian|bmgendian", + "name", + "Force an endian for new BMG files." + " Accepted values are @BIG@ or @BE@ for big endian, @LITTLE@ or @LE@" + " for little endian and @AUTO@ for automatic detection (default)." + "\n " + " Mario Kart Wii uses big endian;" + " the default if no other endian is defined." }, + { T_OPT_CP, "BMG_ENCODING", "bmg-encoding|bmgencoding", "name", - "Force a BMG encoding for new BMG files." - " Accepted encoding names are: @CP-1252@, @UTF-16BE@ (or @UTF-16@)," + "Force an encoding for new BMG files." + " Accepted encoding names are @CP-1252@, @UTF-16BE@ (or @UTF-16@)," " @SHIFT-JIS@, @UTF-8@ and @AUTO@ for automatic detection (default)." " Same keywords without minus signs are accepted too." "\n " @@ -2400,6 +2409,7 @@ { T_GRP_BEG, "BMG", 0,0,0 }, + { T_COPT, "BMG_ENDIAN", 0,0,0 }, { T_COPT, "BMG_ENCODING", 0,0,0 }, { T_COPT, "BMG_INF_SIZE", 0,0,0 }, { T_COPT, "BMG_MID", 0,0,0 }, diff --git a/project/src/ui/ui-wbmgt.c b/project/src/ui/ui-wbmgt.c index b3836f2..1a6c522 100644 --- a/project/src/ui/ui-wbmgt.c +++ b/project/src/ui/ui-wbmgt.c @@ -186,9 +186,18 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " Read https://szs.wiimm.de/opt/filter-bmg for more details." }, + { OPT_BMG_ENDIAN, false, false, false, false, false, 0, "endian", + "name", + "Force an endian for new BMG files. Accepted values are BIG or BE for" + " big endian, LITTLE or LE for little endian and AUTO for automatic" + " detection (default).\n" + " Mario Kart Wii uses big endian; the default if no other endian is" + " defined." + }, + { OPT_BMG_ENCODING, false, false, false, false, false, 0, "encoding", "name", - "Force a BMG encoding for new BMG files. Accepted encoding names are:" + "Force an encoding for new BMG files. Accepted encoding names are" " CP-1252, UTF-16BE (or UTF-16), SHIFT-JIS, UTF-8 and AUTO for" " automatic detection (default). Same keywords without minus signs are" " accepted too.\n" @@ -284,7 +293,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 == 31 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 32 //----- global options ----- @@ -506,7 +515,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 == 60 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 61 }; @@ -694,6 +703,9 @@ static const struct option OptionLong[] = { "filterbmg", 1, 0, GO_FILTER_BMG }, { "fb", 1, 0, GO_FILTER_BMG }, { "msg", 1, 0, GO_FILTER_BMG }, + { "endian", 1, 0, GO_BMG_ENDIAN }, + { "bmg-endian", 1, 0, GO_BMG_ENDIAN }, + { "bmgendian", 1, 0, GO_BMG_ENDIAN }, { "encoding", 1, 0, GO_BMG_ENCODING }, { "bmg-encoding", 1, 0, GO_BMG_ENCODING }, { "bmgencoding", 1, 0, GO_BMG_ENCODING }, @@ -801,19 +813,20 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x094 */ OPT_ALIGN, /* 0x095 */ OPT_MACRO_BMG, /* 0x096 */ OPT_FILTER_BMG, - /* 0x097 */ OPT_BMG_ENCODING, - /* 0x098 */ OPT_BMG_INF_SIZE, - /* 0x099 */ OPT_BMG_MID, - /* 0x09a */ OPT_FORCE_ATTRIB, - /* 0x09b */ OPT_DEF_ATTRIB, - /* 0x09c */ OPT_NO_ATTRIB, - /* 0x09d */ OPT_X_ESCAPES, - /* 0x09e */ OPT_OLD_ESCAPES, - /* 0x09f */ OPT_NO_BMG_COLORS, - /* 0x0a0 */ OPT_BMG_COLORS, - /* 0x0a1 */ OPT_NO_BMG_INLINE, - /* 0x0a2 */ OPT_SECTIONS, - /* 0x0a3 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0, + /* 0x097 */ OPT_BMG_ENDIAN, + /* 0x098 */ OPT_BMG_ENCODING, + /* 0x099 */ OPT_BMG_INF_SIZE, + /* 0x09a */ OPT_BMG_MID, + /* 0x09b */ OPT_FORCE_ATTRIB, + /* 0x09c */ OPT_DEF_ATTRIB, + /* 0x09d */ OPT_NO_ATTRIB, + /* 0x09e */ OPT_X_ESCAPES, + /* 0x09f */ OPT_OLD_ESCAPES, + /* 0x0a0 */ OPT_NO_BMG_COLORS, + /* 0x0a1 */ OPT_BMG_COLORS, + /* 0x0a2 */ OPT_NO_BMG_INLINE, + /* 0x0a3 */ OPT_SECTIONS, + /* 0x0a4 */ 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, /* 0x0d0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -829,130 +842,130 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[31] = // cmd #1 +static u8 option_allowed_cmd_VERSION[32] = // cmd #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,0, 0,0,0,0,0, - 1 + 0,1 }; -static u8 option_allowed_cmd_HELP[31] = // cmd #2 +static u8 option_allowed_cmd_HELP[32] = // 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 }; -static u8 option_allowed_cmd_ARGTEST[31] = // cmd #3 +static u8 option_allowed_cmd_ARGTEST[32] = // cmd #3 { 1,1,1,1,1, 1,1,1,1,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[31] = // cmd #4 +static u8 option_allowed_cmd_TEST[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,1 }; -static u8 option_allowed_cmd_COLORS[31] = // cmd #5 +static u8 option_allowed_cmd_COLORS[32] = // cmd #5 { 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 }; -static u8 option_allowed_cmd_ERROR[31] = // cmd #6 +static u8 option_allowed_cmd_ERROR[32] = // cmd #6 { 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,1 }; -static u8 option_allowed_cmd_FILETYPE[31] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[32] = // cmd #7 { 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,0 }; -static u8 option_allowed_cmd_FILEATTRIB[31] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[32] = // 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 }; -static u8 option_allowed_cmd_POINTS[31] = // cmd #9 +static u8 option_allowed_cmd_POINTS[32] = // cmd #9 { 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 }; -static u8 option_allowed_cmd_REGEXP[31] = // cmd #10 +static u8 option_allowed_cmd_REGEXP[32] = // 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 }; -static u8 option_allowed_cmd_EXTRACT[31] = // cmd #11 +static u8 option_allowed_cmd_EXTRACT[32] = // cmd #11 { 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 }; -static u8 option_allowed_cmd_SECTIONS[31] = // cmd #12 +static u8 option_allowed_cmd_SECTIONS[32] = // cmd #12 { 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_LIST[31] = // cmd #13 +static u8 option_allowed_cmd_LIST[32] = // cmd #13 { 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,0 }; -static u8 option_allowed_cmd_SLOTS[31] = // cmd #14 +static u8 option_allowed_cmd_SLOTS[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,0 }; -static u8 option_allowed_cmd_DIFF[31] = // cmd #15 +static u8 option_allowed_cmd_DIFF[32] = // cmd #15 { 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,0 }; -static u8 option_allowed_cmd_CAT[31] = // cmd #16 +static u8 option_allowed_cmd_CAT[32] = // cmd #16 { 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, - 0 + 1,0 }; -static u8 option_allowed_cmd_MIX[31] = // cmd #17 +static u8 option_allowed_cmd_MIX[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, - 0 + 1,0 }; -static u8 option_allowed_cmd_IDENTIFIER[31] = // cmd #18 +static u8 option_allowed_cmd_IDENTIFIER[32] = // cmd #18 { 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, - 0 + 1,0 }; -static u8 option_allowed_cmd_DECODE[31] = // cmd #19 +static u8 option_allowed_cmd_DECODE[32] = // cmd #19 { 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, - 0 + 1,0 }; -static u8 option_allowed_cmd_ENCODE[31] = // cmd #20 +static u8 option_allowed_cmd_ENCODE[32] = // cmd #20 { - 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,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,0,0,0, 0,0,0,0,0, + 0,0 }; -static u8 option_allowed_cmd_PATCH[31] = // cmd #21 +static u8 option_allowed_cmd_PATCH[32] = // cmd #21 { 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, - 0 + 1,0 }; @@ -1123,6 +1136,10 @@ static const InfoOption_t * option_tab_cmd_CAT[] = { OptionInfo + OPT_NO_HEADER, OptionInfo + OPT_BRIEF, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1149,6 +1166,10 @@ static const InfoOption_t * option_tab_cmd_MIX[] = { OptionInfo + OPT_NO_HEADER, OptionInfo + OPT_BRIEF, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1180,6 +1201,10 @@ static const InfoOption_t * option_tab_cmd_IDENTIFIER[] = OptionInfo + OPT_NO_HEADER, OptionInfo + OPT_BRIEF, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1213,6 +1238,10 @@ static const InfoOption_t * option_tab_cmd_DECODE[] = OptionInfo + OPT_PRESERVE, OptionInfo + OPT_NO_HEADER, OptionInfo + OPT_BRIEF, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1248,6 +1277,10 @@ static const InfoOption_t * option_tab_cmd_ENCODE[] = OptionInfo + OPT_REMOVE_DEST, OptionInfo + OPT_UPDATE, OptionInfo + OPT_PRESERVE, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1276,6 +1309,10 @@ static const InfoOption_t * option_tab_cmd_PATCH[] = OptionInfo + OPT_PRESERVE, OptionInfo + OPT_NO_HEADER, OptionInfo + OPT_BRIEF, + + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1574,7 +1611,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " single archive (SZS,...) are combined to 1 source. The output of all" " source files is concatenated.", 0, - 20, + 21, option_tab_cmd_CAT, option_allowed_cmd_CAT }, @@ -1592,7 +1629,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " combined and strings of later source files override prior defined" " strings.", 0, - 20, + 21, option_tab_cmd_MIX, option_allowed_cmd_MIX }, @@ -1608,7 +1645,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " respect to options --le-code and --ct-code. Print the result to" " standard output.", 0, - 18, + 19, option_tab_cmd_IDENTIFIER, option_allowed_cmd_IDENTIFIER }, @@ -1625,7 +1662,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " This command is similar to PATCH, but the result is always decoded." " The default destination is '%P/%N.txt'.", 0, - 28, + 29, option_tab_cmd_DECODE, option_allowed_cmd_DECODE }, @@ -1642,7 +1679,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " This command is similar to PATCH, but the result is always encoded." " The default destination is '%P/%N.bmg'.", 0, - 17, + 18, option_tab_cmd_ENCODE, option_allowed_cmd_ENCODE }, @@ -1660,7 +1697,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " Use 'wszst patch --patch-bmg ...' to patch BMG files within a SZS" " file.", 0, - 29, + 30, option_tab_cmd_PATCH, option_allowed_cmd_PATCH }, diff --git a/project/src/ui/ui-wbmgt.h b/project/src/ui/ui-wbmgt.h index 4dceb36..75625de 100644 --- a/project/src/ui/ui-wbmgt.h +++ b/project/src/ui/ui-wbmgt.h @@ -72,6 +72,7 @@ typedef enum enumOptions OPT_PATCH_BMG, OPT_MACRO_BMG, OPT_FILTER_BMG, + OPT_BMG_ENDIAN, OPT_BMG_ENCODING, OPT_BMG_INF_SIZE, OPT_BMG_MID, @@ -87,7 +88,7 @@ typedef enum enumOptions OPT_EXPORT, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 31 + OPT__N_SPECIFIC, // == 32 //----- global options ----- @@ -121,7 +122,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 60 + OPT__N_TOTAL // == 61 } enumOptions; @@ -152,6 +153,7 @@ typedef enum enumOptions // OB_PATCH_BMG = 1llu << OPT_PATCH_BMG, // OB_MACRO_BMG = 1llu << OPT_MACRO_BMG, // OB_FILTER_BMG = 1llu << OPT_FILTER_BMG, +// OB_BMG_ENDIAN = 1llu << OPT_BMG_ENDIAN, // OB_BMG_ENCODING = 1llu << OPT_BMG_ENCODING, // OB_BMG_INF_SIZE = 1llu << OPT_BMG_INF_SIZE, // OB_BMG_MID = 1llu << OPT_BMG_MID, @@ -180,6 +182,7 @@ typedef enum enumOptions // // OB_GRP_TEXTOUT = OB_NO_HEADER // | OB_BRIEF +// | OB_BMG_ENDIAN // | OB_BMG_ENCODING // | OB_BMG_INF_SIZE // | OB_BMG_MID @@ -261,6 +264,7 @@ typedef enum enumOptions // | OB_FILTER_BMG, // // OB_CMD_ENCODE = OB_GRP_DEST +// | OB_BMG_ENDIAN // | OB_BMG_ENCODING // | OB_BMG_INF_SIZE // | OB_BMG_MID @@ -378,6 +382,7 @@ typedef enum enumGetOpt GO_ALIGN, GO_MACRO_BMG, GO_FILTER_BMG, + GO_BMG_ENDIAN, GO_BMG_ENCODING, GO_BMG_INF_SIZE, GO_BMG_MID, diff --git a/project/src/ui/ui-wctct.c b/project/src/ui/ui-wctct.c index cd7f2d6..d106ed3 100644 --- a/project/src/ui/ui-wctct.c +++ b/project/src/ui/ui-wctct.c @@ -80,9 +80,18 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Print BMG messages as UTF-8 text without escape sequences." }, + { OPT_BMG_ENDIAN, false, false, false, false, false, 0, "bmg-endian", + "name", + "Force an endian for new BMG files. Accepted values are BIG or BE for" + " big endian, LITTLE or LE for little endian and AUTO for automatic" + " detection (default).\n" + " Mario Kart Wii uses big endian; the default if no other endian is" + " defined." + }, + { OPT_BMG_ENCODING, false, false, false, false, false, 0, "bmg-encoding", "name", - "Force a BMG encoding for new BMG files. Accepted encoding names are:" + "Force an encoding for new BMG files. Accepted encoding names are" " CP-1252, UTF-16BE (or UTF-16), SHIFT-JIS, UTF-8 and AUTO for" " automatic detection (default). Same keywords without minus signs are" " accepted too.\n" @@ -384,7 +393,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 == 46 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 47 //----- global options ----- @@ -637,7 +646,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 == 79 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 80 }; @@ -845,6 +854,8 @@ static const struct option OptionLong[] = { "noheader", 0, 0, 'H' }, { "brief", 0, 0, 'B' }, { "raw", 0, 0, GO_RAW }, + { "bmg-endian", 1, 0, GO_BMG_ENDIAN }, + { "bmgendian", 1, 0, GO_BMG_ENDIAN }, { "bmg-encoding", 1, 0, GO_BMG_ENCODING }, { "bmgencoding", 1, 0, GO_BMG_ENCODING }, { "bmg-inf-size", 1, 0, GO_BMG_INF_SIZE }, @@ -1011,46 +1022,47 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x08b */ OPT_CHDIR, /* 0x08c */ OPT_ROUND, /* 0x08d */ OPT_RAW, - /* 0x08e */ OPT_BMG_ENCODING, - /* 0x08f */ OPT_BMG_INF_SIZE, - /* 0x090 */ OPT_BMG_MID, - /* 0x091 */ OPT_FORCE_ATTRIB, - /* 0x092 */ OPT_DEF_ATTRIB, - /* 0x093 */ OPT_NO_ATTRIB, - /* 0x094 */ OPT_X_ESCAPES, - /* 0x095 */ OPT_OLD_ESCAPES, - /* 0x096 */ OPT_NO_BMG_COLORS, - /* 0x097 */ OPT_BMG_COLORS, - /* 0x098 */ OPT_NO_BMG_INLINE, - /* 0x099 */ OPT_NO_ECHO, - /* 0x09a */ OPT_UTF_8, - /* 0x09b */ OPT_NO_UTF_8, - /* 0x09c */ OPT_FORCE, - /* 0x09d */ OPT_REPAIR_MAGICS, - /* 0x09e */ OPT_OLD, - /* 0x09f */ OPT_STD, - /* 0x0a0 */ OPT_NEW, - /* 0x0a1 */ OPT_EXTRACT, - /* 0x0a2 */ OPT_LIST, - /* 0x0a3 */ OPT_REF, - /* 0x0a4 */ OPT_FULL, - /* 0x0a5 */ OPT_HEX, - /* 0x0a6 */ OPT_CT_DIR, - /* 0x0a7 */ OPT_CT_LOG, - /* 0x0a8 */ OPT_ALLOW_SLOTS, - /* 0x0a9 */ OPT_IMAGES, - /* 0x0aa */ OPT_LOAD_BMG, - /* 0x0ab */ OPT_PATCH_BMG, - /* 0x0ac */ OPT_MACRO_BMG, - /* 0x0ad */ OPT_FILTER_BMG, - /* 0x0ae */ OPT_PATCH_NAMES, - /* 0x0af */ OPT_ORDER_BY, - /* 0x0b0 */ OPT_ORDER_ALL, - /* 0x0b1 */ OPT_DYNAMIC, - /* 0x0b2 */ OPT_WRITE_TRACKS, - /* 0x0b3 */ OPT_NUMBER, - /* 0x0b4 */ OPT_SECTIONS, - /* 0x0b5 */ 0,0,0,0, 0,0,0,0, 0,0,0, + /* 0x08e */ OPT_BMG_ENDIAN, + /* 0x08f */ OPT_BMG_ENCODING, + /* 0x090 */ OPT_BMG_INF_SIZE, + /* 0x091 */ OPT_BMG_MID, + /* 0x092 */ OPT_FORCE_ATTRIB, + /* 0x093 */ OPT_DEF_ATTRIB, + /* 0x094 */ OPT_NO_ATTRIB, + /* 0x095 */ OPT_X_ESCAPES, + /* 0x096 */ OPT_OLD_ESCAPES, + /* 0x097 */ OPT_NO_BMG_COLORS, + /* 0x098 */ OPT_BMG_COLORS, + /* 0x099 */ OPT_NO_BMG_INLINE, + /* 0x09a */ OPT_NO_ECHO, + /* 0x09b */ OPT_UTF_8, + /* 0x09c */ OPT_NO_UTF_8, + /* 0x09d */ OPT_FORCE, + /* 0x09e */ OPT_REPAIR_MAGICS, + /* 0x09f */ OPT_OLD, + /* 0x0a0 */ OPT_STD, + /* 0x0a1 */ OPT_NEW, + /* 0x0a2 */ OPT_EXTRACT, + /* 0x0a3 */ OPT_LIST, + /* 0x0a4 */ OPT_REF, + /* 0x0a5 */ OPT_FULL, + /* 0x0a6 */ OPT_HEX, + /* 0x0a7 */ OPT_CT_DIR, + /* 0x0a8 */ OPT_CT_LOG, + /* 0x0a9 */ OPT_ALLOW_SLOTS, + /* 0x0aa */ OPT_IMAGES, + /* 0x0ab */ OPT_LOAD_BMG, + /* 0x0ac */ OPT_PATCH_BMG, + /* 0x0ad */ OPT_MACRO_BMG, + /* 0x0ae */ OPT_FILTER_BMG, + /* 0x0af */ OPT_PATCH_NAMES, + /* 0x0b0 */ OPT_ORDER_BY, + /* 0x0b1 */ OPT_ORDER_ALL, + /* 0x0b2 */ OPT_DYNAMIC, + /* 0x0b3 */ OPT_WRITE_TRACKS, + /* 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, @@ -1065,130 +1077,130 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[46] = // cmd #1 +static u8 option_allowed_cmd_VERSION[47] = // 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,0, 1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1 }; -static u8 option_allowed_cmd_HELP[46] = // cmd #2 +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,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,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[46] = // cmd #3 +static u8 option_allowed_cmd_ARGTEST[47] = // cmd #3 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,1,1,1, 1,1,1,1,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[46] = // cmd #4 +static u8 option_allowed_cmd_TEST[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,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1 }; -static u8 option_allowed_cmd_COLORS[46] = // cmd #5 +static u8 option_allowed_cmd_COLORS[47] = // cmd #5 { 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 }; -static u8 option_allowed_cmd_ERROR[46] = // cmd #6 +static u8 option_allowed_cmd_ERROR[47] = // cmd #6 { 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, 1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1 }; -static u8 option_allowed_cmd_FILETYPE[46] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[47] = // cmd #7 { 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,1, 0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[46] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[47] = // cmd #8 { 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[46] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[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,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[46] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[47] = // cmd #10 { 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 }; -static u8 option_allowed_cmd_CALCULATE[46] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[47] = // 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,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0 }; -static u8 option_allowed_cmd_FLOAT[46] = // cmd #12 +static u8 option_allowed_cmd_FLOAT[47] = // cmd #12 { 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 }; -static u8 option_allowed_cmd_EXPORT[46] = // cmd #13 +static u8 option_allowed_cmd_EXPORT[47] = // 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 }; -static u8 option_allowed_cmd_RAWDUMP[46] = // cmd #14 +static u8 option_allowed_cmd_RAWDUMP[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,1,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 }; -static u8 option_allowed_cmd_DUMP[46] = // cmd #15 +static u8 option_allowed_cmd_DUMP[47] = // cmd #15 { - 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,1,1,1, - 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,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[46] = // cmd #16 +static u8 option_allowed_cmd_CAT[47] = // cmd #16 { - 0,0,0,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 + 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[46] = // cmd #17 +static u8 option_allowed_cmd_BMG[47] = // cmd #17 { - 0,0,1,1,1, 0,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 + 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[46] = // cmd #18 +static u8 option_allowed_cmd_TRACKS[47] = // cmd #18 { - 0,0,1,1,1, 1,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 + 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[46] = // cmd #19 +static u8 option_allowed_cmd_DECODE[47] = // cmd #19 { - 0,0,0,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,1,1,1,1, 1,1,1,1,1, 0 + 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[46] = // cmd #20 +static u8 option_allowed_cmd_CREATE[47] = // cmd #20 { - 0,0,1,1,1, 0,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 + 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[46] = // cmd #21 +static u8 option_allowed_cmd_PATCH[47] = // cmd #21 { - 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 + 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 }; @@ -1390,6 +1402,7 @@ static const InfoOption_t * option_tab_cmd_BMG[] = OptionInfo + OPT_HEX, &option_grp_TEXTOPT_NO_HEADER, OptionInfo + OPT_EXPORT, + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1499,6 +1512,7 @@ static const InfoOption_t * option_tab_cmd_CREATE[] = &option_grp_TEXTOPT_NO_HEADER, OptionInfo + OPT_BRIEF, OptionInfo + OPT_EXPORT, + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -1850,7 +1864,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " output. BRRES, TEX0, CT-CODE, CT-TEXT and LE-BIN are accepted as" " input.", 0, - 31, + 32, option_tab_cmd_BMG, option_allowed_cmd_BMG }, @@ -1902,7 +1916,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " The Korean support needs external CT-CODE files. Use option" " --ct-dir to define at least one search path.", 0, - 40, + 41, option_tab_cmd_CREATE, option_allowed_cmd_CREATE }, diff --git a/project/src/ui/ui-wctct.h b/project/src/ui/ui-wctct.h index 4e0e4d0..184515b 100644 --- a/project/src/ui/ui-wctct.h +++ b/project/src/ui/ui-wctct.h @@ -61,6 +61,7 @@ typedef enum enumOptions OPT_NO_HEADER, OPT_BRIEF, OPT_RAW, + OPT_BMG_ENDIAN, OPT_BMG_ENCODING, OPT_BMG_INF_SIZE, OPT_BMG_MID, @@ -102,7 +103,7 @@ typedef enum enumOptions OPT_IGNORE, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 46 + OPT__N_SPECIFIC, // == 47 //----- global options ----- @@ -140,7 +141,7 @@ typedef enum enumOptions OPT_CT_LOG, OPT_ALLOW_SLOTS, - OPT__N_TOTAL // == 79 + OPT__N_TOTAL // == 80 } enumOptions; @@ -160,6 +161,7 @@ typedef enum enumOptions // OB_NO_HEADER = 1llu << OPT_NO_HEADER, // OB_BRIEF = 1llu << OPT_BRIEF, // OB_RAW = 1llu << OPT_RAW, +// OB_BMG_ENDIAN = 1llu << OPT_BMG_ENDIAN, // OB_BMG_ENCODING = 1llu << OPT_BMG_ENCODING, // OB_BMG_INF_SIZE = 1llu << OPT_BMG_INF_SIZE, // OB_BMG_MID = 1llu << OPT_BMG_MID, @@ -276,6 +278,7 @@ typedef enum enumOptions // OB_CMD_BMG = OB_BRIEF // | OB_LONG // | OB_GRP_TEXTOUT +// | OB_BMG_ENDIAN // | OB_BMG_ENCODING // | OB_BMG_INF_SIZE // | OB_BMG_MID @@ -322,6 +325,7 @@ typedef enum enumOptions // OB_CMD_CREATE = OB_GRP_DEST // | OB_IGNORE // | OB_GRP_TEXTOPT +// | OB_BMG_ENDIAN // | OB_BMG_ENCODING // | OB_BMG_INF_SIZE // | OB_BMG_MID @@ -439,6 +443,7 @@ typedef enum enumGetOpt GO_CHDIR, GO_ROUND, GO_RAW, + GO_BMG_ENDIAN, GO_BMG_ENCODING, GO_BMG_INF_SIZE, GO_BMG_MID, diff --git a/project/src/ui/ui-wlect.c b/project/src/ui/ui-wlect.c index e590351..e74581c 100644 --- a/project/src/ui/ui-wlect.c +++ b/project/src/ui/ui-wlect.c @@ -150,9 +150,9 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = { OPT_PERFMON, true, false, false, false, false, 0, "perf-mon", "[=mode]", "Enable or disable the performance monitor. Mode is one of OFF, AUTO" - " (default, don't change setting), ON (enable it for Wii only;" - " default, if option is used without parameter) or FORCE (enable it" - " for Wii and for Dolphin)." + " (default, don't change setting), ON (enable it for Wii and Wii U" + " only; default, if option is used without parameter) or FORCE (enable" + " it for Wii, Wii U and for Dolphin)." }, { OPT_CUSTOM_TT, true, false, false, false, false, 0, "custom-tt", @@ -168,6 +168,32 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " parameter). Disable it only for tests!" }, + { 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)." + }, + + { 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_TRACK_DIR, false, false, false, false, true, 0, "track-dir", "directory", "Define a destination directory, where track files are copied, moved" @@ -337,7 +363,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 == 41 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 45 //----- global options ----- @@ -559,7 +585,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 == 72 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 76 }; @@ -784,6 +810,13 @@ static const struct option OptionLong[] = { "custom-tt", 2, 0, GO_CUSTOM_TT }, { "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 }, { "track-dir", 1, 0, GO_TRACK_DIR }, { "trackdir", 1, 0, GO_TRACK_DIR }, { "copy-tracks", 1, 0, GO_COPY_TRACKS }, @@ -912,20 +945,24 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x0a1 */ OPT_PERFMON, /* 0x0a2 */ OPT_CUSTOM_TT, /* 0x0a3 */ OPT_XPFLAGS, - /* 0x0a4 */ OPT_TRACK_DIR, - /* 0x0a5 */ OPT_COPY_TRACKS, - /* 0x0a6 */ OPT_MOVE_TRACKS, - /* 0x0a7 */ OPT_MOVE1_TRACKS, - /* 0x0a8 */ OPT_LINK_TRACKS, - /* 0x0a9 */ OPT_LOAD_BMG, - /* 0x0aa */ OPT_PATCH_BMG, - /* 0x0ab */ OPT_MACRO_BMG, - /* 0x0ac */ OPT_PATCH_NAMES, - /* 0x0ad */ OPT_ORDER_BY, - /* 0x0ae */ OPT_ORDER_ALL, - /* 0x0af */ OPT_NUMBER, - /* 0x0b0 */ OPT_SECTIONS, - /* 0x0b1 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0, + /* 0x0a4 */ OPT_SPEEDOMETER, + /* 0x0a5 */ OPT_RESERVED_1B9, + /* 0x0a6 */ OPT_RESERVED_1BA, + /* 0x0a7 */ OPT_RESERVED_1BB, + /* 0x0a8 */ OPT_TRACK_DIR, + /* 0x0a9 */ OPT_COPY_TRACKS, + /* 0x0aa */ OPT_MOVE_TRACKS, + /* 0x0ab */ OPT_MOVE1_TRACKS, + /* 0x0ac */ OPT_LINK_TRACKS, + /* 0x0ad */ OPT_LOAD_BMG, + /* 0x0ae */ OPT_PATCH_BMG, + /* 0x0af */ OPT_MACRO_BMG, + /* 0x0b0 */ OPT_PATCH_NAMES, + /* 0x0b1 */ OPT_ORDER_BY, + /* 0x0b2 */ OPT_ORDER_ALL, + /* 0x0b3 */ OPT_NUMBER, + /* 0x0b4 */ OPT_SECTIONS, + /* 0x0b5 */ 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, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -940,142 +977,142 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[41] = // cmd #1 +static u8 option_allowed_cmd_VERSION[45] = // 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, 1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 }; -static u8 option_allowed_cmd_HELP[41] = // cmd #2 +static u8 option_allowed_cmd_HELP[45] = // 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 }; -static u8 option_allowed_cmd_ARGTEST[41] = // cmd #3 +static u8 option_allowed_cmd_ARGTEST[45] = // cmd #3 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1,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[41] = // cmd #4 +static u8 option_allowed_cmd_TEST[45] = // 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 }; -static u8 option_allowed_cmd_COLORS[41] = // cmd #5 +static u8 option_allowed_cmd_COLORS[45] = // cmd #5 { 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 }; -static u8 option_allowed_cmd_ERROR[41] = // cmd #6 +static u8 option_allowed_cmd_ERROR[45] = // cmd #6 { 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, 1 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[41] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[45] = // cmd #7 { 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,1, 0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[41] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[45] = // cmd #8 { 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 }; -static u8 option_allowed_cmd_SYMBOLS[41] = // cmd #9 +static u8 option_allowed_cmd_SYMBOLS[45] = // 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 }; -static u8 option_allowed_cmd_FUNCTIONS[41] = // cmd #10 +static u8 option_allowed_cmd_FUNCTIONS[45] = // cmd #10 { 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 }; -static u8 option_allowed_cmd_CALCULATE[41] = // cmd #11 +static u8 option_allowed_cmd_CALCULATE[45] = // 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,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_FLOAT[41] = // cmd #12 +static u8 option_allowed_cmd_FLOAT[45] = // cmd #12 { 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_EXPORT[41] = // cmd #13 +static u8 option_allowed_cmd_EXPORT[45] = // 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 }; -static u8 option_allowed_cmd_DUMP[41] = // cmd #14 +static u8 option_allowed_cmd_DUMP[45] = // cmd #14 { - 0,0,1,0,0, 0,0,0,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,0,0, 0 + 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 }; -static u8 option_allowed_cmd_DL[41] = // cmd #15 +static u8 option_allowed_cmd_DL[45] = // cmd #15 { - 0,0,1,0,0, 0,0,0,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,0,0, 0 + 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 }; -static u8 option_allowed_cmd_DLL[41] = // cmd #16 +static u8 option_allowed_cmd_DLL[45] = // cmd #16 { - 0,0,1,0,0, 0,0,0,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,0,0, 0 + 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 }; -static u8 option_allowed_cmd_BIN_DIFF[41] = // cmd #17 +static u8 option_allowed_cmd_BIN_DIFF[45] = // 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,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_PATCH[41] = // cmd #18 +static u8 option_allowed_cmd_PATCH[45] = // cmd #18 { - 0,0,0,0,0, 0,0,0,0,0, 0,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,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[41] = // cmd #19 +static u8 option_allowed_cmd_LPAR[45] = // cmd #19 { - 0,0,0,1,1, 1,0,0,0,0, 0,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,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[41] = // cmd #20 +static u8 option_allowed_cmd_CREATE[45] = // cmd #20 { - 0,0,0,1,1, 1,0,1,1,1, 1,0,1,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, 0 + 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 }; -static u8 option_allowed_cmd_CAT[41] = // cmd #21 +static u8 option_allowed_cmd_CAT[45] = // cmd #21 { - 0,0,0,1,1, 1,0,1,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,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[41] = // cmd #22 +static u8 option_allowed_cmd_DECODE[45] = // cmd #22 { - 0,0,0,1,1, 1,0,1,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,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[41] = // cmd #23 +static u8 option_allowed_cmd_ENCODE[45] = // cmd #23 { - 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,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,0,0,1,0, + 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,0 }; @@ -1230,6 +1267,7 @@ static const InfoOption_t * option_tab_cmd_DUMP[] = OptionInfo + OPT_PERFMON, OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, OptionInfo + OPT_NONE, // separator @@ -1249,6 +1287,7 @@ static const InfoOption_t * option_tab_cmd_DL[] = OptionInfo + OPT_PERFMON, OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, OptionInfo + OPT_NONE, // separator @@ -1268,6 +1307,7 @@ static const InfoOption_t * option_tab_cmd_DLL[] = OptionInfo + OPT_PERFMON, OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, OptionInfo + OPT_NONE, // separator @@ -1295,6 +1335,7 @@ static const InfoOption_t * option_tab_cmd_PATCH[] = OptionInfo + OPT_PERFMON, OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, OptionInfo + OPT_TRACK_DIR, OptionInfo + OPT_COPY_TRACKS, OptionInfo + OPT_MOVE_TRACKS, @@ -1329,6 +1370,7 @@ static const InfoOption_t * option_tab_cmd_LPAR[] = OptionInfo + OPT_PERFMON, OptionInfo + OPT_CUSTOM_TT, OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, OptionInfo + OPT_NONE, // separator @@ -1370,6 +1412,9 @@ static const InfoOption_t * option_tab_cmd_CREATE[] = OptionInfo + OPT_UPDATE, OptionInfo + OPT_PRESERVE, OptionInfo + OPT_LPAR, + + OptionInfo + OPT_NONE, // separator + OptionInfo + OPT_LT_CLEAR, OptionInfo + OPT_LT_ONLINE, OptionInfo + OPT_LT_N_PLAYERS, @@ -1379,6 +1424,15 @@ static const InfoOption_t * option_tab_cmd_CREATE[] = OptionInfo + OPT_LT_RANDOM, OptionInfo + OPT_LEX_PURGE, + OptionInfo + OPT_NONE, // separator + + OptionInfo + OPT_ENGINE, + OptionInfo + OPT_200CC, + OptionInfo + OPT_PERFMON, + OptionInfo + OPT_CUSTOM_TT, + OptionInfo + OPT_XPFLAGS, + OptionInfo + OPT_SPEEDOMETER, + 0 }; @@ -1682,7 +1736,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, - 10, + 11, option_tab_cmd_DUMP, option_allowed_cmd_DUMP }, @@ -1696,7 +1750,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wlect DL [source]...", "Short cut for 'DUMP --long'.", 0, - 10, + 11, option_tab_cmd_DL, option_allowed_cmd_DL }, @@ -1710,7 +1764,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "wlect DLL [source]...", "Short cut for 'DUMP --long --long'.", 0, - 10, + 11, option_tab_cmd_DLL, option_allowed_cmd_DLL }, @@ -1747,7 +1801,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, - 22, + 23, option_tab_cmd_PATCH, option_allowed_cmd_PATCH }, @@ -1763,7 +1817,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, - 20, + 21, option_tab_cmd_LPAR, option_allowed_cmd_LPAR }, @@ -1784,7 +1838,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, - 22, + 28, 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 94a0f2e..a170a51 100644 --- a/project/src/ui/ui-wlect.h +++ b/project/src/ui/ui-wlect.h @@ -74,6 +74,10 @@ typedef enum enumOptions OPT_PERFMON, OPT_CUSTOM_TT, OPT_XPFLAGS, + OPT_SPEEDOMETER, + OPT_RESERVED_1B9, + OPT_RESERVED_1BA, + OPT_RESERVED_1BB, OPT_TRACK_DIR, OPT_COPY_TRACKS, OPT_MOVE_TRACKS, @@ -97,7 +101,7 @@ typedef enum enumOptions OPT_IGNORE, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 41 + OPT__N_SPECIFIC, // == 45 //----- global options ----- @@ -133,7 +137,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 72 + OPT__N_TOTAL // == 76 } enumOptions; @@ -166,6 +170,10 @@ typedef enum enumOptions // OB_PERFMON = 1llu << OPT_PERFMON, // 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_TRACK_DIR = 1llu << OPT_TRACK_DIR, // OB_COPY_TRACKS = 1llu << OPT_COPY_TRACKS, // OB_MOVE_TRACKS = 1llu << OPT_MOVE_TRACKS, @@ -200,14 +208,20 @@ typedef enum enumOptions // | OB_UPDATE // | OB_PRESERVE, // -// OB_GRP_PATCH = OB_LE_DEFINE -// | OB_LPAR -// | OB_ALIAS -// | OB_ENGINE +// OB_GRP_PARAM = OB_ENGINE // | OB_200CC // | OB_PERFMON // | OB_CUSTOM_TT -// | OB_XPFLAGS, +// | OB_XPFLAGS +// | OB_SPEEDOMETER +// | OB_RESERVED_1B9 +// | OB_RESERVED_1BA +// | OB_RESERVED_1BB, +// +// OB_GRP_PATCH = OB_LE_DEFINE +// | OB_LPAR +// | OB_ALIAS +// | OB_GRP_PARAM, // // OB_GRP_TRACK_COPY = OB_TRACK_DIR // | OB_COPY_TRACKS @@ -282,7 +296,8 @@ typedef enum enumOptions // | OB_LPAR // | OB_LT_CLEAR // | OB_LT_ONLINE -// | OB_LT_N_PLAYERS, +// | OB_LT_N_PLAYERS +// | OB_GRP_PARAM, // // OB_CMD_CAT = OB_COMPLETE // | OB_GRP_TEXTOUT @@ -411,6 +426,10 @@ typedef enum enumGetOpt GO_PERFMON, GO_CUSTOM_TT, GO_XPFLAGS, + GO_SPEEDOMETER, + GO_RESERVED_1B9, + GO_RESERVED_1BA, + GO_RESERVED_1BB, GO_TRACK_DIR, GO_COPY_TRACKS, GO_MOVE_TRACKS, diff --git a/project/src/ui/ui-wszst.c b/project/src/ui/ui-wszst.c index f6a0afc..d5f36b5 100644 --- a/project/src/ui/ui-wszst.c +++ b/project/src/ui/ui-wszst.c @@ -527,9 +527,18 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " default value is 0.01." }, + { OPT_BMG_ENDIAN, false, false, false, false, false, 0, "bmg-endian", + "name", + "Force an endian for new BMG files. Accepted values are BIG or BE for" + " big endian, LITTLE or LE for little endian and AUTO for automatic" + " detection (default).\n" + " Mario Kart Wii uses big endian; the default if no other endian is" + " defined." + }, + { OPT_BMG_ENCODING, false, false, false, false, false, 0, "bmg-encoding", "name", - "Force a BMG encoding for new BMG files. Accepted encoding names are:" + "Force an encoding for new BMG files. Accepted encoding names are" " CP-1252, UTF-16BE (or UTF-16), SHIFT-JIS, UTF-8 and AUTO for" " automatic detection (default). Same keywords without minus signs are" " accepted too.\n" @@ -1094,7 +1103,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 == 130 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 131 //----- global options ----- @@ -1680,7 +1689,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 == 200 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 201 }; @@ -2370,6 +2379,8 @@ static const struct option OptionLong[] = { "delta", 0, 0, GO_DELTA }, { "diff", 0, 0, GO_DIFF }, { "epsilon", 1, 0, GO_EPSILON }, + { "bmg-endian", 1, 0, GO_BMG_ENDIAN }, + { "bmgendian", 1, 0, GO_BMG_ENDIAN }, { "bmg-encoding", 1, 0, GO_BMG_ENCODING }, { "bmgencoding", 1, 0, GO_BMG_ENCODING }, { "bmg-inf-size", 1, 0, GO_BMG_INF_SIZE }, @@ -2700,85 +2711,86 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x0d5 */ OPT_DELTA, /* 0x0d6 */ OPT_DIFF, /* 0x0d7 */ OPT_EPSILON, - /* 0x0d8 */ OPT_BMG_ENCODING, - /* 0x0d9 */ OPT_BMG_INF_SIZE, - /* 0x0da */ OPT_BMG_MID, - /* 0x0db */ OPT_FORCE_ATTRIB, - /* 0x0dc */ OPT_DEF_ATTRIB, - /* 0x0dd */ OPT_NO_ATTRIB, - /* 0x0de */ OPT_X_ESCAPES, - /* 0x0df */ OPT_OLD_ESCAPES, - /* 0x0e0 */ OPT_NO_BMG_COLORS, - /* 0x0e1 */ OPT_BMG_COLORS, - /* 0x0e2 */ OPT_NO_BMG_INLINE, - /* 0x0e3 */ OPT_AUTOADD_PATH, - /* 0x0e4 */ OPT_STRIP, - /* 0x0e5 */ OPT_UTF_8, - /* 0x0e6 */ OPT_NO_UTF_8, - /* 0x0e7 */ OPT_FORCE, - /* 0x0e8 */ OPT_REPAIR_MAGICS, - /* 0x0e9 */ OPT_TINY, - /* 0x0ea */ OPT_YAZ0, - /* 0x0eb */ OPT_YAZ1, - /* 0x0ec */ OPT_XYZ, - /* 0x0ed */ OPT_BZ, - /* 0x0ee */ OPT_SH, - /* 0x0ef */ OPT_BASH, - /* 0x0f0 */ OPT_JSON, - /* 0x0f1 */ OPT_PHP, - /* 0x0f2 */ OPT_MAKEDOC, - /* 0x0f3 */ OPT_VAR, - /* 0x0f4 */ OPT_ARRAY, - /* 0x0f5 */ OPT_AVAR, - /* 0x0f6 */ OPT_ANALYZE, - /* 0x0f7 */ OPT_ANALYZE_MODE, - /* 0x0f8 */ OPT_OLD, - /* 0x0f9 */ OPT_STD, - /* 0x0fa */ OPT_NEW, - /* 0x0fb */ OPT_EXTRACT, - /* 0x0fc */ OPT_NUMBER, - /* 0x0fd */ OPT_REMOVE_SRC, - /* 0x0fe */ OPT_IGNORE_SETUP, - /* 0x0ff */ OPT_PURGE, - /* 0x100 */ OPT_ALIGN_U8, - /* 0x101 */ OPT_ALIGN_PACK, - /* 0x102 */ OPT_ALIGN_BRRES, - /* 0x103 */ OPT_ALIGN_BREFF, - /* 0x104 */ OPT_ALIGN_BREFT, - /* 0x105 */ OPT_ALIGN, - /* 0x106 */ OPT_ENCODE_ALL, - /* 0x107 */ OPT_ENCODE_IMG, - /* 0x108 */ OPT_NO_ENCODE, - /* 0x109 */ OPT_NO_RECURSE, - /* 0x10a */ OPT_AUTO_ADD, - /* 0x10b */ OPT_NO_ECHO, - /* 0x10c */ OPT_PT_DIR, - /* 0x10d */ OPT_RM_AIPARAM, - /* 0x10e */ OPT_U8, - /* 0x10f */ OPT_SZS, - /* 0x110 */ OPT_WU8, - /* 0x111 */ OPT_XWU8, - /* 0x112 */ OPT_WBZ, - /* 0x113 */ OPT_PACK, - /* 0x114 */ OPT_BRRES, - /* 0x115 */ OPT_BREFF, - /* 0x116 */ OPT_BREFT, - /* 0x117 */ OPT_NO_COMPRESS, - /* 0x118 */ OPT_FAST, - /* 0x119 */ OPT_LINKS, - /* 0x11a */ OPT_BASEDIR, - /* 0x11b */ OPT_DECODE, - /* 0x11c */ OPT_MIPMAPS, - /* 0x11d */ OPT_NO_MIPMAPS, - /* 0x11e */ OPT_N_MIPMAPS, - /* 0x11f */ OPT_MAX_MIPMAPS, - /* 0x120 */ OPT_MIPMAP_SIZE, - /* 0x121 */ OPT_FAST_MIPMAPS, - /* 0x122 */ OPT_CMPR_DEFAULT, - /* 0x123 */ OPT_CUT, - /* 0x124 */ OPT_RAW, - /* 0x125 */ OPT_SECTIONS, - /* 0x126 */ 0,0,0,0, 0,0, + /* 0x0d8 */ OPT_BMG_ENDIAN, + /* 0x0d9 */ OPT_BMG_ENCODING, + /* 0x0da */ OPT_BMG_INF_SIZE, + /* 0x0db */ OPT_BMG_MID, + /* 0x0dc */ OPT_FORCE_ATTRIB, + /* 0x0dd */ OPT_DEF_ATTRIB, + /* 0x0de */ OPT_NO_ATTRIB, + /* 0x0df */ OPT_X_ESCAPES, + /* 0x0e0 */ OPT_OLD_ESCAPES, + /* 0x0e1 */ OPT_NO_BMG_COLORS, + /* 0x0e2 */ OPT_BMG_COLORS, + /* 0x0e3 */ OPT_NO_BMG_INLINE, + /* 0x0e4 */ OPT_AUTOADD_PATH, + /* 0x0e5 */ OPT_STRIP, + /* 0x0e6 */ OPT_UTF_8, + /* 0x0e7 */ OPT_NO_UTF_8, + /* 0x0e8 */ OPT_FORCE, + /* 0x0e9 */ OPT_REPAIR_MAGICS, + /* 0x0ea */ OPT_TINY, + /* 0x0eb */ OPT_YAZ0, + /* 0x0ec */ OPT_YAZ1, + /* 0x0ed */ OPT_XYZ, + /* 0x0ee */ OPT_BZ, + /* 0x0ef */ OPT_SH, + /* 0x0f0 */ OPT_BASH, + /* 0x0f1 */ OPT_JSON, + /* 0x0f2 */ OPT_PHP, + /* 0x0f3 */ OPT_MAKEDOC, + /* 0x0f4 */ OPT_VAR, + /* 0x0f5 */ OPT_ARRAY, + /* 0x0f6 */ OPT_AVAR, + /* 0x0f7 */ OPT_ANALYZE, + /* 0x0f8 */ OPT_ANALYZE_MODE, + /* 0x0f9 */ OPT_OLD, + /* 0x0fa */ OPT_STD, + /* 0x0fb */ OPT_NEW, + /* 0x0fc */ OPT_EXTRACT, + /* 0x0fd */ OPT_NUMBER, + /* 0x0fe */ OPT_REMOVE_SRC, + /* 0x0ff */ OPT_IGNORE_SETUP, + /* 0x100 */ OPT_PURGE, + /* 0x101 */ OPT_ALIGN_U8, + /* 0x102 */ OPT_ALIGN_PACK, + /* 0x103 */ OPT_ALIGN_BRRES, + /* 0x104 */ OPT_ALIGN_BREFF, + /* 0x105 */ OPT_ALIGN_BREFT, + /* 0x106 */ OPT_ALIGN, + /* 0x107 */ OPT_ENCODE_ALL, + /* 0x108 */ OPT_ENCODE_IMG, + /* 0x109 */ OPT_NO_ENCODE, + /* 0x10a */ OPT_NO_RECURSE, + /* 0x10b */ OPT_AUTO_ADD, + /* 0x10c */ OPT_NO_ECHO, + /* 0x10d */ OPT_PT_DIR, + /* 0x10e */ OPT_RM_AIPARAM, + /* 0x10f */ OPT_U8, + /* 0x110 */ OPT_SZS, + /* 0x111 */ OPT_WU8, + /* 0x112 */ OPT_XWU8, + /* 0x113 */ OPT_WBZ, + /* 0x114 */ OPT_PACK, + /* 0x115 */ OPT_BRRES, + /* 0x116 */ OPT_BREFF, + /* 0x117 */ OPT_BREFT, + /* 0x118 */ OPT_NO_COMPRESS, + /* 0x119 */ OPT_FAST, + /* 0x11a */ OPT_LINKS, + /* 0x11b */ OPT_BASEDIR, + /* 0x11c */ OPT_DECODE, + /* 0x11d */ OPT_MIPMAPS, + /* 0x11e */ OPT_NO_MIPMAPS, + /* 0x11f */ OPT_N_MIPMAPS, + /* 0x120 */ OPT_MAX_MIPMAPS, + /* 0x121 */ OPT_MIPMAP_SIZE, + /* 0x122 */ OPT_FAST_MIPMAPS, + /* 0x123 */ OPT_CMPR_DEFAULT, + /* 0x124 */ OPT_CUT, + /* 0x125 */ OPT_RAW, + /* 0x126 */ OPT_SECTIONS, + /* 0x127 */ 0,0,0,0, 0, }; // @@ -2786,652 +2798,652 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[130] = // cmd #1 +static u8 option_allowed_cmd_VERSION[131] = // 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,1 + 0,0,0,0,0, 0,0,0,0,0, 1 }; -static u8 option_allowed_cmd_HELP[130] = // cmd #2 +static u8 option_allowed_cmd_HELP[131] = // 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 }; -static u8 option_allowed_cmd_ARGTEST[130] = // cmd #3 +static u8 option_allowed_cmd_ARGTEST[131] = // cmd #3 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,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[130] = // cmd #4 +static u8 option_allowed_cmd_TEST[131] = // 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 }; -static u8 option_allowed_cmd_COLORS[130] = // cmd #5 +static u8 option_allowed_cmd_COLORS[131] = // cmd #5 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,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 }; -static u8 option_allowed_cmd_ERROR[130] = // cmd #6 +static u8 option_allowed_cmd_ERROR[131] = // 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,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,1 + 0,0,0,0,0, 0,0,0,0,0, 1 }; -static u8 option_allowed_cmd_FILETYPE[130] = // cmd #7 +static u8 option_allowed_cmd_FILETYPE[131] = // 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,0, 0,0,0,0,0, 0,0,0,0,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 }; -static u8 option_allowed_cmd_FILEATTRIB[130] = // cmd #8 +static u8 option_allowed_cmd_FILEATTRIB[131] = // 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,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 }; -static u8 option_allowed_cmd_BRSUB[130] = // cmd #9 +static u8 option_allowed_cmd_BRSUB[131] = // 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,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,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 }; -static u8 option_allowed_cmd_SYMBOLS[130] = // cmd #10 +static u8 option_allowed_cmd_SYMBOLS[131] = // 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,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 }; -static u8 option_allowed_cmd_FUNCTIONS[130] = // cmd #11 +static u8 option_allowed_cmd_FUNCTIONS[131] = // 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,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 }; -static u8 option_allowed_cmd_CALCULATE[130] = // cmd #12 +static u8 option_allowed_cmd_CALCULATE[131] = // 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,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,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[130] = // cmd #13 +static u8 option_allowed_cmd_MATRIX[131] = // cmd #13 { 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 }; -static u8 option_allowed_cmd_FLOAT[130] = // cmd #14 +static u8 option_allowed_cmd_FLOAT[131] = // 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,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 }; -static u8 option_allowed_cmd_VR_CALC[130] = // cmd #15 +static u8 option_allowed_cmd_VR_CALC[131] = // 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,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 }; -static u8 option_allowed_cmd_VR_RACE[130] = // cmd #16 +static u8 option_allowed_cmd_VR_RACE[131] = // 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,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 }; -static u8 option_allowed_cmd_AUTOADD[130] = // cmd #17 +static u8 option_allowed_cmd_AUTOADD[131] = // 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,0, 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 }; -static u8 option_allowed_cmd_TRACKS[130] = // cmd #18 +static u8 option_allowed_cmd_TRACKS[131] = // 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,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,1,0,0 + 0,0,0,0,0, 0,0,0,1,0, 0 }; -static u8 option_allowed_cmd_SCANCACHE[130] = // cmd #19 +static u8 option_allowed_cmd_SCANCACHE[131] = // 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,0,0, - 0,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 }; -static u8 option_allowed_cmd_EXPORT[130] = // cmd #20 +static u8 option_allowed_cmd_EXPORT[131] = // 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,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,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[130] = // cmd #21 +static u8 option_allowed_cmd_CODE[131] = // 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 }; -static u8 option_allowed_cmd_RECODE[130] = // cmd #22 +static u8 option_allowed_cmd_RECODE[131] = // 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 }; -static u8 option_allowed_cmd_SUBFILE[130] = // cmd #23 +static u8 option_allowed_cmd_SUBFILE[131] = // 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,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 }; -static u8 option_allowed_cmd_LIST[130] = // cmd #24 +static u8 option_allowed_cmd_LIST[131] = // 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,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,1,1, 1,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,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[130] = // cmd #25 +static u8 option_allowed_cmd_LIST_L[131] = // 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,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,1,1, 1,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,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[130] = // cmd #26 +static u8 option_allowed_cmd_LIST_LL[131] = // 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,1,1, 1,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,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[130] = // cmd #27 +static u8 option_allowed_cmd_LIST_LLL[131] = // 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,1,1, 1,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,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[130] = // cmd #28 +static u8 option_allowed_cmd_LIST_A[131] = // 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,1,1, 1,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,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[130] = // cmd #29 +static u8 option_allowed_cmd_LIST_LA[131] = // 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,1,1, 1,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,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[130] = // cmd #30 +static u8 option_allowed_cmd_NAME_REF[131] = // 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, 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,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,0 + 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_ILIST[130] = // cmd #31 +static u8 option_allowed_cmd_ILIST[131] = // 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,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,1,1, 1,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,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[130] = // cmd #32 +static u8 option_allowed_cmd_ILIST_L[131] = // 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,1,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,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,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[130] = // cmd #33 +static u8 option_allowed_cmd_ILIST_LL[131] = // 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,1,1, 1,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,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[130] = // cmd #34 +static u8 option_allowed_cmd_ILIST_A[131] = // 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,1,1, 1,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,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[130] = // cmd #35 +static u8 option_allowed_cmd_ILIST_LA[131] = // 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,1,1, 1,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,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[130] = // cmd #36 +static u8 option_allowed_cmd_MEMORY[131] = // 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,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,1, 1,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,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[130] = // cmd #37 +static u8 option_allowed_cmd_MEMORY_A[131] = // 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,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,1, 1,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,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[130] = // cmd #38 +static u8 option_allowed_cmd_DUMP[131] = // 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,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 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,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,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[130] = // cmd #39 +static u8 option_allowed_cmd_SHA1[131] = // 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,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,1, 1,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,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[130] = // cmd #40 +static u8 option_allowed_cmd_ANALYZE[131] = // 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,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,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 }; -static u8 option_allowed_cmd_DISTRIBUTION[130] = // cmd #41 +static u8 option_allowed_cmd_DISTRIBUTION[131] = // 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,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,1, 1,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,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[130] = // cmd #42 +static u8 option_allowed_cmd_DIFF[131] = // 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,0,0,0, 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, 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[130] = // cmd #43 +static u8 option_allowed_cmd_CHECK[131] = // cmd #43 { 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,1, 1,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,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[130] = // cmd #44 +static u8 option_allowed_cmd_SLOTS[131] = // cmd #44 { 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,1, 1,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,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[130] = // cmd #45 +static u8 option_allowed_cmd_STGI[131] = // 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,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,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 }; -static u8 option_allowed_cmd_ISARENA[130] = // cmd #46 +static u8 option_allowed_cmd_ISARENA[131] = // cmd #46 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,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,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 }; -static u8 option_allowed_cmd_NORMALIZE[130] = // cmd #47 +static u8 option_allowed_cmd_NORMALIZE[131] = // 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,0, 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, 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[130] = // cmd #48 +static u8 option_allowed_cmd_PATCH[131] = // cmd #48 { 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,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, 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[130] = // cmd #49 +static u8 option_allowed_cmd_COPY[131] = // cmd #49 { 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,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, 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[130] = // cmd #50 +static u8 option_allowed_cmd_DUPLICATE[131] = // 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,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,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, 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[130] = // cmd #51 +static u8 option_allowed_cmd_MINIMAP[131] = // cmd #51 { 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, 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,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[130] = // cmd #52 +static u8 option_allowed_cmd_COMPRESS[131] = // 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,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, 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[130] = // cmd #53 +static u8 option_allowed_cmd_DECOMPRESS[131] = // 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,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,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, 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[130] = // cmd #54 +static u8 option_allowed_cmd_ENCODE[131] = // cmd #54 { 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,1, 1,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, 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[130] = // cmd #55 +static u8 option_allowed_cmd_CREATE[131] = // 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,1, 1,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, 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[130] = // cmd #56 +static u8 option_allowed_cmd_UPDATE[131] = // 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,1, 1,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,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[130] = // cmd #57 +static u8 option_allowed_cmd_EXTRACT[131] = // 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,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,1,1,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,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[130] = // cmd #58 +static u8 option_allowed_cmd_XDECODE[131] = // 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,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,1,1,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,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[130] = // cmd #59 +static u8 option_allowed_cmd_XEXPORT[131] = // 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,1,1, 0,1,1,0,0, 0,0,0,0,0, - 0,0,0,0,0, 0,1,1,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,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[130] = // cmd #60 +static u8 option_allowed_cmd_XALL[131] = // 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,1,1,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,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[130] = // cmd #61 +static u8 option_allowed_cmd_XCOMMON[131] = // cmd #61 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 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 }; -static u8 option_allowed_cmd_BINARY[130] = // cmd #62 +static u8 option_allowed_cmd_BINARY[131] = // cmd #62 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 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 }; -static u8 option_allowed_cmd_TEXT[130] = // cmd #63 +static u8 option_allowed_cmd_TEXT[131] = // cmd #63 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,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,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,1,0, - 0,0,0,0,0, 0,0,0,0,0 + 1,1,1,1,1, 1,1,1,1,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,1, + 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_CAT[130] = // cmd #64 +static u8 option_allowed_cmd_CAT[131] = // 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,1,1,1, 0,1,1,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,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,1,0, - 0,0,0,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,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,1, + 0,0,0,0,0, 0,0,0,0,0, 0 }; -static u8 option_allowed_cmd_BMG[130] = // cmd #65 +static u8 option_allowed_cmd_BMG[131] = // 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,1,1,1, 0,0,0,0,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,1,0, 0,0,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,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_KCL[130] = // cmd #66 +static u8 option_allowed_cmd_KCL[131] = // cmd #66 { 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,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,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[130] = // cmd #67 +static u8 option_allowed_cmd_KMP[131] = // cmd #67 { 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,1,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,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,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[130] = // cmd #68 +static u8 option_allowed_cmd_LEX[131] = // 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,0,1,1, 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, 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,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,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[130] = // cmd #69 +static u8 option_allowed_cmd_INFO[131] = // cmd #69 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,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,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 }; -static u8 option_allowed_cmd_GHOST[130] = // cmd #70 +static u8 option_allowed_cmd_GHOST[131] = // cmd #70 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,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,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 }; -static u8 option_allowed_cmd_YAZDUMP[130] = // cmd #71 +static u8 option_allowed_cmd_YAZDUMP[131] = // 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,0,0, 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 }; -static u8 option_allowed_cmd_VEHICLE[130] = // cmd #72 +static u8 option_allowed_cmd_VEHICLE[131] = // 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,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,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 }; @@ -6277,6 +6289,7 @@ static const InfoOption_t * option_tab_cmd_TEXT[] = OptionInfo + OPT_DIFF, OptionInfo + OPT_EXPORT, OptionInfo + OPT_NO_PARAM, + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -6318,6 +6331,7 @@ static const InfoOption_t * option_tab_cmd_CAT[] = OptionInfo + OPT_DIFF, OptionInfo + OPT_EXPORT, OptionInfo + OPT_NO_PARAM, + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -6340,6 +6354,7 @@ static const InfoOption_t * option_tab_cmd_BMG[] = OptionInfo + OPT_IGNORE, &option_cmd_BMG_NO_HEADER, OptionInfo + OPT_BRIEF, + OptionInfo + OPT_BMG_ENDIAN, OptionInfo + OPT_BMG_ENCODING, OptionInfo + OPT_BMG_INF_SIZE, OptionInfo + OPT_BMG_MID, @@ -7633,7 +7648,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " ITEMSLOT, KCL, KMG, KMP, LEX, OBJFLOW, PAT and the related text" " formats.", 0, - 31, + 32, option_tab_cmd_TEXT, option_allowed_cmd_TEXT }, @@ -7649,7 +7664,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " and RARC archives. The output of all source files is concatenated" " and written to stdout.", 0, - 21, + 22, option_tab_cmd_CAT, option_allowed_cmd_CAT }, @@ -7665,7 +7680,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = " decoded and printed as combined BMG text file. The command works" " exactly like 'wbmgt MIX'.", 0, - 17, + 18, option_tab_cmd_BMG, option_allowed_cmd_BMG }, diff --git a/project/src/ui/ui-wszst.h b/project/src/ui/ui-wszst.h index ee85a24..bdeeeae 100644 --- a/project/src/ui/ui-wszst.h +++ b/project/src/ui/ui-wszst.h @@ -109,6 +109,7 @@ typedef enum enumOptions OPT_DELTA, OPT_DIFF, OPT_EPSILON, + OPT_BMG_ENDIAN, OPT_BMG_ENCODING, OPT_BMG_INF_SIZE, OPT_BMG_MID, @@ -186,7 +187,7 @@ typedef enum enumOptions OPT_RAW, OPT_SECTIONS, - OPT__N_SPECIFIC, // == 130 + OPT__N_SPECIFIC, // == 131 //----- global options ----- @@ -261,7 +262,7 @@ typedef enum enumOptions OPT_NEW, OPT_EXTRACT, - OPT__N_TOTAL // == 200 + OPT__N_TOTAL // == 201 } enumOptions; @@ -329,6 +330,7 @@ typedef enum enumOptions // OB_DELTA = 1llu << OPT_DELTA, // OB_DIFF = 1llu << OPT_DIFF, // OB_EPSILON = 1llu << OPT_EPSILON, +// OB_BMG_ENDIAN = 1llu << OPT_BMG_ENDIAN, // OB_BMG_ENCODING = 1llu << OPT_BMG_ENCODING, // OB_BMG_INF_SIZE = 1llu << OPT_BMG_INF_SIZE, // OB_BMG_MID = 1llu << OPT_BMG_MID, @@ -478,7 +480,8 @@ typedef enum enumOptions // | OB_EXPORT // | OB_NO_PARAM, // -// OB_GRP_BMG = OB_BMG_ENCODING +// OB_GRP_BMG = OB_BMG_ENDIAN +// | OB_BMG_ENCODING // | OB_BMG_INF_SIZE // | OB_BMG_MID // | OB_FORCE_ATTRIB @@ -1121,6 +1124,7 @@ typedef enum enumGetOpt GO_DELTA, GO_DIFF, GO_EPSILON, + GO_BMG_ENDIAN, GO_BMG_ENCODING, GO_BMG_INF_SIZE, GO_BMG_MID, diff --git a/project/src/ui/ui.def b/project/src/ui/ui.def index b0b8a3c..bf829ab 100644 --- a/project/src/ui/ui.def +++ b/project/src/ui/ui.def @@ -1243,9 +1243,17 @@ " short cut for --no-header --brief --brief --delta --delta." \ " Additional, the output is limited to data sections." ) +#:def_opt( "BMG_ENDIAN", "bmg-endian|bmgendian", "CP", \ + "name", \ + "Force an endian for new BMG files. Accepted values are @BIG@ or @BE@" \ + " for big endian, @LITTLE@ or @LE@ for little endian and @AUTO@ for" \ + " automatic detection (default).\n" \ + " Mario Kart Wii uses big endian; the default if no other endian is" \ + " defined." ) + #:def_opt( "BMG_ENCODING", "bmg-encoding|bmgencoding", "CP", \ "name", \ - "Force a BMG encoding for new BMG files. Accepted encoding names are:" \ + "Force an encoding for new BMG files. Accepted encoding names are" \ " @CP-1252@, @UTF-16BE@ (or @UTF-16@), @SHIFT-JIS@, @UTF-8@ and @AUTO@" \ " for automatic detection (default). Same keywords without minus signs" \ " are accepted too.\n" \ @@ -10161,6 +10169,10 @@ "", \ "" ) +#:def_cmd_opt( "TEXT", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "TEXT", "BMG_ENCODING", \ "", \ "" ) @@ -10278,6 +10290,10 @@ "", \ "" ) +#:def_cmd_opt( "CAT", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "CAT", "BMG_ENCODING", \ "", \ "" ) @@ -10343,6 +10359,10 @@ "", \ "" ) +#:def_cmd_opt( "BMG", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "BMG", "BMG_ENCODING", \ "", \ "" ) @@ -11359,9 +11379,17 @@ " With v2.01a, this option was renamed from --msg to the more" \ " meaningful name --filter-bmg. The old name is still available." ) +#:def_opt( "BMG_ENDIAN", "endian|bmg-endian|bmgendian", "CP", \ + "name", \ + "Force an endian for new BMG files. Accepted values are @BIG@ or @BE@" \ + " for big endian, @LITTLE@ or @LE@ for little endian and @AUTO@ for" \ + " automatic detection (default).\n" \ + " Mario Kart Wii uses big endian; the default if no other endian is" \ + " defined." ) + #:def_opt( "BMG_ENCODING", "encoding|bmg-encoding|bmgencoding", "CP", \ "name", \ - "Force a BMG encoding for new BMG files. Accepted encoding names are:" \ + "Force an encoding for new BMG files. Accepted encoding names are" \ " @CP-1252@, @UTF-16BE@ (or @UTF-16@), @SHIFT-JIS@, @UTF-8@ and @AUTO@" \ " for automatic detection (default). Same keywords without minus signs" \ " are accepted too.\n" \ @@ -11598,6 +11626,10 @@ "", \ "" ) +#:def_cmd_opt( "CAT", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "CAT", "BMG_ENCODING", \ "", \ "" ) @@ -11678,6 +11710,10 @@ "", \ "" ) +#:def_cmd_opt( "MIX", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "MIX", "BMG_ENCODING", \ "", \ "" ) @@ -11766,6 +11802,10 @@ "", \ "" ) +#:def_cmd_opt( "IDENTIFIER", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "IDENTIFIER", "BMG_ENCODING", \ "", \ "" ) @@ -11862,6 +11902,10 @@ "", \ "" ) +#:def_cmd_opt( "DECODE", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "DECODE", "BMG_ENCODING", \ "", \ "" ) @@ -11966,6 +12010,10 @@ "", \ "" ) +#:def_cmd_opt( "ENCODE", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "ENCODE", "BMG_ENCODING", \ "", \ "" ) @@ -12042,6 +12090,10 @@ "", \ "" ) +#:def_cmd_opt( "PATCH", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "PATCH", "BMG_ENCODING", \ "", \ "" ) @@ -12384,9 +12436,17 @@ "", \ "Print BMG messages as UTF-8 text without escape sequences." ) +#:def_opt( "BMG_ENDIAN", "bmg-endian|bmgendian", "CP", \ + "name", \ + "Force an endian for new BMG files. Accepted values are @BIG@ or @BE@" \ + " for big endian, @LITTLE@ or @LE@ for little endian and @AUTO@ for" \ + " automatic detection (default).\n" \ + " Mario Kart Wii uses big endian; the default if no other endian is" \ + " defined." ) + #:def_opt( "BMG_ENCODING", "bmg-encoding|bmgencoding", "CP", \ "name", \ - "Force a BMG encoding for new BMG files. Accepted encoding names are:" \ + "Force an encoding for new BMG files. Accepted encoding names are" \ " @CP-1252@, @UTF-16BE@ (or @UTF-16@), @SHIFT-JIS@, @UTF-8@ and @AUTO@" \ " for automatic detection (default). Same keywords without minus signs" \ " are accepted too.\n" \ @@ -12942,6 +13002,10 @@ "", \ "" ) +#:def_cmd_opt( "BMG", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "BMG", "BMG_ENCODING", \ "", \ "" ) @@ -13271,6 +13335,10 @@ "", \ "" ) +#:def_cmd_opt( "CREATE", "BMG_ENDIAN", \ + "", \ + "" ) + #:def_cmd_opt( "CREATE", "BMG_ENCODING", \ "", \ "" ) @@ -19084,9 +19152,9 @@ #:def_opt( "PERFMON", "perf-mon|perfmon", "CO", \ "[=mode]", \ "Enable or disable the performance monitor. Mode is one of @OFF@," \ - " @AUTO@ (default, don't change setting), @ON@ (enable it for Wii" \ - " only; default, if option is used without parameter) or @FORCE@" \ - " (enable it for Wii and for Dolphin)." ) + " @AUTO@ (default, don't change setting), @ON@ (enable it for Wii and" \ + " Wii U only; default, if option is used without parameter) or @FORCE@" \ + " (enable it for Wii, Wii U and for Dolphin)." ) #:def_opt( "CUSTOM_TT", "custom-tt|customtt", "CO", \ "[=mode]", \ @@ -19100,6 +19168,13 @@ " @OFF@, @AUTO@ (default) or @ON@ (default, if option is used without" \ " parameter). Disable it only for tests!" ) +#: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)." ) + #:def_opt( "TRACK_DIR", "track-dir|trackdir", "CP", \ "directory", \ "Define a destination directory, where track files are copied, moved" \ @@ -19368,6 +19443,10 @@ "", \ "" ) +#:def_cmd_opt( "DUMP", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "DUMP", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19413,6 +19492,10 @@ "", \ "" ) +#:def_cmd_opt( "DL", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "DL", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19458,6 +19541,10 @@ "", \ "" ) +#:def_cmd_opt( "DLL", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "DLL", "LONG", \ "", \ "For LE-CODE binaries: If set, print cups with tracks or arenas. For" \ @@ -19511,6 +19598,10 @@ "", \ "" ) +#:def_cmd_opt( "PATCH", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "PATCH", "TRACK_DIR", \ "", \ "" ) @@ -19599,6 +19690,10 @@ "", \ "" ) +#:def_cmd_opt( "LPAR", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "LPAR", "DEST", \ "", \ "" ) @@ -19735,6 +19830,30 @@ "", \ "" ) +#:def_cmd_opt( "CREATE", "ENGINE", \ + "", \ + "" ) + +#:def_cmd_opt( "CREATE", "200CC", \ + "", \ + "" ) + +#:def_cmd_opt( "CREATE", "PERFMON", \ + "", \ + "" ) + +#:def_cmd_opt( "CREATE", "CUSTOM_TT", \ + "", \ + "" ) + +#:def_cmd_opt( "CREATE", "XPFLAGS", \ + "", \ + "" ) + +#:def_cmd_opt( "CREATE", "SPEEDOMETER", \ + "", \ + "" ) + #:def_cmd_opt( "CAT", "COMPLETE", \ "", \ "" ) diff --git a/project/src/wbmgt.c b/project/src/wbmgt.c index 25ba0a9..23ffec3 100644 --- a/project/src/wbmgt.c +++ b/project/src/wbmgt.c @@ -61,7 +61,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WBMGT_SHORT ": " WBMGT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -96,7 +96,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) @@ -291,7 +291,7 @@ static enumError cmd_extract() //--- search sections - const bmg_sect_list_t *sl = ScanSectionsBMG(raw.data,raw.data_size); + const bmg_sect_list_t *sl = ScanSectionsBMG(raw.data,raw.data_size,0); #if 0 { const bmg_sect_info_t *si; @@ -374,7 +374,7 @@ static enumError cmd_sections() continue; } - const bmg_sect_list_t *sl = ScanSectionsBMG(raw.data,raw.data_size); + const bmg_sect_list_t *sl = ScanSectionsBMG(raw.data,raw.data_size,0); if (!sl) { ERROR0(ERR_INVALID_DATA,"Can't scan binary BMG file: %s",raw.fname); @@ -398,15 +398,16 @@ static enumError cmd_sections() const uint seplen = 3*(56+max_info_len); printf( "\n" "%sFile: %s\n" - "%sSize: 0x%x = %u bytes, %u sections, encoding #%u (%s)\n" + "%sSize: 0x%x = %u bytes%s, %u sections, encoding #%u (%s)\n" "%s%.*s\n" "%s offset size sect cut head n(elem) n(e)\n" "%s hex hex size size magic size *size cut info\n" "%s%.*s%s\n" , colout->heading, param->arg, - colout->heading, sl->source_size, sl->source_size, sl->n_sections, - sl->header->encoding, + colout->heading, sl->source_size, sl->source_size, + sl->endian->is_be ? " BE" : sl->endian->is_le ? " LE" : "", + sl->n_sections, sl->header->encoding, GetEncodingNameBMG(sl->header->encoding,"?"), colout->heading, seplen, ThinLine300_3, colout->heading, @@ -815,6 +816,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_NO_HEADER: print_header = false; break; case GO_BRIEF: brief_count++; break; + case GO_BMG_ENDIAN: err += ScanOptBmgEndian(optarg); break; case GO_BMG_ENCODING: err += ScanOptBmgEncoding(optarg); break; case GO_BMG_INF_SIZE: err += ScanOptBmgInfSize(optarg,true); break; case GO_BMG_MID: err += ScanOptBmgMid(optarg); break; diff --git a/project/src/wctct.c b/project/src/wctct.c index e31671e..6220f09 100644 --- a/project/src/wctct.c +++ b/project/src/wctct.c @@ -49,7 +49,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WCTCT_SHORT ": " WCTCT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) @@ -816,6 +816,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) print_header = output_mode.syntax = false; break; + case GO_BMG_ENDIAN: err += ScanOptBmgEndian(optarg); break; case GO_BMG_ENCODING: err += ScanOptBmgEncoding(optarg); break; case GO_BMG_INF_SIZE: err += ScanOptBmgInfSize(optarg,false); break; case GO_BMG_MID: err += ScanOptBmgMid(optarg); break; diff --git a/project/src/wimgt.c b/project/src/wimgt.c index d252be9..674b1ac 100644 --- a/project/src/wimgt.c +++ b/project/src/wimgt.c @@ -57,7 +57,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WIMGT_SHORT ": " WIMGT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -92,7 +92,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wkclt.c b/project/src/wkclt.c index 2ef0bf5..8be86b4 100644 --- a/project/src/wkclt.c +++ b/project/src/wkclt.c @@ -47,7 +47,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WKCLT_SHORT ": " WKCLT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE static const char autoname[] = "/course.kcl"; @@ -86,7 +86,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wkmpt.c b/project/src/wkmpt.c index b1709c2..29e1c83 100644 --- a/project/src/wkmpt.c +++ b/project/src/wkmpt.c @@ -50,7 +50,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WKMPT_SHORT ": " WKMPT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE static const char autoname[] = "/course.kmp"; @@ -87,7 +87,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wlect.c b/project/src/wlect.c index b5deded..7a02f5e 100644 --- a/project/src/wlect.c +++ b/project/src/wlect.c @@ -49,7 +49,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WLECT_SHORT ": " WLECT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE static const char autoname[] = "/course.lex"; @@ -88,7 +88,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) @@ -814,6 +814,7 @@ static enumError cmd_create() { le_lpar_t lpar; InitializeLPAR(&lpar,true); + PatchLPAR(&lpar); lpar.limit_mode = LPM_FORCE_AUTOMATIC; err = SaveTextLPAR(&lpar,"-",false); } @@ -1095,6 +1096,10 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_PERFMON: err += ScanOptPerfMon(optarg); break; 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_TRACK_DIR: opt_track_dest = optarg; break; case GO_COPY_TRACKS: err += ScanOptTrackSource(optarg,TFMD_COPY); break; @@ -1123,6 +1128,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) #if 0 // BMG disabled for wlect case GO_RAW: raw_mode = true; break; + case GO_BMG_ENDIAN: err += ScanOptBmgEndian(optarg); break; case GO_BMG_ENCODING: err += ScanOptBmgEncoding(optarg); break; case GO_BMG_INF_SIZE: err += ScanOptBmgInfSize(optarg,false); break; case GO_BMG_MID: err += ScanOptBmgMid(optarg); break; diff --git a/project/src/wmdlt.c b/project/src/wmdlt.c index 8b112a3..9109f5c 100644 --- a/project/src/wmdlt.c +++ b/project/src/wmdlt.c @@ -46,7 +46,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WMDLT_SHORT ": " WMDLT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -81,7 +81,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wpatt.c b/project/src/wpatt.c index 09c9814..a5b9905 100644 --- a/project/src/wpatt.c +++ b/project/src/wpatt.c @@ -46,7 +46,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WPATT_SHORT ": " WPATT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -81,7 +81,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wstrt.c b/project/src/wstrt.c index a73248a..442249e 100644 --- a/project/src/wstrt.c +++ b/project/src/wstrt.c @@ -58,7 +58,7 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WSTRT_SHORT ": " WSTRT_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -93,7 +93,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) diff --git a/project/src/wszst.c b/project/src/wszst.c index 366f4a7..9f85a58 100644 --- a/project/src/wszst.c +++ b/project/src/wszst.c @@ -71,10 +71,10 @@ /////////////////////////////////////////////////////////////////////////////// #define TITLE WSZST_SHORT ": " WSZST_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE #define TOOLSET_TITLE TOOLSET_SHORT ": " TOOLSET_LONG " v" VERSION " r" REVISION \ - " " SYSTEM " - " AUTHOR " - " DATE + " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -187,7 +187,7 @@ static void version_exit() if ( brief_count > 1 ) fputs( VERSION "\n", stdout ); else if (brief_count) - fputs( VERSION " r" REVISION " " SYSTEM "\n", stdout ); + fputs( VERSION " r" REVISION " " SYSTEM2 "\n", stdout ); else if (print_sections) print_version_section(true); else if (long_count) @@ -1210,7 +1210,7 @@ enumError cmd_brsub() cb.szs = &szs; cb.mode = long_count; cb.sep_fw = 3*99; - IterateFilesSZS(&szs,check_brsub,&cb,false,-1,-1,SORT_NONE); + IterateFilesParSZS(&szs,check_brsub,&cb,false,false,-1,-1,SORT_NONE); line_count += cb.line_count; if ( print_header && cb.header_printed ) @@ -1345,9 +1345,9 @@ static enumError cmd_list ( int long_level ) printf("\n* Files of %s\n",param->arg); if ( long_count > 2 ) - IterateFilesSZS(&szs,PrintFileSZS,0,true,opt_recurse,opt_cut,opt_sort); + IterateFilesParSZS(&szs,PrintFileSZS,0,false,true,opt_recurse,opt_cut,opt_sort); else - IterateFilesSZS(&szs,list_func,0,false,opt_recurse,opt_cut,opt_sort); + IterateFilesParSZS(&szs,list_func,0,false,false,opt_recurse,opt_cut,opt_sort); ResetSZS(&szs); } @@ -1482,7 +1482,7 @@ static enumError cmd_ilist ( int long_level ) else if ( n_param > 1 ) printf("\n* Files of %s\n",param->arg); - IterateFilesSZS(&szs,ilist_func,0,false,-1,0,opt_sort); + IterateFilesParSZS(&szs,ilist_func,0,false,false,-1,0,opt_sort); ResetSZS(&szs); } @@ -1647,7 +1647,7 @@ static enumError cmd_memory() Minus300 ); } - IterateFilesSZS(&szs,memory_func,&dm,false,opt_recurse,opt_cut,SORT_OFFSET); + IterateFilesParSZS(&szs,memory_func,&dm,false,false,opt_recurse,opt_cut,SORT_OFFSET); ResetSZS(&szs); } @@ -1738,7 +1738,7 @@ static enumError cmd_sha1() return err; } - if ( opt_norm || need_norm > 0 ) + if ( opt_norm || need_norm > 0 || opt_rm_aiparam ) NormalizeSZS(&szs); char checksum[100]; @@ -1854,6 +1854,27 @@ static enumError cmd_sha1() /////////////// command analyze /////////////// /////////////////////////////////////////////////////////////////////////////// +static void SetupPrintScript ( PrintScript_t *ps ) +{ + DASSERT(ps); + + InitializePrintScript(ps); + ps->varname = script_varname; + ps->create_array = script_array > 0; + + 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"; @@ -1873,8 +1894,7 @@ static enumError cmd_analyze() InitializeFile(&fo); PrintScript_t ps; - InitializePrintScript(&ps); - ps.fo = &fo; + SetupPrintScript(&ps); ParamList_t *param; for ( param = first_param; param; param = param->next ) @@ -1928,6 +1948,7 @@ static enumError cmd_analyze() max_err = err; break; } + ps.f = fo.f; PrintScriptHeader(&ps); } @@ -2054,6 +2075,7 @@ static enumError cmd_analyze() if (!script_array) { PrintScriptFooter(&ps); + ps.f = 0; ResetFile(&fo,0); } } @@ -4113,7 +4135,7 @@ static enumError job_update up.update_sub = recurse_level < opt_recurse; up.indent = indent + 2; - IterateFilesSZS(szs,update_func,&up,false,0,-1,SORT_NONE); + IterateFilesParSZS(szs,update_func,&up,false,false,0,-1,SORT_NONE); return ERR_OK; } @@ -4745,8 +4767,7 @@ static enumError cmd_ghost() InitializeFile(&fo); PrintScript_t ps; - InitializePrintScript(&ps); - ps.fo = &fo; + SetupPrintScript(&ps); ParamList_t *param; for ( param = first_param; param; param = param->next ) @@ -4787,6 +4808,7 @@ static enumError cmd_ghost() max_err = err; break; } + ps.f = fo.f; PrintScriptHeader(&ps); } @@ -4816,6 +4838,7 @@ static enumError cmd_ghost() if (!script_array) { PrintScriptFooter(&ps); + ps.f = 0; ResetFile(&fo,0); } } @@ -5113,6 +5136,7 @@ static enumError CheckOptions ( int argc, char ** argv, bool is_env ) case GO_NO_PARAM: print_param = false; break; case GO_EPSILON: err += ScanOptEpsilon(optarg); break; + case GO_BMG_ENDIAN: err += ScanOptBmgEndian(optarg); break; case GO_BMG_ENCODING: err += ScanOptBmgEncoding(optarg); break; case GO_BMG_INF_SIZE: err += ScanOptBmgInfSize(optarg,false); break; case GO_BMG_MID: err += ScanOptBmgMid(optarg); break; diff --git a/project/src/wtest.c b/project/src/wtest.c index 83e2d81..8aadaab 100644 --- a/project/src/wtest.c +++ b/project/src/wtest.c @@ -72,7 +72,7 @@ #define NAME "wtest" #undef TITLE -#define TITLE NAME " v" VERSION " r" REVISION " " SYSTEM " - " AUTHOR " - " DATE +#define TITLE NAME " v" VERSION " r" REVISION " " SYSTEM2 " - " AUTHOR " - " DATE // /////////////////////////////////////////////////////////////////////////////// @@ -3758,6 +3758,43 @@ static enumError test_clock ( int argc, char ** argv ) // /////////////////////////////////////////////////////////////////////////////// +/////////////// test_endian() /////////////// +/////////////////////////////////////////////////////////////////////////////// + +static enumError test_endian ( int argc, char ** argv ) +{ + const int verbose = argc > 1 ? str2l(argv[1],0,0) : 0; + + printf("IS_BIG_ENDIAN=%d, IS_LITTLE_ENDIAN=%d\n\n", + IS_BIG_ENDIAN, IS_LITTLE_ENDIAN ); + + printf("BE_FUNC: bom=%02x,%02x, is_be=%u, is_le=%u, endian=%d\n", + be_func.bom[0], be_func.bom[1], + be_func.is_be, be_func.is_le, be_func.endian ); + if (verbose) + HexDump16(stdout,0,0,&be_func,sizeof(be_func)); + + printf("LE_FUNC: bom=%02x,%02x, is_be=%u, is_le=%u, endian=%d\n", + le_func.bom[0], le_func.bom[1], + le_func.is_be, le_func.is_le, le_func.endian ); + if (verbose) + HexDump16(stdout,0,0,&le_func,sizeof(le_func)); + 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) ); + printf("LE: h2n(1) = %x %x %llx / n2h(1) = %x %x %llx\n", + le_func.h2ns(1), le_func.h2nl(1), le_func.h2n64(1), + le_func.n2hs(1), le_func.n2hl(1), le_func.n2h64(1) ); + putchar('\n'); + return 0; +} + +// +/////////////////////////////////////////////////////////////////////////////// /////////////// develop() /////////////// /////////////////////////////////////////////////////////////////////////////// @@ -3990,6 +4027,7 @@ enum CMD_SLOT_ATTRIB, // test_slot_attrib(argc,argv) CMD_SLOT_INFO, // test_slot_info(argc,argv) CMD_CLOCK, // test_clock(argc,argv) + CMD_ENDIAN, // test_endian(argc,argv) CMD__N }; @@ -4047,6 +4085,7 @@ static const KeywordTab_t CommandTab[] = { CMD_SLOT_ATTRIB, "SLOT-ATTRIB", "SA", 0 }, { CMD_SLOT_INFO, "SLOT-INFO", "SI", 0 }, { CMD_CLOCK, "CLOCK", 0, 0 }, + { CMD_ENDIAN, "ENDIAN", 0, 0 }, { CMD__N,0,0,0 } }; @@ -4175,6 +4214,7 @@ int main ( int argc, char ** argv ) case CMD_SLOT_ATTRIB: test_slot_attrib(argc,argv); break; 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_HELP: default: help_exit(); |
