| |
Trap
Registered: Jul 2010 Posts: 223 |
Loading, packing and linking on crossdev
Hi all,
I've spent some time coding some stuff and now I'm at a point where I need to look at putting the whole thing together. Packing, linking, adding a loader for the parts etc.
I'm using KickAss.
How do you manage files in a crossdev environment? Do I need a D64-editor of some sort to put it all together?
What (IRQ-)loaders and packers are you using these days? .... a lot has happened since SledgeHammer, so please bear with me :)
Trap
|
|
... 19 posts hidden. Click here to view all posts.... |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Quoting Trapis there an entirely different clever way to do this?
I suspect there are as many clever ways as there are C64 coders. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
here's what you'd want to keep in memory at all times:
$0200 - $0400 loader & depacker & one permanent raster irq 2 play music
$0400 - ~$1600 music
$1600 - $ffff anything else |
| |
ready.
Registered: Feb 2003 Posts: 441 |
I don't know about makefile, I assemble each demo part individually then link "by hand".
About the loader, it depends a lot on how the demopart is coded.
If the main effect is running in the irq and the background program is not used, you can do "jsr loader" in the baground program, then the loader will return with an rts once all the data has been loaded.
Here:
Aurora 100%
I had the problem that both irq and background programs were used in several parts and I wanted to load inside the parts. I assigned a certain number of processor cylces to the loader, so the demo part can still run, even if a bit slower, but if the cycles stolen are few nobody cares.
To do this I start a single shot CIA2 timer in the IRQ and jump to the loader. After the CIA2 delay an NMI takes care of getting back from the loader to the IRQ and saves the loader location, so that the IRQ can jmp to it the next frame. You can easily decide how much resources the loader can use by setting the CIA2 delay.
And what Oswald said unless you have particular needs. For example in the last part of the Aurora 100% (upscroller) the music is played in the main program. |
| |
ready.
Registered: Feb 2003 Posts: 441 |
once again I'm on packing and linking.
Usually I need to split the file I have to load into parts which are packed individually, so after compiling the file with 64tass, I load it in VICE monitor and save each part of the file separately.
Example in VICe monitor:
l"prg"0 (range $2000-$bfff)
s"prg0"0 2000 9fff
s"prg1"0 a000 bfff
then I pass the files prg0 and prg1 to Exomizer. Is there a way to split the prg file into subfiles from command line instead of using VICE?
|
| |
Mr. SID
Registered: Jan 2003 Posts: 424 |
You can use dd to split files. If you're on Unix, you already have it, on Windows you can download one of the many ports, like this one: http://www.chrysocome.net/dd
Then do:
dd if=prg of=prg0 bs=4096 count=8
dd if=prg of=prg1 bs=4096 skip=8 count=2
But I guess you'll also need start addresses in your files? In this case this will not work. |
| |
ruk
Registered: Jan 2012 Posts: 43 |
You can in fact crunch plain files with exomizer by the <filename>@<adress> syntax.
F.ex.
exomizer mem -c -l none part.bin@0x2000 -o part.exo
|
| |
Mr. SID
Registered: Jan 2003 Posts: 424 |
Ah, good to know! |
| |
Perplex
Registered: Feb 2009 Posts: 255 |
Quoting Mr. SID
dd if=prg of=prg0 bs=4096 count=8
dd if=prg of=prg1 bs=4096 skip=8 count=2
But I guess you'll also need start addresses in your files? In this case this will not work.
echo -ne "\x00\xa0" > prg1
dd if=prg of=prg1 bs=4096 skip=8 count=2 conv=notrunc oflag=append
|
| |
ready.
Registered: Feb 2003 Posts: 441 |
reading VICE docs:
6.10.1 Monitor command-line options
-moncommand FILENAME
Execute the commands from the file FILENAME in the monitor after starting up. This command line switch is mainly thought to load labels and to set breakpoints. Not all other commands are useful to be executed in this way, some may even lead to strange effects.
this comand could be useful to drive the monitor via command line, but most commands crash if executed this way :( |
| |
ready.
Registered: Feb 2003 Posts: 441 |
Finally I found a solution which solved my problem of extracting certain areas of a binary file without using VICE monitor, but an automated command line process. Googling I found this for coping part of a binary:
http://stahlworks.com/dev/index.php?tool=partcopy
and this to assign a load address, modifing the first 2 bytes (it's a command line hex editor):
http://sourceforge.net/projects/hexciting/
So, here is an extract of a batch file used for preparing the files to load taken from Ninfa/Level64:
64tass --m6502 m.txt -o 040exp
sfk165 partcopy 040exp -fromto 0x6100 0x8402 a0.part1 -yes
sfk165 partcopy 040exp -fromto 0x8802 0xb002 a0.part3 -yes
sfk165 partcopy entangled -fromto 0x0002 0x0402 a0.part2 -yes
copy /b a0.part1+a0.part2+a0.part3 041exp
sfk165 partcopy 040exp -fromto 0x8400 0x8802 046exp -yes
sfk165 partcopy 040exp -fromto 0xb000 0xda03 042exp -yes
sfk165 partcopy 040exp -fromto 0x0400 0x4002 043exp -yes
sfk165 partcopy 040exp -fromto 0x0000 0x0402 044exp -yes
sfk165 partcopy 040exp -fromto 0x4000 0x6102 045exp -yes
hexciting -v -a -r 0 2 041exp 0x00 0x00
hexciting -v -o -r 0 2 041exp 0x00 0x81
hexciting -v -a -r 0 2 042exp 0x00 0x00
hexciting -v -o -r 0 2 042exp 0x00 0xd0
hexciting -v -a -r 0 2 043exp 0x00 0x00
hexciting -v -o -r 0 2 043exp 0x00 0x24
hexciting -v -a -r 0 2 044exp 0x00 0x00
hexciting -v -o -r 0 2 044exp 0x00 0x20
hexciting -v -a -r 0 2 045exp 0x00 0x00
hexciting -v -o -r 0 2 045exp 0x00 0x60
hexciting -v -a -r 0 2 046exp 0x00 0x00
hexciting -v -o -r 0 2 046exp 0x00 0xa4
exomizer mem -c -l$e000 041exp -o 041
exomizer mem -c -l$2000 042exp -o 042
exomizer mem -c -l$2000 043exp -o 043
exomizer mem -c -l$fe00 044exp -o 044
exomizer mem -c -l$e000 045exp -o 045
exomizer mem -c -l$fd00 046exp -o 046
041, ....,046 are the compressed files to load from disk. This really boosted my work during the last months prior to X'2012, when bug fixing the linked demo disk.
|
Previous - 1 | 2 | 3 - Next |