Closed mpdunlop closed 1 year ago
Good catch! You're pretty close with this fix.
The one problem is that memory clearing was removed intentionally - this is done in main.asm
(main.template.asm) so we don't need that bit. The calls to neslib were definitely wiped out in error however, so we'll want those back.
Thanks for the clarification and pointing me in the right direction. After locating the memory initialization code in main.template.asm and system-runtime.template.asm I could identify what needed to be removed and have updated accordingly.
Looks great, thanks for doing this! I'll try to publish a new version with this and the other change discussed in #4 later today, or tomorrow worst case.
create-nes-game's initialize_library function appears to be based on clearRAM crt0.s in neslib but is missing some initialisation code which sets a pointer to colours which is required for pal_bg() to work. This pull request attempts to restore this functionality.
A diff between crt0.s and a generated neslib-system.asm:
One thing I'm unsure of is if this change was intentional or not - a method named
clearRAM
has a more specific meaning thatinitialize_library
and it's quite possible I'm missing some of the details behind this decision.