Decompiling Lunar 2 for PS1
- Erroneous
- Legendary Hero
- Posts: 1205
- jedwabna poszewka na poduszkę 70x80
- Joined: Mon Jan 13, 2003 3:08 am
- Location: Washington, USA
- Contact:
Decompiling Lunar 2 for PS1
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
https://twitter.com/ZackmonX/status/1502904361709707273
There's a GitHub repository in development now.
https://github.com/Zackmon/lunar2-psx-decomp
---
LunarNET Discord: https://discord.gg/yzXgsSa
LunarNET Discord: https://discord.gg/yzXgsSa
- ShugoHanasaki
- Black Dragon Wizard
- Posts: 428
- Joined: Fri Jul 07, 2017 4:53 am
- Location: Lavender Falls
- Contact:
Re: Decompiling Lunar 2 for PS1
Pardon my ignorance... What does de-compiling a game mean?
Lotus Moon Productions
- Podcasts on Independent Music Artists & Wrestling -
https://soundcloud.com/lotusmoonproductions
- Podcasts on Independent Music Artists & Wrestling -
https://soundcloud.com/lotusmoonproductions
Re: Decompiling Lunar 2 for PS1
It means that they’re attempting to take the game binary and generate equivalent code in a high level language (C in this case).
- ShugoHanasaki
- Black Dragon Wizard
- Posts: 428
- Joined: Fri Jul 07, 2017 4:53 am
- Location: Lavender Falls
- Contact:
Re: Decompiling Lunar 2 for PS1
Ah! Gotcha. Neat!
Lotus Moon Productions
- Podcasts on Independent Music Artists & Wrestling -
https://soundcloud.com/lotusmoonproductions
- Podcasts on Independent Music Artists & Wrestling -
https://soundcloud.com/lotusmoonproductions
- MagicEmperor
- Student of Vane
- Posts: 86
- Joined: Thu Nov 03, 2005 2:23 am
- Location: Beyond this World
- Contact:
Re: Decompiling Lunar 2 for PS1
So de-compiling it does what make the graphics better? game play ? please explain if you can.
Re: Decompiling Lunar 2 for PS1
makes it awesome and open source
Darkness beyond twilight
Crimson beyond blood that flows
Buried in the stream of time is where your power grows
I pledge myself to conquer all the foes who stand
before the mighty gift bestowed in my unworthy hand
Let the fools who stand before me be destroyed
by the power you and I possess...
DRAGON SLAVE!
Crimson beyond blood that flows
Buried in the stream of time is where your power grows
I pledge myself to conquer all the foes who stand
before the mighty gift bestowed in my unworthy hand
Let the fools who stand before me be destroyed
by the power you and I possess...
DRAGON SLAVE!
- Sonic#
- Pao Tribe Chieftain
- Posts: 4653
- Joined: Thu Dec 26, 2002 3:27 am
- Location: Here, there, everywhere
- Contact:
Re: Decompiling Lunar 2 for PS1
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").
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").
Sonic#
"Than seyde Merlion, "Whethir lyke ye bettir the swerde othir the scawberde?" "I lyke bettir the swerde," seyde Arthure. "Ye ar the more unwyse, for the scawberde ys worth ten of the swerde; for whyles ye have the scawberde uppon you, ye shall lose no blood, be ye never so sore wounded. Therefore kepe well the scawberde allweyes with you." --- Le Morte Darthur, Sir Thomas Malory
"Just as you touch the energy of every life form you meet, so, too, will will their energy strengthen you. Fail to live up to your potential, and you will never win. " --- The Old Man at the End of Time
"Than seyde Merlion, "Whethir lyke ye bettir the swerde othir the scawberde?" "I lyke bettir the swerde," seyde Arthure. "Ye ar the more unwyse, for the scawberde ys worth ten of the swerde; for whyles ye have the scawberde uppon you, ye shall lose no blood, be ye never so sore wounded. Therefore kepe well the scawberde allweyes with you." --- Le Morte Darthur, Sir Thomas Malory
"Just as you touch the energy of every life form you meet, so, too, will will their energy strengthen you. Fail to live up to your potential, and you will never win. " --- The Old Man at the End of Time
- Kizyr
- Keeper of Knowledge (probationary)
- Posts: 8288
- Joined: Wed Dec 25, 2002 7:36 am
- Location: Marius Zone
- Contact:
Re: Decompiling Lunar 2 for PS1
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.
Which means we should finally be able to find the Dark Scimitar for real this time.
~Kizyr


Re: Decompiling Lunar 2 for PS1
Disassembling the MCD/SCD release would be a whole 'nother ballgame.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.
Re: Decompiling Lunar 2 for PS1
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.
- Kizyr
- Keeper of Knowledge (probationary)
- Posts: 8288
- Joined: Wed Dec 25, 2002 7:36 am
- Location: Marius Zone
- Contact:
Re: Decompiling Lunar 2 for PS1
I... I actually didn't expect it to be anywhere in the game data for the Saturn/PS1 versions. Color me surprised!Mr_conan wrote: ↑Mon Feb 06, 2023 4:50 pmI 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.
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.
~Kizyr


Re: Decompiling Lunar 2 for PS1
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
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?




Last edited by Mr_conan on Thu Feb 16, 2023 3:24 pm, edited 2 times in total.
Re: Decompiling Lunar 2 for PS1
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:

Gameshark with Equip Code Only:

RAM Modified for max stat values:

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:

Gameshark with Equip Code Only:

RAM Modified for max stat values:

- Alunissage
- Goddess
- Posts: 7316
- Joined: Thu Dec 26, 2002 10:31 am
Re: Decompiling Lunar 2 for PS1
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.
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
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.
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.
- Attachments
-
- L2EB_US+Demo_Common_Text_v2.zip
- (18.35 KiB) Downloaded 18 times
Re: Decompiling Lunar 2 for PS1
And heres the demo script dump, enjoy. Appears to be a much earlier full version of the script with more cursing.
- Attachments
-
- demo_us_psx_scripts.7z
- (544.31 KiB) Downloaded 17 times
Who is online
Users browsing this forum: No registered users and 14 guests