Archive

Archive for March, 2010

Testing some code display add ones for Live Writer and this blog.

March 27th, 2010 Steven Harrison No comments

First the code I’m wanting to add to a page:

#define getAt( x, y )        mapBG[ ( ( y ) << 5 ) + ( x ) ];

int main( int argc, char *argv[] )
{
    initScreen(); // Call to the screen initialisation code

    // Initialise the file system so that we can access external files.
    if( !nitroFSInit() )
    {
        iprintf( "Unable to init file system" );
        exit( 0 );
    }
    fLevels = fopen( "levels.dat", "rb" );

    initPablo(); // Set up some global variables – these are normally
        // bad, but for this little exercise they are good
    initStats(); // init the status display
    showLevel(); // Show the level

    while(1) {
        showPablo(); // Put Pablo on the screen
        showStats(); // Show the players lives, etc on the screen.
        swiWaitForVBlank();
        erasePablo(); // Erase Pablo
    }

    return 0;
}

 

Prettified Code:

#define getAt( x, y )		mapBG[ ( ( y ) << 5 ) + ( x ) ];

int main( int argc, char *argv[] )
{
	initScreen(); // Call to the screen initialisation code

	// Initialise the file system so that we can access external files.
	if( !nitroFSInit() )
	{
		iprintf( "Unable to init file system" );
		exit( 0 );
	}

	fLevels = fopen( "levels.dat", "rb" );

	initPablo(); // Set up some global variables – these are normally
		// bad, but for this little exercise they are good
	initStats(); // init the status display
	showLevel(); // Show the level

	while(1) {
		showPablo(); // Put Pablo on the screen
		showStats(); // Show the players lives, etc on the screen.
		swiWaitForVBlank();
		erasePablo(); // Erase Pablo
	}

	return 0;
}

 

Pasta as VS Code:

Code Snippet
  1. #define getAt( x, y )        mapBG[ ( ( y ) << 5 ) + ( x ) ];

 

Only have Wrap lines enabled
int main( int argc, char *argv[] )
{
    initScreen(); // Call to the screen initialisation code

    // Initialise the file system so that we can access external files.
    if( !nitroFSInit() )
    {
        iprintf( "Unable to init file system" );
        exit( 0 );
    }
    
    fLevels = fopen( "levels.dat", "rb" );

    initPablo(); // Set up some global variables – these are normally
        // bad, but for this little exercise they are good
    initStats(); // init the status display
    showLevel(); // Show the level

    while(1) {
        showPablo(); // Put Pablo on the screen
        showStats(); // Show the players lives, etc on the screen.
        swiWaitForVBlank();
        erasePablo(); // Erase Pablo
    }

    return 0;
}

Categories: Uncategorized Tags:

Interesting what you find while cleaning rooms

March 7th, 2010 Steven Harrison No comments

Well I found this interesting item while my room was emptied to get a new chimney installed

It looks like I have a problem with pink poo producing animals, but in fact it’s the heat insulating foam :)

Edit: Correcting spelling, got to love blogger tools on the iPhone :)

Categories: Uncategorized Tags: