Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Paul Jensen on February 01, 2011, 02:09:50 am

Title: Can Atlas insert binary data from an external file?
Post by: Paul Jensen on February 01, 2011, 02:09:50 am
Is there any way to get Atlas to insert binary data from an external file into a ROM? As far as I can understand from reading the docs, this isn't possible.

My Rent A Hero translation project involves changing some graphics. Right now I'm doing it all manually. I created a copy of the original ROM with 4k of extra space at the end. If I update the graphics, I insert the modified graphics into that space using Windhex.

What I want to do is set up my Atlas script file to automatically insert the modified graphics (in the form of binary files) at the end of the ROM, and then insert the script after that data.

So anyway, is there a command in, or an extension for Atlas that would do something to the effect of #WRITEBINDATA($Offset, filepath), and then update pointers accordingly?
Title: Re: Can Atlas insert binary data from an external file?
Post by: Ryusui on February 01, 2011, 02:14:36 am
No, but if there's a cross-assembler for Genesis, you could automate the entire process in one batch file.
Title: Re: Can Atlas insert binary data from an external file?
Post by: Pennywise on February 01, 2011, 01:14:19 pm
Not sure if it helps, but a quick and easy way to insert graphics is to have a BMP of the graphics and use a tile editor to import it into the ROM.

Otherwise, based on what you said it doesn't seem like it would be much trouble to just code a simple program to do all the work for you.
Title: Re: Can Atlas insert binary data from an external file?
Post by: abw on February 01, 2011, 08:41:54 pm
This is also not exactly what you want, but writing a fake pointer to some location you don't care about (or to some location you do care about, with judicious use of the HDR command) seems to be one way to get Atlas to insert arbitrary data. You might be able to refine something like this into a useful script:

#JMP(<graphics start location>)
#W16(<some place you don't care about>)
<graphics binary in Atlas notation (*)>

// Atlas will quite merrily chug along from here, knowing that its last insertion point was at the end of your graphics data
<your normal text insertion script>


(*) Unfortunately, you'll need to dump your graphics data as text; since you're using WindHex, a table filled with entries like
00=<$00>
01=<$01>
etc. should do the trick.
Title: Re: Can Atlas insert binary data from an external file?
Post by: RedComet on February 01, 2011, 09:21:40 pm
I can send you an incomplete build of SEKAS that should do what you need, if you want. I still need to add macro support and a few other things before I'm gonna release it, but it's more than capable of inserting raw binary data for you. I used it for Bare Knuckle 3 (and some other projects...) and it's worked perfectly. It's a modified version of xkas that supports the 68k.