Porting FFCC's snapshot function to other games.

Started by Stuff, August 08, 2011, 03:12:59 AM

Previous topic - Next topic

Stuff

Final Fantasy the Crystal Bearer [RFCEGD] has a really awesome snapshot function. Press 2 and you can take a snapshot ANYWHERE. And then it saves it to the sd card in private/app/RFCE/FFCCTCB/FFCCTCB[nonsense].jpg. So I searched for TCB hoping to find some instruction on where to save. Out of the entire 80s and 90s, only 1 result came up(yes!). It was a nice result, but I don't think it's enough. This is what I found:

[spoiler]804B2960   3F800000   3F800000   00000000   BF800000
804B2970   BF800000   00000000   00000000   00000001
804B2980   00000002   00000003   00000004   00000005
804B2990   446F5265   61637469   6F6E0000   00000000
804B29A0   25303264   3A253032   643A2530   32640000
804B29B0   2D3C7332   3E2D3C73   313E3A3C   73313E2D
804B29C0   3C73323E   2D3C7331   3E3A3C73   313E2D3C
804B29D0   73323E2D   00000000   46464343   54434225
804B29E0   30326425   30326425   3032645F   25303264
804B29F0   25303264   25303264   2E6A7067   00000000
804B2A00   3F800000   00000000   00000000   00000000
804B2A10   3F800000   00000000   00000000   00000000
804B2A20   3F800000   00000000   3F800000   00000000
804B2A30   00000000   00000000   00000000   3F800000
804B2A40   00000000   00000000   00000000   00000000
804B2A50   3F800000   00000000   00000000   00000000

And again in ascii:

804B2960    ? . . .    ? . . .    . . . .    . . . .
804B2970    . . . .    . . . .    . . . .    . . . .
804B2980    . . . .    . . . .    . . . .    . . . .
804B2990    D o R e    a c t i    o n . .    . . . .
804B29A0    % 0 2 d    : % 0 2    d : % 0    2 d . .
804B29B0    - < s 2    > - < s    1 > : <    s 1 > -
804B29C0    < s 2 >    - < s 1    > : < s    1 > - <
804B29D0    s 2 > -    . . . .    F F C C    T C B %
804B29E0    0 2 d %    0 2 d %    0 2 d _    % 0 2 d
804B29F0    % 0 2 d    % 0 2 d    . j p g    . . . .
804B2A00    ? . . .    . . . .    . . . .    . . . .
804B2A10    ? . . .    . . . .    . . . .    . . . .
804B2A20    ? . . .    . . . .    ? . . .    . . . .
804B2A30    . . . .    . . . .    . . . .    ? . . .
804B2A40    . . . .    . . . .    . . . .    . . . .
804B2A50    ? . . .    . . . .    . . . .    . . . .[/spoiler]

It's nice to see I probably found what it uses to name the file, and I could probably change what the file gets named completely, but that seems to be it. Maybe s2 and s1 are some kind of folder....idk. I'm not sure where the values for the %02d are coming from, but whatever. I tried looking for DoReaction, hoping it's some kind of function call, but nope. It's only found here. Scrolling up, you can see I guess the disc's files, and scrolling down you can see nonsense(or nothing. I forgot).

I mainly wanted it for mh3 since at the end of a quest you get a nice image that may or may not be worth saving. I imagine that the image is stored somewhere and you just gotta take the data and save it to the sd. But if it is possible to take this game's snapshot function, strip it down to the basics(just save. no pause the game to show the screencap), and port it over to any other game(probably with a C2 code), that'd be awesomeness.

Any ideas on how possible it is, or if I'm looking in the wrong place?
.make Stuff happen.
Dropbox. If you don't have one, get it NOW! +250MB free if you follow my link :p.

Mod code Generator ~50% complete but very usable:
http://dl.dropbox.com/u/24514984/modcodes/modcodes.htm

dcx2

Not to discourage you, but this can become quite complicated.

The string you found is probably used for an sprintf.  It's probably used to create the name of the file, which allows the code to dynamically generate [nonsense].  The %02d means to place some decimal number (the d) at that point in the string, with at least 2 digits wide (the 2) and if it's only one digit then it will fill the missing digit with 0 (the 0).  See wikipedia on printf.  http://en.wikipedia.org/wiki/Printf#Format_placeholders

