Launch emulators from command-line

Страница 1/2
| 2

By aoineko

Paladin (887)

Аватар пользователя aoineko

30-12-2021, 01:54

Hi all,

I am integrating emulator testing into the tool chain of my C game library.
I already support (at least partially) a lot of emulators: OpenMSX, BlueMSX, Meisi, Emoulicious, fMSX and RuMSX.

Disclaimer: Please don’t start an emulator war. ^^ The point here is not to know which one is the best or if we need all of them. It just seems "acceptable" to me that someone would want to test their program on one or the other. Personally, I regularly use 2~3 of them.

To integrate these emulators into my tool chain, I need to be able to control the emulator launch through command-line arguments. Here is my test parameters:
- Format (ROM binary, BASIC or MSX-DOS binary from folder or .DSK file)
- Machine (MSX 1, 2, 2+, turbo R)
- Frequency (50 / 60 Hz)
- Fullscreen
- Mute
- Sub-slot (for ROM test)
- "Debugger" (differs a lot from one emulator to another)

I have come across some limitations and would like to know if someone knows any solution to these problems.
Let's go emulator by emulator (no preference order ^^).

[OpenMSX] doc
- No MSX turbo R machine in the vanilla version => I suppose there is nothing to do but wait for a hypothetical version of C.BIOS for turbo R. I can't ask for patented ROMs in my toolchain.
- No way to test BASIC and DOS binaries in the vanilla version => Same C.BIOS issue.

[BlueMSX] doc
- The only 50Hz MSX2+ machine is C.BIOS based => Not a big deal
- No 50Hz MSX turbo R machine => Not a big deal
- Can’t test DOS binaries => I did not find how to start DOS in BlueMSX from command-line
- No support for Mute and Sub-slot

[fMSX] doc
- Can’t test DOS binaries => I did not find how to start DOS in fMSX (even with the "Load MSXDOS2.ROM" option checked)
- No support for MSX turbo R, Fullscreen and Sub-slot

[Mesei]
I couldn't find any info on the command line arguments. I can start a ROM but I don't know if there are other options. I have not yet tested with DSK2ROM.
- Mesei only support MSX1

[Emulicious]
- No support for MSX2, 2+, turbo R, Frequency, Fullscreen and Sub-slot
- No way to test BASIC and DOS binaries (C.BIOS)

[RuMSX]
- No support for MSX2, 2+, turbo R, Frequency, Fullscreen and Sub-slot
- Can’t test DOS binaries => I did not find how to start DOS in RuMSX from command-line

That's it. Sorry for the long post.

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By pizzapower

Master (149)

Аватар пользователя pizzapower

31-12-2021, 00:00

MSX2/2+ C-BIOS works with DOS. No BASIC ROM required.

By ren

Paragon (1932)

Аватар пользователя ren

31-12-2021, 11:52

Quote:

Can’t test DOS binaries

