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: 1568
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: 1821
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: 1627
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: 1568
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: 541
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
Youth
McMeatLoaf
A3/AFL
Hairdog/BOOM!^Dream
Guests online: 131
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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