Archive

Author Archive

Hiatus over, I hope

July 15th, 2010 Steven Harrison No comments

Well I’ve been given a 4 week sick note from the Docs due to depression. I’ve been off for a week now and so far I’ve done as little I can otherwise I’ll end up going mental. But I am starting to work on my projects again, and hopefully will have an update soon.

- Posted using BlogPress from my iPhone

Categories: Uncategorized Tags:

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:

Start writing a doc and it becomes obsolete before you start

February 27th, 2010 Steven Harrison No comments

As I stated in my last blog I was going to document the changes I’ve done to the Homebrew menu so that I can keep it up to date with the changes in the devkitARM tool chain. Well just as I was about to start the process, including how to download it WinterMute goes and releases a new version of the tool chain – time to run the updater…

I’ve not checked all my projects (there’s only 1 that I want to keep up to date at the moment) but I did notice something in the patch notes:

  • implement soft reset hooks, applications will now exit to menu if support is provided as per hbmenu

Not sure exactly what this means, but I’m going to have a look though the homebrew menu code and see if I can find what this actually means, and how it’s implemented.

Categories: Uncategorized Tags:

iPhone upgrade, DSi hacking and compiling the Homebrew Menu my way

February 21st, 2010 Steven Harrison No comments

I should explain that title a little before continuing I’ve just had my times at work changed so that I’m now free on weekends so I’ve got 2 straight days now to get back into the hacking business and trying to document everything I’ve worked on in the past is my first goal.  The other goal is to hack around with the code from the HomebrewMenu (it’s a project on the svn server for devkitPro) to make it a little more interesting than the current bland list of text.

iPhone upgrade

I’ve just upgraded my old Nokia 6500 slide to a nice and shiny iPhone 3gs (expecting apple to release v4 of the iphone hardware within the next couple of months now).  It’s a nice phone (I’ve not used it to make calls yet) and the apps look good (why did I purchase Space Miner: Space Ore Bust????) but I can’t code for it as I’ve not got a Mac, and with my views on piracy being what they are I’m now saving up for a Mac mini (I don’t need a monitor, I’ve got 2 on my desk right now). I might start hacking stuff for the Mac at some point.

DSi Hacking projects

Well since the DSi came out last year (it’s nearly 1 year old in the UK), I’ve been involved in a couple of projects to attempt to break the DSi open for home brewer’s to use so that we don’t need to use one of those slot-1 carts (like the R4i, AceKard 2i, or EzFlash Vi).  The main focus I had was the FlipNote application as it can load and save to the SD card slot.  Unfortunately I got some docs and test code wrote but nothing came from the little hacking I did due to the limited knowledge I have on the actual hardware implementation of the encryption routines that the DSi has. I have since learnt a little and one thing that stopped me was the last 144 bytes of the file looking like a load of garbage, in fact it was a 128 byte signature for the file, think of it as a 1024 bit CRC check, except it seems to be using some form of AES to generate it. I’m still going to try and break it, but I need to learn how AES works in this situation, which is a long project I think.

Other DSi hacking that I’ve been attempting to do is to use WinterMute’s cooking coach hack to put an image on the top screen of the DS.  All goes well as long as I do not attempt to put the code on an actual cooking coach cart, when I do that I get a blank screen, I’ve got no idea what the hells going on there.  I’ve spoken to WinterMute about it to see if he can spot the problem, but he’s a little busy attempting to find some random bugs in the next release of devkitARM (r28).

Homebrew Menu

Well I’m using an old version of the homebrew menu that is on the svn servers for devkitPro, and I’ve modified it to use my font library instead of the default console.  All well and good until a few people on the devkitPro forums started experiencing some issues with the latest download from the server.  So I’ve setup a new local copy of the project and I’m going to get this working using the minimum of changes as I have a feeling that WinterMute is doing something with it (last update was 13 hours ago according to the server logs). This should also be a good time to learn the correct use of SVN for my own projects (including my failed EMS application).  I’ll document any changes I make so that it should not hinder me if/when it’s updated again.

Hopes for the future

I’m still hoping that Nintendo will allow us home brewers to create some form of application launcher for the DSi that is controlled by WinterMute to stop the pirates of the world working out a way to boot commercial rom images.

Categories: Uncategorized Tags:

3 weeks at work

January 31st, 2010 Steven Harrison No comments

Well it’s been an interesting time at work, lots to learn and lots more to learn after the training is over.  Taking calls to support the Post Office home phone and broadband products is interesting and sometimes hard.  On one hand I want to help the customers, on the other hand I can’t help due to access restrictions (I’m still waiting for some system username and passwords) or because there’s nothing I can do in this case.  Some calls are fun to take mind you.

The reason for this post is to start to document something I’ve been working on for a while – the unified console – and while it’s not taking the same shape as I originally wanted it to, it’s starting to work the way it should.  I’ve currently got the Unicode working in it (using UTF-8 for the Unicode glyphs) and it’s working in the 16 colour tile mode at the moment.  I’ve started to code up a proper image to font format utility, but getting my head around FreeImage is not happening as fast as I would like due to my working hours, and lack of material to read on the PC at work (no internet access).  I’ll post a couple of screen shots later on as well as some docs on how it should work in a homebrew application.

I’ve not forgot about the Pablo series of articles, it’s just I’ve had other things on my mind lately and Pablo got dropped a couple of places in my to do list.

Categories: Uncategorized Tags:

First day at my new job

January 11th, 2010 Steven Harrison No comments