Generate a DOS disk on the fly and boot that? (Perhaps openMSX's diskmanipulator can be of use here?)

Some other emu's to consider:

  • MAME
  • CLK (Clock Signal) (MSX1 only)
  • RVM (Retro Virtual Machine, MSX1 support currently in 2.1 Patreon beta)
  • WebMSX

By aoineko

Paladin (887)

Аватар пользователя aoineko

31-12-2021, 14:02

pizzapower wrote:

MSX2/2+ C-BIOS works with DOS. No BASIC ROM required.

I tried many things in OpenMSX with MSX2 C-BIOS, but even adding a floppy disk drive and MSX-DOS as an extension, I can't get to DOS.
Where can I find the method to access the DOS with C-BIOS?

ren wrote:

Generate a DOS disk on the fly and boot that? (Perhaps openMSX's diskmanipulator can be of use here?)

I use DskTool 1.40 to generate on the fly the DSK file with the program to be tested and an autoexec to start it automatically (and the MSX-DOS files in case of a .COM program).
In OpenMSX, with the ROM of a real machine and with MSX-DOS extension, my DOS programs start without any problem, either via a directory or from a DSK file.
With C-BIOS or other emulators, I have not found how to do this.

ren wrote:

Some other emu's to consider:

  • MAME
  • CLK (Clock Signal) (MSX1 only)
  • RVM (Retro Virtual Machine, MSX1 support currently in 2.1 Patreon beta)
  • WebMSX

WebMSX is at the top of my list of next additions. I've figured out how to run it from the command line (with the default web browser), but I haven't figured out how to tell it to run my "local" program. WebMSX seems to be able to read a program on local computer (since we can drag&drop them into the application), but I don't know how to indicate this in the URL.

I have never heard of CLK and RVM. I'll take a look at it.

By turbor

Hero (519)

Аватар пользователя turbor

31-12-2021, 14:03

aoineko wrote:

I can't ask for patented ROMs in my toolchain.

Some nitpicking here, but I think you mean copyrighted ROMs instead of patented ROMs Smile

But can you explain what you mean?
In case of openMSX the Roms are stored seperatly in a global directory or somehwere in you home directory so how do you consider this part of your toolchain? If you want to host your testing somewhere else in the cloud and you do not want to upload copyrighted material that would make sense, but then the fullscreen and mute do not make sense imho.

aoineko wrote:

openmsx: No way to test BASIC and DOS binaries in the vanilla version

This got me bafled. Do you imply that the other emulators allow you to test BASIC programs? if so then they included copyrighted roms, and your toolchain is already infringing on those copytrighted ROMs you talked about earlier.

If you add the roms for the machines you wish to emulate in openMSX then you can use the dir-as-disk feature to put the basic program in a directory. If you rename it to autoexec.bas it will even start automatically.

Also it is not clear if you want to test DOS1 or DOS2 programs. For DOS1 it suffices to include COMMAND.COM and MSXDOS.SYS on the disk.
For DOS2 programs you need the DOS2 files AND the extra ROM. Some MSX models, like the turbo R, have these MSXDOS2 roms built in otherwise you need to emulate the external DOS2 cartridge. Nishi has given the community the permission to copy those roms so emulators can use them. Even the BIOS roms may be distributed, but not the BASIC roms since he isn't the only rights holder so he can not unilaterally give permission (hence my remark earlier).

By gdx

Enlighted (6102)

Аватар пользователя gdx

31-12-2021, 14:22

I think Aoineko want automatically execute its programs after C compilation.
OpenMSX for Mac works fine executed from command line. I think it's same on Linux. I don't know on windows.

By aoineko

Paladin (887)

Аватар пользователя aoineko

31-12-2021, 16:16

gdx wrote:

I think Aoineko want automatically execute its programs after C compilation.

That's it.
My build tool has several steps that the user can configure:
- COMPILE : Compilation of all sources (mainly C)
- BUILD : Making of the binary file
- PACKAGE : Creation of the final file (depending on the target: BASIC or DOS binary, or ROM). This is where, for example, the assembly of ROM mapper segments is done.
- DEPLOY : Storage of final files for use with emulators. This is where, for example, the DSK files are created.
- RUN : Launching the emulator with automatic start of the program to be tested.

Everything works just fine with OpenMSX configured to use a real machine (with a floppy drive for .BIN and .COM formats).

My problem with copyrighted ROMs is not so much the legal side but the practical one.
I would like a new user to be able to get my library and run his first program without having to ask him/her to found some illegal ROMs on the web. In my documentation I would like to have just these steps:
- Download the library
- Install your favorite MSX emulator
- Setup the path to the emulator
- Launch the build tool on some samples and voilà \o/

That's why, with OpenMSX, I try to make my test process work with the Vanilla version. For emulators that include copyrighted content, that's their problem ^^

To get back to the DOS problem, I have to admit that I don't know this environment very well (my library is mostly ROM oriented). I'm adding the DOS2 files, so that explains why I need the dedicated ROM. I will investigate the difference between the 2 versions and test with the DOS1 files to see if that fixes the problem. Thank you.

By ren

Paragon (1932)

Аватар пользователя ren

01-01-2022, 14:32

aoineko wrote:

WebMSX is at the top of my list of next additions. I've figured out how to run it from the command line (with the default web browser), but I haven't figured out how to tell it to run my "local" program. WebMSX seems to be able to read a program on local computer (since we can drag&drop them into the application), but I don't know how to indicate this in the URL.

Browser security prevents pages/JS from directly accessing files from local filesystems (file:// URLs). Arguably the best solution would be to invoke a local webserver through which WebMSX is hosted & the disk is fetched (same origin).

Another option could be to use an online service where you can upload the .dsk (via an API), and can access it via the resource's generated URL: https://webmsx.org/?DISKA_URL=https://... (Note: the webmsx.org hosted instance fetches media via a proxy (an undocumented feature) as a means to bypass same origin restrictions.)

Yet another option could be writing a browser extension Smile

By aoineko

Paladin (887)

Аватар пользователя aoineko

01-01-2022, 16:03

I'm using UwAmp to launch a program in my PHP tools chain but it's quite a huge program to include in a MSX C library.
Online storage may be a good alternative. I'll test this option, thanks.

By ren

Paragon (1932)

Аватар пользователя ren

01-01-2022, 16:53

I suppose you just need the webserver for the user. You could consider nginx or perhaps (better) lighttpd or Mongoose (and/or offer it as an optional download/extension).

You're currently only supporting Windows I guess (https://github.com/aoineko-fr/CMSX) ?

By aoineko

Paladin (887)

Аватар пользователя aoineko

01-01-2022, 22:30

ren wrote:

You're currently only supporting Windows I guess (https://github.com/aoineko-fr/CMSX) ?

Yes, for now. When everything will works well, I plan to port the Build Tool to python to make it cross-platform.

For WebMSX, what I'm going to do is ask to fill 2 parameters:
- The execution code of the copy to the online storage service,
- The URL to access the program to test.
Like that, it will work with any service.

Страница 1/2
| 2