#174639 - cyberant - Sun Jul 04, 2010 11:48 am
I've been trying to follow drunken coders' tutorial at dev-scene, and I have some problems and questions.
I have a DSi with AceKard 2i and I've been trying to run certain hombrew demo files. it seems that some demo files won't run perfectly with the DSi or won't run at all (or they run but make the DS shut down soon after running).
I tried following Day1 tutorial, writing the code below and building is with "make":
If I run it with an emulator it runs fine, showing the text message. But, when I try running it on a DSi it shuts the DS off (it seems to show the text message for a split-second).
1) Is there a problem with the code?
2) Or should the code be updated to work properly on a DSi?
3) Is there a way to make it work properly on both a DSi and a normal DS?
4) Are there any other things I should take notice of if I want my code to be compatible for all available DS consoles?
Also I'd like to mention that when I tried building and running the Hello_World example that comes with the devkitpro it seems to work perfectly on my DSi:
Your help is appreciated.
I have a DSi with AceKard 2i and I've been trying to run certain hombrew demo files. it seems that some demo files won't run perfectly with the DSi or won't run at all (or they run but make the DS shut down soon after running).
I tried following Day1 tutorial, writing the code below and building is with "make":
Code: |
#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; } |
If I run it with an emulator it runs fine, showing the text message. But, when I try running it on a DSi it shuts the DS off (it seems to show the text message for a split-second).
1) Is there a problem with the code?
2) Or should the code be updated to work properly on a DSi?
3) Is there a way to make it work properly on both a DSi and a normal DS?
4) Are there any other things I should take notice of if I want my code to be compatible for all available DS consoles?
Also I'd like to mention that when I tried building and running the Hello_World example that comes with the devkitpro it seems to work perfectly on my DSi:
Code: |
/*---------------------------------------------------------------------------------
$Id: main.cpp,v 1.13 2008-12-02 20:21:20 dovoto Exp $ Simple console print demo -- dovoto ---------------------------------------------------------------------------------*/ #include <nds.h> #include <stdio.h> volatile int frame = 0; //--------------------------------------------------------------------------------- void Vblank() { //--------------------------------------------------------------------------------- frame++; } //--------------------------------------------------------------------------------- int main(void) { //--------------------------------------------------------------------------------- touchPosition touchXY; irqSet(IRQ_VBLANK, Vblank); consoleDemoInit(); iprintf(" Hello DS dev'rs\n"); iprintf(" \x1b[32mwww.devkitpro.org\n"); iprintf(" \x1b[32;1mwww.drunkencoders.com\x1b[39m"); while(1) { swiWaitForVBlank(); touchRead(&touchXY); // print at using ansi escape sequence \x1b[line;columnH iprintf("\x1b[10;0HFrame = %d",frame); iprintf("\x1b[16;0HTouch x = %04X, %04X\n", touchXY.rawx, touchXY.px); iprintf("Touch y = %04X, %04X\n", touchXY.rawy, touchXY.py); } return 0; } |
Your help is appreciated.