Page 1 of 1

running code on dsi

Posted: Sun Jul 04, 2010 12:38 pm
by cyberant
I started getting intersted in ds programming recently, and I tried running some codes that came with certain tutorials on my DSi.

When I compiled and tested the hello_world code that comes with the devkitpro, it ran perfeclty on my DSi. However, when I tried following drunken-coders' day1 tutorial running the code below, it ran well on an emulator but didn't run well on the DSi:

Code: Select all

#include <nds.h>
#include <stdio.h>
 
int main(void)
{
	int i;
 
	consoleDemoInit();
 
	videoSetMode(MODE_FB0);
 
	vramSetBankA(VRAM_A_LCD);
 
	printf("Hello World!\n");
	printf("www.Drunkencoders.com");
 
	for(i = 0; i < 256 * 192; i++)
		VRAM_A[i] = RGB15(31,0,0);
 
	swiWaitForVBlank();
 
	return 0;
}
Am I doing something wrong?

Re: running code on dsi

Posted: Mon Jul 05, 2010 6:40 pm
by vuurrobin
didn't you ask that same question here?:

http://forum.gbadev.org/viewtopic.php?t=17309

Re: running code on dsi

Posted: Mon Jul 05, 2010 7:37 pm
by cyberant
err yes.. :oops:
At the time I was a bit impetuous because of the frustration of being stuck right at the begining and from not knowing whether the DSi is trustful for hombrew checking (or should I say, vice versa). (at the time I decided to ask here I haven't noticed the answer at gbadev)

Anyway, apologies for being hasty, and thanks for your interest :)

Re: running code on dsi

Posted: Tue Jul 06, 2010 12:47 am
by WinterMute
Not everyone that reads these forums reads the gbadev forums and vice versa, cross posting isn't a big deal.

As you've discovered exiting from the main loop will shut down the DS - in this case the DSi is completely irrelevant as it's running in DS mode.