Caramelldansen

From ProjectWiki
Revision as of 19:25, 5 April 2009 by Wikisysop (Talk | contribs)
Jump to: navigation, search

Caramell Dansen Instant Movie Create... for NDS!!!

Contents

What is this?

Main menu...

After making the nyanroll and rickroll video players, wanted to make one more based on the Caramell Dansen series of videos. The result is Caramell Dansen Instance Movie Create, which adds a sorta GUI to the previous players and facilitates recording, storing all the real time effects, scene changes, and other datas. In this way it is possible to create sort of 'movies' :D

Features:

  • Playback animation loops of various framerates up to 20 frames in duration
  • Special effects such as panning, scaling, rotation, fade to white/black,
  • adjustable framerates full stop to 60fps
  • GUI using the touchscreen, ooo ahh :p
  • Up to 3 backgrounds are used on engine A (the purpose of this was partly to test background management system)

Where to get it?

Would like to add more dansen loops, make the GUI a bit less clunky, but since its not an extremely serious project this may take some time. here is what's working so far:

Technical Details

Playback go go go... ^^
also note 3 background layers

There are a few ways to do event recording, on thds i simply recorded the keypad inputs every frame for instance, but on this one wanted something a bit different. Firstly since it can be played on cards with different loading times and loading of the animation frames may take > one or more vblank intervals, simply recording keypress alone wouldn't stay in sync with the music reliably. Instead here decided to store all events like so:

//Event enumeration
enum {
	ENVT_RESET,
	ENVT_ROT,
	ENVT_ZOOM,
	ENVT_SX,
	ENVT_SY,
	ENVT_XC,
	ENVT_YC,
	ENVT_FADE,
	ENVT_FADEINC,
	ENVT_CHANGE,
	ENVT_FRATE,
	ENVT_FADV
};
 
typedef struct _envt_t {
	int	time;	//in ms how far past start of song for this event
	u32	value;	//
	u16	type;	//event type
} envt_t;

Each event type possible is enumerated, and stored as 'type' along with a 'value' if necessary along with the 'time' in ms from the start of the mp3. The mp3 library can report the offset in ms so this works well. During playback the event's time is compared to the current mp3 time position and it does all events up till the current mp3 time. In this way even if vblanks are missed it will still stay exactly in sync with the mp3... ^_^

while(mp3time>envlist[envcnt].time) {
... //do all the different events
}

For the video loops had to do a bit differently from before. It stores up to 20 frames in RAM, when the animation sequence changes, it starts loading frames immediately as well as setting the current playback position to 0. It then attempts to load a frame per vblank until the entire sequence is in ram. The videoUpdate function, will only play up to the max number of loaded frames sooooo, the result is a best effort animation loop loader.

More on all of this later, sleeps now...

Personal tools
irssi scripts
eggdrop scripts