I'm in a situation where I have a tool generating data and pointers to access this data, both of which will be included in my NES program via .incbin. The problem is that the tool doesn't know where in the ROM the data will be included, so it can't possibly generate the final pointers. How would you suggest I handle this issue? Ideally, the assembler would be able to automatically add an offset to the pointers contained in the file, but I don't think ca65 can do anything remotely similar to this.
The most sensible solution I came up with was to use a separate tool, that'd snoop the label file generated by the assembler in order to extract the base address of the data from it, and then patch the file that contains the pointers. Sounds simple enough, but a little clumsy because I'd need to assemble the ROM twice in a row in order to get the correct output: once using the wrong pointers so that all labels would be in the correct places, and again to include the patched files.
Any other ideas?
The most sensible solution I came up with was to use a separate tool, that'd snoop the label file generated by the assembler in order to extract the base address of the data from it, and then patch the file that contains the pointers. Sounds simple enough, but a little clumsy because I'd need to assemble the ROM twice in a row in order to get the correct output: once using the wrong pointers so that all labels would be in the correct places, and again to include the patched files.
Any other ideas?