stella-emu / stella

A multi-platform Atari 2600 Emulator
https://stella-emu.github.io
GNU General Public License v2.0
626 stars 112 forks source link

Create Launcher snapshots automatically #920

Open thrust26 opened 2 years ago

thrust26 commented 2 years ago

It should be possible to create the snapshot collection (mostly) automatically using e.g. the following procedure:

Not all screenshots will be good enough, but I figure we could reach >90%.

We could also create multiple screenshots (ROM start, after RESET, after FIRE) this way and then sort out (almost) duplicate ones (I think there are tools for this).

Maybe this could be done in combination with #509?

thrust26 commented 2 years ago

After adding the swchb command, we are almost there. We can use -debug and autoexec.script to create the necessary snapshots.

Here is an example for autoexec.script which creates four snapshots/game:

frame 10
savesnap

swchb fd
frame 1
swchb ff
frame 60
savesnap

joy0fire 0
frame 1
joy0fire 1
frame 60
savesnap

joy0fire 0
frame 1
joy0fire 1
frame 60
savesnap

frame 1
exitRom

It creates a SELECT and two joystick FIRE button events. These are meant to skip potential title screens and menus. This way the last snapshot should (in most cases) display the game screen.

Now it takes a batch file to process all files of a folder. And a tool, which helps eliminating double snapshots. Alternatively taking the first three snapshots could be removed from the script.

thrust26 commented 2 years ago

Batch file:

set scriptpath=%~dp0
for %%f in (*.bin) do stella.exe -debug "%scriptpath%%%f"

Identifiying similar images works well, e.g. with Awesome Duplicate Photo Finder

Remaining issues: