Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Copperhead ! (Registered 2024-05-08) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Linking binary files without start address with exomizer
2021-08-06 21:05
wil

Registered: Jan 2019
Posts: 43
Linking binary files without start address with exomizer

Some tools spit out binary files without the CBM-typical 2-byte start address.

Is there a way to link these files with exomizer?

For example, let's say screen.bin is a 1000 byte file containing screen data (that usually belongs to $400-$7E7).

With
exomizer sfx 58235 screen.bin,$400 -o screen.exo.prg

I can generate a self-extractor where the screen.bin data is put to $400, however minus the first two bytes which exomizer interprets as start address.

There is a possibility to set an offset, so screen.bin,$400,10 would skip the first 10 (12) bytes. However, an offset of -2 does not work, since exomizer interpretes this as counting from the back of the file.

Currently I solve the problem by adding two dummy bytes to the beginning of each .bin file, but given the versatility of exomizer I wonder if there is a possibility to link bin files directly.
2021-08-06 21:30
TheRyk

Registered: Mar 2009
Posts: 2076
Problem is sfx treats every source as .PRG IIRC

One workaroud might be when misinterpreted-for-header-bytes are $77,$88:
exomizer sfx $target+2 sourcewithoutheader.bin -o output.prg -n -Di_load_addr=$decruncheraddress -f "LDA #$77 STA target+0 LDA #$88 STA target+1"

did not try if this Sledge Hammer method's working, though :)
2021-08-06 21:33
tlr

Registered: Sep 2003
Posts: 1723
From the manual:
Plain raw files are loaded by adding an address to it using the @-character.
It is also possible to specify an optional offset and optional length if only a
part of the file is to be loaded. Like addresses, the offsets and the lengths
can be given in either decimal or hexadecimal notation using either 0x or $
prefixes. The offset can also be negative and will then be applied from the end
of the file instead of from the start.

<file name>@<load address>[,[<offset>][,[<length>]]]

* To load a raw file to 0x3456, append @0x3456 to the file name.
* To load a raw file to 0x0400 and skip the 16 first bytes and read the
  following 37 bytes, append @0x400,16,37 to the file name.
* To load the first 256 bytes of a raw file to 0x0900, append @$900,,256 or
  @$900,0,256 to the file name.


cld from my cbmtools 0.8 is quite flexible with regards to these tasks if the provided options aren't enough.
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
Mr SQL
Grue/Extend
Hobbit/Laser Inc.
rexbeng
icon/The Silents, Sp..
Stone/Prosonix/Offence
Didi/Laxity
Asphodel
Guests online: 129
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 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Mikael  (9.7)
4 Lobo  (9.7)
5 Archmage  (9.7)

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