Skip to content

Commit 7bbd128

Browse files
committed
Updated to describe current state
1 parent f928280 commit 7bbd128

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

README.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# The Lighthouse of Doom
22

3-
This repository contain a simple text-based adventure game.
3+
This repository contain a simple text-based adventure game, implemented
4+
twice:
45

5-
Currently this is implemented in portable C, however the intention is
6-
to re-implement the game to run on a CP/M system.
6+
* [C Implementation](#c-implementation)
7+
* [Z80 Implementation](#z80-implementation)
78

9+
My intention was to write a simple text-based adventure game to run under
10+
CP/M. Starting large projects in Z80 assembly language from scratch
11+
is a bit of a daunting prospect, so I decided to code a simple game in C
12+
to get the design right and to avoid getting stuck in too many low-level
13+
details.
814

915

1016
## Plot
@@ -15,21 +21,16 @@ to re-implement the game to run on a CP/M system.
1521
* The boat will surely crash if you don't turn on the main light.
1622

1723
The game is over, when you either fix the light, or find another solution.
18-
If you do not achieve victory in 100 turns the boat runs aground, and
24+
If you do not achieve victory within a turn-limit the boat runs aground, and
1925
death will consume you all. (It is a _very_ big boat!)
2026

2127

2228

2329
## C Implementation
2430

25-
My goal behind this game is to write something simple, which can then be ported
26-
to run upon a CP/M system. That mostly means that we should store as much
27-
logic as possible in a series of lookup-tables, or array of items - rather
28-
than writing complex logic within our handlers.
29-
3031
The implementation is mostly concerned with creating the correct series of
3132
data-structures, which are essentially arrays of objects. Because if we
32-
can make the game table-based that simplifies the coding that needs to be
33+
can make the game table-based we simplify the coding that needs to be
3334
done - we don't need to write per-object handlers anywhere, we can just
3435
add pointers to tables/structures.
3536

@@ -48,7 +49,7 @@ too much state to care about:
4849
* Whether you won/lost.
4950

5051

51-
### Running The Game
52+
### Running It
5253

5354
Build the game by running `make`, and then launch it.
5455

@@ -58,11 +59,27 @@ If you get stuck you can see command by entering `help`.
5859

5960
## Z80 Implementation
6061

61-
There is not yet a complete implementation of the game written in z80
62-
assembly language, however there is a basic stub.
62+
The Z80 implementation is based upon the C-implementation, with a few
63+
small changes.
64+
65+
The implementation uses a simple set of structures:
66+
67+
* A command-table to map input-commands to handlers.
68+
* An item-table to store details about each object in the game.
69+
* A person table to store telephone messages.
70+
71+
Along the way I did realize that having fixed inventory slots made the
72+
coding more of a challenge, so I made the location of each object a
73+
property of the object itself.
74+
75+
76+
### Running It
77+
78+
Ensure you have the `pasmo` assembler installed, then build the code
79+
by running `make game`, or `make releas`.
6380

64-
The C-code will not be literally ported over, however the same text will
65-
be used and the idea of using tables and structures will be maintained.
81+
In either case the output will be a binary named `lihouse.com` which you
82+
should be able to run upon your system - or under a CP/M emulator.
6683

6784

6885

0 commit comments

Comments
 (0)