News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Legend of Dragoon 64 consumable items Gameshark Code  (Read 3209 times)

Xifanie

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Legend of Dragoon 64 consumable items Gameshark Code
« on: December 13, 2016, 05:45:07 pm »
Have you ever felt really annoyed that the game only lets you carry 32 consumables at any point in time, especially considering that there are 10 unique, repeatable items in the game, only leaving you 22ish items for your needs? This hack will allow you to carry 64 of them:

80023308 0040
800231F8 0040
800233B8 0040
80023500 0040
80023234 0041
80023250 0041
80023324 003F
8002334C 003F
8002336C 0328
D010B0C8 0020
8010B0C8 0040
D010C3D4 0020
8010C3D4 0040

You should -not- need to start a new playthrough!

Since all the data in Legend of Dragoon seems to be decompressed on the fly and that I can't be bothered to make a proper patch for this game, I decided to just release the Gameshark Code for it.
Note that this hasn't been -extensively- tested, but I still doubt problems would arise from using it given my experience.

This hack was developed in pSX 1.13 (on Disc 1 and Disc 4).
I have tested this hack from Seles to the Black Castle without any issue.
I have only tested this hack (minus the development) in Cheat Engine because Retroarch's Mednafen core does not support Gameshark Codes yet.

I just figured I would post this here since I halted my playthrough because I got a little too absorbed into Skyrim. :(
I mean, I'm pretty sure the hack is working completely fine... the chance of conflict is pretty low, but still possible (at 0x8010B0C8 and 0x8010C3D4 respectively).

Known bugs:
- It will still only display ?/32 in your main menu when browsing your items (you will still be able to have 64/32 items).

Note: I've tried to make an automatic addition hack (regardless of the equipped accessory), but the memory location of the accessories' code changes with different battle formations. :/

MathOnNapkins

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 629
  • Who ya gonna call
    • View Profile
    • Arc-Nova - Rohmackin' and Chiptunin'
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #1 on: December 13, 2016, 11:03:52 pm »
Datacrystal peeps: Is this more suitable for the wiki instead?

NoOneee

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #2 on: December 14, 2016, 04:00:24 pm »
Since all the data in Legend of Dragoon seems to be decompressed on the fly and that I can't be bothered to make a proper patch for this game
Only some resources are compressed (but this includes all executable overlays).
I have made a compression/decompression utility for the resources with the BPE header(I had to do it because of the encounter rate bugfix), I just haven't polished it enough to be released. Aren't most those addresses (all except for 8010B0C8 and 8010C3D4) mapped to the main executable? If so, aren't they easily patchable? (edit: nevermind, I hadn't realized that the main executable is also compressed).

Edit: Also, aren't the extra items overwriting anything? Neither in the RAM or the memory card saves?

Edit again:Yep, I think all values except 8010B0C8 and 8010C3D4 are on the compressed main executable, and I could patch those. I haven't looked for the other two.
« Last Edit: December 14, 2016, 04:45:38 pm by NoOneee »

Xifanie

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #3 on: December 15, 2016, 01:21:46 am »
Yeah that's why I didn't use D codes for the first many GS Codes, because I knew those memory locations were on the main executable and that the last 2 were not.

And believe it or not, the data there seems totally unused. In fact, there seems to be 1 unused byte before the consumable items (between the equipment items and the consumable items) and 35 afterwards. Yes, I was a bitch and made it 64 when it could have been 67 (68 even, but because of how the game was coded that would wipe existing saves' consumables inventory). After those 35 bytes is some unknown variable, then the gold amount.

And all that seemingly unused data is written to the memory card saves.

Idunno, everything points to the theory that the game was programmed to handle 64 consumables, but then they decided to trim it down before release.

Edit: For reference, 0x8010B0C8 and 0x8010C3D4 affect shops. IIRC the file is loaded immediately completing a battle; it's probably the "field" file.
« Last Edit: December 15, 2016, 01:48:51 am by Xifanie »

NoOneee

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #4 on: December 15, 2016, 12:40:35 pm »
The other two values are from the aptly named overlay OVL\S_ITEM.OV_  ;)
I'll try to create a patch later but I think it won't be compatible with my existing bug fix because I've used xdelta...

