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 > ScreenshotCode for taking Screenshot ON DS and save on Card?

#103686 - pas - Sat Sep 23, 2006 9:31 pm

What do you think would it be able to do a Program like discussed here ?:
http://www.m3-forum.com/viewtopic.php?p=36876#36876

Please reply and say what you think about this:

Pas

#103690 - OOPMan - Sat Sep 23, 2006 9:45 pm

Erm, I take it this is primarily meant for use with roms?

That's what it looks like from the M3 forum...

Possibly that makes discussing it here a bad idea...

Is the code possible? No idea...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#103695 - rmco2003 - Sat Sep 23, 2006 10:30 pm

I think some kind of code to generate screenshots of your homebrew functioning and saving to a CF/SD card would be pretty useful, and plus it'd remove the need for blurry digital camera shots of the screens.

#103697 - OOPMan - Sat Sep 23, 2006 10:54 pm

It might be a better idea to just write it as a library that provides screen capture functions from a framebuffer...

I'm not really certain, but I suspect that the "extra features" that devices like the M3 and SuperCard provide are reliant, to some extent, on some feature of said device. Which means that appending some extra chunk of code to your rom probably wouldn't work without replacing said feature...

But, yah, I don't really know, I'm just guessing...

Anyone else with more knowledge have any ideas?
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#103702 - Lick - Sat Sep 23, 2006 11:32 pm

The DS has built-in display capturing.

However, you can't edit or patch other programs to save screenshots. You'll have to ask the developer to add this feature or if the project is opensource, you could add the code yourself.

Oh, and don't compare the PSP with the DS! It's a completely different piece of hardware. ;)
- Lick
_________________
http://licklick.wordpress.com

#103704 - HyperHacker - Sat Sep 23, 2006 11:36 pm

Sounds like a great idea. Dipstar and Action Replay already do similar, loading some small chunk of code into RAM and patching the game to execute it. All you'd really need to do is patch a VBlank handler or something to call your routine, have it check for a button press, and use the display capture to write a screenshot to SRAM. (Or perhaps easier, just dump all of VRAM and have a program reconstruct a screenshot out of it; this way you don't need to fiddle with screen capture at all which could be difficult if the game were using it.)
Fitting in FATLib would be difficult, so at the expense of losing GBAMP support, I'd just have it write the screenshot to SRAM. This would work with flash carts, Supercard and M3, and as a bonus, all of these could be used to contain the code itself so you don't need to patch anything into RAM.

I imagine this could easily be made to work with commercial DS cards since they all use the same library (real cards even, not yarr). Homebrew might be more difficult but it could be designed such that apps can call the hook manually rather than being patched, so at least new apps could be made compatible with it.
_________________
I'm a PSP hacker now, but I still <3 DS.

#103780 - Mrshlee - Sun Sep 24, 2006 3:54 pm

LiraNuna has coded this function for homebrew.. so has dynastab (who has disapeared)

The code is floating around.
_________________
MrShlee.com
Projects
Dev-Scene
MyTechpedia

#103976 - pas - Mon Sep 25, 2006 8:40 pm

I just meant that someone could maybe make a Program (that runs under Windows) and ADDS the Code needed for Screen Capturing to the Homebrew oder maybe something similar (maybe called R****O*****M ? )

I just would like this cause making Screenshots on the DS can come in Handy everytime...

Greets:

Pas

#104001 - josath - Mon Sep 25, 2006 9:56 pm

cReDiAr knows how to patch a commercial game without using illegal roms, his method only works with an actual game in the NDS slot. basically it works like:
1. boot the loader from the GBA slot
2. load the nds game binaries from the NDS slot
3. patch the nds game binaries
4. execute the nds game binaries

currently, he is patching it to do things like infinite ammo etc, but that should be extensible to do screencaptures.

#104035 - ecurtz - Tue Sep 26, 2006 2:50 am

Even if you patched the ROM it would only work if there was an empty bank of video RAM to capture the data into, this seems pretty unlikely in most games. AFAIK there is no other way to get to the contents of VRAM.

#104092 - pas - Tue Sep 26, 2006 3:18 pm

@josath:
This sounds interesting, but if I understand it right then We would need a Gba AND a NDS cart at once to do that, right ? Is there really no way to do it with only a Gba or only NDS one ?

@ecurtz:

And why shoudn't there be any Videoram free ?

Maybe we should ask Darkfader or Chisim about this... Or ?

Greets:

Pas

#104094 - Sausage Boy - Tue Sep 26, 2006 3:52 pm

Quote:
This sounds interesting, but if I understand it right then We would need a Gba AND a NDS cart at once to do that, right ? Is there really no way to do it with only a Gba or only NDS one?


For taking screenshots of homebrew, the developer can add a screenshot function, or you could just make a mockup screenshot. For commercial games, you'd probably have the nds cart, rigt? And most homebrew running solutions are gba slot based, so no problems there.


Quote:
And why shoudn't there be any Videoram free ?


Because a commercial game likely pushes the hardware pretty hard, and leaving a free vram bank would be a huge waste. Besides, you can only capture from the main core, right ecurtz?
_________________
"no offense, but this is the gayest game ever"

#104212 - HyperHacker - Wed Sep 27, 2006 5:43 am

Can you not dump VRAM to SRAM and have a program construct a screenshot out of it later? You shouldn't need the video capture system to just copy the contents of VRAM.
_________________
I'm a PSP hacker now, but I still <3 DS.

#104220 - ecurtz - Wed Sep 27, 2006 6:15 am

Sausage Boy wrote:

Because a commercial game likely pushes the hardware pretty hard, and leaving a free vram bank would be a huge waste. Besides, you can only capture from the main core, right ecurtz?


Yeah, and yeah. Both have exceptions, I'm sure. You could in theory capture 2D graphics or the subscreen by reading all the registers and knowing where to grab all the information, but you'd be better off with an emulator at that point. There's no (accessible) VRAM in the sense of a place the pixels are stored, the only way to get to that is the capture mechanism, or else the capture stuff wouldn't exist.