ROM Hack Yugioh replays and stuff that goes in the 190 blocks

Stuff7

Member
OP
Newcomer
Joined
Dec 3, 2010
Messages
7
Trophies
0
Age
34
Location
the Void
Website
www.youtube.com
XP
83
Country
United States
yugioh%20save_replay_vs_nico.jpg

I guess this is a good place to put this since pokesav is stickied here.

I was hoping to find a solution already, but it sounds like people don't play yugioh. >.<
So Yugioh 2011 has a whooping 190 blocks for you to save replays, your own duel puzzles, and of course dlc(including forbidden lists, ghost data,...and stuff). So I saved a few replays, and I'm out of space. wut? delete "unnecessary data"?! '>.>

So no. There has to be a way to extract the data from those 190 blocks to some file, and somehow inject it back in.

So I opened the save file with a hex editor. The picture above is a snapshot I took. It caught the most interesting part anyway. I assume this is the 190 blocks(not just the snapshot). The file starts off with some nonsense(just a few lines) and then some 00s. And then the snapshot. The snapshot explains what I think everything is, because it almost looks obvious. After that replay, it was more 00s, and then the next replay. And it went on like that for all the rest of the replays. Replays is all I had, so I didn't see what anything else looks like.

But then after the last replay, there were some more 00s and then [512KB-190ish blocks] worth of nonsense, which is most likely game save data. Everything from your name to your decks to your appearance/where you at/what you've done/how many times..etc. So I don't think any of that needs to get looked at. Just the beginning.

So the intention was to make a import/exporter(should be some simple code), but I have no idea how to handle hex. >.<

I should try shifting some data in the hex editor first. Guess I'll do that later and report what happened. I'm just scared of those 00s. idk if I should keep the first set of 00s or the second set or both.

Feedback is appreciated.
biggrin.gif
 

Stuff7

Member
OP
Newcomer
Joined
Dec 3, 2010
Messages
7
Trophies
0
Age
34
Location
the Void
Website
www.youtube.com
XP
83
Country
United States
^I just did that and for some reason my newest replay is in listed first. Probably because I deleted the first replay to save this one. BUT, in game this replay is listed last. So common sense doesn't apply here. >..>

Also, some replays don't show my name twice like that first one. Weird stuff.
 

notmeanymore

Well-Known Member
Member
Joined
Nov 29, 2009
Messages
2,700
Trophies
1
XP
711
Country
United States
Stuff7 said:
^I just did that and for some reason my newest replay is in listed first. Probably because I deleted the first replay to save this one. BUT, in game this replay is listed last. So common sense doesn't apply here. >..>

Also, some replays don't show my name twice like that first one. Weird stuff.
No no no. Try this, make a new save, play around a bit, then back up the save. After that, you play a game and save the replay. Compare the saves. (In this scenario, the only differences would be the replay, and some various integers like DP and win/loss count)
Another good one: Take any save, back it up, add a deck, and compare the saves.

I'd help you out with this, but my older sister is borrowing my AK2i. :/
 

Stuff7

Member
OP
Newcomer
Joined
Dec 3, 2010
Messages
7
Trophies
0
Age
34
Location
the Void
Website
www.youtube.com
XP
83
Country
United States
Sorry for taking so long to respond. I didn't have too much time, and I'm also playing through the game at the same time. XD

Well here it is. I made a new save, saved a replay, deleted the replay, used the saved replay backup to save another replay, and now I'm about to save a replay in the deleted replay backup just to see what happens. That's 4 backups I have atm + my original.

So at 00000C80, all the FF's end. You have 00s up to 00000CDEF. And to my surprise, the new save had some weird data from 00000CE0-00008000ish. I really don't know exactly where the 190 blocks end. I was trying to compare it to my real backup, But there's some weird tag duel info there and I don't remember if I saved a replay for that first tag duel. Back to the weird data, I was expecting to see 00s all the way to the end. There's weird gibberish, as if there was something saved there. But this little bit made me giggle a little. Like, wth is that? XD

