Compare commits

..

5 Commits

Author SHA1 Message Date
bdfae1562b Add dev containter for building 2025-07-07 12:39:49 +00:00
3220e8fcc8 More yourcroft 2024-09-16 21:47:10 +00:00
a6cff03a70 apostrophe's 2024-09-16 18:38:26 +00:00
3e5734bcf0 Start the yourcroft puzzle sequence 2024-09-16 19:00:49 +01:00
e55ad58419 Wait... 2024-09-15 21:38:11 +01:00
5 changed files with 326 additions and 3 deletions

99
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,99 @@
# syntax=docker/dockerfile:1
FROM ubuntu:24.04 AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
make \
unzip \
&& rm -rf /var/lib/apt/lists/*
ADD https://github.com/z00m128/sjasmplus.git#v1.21.0 /sjasmplus
RUN cd /sjasmplus && make -j8 && make install
ADD https://boarstone.mcphail.uk/mcphail/spectrum_remload.git /ttttt
RUN cd /ttttt && make ttttt
ADD https://github.com/einar-saukas/ZX0.git /zx0
RUN cd /zx0/src/ \
&& gcc -O2 -o zx0 zx0.c optimize.c compress.c memory.c \
&& gcc -O2 -o dzx0 dzx0.c
ADD https://www.boriel.com/files/zxb/zxbasic-1.18.1-linux64.tar.gz .
RUN tar xf zxbasic*
ADD https://github.com/Mastodon-/inpaws.git /inpaws
RUN cd /inpaws/ \
&& make -j8
FROM build AS z88dk
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bison \
ca-certificates \
ccache \
cpanminus \
curl \
dos2unix \
flex \
gdb \
git \
libboost-all-dev \
libcapture-tiny-perl \
libclone-perl \
libdata-hexdump-perl \
libfile-slurp-perl \
libgmp3-dev \
liblocal-lib-perl \
libmodern-perl-perl \
libpath-tiny-perl \
libregexp-common-perl \
libtext-table-perl \
libxml2-dev \
libyaml-perl \
m4 \
perl \
pkg-config \
ragel \
re2c \
texi2html \
texinfo \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
ENV Z88DK_PATH="/opt/z88dk"
RUN cpanm -l $HOME/perl5 --no-wget local::lib Template::Plugin::YAML \
&& git clone --depth 1 --recursive https://github.com/z88dk/z88dk.git ${Z88DK_PATH} \
&& cd ${Z88DK_PATH} \
&& eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" \
&& chmod 777 build.sh \
&& sed -i -e "s/make/make -j8/g" build.sh \
&& BUILD_SDCC=1 BUILD_SDCC_HTTP=1 ./build.sh \
&& make install-clean bins-clean
FROM ubuntu:24.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
fuse-emulator-utils \
git \
make \
openssh-client \
pasmo \
python3 \
z80asm \
z80dasm \
zmakebas \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin/sjasmplus /bin/sjasmplus
COPY --from=build /ttttt/ttttt /bin/ttttt
COPY --from=build /zx0/src/zx0 /bin/zx0
COPY --from=build /zx0/src/dzx0 /bin/dzx0
COPY --from=build /zxbasic/zxbasm.py /opt/zxbasic/zxbasm
COPY --from=build /zxbasic/zxbc.py /opt/zxbasic/zxbc
COPY --from=build /zxbasic/zxbpp.py /opt/zxbasic/zxbpp
COPY --from=build /zxbasic/src /opt/zxbasic/src
COPY --from=build /inpaws/inpaws /bin/inpaws
COPY --from=z88dk /opt/z88dk/bin /opt/z88dk/bin
COPY --from=z88dk /opt/z88dk/lib /opt/z88dk/lib
COPY --from=z88dk /opt/z88dk/include /opt/z88dk/include
ENV PATH="${PATH}:/opt/z88dk/bin:/opt/zxbasic"
ENV ZCCCFG="/opt/z88dk/lib/config"
USER ubuntu
RUN echo "PATH=$PATH:/opt/z88dk/bin:/opt/zxbasic" >> ~/.profile
RUN echo "export ZCCCFG=/opt/z88dk/lib/config/" >> ~/.profile

View File

@@ -0,0 +1,25 @@
{
"name": "ZX Spectrum dev tools",
//"build": { "dockerfile": "Dockerfile" },
// The Dockerfile takes an age to build due to z88dk, so pull from prebuilt:
"image": "boarstone.mcphail.uk/mcphail/speccydev:stable",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host"
],
"customizations": {
"vscode": {
"extensions": [
"maziac.dezog",
"maziac.asm-code-lens",
"maziac.z80-instruction-set",
"maziac.hex-hover-converter",
"maziac.sna-fileviewer",
"maziac.nex-fileviewer",
"ms-vscode.makefile-tools",
"jsjlogin.zxbasic",
"thenestruo.z80-asm-meter"
]
}
}
}

View File

@@ -0,0 +1,3 @@
#! /bin/bash
# From https://stackoverflow.com/questions/54055666/docker-hub-and-git-submodules/59640438#59640438
git submodule update --init

106
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,106 @@
{
"configurations": [
{
"type": "dezog",
"request": "launch",
"name": "Simulator - ZX81 56k RAM",
"remoteType": "zsim",
"zsim": {
"visualMemory": true,
"preset": "zx81",
"memoryModel": "ZX81-56K"
},
"sjasmplus": [
{
"path": "myprog.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": true
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"load": "myprog.p"
},
{
"type": "dezog",
"request": "launch",
"name": "Simulator - ZX128K Spectrum",
"remoteType": "zsim",
"zsim": {
"visualMemory": true,
"preset": "spectrum",
"memoryModel": "ZX128K"
},
"sjasmplus": [
{
"path": "myprog.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": true
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"load": "myprog.sna",
"topOfStack": "0x5d58"
},
{
"type": "dezog",
"request": "launch",
"name": "CSpect",
"remoteType": "cspect",
"sjasmplus": [
{
"path": "myprog.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": false
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"load": "myprog.sna",
"topOfStack": "0x5d58",
"cspect": {
// Change "host.docker.internal" to "localhost" if running on Linux
"hostname": "host.docker.internal"
}
},
{
"type": "dezog",
"request": "launch",
"name": "Simulator - ZX48K Spectrum",
"remoteType": "zsim",
"zsim": {
"visualMemory": true,
"preset": "spectrum",
"memoryModel": "ZX48K"
},
"sjasmplus": [
{
"path": "myprog.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": true
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"load": "myprog.sna",
"topOfStack": "0x5d58"
}
]
}

View File

@@ -3,8 +3,13 @@
PROCESS examine;
PROCESS help;
PROCESS crunch;
PROCESS yourcroft_status;
PROCESS yourcroft_parse;
PROCESS say_help;
FLAG crunchvol;
FLAG yourcroftstate;
FLAG say_help;
DEFAULTS
{
@@ -50,7 +55,7 @@ LOCATION scene
LOCATION trap
{
"Wimpy is trapped in a room with no obvious exits.
He is rather perplexed.^Oh, bother!";
He is rather perplexed.^Oh, bother!^(This is placeholder text)^";
}
VOCABULARY
@@ -115,8 +120,17 @@ VOCABULARY
NOUN: "PASSW", "1234", "HUNTER", "12345", "BEANS";
NOUN: "BISCU", "PACKE";
NOUN: "MUG", "CUP";
NOUN: "USBDR", "DRIVE";
ADJECTIVE: "USB";
NOUN: "PORT";
NOUN 18: "YOURC", "LADYC", "COMPU", "ASSIS", "CYLIN", "DEVIC";
NOUN: "FLAP";
NOUN: "DOOR";
VERB: "HELP";
VERB: "EAT", "CONSU", "BITE", "CRUNC", "CHOMP", "MUNCH";
VERB: "WAIT";
VERB: "OPEN";
VERB: "CLOSE";
}
OBJECT notused 0
@@ -130,7 +144,7 @@ OBJECT notused 0
OBJECT mug 1
{
"A large, chipped mug";
INITIALLYAT CARRIED;
INITIALLYAT NOTCREATED;
WORDS MUG _;
WEIGHT 1;
PROPERTY CONTAINER;
@@ -146,7 +160,7 @@ PROCESS examine
OBJECT biscuits
{
"An inexhaustible supply of delicious biscuits";
INITIALLYAT CARRIED;
INITIALLYAT NOTCREATED;
WORDS BISCU _;
WEIGHT 1;
}
@@ -157,6 +171,20 @@ PROCESS examine
DONE;
}
OBJECT usbdrive
{
"A USB Drive";
INITIALLYAT CARRIED;
WORDS DRIVE USB;
WEIGHT 1;
}
PROCESS examine
{
_ DRIVE: PRESENT usbdrive
MESSAGE "A 16GB 'SpamDisk' USB-A Drive with a handwritten label saying 'Wimpy's leet hacking boot drive'."
DONE;
}
MESSAGES
{
0: "Default message";
@@ -257,6 +285,19 @@ RESPONSE
EAT BISCU: PRESENT biscuits
ADVERB QUIET
MESSAGE "He tries to be quiet but they're just too tasty.";
WAIT _: MESSAGE "Wimpy waits for a moment."
DONE;
SAY _: AT trap
PROCESS yourcroft_parse
DONE;
}
PROCESS say_help
{
_ _: ZERO say_help
SET say_help
MESSAGE "(Remember to enclose anything you want Wimpy to say in double quotes, like {0}SAY \"HELLO\"{1}. On a Spectrum, hold {0}SYMBOL-SHIFT{1} and press {0}P{1}. On an emulator, you'll probably need to hold {0}Ctrl{1} and press {0}P{1}.)";
}
PROCESS 1
@@ -277,6 +318,9 @@ PROCESS 1
GOTO trap
DESC;
* YOURC: AT trap
PROCESS yourcroft_status;
* _: NEWLINE ZERO 0 ABSENT 0 LISTOBJ;
* _: PRESENT 0 LISTOBJ;
}
@@ -309,3 +353,49 @@ PROCESS crunch
MESSAGE "The whole room buckles under the crunching boom.";
_ _: CLEAR crunchvol;
}
PROCESS yourcroft_status
{
_ _: ZERO yourcroftstate
MESSAGE "A bodged-together cheap-looking plastic cylinder device is perched on the floor."
DONE;
_ _: EQ yourcroftstate 1
MESSAGE "Yourcroft surveys Wimpy with its tacky, green, blinking LED eye and barks 'I'm watching you, mister!'.";
_ _: EQ yourcroftstate 2
MESSAGE "Yourcroft's eye flashes indignantly and burns with shame at its open flap and exposed port.";
_ _: EQ yourcroftstate 3
MESSAGE "Yourcroft's LED eye keeps flicking with rage between Wimpy's face and its new USB appendage.";
_ _: EQ yourcroftstate 4
MESSAGE "The smouldering remains of Yourcroft sparks and fizzles.";
}
PROCESS examine
{
_ CYLIN: ZERO yourcroftstate
MESSAGE "'What you looking at, buddy?', barks the device. 'I'm a Yourcroft(TM) mark 1 cylindrical assistant, and I've been charged with keeping this door closed.'^^'Don't get any bright ideas for escape or I'll zap you!'^^Its voice sounds like a strangely robotic-yet-feminine version of popey's dulcet tones. A cheap LED array is lit to form a green, blinking eye which follows Wimpy's every movement. Below is a flap with a label saying 'USB', which is closed and obscuring any port.^'By the way, please fund our Kickstarter for version 2.0!'"
PLUS yourcroftstate 1
DONE;
_ YOURC: EQ yourcroftstate 1
MESSAGE "'Don't go poking around - I'm password protected you know!'"
DONE;
_ YOURC: EQ yourcroftstate 2
MESSAGE "Yourcroft is clearly annoyed that its USB port and control touch screen are showing."
DONE;
}
PROCESS yourcroft_parse
{
* *: PARSE
MESSAGE "'Keep it simple, buddy - I ain't ChattyJeeps.'"
PROCESS say_help
DONE;
_ PASSW: LT yourcroftstate 2
MESSAGE "'Hey - that's the right password! You some kind of genius hacker? You can't stop me guarding this door, buddy...'.^^The flap drops open, revealing a USB socket and a small touch screen.^^'Do you mind?', admonishes Yourcroft, 'you're exposing my circuits!'."
LET yourcroftstate 2
DONE;
_ _: MESSAGE "'You ain't the boss of me!'"
DONE;
}