summaryrefslogtreecommitdiff
path: root/PE
diff options
context:
space:
mode:
Diffstat (limited to 'PE')
-rw-r--r--PE/extract-rooms.cpp57
-rw-r--r--PE/extract-various.cpp35
-rw-r--r--PE/reinsert.cpp5
-rw-r--r--PE/table.h62
4 files changed, 102 insertions, 57 deletions
diff --git a/PE/extract-rooms.cpp b/PE/extract-rooms.cpp
index d7148ff..738411d 100644
--- a/PE/extract-rooms.cpp
+++ b/PE/extract-rooms.cpp
@@ -131,62 +131,7 @@ virtual int startup() throw (GeneralException) {
printm(M_INFO, "Found %i bytes of text at %i\n", size, pos);
- for (j = 0; j < size; j++) {
- b = f->readU8();
-
- if (b <= MAXCHAR) {
- t->writeU8(table[b]);
- } else {
- switch(b) {
- case 0xf7:
- t->writeU8('\n');
- break;
- case 0xf8:
- (*t) << "<PAUSE>\n";
- break;
- case 0xf9:
- (*t) << "\n<TCLOSE>\n";
- break;
- case 0xfa:
- (*t) << "<AYA>";
- break;
- case 0xfb:
- j++;
- j++;
- a1 = f->readU8();
- switch(a1) {
- case 0:
- (*t) << "<TAG0>";
- break;
- case 1:
- (*t) << "<TAG1>";
- break;
- case 9:
- a2 = f->readU8();
- (*t) << "<CHOICES " << a2 << ">\n";
- break;
- case 7:
- a2 = f->readU8();
- (*t) << "<TIMER " << a2 << ">";
- break;
- default:
- (*t) << "<UNKCMD " << a1 << ">";
- break;
- }
- break;
- case 0xfe:
- j++;
- b = f->readU8();
- (*t) << "<PT" << b << ">\n";
- break;
- case 0xff:
- (*t) << "\n<CLOSE>\n";
- break;
- default:
- (*t) << String().set("<UNK %02X>", b);
- }
- }
- }
+ extracttext(f, t, size);
delete t;
}
diff --git a/PE/extract-various.cpp b/PE/extract-various.cpp
index 9a68a3d..a4261b9 100644
--- a/PE/extract-various.cpp
+++ b/PE/extract-various.cpp
@@ -9,7 +9,7 @@ int pos[50];
virtual int startup() throw (GeneralException) {
Input * f = new Input("dump/0000.out");
Output * s = new Output("various/various.txt");
- unsigned int c, b, i, j, size, n, changed;
+ unsigned int c, b, i, j, size, changed;
unsigned short p, t;
String fn;
@@ -126,6 +126,39 @@ virtual int startup() throw (GeneralException) {
delete s;
}
+ f = new Input("dump/0075.out");
+
+ for (i = 0; i < 4; i++) {
+ Uint32 pos, pos2, size;
+
+ f->seek(i * 4);
+ pos = f->readU32();
+ pos2 = f->readU32();
+ f->seek(pos);
+
+ if (i == 3) {
+ size = f->readU32();
+ f->seek(pos);
+ } else {
+ size = pos2 - pos;
+ }
+
+ s = new Output(String().set("75/%i.out", i));
+
+ copy(f, s, size);
+
+ delete s;
+
+ if (i == 1) {
+ s = new Output("75/text.txt");
+ f->seek(pos);
+ extracttext(f, s, size);
+ delete s;
+ }
+ }
+
+ delete f;
+
return 0;
}
CODE_ENDS
diff --git a/PE/reinsert.cpp b/PE/reinsert.cpp
index 581c16f..47b2627 100644
--- a/PE/reinsert.cpp
+++ b/PE/reinsert.cpp
@@ -77,6 +77,11 @@ int patch_img(cdutils * cd) {
cd->write_file(menu, GUESS, d_pe1.Sector + 978);
delete menu;
+ Handle * Jour1 = new Input("75/0075.out");
+ printm(M_INFO, "Ecriture de la fin du jour 1...\n");
+ cd->write_file(Jour1, GUESS, d_pe1.Sector + 1975);
+ delete Jour1;
+
for (i = 1; i <= 20; i++) {
Input groupe(String().set("groupe-%02i.txt", i));
c = 0;
diff --git a/PE/table.h b/PE/table.h
index 1eb7cb9..c5a13d2 100644
--- a/PE/table.h
+++ b/PE/table.h
@@ -1,3 +1,65 @@
char table[256] = "0123456789+-=*% ABCDEFGHIJKLMNOPQRSTUVWXYZ&!?\"'.abcdefghijklmnopqrstuvwxyz:,/éèêëàâäîïôöùûüç";
#define MAXCHAR 0x5b
+
+void extracttext(Handle * f, Handle * t, int size) {
+ int j;
+ Uint8 b, a1, a2;
+
+ for (j = 0; j < size; j++) {
+ b = f->readU8();
+
+ if (b <= MAXCHAR) {
+ t->writeU8(table[b]);
+ } else {
+ switch(b) {
+ case 0xf7:
+ t->writeU8('\n');
+ break;
+ case 0xf8:
+ (*t) << "<PAUSE>\n";
+ break;
+ case 0xf9:
+ (*t) << "\n<TCLOSE>\n";
+ break;
+ case 0xfa:
+ (*t) << "<AYA>";
+ break;
+ case 0xfb:
+ j++;
+ j++;
+ a1 = f->readU8();
+ switch(a1) {
+ case 0:
+ (*t) << "<TAG0>";
+ break;
+ case 1:
+ (*t) << "<TAG1>";
+ break;
+ case 9:
+ a2 = f->readU8();
+ (*t) << "<CHOICES " << a2 << ">\n";
+ break;
+ case 7:
+ a2 = f->readU8();
+ (*t) << "<TIMER " << a2 << ">";
+ break;
+ default:
+ (*t) << "<UNKCMD " << a1 << ">";
+ break;
+ }
+ break;
+ case 0xfe:
+ j++;
+ b = f->readU8();
+ (*t) << "<PT" << b << ">\n";
+ break;
+ case 0xff:
+ (*t) << "\n<CLOSE>\n";
+ break;
+ default:
+ (*t) << String().set("<UNK %02X>", b);
+ }
+ }
+ }
+}