So in the 1st replay backup, I see that it starts at either 00000CE0 or 00000D00. I think ..D00 is more likely because CE0 and CF0 are identical to before the replay. And the replay probably ends at 197F. This might be why swapping replays didn't work before. There's a few lines of 00s and then there's "8E 3C DB 93" at the end of them. And then the rest of the lines after that seem to be unchanged.

The 2nd replay starts at 1980, or more precisely, immediately after the end of the 1st replay. and it starts off similar to D00, which eliminates any chance of CE0-CFF being part of the 1st replay. Maybe. Anyway, this duel was short compared to the first one, so it ends at 21FF
. But this one has "ED 5C F3 57" o.O? Followed by unchanged data. This is where that snapshot was at, so you see whatever was left there. lol ////

But even more interesting is when I deleted the 1st replay. This is going back to before the 2nd replay. Instead of deleting/corrupting the data, the data is still there. With the addition of a "01" at 1981 and 00s up to 1B70. That line is 00s and ends with "2F 78 57 54" or /xWT in ascii. Notice the distance between 197C and 1B7C. Thats 200 in hex and...512 in decimal \o/. Coincidence? Eh, maybe.

So now I want to see what'll happen if I save a new replay over the deleted one. I'll try to save a quick duel so I could see what's left after that replay ends. And now I also wonder if deleted replays will always have /xWT 32 bytes(I think) away. And later I'll check what dlc and duel puzzles looks like. Also, up to C70, it's not just FFs. There's a few areas with other data, but for the most part, it's FFs. I don't think I have to touch that anyway.

---------------------------
EDIT:

So idk where this terrible inaccuracy came from. I was just now trying to swap the replays around, and it wouldn't work. I'd end up with 190 free blocks. So I thought maybe the last line has some meaning, or maybe even the first line. The last line because it's after quite a few 00s and they were different for both replays, and the first line because these were also different, but the next line was "01 01" Stuff(In hex) for both replays. And nothing would work. And I noticed that /xWT wasn't there anymore. So now I fear that copy and paste in MadEdit might suck horribly.
 

Prof. 9

Well-Known Member
Member
Joined
Jun 17, 2008
Messages
324
Trophies
1
Location
The Netherlands
Website
twitter.com
XP
853
Country
Netherlands
You need to fix checksums if you change anything in the save file.

I've done a little research into this game's save files a while back. It seems to store some kind of file allocation table, then a block order table or something like it (???), followed by the actual blocks of data. If you can find them, you can simply hex edit files in your save. For example each ghost data has a set size, so you could swap ghost files between save files. That doesn't really solve the problem though, I guess.

Here are my notes if you want 'em. Note that I made this with my 512kb save created with AKAIO:

Code:
00000680: DLC FAT Table (checksum at 0xA4C = CRC32 of 0x3CC bytes from 0x680) (RAM: 02123A58)
00000A82: DLC Blocks Table (?)

First 4 bytes of the FAT table:
Empty:
00 00 10 F1 | F1100000

1 thing stored:
01 04 20 F1 | F1200401

2 things stored:
02 08 30 F1 | F1300802

3 things stored:
03 0C 40 F1 | F1400C03

4 things stored:
04 10 50 F1 | F1501004

4 recipes and an FC:
08 18 70 F0 | F0701808



FAT individual entries:

40 80 00 5D | 00 | 01 | 0000 | 001 | 5D | Starter Deck1
C0 00 01 5D | 00 | 01 | 0001 | 002 | 5D | Starter Deck2
40 81 01 5D | 00 | 01 | 0002 | 003 | 5D | Starter Deck3
C0 01 02 5D | 00 | 01 | 0003 | 004 | 5D | Starter Deck4
43 80 02 00 | 03 | 01 | 0000 | 005 | 00 | Friend Code 1
69 80 03 7C | 29 | 01 | 0000 | 007 | 00 | Friend Code 1
40 82 06 5D | 00 | 01 | 0004 | 00D | 5D | Starter Deck
C0 02 07 5D | 00 | 01 | 0005 | 00E | 5D | Starter Deck

