michel_iwaniec
New member
Lately I've worked on a little conversion utility + NES library that I think NESMakers might find useful.
github.com/michel-iwaniec/CrunchyNES
github.com/michel-iwaniec/CrunchyNES/releases/download/v1.1/CrunchyNES-v1.1-win64.zip
CrunchyNES basically aims to make it a lot easier to display title screens / cutscenes with full-screen artwork that use "intermediate-level-tricks" in your Mapper30 NES game.
Namely, the aforementioned intermediate-level-tricks are:
Future things I'm likely to add, in semi-priority order (shout if you actually care / disagree on the priorities)
CrunchyBuild is a command-line tool. It takes a list of indexed color images and builds a dedicated bank with these images converted and compressed. This bank also includes the CrunchyLib NES code.
CrunchyLib is the actual NES code library that contains subroutines for loading the picture / updating sprites, and an NMI handler function to perform the timed scrolling updates.
CrunchyNES isn't NESMaker-specific... but I have made a patch for NESMaker that integrates it in a as-simple-as-I-could way, using a post-screen-loading subroutine. I've attached this integration to this thread (details to follow).
It repurposes the top overworld screen bank (16x2 = 32 screens) to load the CrunchyNES compressed pictures instead of the normal NESMaker level screens.
The sprite overlays will be scrolled along with the picture using the scrolling coordinates in CrunchyLib, without having to manage them as separate NESMaker objects.
Animation is not supported directly by CrunchyNES at the moment. But you can still use NESMaker objects on top of the CrunchyNES sprite overlay pictures to add some animation, if you wish to have some Ninja Gaiden-style animated cutscenes.
But keep in mind that CrunchyNES uses 8x16 sprites by default, so you'll need to switch to running CrunchyBuild with 8x8 sprite generation for your NESMaker objects to look correctly... or figure out how to use 8x16 sprites in NESMaker if you're brave.
You can also use NESMaker textboxes on top of CrunchyNES. At the moment this requires the textbox area to have blank tiles, as the CrunchyNES NESMaker integration currently can't restore the original picture the textbox drew on top of.
If you do this, you also want to set the "--max_bg_slots" parameter of CrunchyBuild to 208 to leave some room for the NESMaker text characters at the end of the BG pattern table. You can use this mixing of CrunchyNES pictures with regular NESMaker text together with the mid-frame CHR-bank-switching, which still gives you up to 512 - 2*48 = 416 background tiles for your picture.
To get started with CrunchyNES, I would first recommend trying CrunchyNES on its own outside of NESMaker, as this will make it easier to test the conversion process and debug any potential issues.
CrunchyNES comes with a stand-alone NES-viewer CrunchyView which allows you to switch between a number of images, setting the split-screen parameters, and scrolling the picture - using just the joypad to drive this.
Have a read through the user guide to understand how CrunchyNES works and what parameters are supported, and try running CrunchyView in Mesen and use the "PPU viewer" to see how your pictures use the character memory / sprites. That should give you a feel for how you can either pimp or simplify your full-screen artwork before putting it into your game.
CrunchyView might also be a useful stand-alone-tool if you have a need to just quickly check how your background-with-sprite-overlays picture looks on a CRT while being either still or scrolling, before you spend time trying to to put it into your NESMaker game. Just build a few images with CrunchyBuild and put them onto your flash cart... and enjoy the slideshow
github.com/michel-iwaniec/CrunchyNES
github.com/michel-iwaniec/CrunchyNES/releases/download/v1.1/CrunchyNES-v1.1-win64.zip
CrunchyNES basically aims to make it a lot easier to display title screens / cutscenes with full-screen artwork that use "intermediate-level-tricks" in your Mapper30 NES game.
Namely, the aforementioned intermediate-level-tricks are:
- Sprite overlays in either 8x8 or 8x16 mode - for more colorful full-screen pictures
- Up to 512 8x8 background tiles using mid-frame CHR bank-switching - for bigger / less repetitive pixel art
- Easily controlled scrolling and split-screen - for those big enemies or parallax horizons
- Codemasters / Tokumaru tile compression - so those extra background tiles come for free*
Future things I'm likely to add, in semi-priority order (shout if you actually care / disagree on the priorities)
- Multiple banks (CHR / nametable decompression reading bytes from other banks should be trivial to add)
- Make CrunchyBuild conversion settings be per-picture instead of global for more flexibility
- DPCM IRQs to avoid wasting lots of frame time for mid-frame CHR bankswitching / split screen effects
- DPCM-sample playback raster timing compensation (though you can't use it at the same time as DPCM IRQs obviously)
- Scrolling Pictures spanning multiple nametables (512x240, and maybe even 256x480)
- PAL support (currently mid-frame CHR bank-switching / split screen is NTSC-only)
- Palette fades
- OAM write optimisations
- Less noticeable sprite#0 pixel generation
- Top/bottom borders. And maybe a vertical "clamp" mode to bypass the wrap-around effect with vertical mirroring.
CrunchyBuild is a command-line tool. It takes a list of indexed color images and builds a dedicated bank with these images converted and compressed. This bank also includes the CrunchyLib NES code.
CrunchyLib is the actual NES code library that contains subroutines for loading the picture / updating sprites, and an NMI handler function to perform the timed scrolling updates.
CrunchyNES isn't NESMaker-specific... but I have made a patch for NESMaker that integrates it in a as-simple-as-I-could way, using a post-screen-loading subroutine. I've attached this integration to this thread (details to follow).
It repurposes the top overworld screen bank (16x2 = 32 screens) to load the CrunchyNES compressed pictures instead of the normal NESMaker level screens.
The sprite overlays will be scrolled along with the picture using the scrolling coordinates in CrunchyLib, without having to manage them as separate NESMaker objects.
Animation is not supported directly by CrunchyNES at the moment. But you can still use NESMaker objects on top of the CrunchyNES sprite overlay pictures to add some animation, if you wish to have some Ninja Gaiden-style animated cutscenes.
But keep in mind that CrunchyNES uses 8x16 sprites by default, so you'll need to switch to running CrunchyBuild with 8x8 sprite generation for your NESMaker objects to look correctly... or figure out how to use 8x16 sprites in NESMaker if you're brave.
You can also use NESMaker textboxes on top of CrunchyNES. At the moment this requires the textbox area to have blank tiles, as the CrunchyNES NESMaker integration currently can't restore the original picture the textbox drew on top of.
If you do this, you also want to set the "--max_bg_slots" parameter of CrunchyBuild to 208 to leave some room for the NESMaker text characters at the end of the BG pattern table. You can use this mixing of CrunchyNES pictures with regular NESMaker text together with the mid-frame CHR-bank-switching, which still gives you up to 512 - 2*48 = 416 background tiles for your picture.
To get started with CrunchyNES, I would first recommend trying CrunchyNES on its own outside of NESMaker, as this will make it easier to test the conversion process and debug any potential issues.
CrunchyNES comes with a stand-alone NES-viewer CrunchyView which allows you to switch between a number of images, setting the split-screen parameters, and scrolling the picture - using just the joypad to drive this.
Have a read through the user guide to understand how CrunchyNES works and what parameters are supported, and try running CrunchyView in Mesen and use the "PPU viewer" to see how your pictures use the character memory / sprites. That should give you a feel for how you can either pimp or simplify your full-screen artwork before putting it into your game.
CrunchyView might also be a useful stand-alone-tool if you have a need to just quickly check how your background-with-sprite-overlays picture looks on a CRT while being either still or scrolling, before you spend time trying to to put it into your NESMaker game. Just build a few images with CrunchyBuild and put them onto your flash cart... and enjoy the slideshow