Dual Screen 2D Sprite Info/Tutorial

Discussion in 'NDS - Emulation and Homebrew' started by gudenau, Sep 22, 2012.

  1. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,258
    1,225
    Jul 7, 2010
    United States
    /dev/random
    I have looked, just not found.... I would like some help on this.
     
  2. Foxi4

    Foxi4 On the hunt...

    pip Reporter
    23,537
    21,496
    Sep 13, 2009
    Poland
    Gaming Grotto
    A little bit more info would be nice. What you basically want to do is to connect two screens of the DS (dual screen mode) into one display with sprites and/or backgrounds being capable to traverse from one to the other, am I correct?
     
  3. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,258
    1,225
    Jul 7, 2010
    United States
    /dev/random
    I want to have status on the top. The game on the bottom, witch both are 2d.
     
  4. Foxi4

    Foxi4 On the hunt...

    pip Reporter
    23,537
    21,496
    Sep 13, 2009
    Poland
    Gaming Grotto
    Uhm... so you *don't* want to connect the screens, you want them to remain separate displays for separate things?

    Well then just map one VRAM block for the MAIN screen and one for the SUB screen. For example:

    Code:
    videoSetMode(MODE_0_2D);
    videoSetModeSub(MODE_0_2D);
    
    vramSetBankA(VRAM_A_MAIN_BG);
    vramSetBankC(VRAM_C_SUB_BG);
    Both screens are set to work in MODE 0, the top one is set to Bank A, the bottom one to bank C. Now you can init backgrounds on either screen.

    You can find examples in X:\devkitpro\Examples\nds, you'll find more there.
     
  5. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,258
    1,225
    Jul 7, 2010
    United States
    /dev/random
    I will check my code, and change if I need to...
     
  6. Foxi4

    Foxi4 On the hunt...

    pip Reporter
    23,537
    21,496
    Sep 13, 2009
    Poland
    Gaming Grotto
    Review the code in X:\devkitPro\examples\nds\Graphics\Sprites\simple

    It shows *exactly* what you need - sprites on both the top and the bottom screen, in detail.

    That is unless you're not using libnds - if you're using nflib, palib or whatever other library, review their examples. :P
     
  7. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,258
    1,225
    Jul 7, 2010
    United States
    /dev/random
    Ok thanks. I will look it over better this time.
     
  8. relminator

    relminator #AnyaBasic

    Member
    364
    20
    May 28, 2010