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 > 3D & FrameBuffer on both screen

#125117 - zeGouky - Wed Apr 11, 2007 4:16 pm

Hi there,

I would like to know if anyone have experienced to do that :

- Screen 1 -> in frame buffer mode using BANK A of the VRAM
- Screen 2 -> 3D using the bank left

Thanks

#125130 - pepsiman - Wed Apr 11, 2007 5:10 pm

zeGouky wrote:
Hi there,
- Screen 1 -> in frame buffer mode using BANK A of the VRAM

Why use frame buffer when extended rotate and scale backgrounds exist?

#125157 - zeGouky - Wed Apr 11, 2007 8:10 pm

Well after some search im using the Bitmap sprite for the sub screen so i can use 3D for the main screen :)

#125158 - tepples - Wed Apr 11, 2007 8:12 pm

zeGouky wrote:
I would like to know if anyone have experienced to do that :

- Screen 1 -> in frame buffer mode using BANK A of the VRAM
- Screen 2 -> 3D using the bank left

Pepsiman is right. Put the main core on screen 2 with the sub core in mode 5. Put the frame buffer in bank C of VRAM and make sure bit 15 of each pixel value is set. Then you have four banks of texture for the screen 2 (A, B, and D) and 1 bank of frame buffer for screen 1.

Or must the three texture banks be contiguous?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#125161 - zeGouky - Wed Apr 11, 2007 8:54 pm

They need to be contiguous.

Here's the main idea, the game screen is 512x300 but i want to have a full view of the game area, so my idea is to render the screen into a 512x300 buffer that will be used as a texture, and display it cropped on the sub screen and put it on a quad for the main screen, so i will be able to zoom it.

#125209 - tepples - Thu Apr 12, 2007 2:51 am

How many colors are needed for the main screen? If 256, then 1 byte per pixel * 512 pixels per line * 300 lines = 153600 bytes, which fits into VRAM A and B.

Are you doing something on the sub screen that isn't better done with a tiled mode pulling tile and map data from VRAM H?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#125228 - zeGouky - Thu Apr 12, 2007 7:26 am

No its a 16 bit texture so it need bank A,B & C.

As for the sub i have no choice, i can't use the tile and map mode

Anyway i got everything working now

thanks for the help

#125230 - HyperHacker - Thu Apr 12, 2007 8:00 am

You just want to display a partial view of a 512x300 image on one screen, and a scaled-down view of the entire image on the other? In that case, why not use an extended rotation background? They can be up to 512x512 and can be scaled.
_________________
I'm a PSP hacker now, but I still <3 DS.

#125248 - zeGouky - Thu Apr 12, 2007 10:13 am

Well Simply because there's not enough ram for 2 512*512 extended background and also because the sub screen doesnt support the 512x512 format.

Thats why my primary idea was to use extende BG for sub and 3D for the main and do the render inside a 512x512 texture, but on the flip i get black lines :-(

#125252 - zeGouky - Thu Apr 12, 2007 11:00 am

Well i think I'm quite stuck on that solution, only a small data can be transferred every VBlank without having screen corruption :-/

I might go for a 512x512 bg for main and a 256x192 for the sub using OAM but im going to be really short on VRAM *sigh*

#125405 - HyperHacker - Fri Apr 13, 2007 3:19 am

Yeah, a 512x512 image will eat most of your VRAM, at 512K. You might want to use a 256x256 image for both (IIRC there's no 256x192 mode), and do software scaling and clipping.
_________________
I'm a PSP hacker now, but I still <3 DS.

#125432 - zeGouky - Fri Apr 13, 2007 7:37 am

Yep but i managed to get it working, so I have a 512x512 extended BG on the main display and an OAM 'framebuffer' on the sub.

On the main i have declared a 512x512 BG but only set the bank A,B,C and for the Sub bank D. Since im only using 512x300 in real that's fit on the 3 first banks. It a little tricky but it work :)