gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Looking for general help/advice about dual-screen coding

#172761 - SatNav - Mon Mar 01, 2010 7:17 pm

Hey,

as one or two of you may know, I'm currently working on a rubik's cube game for DS, and I've kind of reached a sticking point. I've pretty much sorted the actual cube, including some decent-ish 3d with nice touchscreen controls. Where I'm stuck is exactly how to proceed.

What I want is to have the cube on the bottom screen most of the time, with a title/settings page on the top. Then I want to be able to flip the two, so that the touchscreen can be used to play around with the settings, save/load the state of the cube, etc.

So my question is, do I need to delve into arm7 coding in order to make this work, or is it preferable (or even possible) to handle everything on the arm9? And why? In addition, I've spent some time browsing and googling around for decent examples or tutorials on dual-processor coding, and have found very little. Can anyone point me to a decent resource or example, or just give me some pointers to get me started?

Cheers,
Mark.

#172762 - wintermute - Mon Mar 01, 2010 8:36 pm

You seem to have got confused somewhere along the line - using both screens and using both processors are two entirely unrelated things. Only the arm9 has access to the video hardware and, unless you have some very specific needs which aren't addressed by the default arm7 binary, you should generally stick with programming only on the arm9.

All you have to do to swap the screen displays is call one of the libnds engine flip functions.

Code:

//!   Switches the screens.
lcdSwap();

//!   Forces the main core to display on the top.
lcdMainOnTop();

//!   Forces the main core to display on the bottom.
lcdMainOnBottom();

_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#172769 - SatNav - Tue Mar 02, 2010 11:27 am

yep, definite confusion on my part. I've been under the impression for, like, ever, that each processor controlled a different screen, and though they could switch, if you wanted to use both screens properly, you had to use both cores. Nice to know I was completely off the mark - makes things easier :D