| |
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 |
|
| |
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. |
| |
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.
|
| |
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 |
| |
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 |
| |
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. |
| |
TWW
Registered: Jul 2009 Posts: 545 |
OR, you can do it in a way which "kicks ass". |