ZSNES - Headless/Test mode?

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

Post Reply
bttf
New Member
Posts: 3
Joined: Sat Sep 21, 2013 6:49 pm

ZSNES - Headless/Test mode?

Post by bttf »

Hello,

I am trying to set up a continuous integration testing environment for my SNES workflow. I have automatic builds running when code is updated and I am trying to figure out how I can programatically test the integrity of an SMC/SFC/etc file.

I was hoping maybe there was a way to use ZSNES in a "command-line" mode to output whether it was able to sucessfully load the ROM or not. If not, are there any other options that come to mind?

I thank you in advance,
BTTF
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES - Headless/Test mode?

Post by kode54 »

And why would you use ZSNES for a SNES workflow? Unless you're not actually developing for hardware, or even developing for that matter.

It would probably be easier for you to examine the ROM loading process in Snes9X, as it's actually written in a high level language.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: ZSNES - Headless/Test mode?

Post by grinvader »

Nope. ZSNES doesn't check if a file looks correct to load it. The realsnes doesn't even care about internal header info, so as long as the right bits are in the right place, anything goes.

The advanced heuristics used to autodetect map type is probably the closest to what you want, and it's easier to use existing stand-alone tools (like nsrt) than adding special modes in fullblown emus. Especially emus that don't autodetect anything.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES - Headless/Test mode?

Post by kode54 »

Although if you want something open source, which can heuristically detect mappings from ROM images, and produce mappings in one man's vision of a machine readable text mapping descriptor format, and don't mind parsing over code written meticulously to fit that same man's vision of organization, you could take a look at byuu's Ananke library.

But really, what you're more likely to prefer is using nsrt and verifying titles against its internal database, rather than trying to guess from data that isn't even necessary for the games to boot on their own.
bttf
New Member
Posts: 3
Joined: Sat Sep 21, 2013 6:49 pm

Re: ZSNES - Headless/Test mode?

Post by bttf »

This seems pretty futile then.

Testing for the correct title data is not as thorough as I'd like it to be. And using heuristics to verify map data, if I understood correctly, sounds like something problematic to maintain as the code grows.

I think it may be more effective to just test if the ROM exists after compilation.

I may be able to do Automated UI tests to boot up the ROM and capture screenshots of gameplay at different intervals.

I have a small demo compiling now that is based on Matthew Callis' Tic-Tac-Toe guide.

Thanks,
BTTF
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES - Headless/Test mode?

Post by kode54 »

If you're validating the output of compiling your own code, I would suggest rigging up something with a Higan RetroArch core. You could probably whip up a quick RetroArch frontend that does nothing but run a game for a while and take periodic screen shots.

Higan is the ideal choice, especially the "Accuracy" core, as nothing else that you can call on like a library even approaches its level of accuracy.

I'm not sure if you'll need Ananke to generate mappings, but maybe it either detects on its own in libsnes form, or supports your own external mapping definition. You can create the mapping definition once for your game and reuse it as you recompile it later, unless the mapping changes.

I suggest contacting either the bsnes forum, or the RetroArch forum, with regard to using the emulator core for automated unit testing. I recall someone on one of those forums having something like that for bulk compatibility checking, to spot the simplest of mapping or execution failure errors.
bttf
New Member
Posts: 3
Joined: Sat Sep 21, 2013 6:49 pm

Re: ZSNES - Headless/Test mode?

Post by bttf »

Thank you for the useful information.

BTTF
Post Reply