Closed mpdunlop closed 1 year ago
Hey there!
This looks like a quirk of neslib. There's an internal brightness tracker it has, and it seems like nothing initializes it for us. It's also possible create-nes-game isn't doing a setup step that neslib expects, though I can't find anything.
In short, you'll need to set the brightness to default somewhere before turning on the ppu. Do that with pal_bright(4)
. documentation for what that does - You can also use this in a loop to animate the screen fading in and out, for a nice transition.
I hope that helps, and sorry it's not super clear! Please let me know if you need more help.
ps: For the future, your example is just using create-nes-game. nes-starter-kit is a (very) short functioning game in C that can be customized. The name isn't great, I know.
Thank you so much for looking into this for me, especially when it’s outside the domain of your project. Much appreciated!
Glad to help! create-nes-game is also my project, so feel free to reach out if you hit more trouble
Apologies - I'm not sure if this is an issue with my code, nes-starter-kit or with create-nes-game.
After creating the default template game using the create-nes-game command I'm attempting to change the background palette using neslib's
pal_bg(*char)
. Once I callppu_on_all();
the palette is updated but to incorrect colours. Setting the palette data in vram memory manually using vram_put() works so I'm not sure what I'm doing wrong.The sample code using vram_put():
My alteration using pal_bg():
I've uploaded a repro to https://github.com/Dunnymeister/pal_bg_repro
I have tested using create-nes-game 1.0.10 and also after updating to 1.0.11.