Caramelldansen

From ProjectWiki
(Difference between revisions)
Jump to: navigation, search
(Technical Details)
(Technical Details)
Line 53: Line 53:
 
while(mp3time>envlist[envcnt].time) {
 
while(mp3time>envlist[envcnt].time) {
 
... //do all the different events
 
... //do all the different events
 +
    envcnt++; //move on to the next event....
 
}
 
}
 
</source>
 
</source>

Revision as of 20:10, 5 April 2009

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,
  • Mp3 soundtrack
  • cute and colorful appearance (could be better however >_>)
  • Records user inputs and replays in exact timing as performed orignally
  • adjustable framerates full stop to 60fps
  • GUI using the touchscreen, ooo ahh :p
  • Power Management so closing the lid saves battery..
  • 12 point japanese font renderer with SJIS input rendered in mode5
  • Up to 3 backgrounds are used on engine A (the purpose of this was partly to test background management system)

The animation loop data were taking from various .flv animations on the youtube.. Really a shame since its loading them as bitmaps and yet they still end up with numerous artifacts from the .flv format. But i cannot draw well and meh it works. u_u

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
    envcnt++; //move on to the next event....
}

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.

Some notes: ø(._. )
Had to modify the font renderer just a bit to be compatible with C and not C++ styles. Would be nice to create a device driver within the devopt table so that stdio may be usd rather than font specific calls.

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

Personal tools
irssi scripts
eggdrop scripts