Nds

From RTEMSWiki
Revision as of 16:48, 26 August 2011 by Julien Delange (Talk | contribs)

Jump to: navigation, search
Nds
Board NameNDS, Nintendo DS
ManufacturerNintendo
Referencehttp://en.wikipedia.org/wiki/Nintendo_ds
ArchitectureARM
CPU ModelARM9 + ARM7
Monitornone
Runs on Simulator?Desmume, see http://desmume.org
RAMRAM Unspecified.
Non-volatile MemoryNon-volatile memory unspecified.
Serial PortsSerial Ports Unspecified.
VideoVideo Unspecified.


This is start page of Nintendo DS BSP

Contents

Features in NDS BSP:

Basic console device

  • LCD, very small fonts but still readable.
  • output on the lower screen

Multiboot support in linkcmds

How to run Multi-boot programs

  • You can load the generated nds file with desmume
  • You can copy the nds file on a micro-sd card that is then started using a linker.


LibNDS

  • The BSP embedds an old version of libnds that is a library to handle low-level aspects of the hardware
  • Most of libnds functions can be used to manipulate the touchscreen, keys, wireless, etc.


How to use Framebuffer

There is an example of an RTEMS task that show grey scale on a periodic basis. This example relies on the libnds.

rtems_task Init(
  rtems_task_argument ignored
)
{
  int i;
  int j;
  int k;
  uint16_t custom_color; 
  k = 0; 
   while (1)
   {
      k = (k + 1) % 200;
      custom_color= RGB15(k, k, k);
      for (i = 0 ; i < SCREEN_WIDTH ; i++)
      {
         for (j = 0 ; j < SCREEN_HEIGHT ; j++)
         {
            my_image[i][j] = custom_color;
         }
      }
      display_image (my_image);
      printf ("test %d\n", k);
      usleep (10);
   }
}


How to use Keypad

With the libnds, you can proceed as follow :

  uint32_t keys;
  while (1)
  {
     scanKeys ();
     keys = keysHeld();
     if (keys & KEY_A)
     {
        printf ("A PRESSED\n");
     }
     if (keys & KEY_B)
     {
        printf ("B PRESSED\n");
     }



How to use Touchscreen

With the libnds, you can use it as follow :

  touchscreen_initialize (0, 0, NULL);
  touchPosition tp;
  tp = touchReadXY ();
  printf ("x=%u, y=%u, px=%u, py=%u, z1=%u, z2=%u\n", tp.x, tp.y, tp.px, tp.py, tp.z1, tp.z2);

See the touchscreen-related functions for more information about the relevant data structures.


More information

  • Desmume emulator : desmume
  • Many functions are implemented on top of third-party libraries available in the devkitpro tool-chain (devkitpro).

Test Reports

Binaries from the RTEMS examples and other examples that use libnds are available here : http://julien.gunnm.org/public/rtems/

4.10.99: User:Julien Delange reports that as for the 26/08/2011, the current CVS works correctly.

4.10-cvs : User:Julien Delange reports that the support works correctly.

4.10.0 : User:Julien Delange reports that the support is broken (26/08/2011)

Personal tools
Namespaces

Variants
Actions
Navigation
Gedare's Special Help
Toolbox