开发工具


devkitPro:

关于 NDS 的目录有:

  • devkitARM/: 交叉编译工具
  • libnds/: NDS Library,其中包括库、文档、源代码。
  • examples/nds/: NDS 示例代码。

搭建开发环境


参考资料:Getting Started

Step 1:下载

Step 2:解压并组织

devkitpro/
    |
    +-- devkitARM/
    +-- examples/
    |     |
    |     +-- nds/
    |
    +-- libnds/

过程:

mkdir devkitpro
cd devkitpro

tar -xvjf <devkitARM tarball>

mkdir libnds
cd libnds

tar -xvjf <libnds tarball>
tar -xvjf <libfat-nds tarball>
tar -xvjf <dswifi tarball>
tar -xvjf <maxmod tarball>
tar -xvjf <libfilesystem tarball>
tar -xvjf <default arm7 tarball>

cd ..
mkdir -p examples/nds
cd examples/nds
tar -xvjf <examples tarball>

Step 3:环境变量设置

export DEVKITPRO=devkitpro
export DEVKITARM=$DEVKITPRO/devkitARM

HELLO WORLD!


Hello World 在 nds-examples/hello_world 下。

    #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;
    }

在我的 New 3DS 实机运行画面

IMG_0385

如果没有 3DS 或者 NDS,想要运行上面的代码,可以下载一个 NDS 模拟器。

其他资料


这些参考资料都很重要,不断收集中……

  1. GBATEMP wiki
  2. 3DS Homebrew wiki
  3. Gateway-3ds
  4. Why Nintendo 3DS Jailbreak is so difficult
  5. How to use Nintendo 3DS/DS/DSI homebrew with a flashcart ?

     Not like the IOS,Nintendo DS/DSI/3DS jailbreak is more harder.You need another card(like a game card)  as a sidekick to “jailbreak”.In fact,we are not call it jailbreak,and the technology is not jailbreak the Nintendo’s system.It’s something like spoof.The card enable your device to run homebrew is called flashcart(or flashcard,or linker).Here I will call it flashcart.
    
  6. DSibrew wiki