Skip to content

Latest commit

 

History

History
103 lines (56 loc) · 3.88 KB

CppCompileErrorSUB_BG0_CRnotDeclared.md

File metadata and controls

103 lines (56 loc) · 3.88 KB

 

 

 

 

 

 

Compile error.

 

 

 

 

Operating system(s):

  • NDS Nintendo DS
  • Ubuntu Ubuntu 10.04 LTS Lucid Lynx

IDE(s):

Project type:

  • console Console application

Compiler(s):

Libraries used:

 

 

 

 

 

main.cpp

 


////////////////////////////////////////////////////////////////////// // Demo1 ARM9 Code - Based on an example shipped with NDSLIB. // Chris Double (chris.double@double.co.nz) ////////////////////////////////////////////////////////////////////// //From http://double.co.nz/nintendo_ds/nds_develop1.html #include <nds.h> #include <stdio.h> int main(void) {   // Use the touch screen for output   videoSetMode(0);   videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);   vramSetBankC(VRAM_C_SUB_BG);   SUB_BG0_CR = BG_MAP_BASE(31);   // Set the colour of the font to White.   BG_PALETTE_SUB[255] = RGB15(31,31,31);   consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);   printf("\n\n\tHello World!\n");   while(1) {     touchPosition touchXY = touchReadXY();     printf("\x1b[10;0H");     printf("Touch x = %d   \n", touchXY.px);     printf("Touch y = %d   \n", touchXY.py);   }   return 0; }

 

 

 

 

 

Solution

 

Due to new version architecture, add the following line to the #includes:

 


#include <nds/registers_alt.h>