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


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

Registered: Jan 2019
Posts: 35
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: 1049
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: 1480
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
Knight Rider/Excess
Malmix/Fatzone
The Syndrom/TIA/Pret..
curtcool
HOL2001/ExCeSs
tlr
Freddie
Scrapper
Erol
cba
Trap/Bonzai
Guests online: 71
Top Demos
1 Edge of Disgrace  (9.6)
2 Coma Light 13  (9.6)
3 Bromance  (9.6)
4 Uncensored  (9.6)
5 Memento Mori  (9.5)
6 Comaland 100%  (9.5)
7 Lunatico  (9.5)
8 Unboxed  (9.5)
9 Wonderland XII  (9.5)
10 Christmas Megademo  (9.5)
Top onefile Demos
1 Copper Booze  (9.7)
2 Daah, Those Acid Pil..  (9.5)
3 Dawnfall V1.1  (9.5)
4 Cityscape 2730  (9.5)
5 To Norah  (9.5)
6 Elite Code Mechanics  (9.4)
7 Lovecats  (9.4)
8 Barry Boomer - Trapp..  (9.4)
9 For Your Sprites Only  (9.4)
10 Quadrants  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Oxyron  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Triad  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Crossbow  (9.8)
4 HCL  (9.7)
5 Lft  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2021
Page generated in: 0.045 sec.