Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > How to link PSID with Turbo Assembler
2011-11-07 19:06
King Durin
Account closed

Registered: Oct 2007
Posts: 85
How to link PSID with Turbo Assembler

How do I link in a PSID with Turbo Assembler? I have a PSID that plays inits at $1000 and plays at $1003. It has the standard header on the file. I need to include the PSID file in my linked output with Turbo Assembler, but the simple docs I have found for Turbo Assembler do not tell me how to link binary files.

King Durin aka plbyrd
http://cbmcommand.codeplex.com
http://www.paytonbyrd.com
2011-11-07 22:17
Scout

Registered: Dec 2002
Posts: 1570
On a real c64 it's more efficient to rip a tune yourself, load it in memory and write code in turbo assembler to replay it.
Otherwise you have to write a tool to strip the 126 byte header from the psid and add the original loading address in front of the file.

If you want to play a psid using 64tass check this thread where I placed some quick n dirty code.
2011-11-07 22:35
Count Zero

Registered: Jan 2003
Posts: 1932
On c64 Turbo Assembler you usually dont include large data chunks into the source code anyway, but have a data file and the source.
2011-11-08 07:52
Frantic

Registered: Mar 2003
Posts: 1648
Durin: You enter your machine code monitor (such as the action replay monitor) and load the psid so that the actual c64 data in the psid that comes after the PSID header ends up at $1000. That is, if the psid header is $7c bytes (can't remember.. maybe the header size is $7d or something?) and if you have to get rid of two additional bytes in the beginning of the c64 file (the load adress — can't remember if one has to strip that from psid files or not), then you load the psid at address $1000-$7c-2, which is $0f82, i.e. something like this in the monitor:

L"mytune.sid",8,0f82

The action replay monitor will output the memory range used by the tune, which can be good to know later when saving everything, so write that on a note. Then you assemble your replayer source in turbo assembler, and make sure that the output from the assembler does not overlap with the memory range where you put the sid tune.

Now both the music and the replayer (in its assembled, binary form) should be in the c64 memory at the same time. Next step is to enter the monitor again and save the memory are which contains your replayer and your sidtune. Assuming that your replayer code start at $080d and that the sid tune ends at $2001, you'll write something like:

S"myintro",8,080d,2001

...and it will save your stuff to the disk as a "linked" binary. If there is no basic-line in front of your program, that will make it executable when typing RUN, you better use a cruncher (good idea anyway) to add that: The Cruncher AB V1.0
2011-11-08 18:31
King Durin
Account closed

Registered: Oct 2007
Posts: 85
Quote: On a real c64 it's more efficient to rip a tune yourself, load it in memory and write code in turbo assembler to replay it.
Otherwise you have to write a tool to strip the 126 byte header from the psid and add the original loading address in front of the file.

If you want to play a psid using 64tass check this thread where I placed some quick n dirty code.


I've written a quick tool for Windows to take a binary file and convert it to .byte statements for Turbo Assembler so I can .include the file in my assembly. The program takes an offset, so I can skip the $7C bytes of the PSID header.

King Durin aka plbyrd
http://cbmcommand.codeplex.com
http://www.paytonbyrd.com
2011-11-08 19:02
Scout

Registered: Dec 2002
Posts: 1570
Hmm...

In your initial post you mention Turbo Assembler.
Do you mean *the* Turbo Assembler we all used back in the days on the C64?
Or do you mix it up with the 64TASS linker for cross development for PC?

I'm asking this because you suddenly mention Windows and .include.

If you use cross development:
- use .binary to include a binary file (such as a psid or graphics).
- use .binary "whatever.sid",126 to skip 126 bytes (as you can read in the thread I redirected you earlier). This makes your windows tool obsolete (which you didn't have to code anyway if you had read the thread :-S)

If you use a real 64 with TASM:
- Don't include too much .byte data (as in complete sid songs or gfx data) because this will snoop up memory...a lot!
- Do what Count Zero & Frantic told you => which is the way we always did it.

Good luck.
2011-11-08 19:34
TWW

Registered: Jul 2009
Posts: 545
OR, you can do it in a way which "kicks ass".
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Guests online: 116
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.