gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Compile errors?

#40002 - chrissieboy - Thu Apr 14, 2005 11:58 am

Hi, i had downloading an cool template from drunkencoders.com.
But when i was compiling it it tells me an error.

Code:

//////////////////////////////////////////////////////////////////////
// Simple consol print demo
// -- dovoto
//////////////////////////////////////////////////////////////////////

#include <NDS/NDS.h>

#include <NDS/ARM9/console.h> //basic print funcionality

int main(void)
{
   videoSetMode(0); //not using the main screen
   videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text
   vramSetBankC(VRAM_C_SUB_BG);

   SUB_BG0_CR = BG_MAP_BASE(31);
   
   BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255
   
   //consoleInit() is a lot more flexible but this gets you up and running quick
   consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0));

   consolePrintf("\n\n\tHello DS devers\n");
   consolePrintf("\twww.drunkencoders.com");
   
   

   while(1)
   {
      //move the cursor
      consolePrintSet(0,10);
      consolePrintf("Touch x = %04X\n", IPC->touchX);
      consolePrintf("Touch y = %04X\n", IPC->touchY);      
   
   }
   return 0;
}


it fails at this code : consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0));

what must i do to get this running, because the codes i want to compile or edit NEVER WORKS??

But other people get it running so i want that too hihi...

What i do wrong?

And are there more people who are beginners with development?

Because theres not much information?? or tutorials?

Thanx!!!

Chris

#40003 - chrissieboy - Thu Apr 14, 2005 12:01 pm

and i used the installer from aaronrogers his site....

#40007 - dovoto - Thu Apr 14, 2005 1:32 pm

You have an old version of the example. Get the new zip file from drunkencoders.com (under tools).
_________________
www.drunkencoders.com

#40009 - Cleon I - Thu Apr 14, 2005 1:36 pm

If you're interesting in learning to develop for a handheld system, you should probably start with the GBA. There's a lot of documentation, tutorials, tools, and example source code already out there, whereas the DS stuff is just barely starting to take off.

#40014 - chrissieboy - Thu Apr 14, 2005 2:19 pm

i got the one from the examples, because under tools i can't find a template?

And i was just starting with the gba tutorials on drunkencoders.com :)
I really like it :)
Now i understand more of how its working, i think that the ds can do the same, only more i think??

So im just learning the gba now very very very cool dudes!

But can i use the codes from the gba only compile it with the nds.h library? And then use the touchscreen for it also?

THANX!

#40026 - dovoto - Thu Apr 14, 2005 4:15 pm

Codeing for DS will be very similer when doing 2D to GBA. I am going to port my tutorials over to DS as soon as i finish day five of my GBA tutor.

I should update the "examples" section of my site. You need to grab ndslib.zip from "tools" inside there is an example folder.
_________________
www.drunkencoders.com