#154648 - ZeroSum - Sat Apr 19, 2008 8:35 pm
I've been playing around with libnds a bit and currently have some questions. I might have answered some of them myself but I'd like some confirmation that I've understood some things properly. I don't have my DS at the moment so sorry if some are painfully obvious if I just tried changed the code ><
1) To change a background I've just been dmaCopy'ing a new background into the memory. Am I right that the DS will just constantly draw whatever is in the memory it's pointing to and there's no need to "unload" things or constantly redraw it (like after every frame on a PC)?
2) Every sprite tutorial I've read has used one image per sprite. I've got about ~100 sprites so I would like to use just a sprite "sheet", would the tile hardware let me do this? Would I have to space the sprites in the sheet image a certain way?
3) Can you change video modes and vram settings whenever you want? I suppose yes as long as you set everything up right after each change?
4) Out of interest, is it possible to use backgrounds, sprites and the frame buffer on the same screen at the same time? So I could pixel plot over the top if I wanted to?
5) How would I set up the console to draw over the top of other backgrounds? I use both screens for the game but would like to display the log over the top of one if a button is pressed but I'm unsure how initConsoleDefault works...
At the moment I setup the console like so:
To draw the text over the top of the game I should set it to the topmost background I'm guessing, but would I need to change any of the parameters for consoleInitDefault()? What does the first and second parameter actually point to? If I wanted to display on the main screen can I just take out the _SUB parts?
Thanks for reading!
1) To change a background I've just been dmaCopy'ing a new background into the memory. Am I right that the DS will just constantly draw whatever is in the memory it's pointing to and there's no need to "unload" things or constantly redraw it (like after every frame on a PC)?
2) Every sprite tutorial I've read has used one image per sprite. I've got about ~100 sprites so I would like to use just a sprite "sheet", would the tile hardware let me do this? Would I have to space the sprites in the sheet image a certain way?
3) Can you change video modes and vram settings whenever you want? I suppose yes as long as you set everything up right after each change?
4) Out of interest, is it possible to use backgrounds, sprites and the frame buffer on the same screen at the same time? So I could pixel plot over the top if I wanted to?
5) How would I set up the console to draw over the top of other backgrounds? I use both screens for the game but would like to display the log over the top of one if a button is pressed but I'm unsure how initConsoleDefault works...
At the moment I setup the console like so:
Code: |
// This sets the BG to use a certain tilemap? Is this a default character tilemap? Could I change the font by replacing this if I wanted? SUB_BG0_CR = BG_MAP_BASE(31); // Text is drawn using this palette colour. BG_PALETTE_SUB[255] = RGB15(5,31,5); consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); |
To draw the text over the top of the game I should set it to the topmost background I'm guessing, but would I need to change any of the parameters for consoleInitDefault()? What does the first and second parameter actually point to? If I wanted to display on the main screen can I just take out the _SUB parts?
Thanks for reading!