#61659 - chishm - Tue Nov 22, 2005 12:02 pm
I have whipped up this quick demo of how to have borders in GBA mode. To use it, start the NDS file using your favourite method. Then insert a GBA game (you can remove the flash cart if you need to) and press A to start it, with the border around the game screen.
Crappy source code is included, to demonstrate how to do it in your own applications.
The image is a raw 15 bit, 256 * 192 pixel image, if you want to change it. You will need to recompile with DevKitPro r17 if you do.
I almost forgot the link.
I have to thank MightyMax for the idea for this. It was his comments on left over NDS data in GBA mode that inspired me to try it out.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#61662 - buZz_ - Tue Nov 22, 2005 12:47 pm
great work chishm :)
#61701 - tepples - Tue Nov 22, 2005 8:10 pm
Could you use this in a future version of your GBAMP firmware hack to provide an error message if the FAT driver fails to find _boot_mp.nds? This would help distinguishing "booting in GBA mode" from "booting in DS mode but falling back to GBA mode", saving a bit of troubleshooting time.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#61708 - Ilomoga - Tue Nov 22, 2005 8:50 pm
Wow, that's a quite nice demo :D
Would it be possible to make a DS loader (like MultiNDS) that supports both *.nds and *.gba files?
_________________
The future of gaming is mobile Handheld Gaming.
#61724 - Mighty Max - Tue Nov 22, 2005 9:45 pm
Ilomoga wrote: |
Wow, that's a quite nice demo :D
Would it be possible to make a DS loader (like MultiNDS) that supports both *.nds and *.gba files? |
That was basically the reason why we experimented with left over ram :p Some Method to pass parameters over into gba mode.
_________________
GBAMP Multiboot
#61745 - josath - Wed Nov 23, 2005 1:10 am
well, if all you want to do is pass info from ds mode into gba mode, on the gbamp, why not just write it to a file? like __gbamp.tmp or something?
but the border is cool nevertheless, now we need to make it load from a .bmp file on the cf card, so people can have their own borders while playing gba games.
#61752 - chishm - Wed Nov 23, 2005 2:48 am
Actually, to load a file, all I need to know is the cluster number. That is 32bits long. I have 5 registers in the CF card, each one 8 bits wide. They should survive a soft reset with their data intact, and readable. I just haven't gotten around to implementing it yet.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#61762 - tepples - Wed Nov 23, 2005 3:39 am
chishm wrote: |
Actually, to load a file, all I need to know is the cluster number. That is 32bits long. |
And the file length in bytes. Otherwise the file length is rounded up to the number of bytes per cluster. But for some formats this might not matter.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Wed Nov 23, 2005 2:26 pm; edited 1 time in total
#61776 - chishm - Wed Nov 23, 2005 8:55 am
I have been experimenting some more. It seems that if I set the display into frame buffer mode, then I only need to fill the buffer being used with the data. However, only VRAM banks A or B can be used. If C or D are used, the GBA display doesn't show up.
However, doing this causes the DS to render the GBA screen at only 30 fps, rather than the usual 60.
The better option is to fill VRAM banks A and B with the background display, then switch to MODE_0_2D (or any other non-framebuffer mode). This allows the GBA display to run at 60 fps.
In either case, the image data is 256*192 pixels, 15bpp, no alpha bit.
My theory about how this works:
The DS screen is 256 * 192, while the GBA screen is 240 * 160 pixels. The VRAM banks are used as a buffer between the GBA renderer and the DS screen, but the buffers are not cleared between frames (why bother?). Since the border is still in the buffer, it won't be cleared.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#61878 - biubid_boy - Thu Nov 24, 2005 1:06 pm
Perhaps this could be modified to make the game use the whole screen, like what you can do in Gooba.
//EDIT: Maybe a buffer-overflow can be used to control the ds part of the screen.
#61910 - IxthusTiger - Fri Nov 25, 2005 1:39 am
what's "pircay??"
#61923 - chishm - Fri Nov 25, 2005 9:41 am
biubid_boy wrote: |
Perhaps this could be modified to make the game use the whole screen, like what you can do in Gooba.
//EDIT: Maybe a buffer-overflow can be used to control the ds part of the screen. |
No, its not possible. To software running on the GBA, the screen buffer is just like a normal GBA screen, there is no way for it to access the outside. The DS hardware is what takes care of the conversion between the two formats. The border is created in NDS mode, while that hardware is still accessable.
To use your Goomba analogy, the DS hardware is like the emulator. It is what takes care of drawing the screen. The GBA game is like the GB ROM, it has no idea that it is not running on the real thing, and so can't change its behaviour. The only reason you can see more in Goomba is because the emulator draws the screen differently. For the same thing to happen on the DS, the DS hardware would have to be modified to draw outside of the normal screen area.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#95634 - spinal_cord - Sun Jul 30, 2006 5:17 pm
broken link, i wanted to try this :(
It would be cool and a flashme add-on, eg, the firmware could check the game in the gba slot, and load a background accordingly.
would this be possible?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#95694 - ph0x - Sun Jul 30, 2006 7:54 pm
#95713 - spinal_cord - Sun Jul 30, 2006 8:16 pm
I was hoping sor somwthing i could run from gbamp, can this do that, eg, run this. I cant use .ds.gba, i need .nds instead
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#95723 - ph0x - Sun Jul 30, 2006 8:28 pm
does it work if you rename it to .nds?
#95753 - spinal_cord - Sun Jul 30, 2006 10:42 pm
nope, 2x white screens.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#95817 - HyperHacker - Mon Jul 31, 2006 6:05 am
I made a program for this a while ago, and I intend to add a hell of a lot more options soon.
_________________
I'm a PSP hacker now, but I still <3 DS.
#95860 - spinal_cord - Mon Jul 31, 2006 10:13 am
That one works fine for me. thankyou.
What sort of features?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#96065 - HyperHacker - Tue Aug 01, 2006 3:19 am
Basically turning it into a general-purpose boot menu that can launch NDS apps, game cards, etc.
_________________
I'm a PSP hacker now, but I still <3 DS.
#96090 - spinal_cord - Tue Aug 01, 2006 9:41 am
is it possible to read the cart name (or some sort of ID) so that a specific background can be load for each cart with less user fiddling, perhaps using some sort if .ini file. So that a different backgrougd can be loaded for each game without me having to set anything?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#96095 - Scorpei - Tue Aug 01, 2006 10:28 am
HyperHacker wrote: |
I made a program for this a while ago, and I intend to add a hell of a lot more options soon. |
Hmm, I can't seem to load my own borders....
I've tried using the SC-SD and GBAMP, just a simple .bmp image 24bit.
#96097 - Sausage Boy - Tue Aug 01, 2006 10:33 am
spinal_cord wrote: |
is it possible to read the cart name (or some sort of ID) so that a specific background can be load for each cart with less user fiddling, perhaps using some sort if .ini file. So that a different backgrougd can be loaded for each game without me having to set anything? |
Just read the game title, 0x800000a0 to 0x800000ab (12 chars) in NDS mode.
_________________
"no offense, but this is the gayest game ever"
#96104 - spinal_cord - Tue Aug 01, 2006 11:45 am
Scorpei wrote: |
HyperHacker wrote: | I made a program for this a while ago, and I intend to add a hell of a lot more options soon. |
Hmm, I can't seem to load my own borders....
I've tried using the SC-SD and GBAMP, just a simple .bmp image 24bit. |
I'm using an 8-bit bmp, it works fine. (using GBAMP CF)
Sausage Boy wrote: |
Just read the game title, 0x800000a0 to 0x800000ab (12 chars) in NDS mode. |
And this could be used in some sort of table to load a specific image (perhaps naming the image the same as the game title?) cool.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#96109 - Scorpei - Tue Aug 01, 2006 12:26 pm
I got it to work if I start the app from my GBAMP, but when I start it from my SC it doesn't want to work (I started it up after patching it with ndsloader.bin).
#96177 - HyperHacker - Tue Aug 01, 2006 7:52 pm
Are they in \GBA Borders?
Loading a specific image based on the title of the game was planned originally, but I'd have to load all the images into memory first, because the program can't very well read the cartridge to see what game is being played when the GBAMP/whatever device is still inserted. The next version does automatically load default.bmp if it exists though, and I plan to add a mechanism for homebrew GBA ROMs to contain their own border. (Can GBA ROMs specify a border image for the Game Boy Player?)
_________________
I'm a PSP hacker now, but I still <3 DS.
#123989 - felix123 - Mon Apr 02, 2007 10:30 am
Looks like R4 included this feature in 1.08
_________________
Nintendo DS homebrew on Wikipedia
#123999 - HyperHacker - Mon Apr 02, 2007 12:12 pm
Neat. FYI, I haven't forgotten this project. I'm just having some trouble getting libFAT, rebootlib, my NDS launching code and my console library to cooperate with eachother.
_________________
I'm a PSP hacker now, but I still <3 DS.