summaryrefslogtreecommitdiff
path: root/PE/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'PE/table.h')
-rw-r--r--PE/table.h62
1 files changed, 62 insertions, 0 deletions
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);
+ }
+ }
+ }
+}