summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xenogears/mac2unix6
-rw-r--r--lib/lzss.cpp7
2 files changed, 10 insertions, 3 deletions
diff --git a/Xenogears/mac2unix b/Xenogears/mac2unix
new file mode 100644
index 0000000..a09f655
--- /dev/null
+++ b/Xenogears/mac2unix
@@ -0,0 +1,6 @@
+tr '\0210' à
+tr '\0220' ê
+tr '\0216' é
+tr '\0141' ç
+tr '\0217' è
+tr '\0235' ù
diff --git a/lib/lzss.cpp b/lib/lzss.cpp
index cc80778..36ec41d 100644
--- a/lib/lzss.cpp
+++ b/lib/lzss.cpp
@@ -52,7 +52,7 @@ const lzss::scheme_t lzss::schemes[] = {
{"FF6 PSX", 0, 0, 0, 1, 1, 1, 0, 0, 0, 0x1f, 1, 0x00, 0, 0xe0, -4, 0xff, 4, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0},
{"Valkyrie-1", 0, 0, 0, 1, 1, 0, 0, 0, 0, 0x00, 0, 0xf0, -4, 0xff, 0, 0x0f, 8, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0},
{"Valkyrie-2", 0, 0, 0, 1, 1, 0, 0, 2, 0, 0x00, 0, 0xf0, -4, 0xff, 0, 0x0f, 8, 0x00, 0, 0x0f, 0, 0xff, 0, 0x00, 0},
- {"ToD", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0, 0x0f, 0, 0xff, 0, 0xf0, 4, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0},
+ {"ToD", 0, 0, 0,-1, 1, 0, 1, 0, 3, 0x00, 0, 0x0f, 0, 0xff, 0, 0xf0, 4, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0},
{0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0}
};
@@ -109,7 +109,7 @@ unsigned long lzss::lzss_decomp(Handle * f_source, Handle * f_cible, long true_l
unsigned char valeur;
unsigned char * text_buf;
unsigned char val1, val2, val3;
- int negative_error = scheme.negative_trick, overlap_error = scheme.overlap_trick;
+ int negative_error = scheme.negative_trick, overlap_error = scheme.overlap_trick == 1;
int r = 0;
int decomp_count;
int decomp_length;
@@ -198,12 +198,13 @@ unsigned long lzss::lzss_decomp(Handle * f_source, Handle * f_cible, long true_l
decomp_offset = r - decomp_jump;
break;
case 1:
- decomp_offset = r - lzss_maxptr - 1 + decomp_jump;
+ decomp_offset = r - lzss_maxptr - 1 + decomp_jump - scheme.window_start;
break;
case 2:
decomp_offset = decomp_jump - scheme.window_start;
break;
}
+ decomp_offset += scheme.overlap_trick == -1 ? decomp_length : 0;
loop_length = decomp_offset + decomp_length;
if ((loop_length >= r) && (!overlap_error)) {
if (!tolerate) {