Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4eaf481
6502: Added Apple II support
sehugg Aug 8, 2026
3fc14f4
6502: updated license for ProRWTS2 and 0boot
sehugg Aug 24, 2026
1e13cfa
6502: turn off verbose info during make
sehugg Aug 24, 2026
9531f66
apple2: "more" prompt when a page of text printed (like c64)
sehugg Aug 24, 2026
5a814c8
apple2: fix status bar clearing w/ inverse spaces
sehugg Aug 24, 2026
15fbcbf
apple2: added codepoints U+201E, U+2022, and U+202F, and 23 more for …
sehugg Aug 24, 2026
bdba69b
apple2: fix non-breaking spaces
sehugg Aug 24, 2026
e586f96
6502: nbsp now degrades to space (instead of nothing) in engine.s
sehugg Aug 24, 2026
9f6f082
added codepoints test
sehugg Aug 24, 2026
913e245
apple2: transliterate characters in status bar (c64 probably has simi…
sehugg Aug 24, 2026
5df5c20
apple2: cleaned up some commented code
sehugg Aug 24, 2026
4bddf3e
apple2: prevent translit and status overflow from wrapping
sehugg Aug 25, 2026
bc19304
apple2: refactor shared code
sehugg Aug 25, 2026
f0da1b8
apple2: prevent dual-char translits from being split
sehugg Aug 25, 2026
3858e03
apple2: a2test.exp now uses a frame-based approach that strips ansi c…
sehugg Aug 25, 2026
56d2bce
apple2: fixed word wrap edge cases
sehugg Aug 25, 2026
d6b1a59
apple2: flush before io_mclear
sehugg Aug 25, 2026
9b04d20
apple2: added test-apple2 github workflow
sehugg Aug 25, 2026
831d49d
apple2: test/apple2 scripts look for izconsole more thoroughly
sehugg Aug 25, 2026
cb5ef31
apple2: fixed inline progress bars
sehugg Aug 25, 2026
8f3e461
apple2: fixed test-apple2 github workflow
sehugg Aug 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,46 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- name: install assembler
run: sudo apt install xa65
- name: install assemblers
run: sudo apt install xa65 acme
- name: install node packager
run: sudo npm install -g @yao-pkg/pkg
- name: make test
run: make test

test-apple2:
runs-on: ubuntu-latest
env:
IZAPPLE2_SHA1: "1b563d7"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- name: install tools
run: |
sudo apt update
sudo apt install xa65 acme expect git
- uses: actions/cache@v4
id: izcache
with:
path: ~/bin/izconsole
key: izconsole-${{ runner.os }}-${{ env.IZAPPLE2_SHA1 }}
- uses: actions/setup-go@v6
if: steps.izcache.outputs.cache-hit != 'true'
with:
go-version: 'stable'
- name: build izconsole (izapple2)
if: steps.izcache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/ivanizag/izapple2 /tmp/izapple2
cd /tmp/izapple2
git checkout ${{ env.IZAPPLE2_SHA1 }}
mkdir -p "$HOME/bin"
go build -o "$HOME/bin/izconsole" ./frontend/console
- name: build aambundle
run: make --directory=./src aambundle
- name: make apple2 tests
timeout-minutes: 5
run: make --directory=./test apple2 -j 8

build-manual:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,7 +82,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
- name: install dependencies
run: sudo apt install gcc-mingw-w64 xa65
run: sudo apt install gcc-mingw-w64 xa65 acme
- name: install node packager
run: sudo npm install -g @yao-pkg/pkg
- name: make (aamrun)
Expand Down Expand Up @@ -84,7 +118,7 @@ jobs:
- name: install dependencies
run: |
brew update
brew install xa
brew install xa acme
- name: install node packager
run: sudo npm install -g @yao-pkg/pkg
- name: make (aamrun)
Expand Down
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ aambox6502
**/#*#
src/6502/cruncher
src/6502/labels
src/6502/mkfont
src/6502/mkfont
src/6502/*.lst
src/6502/*.rpt
src/6502/*.sym
src/6502/*.labels
src/6502/a2.system
# Apple II test disks (built by test/apple2/Makefile)
test/apple2/aa-exercise/
test/apple2/gosling/
# Bundled disks for the codepoint exercise (built by test/codepoints/Makefile)
test/codepoints/codepoints/
# Test out files
test/*/*.out
35 changes: 35 additions & 0 deletions license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,38 @@ redistributed inside this archive in compliance with the MIT license:
The commandline tool aambox6502, for testing the 6502 interpreter, makes use of
a 6502 emulator by Mike Chambers called fake6502. This emulator is in the
public domain.

---

The Apple II interpreter also contains ProRWTS2 (block-level file access)
and 0boot (the boot loader used on 140k disks), both under the following
terms:

ProRWTS2, copyright (c) Peter Ferrie 2013-2022
0boot, copyright (c) Peter Ferrie 2015-2016, 2018

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 changes: 24 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The following interpreters are included:
* Javascript engine, web frontend.
* Javascript engine, Node.js frontend.
* 6502 engine, Commodore 64 frontend.
* 6502 engine, Apple II frontend.
* 6502 engine, aambox6502 frontend.

Version number:
Expand Down Expand Up @@ -99,6 +100,11 @@ To run the example story using the Vice Commodore 64 emulator, available at
To run on a real Commodore 64, insert the disk and type: LOAD"*",8
Then type: RUN

To run the example story using an online Apple II emulator, go to
<https://apple2ts.com/> then drag one of the bootable disk images
to the page. You can also run from the command line using a console
emulator such as <https://github.com/ivanizag/izapple2>.

To build the Å-machine tools under Linux (requires a C compiler and make):

cd src
Expand All @@ -114,7 +120,8 @@ To cross-compile the Windows version of the Å-machine tools under Linux

Note that when aambundle is built, several files are copied from src/js and
src/6502 into the resulting executable file. To rebuild the binary files in
src/6502, run "make" in that directory. This requires the xa65 assembler.
src/6502, run "make" in that directory. This requires the xa65 and ACME
assemblers.

Project website:

Expand All @@ -127,6 +134,22 @@ Release notes:
6502 engine: Fixed some memory corruption issues, especially
involving save/restore/undo operations.

New Apple II interpreter:
- Supports Apple II+ and later models
- 64 or 128 kB
- 40 or 80 columns
- Aambundle builds 140 kB and 800 kB ProDOS-format disk images
- No actual ProDOS system image is needed
- Save/restore is supported with only one slot at the moment
- For more, consult the readme.txt generated by aambundle
- Run "make -C test apple2" for unit tests

Aambundle: Stories without a title in their metadata are
named after the base name of the story file.

6502 engine: Fixed NBSP so that it properly degrades to a
breaking space instead of being ignored.

1.0.2:

Cleaned up the specification and some dev tools.
Expand Down
52 changes: 43 additions & 9 deletions src/6502/Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
VERSION=1.0.3
CFLAGS=-Wall -O2 -DVERSION=\"$(VERSION)\"

all: aambox6502 aambox_frontend.bin c64_crunched.bin c64_drivecode.bin c64_loader.prg
all: aambox6502 aambox_frontend.bin c64_crunched.bin c64_drivecode.bin c64_loader.prg a2.system a2_0boot.bin a2_sboot.bin

check_xa:
@if ! command -v xa >/dev/null 2>&1; then \
echo "ERROR: 'xa' (6502 cross-assembler) not found in PATH."; \
echo " macOS: brew install xa"; \
echo " Debian/Ubuntu: apt install xa65"; \
echo " From source: https://www.floodgap.com/retrotech/xa/"; \
echo "(To build the C tools without any 6502 code, run 'make no6502' from the top level.)"; \
exit 1; fi

check_acme:
@if ! command -v acme >/dev/null 2>&1; then \
echo "ERROR: 'acme' (6502 cross-assembler) not found in PATH."; \
echo " macOS: brew install acme"; \
echo " Debian/Ubuntu: apt install acme"; \
echo " From source: https://github.com/meonwax/acme"; \
echo "(Only the Apple II targets need acme; the C64 and aambox targets build with xa alone.)"; \
exit 1; fi

clean:
rm -rf aambox6502 cruncher labels mkfont
rm -rf aambox6502 cruncher labels c64.labels mkfont
rm -f a2_frontend.bin a2_prorwts2.bin a2.labels a2.system a2_0boot.bin a2_sboot.bin a2_sboot.labels

aambox6502: aambox6502.c fake6502.c

aambox_frontend.bin: aambox_frontend.s engine.s
aambox_frontend.bin: aambox_frontend.s engine.s | check_xa
xa -l aambox.labels -o $@ $< -DRAMTOP=49152

c64_frontend.bin: c64_frontend.s engine.s font.bin
xa -l labels -o $@ $< -DVERSION=\"$(VERSION)\"
c64_frontend.bin: c64_frontend.s engine.s font.bin | check_xa
xa -l c64.labels -o $@ $< -DVERSION=\"$(VERSION)\"

font.bin: fontdef.txt mkfont
./mkfont <$< >$@

c64_drivecode.bin: c64_drivecode.s
c64_drivecode.bin: c64_drivecode.s | check_xa
xa -o $@ $<

c64_loader.prg: c64_loader.s
c64_loader.prg: c64_loader.s | check_xa
xa -o $@ $<

decruncher.bin: decruncher.s
decruncher.bin: decruncher.s | check_xa
xa -o $@ $<

c64_crunched.bin: c64_frontend.bin decruncher.bin cruncher
./cruncher $< decruncher.bin >$@

.PHONY: all clean
a2_0boot.bin: a2_0boot.acme a2.system | check_acme
acme -DA2_TRACKS=$$((($$(wc -c < a2.system) + 4095) / 4096)) -o $@ $<

a2_sboot.bin: a2_sboot.s a2.system | check_xa
xa -l a2_sboot.labels -o $@ $< -DAAM_BLOCKS=$$((($$(wc -c < a2.system) + 511) / 512))

a2_prorwts2.bin: a2_prorwts2.acme a2_frontend.bin | check_acme
acme -DPRORWTS_ORG=$$(($$(wc -c < a2_frontend.bin) + 8192)) -l a2_prorwts2.sym -r a2_prorwts2.rpt $<

a2_frontend.bin: a2_frontend.s engine.s | check_xa
xa -l a2.labels -P a2_frontend.lst -o $@ $< -DPRODOS=0 -DPRORWTS=1 -DVERSION=\"$(VERSION)\"

a2.system: a2_frontend.bin a2_prorwts2.bin
cat $^ > $@

.PHONY: all clean check_xa check_acme
Loading
Loading