aboutsummaryrefslogtreecommitdiff
path: root/textcomp.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-05-17 16:54:19 -0400
committerB. Watson <yalhcru@gmail.com>2021-05-17 16:54:19 -0400
commit6dbdb33689cc5fa308b39e1c23d88d572cb7368c (patch)
tree20307951a0653e8da85f335ad730ce7ad4a76d38 /textcomp.c
parent1e2d8abd29ff4717404f6527b4df7cd27d89c991 (diff)
downloadtaipan-6dbdb33689cc5fa308b39e1c23d88d572cb7368c.tar.gz
Better text compression, save 35 bytes, now 8816
Diffstat (limited to 'textcomp.c')
-rw-r--r--textcomp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/textcomp.c b/textcomp.c
index 7139225..71b4dad 100644
--- a/textcomp.c
+++ b/textcomp.c
@@ -9,7 +9,7 @@
for every string.
Input length | Encoded length | Ratio
- (incl. null) | |
+ (incl. null) | (bytes) |
2 | 2 | 100%, don't bother
3 | 3 | 100%, don't bother
4 | 3 | 75%
@@ -49,8 +49,9 @@
62 = )
63 = newline
- All the strings used by taipan.c are listed in the __END__ section
- of messages.pl. The perl script calls this program (textcomp) once
+ All the strings used by taipan.c are listed in messages.msg, except
+ the help messages in the cartridge build (which are in helpmsgs.msg).
+ The perl script messages.pl calls this program (textcomp) once
per string, and outputs C source consisting of the encoded versions.
Each string in the __END__ section is preceded by a name, and the
generated C source uses these names with M_ prefixed.
@@ -60,11 +61,11 @@
but it's not really noticeable. cputc() is used for printing, so it
respects the reverse video setting (set by rvs_on() and rvs_off()).
The task of replacing cputs("some string") with print_msg(M_some_string)
- is done manually.
+ was done manually.
When a newline is printed, our modified conio moves the cursor to the
start of the next line, so no \r's are needed. Any \r sequences listed
- in messages.pl are discarded before encoding is done.
+ in the .msg files are discarded before encoding is done.
Since no prompts ever use capital Z, it's used as an escape character
for dictionary lookups (e.g. Za = "Li Yuen", Zb = "Elder Brother").