SnapToTap R2.1
(c)2010-2011 Arda 'ref' Erdikmen
arda@kisafilm.org
http://arda.kisafilm.org/blog

What is it?
Snaptotap is a snapshot converter for Zx Spectrum emulation files.
it basically compresses and converts snapshot data into ONE single CODE block where you can load it by a simple LOAD "" CODE.

Is it special?
Yes, to the day, every snapshot converter uses custom loaders to load converted tape data.
snaptotap uses regular, standard basic loader. So you can easily carry snapsot data into any storage.
Snatotap uses very eficient Bitbuster compression. Uncompresser is 79 bytes long, so it does not corrupts your snapshot too much.

Usage:
Drag&drop a sna file into drag panel, wait a bit and select the loader type, save.



Options:
"Basic Loader" part is the target selection.
** Tape option injects this code: 1 Clear N: LOAD "F" CODE: RANDOMIZE USR X 
** Microdrive option inject this: 1 Clear N: LOAD *"m";1;"F" CODE: RANDOMIZE USR X 
** No Loader injects no loader, just code block. You have to manually calculate clear and start addresses. (Use USR address given on save group box. Eg. USR address is 43000, use this program to load the snapsot: CLEAR 42999:LOAD ""CODE:RANDOMIZE USR 43000)
** Autostart loader option makes first block started automatically. If you want to save this block to a real microdrive or tape, you should unselect this option. Or it will automatically load the code block and start the game.

Program Name:
Program name is a 1 letter long ident. It's 1 letter long because we have to conserve memory. It's there because if you are planning to put more than one snapshot into one microdrive or disk you'll need different filenames for the code block. 

If you are going to transfer the code block to another storage unit please read microdrive tutorial below.

Requirements:
Microsoft .net framework 2.0+


Experimental version:
Snaptotap is a proof of concept demo. While it's fully working, it is not a clean app, read: there is no error checking. It's highly recomended to restart the app everytime you want to convert a sna file. 

Downside:
This version always tries to compress the memory and if it fails to save more than 8kb, the process fails. In that case, please try Visual Snapshot Converter R1 which can split memory into two code block and still make it work.

History:

R2-Changed application name to "snaptotap", gui is now simplistic, conversion is fully automated.

R1-Visual Snapshot Converter - Initial release, advanced gui, manual controls.


Zip file contains 2 files, they must reside under same directory. Packer is a special packer to VSC, it doesnt pack anything other than VSC output, so dont mess with it. Unmodified packer available at gasman's BitBuster page.

Just click Visual Snapshot Converter and run.

TO COPY FILES TO MICRODRIVE:

When saving your file from VSC, make sure you selected Microdrive and UNchecked Autoload option.

Now. Setup your speccy, add only one microdrive, a pre-formatted cartridge with enough space on it, connect it's audio input to your computer.

1. On speccy type LOAD "" speccy waits for audio.
2a. Play TAP file from your emulator (do not use edge loader or flash loader.
2b. "Basic" part loads.Pause the emulator.
3. You can see the microdrive loader listing on real speccy. it's only 1 line long.
4. On real spectrum type SAVE *"m";1;"GAMENAME" LINE 1 
5. now type CLEAR X  : The X number is what you see in the listing.
6. after clear, time to transfer code block. Type LOAD "" CODE
7. Unpause the emulator. The Code block loads into real speccy.
8. After loading, you must do a simple calculation: Y=65535-X  (X is the clear adress)
9. Now by using the result, type SAVE *"m";1;"v2" CODE X+1,Y

example calculation. eg. if CLEAR is 30000 , 65535-30000=35535. thus, LOAD "" CODE 30001,35535

That's all. I'll be including a microdrive/disk copier soon. Check my website.

Background:

I was bought a pack of microdrive carts, and they were all blank. Then I got an idea of putting old games into those cartridges. But wait, all of the sna2tap converters was using their own custom tape loaders, and those loaders won't be loading anything from a microdrive. The idea was busted from start. Then I set a goal to make a snapshot converter using standard loading from basic.

it's started as ASM's idea to move game data which overlaps basic to somewhere safe, load the game data from basic, and execute game from basic by copying overlapping gamedata into it's original place.

And when I managed accomplish this simple task, asm released zxboot, which has simplistic but effective compressor, so it made my program absolete even before I released it. Our programs has to split memory into two, thus producing two code block, one for data, one for screen block.

After looking Asm's compression, I started to think that very same idea can still made possible but with only 'one' codeblock. But this needed an extremely effective compresser, which I'm now familiar of few, I used Bitbuster from Team Bomba.

Bitbuster compresses WHOLE batman snapshot into 33Kb (saves over 17kb), Cobra to 23kb and chuckie egg to mere 11kb (note that: including screen$).

That way it takes less time to load a game, you can fit more games into one microdrive cartridge or +3 disk.

Sadly, this tool corrupts first 280 to 437 bytes of your screen. The compressor needs to reside somewhere. Note that this size is not very optimized. it's very easy to save 100 more bytes, posibbly I will be aiming that if someone beats me to it. 

Another downside is this program coded under microsoft vc2008 .net, so you'll need .net 2.0+.

Also this program uses a slightly modified bitbuster extreme by team bomba and gasman. 


Licences:

Snaptotap (c)2010-2011 Arda 'ref' Erdikmen
disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 

Bitbuster Copyright (c) 2002-2003 Team Bomba

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

