doomhack / GBADoom

A port of prBoom to the Nintendo GBA.
214 stars 27 forks source link

Screen melt ? #19

Closed sttng closed 2 years ago

sttng commented 3 years ago

Just out of interest. Any reason the screen melt effect wasn't implemented ?

doomhack commented 3 years ago

Hi,

TLDR; Memory!

The screen melt needs an extra memory buffer to store the previous frame. (Around another 15kb or so)

This got removed becuase there isn't enough memory for this on the bigger maps.

If anyone wants to have a go, you might be able to just use the backbuffer and then modify the frontbuffer to do the effect but it will look goofy!

sttng commented 3 years ago

Ok makes sense. Maybe just implement a screenmelt with black background ? The screenmelt seems so iconic to Doom imho.

Kippykip commented 3 years ago

Ok makes sense. Maybe just implement a screenmelt with black background ? The screenmelt seems so iconic to Doom imho. Yeah I believe memory was also why the melt wasn't implemented in most console ports at the time.

doomhack commented 3 years ago

Melt from black will also need an extra 15kb buffer as we still need to store the rendered frame somewhere.

You could probably do something like:

1) Render first frame (we are melting to) into back buffer. (Basically render as normal) 2) Front buffer contains last frame as usual, (Menu, intermission, whatever) 3) Then do the melt by copying columns down in-place in the front buffer and filling from the backbuffer in a loop. We don't do a page-flip while melting.

This needs no extra buffers (I may have a go at this at some point) but will look a bit crappy as we will be manipulating the frontbuffer while it is displayed so it might look a bit crappy as we won't have enough time to do a frame of melt in the VBlank time. It's slow because we have to manipulate columns so DMA can't help us. :-(

doomhack commented 3 years ago

I've not had a great deal of time to work on this project lately. The last few sessions I've had on it I feel like i've run into the wall with it. The performance optimisations i've tried have been a bust and I can't see much more memory savings to find. (I really wanted to get Plutonia and TNT working fully, theres about 3 levels that won't load) I'm sure someone smarter than me could do better but it's about as fast and small as I can make it without susbstantially changing the game.

doomhack commented 2 years ago

It turns out the guys at https://github.com/next-hack/nRF52840Doom did the in-place screen melt.

I though it would look bad as we're modifying the front buffer while its being displayed but no. It looks great!