If you place a read breakpoint on the first address in the string (804B29D8) and then take a snapshot, you'll probably be taken to the sprintf.  You can walk the stack back a bit and perhaps you'll see where the arguments come from (i.e. what all the %02d are supposed to be - my first guess would be date and time of snapshot).  sprintf will then ultimately create the file name's string.  You might be able to follow this "real string" along to see who reads it.  Ultimately it will be passed to some function that writes to the SD card.

The problem is that not all games will have the same functions.  The File Patch code by Phantom Wings was possible because Brawl already had SD functions and he figured out how to use them.  You might be able to get such a snapshot code to work on other games which have SD functions, once you find them.

Oh, and those games would need jpg conversion functions, too.  If a game doesn't have jpg and SD functions, you might be able to add them with the extended code list...maybe.

All in all, I would say that it's...well...possible...with a lot of hard work.

goemon_guy

Forgive me if I'm wrong, but doesn't Gecko.net and/or WiiRD have a screenshot function you could use to take snapshots from games?
-Currently hacking the following game(s):
...
Request a code via PM, if you wish.

dcx2

Yeah, it dumps the video buffer as a raw bitmap.  Then the PC converts to jpg, png, etc.

I think Stuff wanted a code that allowed your average cheater to take screenshots and save them to the SD.

Stuff

Yeah. I guess it would be extremely complicated. I imagined some copy and pasting would work some magic XD. I'll come back to it at some point later on. It's still something I'd like to see happen.

Quote from: goemon_guy on August 08, 2011, 06:06:53 PM
Forgive me if I'm wrong, but doesn't Gecko.net and/or WiiRD have a screenshot function you could use to take snapshots from games?
Yeah but only hackers have usb geckos :p. Don't we make codes for the user to enjoy? And also, I don't normally play with the debugger on at all times. Codes on, yes.what dcx2 said.

And with mh3, I think it might be possible to grab the quest clear image and save it without the menu all over the screen. That gave me an idea for a code, though.
.make Stuff happen.
Dropbox. If you don't have one, get it NOW! +250MB free if you follow my link :p.

Mod code Generator ~50% complete but very usable:
http://dl.dropbox.com/u/24514984/modcodes/modcodes.htm

goemon_guy

Quote from: dcx2 on August 08, 2011, 06:25:00 PM
Yeah, it dumps the video buffer as a raw bitmap.  Then the PC converts to jpg, png, etc.

I think Stuff wanted a code that allowed your average cheater to take screenshots and save them to the SD.

I thought of that moments after posting. Sounds like quite a project, though.

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.

Stuff

using an extended code list wouldn't be very user friendly... I can't see it being a massively huge code. Maybe about as big as MID custom. It just needs to do the saving part of the code. Not that preview thing or anything like that.

Quote from: goemon_guy on August 08, 2011, 06:40:29 PM
I thought of that moments after posting. Sounds like quite a project, though.
heh. yeah. Especially since I'm learning as I go. It'll be awesome if I complete it, though.
.make Stuff happen.
Dropbox. If you don't have one, get it NOW! +250MB free if you follow my link :p.

Mod code Generator ~50% complete but very usable:
http://dl.dropbox.com/u/24514984/modcodes/modcodes.htm

dcx2

No, I mean if you want to port this code to other games, you will not only have to port the part that you hack...but you'll also have to port all the functions that your hack needs, because your other game was probably not compiled with functions that write to the SD card.

Stuff

:/ Well I was hoping to be able to simplify everything into one function if it does a bunch of passing arguments. Like for example, the formatting for "DoReaction"(I'll just call it that) can happen within the main function instead of having values passed from somewhere else to here. I'm just blabbering nonsense hoping you get what I mean >.<.

I'll probably start looking into this more soon. It's getting more interesting than when the idea popped up in my head.

Here's hoping the final code doesn't take up 800+ lines.  :D
.make Stuff happen.
Dropbox. If you don't have one, get it NOW! +250MB free if you follow my link :p.

Mod code Generator ~50% complete but very usable:
http://dl.dropbox.com/u/24514984/modcodes/modcodes.htm