I'm working on disassembling Final Fantasy so that it can be reassembled using cc65 (I would have gone with x816, but it seems to use some kind of special RAM or something that I lack o_O). Anyway... I have it all disassembled and ready to be rebuilt... but cc65 insist on being a pain in the ass, and give me completely rediculous errors.
First of all... I should say that I'm trying to <b>avoid</i> 1 massive asm file. I've split it into seperate banks (8k each... I know FF1 uses 16k banks normally, but I'm doing this for hacking purposes and I plan on changing the mapper to one that uses 8k banks). I'm looking for a way to assemble these so that code in one bank can jump to a label that exists in another bank. So far the only way I've found to do this is to make 1 asm file (which I call "main.asm") and have it consist of nothing but several .include lines, including each bank's asm file... then run main.asm through ca65... now this both works... and it doesn't...
I must have been including too many files or something (there's 31 in total)... because whichever file I included last, seemed to be ignored completely (although no error was given to reflect this, other than the fact that labels in that file weren't being found).
After struggling with that for a while, I decided to trim down the number of .includes by removing some of the banks which were data only. That shorted it to 11 .includes in the main.asm file.. but I'm still getting the same problem. It's saying that my labels are undefined, when they're defined just a few lines under the line that the error is reported from. What's even stranger... when I re-arrange the order that the banks are .included, the errors change. Some labels that weren't recognized before are being recognized, and labels that were recognized are lost.
Anyway... is there a better way to do this than a big .include list? Does anyone have any experience in assembling multiple asm files? If you could lend me a hand with ca65 and/or point me in the direction of an assembler that isn't completely stupid, I'd be most greatful ^^. This has really been frustrating the hell out of me.