BitMagic The Complete Development Environment for the Commander X16.

Setting Up

This page gets an X16 ready for remote debugging: the WiFi card on your network, the debugger on the SD card, and the X16 dialling the right PC. You only do this once per card.

How to get the WiFi card on your network

The debugger uses the card’s ZiModem firmware at its default speed, so there’s nothing to change on the card apart from your network. In a terminal program on the X16, type:

ATW"YourNetwork,YourPassword"
AT&W

AT&W saves it, so the card joins the network by itself from then on.

How to write the debugger to the SD card

In VSCode, run X16 Remote: Write the Debugger to an SD Card from the command palette. Pick the SD card (or a folder to copy to it), then the address the X16 should dial to reach this PC. Pick This PC: it uses this PC’s name if your network’s DNS knows it (so the card keeps working when the PC’s address changes), with its current address as the fallback. The list also has this PC’s addresses and its name on their own, or you can type your own.

DEBUG.PRG has no address of its own until it’s written this way. A copy taken straight from the extension says so on the X16 and goes back to BASIC.

It writes four files:

File Description
DEBUG.PRG The loader, the one you RUN. It loads the other two, dials your PC and hands over to the debugger.
DBGSTUB.BIN The debugger itself, which goes into a bank of high RAM (63 by default).
DBGTRAMP.BIN 40 bytes of interrupt handler, which go at $0342 in low RAM.
DEBUGHOST.TXT The address of your PC.

Without VSCode, the command line tool does the same:

x16remote deploy E:\

Without --host it works out this PC’s address, as “This PC” does in VSCode. x16remote hostfile E:\ writes just DEBUGHOST.TXT, to point a card that already has the debugger at this PC.

How to point it at another PC

DEBUGHOST.TXT is one line, the address DEBUG.PRG dials:

192.168.1.10:6464

Edit it in any text editor, or run X16 Remote: Change the PC Address on an SD Card. A few things it accepts:

  • A name works as well as an address, if your router knows it: mypc.lan:6464. A name keeps working when your PC gets a new address.
  • Without a port it’s 6464, so 192.168.1.10 is fine.
  • Spaces before the address are skipped, and only the first line is read.

Note: there’s no way for the X16 to find your PC by itself, as the WiFi card has no broadcast or discovery the debugger can use. A name is the next best thing.

When it can’t connect

DEBUG.PRG shows what it’s dialling, and what’s wrong whenever that changes:

BITMAGIC X16 REMOTE CONTROL
DIALLING 192.168.1.10:6464
NO ANSWER FROM THE PC. CONNECT FROM VS CODE OR THE X16REMOTE TOOL.
STILL TRYING (PRESS A KEY TO GIVE UP)
Message What to do
NO WIFI CARD FOUND AT $9FE0 The card isn’t fitted, or isn’t seen. It gives up and goes back to BASIC.
THE WIFI CARD ISN'T ANSWERING The card is there but not replying. Check it’s powered and its firmware is ZiModem.
NO ANSWER FROM THE PC The card is working but nothing answered. Connect from VSCode (start debugging, or open the X16 SD Card view) or run x16remote, check the address in DEBUGHOST.TXT, that both are on the same network, and that Windows Firewall lets dotnet accept connections on the port.
CONNECTED All good. VSCode (or x16remote) takes it from here.

VSCode says what it’s waiting for too, with this PC’s addresses, and after 30 seconds it lists what to check.

Settings

Name Type Optional Description
x16remote.port number true The port the X16 dials, 6464. It has to match the port on the SD card.
x16remote.bank number true The bank of high RAM the debugger lives in, 63. Your program mustn’t use it. Write the SD card again after changing it.
x16remote.ioAccess string array true Parts of the I/O area the debugger may read and write, eg [ "$9f60-$9f6f" ]. None by default. A launch configuration’s ioAccess takes precedence. See Debugging New Hardware.
x16remote.dotnetPath string true The dotnet to run the debugger with. It needs .NET 10.