Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: marlin1500 on December 22, 2013, 08:01:38 am

Title: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 22, 2013, 08:01:38 am
Hi I am looking for something similiar to the below for Phantasy Star 2, does anyone have any info on what offsets are used to control who can equip which piece of equipment in the game?  I am not talking about save state editing but using a hex editor to change the actual rom itself.
http://www.wrftpb.com/psiv/
Title: Re: Phantasy Star 2 Rom Hacking
Post by: tryphon on December 22, 2013, 11:12:38 am
You can find some PSII hacks here, maybe they documented it.

If you don't find what you're looking, I can do some research, but what do you want to do exactly ?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 23, 2013, 04:25:03 am
Thanks I've looked into the packs, I managed to hack PS4 easily with the data and hacks but I don't know where to start with PS2, basically I want to make the weaker characters stronger by increasing their weapon and armour options.  For some characters can use a normal knife but not a laser knife or dagger, it doesn't make sense.

I also want to change the damage values to make say the bowgun useful early on so Rudo isn't always using a shotgun.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: FAST6191 on December 23, 2013, 05:12:31 am
Not exactly what you want but some game genie codes will probably get you closer to where you want to be

http://www.romhacking.net/forum/index.php/topic,16454.0.html I do not know how far the OP got (it would probably be able to do what you want) but there was nice stuff along the way.
http://www.phantasy-star.net/psii/psiicode.html
http://codehut.gshi.org/PStar2GG.txt

Alternatively the stuff from Tony H (the last link) has some stuff on changing item stats, availability in shops and costs....
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 23, 2013, 05:40:55 am
Thanks but how will the genie codes help? They do not change the rom so I can I compare an original rom to one run with a code?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: FAST6191 on December 23, 2013, 06:08:13 am
I did not check at length but game genie codes do change the ROM -- you can quite easily hardpatch them or decode them.
http://gamehacking.org/wiki/Hacking_Genesis

If you want a hardpatch program then CCCGP from http://crackerscrap.com/index.php (click on projects).

(Pro) Action replay, codebreaker, GameShark... those typically fiddle with RAM but most game genie stuff is ROM patching code.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 23, 2013, 07:22:59 am
Thanks I found the offset for bowgun damage bu when I make a change to it the rom will not load in gens and just has a blank screen, from memory is this something to do with the checksum? If so which algorithm do I use?

December 23, 2013, 07:43:49 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Yes its the checksum error as I thought, how do you change it the FixCheckSum.exe does not correct it.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 23, 2013, 09:20:18 am
Using the master code will kill the checksum check.  You can find the master code here:

http://www.angelfire.com/games2/codehut/PStar2GG.txt

or here:

http://codehut.gshi.org/PStar2GG.txt
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 23, 2013, 08:40:36 pm
Thanks, I can't seem to get the weapon damage codes to work though, the code to make the shotgun one handed worked fine, but not weapon damage ones.  If anyone has a list of offest's I would be very much appreciative.

December 24, 2013, 01:31:48 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Right from Numan Revolution Hacked Rom
                     Column    00 01 02 03 04                                         05  06  07  08    09  0A                                             0B - 0F
 Sonic Gun 00013C20   ?    ?   ?   ?   1st Letter in weapon Name  3rd 5th 7th 9th  ?    A3=2 Handed / A2=1 Handed.  ??????

No idea where the even numbered letters are or anything else, the Shotgun is offset 00013C30 and is the same.  Anyone got any ideas?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Chippy2000 on December 24, 2013, 02:22:53 pm
Maybe the guns you mentioned are the same? Beta element discovered?

Thanks, I can't seem to get the weapon damage codes to work though, the code to make the shotgun one handed worked fine, but not weapon damage ones.  If anyone has a list of offest's I would be very much appreciative.

December 24, 2013, 01:31:48 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Right from Numan Revolution Hacked Rom
                     Column    00 01 02 03 04                                         05  06  07  08    09  0A                                             0B - 0F
 Sonic Gun 00013C20   ?    ?   ?   ?   1st Letter in weapon Name  3rd 5th 7th 9th  ?    A3=2 Handed / A2=1 Handed.  ??????

No idea where the even numbered letters are or anything else, the Shotgun is offset 00013C30 and is the same.  Anyone got any ideas?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 24, 2013, 03:49:24 pm
I've made a great deal more progress and found where the even numbers of weapons are found and the offset to change who can wield what, for example the stock hex numbers are FD for the knife & for 44 for the shotgun.  What  confuses me is that the attack value which is the next offest after one or 2 handed has no effect on the damage a weapon does.  This seems really bizarre unless the attack value is used when calculated a hit or miss.

