PSID für eigene Programme umwandeln

(scrollen Sie ein wenig, um die zusätzliche englische Übersetzung von DeMOSic zu sehen, die sehr viel ausführlicher ist).

(scroll a little for DeMOSic’s additional English translation (which is way more in-depth))

Die HVSC ist wirklich eine tolle Sache mit ihren über 55.000 zusammengesammelten SID-Musiken. Am PC mit Softwareplayern und mit gesonderter C64-Hardware 1541 Ultimate 2 plus sind sie schnell abgespielt.
Was aber, will man einen Song in ein BASIC-Programm oder ein Diskmag *hint* einbinden?
Das erfordert ein paar Schritte, die nativ am C64 etwas umständlich erscheinen, wo es am PC doch auch mit ein paar Mausklicks funktioniert. Aber niemand lernt etwas dabei, also hier einmal der umständliche Weg am C64.

Ohne lange Worte: das war meine Version
Damit ist auch gleich die Musik gestartet. Geht natürlich auch anders!

Warum muss man das aber so tun?
Klar: PSID ist ein spezielles Dateiformat, was nativ am C64 nicht ohne weiteres verwendet werden kann.
Zunächst müssen 7c Bytes (hex) Header am Anfang der Datei entfernt werden. Dann schiebt man alles nach 1000, damit es C64-konform ist. Normal lädt ein PSID nach 5850, wo es bereits anderen Code deines Programms stören kann.

Viel Spaß beim ausprobieren!


How To use a PSID .sid file for your Demo or Game or diskmag, etc etc etc.
If you wanna find sid files to use The HVSC has over 55000 sids. You can load these with sid players like JSIDPlay2 or SidPlayFP, theres even an online sidplayer called DeepSID (By Jens Christian Huus) and you can also run sid files natively on hardware by converting them with something like PSID64 or by coding your own player (hehe)
But what if you want to integrate a song into something like a BASIC program or a Diskmag *hint*?
This requires a few steps which can be done in assembler
Youll need these things
SID File (Obviously)
Hex Editor (this is optional as you can cut bytes in some assemblers, but assemblers like dasm cant. A Good option is HxD)
and an assembler (like 64Tass or Kick Assembler)
Optionally you can use this program
SIDEdit (You can look at the sid info in this tool)

You may ask, Why cant i just directly load the sid on C64?
Of course: PSID is a special file format that cannot be used natively on the C64.
To run a PSID on C64 (or use it in whatever thing you want to do), First, you’ll have to remove the first 7C bytes (which is the psid header) and then an extra 2 bytes (The startadress header) (you can remove all of this in the code with something like “.incbin “musicthingy.sid”,7e”, but if you are using something like dasm you will have to strip them in a hex editor (strip the first 7e bytes in the .sid file)) Then you can move the music to 1000 if youd like using something like SIDReloc by LFT, do this before stripping bytes. Now you can put the sid Into your code usually by Initializing 1000 and Playing 1003, but sometimes this varies (on futurecomposer play is 1006 if relocating sid to 1000 beforehand) this info is stored in the psid file, you can get this info by loading the .sid in SIDEdit.
Have fun trying it out!

Heres some code you can use to test https://codebase64.org/doku.php?id=base:simple_irq_music_player

…—DT112 wird den Artikel beinhalten—…