And I’m knackered…

Training for a new job is tiring, taking in all the information about the products that I will be supporting (it’s a help desk role I’m in).  I’m looking forward to the next few days since I will be trained in the art of being a Post Office representative – and as one American said in #dsdev “Don’t go postal on us now” :D

Categories: Uncategorized Tags:

2010 – The year we make contact

January 4th, 2010 Steven Harrison No comments

Well it’s here, it’s the year we make contact, according to Arthur C. Clarke.  So far all I’ve made contact with is the ceiling with a paint brush…

I’m still unemployed and looking for work is starting to get me down, I mean how many times can you search for work to find no jobs that you can do before you want to kill yourself?  I’m not quite there yet, but not far from it.

On a brighter note I did some work on a new console system for the DS, but instead of using the ByteMap Font files that I used in the graphical console, I started from scratch and created my own font file format that supports Unicode fonts, and got a basic version working using the 16 colour tile mode, I’ve got a couple of tests to write but it’s working as long as you are aware of the limitations of the tile mode.

My main New Years resolution this year is to attempt to keep this blog updated more often than I have in the past – hopefully it will work this time…

Categories: Uncategorized Tags:

Cough, Cough, is this thing on?

September 29th, 2009 Steven Harrison No comments

It’s been a while since my last post on here, and I’ve not done a lot of coding since the last post, in fact I’ve not done much coding for a while.  I have been asked by WinterMute and dovoto to assist them in a little project for the homebrew community, but I can’t really say too much about this yet.  Lets just say I’m learning new things about word press that I never wanted to know but it’s giving me some idea’s about this little blog of mine, which initially was only a temporary solution until I got off my ass and coded a site of my own.

Yesterday I was clearing out some old rubbish and found a couple of old Your Sinclair magazines from 1992/93, in these magazines was a small type in game called Pathetic Pablo Bros – it was mainly to show people how to code on the Spectrum 48K/128K but the game was a very simple platform game, that would run with a little modification (from basic to C) on the DS.  I started to write up a document on what I was doing each step of the way, so that I could possibly do a write up / mini tutorial for other people, that little document ended up being the tutorial, and I’ve split it into 3 parts, one part for each of the parts from the magazine series, and I might write a follow up detailing the translation from a ZX Spectrum game to a full fledged DS game with enemies (possibly, I don’t know YET), scrolling levels, and using sprites instead of the tile engine for the graphics.  Anyway look out for a new Tutorials page appearing soon-ish.

Categories: Uncategorized Tags:

FLICing more into my FLI player

July 5th, 2009 Steven Harrison No comments

Well the current state of my FLI/FLC player is that I managed to get some optimisations into the decoding code and managed to get the test 320×200 FLI video to play at around the same speed as QuickTime, ok next challenge was a 160×120 FLC file. Now the problem with FLC files is that they can have any size, unlike FLI files that are fixed 320×200 images, this should be fine as long as the image is smaller than the largest background size that the DS can handle.  After reading the file format correctly for an FLI file the FLC file should be no problem – I was slightly wrong.

The first major issue (and the biggest improvement) is that the compressed frames are word aligned, not byte aligned, this led to the decoding code improving in speed on the 8-bit screen mode (I’m not reading the screen into a temp variable, updating it and then putting it back onto the screen) and making my code for the FLI (I’ll just copy and paste I thought) not work at all as the start of each encoded line can have a few opcodes, each opcode has to be read and parsed, there’s no way to just skip them (although one of the opcodes I did skip as I do not think anyone would use an odd sized width file).  After getting the code to work (multiple itterations wondering why I’m only updating 75% of the 3rd line of my test video (this was the first line that used a specific encoding sequence) and ripping some of my hair out I finally got it to play perfectly.  I added some code to the FLI decoder to tell my approximately how many vblanks were being used to render 1 frame of the video, to my surprise the 320×200 video was running @ about 3 vblanks per frame (or approx 20 fps) – which is about the correct FPS for that video.  The FLC I had was running closer to 1.25 vblanks per frame (approximately 48 fps).  The video should be running a lot slower than that, I think it should be running at 30 fps – so the code I’m using on a 160×120 video is fine (and in each frame I think nearly every line was changing in some major way).  Now onto the real challenge, a 256×192 image.  Even though I was scaling the background to fit the full video onto the DS’s screen, I should check the code on a 256×192 video that would be what most people that use this code would be using.  Hunting around for a free application to save FLC files was not easy – most were for windows, and when I did find one that I could get the source for it’s input file format was PPM (a very old and dead file format), failing to find anything better I looked for something to convert to PPM files – The GIMP came to mind as it’s for Linux, Windows, etc.  Checking the file save dialog I spotted a little godsend – FLIC (fli/flc) – GIMP knows how to deal with FLIC files :) .  With this in mind I generated a short animation in Blender, and created my 256×192 FLC file within seconds (actually more like 5 minutes after having to re-arrange the files) and expectedly opened the file in my test nds file.  Yeah I have an image… Crash….

After some investigation it turns out that GIMP’s FLC encoding is good, but not the best as it saves filler byte at the end of a frame chunk to make every frame start on an even byte.  A quick change to my code and I have a fully running FLC player for any files generated by GIMP.  Next step in this project – adding audio via the EGA_WAVE chunk that was added by the EGA application.

No demo this time as I’m going to play around with another of the projects I’ve got going at the moment.  I’ll try and get something working that’s better than my current version and post a demo soon.

Categories: Uncategorized Tags: