Skyscraper and apple2
@muldjord, et al:
My gamelist got corrupted (missing entries) so I investigated, and found an issue relating to Skyscraper and apple2 roms. (I suppose this applies to any system that uses writable disk images like this, but apple2 is the only one that I have at the moment.)
apple2 roms aren't exactly "ROMs," in that they aren't read-only. Rather, they are "live" floppy disk images that are both read from, and written to, during normal operation.
Skyscraper organizes its cache by assigning each entry a hash value, based on the file's sha1sum. When the file is written to, this changes its content and therefore its sha1sum, which "un-links" it from the cache entry.
So what happened was this:
I had some apple2 games. I scraped them using Skyscraper. Skyscraper hashed the files and wrote its database. Then I played a game (Lode Runner), and achieved a high score. This score was written to the disk image/ROM, which now has a different hash value than the database entry. Then, I removed a different game (Carmen Sandiego) from my library. I ran Skyscraper with
--cache vacuumto clean out the removed game's (Carmen Sandiego's) assets. But now, the "Lode Runner" file that exists in my library is different from what's logged in the cache. And what's logged in the cache, doesn't exist...so it has its assets vacuumed along with Carmen Sandiego. Now I have zero Lode Runner assets cached, and when I rebuild my gamelist, it doesn't include a Lode Runner entry.
I only had a small handful of apple2 games to begin with so it was relatively painless to reconstruct my gamelist after this single occurrence, but any ideas to prevent it happening again in the future?
Interesting find. What SkySkraper version you are on? Does it happen with all apple2 emulators or which one are you using in this context?
Does the apple2 emulator in question support loading ROMs from zip files?
Yes: You are lucky. Use zipped-ROMs and you should be fine, as SkySkraper uses the filename instead of the file contents for zip files (and other file formats). 
I came across the same issue but with PC games, launched from
*.conf"ROMs" (=dosbox configurations). I filed a bug report a while ago , but Muldjord is not very active on SkySkraper as it seems.
No: If your favorite emulator can not deal with zipped ROMS you may add the extensions to this
ifclause , then the filename will be used as input for the hash.
Only downside is that you have to reapply the patch everytime you update SkySkraper from sources. And you can not use the binary pre-compiled SkySkraper from the RetroPie maintainers.
@Lolonois oh yah, it looks like this is the same issue as that.
I'm using linapple. It does not appear to support
.zipfiles (platforms.cfg), but adding the Apple2 suffixes to that list in
nametools.cppdoes look like it might do the trick.
Edit: yah that seems to have worked: https://github.com/muldjord/skyscraper/compare/master...s1eve-mcdichae1:skyscraper:apple2exts