Actually for melee weapons the attack value should calculate damage.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Chippy2000 on December 24, 2013, 04:03:02 pm
Maybe it DOES calculate a hit or miss. Why not Google it? Maybe an answer will surface from the depths of the INTERNETZ.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 24, 2013, 07:50:23 pm
Don't forget that there are 2 different versions of that ROM.  There is a regular version, and a "REV A" version.  I'm pretty sure I used the regular version to make all of the codes. 
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 26, 2013, 03:51:30 am
Thanks, the master code got rid of the checksum.  Found some more weapon data 2 handed guns double the hex attack value in game, I've found where weapon defence is as well, I still have no idea where the data for gun damage and multiple targets is.  I also have no idea what the offset immediately before 1/2 hands & users does they seem to be a whole bunch of random numbers that have no effect in game.

The 2 offsets above affect the price in shops of items, the offset value before attack value increases the price by 256 & the offset before users increases the price by 1.  The attack value for 2 handed melee weapons is also doubled in game from the hex value, unlike guns this directly affects damage, double the hex value and the weapon damage is doubled.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Chippy2000 on December 27, 2013, 04:41:23 pm
Well, google answers everything, and sure enough, you were all right.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 28, 2013, 02:50:42 am
No google involved this is all through my testing, I found the techniques now.

Does anyone know of a hexeditor that will allow me to search for and replace hex values within a given range? Every one I have found will only allow you to search/replace - up/down/all.  If I can replace the damage value for a gun as it is a know value ie. 0a for the shotgun I can narrow the search down until I find it. 
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Chippy2000 on December 28, 2013, 11:02:47 am
Maybe looking through the coding will help a little via looking for hexadecimals and all that jazz. Hex editors? Can't help you there since i don't use hex editors for ANYTHING. I prefer doing the 'ol switcheroo.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 28, 2013, 07:31:41 pm
Thanks, I can't seem to get the weapon damage codes to work though, the code to make the shotgun one handed worked fine, but not weapon damage ones.

Are you talking about the "Attack" codes? If I recall, those codes change the "Attack" stat (and some change the "Defense" stat as well).  Is there another stat for Damage?

December 28, 2013, 09:06:50 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I think I found the problem. If you enter one of the codes that makes your weapon stronger (higher "Attack" value) at the start of a new game, you will see the new, higher Attack value from the very beginning. If you enter one of the stronger weapon codes from a saved game (save state), the new "Attack" value may not show up until you enter battle. If you unequip the weapon, and then re-equip it, the new higher Attack value will show up immediately.

I entered my code that makes the Knife 10x stronger from a save state. My stats showed that I had 17 ATK (which is the normal amount you have when starting a new game). I went into battle and did massive damage with the knife (47 to 54 damage to the enemy).  Without the code, I did 6 damage to the enemies.

December 28, 2013, 09:10:16 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Forgot to mention... If I unequipped the knife and then re-equipped it, my ATK stat went from 17 to 62.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 29, 2013, 03:19:10 am
Yes thats what happens with melee weapons, guns have a different mechanic which I'm trying to work out where it belongs, see below a link to a page that has some damage formula's.  Its done the bottom.
http://www.rpgdl.com/forums/index.php?topic=224.0
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 29, 2013, 11:37:47 am
Give me some time to buy a bow gun, go into battle and make an asm trace log to find out where the stats are located in the ROM.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 29, 2013, 02:58:41 pm
Thank you that would be awesome.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 29, 2013, 03:05:40 pm
Finally figured out where the stats are in the ROM for gun damage.  Here's how the game is programmed for gun damage: It gets a value and adds 5C to it, then multiplies it by a value that changes depending on which gun you have (this is the stat we will be changing), then divides it by 64.  This final value is the amount of HP subtracted from the enemy.

Here are ROM addresses for the multiplier values for the Bow Gun, and the Sonic Gun.  I don't know where to buy a Shotgun, so don't have an address for that one yet (although it's address should be fairly close to the others).

Bow Gun multiplier: $0277E6 (normal value is 05)
Sonic Gun multiplier: $0277F2 (normal value is 07)

New Game Genie codes:

AF5T-EWHG
Makes the Bow Gun stronger (does more damage).

AF5T-E6HG
Makes the Bow Gun much stronger (does much more damage).

AF5T-E2HW
Makes the Sonic Gun stronger (does more damage).

AF5T-FEHW
Makes the Sonic Gun much stronger (does much more damage).


Also, made a new code that makes all gun attacks stronger...

1AYA-AAC2
All weapon attacks (guns, etc) inflict more damage.  Doesn't apply to melee weapons (knife, etc).  Can use with the stronger gun codes for even more damage.

RAYA-ACC2
All weapon attacks (guns, etc) inflict much more damage.  Doesn't apply to melee weapons (knife, etc). Can use with the stronger gun codes for even more damage.

I'll update/correct the codes on my site shortly.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 29, 2013, 08:32:26 pm
Thanks but the genie codes don't seem to work.  Just to clarify $0277F2 = 000277F0 (2)
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 29, 2013, 09:07:46 pm
Thanks but the genie codes don't seem to work.  Just to clarify $0277F2 = 000277F0 (2)

I just tested all of the Game Genie codes again, and they work fine. Keep in mind that I didn't go very high with the values (didn't want to make the game too easy). Here is an example of the increase of damage with the code that makes the Sonic Gun much stronger (AF5T-FEHW): Without the code I did 7 damage, with the code I did 18 damage.  When I used that code together with the "All weapon attacks" code (RAYA-ACC2), I think I did 56 damage.  I'm using the codes at the very beginning of the game.

