Professional Documents
Culture Documents
Allright, there’s maybe a lot of you out there who wondered how to get all these lovely
sidtunes into .sid format, so that you can listen to it without the need of having an emulator
running all days. At first it’s unconvenient, takes up quite a bit of your CPU’s resources and
in many cases it does not offer the possibility of archiving the music ONLY, so you can
conveniently play it back whereever and whenever you like.
So it’s again one of these days where you’re sitting amazed in front of the emulator, staring at
your favourite crack-intro and you desperately want to get this tune into a neat little PSID file
to put it on your desktop to have it running in the background while doing your everyday’s
work.
But on the other hand you know that about 99% of all sidtunes are already ripped in the High
Voltage Sid Collection. And maybe you’re already familiar with the major composers (those
above the /VARIOUS directory), like Hubbard, Galway or Daglish, to name a few. You’re
absolutely sure that the tune you fell in love with is not among the classical pack of sids. You
are, on the other hand, a little bit afraid to scan the whole /VARIOUS directory for that
favourite sidtune – understandably, as it contains about 22.000 files! So the question is:
How to find it, and – in the unlikely case that it’s not in HVSC yet – how to rip it?
How to locate already ripped sidtunes in HVSC
This chapter is not only for the occasional listener of sidmusic or for the hardcore sid fan, it’s
also meant as a resource for external contributors, those guys that send in rip packs to the
HVSC administrator now and then (and who I like to express my warmest thanks for helping
the HVSC crew and who add valuable sids to the collection).
Nevertheless I will of course keep the chapter general enough so that the absolute newbie can
follow, and even if you feel adressed now I can assure you that every “monkey” with the
minimum ability of logical thinking can successfully complete the simple tasks I will describe
hereafter. In the end I’ve been one of those monkeys too, until some members of the HVSC
crew helped me to help myself. ;-)
Ok, back to the intro that is included in this guide. Load the W.O.F. file, it has 46 blocks.
We’re now sitting in front of it, listening to that cool tune. I assume you use the latest version
of VICE for that, although it basically works in every emulator that provides a machine-
language monitor.
So we hit Alt+M now or, to make it the complicated way, choose File|Monitor from the
pulldown menu. This is what you will get then:
The currently running program will pause while you’re in the monitor, so this function also
might come in handy for those who want to interrupt playing to do some urgent deeds. ;-)
So we want to find the music routine in memory, remember? One fundamental thing about a
music-routine is that it fiddles with the volume register. There are a few rare cases where the
below mentioned might not work, but I consider these to be below 0,1% of the cases.
So we type the following:
So we know that at memory location $0D4F there might be a part of the musicroutine. We
need to find the beginning of it, might be a good excercise for the ambitous ripper later on.
I’ll show you another command for listing memory areas (we had m and d so far,
remember?): Type i 0a00 (and hit return), then type i without argument again. And again.
And again. =)
Now start your favourite hex-editor. I find Ultraedit (www.ultraedit.com) quite comfortable to
work with, other people have reported Winhex (www.winhex.com) to be a good choice as
well. Open the file music.dat (which should be located in the same directory as the d64) and
scroll until you find the “magic string” aeinrw.
You see that Ultraedit shows all the characters in upper case now. I guess that has something
to do with the petscii/ascii conversion, but you don’t need to be concerned about it. You can
again see the magic string on the upper right. Now mark one line of hex-data, but be sure
NOT to mark a line that contains the byte 00. As you can see the marked example-string
doesn’t contain any of these. Copy the string to the clipboard by pressing Ctrl+C.
Users of Windows 98, Me or 2000 can now open the explorer search dialog and enter the
string there:
See, I’m entering the searchstring in the „Find
in file” field, we want to search for that string
inside of the sidtunes of the High Voltage Sid
Collection. The field “Suchen in” (search in)
should contain the HVSC directory, so for
example C:\HVSC\c64music.
Now let it search and with a little bit of luck
you will find the right file. Don’t give up if
you get no results, you might have just picked
the wrong search string. Go back to your hex
editor and mark a new line and search again.
If after about 3 tries you still get no results it
might be likely that the tune is in fact not in
HVSC yet.
It may happen that your search turns up hundreds, sometimes thousands of sids, which isn’t
very useful either. Then your searchstring is likely to be either too short or you took the bytes
to search for from the play routine and not from the music data. Just refine your search in this
case, take another string from a few lines below and search again.
Also be sure to include the search string in quotation marks if it contains a blank space (hex:
20). Otherwise the Windows search-tool will perform an OR search, meaning it will find files
containing only the string “mething” or “wonderful”.
If you have Windows XP the procedure is a little bit different. The built in search function of
WinXP is unfortunately bugged, so we need to use an external filesearch tool. A very good
choice is the Total Commander, available at www.ghisler.com. It’s shareware and you have to
register it after the trial-period, although it will still continue to work if you don’t.
It also works with the Ultraedit built-in Search|Find in Files function. But that way you can’t
start the tune directly from the search result window, hence I’ll stick to Total Commander in
this tutorial.
Hit Alt+F7 to enter the search dialog and paste the content of the clipboard into the “search
text” field:
In the case of the search-string used above you’ll see that you get exactly one result. You
guessed it already, the tune is the Strike Force Intromusic, a very famous sidtune which was
used in countless intros, notes and demos.
Some more examples, to make choosing the search-string easier:
1.
2.
3.
4.
1. Wrong. This string is above our “magic string”, thus you’re in the player. This would
in our case turn up several thousand tunes! ;-)
2. Again wrong, the string contains several 00s.
3. Right, you can of course mark less than a line and even over the linebreak.
4. Ok. Good choice!
Some things to keep in mind:
• There are always exceptions to the rule!
• Sometimes the string search just doesn’t work. I had a Jeroen Tel tune recently of which I
couldn’t remember the name. I did a string search, but no matter how often I tried I
couldn’t find it with the method described above. I had to locate it manually by listening
through all the tunes in his directory.
• Sometimes the programmers protect their tunes from being ripped by spreading pieces of
the code and music data all over the memory. There’s nothing you can do here apart from
writing an e-mail to the HVSC crew and request the tune to be ripped by us.
• Sometimes there’s no “magic string” that separates player and music data, or it may look
different than cgkoty or aeinrw. Trial and error method is to apply then. Or just look for a
regular byte pattern that “smells like” music data.
The more you try it the easier it will get for you to locate a tune, there’s no such thing as an
easy victory.
I’m happy you have made it this far, which brings me to the conclusion that you couldn’t find
the tune you’re looking for. If you didn’t know about the string-search so far it’s more than
likely that the above steps have taken you more than 20 minutes. Be assured that once you got
used to it this time decreases to about one minute per tune, which is a comfortable amount of
time compared to making a clean rip.
Take the second file included in this pack (Ikari_Intro.prg) and start it in the Vice emulator.
Ah, that classic tune surely will send shivers down your back! ☺
There are two terms called init and play that you have to get familiar with:
• The init routine (as the name implies) initializes the SID chip for the correct playback. For
example it sets the filter register value, the volume register value and usually clears certain
registers to be zero to avoid clicking noises and other unwanted audial side effects. The
init routine is only called once before the tune starts playing.
• The play routine is executed once a frame (or even more often to increase the resolution
of the sounds). It feeds the SID chip with the required notes and instrument data in regular
evenly timed intervals.
Allright, so we save the tune to the harddisk again: Enter s “ikari.dat” 0 1000 3000. This
saves the area from $1000-$3000.
We need the Sidedit tool from Lala now, download it from his site lala.c64.org. Not that one
couldn’t write a SID header “by hand” but Sidedit greatly simplifies this task.
Start Sidedit, mark the “List C64 data files” checkbox, navigate to the directory where your
ikari.dat file resides and load it by clicking once on it. Confirm both questions (load the tune?
Yes – Reset headers to default? Yes).
Click now on “Display SID Data”. A new window opens.
Choose Assembly from the Data display options and you see the familiar view from the
VICE monitor, right before you saved the file.
As a rule of thumb you should put down the first JMP adress as the init adress and the last
JMP as the play adress.
If a rip doesn’t work, then play around with the different combinations: Put the 1st value into
init, the 2nd into play. Or use the 2nd as init and the 1st as play.
Click OK to return to the main window. Then enter these two numbers into the initAddress
and playAdress field. Hit Save to File and then Play (or doubleclick on the .sid file in the
explorer window) to test if it works. You can make all changes to the titlefield or to the
filename later.
And to our all surprise the tune starts happily playing along! Congratulations on your first rip!
BUT! ;-)
The rip is not “clean” yet. If you want to submit your rips to be included into the High
Voltage Sid Collection your rip should be “clean”.
1. A clean rip should contain only the player and the music data, stripping down the filesize
to the minimum.
2. A clean rip plays exactly as it played in the _original source_. If a crack-intro can be seen
as the original source is often doubtable. Sometimes the person who ripped the tune in the
first place to use it in his own intro made a mistake that caused the tune to fall out of sync
later on. It even occured that a whole voice was missing or the tune starts at the wrong
position somewhere in the middle of the tune.
3. A clean rip should have no “bad reads”. This is when the tune tries to read data that is
outside the load range. Quite often tunes have seemingly bad reads in the area from
$0000 to $03FF. This is an exception and bad reads in this area are nothing to be
concerned about. The music routine often uses this area as buffer to make the playback
less CPU consuming.
4. A clean rip should loop correctly and should not fall out of sync.
With Adam Lorentzon’s ripper friendly version of Sidplay2w, included in this tutorial.
Drag’n’drop the newly created sidtune on the open Sidplay2 window and have it play for a
while. To speed this up you can use the shortcut Alt+8 and you’ll get fastforward at 8x speed.
Hit STOP and close Sidplay2 again. Now open the file memmap.txt in your C:\ directory.
;0000 .x...... ........ ........ ........ ........ ........ ........ ........
;0040 ........ ........ ........ ........ ........ ........ ........ ........
;0080 ........ ........ ........ ........ ........ ........ ........ ........
;00c0 ........ ........ ........ ........ ........ ........ ........ ...xxxx.
;0100 ........ ........ ........ ........ ........ ........ ........ ........
;0140 ........ ........ ........ ........ ........ ........ ........ ........
;0180 ........ ........ ........ ........ ........ ........ ........ ........
;01c0 ........ ........ ........ ........ ........ ........ .....++x x+++++xx
;0200 ........ ........ ........ ........ ........ ........ ........ ........
;0240 ........ ........ ........ ........ ........ ........ ........ ........
;0280 ........ ........ ........ ........ ........ ........ ........ ........
;02c0 ........ ........ ........ ........ ........ ........ ........ ........
;0300 ........ ........ ....x?.. ........ ........ ........ ........ ........
;0340 ........ ........ ........ ........ ........ ........ ........ ........
;0380 ........ ........ ........ ........ ........ ........ ........ ........
;03c0 ........ ........ ........ ........ ........ ........ ........ ........
;0400 ........ ........ ........ ........ ........ ........ ........ ........
;0440 ........ ........ ........ ........ ........ ........ ........ ........
;0480 ........ ........ ........ ........ ........ ........ ........ ........
;04c0 ........ ........ ........ ........ ........ ........ ........ ........
As I wrote above you see that there’s something going on in the area between
$0000 and $03FF. That doesn’t need to concern you or lead you to the conclusion that you
didn’t save enough memory area from the tune. Most of the sidtunes do this and if it messes
around in more than the $0000-$03FF area you have to cope with this by setting the
FREEPAGES flags.
;0f00 ........ ........ ........ ........ ........ ........ ........ ........
;0f40 ........ ........ ........ ........ ........ ........ ........ ........
;0f80 ........ ........ ........ ........ ........ ........ ........ ........
;0fc0 ........ ........ ........ ........ ........ ........ ........ ........
;1000 PPP,,,PP PRXXXXRR RRRXWWWW WXWWXXXX WWXXXW,X ,XXXXXXX XXXXXXXX XXXXXXXX
;1040 XXXXXXXX XXXXXWXX XXXXXXXX XWXWXXXX XXXXXWXW XXWXXXWX WWXWRRRR RRPPPPPP
;1080 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PP,,,,,, PPPPP,PP PPPPPPPP
;10c0 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1100 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1140 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1180 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;11c0 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1200 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1240 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1280 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;12c0 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPP,,, ,,,,,,,, ,,,,,,,P
;1300 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1340 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1380 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;13c0 PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPPPPPPP PPP,,,,,
;1400 ,,,,,,,, ,,,,PPPP PPPPPPPP PPPPPPP, ,,PPPPPP PPPPPPPP PPPPPPPP PPPPPPPP
;1440 PPPPPPPP PPPPPPPP PPP,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,RR,,R
;1480 R,,,,RR, ,RR,,RRR R,,RR,,R RRR,,RR, ,RRRR,,, ,,,RR,,, ,,,RR,,, ,,,,,,,,
;14c0 ,,,RRRRR R,,RRRR, ,RR,,RRR R,,RR,,R RRR,,RR, ,RR,,RRR R,,RR,,R R,,,,,,,
;1500 ,,,,,,,, ,,,,,,,, ,,,RRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1540 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1580 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;15c0 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1600 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1640 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1680 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;16c0 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1700 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1740 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR
;1780 RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR RRRRRR,,
;17c0 ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,,
;1800 ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,,
Here we have the snippet of memory that actually gets used by the tune. To understand what
the different symbols (P, X, R, W, dots and commas) mean, read the accompanying
documentation of the hacked Sidplay2 version. You see, the dots mark areas outside of the
loadrange of the tune that has no read or write accesses, the commas mark the are inside the
load range of the tune that have no read/write accesses.
So now we can determine the memory usage of the tune and make our new rip as short as
possible: $1000-$17BD.
Here you see the end of our saved memory range, followed by another location of memory
that seemingly got accessed while playing the tune. What the hell? ☺
This is the housekeeping code of Sidplay2 that places its own code into the virtual memory to
play back the tune without external interference by the emulator. This is done to achieve the
highest possible compatibility to a real C64 environment.
Now get back to SIDedit and enter the Diplay SID Data window again:
Now use the stringsearch method above to locate the tune in HVSC, it shouldn’t be hard to
find (hint: it’s by Laxity).
Congratulations, you just made your first rip! Now don’t forget to submit your rips to the
HVSC Crew (after you verified that they’re not already in HVSC, please!) and we’ll be
happy to include them in the next update. Happy ripping!
PS:
For those who think this all was baby-stuff or who would like to delve more deeply into
ripping I’d like to point you to Michael Schwendt’s ripping guide on the Sidplay homepage.
It’s much more detailed and covers lots of stuff that would have been too much to be included
in this introductory guide. Only the calculation of the machine cycles for the conversion of
VIC timed multispeed tunes to CIA timed rips is clearly wrong. The correct amount of cycles
of a PAL C64 is $4CC8, not $4CF8. Thus the calculation of CIA values for multispeed tunes
would be:
( $4CC8 / x ) – 1
In case of a doublespeed tune this would be ( $4CC8 / 2 ) – 1 = $2663. So the correct CIA
timer values would be:
$DC04: $63
$DC05: $26
Michael, should you read this, feel free to correct that mistake. ☺