This is an emulator for the Commander X16 computer system. Unlike the official emulator, this has a few more dependencies, see the build instructions below. It compiles on Windows, Debian Linux, and Raspbian, and probably other Linux-based platforms.
Don't expect official "releases" until the physical X16 is out. Until then, there will be "non-releases" of Box16. Since this is originally forked from the Official X16 emulator, the goal is to remain fully compatible with the Official X16 emulator, but with feature-adds such as ImGui displays, and performance improvements from OpenGL acceleration.
Some of the feature-adds will be prototype or preview in nature, as this is also my platform for fixing bugs and adding features to the official emulator.
- CPU: Full 65C02 instruction set
- VERA
- Mostly cycle exact emulation
- Supports almost all features:
- composer
- two layers
- sprites
- VSYNC, raster, sprite IRQ
- Sound
- PCM
- PSG
- YM2151
- SD card: reading and writing (image file)
- VIA
- ROM/RAM banking
- keyboard
- mouse
- gamepad
- VERA
- Does not support the "CURRENT_FIELD" bit
- Interlaced modes (NTSC/RGB) don't render at the full horizontal fidelity
- VIA
- Does not support counters/timers/IRQs
The emulator itself is dependent on SDL2 and OpenGL. However, to run the emulated system you will also need a compatible rom.bin
ROM image. This will be
loaded from the directory containing the emulator binary, or you can use the -rom .../path/to/rom.bin
option.
WARNING: Older versions of the ROM might not work in newer versions of the emulator, and vice versa.
You can build a ROM image yourself using the build instructions in the x16-rom repo. The rom.bin
included in the latest release of the emulator may also work with the HEAD of this repo, but this is not guaranteed.
Read resources/r39/README
and build or acquire the necessary files.
The needed development packages are available as a distribution package with most major versions of Linux:
- Debian:
sudo apt-get install libglew-dev libgtk-3-dev libsdl2-dev libsdl2-image-dev
- Raspbian:
sudo apt-get install libglew-dev libgtk-3-dev libsdl2-dev libsdl2-image-dev
- Fedora 33:
sudo dnf install glew-devel SDL2-devel SDL2_image-devel
Type make
to build the source. The output will be box16
in the output directory. Remember you will also need a rom.bin
as described above.
Read resources/r39/README
and build or acquire the necessary files.
Install Microsoft Visual Studio Community 2019, make sure to include the following modules:
Desktop development with C++
Open build\vs2019\box16.sln with Visual Studio Community 2019.
Select Build All
from the Build
menu.
The built .exe and associated files should be located in build\vs2019\out
, plus a few more subdirectories based on the exact build generated.
You can start box16
/box16.exe
either by double-clicking it, or from the command line. The latter allows you to specify additional arguments.
- When starting
box16
without arguments, it will pick up the system ROM (rom.bin
) from the executable's directory. -abufs <number>
Is provided for backward-compatibility with x16emu toolchains, but is non-functional in Box16.-bas
lets you specify a BASIC program in ASCII format that automatically typed in (and tokenized).-debug <address>
adds a breakpoint to the debugger.-dump {C|R|B|V}
configure system dump (e.g.-dump CB
):C
: CPU registers (7 B: A,X,Y,SP,STATUS,PC)R
: RAM (40 KiB)B
: Banked RAM (2 MiB)V
: Video RAM and registers (128 KiB VRAM, 32 B composer registers, 512 B pallete, 16 B layer0 registers, 16 B layer1 registers, 16 B sprite registers, 2 KiB sprite attributes)
-echo [{iso|raw}]
(e.g.-echo iso
) causes all KERNAL/BASIC output to be printed to the host's terminal. Enable this and use the BASIC command "LIST" to convert a BASIC program to ASCII (detokenize):- By default, everything but printable ASCII will be escaped.
iso
will escape everything but non-printable ISO-8859-1 characters and convert the output to UTF-8.raw
will not do any substitutions.
-hypercall_path <path>
sets the default path for all LOAD and SAVE calls to BASIC and the kernal.-geos
launches GEOS at startup.-gif <file.gif>[,wait]
records frames generated by the VERA to the specified gif file (e.g.-gif capture.gif
or-gif capture.gif,wait
)- Recording normally begins immediately.
,wait
will begin the gif file, but immediately pause recording.- POKE $9FB5,0 will pause GIF recording
- POKE $9FB5,1 will snapshot a single frame
- POKE $9FB5,2 will unpause GIF recording
-help
will show all command line options and their documentation, then immediately exit.-keymap
tells the KERNAL to switch to a specific keyboard layout. Use it without an argument to view the supported layouts.-log
enables one or more types of logging (e.g.-log KS
):K
: keyboard (key-up and key-down events)S
: speed (CPU load, frame misses)V
: video I/O reads and writes
-nobinds
will disable most emulator keyboard bindings, allowing the X16 to see most keys and key chords.-nosound
can be used to specify that the audio subsystem should not be enabled in the first place.-nvram
lets you specify a 64 byte file for the system's non-volatile RAM. If it does not exist, it will be created once the NVRAM is modified.-prg
lets you specify a.prg
file that gets injected into RAM after start.-quality {nearest|linear|best}
lets you specify video scaling quality.-ram <ramsize>
will adjust the amount of banked RAM emulated, in KB. (8, 16, 31, 64, ... 2048)-rom <rom.bin>
will allow you to override the KERNAL/BASIC/ROM file used by the emulator.-rtc
will set the real-time clock to the current system time and date.-run
executes the application specified through-prg
or-bas
usingRUN
orSYS
, depending on the load address.-scale {1|2|3|4}
sizes the Box16 window to scale video output to an integer multiple of 640x480. (e.g.-scale 2
)-sdcard <sdcard.img>
lets you specify an SD card image (partition table + FAT32).-sound <device>
lets you specify a specific sound device to use. If given an improper device or no device, will list all audio devices and exit.-stds
will automatically load all kernal and BASIC labels, if available.-sym <filename>
will load a VICE label file. Note that not all VICE debug commands are available. (e.g.-sym myprg.lbl
)-test {0, 1, 2, 3}
will automatically invoke the TEST command with the provided test number.-version
will print the version of Box16 and then exit.-warp
causes the emulator to run as fast as possible, possibly faster than a real X16.-wav <file.wav>[{,wait|,auto}]
records audio to the specified wav file (e.g.-wav audio.wav
or-wav audio.wav,wait
)- Recording normally begins immediately.
,wait
will start with recording paused.,auto
will start with recording paused, but recording will automatically start at the first non-zero audio signal.- POKE $9FB6,0 will pause wav recording
- POKE $9FB6,1 will unpause wav recording
- POKE $9FB6,2 will unpause wav recording at the fist non-zero audio signal
-ymirq
will enable interrupts from the YM2151 audio chip (this is disabled by default to match the behavior of the official emulator r38)-ymstrict
will enable strict enforcement of the YM2151's busy status, dropping writes to the chip if it's busy at the time of write (this is disabled by default to match the behavior of the official emulator r38)
Run box16 -help
to see all command line options.
The X16 uses a PS/2 keyboard, and the ROM currently supports several different layouts. The following table shows their names, and what keys produce different characters than expected:
Name | Description | Differences |
---|---|---|
en-us | US | [`] ⇒ [←], [~] ⇒ [π], [\] ⇒ [£] |
en-gb | United Kingdom | [`] ⇒ [←], [~] ⇒ [π] |
de | German | [§] ⇒ [£], [´] ⇒ [^], [^] ⇒ [←], [°] ⇒ [π] |
nordic | Nordic | key left of [1] ⇒ [←],[π] |
it | Italian | [\] ⇒ [←], [|] ⇒ [π] |
pl | Polish (Programmers) | [`] ⇒ [←], [~] ⇒ [π], [\] ⇒ [£] |
hu | Hungarian | [\] ⇒ [←], [|] ⇒ [π], [§] ⇒ [£] |
es | Spanish | [|] ⇒ π, \ ⇒ [←], Alt + [<] ⇒ [£] |
fr | French | [²] ⇒ [←], [§] ⇒ [£] |
de-ch | Swiss German | [^] ⇒ [←], [°] ⇒ [π] |
fr-be | Belgian French | [²] ⇒ [←], [³] ⇒ [π] |
fi | Finnish | [§] ⇒ [←], [½] ⇒ [π] |
pt-br | Portuguese (Brazil ABNT) | [\] ⇒ [←], [|] ⇒ [π] |
Keys that produce international characters (like [ä] or [ç]) will not produce any character.
Since the emulator tells the computer the position of keys that are pressed, you need to configure the layout for the computer independently of the keyboard layout you have configured on the host.
Use the F9 key to cycle through the layouts, or set the keyboard layout at startup using the -keymap
command line argument.
The following keys can be used for controlling games:
Keyboard Key | NES Equivalent |
---|---|
Ctrl | A |
Alt | B |
Space | SELECT |
Enter | START |
Cursor Up | UP |
Cursor Down | DOWN |
Cursor Left | LEFT |
Cursor Right | RIGHT |
Ctrl
+R
will reset the computer.Ctrl
+V
will paste the clipboard by injecting key presses.Ctrl
+S
will save a system dump (configurable with-dump
) to disk.Ctrl
+F
andCtrl
+Return
will toggle full screen mode.Ctrl
+=
andCtrl
++
will toggle warp mode.Ctrl
+A
will attach the SD Card image, if available.Ctrl
+D
will detach the SD Card image.
On the Mac, use the Cmd
key instead.
With the argument -gif
, followed by a filename, a screen recording will be saved into the given GIF file. Please exit the emulator before reading the GIF file.
If the option ,wait
is specified after the filename, it will start recording on POKE $9FB5,2
. It will capture a single frame on POKE $9FB5,1
and pause recording on POKE $9FB5,0
.
PEEK($9FB5)
returns a 0 if recording is disabled, 1 if recording is enabled but not active, 2 if snapshotting a single frame, and 3 if recording.
With the argument -wav
, followed by a filename, a audio recording will be saved into the given WAV file. Please exit the emulator before reading the WAV file.
If the option ,wait
is specified after the filename, it will start recording on POKE $9FB6,1
. If the option ,auto
is specified after the filename, it will start recording on the first non-zero audio signal, or on POKE $9FB6,1
. POKE $9FB6,0
will pause recording, and POKE $9FB6,2
will pause recording until the next non-zero audio signal.
PEEK($9FB6)
returns 0 if recording is disabled, 1 if recording is enabled but not active, 2 if recording is paused waiting on a non-zero audio signal, and 3 if recording.
On startup, the X16 presents direct mode of BASIC V2. You can enter BASIC statements, or line numbers with BASIC statements and RUN
the program, just like on Commodore computers.
- To stop execution of a BASIC program, hit the
RUN/STOP
key (Esc
in the emulator), orCtrl + C
. - To insert characters, first insert spaces by pressing
Shift + Backspaces
, then type over those spaces. - To clear the screen, press
Shift + Home
. - The X16 does not have a
STOP + RESTORE
function.
The command line argument -sdcard
lets you attach an image file for the emulated SD card. Using an emulated SD card makes filesystem operations go through the X16's DOS implementation, so it supports all filesystem operations (including directory listing though DOS"$
command channel commands using the DOS
statement) and guarantees full compatibility with the real device.
Images must be greater than 32 MB in size and contain an MBR partition table and a FAT32 filesystem. The file sdcard.img.zip
in this repository is an empty 100 MB image in this format.
On macOS, you can just double-click an image to mount it, or use the command line:
# hdiutil attach sdcard.img
/dev/disk2 FDisk_partition_scheme
/dev/disk2s1 Windows_FAT_32 /Volumes/X16 DISK
# [do something with the filesystem]
# hdiutil detach /dev/disk[n] # [n] = number of device as printed above
On Linux, you can use the command line:
# sudo losetup -P /dev/loop21 disk.img
# sudo mount /dev/loop21p1 /mnt # pick a location to mount it to, like /mnt
# [do something with the filesystem]
# sudo umount /mnt
# sudo losetup -d /dev/loop21
On Windows, you can use the OSFMount tool.
If the system ROM contains any version of the KERNAL, and there is no SD card image attached, the LOAD ($FFD5
) and SAVE ($FFD8
) KERNAL calls (and BASIC statements) are intercepted by the emulator for device 8 (the default). So the BASIC statements will target the host computer's local filesystem:
LOAD"$
LOAD"FOO.PRG
LOAD"IMAGE.PRG",8,1
SAVE"BAR.PRG
Note that this feature is very limited! Manually reading and writing files (e.g. OPEN
in BASIC) is not supported by the host filesystem interface. Use SD card images for this.
The emulator will interpret filenames relative to the directory it was started in. On macOS, when double-clicking the executable, this is the home directory.
To avoid incompatibility problems between the PETSCII and ASCII encodings, you can
- use lower case filenames on the host side, and unshifted filenames on the X16 side.
- use
Ctrl+O
to switch to the X16 to ISO mode for ASCII compatibility. - use
Ctrl+N
to switch to the upper/lower character set for a workaround.
BASIC programs are encoded in a tokenized form, they are not simply ASCII files. If you want to edit BASIC programs on the host's text editor, you need to convert it between tokenized BASIC form and ASCII.
- To convert ASCII to BASIC, reboot the machine and paste the ASCII text using
Ctrl + V
(Mac:Cmd + V
). You can now run the program, or use theSAVE
BASIC command to write the tokenized version to disk. - To convert BASIC to ASCII, start box16 with the
-echo
argument,LOAD
the BASIC file, and typeLIST
. Now copy the ASCII version from the terminal.
Please see the KERNAL/BASIC documentation.
There are a number of debugging windows that can be displayed:
- Two independent memory dump windows.
- A disassembly and CPU status window.
- A VERA memory dump and status window.
The debugger keys are similar to the Microsoft Debugger shortcut keys, and work as follows
Key | Description |
---|---|
F1 | resets the shown code position to the current PC |
F2 | resets the 65C02 CPU but not any of the hardware. |
F5 | is used to return to Run mode, the emulator should run as normal. |
F9 | sets the breakpoint to the currently code position. |
F10 | steps 'over' routines - if the next instruction is JSR it will break on return. |
F11 | steps 'into' routines. |
F12 | is used to break back into the debugger. |
The STP instruction (opcode $DB) will break into the debugger automatically.
Effectively keyboard routines only work when the debugger is running normally. Single stepping through keyboard code will not work at present.
https://www.commanderx16.com/forum/
https://github.com/commanderx16/x16-emulator/wiki
Copyright (c) 2019-2020 Michael Steil <mist64@mac.com>, www.pagetable.com, et al.
Portions copyright (c) 2021 Stephen Horn, et al.
All rights reserved. License: 2-clause BSD
- Internals
- Replaced the YM core with ymfm, a BSD 3-clause library.
- YM2151 now supports timers, IRQs, and strict enforcement of the busy status.
- Removed a variety of redundant dll files (akumanatt)
- Fixed anisotropic filtering for display ("best" scaling option).
- Fixed middle mouse button support (ZeroByteOrg)
- Fixed YM2151 reset (ZeroByteOrg)
- Many overlays and UIs replaced or improved (akumanatt, et al)
- Added CPU visualization to show where/how the CPU is spending its time per frame.
- Added command-line parameter hints to tooltip on Options display.
- Added CPU stack to debugger
- Re-wrote PSG monitor (akumanatt)
- Added YM2151 monior (akumanatt)
- Improved Layer debugger (akumanatt)
- Improved Tile visualizer (akumanatt)
- Usability tweak to color picker
- Improved Sprite settings (akumanatt)
- Added basic MIDI support, it is now possible to play with the X16's audio devices via MIDI control.
- Fixed a variety of relatived and absolute pathing issues.
- Added support for "break" VICE label command in VICE label files.
- Moved YM2151 to r39 memory address
- Performance improvements
- Faster
rel
instruction. - Faster check for lo-RAM breakpoints.
- Faster
- Added WAV recorder
- Supporting hardware Rev2.
- Removed NES controller support.
- Added -nosound to explicity disable sound system init.
- Added ini file, comparable to r39. Will regenerate the file based on current command line options if no ini file is present at load time. Entries are identical to the command line parameters. Command line parameters will overrule ini file values.
- Internals
- Faster joystick implementation, now supporting hot-swapping.
- Even faster PS2.
- Rebuilt build script. Windows is now a VS2019 solution. Still no Mac, but Linux builds A-OK. Pls halp with iThings, PRs absolutely welcome.
- Fixes VERA scaling for scaling values greater than $80.
- Added a bunch of imgui windows for debugging and options. Full list, including new ones:
- Options
- Memory Dumps
- ASM Monitor
- CPU Visualizer
- VRAM Visualizer
- VERA Monitor
- Palette
- Layer Settings
- Sprite Settings
- PSG Monitor
- Fixes ported from official emulator:
- PR 216, fixing occasional flicker and hang issues on Linux. (nigels-com)
- PR 317, fixing debugger break timing after hypercalls.
- PR 321, adjusting mouse state send rate. (Elektron72)
- PR 322, fixing vsync timing. (Elektron72)
- PR 323, fixing front/back porch terms, quantities, and use. (Elektron72)
- PR 349, adding Delete, Insert, End, Page Up, and Page Down keys. (stefan-b-jakobsson)
- Internals
- Converted code to C++17, cleaned up all build warnings, save one.
- Converted build scripts to CMake, but lost Mac along the way. Halp fix pls?
- Converted rendering to OpenGL.
- Converted overlay to ImGUI.
- Unified keyboard-like input and data queues.
- Restructured memory access to provide real read-only access for the debugger. Also small speed boost.
- Rewrote the PS2 ports to be lean mean speed machines.
- Pulled non-VERA code out of VERA code.
- Debugger is now always enabled, the command-line option now requires an address and is used to set breakpoints.
- CPU
- added WAI, BBS, BBR, SMB, and RMB instructions [Stephen Horn]
- VERA
- VERA speed optimizations [Stephen Horn]
- fixed raster line interrupt [Stephen Horn]
- added sprite collision interrupt [Stephen Horn]
- fixed sprite wrapping [Stephen Horn]
- added VERA dump, fill commands to debugger [Stephen Horn]
- fixed VRAM memory dump [Stephen Horn]
- SD card
- SD card write support
- Ctrl+D/Cmd+D detaches/attaches SD card (for debugging)
- improved/cleaned up SD card emulation [Frank van den Hoef]
- SD card activity/error LED support
- VERA-SPI: support Auto-TX mode
- misc
- added warp mode (Ctrl+'+'/Cmd+'+' to toggle, or
-warp
) - added '-version' shell option [Alice Trillian Osako]
- new app icon [Stephen Horn]
- expose 32 bit cycle counter (up to 500 sec) in emulator I/O area
- zero page register display in debugger [Mike Allison]
- Various WebAssembly improvements and fixes [Sebastian Voges]
- added warp mode (Ctrl+'+'/Cmd+'+' to toggle, or
- VERA 0.9 register layout [Frank van den Hoef]
- audio [Frank van den Hoef]
- VERA PCM and PSG audio support
- YM2151 support is now enabled by default
- added
-abufs
to specify number of audio buffers
- removed UART [Frank van den Hoef]
- added window icon [Nigel Stewart]
- fixed access to paths with non-ASCII characters on Windows [Serentty]
- SDL HiDPI hint to fix mouse scaling [Edward Kmett]
- added VERA UART emulation (
-uart-in
,-uart-out
) - correctly emulate missing SD card
- moved host filesystem interface from device 1 to device 8, only available if no SD card is attached
- require numeric argument for
-test
to auto-run test - fixed JMP (a,x) for 65c02
- Fixed ESC as RUN/STOP [Ingo Hinterding]
- video optimization [Neil Forbes-Richardson]
- added
-geos
to launch GEOS on startup - added
-test
to launch (graphics) unit test on startup - debugger
- switch viewed RAM/ROM bank with
numpad +
andnumpad -
[Kobrasadetin] - optimized character printing [Kobrasadetin]
- switch viewed RAM/ROM bank with
- trace mode:
- prepend ROM bank to address in trace
- also prints 16 bit virtual regs (graph/GEOS)
- fixes
- initialize memory to 0 [Kobrasadetin]
- fixed SYS hex argument
- disabled "buffer full, skipping" and SD card debug text, it was too noisy
- PS/2 mouse
- support for text mode with tiles other than 8x8 [Serentty]
- fix: programmatic echo mode control [Mikael O. Bonnier]
- significant performance optimizations
- VERA
- enabled all 128 sprites
- correct sprite zdepth
- support for raster IRQs
- SDL controller support using
-joy1
and-joy2
[John J Bliss] - 65C02 BCD fixes [Norman B. Lancaster]
- feature parity with new LOAD/VLOAD features [John-Paul Gignac]
- default RAM and ROM banks are now 0, matching the hardware
- GIF recording can now be controlled from inside the machine [Randall Bohn]
- Debugging
- Major enhancements to the debugger [kktos]
-echo
will now encode non-printable characters like this: \X93 for CHR$(93),-bas
as well as pasting accepts this convention again-echo raw
for the original behavior-echo iso
for correct character encoding in ISO mode-ram
to specify RAM size; now defaults to 512
- correct ROM banking
- VERA emulation optimizations [Stephen Horn]
- added
-dump
option to allow writing RAM, CPU state or VERA state to disk [Nils Hasenbanck] - added
-quality
option to change scaling algorithm; now defaults to "best" [Maurizio Porrato] - output of
-echo
can now be fed into UNIX pipes [Anonymous Maarten] - relative speed of emulator is shown in the title if host can't keep up [Rien]
- fix: 6502 BCD arithmetic [Rien]
- fix: colors (white is now white) [Rien]
- fix: sprite flipping [jjbliss]
- VERA 0.8 register layout
- removed
-char
(character ROM is now part ofrom.bin
) - GIF recording using
-gif
[Neil Forbes-Richardson] - numpad support [Maurizio Porrato]
- fake support of VIA timers to work around BASIC RND(0)
- default ROM is taken from executable's directory [Michael Watters]
- emulator window has a title [Michael Watters]
-debug
allows specifying a breakpoint [Frank Buss]- package contains the ROM symbols in
rom.txt
- support for VERA SPI
Emulator:
- VERA can now generate VSYNC interrupts
- added
-keymap
for setting the keyboard layout - added
-scale
for integer scaling of the window [Stephen Horn] - added
-log
to enable various logging features (can also be enabled at runtime (POKE $9FB0+) [Randall Bohn]) - changed
-run
to be an option to-prg
and-bas
- emulator detection: read $9FBE/$9FBF, must read 0x31 and 0x36
- fix:
-prg
and-run
no longer corrupt BASIC programs. - fix:
LOAD,1
into RAM bank [Stephen Horn] - fix: 2bpp and 4bpp drawing [Stephen Horn]
- fix: 4bpp sprites [MonstersGoBoom]
- fix: build on Linux/ARM
- better keyboard support: if you pretend you have a US keyboard layout when typing, all keys should now be reachable [Paul Robson]
-debug
will enable the new debugger [Paul Robson]- runs at the correct speed (was way too slow on most machines)
- keyboard shortcuts work on Windows/Linux:
Ctrl + F/R/S/V
Ctrl + V
pastes the clipboard as keypresses-bas file.txt
loads a BASIC program in ASCII encoding-echo
prints all BASIC/KERNAL output to the terminal, use it with LIST to convert a BASIC program to ASCII-run
acts like-prg
, but also autostarts the programJMP $FFFF
andSYS 65535
exit the emulator and save memory into the host's storage- the packages now contain the current version of the Programmer's Reference Guide (HTML)
- fix: on Windows, some file load/saves may be been truncated
- support for 65C02 opcodes [Paul Robson]
- keep aspect ratio when resizing window [Sebastian Voges]
- updated sprite logic to VERA 0.7 – the layout of the sprite data registers has changed, you need to change your code!
- Command line overhaul. Supports
-rom
,-char
,-sdcard
and-prg
. - ROM and char filename defaults, so box16 can be started without arguments.
- Host Filesystem Interface supports
LOAD"$"
- macOS and Windows packaging logic in Makefile
- better sprite support (clipping, palette offset, flipping)
- better border support
- KERNAL can set up interlaced NTSC mode with scaling and borders (compile time option)
- sdcard: fixed
LOAD,x,1
to load to the correct addressg - sdcard: all temp data will be on bank #255; current bank will remain unchanged
- DOS: support for DOS commands ("UI", "I", "V", ...) and more status messages (e.g. 26,WRITE PROTECT ON,00,00)
- BASIC:
DOS
command. Without argument: print disk status; with "$" argument: show directory; with "8" or "9" argument: switch default drive; otherwise: send DOS command; also accessible through F7/F8 - Vera: cycle exact rendering, NTSC, interlacing, border
- SD card support
- pass path to SD card image as third argument
- access SD card as drive 8
- the local PC/Mac disk is still drive 1
- modulo debugging, this would work on a real X16 with the SD card (plus level shifters) hooked up to VIA#2PB as described in sdcard.c in the emulator surce
- Updated emulator and ROM to spec 0.6 – the ROM image should work on a real X16 with VERA 0.6 now.
SYS65375 (SWAPPER) now also clears the screen, avoid ing side effects.
- support for $ and % number prefixes in BASIC
- support for C128 KERNAL APIs LKUPLA, LKUPSA and CLOSE_ALL
- Toggle fullscreen using
Cmd + F
orCmd + return
- new BASIC instructions and functions:
MON
: enter monitor; no more SYS65280 requiredVPEEK(bank, address)
VPOKE bank, address, value
example:VPOKE4,0,VPEEK(4,0) OR 32
[for 256 color BASIC]
- fixed cursor trail bug
- fixed f7 key in PS/2 driver
- f keys are assigned with shortcuts now: F1: LIST F2: <enter monitor> F3: RUN F4: <switch 40/80> F5: LOAD F6: SAVE" F7: DOS"$ <doesn't work yet> F8: DOS <doesn't work yet>
- Fixed scrolling in 40x30 mode when there are double lines on the screen.
- video RAM support in the monitor (SYS65280)
- 40x30 screen support (SYS65375 to toggle)
- Integrated monitor, start with SYS65280
rom.bin
is now 3*8 KB:- 0: BASIC (bank 0 at $C000)
- 1: KERNAL ($E000)
- 2: UTIL (bank 1 at $C000)
- correct text mode video RAM layout both in emulator and KERNAL
- KERNAL: fast scrolling
- KERNAL: upper/lower switching using CHR$(
$0E)/CHR$ ($8E) - KERNAL: banking init
- KERNAL: new PS/2 driver
- Emulator: VERA updates (more modes, second data port)
- Emulator: RAM and ROM banks start out as all 1 bits
- Supports mode 7 (8bpp bitmap).
- Supports 8bpp tile mode (mode 4)
- The emulator and the KERNAL now speak the bit-level PS/2 protocol over VIA#2 PA0/PA1. The system behaves the same, but keyboard input in the ROM should work on a real device.
updated KERNAL with proper power-on message
-
LOAD and SAVE commands are intercepted by the emulator, can be used to access local file system, like this:
LOAD"TETRIS.PRG SAVE"TETRIS.PRG
-
No device number is necessary. Loading absolute works like this:
LOAD"FILE.PRG",1,1
-
New optional override load address for PRG files:
./x64emu rom.bin chargen.bin basic.prg,0401
- Now with banking.
POKE40801,n
to switch the RAM bank at $A000.POKE40800,n
to switch the ROM bank at $C000. The ROM file at the command line can be up to 72 KB now (layout: 0: bank 0, 1: KERNAL, 2: bank 1, 3: bank 2 etc.), and the RAM thatCmd + S
saves is 2088KB ($0000-$9F00: regular RAM, $9F00-$9FFF: unused, $A000+: extra banks)
- Vera emulation now matches the complete spec dated 2019-07-06: correct video address space layout, palette format, redefinable character set
- BASIC now starts at $0401 (39679 BASIC BYTES FREE)
Cmd + S
now saves all of memory (linear 64 KB for now, including ROM) tomemory.bin
,memory-1.bin
,memory-2.bin
, etc. You can extract parts of it with Unix "dd", like:dd if=memory.bin of=basic.bin bs=1 skip=2049 count=38655
- Supports PRG file as third argument, which is injected after "READY.", so BASIC programs work as well.
- STOP key support
- 6502 core, fake PS/2 keyboard emulation (PS/2 data bytes appear at VIA#1 PB) and text mode Vera emulation
- KERNAL/BASIC modified for memory layout, missing VIC, Vera text mode and PS/2 keyboard