From bd0af736980ba0a9f3f22c40868f9bcad78dacb0 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 2 Oct 2024 23:34:15 -0400 Subject: [PATCH] peasant: consolidate dialog in text directory --- games/peasant/Makefile | 108 +++++------------- games/peasant/dialog_peasant1.s | 3 - games/peasant/dialog_peasant2.s | 3 - games/peasant/dialog_peasant3.s | 3 - games/peasant/dialog_peasant4.s | 2 - games/peasant/text/Makefile | 77 ++++++++++--- .../text/{peasant1.inc => dialog_peasant1.s} | 6 +- .../text/{peasant2.inc => dialog_peasant2.s} | 3 + .../text/{peasant3.inc => dialog_peasant3.s} | 3 + .../text/{peasant4.inc => dialog_peasant4.s} | 3 + 10 files changed, 107 insertions(+), 104 deletions(-) delete mode 100644 games/peasant/dialog_peasant1.s delete mode 100644 games/peasant/dialog_peasant2.s delete mode 100644 games/peasant/dialog_peasant3.s delete mode 100644 games/peasant/dialog_peasant4.s rename games/peasant/text/{peasant1.inc => dialog_peasant1.s} (81%) rename games/peasant/text/{peasant2.inc => dialog_peasant2.s} (92%) rename games/peasant/text/{peasant3.inc => dialog_peasant3.s} (92%) rename games/peasant/text/{peasant4.inc => dialog_peasant4.s} (92%) diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 6992e13a..3d5b18e0 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -308,8 +308,8 @@ PEASANT1: peasant1.o peasant1.o: peasant1.s zp.inc ./inventory/inventory.inc \ parse_input.inc \ - peasant1_actions.s DIALOG_PEASANT1.ZX02 dialog_peasant1.inc \ - text/peasant1.inc text/kerrek.inc \ + peasant1_actions.s \ + text/DIALOG_PEASANT1.ZX02 text/dialog_peasant1.inc \ kerrek_actions.s peasant_common.s \ sprites/peasant_sprites.inc \ sprites/kerrek_sprites.inc \ @@ -330,7 +330,8 @@ PEASANT2: peasant2.o peasant2.o: peasant2.s zp.inc ./inventory/inventory.inc \ parse_input.inc \ - peasant2_actions.s DIALOG_PEASANT2.ZX02 dialog_peasant2.inc \ + peasant2_actions.s \ + text/DIALOG_PEASANT2.ZX02 text/dialog_peasant2.inc \ graphics_peasantry/graphics_peasant2.inc sprites/peasant_sprites.inc \ graphics_peasantry/priority_peasant2.inc \ sprites/river_bubble_sprites.inc \ @@ -350,7 +351,8 @@ PEASANT3: peasant3.o peasant3.o: peasant3.s zp.inc ./inventory/inventory.inc \ parse_input.inc \ - peasant3_actions.s DIALOG_PEASANT3.ZX02 dialog_peasant3.inc \ + peasant3_actions.s \ + text/DIALOG_PEASANT3.ZX02 text/dialog_peasant3.inc \ graphics_peasantry/graphics_peasant3.inc sprites/peasant_sprites.inc \ graphics_peasantry/priority_peasant3.inc \ peasant_common.s \ @@ -370,9 +372,9 @@ PEASANT4: peasant4.o peasant4.o: peasant4.s zp.inc ./inventory/inventory.inc \ parse_input.inc \ sprites/ned_sprites.inc \ - peasant4_actions.s DIALOG_PEASANT4.ZX02 dialog_peasant4.inc \ + peasant4_actions.s \ + text/DIALOG_PEASANT4.ZX02 text/dialog_peasant4.inc \ kerrek_actions.s peasant_common.s \ - text/peasant4.inc text/kerrek.inc \ graphics_peasantry/graphics_peasant4.inc sprites/peasant_sprites.inc \ graphics_peasantry/priority_peasant4.inc \ draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \ @@ -458,85 +460,33 @@ parse_input: parse_input.o parse_input.o: parse_input.s tokens.inc text/common.inc.lookup ca65 -o parse_input.o parse_input.s -l parse_input.lst +### + +text/DIALOG_PEASANT1.ZX02: + cd text && make + +text/DIALOG_PEASANT2.ZX02: + cd text && make + +text/DIALOG_PEASANT3.ZX02: + cd text && make + +text/DIALOG_PEASANT4.ZX02: + cd text && make ### -DIALOG_PEASANT1.ZX02: dialog_peasant1 - $(ZX02) -f dialog_peasant1 DIALOG_PEASANT1.ZX02 +text/dialog_peasant1.inc: + cd text && make -dialog_peasant1: dialog_peasant1.o - ld65 -o dialog_peasant1 dialog_peasant1.o -C ../../linker_scripts/apple2_d000.inc +text/dialog_peasant2.inc: + cd text && make -dialog_peasant1.o: dialog_peasant1.s text/peasant1.inc - ca65 -o dialog_peasant1.o dialog_peasant1.s -l dialog_peasant1.lst +text/dialog_peasant3.inc: + cd text && make -### - -dialog_peasant1.inc: generate_all_symbols dialog_peasant1 - ./generate_all_symbols -a 0xd000 dialog_peasant1.lst > dialog_peasant1.inc - -### - -DIALOG_PEASANT2.ZX02: dialog_peasant2 - $(ZX02) -f dialog_peasant2 DIALOG_PEASANT2.ZX02 - -dialog_peasant2: dialog_peasant2.o - ld65 -o dialog_peasant2 dialog_peasant2.o -C ../../linker_scripts/apple2_d000.inc - -dialog_peasant2.o: dialog_peasant2.s text/peasant2.inc - ca65 -o dialog_peasant2.o dialog_peasant2.s -l dialog_peasant2.lst - -### - -dialog_peasant2.inc: generate_all_symbols dialog_peasant2 - ./generate_all_symbols -a 0xd000 dialog_peasant2.lst > dialog_peasant2.inc - -#### - -DIALOG_PEASANT3.ZX02: dialog_peasant3 - $(ZX02) -f dialog_peasant3 DIALOG_PEASANT3.ZX02 - -dialog_peasant3: dialog_peasant3.o - ld65 -o dialog_peasant3 dialog_peasant3.o -C ../../linker_scripts/apple2_d000.inc - -dialog_peasant3.o: dialog_peasant3.s text/peasant3.inc - ca65 -o dialog_peasant3.o dialog_peasant3.s -l dialog_peasant3.lst - -### - -dialog_peasant3.inc: generate_all_symbols dialog_peasant3 - ./generate_all_symbols -a 0xd000 dialog_peasant3.lst > dialog_peasant3.inc - -#### -DIALOG_PEASANT4.ZX02: dialog_peasant4 - $(ZX02) -f dialog_peasant4 DIALOG_PEASANT4.ZX02 - -dialog_peasant4: dialog_peasant4.o - ld65 -o dialog_peasant4 dialog_peasant4.o -C ../../linker_scripts/apple2_d000.inc - -dialog_peasant4.o: dialog_peasant4.s text/peasant4.inc - ca65 -o dialog_peasant4.o dialog_peasant4.s -l dialog_peasant4.lst - -### - -dialog_peasant4.inc: generate_all_symbols dialog_peasant4 - ./generate_all_symbols -a 0xd000 dialog_peasant4.lst > dialog_peasant4.inc - -#### - -### - -DIALOG_KNIGHT_FALLS_ROCK.ZX02: dialog_knight_falls_rock - $(ZX02) -f dialog_knight_falls_rock DIALOG_KNIGHT_FALLS_ROCK.ZX02 - -dialog_knight_falls_rock: dialog_knight_falls_rock.o - ld65 -o dialog_knight_falls_rock dialog_knight_falls_rock.o -C ../../linker_scripts/apple2_d000.inc - -dialog_knight_falls_rock.o: dialog_knight_falls_rock.s text/knight_falls_rock.inc.lookup - ca65 -o dialog_knight_falls_rock.o dialog_knight_falls_rock.s -l dialog_knight_falls_rock.lst - -dialog_knight_falls_rock.inc: generate_all_symbols dialog_knight_falls_rock - ./generate_all_symbols -a 0xd000 dialog_knight_falls_rock.lst > dialog_knight_falls_rock.inc +text/dialog_peasant4.inc: + cd text && make ### diff --git a/games/peasant/dialog_peasant1.s b/games/peasant/dialog_peasant1.s deleted file mode 100644 index cea5b1d6..00000000 --- a/games/peasant/dialog_peasant1.s +++ /dev/null @@ -1,3 +0,0 @@ -.include "text/lookup.inc" -.include "text/peasant1.inc" - diff --git a/games/peasant/dialog_peasant2.s b/games/peasant/dialog_peasant2.s deleted file mode 100644 index b4053a4f..00000000 --- a/games/peasant/dialog_peasant2.s +++ /dev/null @@ -1,3 +0,0 @@ -;.include "text/peasant2.inc" -.include "text/lookup.inc" -.include "text/peasant2.inc" diff --git a/games/peasant/dialog_peasant3.s b/games/peasant/dialog_peasant3.s deleted file mode 100644 index 1ff69b1c..00000000 --- a/games/peasant/dialog_peasant3.s +++ /dev/null @@ -1,3 +0,0 @@ -.include "text/lookup.inc" -.include "text/peasant3.inc" - diff --git a/games/peasant/dialog_peasant4.s b/games/peasant/dialog_peasant4.s deleted file mode 100644 index 5b6877f3..00000000 --- a/games/peasant/dialog_peasant4.s +++ /dev/null @@ -1,2 +0,0 @@ -.include "text/lookup.inc" -.include "text/peasant4.inc" diff --git a/games/peasant/text/Makefile b/games/peasant/text/Makefile index 11865ec8..bd88e872 100644 --- a/games/peasant/text/Makefile +++ b/games/peasant/text/Makefile @@ -1,11 +1,16 @@ +include ../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 +LINKER_SCRIPTS = ../../../linker_scripts + CC = gcc CFLAGS = -O2 -Wall -g -all: dump_text shrink_text \ - peasant1.inc \ - peasant2.inc \ - peasant3.inc \ - peasant4.inc \ +all: DIALOG_PEASANT1.ZX02 dialog_peasant1.inc \ + DIALOG_PEASANT2.ZX02 dialog_peasant2.inc \ + DIALOG_PEASANT3.ZX02 dialog_peasant3.inc \ + DIALOG_PEASANT4.ZX02 dialog_peasant4.inc \ + dump_text shrink_text \ inside.inc.lookup \ inn.inc.lookup \ cliff_base.inc.lookup \ @@ -14,27 +19,73 @@ all: dump_text shrink_text \ common.inc.lookup \ inventory.inc.lookup -##################### -# derived locations # -##################### +### -peasant1.inc: gary.inc.lookup kerrek.inc.lookup \ +DIALOG_PEASANT1.ZX02: dialog_peasant1 + $(ZX02) -f dialog_peasant1 DIALOG_PEASANT1.ZX02 + +dialog_peasant1: dialog_peasant1.o + ld65 -o dialog_peasant1 dialog_peasant1.o -C $(LINKER_SCRIPTS)/apple2_d000.inc + +dialog_peasant1.o: dialog_peasant1.s \ + gary.inc.lookup kerrek.inc.lookup \ well.inc.lookup yellow_tree.inc.lookup \ falls.inc.lookup + ca65 -o dialog_peasant1.o dialog_peasant1.s -l dialog_peasant1.lst +dialog_peasant1.inc: ../generate_all_symbols dialog_peasant1 + ../generate_all_symbols -a 0xd000 dialog_peasant1.lst > dialog_peasant1.inc -peasant2.inc: hay.inc.lookup mud.inc.lookup \ +### + +DIALOG_PEASANT2.ZX02: dialog_peasant2 + $(ZX02) -f dialog_peasant2 DIALOG_PEASANT2.ZX02 + +dialog_peasant2: dialog_peasant2.o + ld65 -o dialog_peasant2 dialog_peasant2.o -C $(LINKER_SCRIPTS)/apple2_d000.inc + +dialog_peasant2.o: dialog_peasant2.s \ + hay.inc.lookup mud.inc.lookup \ archery.inc.lookup rock.inc.lookup \ knight.inc.lookup + ca65 -o dialog_peasant2.o dialog_peasant2.s -l dialog_peasant2.lst +dialog_peasant2.inc: ../generate_all_symbols dialog_peasant2 + ../generate_all_symbols -a 0xd000 dialog_peasant2.lst > dialog_peasant2.inc -peasant3.inc: jhonka.inc.lookup cottage.inc.lookup \ +### + +DIALOG_PEASANT3.ZX02: dialog_peasant3 + $(ZX02) -f dialog_peasant3 DIALOG_PEASANT3.ZX02 + +dialog_peasant3: dialog_peasant3.o + ld65 -o dialog_peasant3 dialog_peasant3.o -C $(LINKER_SCRIPTS)/apple2_d000.inc + +dialog_peasant3.o: dialog_peasant3.s \ + jhonka.inc.lookup cottage.inc.lookup \ lake_west.inc.lookup lake_east.inc.lookup \ outside_inn.inc.lookup + ca65 -o dialog_peasant3.o dialog_peasant3.s -l dialog_peasant3.lst -peasant4.inc: ned_cottage.inc.lookup wavy_tree.inc.lookup \ +dialog_peasant3.inc: ../generate_all_symbols dialog_peasant3 + ../generate_all_symbols -a 0xd000 dialog_peasant3.lst > dialog_peasant3.inc + +### + +DIALOG_PEASANT4.ZX02: dialog_peasant4 + $(ZX02) -f dialog_peasant4 DIALOG_PEASANT4.ZX02 + +dialog_peasant4: dialog_peasant4.o + ld65 -o dialog_peasant4 dialog_peasant4.o -C $(LINKER_SCRIPTS)/apple2_d000.inc + +dialog_peasant4.o: dialog_peasant4.s \ + ned_cottage.inc.lookup wavy_tree.inc.lookup \ kerrek.inc.lookup lady_cottage.inc.lookup \ burninated_tree.inc.lookup + ca65 -o dialog_peasant4.o dialog_peasant4.s -l dialog_peasant4.lst + +dialog_peasant4.inc: ../generate_all_symbols dialog_peasant4 + ../generate_all_symbols -a 0xd000 dialog_peasant4.lst > dialog_peasant4.inc #################### @@ -147,4 +198,4 @@ shrink_text.o: shrink_text.c ### clean: - rm -f *.o *~ dump_text shrink_text *.lookup + rm -f *.o *~ dump_text shrink_text *.lookup *.ZX02 diff --git a/games/peasant/text/peasant1.inc b/games/peasant/text/dialog_peasant1.s similarity index 81% rename from games/peasant/text/peasant1.inc rename to games/peasant/text/dialog_peasant1.s index 5e3a85e8..f85cba3a 100644 --- a/games/peasant/text/peasant1.inc +++ b/games/peasant/text/dialog_peasant1.s @@ -1,11 +1,15 @@ +.include "lookup.inc" + peasant1_dialog_start: .include "gary.inc.lookup" .include "kerrek.inc.lookup" .include "well.inc.lookup" -.include "tree.inc.lookup" +.include "yellow_tree.inc.lookup" .include "falls.inc.lookup" peasant1_dialog_end: .assert (>peasant1_dialog_end - >peasant1_dialog_start) < $1E , error, "peasant1 dialog too big" + + diff --git a/games/peasant/text/peasant2.inc b/games/peasant/text/dialog_peasant2.s similarity index 92% rename from games/peasant/text/peasant2.inc rename to games/peasant/text/dialog_peasant2.s index 7fde34d6..a17a5400 100644 --- a/games/peasant/text/peasant2.inc +++ b/games/peasant/text/dialog_peasant2.s @@ -1,3 +1,5 @@ +.include "lookup.inc" + peasant2_dialog_start: .include "hay.inc.lookup" @@ -9,3 +11,4 @@ peasant2_dialog_start: peasant2_dialog_end: .assert (>peasant2_dialog_end - >peasant2_dialog_start) < $1E , error, "peasant2 dialog too big" + diff --git a/games/peasant/text/peasant3.inc b/games/peasant/text/dialog_peasant3.s similarity index 92% rename from games/peasant/text/peasant3.inc rename to games/peasant/text/dialog_peasant3.s index cd3642da..51dfb13c 100644 --- a/games/peasant/text/peasant3.inc +++ b/games/peasant/text/dialog_peasant3.s @@ -1,3 +1,5 @@ +.include "lookup.inc" + peasant3_dialog_start: .include "jhonka.inc.lookup" @@ -9,3 +11,4 @@ peasant3_dialog_start: peasant3_dialog_end: .assert (>peasant3_dialog_end - >peasant3_dialog_start) < $1E , error, "peasant3 dialog too big" + diff --git a/games/peasant/text/peasant4.inc b/games/peasant/text/dialog_peasant4.s similarity index 92% rename from games/peasant/text/peasant4.inc rename to games/peasant/text/dialog_peasant4.s index 273240b5..fd3013e6 100644 --- a/games/peasant/text/peasant4.inc +++ b/games/peasant/text/dialog_peasant4.s @@ -1,3 +1,5 @@ +.include "lookup.inc" + peasant4_dialog_start: .include "ned_cottage.inc.lookup" @@ -9,3 +11,4 @@ peasant4_dialog_start: peasant4_dialog_end: .assert (>peasant4_dialog_end - >peasant4_dialog_start) < $1E , error, "peasant4 dialog too big" +