Adding XRoar Emulator for Tandy Color Computer emulation#14992
Adding XRoar Emulator for Tandy Color Computer emulation#14992ImCoKeMaN wants to merge 2 commits intobatocera-linux:masterfrom
Conversation
|
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
|
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. |
dmanlfc
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
is it low cpu requirements and therefore can likely work on all supported systems?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
i don't see any environment variables. where are configuration files written when this is run?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
if not using write_sdl_controller_db as a result, then yes remove it.
|
from CLI after |
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/