Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Gabezcommodore ! (Registered 2025-07-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Taking NUFLI one step further
2024-11-10 22:46
cobbpg

Registered: Jan 2022
Posts: 53
Taking NUFLI one step further

I'm working on a new converter for creating images the C64 can display with as much freedom as possible: NUFLI Studio preview video.

The images are NUFLI with the sprite colour limitations lifted: all sprite colours outside the FLI bug area can potentially change in every row. While this is impossible in general due to CPU time limitations, the solution is to generate the speedcode that updates the registers ahead of time. The code generator can make informed decisions about dropping the least impactful register changes to fit everything into the available budget. In practice, most pictures don't require all the 10 possible colour updates on every scanline, far from it.

Another big innovation compared to Mufflon is the improvement in conversion speed. Lifting the sprite colour change limitations makes it easy to fully parallelise the brute force colour search step for each 48x2 pixel area (or 24x2 pixels over the FLI bug), and this allowed me to implement it as a compute shader. The whole process takes about 0.25 seconds on my three-year-old gaming laptop. Besides, when using the internal editor, only the affected areas are recomputed, and they can be previewed in VICE right away (note that the video shows some lag that's probably introduced by OBS somehow; it doesn't happen outside recording).

My hope is that making the feedback practically instantaneous (even when using an external image editor) opens the door for pixel artists to develop a much better intuition about this image format. Also, removing the limitation of only changing sprite colours every second row should make it a lot less frustrating to work with.

I'm not sure what to call this image format. This is 95% NUFLI, the only real difference is that the speedcode is also generated ahead of time (when run on NTSC, there's a patching step done by the displayer routine to make it work), so the files are 4096 bytes bigger (they load from $1000 instead of $2000, the rest of the structure is almost identical). I'm leaning towards "NUFLI2" to make it somewhat search engine friendly, but I'm open to ideas.

At the moment I'm in the process of writing a manual for the tool and a deep-dive article about the technical details. Hopefully neither of those will take too long!
 
... 98 posts hidden. Click here to view all posts....
 
2025-07-01 10:56
cobbpg

Registered: Jan 2022
Posts: 53
Good to hear! In this case I can add the build to the release page later this week when I’m back at my computer.
2025-07-01 16:45
Guinea_pig

Registered: Feb 2024
Posts: 5
Quote: This mode is not very game friendly. It uses a lot of memory and rastertime, plus screen organisation is extremely inconvenient. Making a game using it for gameplay would be something that even top coders would struggle with, but i’m willing to hold your beer ;)

Yeah, I can see that. I just thought the last ninja examples indicated someone was using it in bitmap mode.
2025-07-01 20:42
cobbpg

Registered: Jan 2022
Posts: 53
The only practical in-game use I can think of would be to make fancy illustrations for text adventures with this approach. E.g. you could fill the top 15 char rows with a NUFLIX picture, which would leave enough processing time to run the parser. Similarly, you could also put a nice logo above your main menu as long as you don’t want to animate it.

If enough people expressed demand for such uses, I could offer the option to make less tall images that hand the CPU back to you earlier.
2025-07-05 03:15
TSM

Registered: Jan 2007
Posts: 45
Quote: The only practical in-game use I can think of would be to make fancy illustrations for text adventures with this approach. E.g. you could fill the top 15 char rows with a NUFLIX picture, which would leave enough processing time to run the parser. Similarly, you could also put a nice logo above your main menu as long as you don’t want to animate it.

If enough people expressed demand for such uses, I could offer the option to make less tall images that hand the CPU back to you earlier.


That would be cool. And having the option for less wide images as well would be awesome.
2025-07-05 11:15
cobbpg

Registered: Jan 2022
Posts: 53
What exactly would you want to gain from less wide options? Some possible ideas:

• Freeing up some sprites, e.g. to add a bit of animation
• Being able to use non-X-expanded sprites in the main section
• Adjusting the horizontal position at runtime (at least when showing the image, not necessarily animating)

Do you have specific use cases in mind?
2025-07-06 02:16
TSM

Registered: Jan 2007
Posts: 45
Just smaller images that take less RAM. Then again, I guess I can just have black rectangles on the sides and crunch the data.
2025-07-06 12:28
cobbpg

Registered: Jan 2022
Posts: 53
Making them shorter horizontally won't really help with that, because these images have rather nonlinear memory layouts. Crunching is indeed the answer there. For the vertical size options it's possible to make their memory footprint a bit more compact depending on the specifics. For instance, if they are at most 16 character rows tall, then they can fit into a single VIC bank excluding the displayer code, but that can be located anywhere.
2025-07-07 01:34
TSM

Registered: Jan 2007
Posts: 45
I would definitely use pictures shorter than 16 characters vertically.
2025-07-07 19:52
S.E.S.

Registered: Apr 2010
Posts: 20
Quote: The only practical in-game use I can think of would be to make fancy illustrations for text adventures with this approach. E.g. you could fill the top 15 char rows with a NUFLIX picture, which would leave enough processing time to run the parser. Similarly, you could also put a nice logo above your main menu as long as you don’t want to animate it.

If enough people expressed demand for such uses, I could offer the option to make less tall images that hand the CPU back to you earlier.


If you display a NUFLI picture and want to cut it off earlier, you can set up a NMI IRQ for the right amount of cycles (63 * number of NUFLI lines you want to see), and then in the NMI IRQ handler switch off the ongoing NUFLI display by switching into an illegal gfx mode and moving the sprites behind the side border. :-)
2025-07-08 13:36
cobbpg

Registered: Jan 2022
Posts: 53
Quoting S.E.S.
If you display a NUFLI picture and want to cut it off earlier, you can set up a NMI IRQ for the right amount of cycles (63 * number of NUFLI lines you want to see), and then in the NMI IRQ handler switch off the ongoing NUFLI display by switching into an illegal gfx mode and moving the sprites behind the side border. :-)

It seems easier to me to just patch the speedcode to do that for you. ;) In any case, if I added this feature to NUFLIX Studio, I'd definitely make it so that the memory footprint is also minimised by reusing freed up bitmap regions for the sprite layer whenever possible.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
bugjam
Jazzcat/Onslaught
Krill/Plush
Knobby/Role
tlr
GI-Joe/MYD!
bodo^rab
REBEL 1/HF
Exile/Anubis
Guests online: 52
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Harminc  (9.7)
4 Codeboys & Endians  (9.7)
5 Mojo  (9.7)
6 Coma Light 13  (9.6)
7 Edge of Disgrace  (9.6)
8 Comaland 100%  (9.6)
9 Wonderland XIV  (9.6)
10 Signal Carnival  (9.6)
Top onefile Demos
1 Morphing Starball  (9.9)
2 Nine  (9.8)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.5)
7 Scan and Spin  (9.5)
8 Onscreen 5k  (9.5)
9 Dawnfall V1.1  (9.5)
10 Grey  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Oxyron  (9.3)
5 Artline Designs  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Shine  (9.5)
4 Mermaid  (9.5)
5 Pal  (9.4)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.049 sec.