Skip to content

Adding XRoar Emulator for Tandy Color Computer emulation#14992

Closed
ImCoKeMaN wants to merge 2 commits intobatocera-linux:masterfrom
ImCoKeMaN:xroar
Closed

Adding XRoar Emulator for Tandy Color Computer emulation#14992
ImCoKeMaN wants to merge 2 commits intobatocera-linux:masterfrom
ImCoKeMaN:xroar

Conversation

@ImCoKeMaN
Copy link
Copy Markdown
Contributor

@ImCoKeMaN ImCoKeMaN commented Dec 26, 2025

This is my first effort with something like buildroot so I will accept any pointers and tips.

This compiles on x86_64 and aarch64 and I was able to open and run a joystick game on both platforms.

It will need unzipped bios files bas13.rom and extbas11.rom in /userdata/bios/

@ImCoKeMaN ImCoKeMaN marked this pull request as ready for review December 28, 2025 20:48
@dmanlfc dmanlfc marked this pull request as draft December 31, 2025 23:24
@dmanlfc
Copy link
Copy Markdown
Collaborator

dmanlfc commented Dec 31, 2025

when working on a PR, mark it as draft until you have finished. also squash your commits so it's 1 commit, not currently 9.

Add xroar emulator for arm64 and x86_64
@ImCoKeMaN
Copy link
Copy Markdown
Contributor Author

I have squashed the commits now. This is my first contribution for this project so forgive my ignorance. What else is required for this to be merged? It has worked in my testing and I'm not planning to override the default of MAME so it should have little impact to any users not actively seeking it.

@ImCoKeMaN ImCoKeMaN marked this pull request as ready for review January 4, 2026 16:20
Copy link
Copy Markdown
Collaborator

@dmanlfc dmanlfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there no configuration features whatsoever required?

from typing import TYPE_CHECKING

from ... import Command
from ...controller import generate_sdl_game_controller_config, write_sdl_controller_db
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't use these...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do controllers work?

Copy link
Copy Markdown
Contributor

@crcerror crcerror Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.6809.org.uk/xroar/doc/xroar.shtml#Joysticks

Seems via SDL2, worked out of the box for me

Wait this interesting
https://www.6809.org.uk/xroar/doc/xroar.shtml#Joystick-options

You can indeed map a file

Copy link
Copy Markdown
Contributor Author

@ImCoKeMaN ImCoKeMaN Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be using SDL controllers, I believe that's what was making it work on my rg35xxh. Are you saying that line 6 can be removed and it would still work the same if there wasn't another export command in my script?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's using SDL controllers then set the environment variable "SDL_GAMECONTROLLERCONFIG": generate_sdl_game_controller_config(playersControllers), "SDL_JOYSTICK_HIDAPI": "0" as per other configgen examples.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not using write_sdl_controller_db as a result, then yes remove it.

XROAR_CONF_OPTS += --enable-coco3
XROAR_CONF_OPTS += --enable-mc10
XROAR_CONF_OPTS += --without-gtk2
XROAR_CONF_OPTS += --without-gtk3
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not gtk3 & gtkgl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the parameters I used for most compatibility in testing when I built it for portmaster and aarch64, and it also runs this way for x86_64 devices

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but likely without hardware acceleration. for gtk3 & gtkgl you can wrap the option in an ifeq statement. as an example you can do ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_HAS_LIBGL),yy). that way if the device supports OpenGL then you we can squeeze out more performance.

select BR2_PACKAGE_LIBCAPSIMAGE # ALL

# Color Computer (Tandy TRS-80)
select BR2_PACKAGE_XROAR # ALL
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it low cpu requirements and therefore can likely work on all supported systems?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reference machine for running this has been an h700 arm device. It may not work on armhf, what is needed to mark that as excluded, or how would that get tested?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it have a minimum system requirements? that should guide you. otherwise you can do if !BR2_PACKAGE_BATOCERA_TARGET_ for a board that does not meet the requirements. if blanket 32-bit arm or riscv may have troubles you can do if !BR2_riscv or if !BR2_arm etc.

XROAR_SOURCE = xroar-${XROAR_VERSION}.tar.gz
XROAR_SITE = https://www.6809.org.uk/xroar/dl
XROAR_LICENSE = GPLv3
XROAR_DEPENDENCIES = sdl2 alsa-lib
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you add these dependencies but don't select them in Config.in. this will throw an error if you try to compile as a standard build...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I'm not certain how to have that selected in the config,in, but when I compiled via a full build I also don't recall an Error. I really am trying to learn this, it's just a lot of parts to pull together and understand all the connections.

def generate(self, system, rom, playersControllers, metadata, guns, wheels, gameResolution):

commandArray = ["xroar", "-rompath", "/userdata/bios:/userdata/bios/xroar", "-fs", "-default-machine", "coco2bus", rom]
return Command.Command(array=commandArray)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't see any environment variables. where are configuration files written when this is run?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I have it's config just in the command line as most items can be configured that way. The options could also be in an xroar.conf wherever and just have -c path/to/xroar.conf as first command arg, but I wasn't certain how to create that or if it was actually even needed with how options can be set in configgen for commandline

from typing import TYPE_CHECKING

from ... import Command
from ...controller import generate_sdl_game_controller_config, write_sdl_controller_db
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's using SDL controllers then set the environment variable "SDL_GAMECONTROLLERCONFIG": generate_sdl_game_controller_config(playersControllers), "SDL_JOYSTICK_HIDAPI": "0" as per other configgen examples.

XROAR_CONF_OPTS += --enable-coco3
XROAR_CONF_OPTS += --enable-mc10
XROAR_CONF_OPTS += --without-gtk2
XROAR_CONF_OPTS += --without-gtk3
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but likely without hardware acceleration. for gtk3 & gtkgl you can wrap the option in an ifeq statement. as an example you can do ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_HAS_LIBGL),yy). that way if the device supports OpenGL then you we can squeeze out more performance.

select BR2_PACKAGE_LIBCAPSIMAGE # ALL

# Color Computer (Tandy TRS-80)
select BR2_PACKAGE_XROAR # ALL
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it have a minimum system requirements? that should guide you. otherwise you can do if !BR2_PACKAGE_BATOCERA_TARGET_ for a board that does not meet the requirements. if blanket 32-bit arm or riscv may have troubles you can do if !BR2_riscv or if !BR2_arm etc.

from typing import TYPE_CHECKING

from ... import Command
from ...controller import generate_sdl_game_controller_config, write_sdl_controller_db
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not using write_sdl_controller_db as a result, then yes remove it.

@crcerror
Copy link
Copy Markdown
Contributor

crcerror commented Jan 9, 2026

from CLI after export DISPLAY=:0.0

[root@BATOCERA /userdata/…/xroarbinary/x86_64]# ./xroar -joy help
        mjoy0      Mouse
        kjoy0      Keyboard: Cursors+Alt_L,Super_L
        wasd       Keyboard: WASD+O,P
        ijkl       Keyboard: IJKL+X,Z
        qaop       Keyboard: QAOP+Space,[
        030000001008000001e5000010010000 0: usb gamepad

@dmanlfc dmanlfc closed this Jan 11, 2026
@ImCoKeMaN ImCoKeMaN deleted the xroar branch March 24, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants