Dual Screen 2D Sprite Info/Tutorial

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

Sep 22, 2012
  1. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    2,960
    Location:
    /dev/random
    Country:
    United States
    I have looked, just not found.... I would like some help on this.
     
  2. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,736
    Location:
    Gaming Grotto
    Country:
    Poland
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    2,960
    Location:
    /dev/random
    Country:
    United States
    I want to have status on the top. The game on the bottom, witch both are 2d.
     
  4. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,736
    Location:
    Gaming Grotto
    Country:
    Poland
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    2,960
    Location:
    /dev/random
    Country:
    United States
    I will check my code, and change if I need to...
     
  6. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,736
    Location:
    Gaming Grotto
    Country:
    Poland
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    2,960
    Location:
    /dev/random
    Country:
    United States
    Ok thanks. I will look it over better this time.
     
  8. relminator

    Member relminator GBAtemp Fan

    Joined:
    May 28, 2010
    Messages:
    333
    Country:
    Philippines

Share This Page