A library of tap2sna.py recipes
A library of tap2sna.py recipes
In July of 2020 I said that in an ideal world where I had the time, I'd build a large library of tap2sna.py recipes (for producing pristine snapshots of ZX Spectrum games) for any and all to use as they see fit. Back then, given the crap quality of tap2sna.py, that would have been a monumentally difficult and hair-pullingly frustrating task.
Nowadays, though, tap2sna.py is less crap than it was (thanks to --sim-load), so I'm giving the idea a go.
t2sfiles
This library isn't large (yet), but it's a start. I'll add new recipes to it as time allows, and will happily accept contributions as well. If you're on GitHub already you could create a pull request, or submit your recipe in an issue. Or you could just post it here in this thread. Whatever's easiest.
Nowadays, though, tap2sna.py is less crap than it was (thanks to --sim-load), so I'm giving the idea a go.
t2sfiles
This library isn't large (yet), but it's a start. I'll add new recipes to it as time allows, and will happily accept contributions as well. If you're on GitHub already you could create a pull request, or submit your recipe in an issue. Or you could just post it here in this thread. Whatever's easiest.
Re: A library of tap2sna.py recipes
@Bedazzle is the winner of the First Contributor award:
https://github.com/skoolkid/t2sfiles/co ... 7e33240e67
Who will win the Second Contributor award? The race is on!
https://github.com/skoolkid/t2sfiles/co ... 7e33240e67
Who will win the Second Contributor award? The race is on!
Re: A library of tap2sna.py recipes
Library update: There are now over 1200 recipes in the t2sfiles repository.
So far I've been picking the low-hanging fruit as far as recipe-generation goes - meaning games whose start address tap2sna.py can automatically determine. That will continue for a bit, and then I'll have to tackle some of the higher-up fruit. Speedlock-protected games perhaps - since they all LOAD in much the same way, I might be able to automate the process to some extent (assuming I can identify all the Speedlock TZX files in my collection).
Some things I've noticed/learned in this process:
So far I've been picking the low-hanging fruit as far as recipe-generation goes - meaning games whose start address tap2sna.py can automatically determine. That will continue for a bit, and then I'll have to tackle some of the higher-up fruit. Speedlock-protected games perhaps - since they all LOAD in much the same way, I might be able to automate the process to some extent (assuming I can identify all the Speedlock TZX files in my collection).
Some things I've noticed/learned in this process:
- Many adventure games have the same start address (a Quill thing, perhaps).
- tzxvault.org is a bit weak when it comes to Spanish games.
- My collection of TZX files (originally pulled from Martijn's WoS) is old.
Re: A library of tap2sna.py recipes
Library update #2: There are now exactly 3861 recipes in the t2sfiles repository.
All the low-hanging fruit (i.e. games for which tap2sna.py correctly determines the start address automatically) have been picked as far as I can tell, so there will probably be a bit of a pause in new uploads until I decide what types of games to tackle next.
All the low-hanging fruit (i.e. games for which tap2sna.py correctly determines the start address automatically) have been picked as far as I can tell, so there will probably be a bit of a pause in new uploads until I decide what types of games to tackle next.
Re: A library of tap2sna.py recipes
Library update #3: There are now exactly 5229 recipes in the t2sfiles repository.
If there's no recipe for a particular game in the repository at the moment, it's probably for one of the following reasons:
If there's no recipe for a particular game in the repository at the moment, it's probably for one of the following reasons:
- The game executes some BASIC before doing a 'USR nnnnn', or is entirely written in BASIC, which makes specifying a "start address" that actually works somewhat tricky. (I'll probably add support for specifying a start address for such games in the next version of SkoolKit.)
- The game requires issue 2 keyboard emulation. (I'll probably add support for such games - e.g. Madhatter, Spinads, Rasputin - in the next version of SkoolKit.)
- The game doesn't run on a 48K Spectrum. (I might add support for 128K games later.)
- The game requires user input during the LOAD process, e.g. Stop the tape / Keyboard or Joystick? / Start the tape. (I have no plans to add support for these annoying games.)
- --sim-load fails to produce a working snapshot, and Fuse fails to load the game too. (If Fuse can't load the game - even with all tape acceleration disabled - I'm inclined to conclude that the tape is just broken.)
- --sim-load fails to produce a working snapshot, but Fuse does load the game successfully. (So far I've found six tapes for which this is the case. I'll probably investigate these further at some point.)
Re: A library of tap2sna.py recipes
No, but I'll see if I can generate one.
Re: A library of tap2sna.py recipes
Here it is:
https://skoolkit.ca/tapes/games-not-done.zip
It's a JSON file of all the games I'm aware of for which no t2s file exists in the repository.
https://skoolkit.ca/tapes/games-not-done.zip
It's a JSON file of all the games I'm aware of for which no t2s file exists in the repository.
Re: A library of tap2sna.py recipes
A quick contribution from me, the existing t2s file for Elite only covers one side of the tape, these create snapshots of both sides (which differ in the lineup of ships):
The file https://spectrumcomputing.co.uk/pub/sin ... te.tzx.zip is the same as the TZX Vault one if SC links are preferred.
Code: Select all
http://www.tzxvault.org/Spectrum/TZX/Elite-48k.zip
elite-48k-side-a.z80
--sim-load
--tape-name "Elite - 48k - Side A.tzx"
--tape-sum 6b0ee146cf206d997c901c0e67460c82
--start 53369
Code: Select all
http://www.tzxvault.org/Spectrum/TZX/Elite-48k.zip
elite-48k-side-b.z80
--sim-load
--tape-name "Elite - 48k - Side B.tzx"
--tape-sum 9dd57ef1bb0c42315951208593719960
--start 53369
Re: A library of tap2sna.py recipes
Thanks! I'll add this to the repository today.
(One of the most annoying things about making t2s files - so far - is finding multi-sided tapes where it's not obvious whether the sides are actually different.)
Re: A library of tap2sna.py recipes
Yep - that's exactly why they're so annoying. This takes time, and life is short.
Re: A library of tap2sna.py recipes
Great project that you've taken on, @SkoolKid . How does one tell which is a better and "more accurate" tzx or tap file? For example if the tzx exists but it's a hacked version, or if 3 tzx files exist and they all have different MDA checksums?
Re: A library of tap2sna.py recipes
Good question, and I don't have a good answer. So far I've assumed, for each game I've looked at, that the TZX file (if it exists) of the original release is the best one to use. (And if there's more than one of those, I go with the first one listed on the game's page on worldofspectrum.net.) If I knew that it was a hacked version, though, I would look for an alternative.
By the way, if anyone does spot a hacked tape being used somewhere in the repository, please report it as a bug.
Re: A library of tap2sna.py recipes
Seems like a good enough answer to me. I think that's what I would do as well.SkoolKid wrote: ↑Sun Apr 09, 2023 8:02 pm Good question, and I don't have a good answer. So far I've assumed, for each game I've looked at, that the TZX file (if it exists) of the original release is the best one to use. (And if there's more than one of those, I go with the first one listed on the game's page on worldofspectrum.net.) If I knew that it was a hacked version, though, I would look for an alternative.
I have some old TZX files which are type-ins which I entered BITD. I tried tap2sna converting Spraymania.tzx (type-in from Your Computer) from a TZX to a Z80 and that worked well. Then I tried Cheekah's Exploits and that did not work at all. After some debugging it turns out the BASIC loader loads some code which draws a loading screen and loads the final block of code using the standard ROM loader, then runs the game code.
What's the best way to handle this scenario with tap2sna? I was able to manually create a sort-of-perfect .Z80 snapshot using SpecEmu's debugger and saving a snapshot right after the loading was complete ( I saved the snapshot while still in debug mode so that the game code didn't resume executing).
Here's the t2s I used:
Code: Select all
"file:///C:/Files/ZX%20Spectrum/tap2sna%20Recipes/t2sfiles-master/Magazine%20Games/Cheekah's Exploits.tzx"
cheekahs-exploits.z80
--sim-load
--tape-name "Cheekah's Exploits.tzx"
--tape-sum 7cdeea4e23fce8b5753c1735f2a9b0aa
--start 32614
Re: A library of tap2sna.py recipes
It's hard to tell without seeing exactly what the loader does. At the moment, there is no way to tell tap2sna.py to "stop the simulation at address X, but only after the tape has finished", which sounds like what you may need (and which many BASIC-heavy games need). That's a feature I'm planning to add in the next version of SkoolKit.cmal wrote: ↑Mon Apr 10, 2023 1:24 am I have some old TZX files which are type-ins which I entered BITD. I tried tap2sna converting Spraymania.tzx (type-in from Your Computer) from a TZX to a Z80 and that worked well. Then I tried Cheekah's Exploits and that did not work at all. After some debugging it turns out the BASIC loader loads some code which draws a loading screen and loads the final block of code using the standard ROM loader, then runs the game code.
What's the best way to handle this scenario with tap2sna?
What's the significance of the 32614 start address, though?
(Also, by the way, if your recipe points to a local TZX/TAP file, the --tape-name and --tape-sum arguments are redundant. Those arguments are useful only for verifying the contents of a remote zip archive.)
Re: A library of tap2sna.py recipes
Makes sense what you say. In my example, which I didn't explain very well, the BASIC loader is simple, but it has a machine code loader as well.SkoolKid wrote: ↑Mon Apr 10, 2023 2:59 pm It's hard to tell without seeing exactly what the loader does. At the moment, there is no way to tell tap2sna.py to "stop the simulation at address X, but only after the tape has finished", which sounds like what you may need (and which many BASIC-heavy games need). That's a feature I'm planning to add in the next version of SkoolKit.
The BASIC loader looks like this:
10 CLEAR 32299: LOAD "" CODE: CLS : PRINT USR 32614
32614 is the start address of the machine code, according to the loader above. I realized after the fact that it's the wrong address to use for tap2sna.py because it loads another block of code by calling ROM address 1378. Only after that's done, the game starts.
Great, that's nice to know. Thanks!
Re: A library of tap2sna.py recipes
@cmal, I've just added support for stopping a simulated LOAD at the given --start address only after the tape has finished. If you want to test this new feature, grab a copy of the current development version of SkoolKit from GitHub and try this t2s file:
(0x053f is the address of the SA/LD-RET subroutine in the ROM.)
Code: Select all
"file:///C:/Files/ZX%20Spectrum/tap2sna%20Recipes/t2sfiles-master/Magazine%20Games/Cheekah's Exploits.tzx"
cheekahs-exploits.z80
--sim-load
--start 0x053f
-c finish-tape=1
Re: A library of tap2sna.py recipes
Hi @SkoolKid, Thanks for the change you made. I gave that a try but the Python script kept running without stopping. I stopped it with ctrl+C and then it produced a non-pristine z80 which worked but the PC was at some place well into the game code.
I adjusted the t2s file to read like this, which produces a pristine z80 file:
Here's the mc loader code. You can see where 0x7FC8 is the EI instruction that runs right after loading the main code block.
If you want to try it on your side, the TZX I used is on SC at Cheekah's Exploits
One method I find useful if the game uses a Basic loader which is difficult to get to or view is to place a breakpoint at address #34B6. That's the USR function in ROM and BC will contain the address of the USR address.
I adjusted the t2s file to read like this, which produces a pristine z80 file:
Code: Select all
"file:///C:/Files/ZX%20Spectrum/tap2sna%20Recipes/t2sfiles-master/Magazine%20Games/Cheekah's Exploits.tzx"
cheekahs-exploits.z80
--sim-load
--start 0x7FC8
If you want to try it on your side, the TZX I used is on SC at Cheekah's Exploits
One method I find useful if the game uses a Basic loader which is difficult to get to or view is to place a breakpoint at address #34B6. That's the USR function in ROM and BC will contain the address of the USR address.
Re: A library of tap2sna.py recipes
I could have sworn I looked for a TZX of the game right there a few days ago, but I must have missed it somehow.cmal wrote: ↑Sat Apr 15, 2023 9:01 pm If you want to try it on your side, the TZX I used is on SC at Cheekah's Exploits
Anyway, now that I can see the loading routine - and how it bypasses SA/LD-RET - I think 0x7FC8 is a good candidate for the start address. Another good one is 0x71AF (which is where the RET C returns to).
Re: A library of tap2sna.py recipes
Re: A library of tap2sna.py recipes
Library update #4: There are now exactly 6579 recipes in the t2sfiles repository.
If there's no recipe for a particular game in the repository at this point, it's probably for one of the following reasons:
If there's no recipe for a particular game in the repository at this point, it's probably for one of the following reasons:
- The game doesn't run on a 48K Spectrum. (I might add support for 128K games later.)
- The game requires user input during the LOAD process, e.g. Stop the tape / Want instructions? / Start the tape. (I have no plans to add support for these annoying games.)
- --sim-load fails to produce a working snapshot, and Fuse fails to load the game too. (If Fuse can't load the game - even with all tape acceleration disabled - I'm inclined to conclude that the tape is just broken.)
- --sim-load fails to produce a working snapshot, but Fuse does load the game successfully. (So far I've found eight tapes for which this is the case. I'll probably investigate these further at some point.)
- The game isn't in my collection of TZXs downloaded from worldofspectrum.net.
Re: A library of tap2sna.py recipes
Library update #5: There are now exactly 8267 recipes in the t2sfiles repository.
I did another sweep of the worldofspectrum.net archive and found some tapes that had been hiding under the sofa cushions, so to speak.
At this point I'm fairly confident that I've t2s-ified 99%+ of the games on worldofspectrum.net that actually can be t2s-ified.
I did another sweep of the worldofspectrum.net archive and found some tapes that had been hiding under the sofa cushions, so to speak.
At this point I'm fairly confident that I've t2s-ified 99%+ of the games on worldofspectrum.net that actually can be t2s-ified.
Re: A library of tap2sna.py recipes
Ahh I started looking at some of the missing files but never got round to raising a PR Looks like you've got all the ones I did anyway, although I used the TZX of Total Eclipse: The Sphinx Jinx instead of the TAP so I don't know if it's still useful?
Code: Select all
https://worldofspectrum.net/pub/sinclair/compilations/t/TotalEclipse+TheSphinxJinx.tzx.zip
total-eclipse-2-the-sphinx-jinx.z80
--sim-load
--tape-name "Total Eclipse & The Sphinx Jinx - The Sphinx Jinx.tzx"
--tape-sum ca4458b00be6bbea7ee05e316e24e250
--start 27228
Re: A library of tap2sna.py recipes
Yep, definitely. I prefer a TZX whenever one is available.