Phantasy Star Disassemblies

Discuss anything related to the Phantasy Star series

Re: Phantasy Star Disassemblies

Postby BenoitRen » Sun Mar 08, 2015 9:37 am

Awesome! I tried hacking PSIII myself back in the day to alter the script, but was unable to isolate the text pointers so I could change them.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Re: Phantasy Star Disassemblies

Postby lorenzo » Sun Mar 08, 2015 12:08 pm

For the game script, as you'll see in the tutorial in the asm file, all text pointers are offsets relative to the GameScript start location. It's a bit less organized than PSII and most likely some other games, as all of these offsets are scattered around in the code. There are some text blocks which have no labels: these are unused dialogues so there's no instruction in the code that references them.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby lorenzo » Tue Mar 24, 2015 9:36 am

Hello!

The Phantasy Star II disassembly got an update: upon suggestion of ValleyBell, I took the comments and labels from his disassembly of the sound driver and included them in the full one. It should have enough comments and explanations to understand what it does, I think... In the "sound" folder I also included some files (still by ValleyBell) regarding info and notes. Besides, I replaced all the ID's for the Music and SFX with constants so it will be easier to see what sound is used.

I also replaced the incorrectly named "general_text_buffer" and "battle_text_buffer" with "script_id" and "battle_script_id" for the RAM addresses. The text buffer is now assigned to the correct address. Phantasy Star III also has the "text_buffer" constant that I put, but it's wrong as well; I renamed it to "script_offset" so replace it if you want to, otherwise you will see it in a future update.

Speaking of PSIII, I'm making some progress: I identified more RAM addresses, assigned more meaningful names to labels, found and cleaned up the data for the demo sequences, found the escape from battle logic... Well you get the picture, it's getting better.

I included a changelog section in the README file for Phantasy Star II, and PSIII will have one as well.

That's all for now.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby Tryphon » Wed Apr 01, 2015 6:12 pm

I had written some notes on datacrystal wiki, but I'm sure they are useless now.

Great work!
Tryphon
Scorpius
Scorpius
 
Posts: 357
Joined: Wed Mar 28, 2012 11:29 pm

Re: Phantasy Star Disassemblies

Postby lorenzo » Thu Apr 02, 2015 8:27 am

Thank you! I noticed that page long ago and it would be nice if it could be expanded. I'm not sure if I'll do that, but having a good, organized documentation would be cool, both for people who want to hack and those who are just curious.

Anyway I uploaded a small update (and got approved) for Phantasy Star III; most of the changes are hardware related, like VDP, Nemesis compression, etc, but I also renamed "text_buffer" to "script_offset", put more RAM constants and small explanation on how some demos are handled. By demos I mean the automatic input that happens, for example, at the wedding scene at the start of the game. Other things include some info about the escape rate, some technique TP costs (so it should be slightly easier to see how variables are handled in battle when they are used), and... well other things I can't think of at the moment.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby lorenzo » Sun Apr 26, 2015 9:00 pm

There's another update for Phantasy Star III: there's a new file called ps3.info where I wrote down the event flags and the ID's for the maps used in the game. I played through the game using a debugger to find out most of the values. If you're interested, you can use it as a reference to change things such as the game script by loading a different text depending on the point of the story you're at. Of course I discovered and put more comments regarding some more objects and stuff.

EDIT: Now I have a disassembly of the original Phantasy Star, however it's really basic meaning that most data and pointers are in raw form. Besides the disassembler couldn't distinguish most data from code and vice versa, but at least I can produce a copy of the original ROM. OP was updated accordingly.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby BenoitRen » Mon Apr 27, 2015 8:38 am

Would it be possible to extract the map data from the original Phantasy Star? I was planning to play through the game again to update this website's incomplete maps, but turning to the walls every step to make sure I'm not missing any secret corridors is tedious.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Re: Phantasy Star Disassemblies

