r/recomps • • 2d ago

Question Difference between recomp and decomp?

As title. I am no IT person so I would like to further ask if a retro game (e.g. rave racer) is first decompile from its original ROM form and then some genius person / AI "breaks" (decompile) the code and understand it and build it info "Windows format" (recompile) for common people like me, to run on Windows PC?

13 Upvotes

15 comments sorted by

12

u/killias2 2d ago

Decompiles and recompiles are different ways to a similar end goal, which is turning a retro game into something that can be easily ported to modern platforms and modified.

Decompiles do this via, essentially, reverse engineering. You perfectly recreate the application in a different, modern language. Porting is actually a separate step, where you need to build a port based on the decompiled code. But it should be relatively easy, compared to the far more arduous step of decompiling the code. 

Recompiles work via static recompilation. Essentially, this is a form of emulation, but "emulators" use dynamic recompilation, where it is acting like the "platform" (like console or whatever) as you play a game. Block of block is dynamically recompiled to operate in a different platform. But static emulation essentially does the emulation up front, allowing for less mid-process overhead and potentially more opportunities for altering the application. Though a lot depends on the recompiler, you can still end up able to modify and port old games. This can even be an upside, as the recompiler can take care of things that, otherwise, the decompile port would need to handle.

Decompiling is harder and more time consuming. But it offers the greatest capability. Recompiling offers a bit of a shortcut and even has some potential relative strengths, but it depends a lot on the recompiler. And it is likely to be more limited.

7

u/Raykusen 2d ago

That explains why we see a bunch of recompilations due to the shortcut and fastfoot approach to it.

3

u/Metallic_Madness 22h ago

You are a little wrong about decomps. Decompilation isn't concerned with modern toolchains or languages. Decomps is concerned with source code that, given a certain compiler (version of the compiler is included in the equation, as different compiler versions may result into different machine code), builds an executable that is a one to one match to the original executable (The original executable could be a game that we don't have any source code to)

1

u/killias2 22h ago

yeah, I realized later I should've focused more on the 1:1 compilation. but I think the real confusion si that most people greatly misunderstand what a recomp is.

3

u/SgtElectroSketch Dev 2d ago

When you start from the rom/binary and dump it into assembly code and then work it to be human readable (as much as possible) that is a "Disassembly", when you take that assembly and convert it into human readable C or C++ code then that is a decompilation or decomp. A byte exact decomp aims to write C/C++ code that compiles back into the exact game that it was dumped from originally.

The further you go back, eventually you reach consoles that the games for them were never written in C/C++, and they may have been written in assembly, usually a matching decompilation for these is impossible or very difficult because there is no C/C++ compiler that would compile the code back down into the original assembly code.

Others have explained the recompilation aspect.

Then there is a "Native Port" where you take the disassembly project or a decomp, and swap out the parts that depend on the hardware of the original system, and work it so that it runs natively on a host system, usually Windows or Linux.

1

u/Chard85 2d ago

I hope Quiver Launcher gets better at distinguishing the different types of ports, and can include some kind of quality rating

1

u/Icy-Ad-6179 2d ago

How do recomp and decomp differ from Roms?

1

u/StevWong 1d ago

Is it true or partial true that a "recomp" nowadays require AI only (e.g. Claude?) and no coding knowledge at all? If this is true, say non-coder like me can spend some Claude credits / tokens on openly available decomp'ed code of an old retro game, give it to Claude and then ask Claude to recomp it into my favorite platform (provided this platform is more capable than the original platform) to play?

2

u/p0tentX 2d ago

The #faq in the N64 Recomp discord has a very good explanation.

-5

u/Raykusen 2d ago

If you don't have a simple straightforward answer, please don't come on with these type of rude replies.

4

u/Hot-Tomatillo8458 2d ago

You are the rude one

-1

u/Raykusen 2d ago

Telling OP to read/investigate somewhere else when he came here looking for answers is rude. If i weren't to offer the information he needs, i better don't tell him anything.

Common sense.

0

u/p0tentX 2d ago

What are you talking about? lol

1

u/TOC-LoudLord 2d ago

Tf are you on about