From fdde40e7d29740df9aa6bf7bc15dcdff8503fb9c Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sun, 8 Nov 2026 10:11:41 +0100 Subject: [PATCH] Atari ST: 512 KB is enough (a 520 ST keeps about 187 KB free beside the game); CI tests the ST on 512 KB Co-Authored-By: Claude Opus 5.5 --- .github/workflows/emulators.yml | 4 ++-- README.md | 2 +- docs/port-atari-st.md | 10 ++++++++-- docs/setup/atari-st.md | 5 +++-- tools/st_match.py | 3 ++- tools/st_netplay.py | 2 +- tools/st_play.py | 2 +- tools/st_test.py | 3 ++- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/emulators.yml b/.github/workflows/emulators.yml index f59025e..edc9290 100644 --- a/.github/workflows/emulators.yml +++ b/.github/workflows/emulators.yml @@ -159,11 +159,11 @@ jobs: - name: replay run: | python3 tools/build_st.py --test tests/recordings/dm4.bnr - tools/ci/retry.sh python3 tools/st_test.py + ST_MEMSIZE=0 tools/ci/retry.sh python3 tools/st_test.py # a 520 ST: the smallest machine it runs on echo "- ST replay: passed" >> "$GITHUB_STEP_SUMMARY" - name: match over the WiFi modems run: | - ST_DISPLAY=:98 tools/ci/retry.sh build/venv/bin/python tools/st_match.py 45 + ST_MEMSIZE=0 ST_DISPLAY=:98 tools/ci/retry.sh build/venv/bin/python tools/st_match.py 45 echo "- ST-ST match: passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() run: tail -50 build/relay.log || true; tail -30 build/st/hatari.log || true diff --git a/README.md b/README.md index 9fc892c..066d049 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ joysticks, or on several machines over the network, in any mix. | Atari XL/XE | a FujiNet | | Commodore 64 | a WiC64, or an Ultimate 64 / Ultimate-II+ | | Amiga (Kickstart 2.04 or later) | a network connection with a TCP/IP stack | -| Atari ST, STE (1 MB, colour) | a Wi-Fi modem on the serial port | +| Atari ST, STE (512 KB, colour) | a Wi-Fi modem on the serial port | | IBM PC (DOS, CGA, EGA or VGA) | Ethernet with a packet driver, or a Wi-Fi modem | Every machine plays on its own without any of these. How to load the game diff --git a/docs/port-atari-st.md b/docs/port-atari-st.md index d561659..a2d3ecb 100644 --- a/docs/port-atari-st.md +++ b/docs/port-atari-st.md @@ -7,8 +7,14 @@ platform layer and a new network transport. - Machines: any ST, STE, Mega ST, Mega STE with a colour monitor (low resolution, 320 x 200 in 16 colours); the TT and the Falcon run ST low resolution too. A mono monitor (SM124, 640 x 400) cannot show it. -- Requirements: TOS or EmuTOS (tested: EmuTOS only, so far); tested with - 1 MB of memory, 512 KB (a 520 ST) not yet. +- Requirements: TOS or EmuTOS (tested: EmuTOS only, so far); 512 KB of + memory (a 520 ST) or more. The program takes 170 KB loaded (text 151 KB, + data and BSS 18 KB) and its 64 KB stack; a 520 ST with EmuTOS keeps + about 187 KB free beside it (`Malloc(-1)` measured in Hatari). The + replays, the floppy boot and a 4-player match over the modems pass the + same on 512 KB as on 1 MB, and CI runs them on 512 KB. A 520 ST that + loads TOS from disk into RAM (the first ones, 1985) has about 200 KB + less and probably cannot run it: untested. ## Steps diff --git a/docs/setup/atari-st.md b/docs/setup/atari-st.md index c049f13..bc5e789 100644 --- a/docs/setup/atari-st.md +++ b/docs/setup/atari-st.md @@ -1,7 +1,8 @@ # BomberNet on the Atari ST -**Runs on:** an ST, STE, Mega ST or Mega STE with 1 MB and a colour monitor -or TV (low resolution), with TOS or EmuTOS. 512 KB is not enough yet. +**Runs on:** an ST, STE, Mega ST or Mega STE with 512 KB or more and a +colour monitor or TV (low resolution), with TOS in ROM or EmuTOS. A 520 ST +keeps about 180 KB free beside the game. **Files:** `bombernet-0.3.0-atari-st.st`, a bootable floppy image (a single-sided 360 KB disk, which every ST drive reads), and diff --git a/tools/st_match.py b/tools/st_match.py index b9f663a..cdad54e 100644 --- a/tools/st_match.py +++ b/tools/st_match.py @@ -9,6 +9,7 @@ PLAYERS=4 LOCAL_HOST=2 LOCAL_JOIN=2 ... seats, as in tools/crossplay.py RELAY=api.mzpico.com:80 the relay (default the local one, 127.0.0.1:8765) ST_MACHINE=ste the machine (default st) + ST_MEMSIZE=0 512 KB (Hatari's --memsize: 0, or MB; default 1) ST_DISPLAY=:98 the X display (default AMIGA_DISPLAY, :97) """ import os, shutil, subprocess, sys, time @@ -45,7 +46,7 @@ def __init__(self, role, nomap=True): while not os.path.exists(link) and time.time() - t < 5: time.sleep(0.1) cfg = f'{out}/hatari.cfg' open(cfg, 'w').write('') - self.p = subprocess.Popen(['hatari', '--configfile', cfg, '--tos', TOS, '--machine', MACHINE, '--memsize', '1', + self.p = subprocess.Popen(['hatari', '--configfile', cfg, '--tos', TOS, '--machine', MACHINE, '--memsize', os.environ.get('ST_MEMSIZE', '1'), '--harddrive', self.hd, '--fast-forward', 'no', '--sound', 'off', '--confirm-quit', 'no', '--statusbar', 'no', '--drive-led', 'no', '--window', '--cmd-fifo', self.fifo, '--rs232-in', link, '--rs232-out', link], diff --git a/tools/st_netplay.py b/tools/st_netplay.py index f444630..0936a1c 100644 --- a/tools/st_netplay.py +++ b/tools/st_netplay.py @@ -42,7 +42,7 @@ if not os.path.exists(cfg): open(cfg, 'w').write('') # Hatari keeps what is changed with F12 here print(f'Hatari on {display}, relay {relay}; close its window to end', flush=True) try: - subprocess.run(['hatari', '--configfile', cfg, '--tos', tos, '--machine', machine, '--memsize', '1', '--harddrive', hd, + subprocess.run(['hatari', '--configfile', cfg, '--tos', tos, '--machine', machine, '--memsize', os.environ.get('ST_MEMSIZE', '1'), '--harddrive', hd, '--rs232-in', link, '--rs232-out', link, '--joy0', 'none', '--joy1', 'none', '--confirm-quit', 'no', '--window', '--zoom', '2'], env=dict(os.environ, DISPLAY=display)) finally: diff --git a/tools/st_play.py b/tools/st_play.py index c676cf5..435bddc 100644 --- a/tools/st_play.py +++ b/tools/st_play.py @@ -40,7 +40,7 @@ def __init__(self, joy_port, wav=None): if os.path.exists(fifo): os.remove(fifo) cfg = os.path.join(ROOT, 'build', 'st', 'hatari.cfg') open(cfg, 'w').write(f'[Sound]\nbEnableSound = TRUE\nnPlaybackFreq = 44100\nszYMCaptureFileName = {wav}\n' if wav else '') - cmd = ['hatari', '--configfile', cfg, '--tos', tos, '--machine', 'st', '--memsize', '1', '--harddrive', hd, + cmd = ['hatari', '--configfile', cfg, '--tos', tos, '--machine', 'st', '--memsize', os.environ.get('ST_MEMSIZE', '1'), '--harddrive', hd, '--fast-forward', 'no', '--confirm-quit', 'no', '--statusbar', 'no', '--drive-led', 'no', '--window', '--monitor', 'rgb', '--cmd-fifo', fifo, '--joy0', 'none', '--joy1', 'none'] if joy_port is not None: cmd[cmd.index(f'--joy{joy_port}') + 1] = 'keys' diff --git a/tools/st_test.py b/tools/st_test.py index 19fe4ce..14fd0c4 100644 --- a/tools/st_test.py +++ b/tools/st_test.py @@ -5,6 +5,7 @@ times are the emulated machine's even with Hatari fast-forwarding. tools/st_test.py [build/st/BOMBER.PRG] [--60hz] [--png out.png] [--machine st|ste] [--st] + ST_MEMSIZE=0 512 KB (Hatari's --memsize: 0, or MB; default 1) --st: the program (built with --result-drive A) in the AUTO folder of a floppy image (tools/make_st_disk.py), booted from drive A: with no drive C: @@ -43,7 +44,7 @@ open(cfg, 'w').write('') fifo = os.path.join(ROOT, 'build', 'st', 'test.fifo') if os.path.exists(fifo): os.remove(fifo) -cmd = ['hatari', '--configfile', cfg, '--tos', tos, '--machine', machine, '--memsize', '1', '--harddrive', hd, '--cmd-fifo', fifo, +cmd = ['hatari', '--configfile', cfg, '--tos', tos, '--machine', machine, '--memsize', os.environ.get('ST_MEMSIZE', '1'), '--harddrive', hd, '--cmd-fifo', fifo, '--fast-forward', 'yes', '--sound', 'off', '--confirm-quit', 'no', '--statusbar', 'no', '--drive-led', 'no', '--window', '--monitor', 'rgb'] if floppy: i = cmd.index('--harddrive'); del cmd[i:i + 2]