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 > Swapping LCD's without using LCDSwap

#107563 - headspin - Mon Oct 30, 2006 10:26 pm

I've had a few people reporting problems with LCDSwap(). It was with Supercards I think. So I'm recompiling some old code to avoid using it.

Here are my video mode and bank setup's
Code:
videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE);
videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);
vramSetMainBanks(VRAM_A_MAIN_BG_0x6000000, VRAM_B_MAIN_BG_0x6020000, VRAM_C_SUB_BG , VRAM_D_LCD);
SUB_BG0_CR = BG_MAP_BASE(31);
BG3_CR = BG_BMP16_256x256;


Now I thought it would be a simple matter of swapping over the first two banks to VRAM_A_SUB_BG_0x6200000 and VRAM_B_SUB_BG_0x6220000. Problem is I only see a defintion for Sub screen in bank C (VRAM_C_SUB_BG_0x6200000).

Is there a way I can avoid the LCDSwap bug in Supercards and switch over the banks? Or is there some other way?
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#107565 - omaremad - Mon Oct 30, 2006 10:45 pm

Works fine on my supercard, maybe its m3? ithink the m3 needs to have all the ram banks cleared througly othewise its buggy try pepsimans loader.

#107567 - josath - Mon Oct 30, 2006 11:34 pm

There's an easier way. Instead of using lcdSwap(), use lcdMainOnTop() or lcdMainOnBottom() (I think those are the names, look in video.h if they don't work)

#107579 - TJ - Tue Oct 31, 2006 1:47 am

lcdSwap works fine on my SuperCard as well.

#107582 - headspin - Tue Oct 31, 2006 3:24 am

Okay, just checked my e-mail and it was a user with an M3 SD cart that had the LCDSwap() issue.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#107622 - HyperHacker - Tue Oct 31, 2006 5:43 pm

lcdSwap() is unreliable for setting the initial screen position since you don't know what it is to begin with. Use lcdMainOnTop() or lcdMainOnBottom() to set up, and lcdSwap() when you actually need to switch screens.
_________________
I'm a PSP hacker now, but I still <3 DS.

#107631 - OOPMan - Tue Oct 31, 2006 6:38 pm

Hmmmm, I do recall having problems with some older homebrew whereby loading direct from the SC menu would result in the app hanging with the screens reversed shortly hafter startup. Starting via DSO or Moonshell usually fixed this...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#107948 - PypeBros - Fri Nov 03, 2006 10:51 am

headspin wrote:

Now I thought it would be a simple matter of swapping over the first two banks to VRAM_A_SUB_BG_0x6200000 and VRAM_B_SUB_BG_0x6220000. Problem is I only see a defintion for Sub screen in bank C (VRAM_C_SUB_BG_0x6200000).

Is there a way I can avoid the LCDSwap bug in Supercards and switch over the banks? Or is there some other way?


That would only partially emulate the LCD swap, anyway. E.g. sprite memory wouldn't be swapped (so you have to move manually all the sprites to the new screen), and that doesn't make your bottom screen more powerful (e.g. you don't change the physical location of the screen that is 3D-capable).

Still that could be a nice trick if you want to swap the capabilities without swapping the content (e.g. your 3D-rendered avatar moves to the upper screen so you want the upper screen to become the main screen but the tiles of your dungeon-of-darkness should still remain in place).
_________________
SEDS: Sprite Edition on DS :: modplayer