Compare commits
6 Commits
6c29091fcb
...
main
Author | SHA1 | Date | |
---|---|---|---|
2363fad844 | |||
aba129a0f7 | |||
8310e65e6b | |||
30105450d6 | |||
223d284939 | |||
7e02520c24 |
93
.devcontainer/Dockerfile
Normal file
93
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,93 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ubuntu:24.04 AS build
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
make \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD https://github.com/z00m128/sjasmplus.git#v1.21.0 /sjasmplus
|
||||
RUN cd /sjasmplus && make && 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*
|
||||
|
||||
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 \
|
||||
&& 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=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
|
25
.devcontainer/devcontainer.json
Normal file
25
.devcontainer/devcontainer.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
106
.vscode/launch.json
vendored
Normal file
106
.vscode/launch.json
vendored
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
99
xylo.asm
99
xylo.asm
@ -1,7 +1,7 @@
|
||||
org 51000
|
||||
|
||||
counter EQU inc_counter + 1
|
||||
attrs EQU &5800
|
||||
attrs EQU #5800
|
||||
xylo EQU attrs + 40
|
||||
|
||||
zero_counter:
|
||||
@ -11,8 +11,8 @@ set_counter:
|
||||
ld (counter), a
|
||||
|
||||
read_keyboard:
|
||||
ld a, &f7
|
||||
in a, (&fe)
|
||||
ld a, #f7
|
||||
in a, (#fe)
|
||||
rra
|
||||
jr nc, key_1
|
||||
rra
|
||||
@ -22,56 +22,33 @@ read_keyboard:
|
||||
rra
|
||||
jr nc, key_4
|
||||
rra
|
||||
jr nc, key_5
|
||||
jr read_keyboard
|
||||
|
||||
key_1:
|
||||
ld c, 0
|
||||
call highlight_key
|
||||
ld a, (counter)
|
||||
call play
|
||||
ld c, 0
|
||||
call highlight_key
|
||||
jr inc_counter
|
||||
|
||||
key_2:
|
||||
ld c, 3
|
||||
call highlight_key
|
||||
ld a, (counter)
|
||||
inc a
|
||||
call play
|
||||
ld c, 3
|
||||
call highlight_key
|
||||
jr inc_counter
|
||||
|
||||
key_3:
|
||||
ld c, 6
|
||||
call highlight_key
|
||||
ld a, (counter)
|
||||
inc a
|
||||
inc a
|
||||
call play
|
||||
ld c, 6
|
||||
call highlight_key
|
||||
jr inc_counter
|
||||
|
||||
key_4:
|
||||
ld c, 9
|
||||
call highlight_key
|
||||
ld a, (counter)
|
||||
add a, 3
|
||||
call play
|
||||
ld c, 9
|
||||
call highlight_key
|
||||
jr inc_counter
|
||||
jr c, read_keyboard
|
||||
|
||||
key_5:
|
||||
ld c, 12
|
||||
ld de, #040C
|
||||
jr invoke
|
||||
|
||||
key_2:
|
||||
ld de, #0103
|
||||
jr invoke
|
||||
|
||||
key_3:
|
||||
ld de, #0206
|
||||
jr invoke
|
||||
|
||||
key_4:
|
||||
ld de, #0309
|
||||
jr invoke
|
||||
|
||||
key_1:
|
||||
ld de, #0000
|
||||
invoke:
|
||||
push de
|
||||
call highlight_key
|
||||
ld a, (counter)
|
||||
add a, 4
|
||||
add a, d
|
||||
call play
|
||||
ld c, 12
|
||||
pop de
|
||||
call highlight_key
|
||||
|
||||
inc_counter:
|
||||
@ -79,26 +56,26 @@ inc_counter:
|
||||
add a, 5
|
||||
cp 25
|
||||
jr nz, set_counter
|
||||
jp zero_counter
|
||||
jr zero_counter
|
||||
|
||||
highlight_key:
|
||||
ld hl, xylo
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld d, 15
|
||||
highlight_row:
|
||||
ld e, 3
|
||||
highlight_block:
|
||||
push de
|
||||
ld d, 0
|
||||
add hl, de
|
||||
ld e, 30
|
||||
ld a, (hl)
|
||||
xor %01000000
|
||||
ld b, 15
|
||||
highlight_block:
|
||||
ld (hl), a
|
||||
inc hl
|
||||
dec e
|
||||
jr nz, highlight_block
|
||||
ld c, 29
|
||||
add hl, bc
|
||||
dec d
|
||||
jr nz, highlight_row
|
||||
ld (hl), a
|
||||
inc hl
|
||||
ld (hl), a
|
||||
add hl, de
|
||||
djnz highlight_block
|
||||
pop de
|
||||
ret
|
||||
|
||||
INCLUDE "sample.asm"
|
||||
|
Reference in New Issue
Block a user