Page 1 of 1

Decompiling Lunar 2 for PS1

Posted: Mon Apr 04, 2022 7:39 am
by Erroneous
Been watching this new twitter thread of someone who is decompiling Lunar 2 Eternal Blue for the PS1.

https://twitter.com/ZackmonX/status/1502904361709707273

There's a GitHub repository in development now.

https://github.com/Zackmon/lunar2-psx-decomp

Re: Decompiling Lunar 2 for PS1

Posted: Thu Apr 14, 2022 5:23 pm
by ShugoHanasaki
Pardon my ignorance... What does de-compiling a game mean?

Re: Decompiling Lunar 2 for PS1

Posted: Mon Apr 18, 2022 12:26 pm
by Mr_conan
It means that they’re attempting to take the game binary and generate equivalent code in a high level language (C in this case).

Re: Decompiling Lunar 2 for PS1

Posted: Tue Apr 19, 2022 5:15 am
by ShugoHanasaki
Ah! Gotcha. Neat!

Re: Decompiling Lunar 2 for PS1

Posted: Sun Jan 01, 2023 11:23 pm
by MagicEmperor
So de-compiling it does what make the graphics better? game play ? please explain if you can.

Re: Decompiling Lunar 2 for PS1

Posted: Tue Jan 03, 2023 4:48 am
by kazuya
makes it awesome and open source

Re: Decompiling Lunar 2 for PS1

Posted: Tue Jan 03, 2023 4:46 pm
by Sonic#
A layman's explanation - when someone is making a program, they usually use a higher-level coding language, tools made for programmers to use to build that program. They do that because the actual instructions machines use (commands that directly tell the CPU what to do) are so tedious to do manually; these tools automate more complex tasks in a more accessible way.

When programming in that coding language is finished, the program is then compiled back into the instructions machines actually use. In other words, a compiler takes the complex code and rewrites it as machine instructions that tell the CPU what to do. Games are released in these forms.

Decompiling a game is a difficult process. Compilers are only made to work one way, and there could be many ways to write valid higher-level code that executes the same machine instructions. Frequently a decompiler will generate goofy code that doesn't correspond to the original programming but would bring about the same result.

So decompiling efforts are reconstructions that try to figure out how the original game worked prior to compiling. That can provide lots of insights into how the game and its mechanics work and makes the game easily modifiable ("open source").

Re: Decompiling Lunar 2 for PS1

Posted: Thu Jan 12, 2023 12:26 am
by Kizyr
Another thing decompiling can do is make it a lot clearer things that were originally removed, hidden, or otherwise obscured in the game. Certain stat behavior, character/enemy behavior, items or spells, etc..

Which means we should finally be able to find the Dark Scimitar for real this time.

Re: Decompiling Lunar 2 for PS1

Posted: Thu Jan 12, 2023 11:11 pm
by DevNall
Kizyr wrote: Thu Jan 12, 2023 12:26 am Another thing decompiling can do is make it a lot clearer things that were originally removed, hidden, or otherwise obscured in the game. Certain stat behavior, character/enemy behavior, items or spells, etc..

Which means we should finally be able to find the Dark Scimitar for real this time.
Disassembling the MCD/SCD release would be a whole 'nother ballgame.

Re: Decompiling Lunar 2 for PS1

Posted: Mon Feb 06, 2023 4:50 pm
by Mr_conan
Kizyr wrote: Thu Jan 12, 2023 12:26 am Which means we should finally be able to find the Dark Scimitar for real this time.
I can tell you its Item #90 (0x5A)

I've located the file containing chest information on Saturn (of course it wont be found there though since thats a jp release), haven't tried to figure out the equivalent file on PSX yet. Its not present in any of the PSX dialog scripts.

Re: Decompiling Lunar 2 for PS1

Posted: Tue Feb 07, 2023 12:29 am
by Kizyr
Mr_conan wrote: Mon Feb 06, 2023 4:50 pm
Kizyr wrote: Thu Jan 12, 2023 12:26 am Which means we should finally be able to find the Dark Scimitar for real this time.
I can tell you its Item #90 (0x5A)

I've located the file containing chest information on Saturn (of course it wont be found there though since thats a jp release), haven't tried to figure out the equivalent file on PSX yet. Its not present in any of the PSX dialog scripts.
I... I actually didn't expect it to be anywhere in the game data for the Saturn/PS1 versions. Color me surprised!

Any stat information on it? In Sega CD it was just an MP drain for critical hits and sometimes cast a spell that froze time... forcing you to reset the game.

Re: Decompiling Lunar 2 for PS1

Posted: Wed Feb 08, 2023 10:18 pm
by Mr_conan
Ive only decoded the in-game item list on psx so far in order to import it into the saturn, since the order is identical. The saturn just has more empty slots. At some point i should try using the debugger to give it from a chest and see if it actually works. SSS had a bunch of test items that would crash the game, this could be a similar case, or it might just work

Re: Decompiling Lunar 2 for PS1

Posted: Wed Feb 15, 2023 4:04 am
by Mr_conan
Played around with the debugger a bit and i have it in my inventory now. It doesnt seem to be equipable by Hiro. Not sure which character might be able to use it or if its disabled?

Image
Image

Re: Decompiling Lunar 2 for PS1

Posted: Thu Feb 16, 2023 3:07 am
by Mr_conan
I went in and manually entered in the gameshark RAM modifications from the other thread and they work to equip and use the item.
Then i played around in RAM to see what was going on... It looks like the default stat parameters have the scimitar set up to be no different than an unarmed character. So yeah, big let-down.
The gameshark codes modify the stats value to be better. Changing several of them from 0x002C to 0x0FFF gives stats of 999.

Gameshark Codes:
Image

Gameshark with Equip Code Only:
Image

RAM Modified for max stat values:
Image

Re: Decompiling Lunar 2 for PS1

Posted: Fri Feb 24, 2023 9:45 pm
by Alunissage
So, the EBC demo had some joke stuff in it that wasn't accessible while playing the demo normally -- the pajamas were called Bernie's Pajamas after Bernie Stolar, for one -- that one of the WD messageboard members found with a GameShark and similar. I would guess that the Dark Scimitar was also put in as a joke, and maybe WD considered trying to make it an actual findable item in the full game before deciding to just have Bromide X (picture of Borgan holding the Dark Scimitar) instead.

It would probably be fun to poke around the demo data for other stuff like that. The pajamas are the only thing I remember besides there being a message left by a WD programmer that led to his departure from the company. Gah, this was a long time ago.

Re: Decompiling Lunar 2 for PS1

Posted: Mon Feb 27, 2023 3:03 am
by Mr_conan
Well, the item text definitely has a lot of differences between the demo and the final version. Anyone who's curious can take a look at the attachment. I'll have to sift through the dialog text next. (Updated to fix an output bug).

Sadly, no Bernie’s Pajamas or Dark Scimitar. Maybe the PJ reference is in the dialog text, or maybe the Gameshark code was designed to modify the item name as a joke.

Re: Decompiling Lunar 2 for PS1

Posted: Tue Feb 28, 2023 4:17 am
by Mr_conan
And heres the demo script dump, enjoy. Appears to be a much earlier full version of the script with more cursing.