If the codes don't work for you, you may have a different version of the ROM.  Make sure you are NOT using the "REV A" ROM. The CRC-32 checksum for the correct ROM is: 0D07D0EF.

Also keep in mind that the new codes don't change the ATK stat for your character.

December 29, 2013, 09:10:30 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
EDIT:
When you say  "Just to clarify $0277F2 = 000277F0 (2)", I'm not sure what you mean. If you go to ROM address $000277F2, the value there should be 07.  Changing that to a higher value will make the Sonic Gun stronger.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 30, 2013, 12:22:01 am
Any chance you have a link to the correct rom the one,as unfortunately the one I have has a checksum of B4146066.  I got it from here (REMOVED).

The one I downloaded was the US/PAL version.  You may just be able to send me the Hex block for the guns as they should be the same or very similar and I can find them in my version.

I just realised have been using the "Rev 2" rom but even with it stock the checksum is B4146066.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 30, 2013, 01:22:05 am
Here's how to find the right ROM address with your ROM:

Open up your ROM with a hex editor. Search for this hex string: 0501B6. There should only be 1 match. The "05" in that string is the value for the Bow Gun damage.

For the Sonic Gun, search for this hex string: 0701B6. There should only be 1 match. The "07" is the value for damage.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on December 30, 2013, 02:10:20 am
Thank you your awesome, my rom version has 07B6 I assume the middle hex value is number of hits, all the names and stats in the one I sent to you are in to parts.  See below an example.
Fire Ant(name) at  00017DD0(04 - 07) & 00015DD0(04 - 07).  I refer to the hex number of the line then have the columns in brackets which is why I was a big confused before.

Don't change the 01 in 0701B6 it causes the game to crash.  The shotgun is 0A02B6 so there must be another mechanic for number of shots and effects.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on December 30, 2013, 09:36:26 am
I found part of the problem with your ROM... it's in the wrong format. It's in the "smd" format, but should be in the "bin", "md" or "gen" format. That's why names and stats are in parts when you look at them with a hex editor. If the ROM is in bin format, everything will be much easier to see. You can either get a conversion program online to convert it from smd to bin, or you can use Google to find and download a ROM that's already in bin, md or gen format. There's a conversion program here: http://www.romhacking.net/utilities/383/

Just for future reference, you should never use ROMs in smd format.

December 30, 2013, 09:55:17 am - (Auto Merged - Double Posts are not allowed before 7 days.)
EDIT: Here are some new shotgun codes...

AK5T-FAH8
Makes the Shotgun stronger (does more damage).


AK5T-FRH8
Makes the Shotgun much stronger (does much more damage).
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on January 01, 2014, 04:57:54 am
Thanks made the changes I want, doubled all monster hp and made the guns viable.  Also Nei has slasher animations and Anna has a gun animation.  Amy only has pistol animations so I changed the shot weapons to be pistols, including the silent shot by given it a damage value and removing the sleep factor.  Hugh has normal gun animations.

Shir has the same animations as amy as well.  If you want make nei use slashers her weapon user code is 02, Anna's is 20 so add them together for 22 and Nei and Anna can use the same weapon.

January 02, 2014, 07:11:01 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Is anyone else interested in what I have found out of the PS2 rom? I am happy to share.

Nei also has knife animations if you want to give her knifes etc, I am playing numan revolution so the weapon purchase order is different.

Hey Tony could you work out where the slashers work so instead of only hitting a single group of one type of monster they hit every enemy like they do in PS4?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on January 09, 2014, 06:35:55 am
Again does anyone know how to make the group attack weapons like slashers attack 2 different monster types as per PS4?
Also does anyone know how to give max hp & tp at level up instead of random amounts?
Tony K can you have a go at working out how to determine what gives an item such as Storm gear a technique attached to it?
I have made a great deal of progress with the help of Tony K and others in determining the Offsets of PS2.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: tryphon on January 09, 2014, 06:54:20 am
I have made a great deal of progress with the help of Tony K and others in determining the Offsets of PS2.

I'm currently studying the ROM (partial dissassembly, using Ida), from another point of view (I work on dialogs, trying to bypass some size limitations, and events, trying to modify slightly the flow of the game in order to make a decent Nei resurrection ; doing this, I try too to include custom items).

