diff --git a/games/peasant/dialog_peasant2.s b/games/peasant/dialog_peasant2.s index f5318509..e5299059 100644 --- a/games/peasant/dialog_peasant2.s +++ b/games/peasant/dialog_peasant2.s @@ -1 +1,3 @@ -.include "text/peasant2.inc" +;.include "text/peasant2.inc" +.include "text/lookup.inc" +.include "text/peasant2.inc.lookup" diff --git a/games/peasant/text/Makefile b/games/peasant/text/Makefile index 48400488..c87b2b09 100644 --- a/games/peasant/text/Makefile +++ b/games/peasant/text/Makefile @@ -1,7 +1,13 @@ CC = gcc CFLAGS = -O2 -Wall -g -all: dump_text +all: dump_text shrink_text peasant2.inc.lookup + +### + +peasant2.inc.lookup: peasant2.inc shrink_text + ./shrink_text < peasant2.inc > peasant2.inc.lookup + ### @@ -13,8 +19,16 @@ dump_text.o: dump_text.c ### +shrink_text: shrink_text.o + $(CC) -o shrink_text shrink_text.o $(LFLAGS) + +shrink_text.o: shrink_text.c + $(CC) $(CFLAGS) -c shrink_text.c + +### + clean: - rm -f *.o dump_text + rm -f *.o dump_text shrink_text *.lookup diff --git a/games/peasant/text/NOTES b/games/peasant/text/NOTES new file mode 100644 index 00000000..811e55b4 --- /dev/null +++ b/games/peasant/text/NOTES @@ -0,0 +1,13 @@ + + orig lzsa word wordlzsa + ==== ==== ==== ==== +cliff 2836 1801 +inn 3815 2251 +inside 7213 4111 +peasant1 7465 4234 +peasant2 7439 4269 5807 4055 +peasant3 6229 3599 +peasant4 6819 3947 + +not peasant1/peasant4 has some of the kerrek text commented out +so it would fit diff --git a/games/peasant/text/lookup.inc b/games/peasant/text/lookup.inc new file mode 100644 index 00000000..9754c28f --- /dev/null +++ b/games/peasant/text/lookup.inc @@ -0,0 +1,85 @@ +DIALOG_ALREADY = $80 +DIALOG_COTTAGE = $81 +DIALOG_PEASANT = $82 +DIALOG_CAPITAL_THERES = $83 +DIALOG_CAPITAL_TROGDOR = $84 + +DIALOG_LITTLE = $85 +DIALOG_YOURE = $86 +DIALOG_CAPITAL_YOURE = $87 + +DIALOG_ABOUT = $88 +DIALOG_CANT = $89 +DIALOG_DONT = $8A +DIALOG_THERE = $8B +DIALOG_CAPITAL_THERE = $8C + +DIALOG_BABY = $8D +DIALOG_DEAD = $8E +DIALOG_FROM = $8F +DIALOG_HAVE = $90 +DIALOG_HERE = $91 +DIALOG_INTO = $92 +DIALOG_ITS = $93 +DIALOG_CAPITAL_ITS = $94 +DIALOG_JUST = $95 +DIALOG_LIKE = $96 +DIALOG_SAYS = $97 +DIALOG_SOME = $98 +DIALOG_THAT = $99 +DIALOG_CAPITAL_THAT = $9A +DIALOG_THIS = $9B +DIALOG_WITH = $9C +DIALOG_YOUR = $9D + +DIALOG_ALL = $9E +DIALOG_AND = $9F +DIALOG_ARE = $A0 +DIALOG_BUT = $A1 +DIALOG_FOR = $A2 +DIALOG_GET = $A3 +DIALOG_GOT = $A4 +DIALOG_HIM = $A5 +DIALOG_HIS = $A6 +DIALOG_NOT = $A7 +DIALOG_NOW = $A8 +DIALOG_OLD = $A9 +DIALOG_ONE = $AA +DIALOG_OUT = $AB +DIALOG_SEE = $AC +DIALOG_THE = $AD +DIALOG_CAPITAL_THE = $AE +DIALOG_WAS = $AF +DIALOG_YOU = $B0 +DIALOG_CAPITAL_YOU = $B1 + +DIALOG_AN = $B2 +DIALOG_AT = $B3 +DIALOG_BE = $B4 +DIALOG_DO = $B5 +DIALOG_GO = $B6 +DIALOG_HE = $B7 +DIALOG_CAPITAL_HE = $B8 +DIALOG_IN = $B9 +DIALOG_IS = $BA +DIALOG_IT = $BB +DIALOG_CAPITAL_IT = $BC +DIALOG_MY = $BD +DIALOG_NO = $BE +DIALOG_CAPITAL_NO = $BF +DIALOG_OF = $C0 +DIALOG_ON = $C1 +DIALOG_OR = $C2 +DIALOG_SO = $C3 +DIALOG_TO = $C4 +DIALOG_UP = $C5 + +;.byte "already","cottage","peasant","There's","Trogdor" +;.byte "little","you're","You're" +;.byte "about","can't","don't","there","There" +;.byte "baby","dead","from","have","here","into","it's","It's" +;.byte "just","like","says","some","that","That","this","with","your", +;.byte "all","and","are","but","for","get","got","him","his","not" +;.byte "now","old","one","out","see","the","The","was","you","You" +;.byte "an","at","be","do","go","he","He","in","is","it","It" +;.byte "my","no","No","of","on","or","so","to","up" diff --git a/games/peasant/text/shrink_text.c b/games/peasant/text/shrink_text.c new file mode 100644 index 00000000..da6f8889 --- /dev/null +++ b/games/peasant/text/shrink_text.c @@ -0,0 +1,187 @@ +#include +#include + +#define NUM_WORDS 70 + +static char word_list[NUM_WORDS][20]={ + "already","cottage","peasant","There's","Trogdor", + "little","you're","You're", + "about","can't","don't","there","There", + "baby","dead","from","have","here","into","it's","It's","just","like","says","some","that","That","this","with","your", + "all","and","are","but","for","get","got","him","his","not","now","old","one","out","see","the","The","was","you","You", + "an","at","be","do","go","he","He","in","is","it","It","my","no","No","of","on","or","so","to","up", +}; + +static char replacement_list[NUM_WORDS][32]={ + "DIALOG_ALREADY", + "DIALOG_COTTAGE", + "DIALOG_PEASANT", + "DIALOG_CAPITAL_THERES", + "DIALOG_CAPITAL_TROGDOR", + + "DIALOG_LITTLE", + "DIALOG_YOURE", + "DIALOG_CAPITAL_YOURE", + + "DIALOG_ABOUT", + "DIALOG_CANT", + "DIALOG_DONT", + "DIALOG_THERE", + "DIALOG_CAPITAL_THERE", + + "DIALOG_BABY", + "DIALOG_DEAD", + "DIALOG_FROM", + "DIALOG_HAVE", + "DIALOG_HERE", + "DIALOG_INTO", + "DIALOG_ITS", + "DIALOG_CAPITAL_ITS", + "DIALOG_JUST", + "DIALOG_LIKE", + "DIALOG_SAYS", + "DIALOG_SOME", + "DIALOG_THAT", + "DIALOG_CAPITAL_THAT", + "DIALOG_THIS", + "DIALOG_WITH", + "DIALOG_YOUR", + + "DIALOG_ALL", + "DIALOG_AND", + "DIALOG_ARE", + "DIALOG_BUT", + "DIALOG_FOR", + "DIALOG_GET", + "DIALOG_GOT", + "DIALOG_HIM", + "DIALOG_HIS", + "DIALOG_NOT", + "DIALOG_NOW", + "DIALOG_OLD", + "DIALOG_ONE", + "DIALOG_OUT", + "DIALOG_SEE", + "DIALOG_THE", + "DIALOG_CAPITAL_THE", + "DIALOG_WAS", + "DIALOG_YOU", + "DIALOG_CAPITAL_YOU", + + "DIALOG_AN", + "DIALOG_AT", + "DIALOG_BE", + "DIALOG_DO", + "DIALOG_GO", + "DIALOG_HE", + "DIALOG_CAPITAL_HE", + "DIALOG_IN", + "DIALOG_IS", + "DIALOG_IT", + "DIALOG_CAPITAL_IT", + "DIALOG_MY", + "DIALOG_NO", + "DIALOG_CAPITAL_NO", + "DIALOG_OF", + "DIALOG_ON", + "DIALOG_OR", + "DIALOG_SO", + "DIALOG_TO", + "DIALOG_UP", + +}; + + +static int char_count=0,orig_count=0; + +void parse_line(char *string) { + int len; + int i,j; + int in_string=0; + int in_quote=0; + int dotfound=0,bfound=0,yfound=0,tfound=0,efound=0; + + len=strlen(string); + + for(i=0;i