aboutsummaryrefslogtreecommitdiff
path: root/project/dclib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--project/dclib/dclib-basics.c11
-rw-r--r--project/dclib/dclib-basics.h84
-rw-r--r--project/dclib/dclib-file.c2
-rw-r--r--project/dclib/dclib-numeric.c135
-rw-r--r--project/dclib/dclib-numeric.h34
-rw-r--r--project/dclib/dclib-types.h70
-rw-r--r--project/dclib/dclib-ui.c44
-rw-r--r--project/dclib/lib-bmg.c5
-rw-r--r--project/dclib/lib-bmg.h28
-rw-r--r--project/dclib/lib-dol.h4
-rw-r--r--project/dclib/lib-mkw-def.c2
-rw-r--r--project/dclib/lib-mkw.h2
12 files changed, 309 insertions, 112 deletions
diff --git a/project/dclib/dclib-basics.c b/project/dclib/dclib-basics.c
index bcf1012..094c189 100644
--- a/project/dclib/dclib-basics.c
+++ b/project/dclib/dclib-basics.c
@@ -2466,6 +2466,17 @@ void ResetFastBuf ( FastBuf_t *fb )
///////////////////////////////////////////////////////////////////////////////
+int SetFastBufLen ( FastBuf_t *fb, uint max_size )
+{
+ DASSERT(fb);
+ const uint cur_len = GetFastBufLen(fb);
+ if ( max_size < cur_len )
+ fb->ptr = fb->buf + max_size;
+ return GetFastBufLen(fb);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
ccp GetFastBufStatus ( const FastBuf_t *fb )
{
char info[100];
diff --git a/project/dclib/dclib-basics.h b/project/dclib/dclib-basics.h
index 5e6edc9..dd56ecb 100644
--- a/project/dclib/dclib-basics.h
+++ b/project/dclib/dclib-basics.h
@@ -2043,10 +2043,14 @@ FastBuf_t;
FastBuf_t * InitializeFastBuf ( void * mem, uint size );
FastBuf_t * InitializeFastBufAlloc ( FastBuf_t *fb, uint size );
-void ResetFastBuf ( FastBuf_t *fb );
+void ResetFastBuf ( FastBuf_t *fb );
static inline void ClearFastBuf ( FastBuf_t *fb )
{ DASSERT(fb); fb->ptr = fb->buf; }
+int SetFastBufLen ( FastBuf_t *fb, uint max_size );
+static inline int GetFastBufLen ( const FastBuf_t *fb )
+ { DASSERT(fb); return fb->ptr - fb->buf; }
+
ccp GetFastBufStatus ( const FastBuf_t *fb );
int ReserveSpaceFastBuf ( FastBuf_t *fb, uint size );
char * GetSpaceFastBuf ( FastBuf_t *fb, uint size );
@@ -2083,9 +2087,6 @@ static inline void AppendU32FastBuf ( FastBuf_t *fb, u32 num )
static inline void AppendU64FastBuf ( FastBuf_t *fb, u64 num )
{ AppendFastBuf(fb,&num,sizeof(num)); }
-static inline int GetFastBufLen ( const FastBuf_t *fb )
- { DASSERT(fb); return fb->ptr - fb->buf; }
-
//-----------------------------------------------------------------------------
// The resulting strings of GetFastBufString() and GetFastBufMem0() are always
// terminated by an additional NULL byte.
@@ -2844,10 +2845,14 @@ typedef enum CharMode_t // select encodig/decoding method
CHMD_UTF8 = 0x01, // UTF8 support enabled (compatible with legacy bool)
CHMD_ESC = 0x02, // escape ESC by \e
CHMD_PIPE = 0x04, // escape pipes '|' to '\!'
- CHMD_IF_REQUIRED = 0x08, // check for special chars and encode only if required
- CHMD__ALL = 0x0f,
+ CHMD_SH = 0x08, // escape for sh '...' => use "'" for '
+ CHMD_BASH = 0x10, // escape for bash $'...': \ ' " (ignore CHMD_SH)
+ CHMD_IF_REQUIRED = 0x20, // check for special chars and encode only if required
+ CHMD__ALL = 0x3f,
CHMD__MODERN = CHMD_UTF8 | CHMD_ESC,
+ CHMD__SH = CHMD_UTF8 | CHMD_ESC | CHMD_SH,
+ CHMD__BASH = CHMD_UTF8 | CHMD_ESC | CHMD_BASH,
CHMD__PIPE8 = CHMD__MODERN | CHMD_PIPE | CHMD_IF_REQUIRED,
}
__attribute__ ((packed)) CharMode_t;
@@ -3554,6 +3559,7 @@ typedef int (*KeywordListFuncKey)
);
//-----------------------------------------------------------------------------
+// [[KeyListParam_t]]
typedef struct KeyListParam_t
{
@@ -4479,72 +4485,6 @@ enumError ScanSizeOptU32
///////////////////////////////////////////////////////////////////////////////
/////////////// time & timer ///////////////
///////////////////////////////////////////////////////////////////////////////
-
-//--- conversion factors
-
-#define SEC_PER_MIN 60
-#define SEC_PER_HOUR 3600
-#define SEC_PER_DAY 86400
-#define SEC_PER_WEEK 604800
-#define SEC_PER_MONTH 2629746 // 365.2425 * SEC_PER_DAY / 12
-#define SEC_PER_QUARTER 7889238 // 365.2425 * SEC_PER_DAY / 4
-#define SEC_PER_YEAR 31556952 // 365.2425 * SEC_PER_DAY
-
-#define MSEC_PER_SEC 1000ll
-#define MSEC_PER_MIN (MSEC_PER_SEC*SEC_PER_MIN)
-#define MSEC_PER_HOUR (MSEC_PER_SEC*SEC_PER_HOUR)
-#define MSEC_PER_DAY (MSEC_PER_SEC*SEC_PER_DAY)
-#define MSEC_PER_WEEK (MSEC_PER_SEC*SEC_PER_WEEK)
-#define MSEC_PER_MONTH (MSEC_PER_SEC*SEC_PER_MONTH)
-#define MSEC_PER_QUARTER (MSEC_PER_SEC*SEC_PER_QUARTER)
-#define MSEC_PER_YEAR (MSEC_PER_SEC*SEC_PER_YEAR)
-
-#define USEC_PER_MSEC 1000ll
-#define USEC_PER_SEC 1000000ll
-#define USEC_PER_MIN (USEC_PER_SEC*SEC_PER_MIN)
-#define USEC_PER_HOUR (USEC_PER_SEC*SEC_PER_HOUR)
-#define USEC_PER_DAY (USEC_PER_SEC*SEC_PER_DAY)
-#define USEC_PER_WEEK (USEC_PER_SEC*SEC_PER_WEEK)
-#define USEC_PER_MONTH (USEC_PER_SEC*SEC_PER_MONTH)
-#define USEC_PER_QUARTER (USEC_PER_SEC*SEC_PER_QUARTER)
-#define USEC_PER_YEAR (USEC_PER_SEC*SEC_PER_YEAR)
-
-#define NSEC_PER_USEC 1000ll
-#define NSEC_PER_MSEC 1000000ll
-#define NSEC_PER_SEC 1000000000ll
-#define NSEC_PER_MIN (NSEC_PER_SEC*SEC_PER_MIN)
-#define NSEC_PER_HOUR (NSEC_PER_SEC*SEC_PER_HOUR)
-#define NSEC_PER_DAY (NSEC_PER_SEC*SEC_PER_DAY)
-#define NSEC_PER_WEEK (NSEC_PER_SEC*SEC_PER_WEEK)
-#define NSEC_PER_MONTH (NSEC_PER_SEC*SEC_PER_MONTH)
-#define NSEC_PER_QUARTER (NSEC_PER_SEC*SEC_PER_QUARTER)
-#define NSEC_PER_YEAR (NSEC_PER_SEC*SEC_PER_YEAR)
-
-
-//--- time types
-
-typedef uint u_sec_t; // unsigned type to store time as seconds
-typedef int s_sec_t; // signed type to store time as seconds
-typedef u64 u_msec_t; // unsigned type to store time as milliseconds
-typedef s64 s_msec_t; // signed type to store time as milliseconds
-typedef u64 u_usec_t; // unsigned type to store time as microseconds
-typedef s64 s_usec_t; // signed type to store time as microseconds
-typedef u64 u_nsec_t; // unsigned type to store time as nanoseconds
-typedef s64 s_nsec_t; // signed type to store time as nanoseconds
-
-
-//--- max values time types
-
-#define S_SEC_MAX S32_MAX
-#define U_SEC_MAX U32_MAX
-#define S_MSEC_MAX S64_MAX
-#define U_MSEC_MAX U64_MAX
-#define S_USEC_MAX S64_MAX
-#define U_USEC_MAX U64_MAX
-#define S_NSEC_MAX S64_MAX
-#define U_NSEC_MAX U64_MAX
-
-//-----------------------------------------------------------------------------
// [[DayTime_t]]
typedef struct DayTime_t
{
diff --git a/project/dclib/dclib-file.c b/project/dclib/dclib-file.c
index 069d932..c88569e 100644
--- a/project/dclib/dclib-file.c
+++ b/project/dclib/dclib-file.c
@@ -1677,7 +1677,7 @@ enumError WriteFileAt
}
}
- noPRINT("WRITE %zx @%zx -> %zx\n",size,offset,offset+size);
+ PRINT0("WRITE %zx @%zx -> %zx\n",size,offset,offset+size);
const size_t written = fwrite(data,1,size,F->f);
if ( written != size )
return ERROR1(ERR_WRITE_FAILED,"Writing %zu bytes at offset %zu failed: %s\n",
diff --git a/project/dclib/dclib-numeric.c b/project/dclib/dclib-numeric.c
index 8cbff8d..7c23129 100644
--- a/project/dclib/dclib-numeric.c
+++ b/project/dclib/dclib-numeric.c
@@ -1245,11 +1245,18 @@ uint GetEscapeLen
)
{
const CharMode_t utf8 = char_mode & CHMD_UTF8;
+ const CharMode_t for_bash = char_mode & CHMD_BASH;
+ const bool for_sh = char_mode & CHMD_SH && !for_bash;
const int esc_size = char_mode & CHMD_ESC ? 1 : 3;
const int pipe_size = char_mode & CHMD_PIPE ? 1 : 0;
if ( !source || !*source )
return 0;
+
+ // force no-quotes for shell modes
+ if ( for_bash || for_sh )
+ quote = 0;
+
ccp str = source;
ccp end = src_len < 0 ? 0 : str + src_len;
@@ -1262,7 +1269,7 @@ uint GetEscapeLen
case 0:
if (!end)
return size;
- size += 3;
+ size += for_sh ? -1 : 3;
break;
case '\\':
@@ -1273,17 +1280,26 @@ uint GetEscapeLen
case '\r':
case '\t':
case '\v':
- size++;
+ if (!for_sh)
+ size++;
break;
case '\033':
- size += esc_size;
+ if (!for_sh)
+ size += esc_size;
break;
case '|':
size += pipe_size;
break;
+ case '\'':
+ if (for_bash)
+ size += 1;
+ else if (for_sh)
+ size += 4;
+ break;
+
default:
if ( ch == quote )
size++;
@@ -1317,9 +1333,15 @@ char * PrintEscapedString
DASSERT(buf_size>=10);
const CharMode_t utf8 = char_mode & CHMD_UTF8;
+ const CharMode_t for_bash = char_mode & CHMD_BASH;
+ const bool for_sh = char_mode & CHMD_SH && !for_bash;
const CharMode_t allow_e = char_mode & CHMD_ESC;
const CharMode_t esc_pipe = char_mode & CHMD_PIPE;
+ // force no-quotes for shell modes
+ if ( for_bash || for_sh )
+ quote = 0;
+
char *dest = buf;
char *dest_end = dest + buf_size - 4;
@@ -1339,30 +1361,38 @@ char * PrintEscapedString
str--;
goto eos;
}
- *dest++ = '\\';
- *dest++ = 'x';
- *dest++ = '0';
- *dest++ = '0';
+ if (!for_sh)
+ {
+ *dest++ = '\\';
+ *dest++ = 'x';
+ *dest++ = '0';
+ *dest++ = '0';
+ }
break;
- case '\\': *dest++ = '\\'; *dest++ = '\\'; break;
- case '\a': *dest++ = '\\'; *dest++ = 'a'; break;
- case '\b': *dest++ = '\\'; *dest++ = 'b'; break;
- case '\f': *dest++ = '\\'; *dest++ = 'f'; break;
- case '\n': *dest++ = '\\'; *dest++ = 'n'; break;
- case '\r': *dest++ = '\\'; *dest++ = 'r'; break;
- case '\t': *dest++ = '\\'; *dest++ = 't'; break;
- case '\v': *dest++ = '\\'; *dest++ = 'v'; break;
+ case '\\': if (!for_sh) *dest++ = '\\'; *dest++ = '\\'; break;
+ case '\a': if (!for_sh) *dest++ = '\\'; *dest++ = 'a'; break;
+ case '\b': if (!for_sh) *dest++ = '\\'; *dest++ = 'b'; break;
+ case '\f': if (!for_sh) *dest++ = '\\'; *dest++ = 'f'; break;
+ case '\n': if (!for_sh) *dest++ = '\\'; *dest++ = 'n'; break;
+ case '\r': if (!for_sh) *dest++ = '\\'; *dest++ = 'r'; break;
+ case '\t': if (!for_sh) *dest++ = '\\'; *dest++ = 't'; break;
+ case '\v': if (!for_sh) *dest++ = '\\'; *dest++ = 'v'; break;
case '\033':
- *dest++ = '\\';
- if (allow_e)
- *dest++ = 'e';
+ if (for_sh)
+ *dest++ = '\033';
else
{
- *dest++ = 'x';
- *dest++ = '1';
- *dest++ = 'B';
+ *dest++ = '\\';
+ if (allow_e)
+ *dest++ = 'e';
+ else
+ {
+ *dest++ = 'x';
+ *dest++ = '1';
+ *dest++ = 'B';
+ }
}
break;
@@ -1376,6 +1406,24 @@ char * PrintEscapedString
*dest++ = '|';
break;
+ case '\'':
+ if (for_bash)
+ {
+ *dest++ = '\\';
+ *dest++ = '\'';
+ }
+ else if (for_sh)
+ {
+ *dest++ = '\'';
+ *dest++ = '\"';
+ *dest++ = '\'';
+ *dest++ = '\"';
+ *dest++ = '\'';
+ }
+ else
+ *dest++ = '\'';
+ break;
+
default:
if ( ch == quote )
{
@@ -9875,6 +9923,51 @@ char * PrintIP4ByMode
//
///////////////////////////////////////////////////////////////////////////////
+/////////////// progress helper ///////////////
+///////////////////////////////////////////////////////////////////////////////
+
+void StartProgress ( progress_t *pr, u_msec_t interval_msec )
+{
+ DASSERT(PR);
+ ResetProgress(pr);
+ pr->interval_msec = interval_msec;
+ pr->start_msec = GetTimerMSec();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CheckProgress ( progress_t *pr )
+{
+ DASSERT(PR);
+ if ( pr->interval_msec > 0 && pr->counter != pr->last_counter )
+ {
+ const u_msec_t now = GetTimerMSec();
+ if ( now >= pr->last_log_msec + pr->interval_msec )
+ {
+ pr->last_log_msec = now;
+ pr->last_counter = pr->counter;
+ return true;
+ }
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FinalProgress ( progress_t *pr )
+{
+ DASSERT(PR);
+ if ( pr->interval_msec > 0 && pr->counter != pr->last_counter )
+ {
+ pr->last_log_msec = GetTimerMSec();
+ pr->last_counter = pr->counter;
+ return true;
+ }
+ return false;
+}
+
+//
+///////////////////////////////////////////////////////////////////////////////
/////////////// CRC16 ///////////////
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/dclib/dclib-numeric.h b/project/dclib/dclib-numeric.h
index 1ad805c..c2ddf3b 100644
--- a/project/dclib/dclib-numeric.h
+++ b/project/dclib/dclib-numeric.h
@@ -261,6 +261,40 @@ bool IsSameD3 ( const double *a, const double *b, int bit_diff );
//
///////////////////////////////////////////////////////////////////////////////
+/////////////// progress helper ///////////////
+///////////////////////////////////////////////////////////////////////////////
+// [[progress_t]]
+
+// [[doxygen]]
+typedef struct progress_t
+{
+ // all times are set by GetTimerMSec()
+
+ u_msec_t interval_msec; // 0=off, >0: minimum distance between 2 logs
+ u_msec_t start_msec; // start time of progress
+ u_msec_t last_log_msec; // time of last log
+ uint counter; // current counter
+ uint last_counter; // count at last log
+}
+progress_t;
+
+//-----------------------------------------------------------------------------
+
+void StartProgress ( progress_t *pr, u_msec_t interval_msec );
+bool CheckProgress ( progress_t *pr );
+bool FinalProgress ( progress_t *pr );
+
+static inline void ResetProgress ( progress_t *pr )
+ { DASSERT(pr); memset(pr,0,sizeof(*pr)); }
+
+static inline uint IncrementProgress ( progress_t *pr )
+ { DASSERT(pr); return ++pr->counter; }
+
+static inline uint AddProgress ( progress_t *pr, uint add )
+ { DASSERT(pr); return pr->counter += add; }
+
+//
+///////////////////////////////////////////////////////////////////////////////
/////////////// 2D vector functions ///////////////
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/dclib/dclib-types.h b/project/dclib/dclib-types.h
index 2dc2855..e14682d 100644
--- a/project/dclib/dclib-types.h
+++ b/project/dclib/dclib-types.h
@@ -477,6 +477,76 @@ typedef int (*qsort_r_func)( const void *, const void *, void * );
//
///////////////////////////////////////////////////////////////////////////////
+/////////////// time & timer ///////////////
+///////////////////////////////////////////////////////////////////////////////
+
+
+//--- conversion factors
+
+#define SEC_PER_MIN 60
+#define SEC_PER_HOUR 3600
+#define SEC_PER_DAY 86400
+#define SEC_PER_WEEK 604800
+#define SEC_PER_MONTH 2629746 // 365.2425 * SEC_PER_DAY / 12
+#define SEC_PER_QUARTER 7889238 // 365.2425 * SEC_PER_DAY / 4
+#define SEC_PER_YEAR 31556952 // 365.2425 * SEC_PER_DAY
+
+#define MSEC_PER_SEC 1000ll
+#define MSEC_PER_MIN (MSEC_PER_SEC*SEC_PER_MIN)
+#define MSEC_PER_HOUR (MSEC_PER_SEC*SEC_PER_HOUR)
+#define MSEC_PER_DAY (MSEC_PER_SEC*SEC_PER_DAY)
+#define MSEC_PER_WEEK (MSEC_PER_SEC*SEC_PER_WEEK)
+#define MSEC_PER_MONTH (MSEC_PER_SEC*SEC_PER_MONTH)
+#define MSEC_PER_QUARTER (MSEC_PER_SEC*SEC_PER_QUARTER)
+#define MSEC_PER_YEAR (MSEC_PER_SEC*SEC_PER_YEAR)
+
+#define USEC_PER_MSEC 1000ll
+#define USEC_PER_SEC 1000000ll
+#define USEC_PER_MIN (USEC_PER_SEC*SEC_PER_MIN)
+#define USEC_PER_HOUR (USEC_PER_SEC*SEC_PER_HOUR)
+#define USEC_PER_DAY (USEC_PER_SEC*SEC_PER_DAY)
+#define USEC_PER_WEEK (USEC_PER_SEC*SEC_PER_WEEK)
+#define USEC_PER_MONTH (USEC_PER_SEC*SEC_PER_MONTH)
+#define USEC_PER_QUARTER (USEC_PER_SEC*SEC_PER_QUARTER)
+#define USEC_PER_YEAR (USEC_PER_SEC*SEC_PER_YEAR)
+
+#define NSEC_PER_USEC 1000ll
+#define NSEC_PER_MSEC 1000000ll
+#define NSEC_PER_SEC 1000000000ll
+#define NSEC_PER_MIN (NSEC_PER_SEC*SEC_PER_MIN)
+#define NSEC_PER_HOUR (NSEC_PER_SEC*SEC_PER_HOUR)
+#define NSEC_PER_DAY (NSEC_PER_SEC*SEC_PER_DAY)
+#define NSEC_PER_WEEK (NSEC_PER_SEC*SEC_PER_WEEK)
+#define NSEC_PER_MONTH (NSEC_PER_SEC*SEC_PER_MONTH)
+#define NSEC_PER_QUARTER (NSEC_PER_SEC*SEC_PER_QUARTER)
+#define NSEC_PER_YEAR (NSEC_PER_SEC*SEC_PER_YEAR)
+
+
+//--- time types
+
+typedef uint u_sec_t; // unsigned type to store time as seconds
+typedef int s_sec_t; // signed type to store time as seconds
+typedef u64 u_msec_t; // unsigned type to store time as milliseconds
+typedef s64 s_msec_t; // signed type to store time as milliseconds
+typedef u64 u_usec_t; // unsigned type to store time as microseconds
+typedef s64 s_usec_t; // signed type to store time as microseconds
+typedef u64 u_nsec_t; // unsigned type to store time as nanoseconds
+typedef s64 s_nsec_t; // signed type to store time as nanoseconds
+
+
+//--- max values time types
+
+#define S_SEC_MAX S32_MAX
+#define U_SEC_MAX U32_MAX
+#define S_MSEC_MAX S64_MAX
+#define U_MSEC_MAX U64_MAX
+#define S_USEC_MAX S64_MAX
+#define U_USEC_MAX U64_MAX
+#define S_NSEC_MAX S64_MAX
+#define U_NSEC_MAX U64_MAX
+
+//
+///////////////////////////////////////////////////////////////////////////////
/////////////// sockaddr + IPv* support ///////////////
///////////////////////////////////////////////////////////////////////////////
// [[sockaddr_t]] [[sockaddr_in_t]]
diff --git a/project/dclib/dclib-ui.c b/project/dclib/dclib-ui.c
index 25f5702..3933822 100644
--- a/project/dclib/dclib-ui.c
+++ b/project/dclib/dclib-ui.c
@@ -436,6 +436,50 @@ void DumpText
}
break;
+ case '\xc2':
+ if (is_makedoc)
+ {
+ #if 1
+ uint code = 0;
+ switch (text[1])
+ {
+ case '\xab': // «
+ case '\xbb': // »
+ code = text[1];
+ break;
+ }
+
+ if (code)
+ {
+ *dest++ = code;
+ text += 2;
+ break;
+ }
+ #else
+ ccp str = 0;
+ switch (text[1])
+ {
+ case '\xab': // «
+ str = "&raquo;";
+ break;
+
+ case '\xbb': // »
+ str = "&laquo;";
+ break;
+ }
+
+ if (str)
+ {
+ strcpy(dest,str);
+ dest += strlen(str);
+ text += 2;
+ break;
+ }
+ #endif
+ }
+ *dest++ = *text++;
+ break;
+
case '@':
case '$':
if (!is_makedoc)
diff --git a/project/dclib/lib-bmg.c b/project/dclib/lib-bmg.c
index d3a98ed..aaeb8b8 100644
--- a/project/dclib/lib-bmg.c
+++ b/project/dclib/lib-bmg.c
@@ -4358,10 +4358,10 @@ enumError SaveTextFileBMG
{ MID_LE_ALT_ARENA_BEG, "LE-CODE: alternative arena names for random slots" },
{ MID_LE_ALT_ARENA_END, 0 },
- { MID_LE_CUP_BEG, "LE-CODE: cup names" },
- { MID_LE_CUP_END, 0 },
{ MID_LE_TRACK_BEG, "LE-CODE: track names" },
{ MID_LE_TRACK_END, 0 },
+ { MID_LE_CUP_BEG, "LE-CODE: cup names" },
+ { MID_LE_CUP_END, 0 },
{ MID_LE_CUP_REF_BEG, "LE-CODE: track-to-cup reference" },
{ MID_LE_CUP_REF_END, 0 },
@@ -6084,6 +6084,7 @@ bool PatchFillBMG
bmg_item_t * dptr = InsertItemBMG(bmg,mid,0,0,&old_item);
if ( !old_item || !dptr->len )
{
+// [[%04x-]] no access to lecode_04x
const uint len
= snprintf(buf,sizeof(buf),"_T%03X_",mid-ctb.track_name1.beg);
AssignItemTextBMG(dptr,buf,len);
diff --git a/project/dclib/lib-bmg.h b/project/dclib/lib-bmg.h
index 81ac813..7614558 100644
--- a/project/dclib/lib-bmg.h
+++ b/project/dclib/lib-bmg.h
@@ -142,40 +142,40 @@ enum
//-- LE-CODE
- BMG_N_LE_RCUP = 0x400,
+ BMG_N_LE_RCUP = 0x800,
BMG_N_LE_BCUP = 2,
- BMG_N_LE_TRACK = 0x1000,
+ BMG_N_LE_TRACK = 0x2000,
BMG_N_LE_ARENA = BMG_N_ARENA,
BMG_LE_FIRST_CTRACK = 0x44,
MID_LE_ALT_ARENA_BEG = 0x6400, // alternate BMG of MID_LE_TRACK_BEG for arenas
MID_LE_ALT_ARENA_END = 0x6480,
- MID_LE_CUP_BEG = 0x6800,
+ MID_LE_TRACK_BEG = 0x7000,
+ MID_LE_TRACK_END = MID_LE_TRACK_BEG + BMG_N_LE_TRACK,
+ MID_LE_ARENA_BEG = MID_LE_TRACK_BEG + BMG_N_TRACK,
+ MID_LE_ARENA_END = MID_LE_ARENA_BEG + BMG_N_LE_ARENA,
+
+ MID_LE_CUP_BEG = 0xc000,
MID_LE_RCUP_BEG = MID_LE_CUP_BEG,
MID_LE_RCUP_END = MID_LE_RCUP_BEG + BMG_N_LE_RCUP,
MID_LE_BCUP_BEG = MID_LE_RCUP_END,
MID_LE_BCUP_END = MID_LE_BCUP_BEG + BMG_N_LE_BCUP,
MID_LE_CUP_END = MID_LE_BCUP_END,
- MID_LE_TRACK_BEG = 0x7000,
- MID_LE_TRACK_END = MID_LE_TRACK_BEG + BMG_N_LE_TRACK,
- MID_LE_ARENA_BEG = MID_LE_TRACK_BEG + BMG_N_TRACK,
- MID_LE_ARENA_END = MID_LE_ARENA_BEG + BMG_N_LE_ARENA,
-
- MID_LE_CUP_REF_BEG = 0x8000,
+ MID_LE_CUP_REF_BEG = 0xd000,
MID_LE_CUP_REF_END = MID_LE_CUP_REF_BEG + BMG_N_LE_TRACK,
- MID_LE_BEG = MID_LE_CUP_BEG,
+ MID_LE_BEG = MID_LE_TRACK_BEG,
MID_LE_END = MID_LE_CUP_REF_END,
//-- max(CT,LE)
- BMG_MAX_RCUP = 0x3fe,
- BMG_MAX_BCUP = 2,
- BMG_MAX_TRACK = 0x1000,
- BMG_MAX_ARENA = BMG_N_ARENA,
+ BMG_MAX_RCUP = BMG_N_LE_RCUP,
+ BMG_MAX_BCUP = BMG_N_LE_BCUP,
+ BMG_MAX_TRACK = BMG_N_LE_TRACK,
+ BMG_MAX_ARENA = BMG_N_LE_ARENA,
//-- tracks
diff --git a/project/dclib/lib-dol.h b/project/dclib/lib-dol.h
index fb196ee..60cf2bf 100644
--- a/project/dclib/lib-dol.h
+++ b/project/dclib/lib-dol.h
@@ -392,6 +392,10 @@ uint RemoveDolSections
#define GCT_SEP_NUM1 0xf0000001u
#define GCT_REG_OFFSET 8
+#define GCTTXT_MAGIC "#GCT"
+#define GCTTXT_MAGIC_NUM 0x23474354u
+
+
///////////////////////////////////////////////////////////////////////////////
// [[gch_header_t]]
diff --git a/project/dclib/lib-mkw-def.c b/project/dclib/lib-mkw-def.c
index 96cde69..94414fc 100644
--- a/project/dclib/lib-mkw-def.c
+++ b/project/dclib/lib-mkw-def.c
@@ -48,7 +48,7 @@ MkwTrackCategory_t * GetMkwTrackCategory ( int id )
static MkwTrackCategory_t id_MTCAT_TEXTURE =
{
"Accepted texture hack",
- "texture,texture2do",
+ "texture,texture2do,edit.allow",
0x000000,
0x20ffa0,
0,
diff --git a/project/dclib/lib-mkw.h b/project/dclib/lib-mkw.h
index 470d942..cda34ee 100644
--- a/project/dclib/lib-mkw.h
+++ b/project/dclib/lib-mkw.h
@@ -112,7 +112,7 @@ enum mkw_consts_t // some constants
//--- LE-CODE extended slots
MKW_LE_SLOT_BEG = 0x44,
- MKW_LE_SLOT_END = 0x1000,
+ MKW_LE_SLOT_END = 0x2000,
MKW_N_LE_SLOT = MKW_LE_SLOT_END - MKW_LE_SLOT_BEG,