Phantasy Star Disassemblies

Discuss anything related to the Phantasy Star series

Re: Phantasy Star Disassemblies

Postby Zucca » Mon Nov 06, 2017 1:38 pm

lorenzo wrote:Btw @Zucca, did you manage to run the assembler on Linux?

I haven't had time yet. I needed to set up complex logging and backupping system here. But it's done now.

I still have the terminal open where I did the git pull. I'll prepare some coffee and then try it out. :handgestures-thumbupright:
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby Zucca » Mon Nov 06, 2017 2:02 pm

Code: Select all
$ cc -o ps2p2bin{,.c}
ps2p2bin.c: In function ‘buildRom’:
ps2p2bin.c:193:11: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Wformat=]
    printf("\nERROR: negative start address ($%X).", start), start = 0;
           ^


I guess I need to ignore the warnings...

EDIT: Had to refresh my memory. It was '-w' that disables the warnings.
Does the executable take in patch files? O.o
Code: Select all
usage: ps2p2bin.exe inputcodefile.p outputromfile.bin sharefile.h

Also I have no clue what to give as 'sharefile.h'. To me .h means header file.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby lorenzo » Mon Nov 06, 2017 3:42 pm

Most of the work on those files was done by other guys, and since I don't use Linux, I can't help much. Try downloading the Sonic disassemblies.....It's how I got started and they seem to have packages ready for Linux, maybe you use those as reference. Here's the link

http://info.sonicretro.org/Disassemblies

There are tons of links there, but focus on just Sonic 1, 2 and 3.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby etony33 » Mon Nov 06, 2017 5:13 pm

I wish I understood most of this. Maybe I should take a course on computer programming.
User avatar
etony33
King Rappy
King Rappy
 
Posts: 892
Joined: Sat Dec 28, 2013 9:21 pm

Re: Phantasy Star Disassemblies

Postby Zucca » Mon Nov 06, 2017 6:51 pm

Got it!
I need to have macroassembler AS.
Luckily one is to be found from the repositories of my Linux distro, so I can compile it. Yay. This is progress.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby Zucca » Mon Nov 06, 2017 7:33 pm

I'll convert bulld.bat to linux shell script. Then when it's working and well tested, I'll submit it to you, lorenzo (via github).
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby lorenzo » Tue Nov 07, 2017 9:03 am

Cool, thanks!
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby Zucca » Tue Nov 07, 2017 9:31 pm

I think I need to create a little more complex build script, since ps2.asm contains all the bincludes in windows pathname format where \ is the path component separator while on *NIX operating systems it's /.
I'm thinking of just live patching the code whenever the script is run. This way the code is still windows compatible.

Or does anyone know if windows can support / too as well as \?

EDIT02: The compilation was succesful. But I don't have the "fixheader" executable. So I'm trying to figure out what it does and how to do it on Linux.
EDIT02: My wild guess would be that the fixheader adds the signature to the rom file so that if you run the game on actual Genesis, it passes the ROM check and runs the code. At least on MESS the game is now running fine. Hey... First time compiling code for Genesis.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby Zucca » Wed Nov 08, 2017 11:20 pm

@lorenzo: There you go.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby lorenzo » Thu Nov 09, 2017 9:08 am

Thank you so much! Really appreciate it! I merged your changes.

Is it easy to port the build.sh file to ps3 and ps4 as well? I assume all I need to do is change all instances of ps2 with ps3/ps4, but I wanna ask just in case.
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby Zucca » Thu Nov 09, 2017 9:48 am

lorenzo wrote:Thank you so much! Really appreciate it! I merged your changes.
You're welcome. I've been enjoying using it already.

lorenzo wrote:Is it easy to port the build.sh file to ps3 and ps4 as well? I assume all I need to do is change all instances of ps2 with ps3/ps4, but I wanna ask just in case.

There's no porting needed! :dance:
The script assumes only few things:
  • The source for p2bin must reside in the same directory tree as the main asm. It automatically searches for '*p2bin.c' and compiles it into the project root directory.
  • User can specify their own p2bin executable using --p2bin switch (undocumented atm). But by default the script looks prebuilt binary from the same directory as the main asm.
  • It assumes p2bin command line syntax does not change. This means if other prject have their *p2bin.c modified and the use of it differs, the script might not be able to combine the resulting files from assembly compilation.
  • Dependencies must be installed of course. ;)
With that said... I'm gonna try it out with other games too. PSIII should work at least.

If the script works it might be better off to have it as an seperate project since users really can place the script anywhere. The real problem I see is the changes to *p2bin.c. If the source is the same for all the projects, then there's no problem.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby lorenzo » Thu Nov 09, 2017 2:51 pm

Ok, so if I copy the linux_build folder in the ps3 and ps4 project folders, no changes are needed right? That's neat.

Before I do that, I'll wait until you finish your testing
lorenzo
Blastoid
Blastoid
 
Posts: 92
Joined: Thu Dec 25, 2014 12:57 am
Location: Italy

Re: Phantasy Star Disassemblies

Postby Zucca » Thu Nov 09, 2017 4:03 pm

lorenzo wrote:Ok, so if I copy the linux_build folder in the ps3 and ps4 project folders, no changes are needed right? That's neat.
Exactly, but the user could have build.sh anywhere.
I may create a seperate project for the build script, that I then sync with the disassembly projects. After testing, I'd do the regular pull request to your projects.

lorenzo wrote:Before I do that, I'll wait until you finish your testing.
I'll try out the other games as well.

I'll plan to add binary patch creation support for the script as well. Meaning that it could then produce patches for say romhacking.net for example with a single command that first compiles the asm and then automatically creates the patch.

BTW... What's the preferred binary patch file format? I read that people use some Lunar patches or something like that...
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby Zucca » Thu Nov 09, 2017 5:07 pm

Code: Select all
zucca@wren ~/psbuild/mdps-asm-builder $ ./build.sh ../ps3disasm/ps3.asm /tmp/ps3.bin
Path patch applied...
Source compiled...
p2bin compiled...
Succesfully created '/tmp/ps3.bin'.

Code: Select all
zucca@wren ~/psbuild/mdps-asm-builder $ ./build.sh ../ps4disasm/ps4.asm /tmp/ps4.bin
Path patch applied...
Source compiled...
p2bin compiled...
Succesfully created '/tmp/ps4.bin'.
:geek:

And they both run on MESS emulator. :dance:

Next up I'll start to search if there's a source or program equivalent for fixheader.exe for Linux.

EDIT: @lorenzo - You have three more pull requests waiting. The porting went as I thought - basically just copying the script. Although you'd only need one. :P This is why I created the "main repo" for the script too.
I am NaN!
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1916
Joined: Sun Sep 23, 2007 7:06 pm
Location: Rasi, Kouvola, Finland

Re: Phantasy Star Disassemblies

Postby lorenzo » Fri Nov 10, 2017 9:17 am

Zucca wrote:BTW... What's the preferred binary patch file format? I read that people use some Lunar patches or something like that...


As far as I know the .ips format is the most popular.


I will check and merge the changes you sent. Thanks again!
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 9 guests

cron