This repo is my playground for programming against the C64 (and Ultimate/SwiftLink-style setups) from modern tools. It’s a mix of C64 BASIC, 6502 assembly, and some helper Python to glue everything together.
-
Python BBS server (
bbs.py)This is based on an original project started by @jalbarracinv
A very simple PETSCII BBS-style server that a C64 can call over TCP (typically via a SwiftLink-style modem setup or TCP-to-serial bridge).
- Talks PETSCII using the helpers in
funct.py - Shows a welcome screen from
seq/welcome.seq/seq/colaburger.seq - Has a basic per-connection session loop and user count tracking
- Integrates a “Word of the Day” banner via
wotd.py
- Talks PETSCII using the helpers in
-
Word of the Day fetcher (
wotd.py)
Small helper that fetches Merriam‑Webster’s Word of the Day over HTTP (RSS), strips it down to a word + short definition, and feeds that into the BBS. This is where the BBS gets the#WORD#DEFINITION#header line. -
PETSCII / terminal helpers (
funct.py)
Utility functions shared by the Python side:cbmencode/cbmdecodeto translate between ASCII and PETSCIIsend_line,send_control_code,send_seqto push text, control codes, and SEQ “graphics” to the C64get_char,input_line,input_passto read keys/lines/passwords from the remote C64 in a way that feels like BASIC’sGETandINPUT
-
BASIC programs
swiftlink.bas: C64 BASIC code that talks to the Python server over a SwiftLink-style interface / TCP bridge.wotd.bas: C64-side program for showing the Word of the Day coming from the Python side.modem.bas,wotd.bas, etc. are experiments around dialing/connecting and displaying remote content.
-
C64 Ultimate PRG runner (
runner.py,rbas.sh,word-search.bas)runner.py: small helper that HTTP‑posts a.prgto a C64 Ultimate (or compatible) using its/v1/runners:run_prgendpoint.rbas.sh: shell script that tokenizes a C64 BASIC v2 listing withpetcatand then invokesrunner.py.word-search.bas: example C64 BASIC v2 program that talks to a remote HTTP server using a SwiftLink‑style interface.
-
C / assembly multiplexing demo (
multiplex.c-c64/)
A separate little project showing sprite multiplexing on the C64 in C and 6502 assembly. This is mostly independent of the BBS work, but lives here as part of the broader “C64 experiments” theme.
Requirements:
- Python 3.10+ (what I’ve been testing with)
requestsforwotd.py:
pip install requestsTo start the BBS server:
python3 bbs.pyBy default it:
- Listens on TCP port
6464on all interfaces - Logs new connections and a running user count
- Speaks PETSCII only (this is meant to be driven by a C64 client, not a plain telnet terminal)
On the C64 side, I currently talk to it using a SwiftLink-style setup and swiftlink.bas, often via a TCPSerial bridge on the host. Exact wiring/details depend on your hardware and emulator, so you’ll likely need to adjust those for your setup.
- The BBS and helpers are intentionally minimal and experimental, not a full-featured BBS package.
- The PETSCII mapping in
funct.pyis just enough for what I’m doing; some Unicode or punctuation from Merriam‑Webster may not display perfectly and might need further mapping/stripping. - The MySQL account system code in
bbs.pyis mostly stubbed out right now; I hard-code a test user for iteration and keep the DB bits commented until I want real persistence.
This flow uses petcat to tokenize a BASIC v2 listing and runner.py to send the resulting PRG to a C64 Ultimate over HTTP.
Requirements:
petcatfrom VICE available on yourPATH(used byrbas.sh)- Python 3.10+
requestsandpython-dotenv:
pip install requests python-dotenv- A
.envfile in this repo with:
C64U_PASSWORD=your_ultimate_http_password_hereUsage (for word-search.bas):
./rbas.shYou can also pass a different BASIC file:
./rbas.sh my-program.basWhat rbas.sh does:
- Takes the BASIC filename from
$1(or defaults toword-search.basif no argument is given). - Pipes that BASIC file through
trto lowercase it (VICEpetcatexpects lowercase BASIC keywords when tokenizing). - Calls
petcat -w2 -cto tokenize as C64 BASIC v2, interpreting control‑code mnemonics like{clr},{rvon},{rvof}. - Writes
prg.prg, then runs:
python3 runner.py prg.prgrunner.py reads the PRG and POSTs it as application/octet-stream to the C64 Ultimate at http://192.168.0.64/v1/runners:run_prg with the password from C64U_PASSWORD.
Notes:
- The BASIC source can be authored in uppercase (as you’d normally type it on a C64);
rbas.shlowercases it only forpetcat. - Control codes in the BASIC source should use mnemonics that
petcatunderstands, e.g.{CLR},{RVON},{RVOF}.
See LICENSE for project licensing details.