Thanks. I manage to remove the condes.o from nes.lib and the references of initlib on crt0.o, also removed features on nes.cfg. Although, the compiled ROM, seems to bring the same error and basic structure.rainwarrior wrote: ↑Mon Dec 07, 2020 4:30 pmIf condes.o is getting linked it means there's a reference to initlib or donelib in your crt0.o. You could remove it from the library archive with ar65 but you wouldn't be able to explicitly unlink it. You have to rebuild crt0 without the reference to those two functions. Once that's done it won't matter if condes.o remains in the library, as it won't get linked without any references.
The FEATURES / CONDES stuff is useless for NES. It adds an ability for linked modules to have a startup/shutdown routine at program start and exit. The shutdown part doesn't really make sense on any platform where you don't return to an operating system on exit. The startup part might be useful, but AFAIK as a feature it's only used for an IRQ implementation on a few systems. I recommend getting rid of this feature from your library.
FWIW I don't really like any of the platform libraries that come with cc65. My approach is generally to take everything in libsrc/runtime and libsrc/common, and write my own crt0 that's part of my program rather than a library. That's enough to get all the basic stuff going. If you want to use some library functions like printf, etc. you might need to write some of the dependent routines, but if you're going to be making a game you probably don't need any of it. All ctr0.s really needs to do is handle a reset, jsr copydata, set up the C stack pointer, and jmp _main. (Example: dgolf.s)
Aboute the example, still studying it. Not sure how to make it useful yet. But really thanks for the help!