You could spare me some time sharing these offsets. Would it be possible?

I have too some infos to share, it's likely I will find sooner or later how to add a technique to an item. I can have a look at how the TP and HP are computed.

January 09, 2014, 08:49:47 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I have found where the program computes the new max HP and max TP (and also all other stats).

The part of the routine is located from 0xF3A0 to 0xF3BC (in the same routine, all others stats are updated).

Basically, it looks for a value in a table (starting at 1619E, with offsets according to character), then compute a random multiplier between 0.5 and 1.5, and multiply the value by this multiplier. Then add it to the current stat.

Do you want to remove this random multiplier ? For all stats ?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: Tony H on January 11, 2014, 02:51:32 pm
Again does anyone know how to make the group attack weapons like slashers attack 2 different monster types as per PS4?
Also does anyone know how to give max hp & tp at level up instead of random amounts?
Tony K can you have a go at working out how to determine what gives an item such as Storm gear a technique attached to it?
I have made a great deal of progress with the help of Tony K and others in determining the Offsets of PS2.

I'd be more than happy to help, but here's the problem... I'm not familiar with PS2 at all. I've played it enough to make all the Game Genie codes, but that's it. I have no idea what you mean when you mention group attack weapons, or items having a technique attached to it. I enjoy finding this kind of stuff in the ROM, but getting familiar enough with PS2 to figure that stuff out would probably take lots of time.  Will let you know if I figure anything out.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on January 29, 2014, 03:55:20 am
Thanks Tony been flat out with work, I think I am close to working out where item special abilities are in the rom.  What I would like to know know is how to work out to give max hp and tp on level up as I have double or in some cases triple monster hp, in the stock game the hp and tp level up tables are modified by 0.5 or 1.5.

January 30, 2014, 08:04:17 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Now have double HP and TP granted per level, as you can set techniques to effect every enemy on the screen regards of type I should be able to do the same with weapons.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: tryphon on January 30, 2014, 04:50:42 pm
Not related to what you're doing, but related to the thread's title, I'm currently updating the Phantasy Star II page on the wiki (http://datacrystal.romhacking.net/wiki/Phantasy_Star_II), especially the Notes page (but there will be soon partial ROM and RAM maps). Feel free to contribute.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on January 31, 2014, 05:40:48 am
Awesome I will have heaps of stuff for you.

February 02, 2014, 06:31:48 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I'm currently studying the ROM (partial dissassembly, using Ida), from another point of view (I work on dialogs, trying to bypass some size limitations, and events, trying to modify slightly the flow of the game in order to make a decent Nei resurrection ; doing this, I try too to include custom items).

You could spare me some time sharing these offsets. Would it be possible?

I have too some infos to share, it's likely I will find sooner or later how to add a technique to an item. I can have a look at how the TP and HP are computed.

January 09, 2014, 08:49:47 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I have found where the program computes the new max HP and max TP (and also all other stats).

The part of the routine is located from 0xF3A0 to 0xF3BC (in the same routine, all others stats are updated).

Basically, it looks for a value in a table (starting at 1619E, with offsets according to character), then compute a random multiplier between 0.5 and 1.5, and multiply the value by this multiplier. Then add it to the current stat.

Do you want to remove this random multiplier ? For all stats ?

PM me your email and I will send you everything I have, not its all over the shop but just ask me if you can't work anything out.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on November 05, 2015, 05:03:48 am
Hi does anyone have a rom dump yet for PS2?
Title: Re: Phantasy Star 2 Rom Hacking
Post by: tryphon on November 05, 2015, 05:54:04 am
Lorenzo posted a complete disassembly of the game, fully recompilable. Check documents pages.
Title: Re: Phantasy Star 2 Rom Hacking
Post by: marlin1500 on November 05, 2015, 07:07:09 am
Thanks above my head, I'm only good at Hex editing, does anyone have a dump as per below for PS4?
http://www.wrftpb.com/psiv/

November 06, 2015, 07:29:50 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I am after where the techique affects are I have mapped out most of the rest of rom, let me know if anyone wants any help.

November 10, 2015, 08:41:14 am - (Auto Merged - Double Posts are not allowed before 7 days.)
If anyone is interested I just checked if you can use Neifirst as a normal monster and it appears you can, i am running the Numan Revolution mod, but I assume it works with the stock rom as well.  Her code is 7C, I only fought 1 of her with 3 pythons at once.  I'll test tomorrow if you can fight multiple "Neifirsts" at once, given her sprite I think 3 will be the max.  For a challenge I gave her 8000hp.

This should also mean you can fight Dark Force & Mother brain as normal monster to.

Link below to Neifirst & 2x Neithird.
http://postimg.org/image/8xpzgdfsx/

Works fine with no bugs.