Edit:
Fix the max item display in the menus (should now display xx/64):
D0102970 0020
80102970 0040
« Last Edit: December 15, 2016, 02:22:19 pm by NoOneee »

Xifanie

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #5 on: December 15, 2016, 12:50:14 pm »
Yeah, I hate PPF as it was made for PSX yet scans the ECC/EDC... and I can't get the other formats to not force a checksum verification...
I tried developing my own patched format for CD-Roms but I haven't touched that in several months (trying to make a living is more important right now).
Does the structure, after recompressing, change enough that it requires a format like XDelta?

NoOneee

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #6 on: December 15, 2016, 06:57:48 pm »
Yeah, I hate PPF as it was made for PSX yet scans the ECC/EDC... and I can't get the other formats to not force a checksum verification...
I tried developing my own patched format for CD-Roms but I haven't touched that in several months (trying to make a living is more important right now).
Does the structure, after recompressing, change enough that it requires a format like XDelta?
I've only changed the SMAP.OV_ file, which is compressed.

The compression works in blocks. Each block usually (but not always) decompresses to 0x800 bytes. I've added new code in a previously zerofilled area in the very first block, so now the compressed size of that block is a bit bigger even though the decompressed size is the same.
That ended up moving forward all the other blocks. A PPF patch would basically contain the entire file + ECC/EDC.

We are changing different files so maybe we could provide patches to the files themselves... This utility can replace files in the disc images(PSX-MODE2 http://www.romhacking.net/utilities/848/), but I don't know if there's any command line utility to extract them.

Xifanie

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #7 on: December 15, 2016, 10:48:42 pm »
Damn, yeah, no matter what we won't be able to easily make a patch compatible with yours...
Mods which, btw, I have looked at today, and left me baffled; I thought no one ever hacked this game, especially given the compression.
I looked into making an undub right before this hack, and gave up because the compression. Your mod only reverts the battle voices, but we can literally export/import the STR files for the rest.  :happy: (the lack of subtitles still sucks, but the dub is just so bad...)

In fact, all your mods look awesome. I'll patch them all before I resume my playthrough. Thank you so much for those.  :thumbsup:

STARWIN

  • Sr. Member
  • ****
  • Posts: 445
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #8 on: December 16, 2016, 12:00:10 pm »
We are changing different files so maybe we could provide patches to the files themselves... This utility can replace files in the disc images(PSX-MODE2 http://www.romhacking.net/utilities/848/), but I don't know if there's any command line utility to extract them.

http://web.archive.org/web/20130504220128/http://www.neillcorlett.com/cmdpack

cdpatch -x imagename filename

NoOneee

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #9 on: December 16, 2016, 03:07:04 pm »
Damn, yeah, no matter what we won't be able to easily make a patch compatible with yours...
Mods which, btw, I have looked at today, and left me baffled; I thought no one ever hacked this game, especially given the compression.
I looked into making an undub right before this hack, and gave up because the compression. Your mod only reverts the battle voices, but we can literally export/import the STR files for the rest.  :happy: (the lack of subtitles still sucks, but the dub is just so bad...)

In fact, all your mods look awesome. I'll patch them all before I resume my playthrough. Thank you so much for those.  :thumbsup:

You're welcome. Thank you for your item capacity hack too!

To be fair I actually didn't do that much regarding the compression. I did not code everything from scratch. I simply realized that the compression algorithm is very similar to the reference BPE code (https://web-beta.archive.org/web/20160807201159/http://www.csse.monash.edu.au/cluster/RJK/Compress/bpe.c) and worked it out the differences.

Yeah, the STR and XA files can be simply replaced, but that can't be easily done when the Japanese version is bigger than the American. That happens with one of the XA file. I don't remember whether it happens with the STR.

http://web.archive.org/web/20130504220128/http://www.neillcorlett.com/cmdpack

cdpatch -x imagename filename
Well, time to update my patches. Thank you for finding this.
« Last Edit: December 16, 2016, 03:12:54 pm by NoOneee »

Digitsie

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
Re: Legend of Dragoon 64 consumable items Gameshark Code
« Reply #10 on: December 16, 2016, 03:33:11 pm »
If you ever figure out how to add subtitles to the undub, it would be very, very much appreciated, as  well as a comprehensive patch for all those.