AND 0000003F lsr 00h = ?
AND 00000040 lsr 06h = ?
AND 00007F80 lsr 07h = block number???
AND 00FF8000 lsr 0Fh = ?
AND FF000000 lsr 18h = ?
Code:
HEADER
0x0000 = ??? (some kind of number? might have to do with the ghost order in the list???)
0x0004 = Expiration data (not sure about size, 8 bytes or something?)
Downloaded Ghost: FC EF BE 03 63 00 00 00 (permanent/never expire)

NAME
0x001C = Ghost name character set (00 = Japanese, 01 = English)
0x001D = Ghost name (terminator: 0x00 byte) (1/2 bytes per character) (20 (?) (0x14h) bytes max, not including the terminator)
Downloaded Monster ghosts take their name from the ROM based on their Appearance ID

RANKING
0x0034 = Ranking Points (16-bit)

STRATEGY PENTAGON
0x0036 = Sword (8-bit)
0x0037 = Shield (8-bit)
0x0038 = Thumbs (8-bit)
0x0039 = Die (8-bit)
0x003A = Hearts (8-bit)

APPEARANCE
0x0040 = Appearance ID (32-bit) (consists of multiple variables)
0x0042 = Hair color data (16-bit) (palette color (?))
0x0044 = Clothes color data (16-bit) (palette color (?))
0x0048 = Fixed Text (duel messages) (8-bits per message) (28 messages total)

DECK
0x0070 = Deck name character set (00 = Japanese, 01 = English) (8-bit)
0x0071 = Deck name (terminator: 0x00 byte) (1/2 bytes per character) (20 (0x14) bytes max, not including the terminator)
0x0086 = Key Card (16-bit)
0x008C = Amount of cards in Main Deck (32-bit??? at least 8-bit anyway)
0x0090 = Amount of cards in Side Deck (32-bit??? at least 8-bit anyway)
0x0094 = Amount of cards in Extra Deck (32-bit??? at least 8-bit anyway)
0x0098 = Main Deck (16-bits per card) (60 cards max)
0x0110 = Side Deck (16-bits per card) (15 cards max)
0x012E = Extra Deck (16-bits per card) (15 cards max)

UNKNOWN
0x014C and on = ?

CHECKSUM
Code:
Player data in the RAM
02124064 = Player name character set
02134065 = Player name

0212407A = Strategy pentagon

021240AC = Appearance ID
021240B0 = Hair color data
021240B2 = Clothes color data

021240B4 = Fixed text
 

Stuff7

Member
OP
Newcomer
Joined
Dec 3, 2010
Messages
7
Trophies
0
Age
34
Location
the Void
Website
www.youtube.com
XP
83
Country
United States
Aww man. Now I have to look at that gibberish up there. >.<
Thanks, man. All that stuff will come in handy. I do have some stuff from 00000000-00000093. That might be what makes saves different for each flash cart, though. Not entirely sure. Well. It looks like theres another FAT at 80...with I guess a checksum at 44B. And after the first replay, another little section spawned at 480 and it got bigger after the 2nd replay. And I guess a checksum at 664.

The "DLC Blocks Table (?)" looks like it has a....checksum at C64

Anyway, I'm using EZFlash Vi, and I was able to find those addresses you had for the tables. They're at the same locations. Looking at the first 4 bytes:

1st replay - 19 08 30 E0
deleted 1st replay - 1D 0C 50 E1
2nd replay(w/o deleting 1st one) - 2A 10 50 E1

And empty was the same as yours.


Anyway, You lost me at the second spoiler. I'm guessing that's for stored ghost data. Guess I'll dl something to see what your talking about there.
And then the 3rd spoiler, idk what to do with that. lol. The save only goes up to 0007FFFF.

Anyway, thanks Prof. 9. You made me find stuff I didn't think mattered. I really do appreciate it.
Guess it's time to learn a few new things. Dunno how I would find a checksum and CRC32 looked like y8(^&J5#. >.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: +1