Postby Tryphon » Mon Apr 27, 2015 9:16 am

I made a map dumper some time ago for Hugues Johnson. I dumped all the maps in tmx format, along with their tilesets. I'll upload that somewhere.

If you want a dump in png format, no problem too, just recall me that since I can forget easily :)

BTW, I did the same for Phantasy Star 2 and the PS2 remake, if you're interested.
Tryphon
Scorpius
Scorpius
 
Posts: 357
Joined: Wed Mar 28, 2012 11:29 pm

Re: Phantasy Star Disassemblies

Postby Tryphon » Mon Apr 27, 2015 9:19 am

Here it is!

You need tiled to see/edit the maps.
Tryphon
Scorpius
Scorpius
 
Posts: 357
Joined: Wed Mar 28, 2012 11:29 pm

Re: Phantasy Star Disassemblies

Postby lorenzo » Wed Jul 08, 2015 10:34 pm

Hello.

Hugues Johnson released a couple of updates for Aridia over the last 2 months; he included 2 features for editing enemy groups and NPC's in maps and they are more detailed than the data of my disassembly, so those who want more information you can check out his program.

As for me, I've been working on PSIV. It's huuuuge, but I'm almost done...relatively. I need to finish labelling raw pointers and offset tables, then I will need to do the sound driver. I will need to test this game by putting dummy data a bit everywhere. Of course this data will not affect the functionality or break the game, they are NOP instructions to see if the game works fine even with shifted data. Fortunately someone already identified a few things so I will include it in the disassembly before releasing it!
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby BenoitRen » Thu Jul 09, 2015 12:46 pm

Good work. :)

I recall reading that Phantasy Star IV used compression. Someone once figured it out a decade ago, but I don't think it was documented.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Re: Phantasy Star Disassemblies

Postby lorenzo » Thu Jul 09, 2015 5:13 pm

Thanks!

I found the Nemesis compression (which was common in many Megadrive games) and the Kosinski compression mainly used for most of the script. That means that text can't be edited as easily as PSII and III, I think. There could also be other less known compression routines or variants of the Nemesis and Kosinski ones... we'll see.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby lorenzo » Sun Jul 26, 2015 2:56 pm

Phantasy Star IV disassembly is on RHDN. Link is in the OP. There's quite bit of information that was already discovered by FreshFeeling; you can find it in the link below:

http://www.wrftpb.com/psiv/

I included the technical explanation of the data, meaning what each byte represents. You can read the additional comments he posted on that website. I converted some raw bytes to strings but there's not really much else at the moment... I will post updates as usual and let you know.

ValleyBell already took care of the sound driver so you can find labels and a few comments in that section for those who are interested.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby etony33 » Tue Jul 28, 2015 2:47 pm

lorenzo, I sent you a private message.
User avatar
etony33
King Rappy
King Rappy
 
Posts: 892
Joined: Sat Dec 28, 2013 9:21 pm

Re: Phantasy Star Disassemblies

Postby lorenzo » Sun Aug 02, 2015 9:38 am

I had to release an update (approved today) because of the SRAM addresses: basically both ROM and SRAM can read from address 0x200000, however there's a flag which determines whether to access one or the other. There's data of course at ROM location 0x200000 and pointers are used to access this. The problem is sections of code dealing with SRAM addresses were accessing that address using the labels, and those labels referred to the ROM data...very BAD! I had to track down and put the raw addresses for SRAM; hopefully all the references to ROM data should be gone in SRAM code section.

In the meantime I'm still converting raw bytes to strings; at least names of items, techs and such as well as shop dialogues and item descriptions are uncompressed so it's better than nothing. I still need to confirm if the main game script is compressed. The next update will include all the ID constants for enemies, items, etc as well as code section dealing with windows and data on how to expand/reduce them.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

PreviousNext

Return to Phantasy Star

Who is online

Users browsing this forum: No registered users and 2 guests

cron