gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Making an intromovie

#37403 - donpeppoe - Fri Mar 11, 2005 1:00 pm

Hey,

I'm trying to make an intromovie. Its a backgroundimage with dimensions of 240x1760 (10 frames * 176 (After Dffects add 16 rows to a filmstrip, i compensate that)). And I shift 21120 bytes every frame.
This all works fine if I have a 5 frame movie, but when I use a 10 frame movie, it messes up the last few frames.

It seems like a memory issue. I don't really understand all the memoryfeatures of the GBA.

Any idea's? Thanks in advanced!

This is the code i use

Code:
for (t = 0; t < 10; t++ )
{
    DMA_Copy( 3, (void*)&movieData[t * 21120], (void*)FrontBuffer, 19200, DMA_16NOW );
    Sleep(20);
    WaitForVsync();
    Flip();
}


21120 = 240 * (160 + 16) / 2

#37420 - tepples - Fri Mar 11, 2005 4:30 pm

Perhaps your conversion tool isn't able to translate images larger than 1024 pixels tall.

And what happens when you do a 'nm foo.elf' and look for the line containing the image?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#37429 - Miked0801 - Fri Mar 11, 2005 5:29 pm

Are you doing something silly like loading the entire image into EWRAM before playing with it? That would fit the description of it failing at around the 9th frame or so depending on what other stuff is loaded into slow ram.

EWRAM = 256K total

#37486 - Lord Graga - Sat Mar 12, 2005 12:07 am

since it's been played so slow then you could just FXE or LZ77 compress every frame and then unpack them to the backbuffer realtime.

#37501 - tepples - Sat Mar 12, 2005 6:03 am

I'm not sure that LZ77, FXE, Pucrunch, LZO, or any other general-purpose lossless codecs would be useful for video. Proper video compression involves frame differencing, motion estimation, and some sort of transform coding (DCT or wavelet).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#37649 - Miked0801 - Mon Mar 14, 2005 6:50 pm

Proper video does, you are correct - but even just using silly compression per frame allows some compression. Per pixel difference per frame of course helps as well (or vectoring and all that other fun MPEG stuff)

#37652 - Kyoufu Kawa - Mon Mar 14, 2005 7:22 pm

Heck, maybe I should put some kind of difference thingy in my animation system...

#37681 - Miked0801 - Tue Mar 15, 2005 1:22 am

Do you have the extra CPU power to afford this change? When playing a movie, you are giving the CPU everything available to render the movie. In an animation system, you aren't given nearly as much time.