[HN Gopher] A decompilation and port of Sonic Advance 2-a GameBo...
       ___________________________________________________________________
        
       A decompilation and port of Sonic Advance 2-a GameBoy Advance game
       written in C
        
       Author : bane
       Score  : 172 points
       Date   : 2025-03-28 02:21 UTC (20 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | Gamemaster1379 wrote:
       | I love projects like these. Between decomps and static analyzers,
       | we've seen so many fantastic games modernized and ported.
       | 
       | Ocarina of Time is able to play natively on just about every
       | system system imagineable (pretty sure native PS1 builds exist)
       | Sonic Unleashed, previously an 360/PS3 exclusive, now can be
       | played in ultra wide on PC natively.
       | 
       | Majoras Mask got a recent static deanalyzed PC port and has
       | higher FOS and ultrawide mods.
       | 
       | Perfect Dark for the N64 has a native PC port with ultrawide and
       | mouse and keyboard controls.
       | 
       | These are just a few off the top of my head.
        
         | saturn8601 wrote:
         | >Ocarina of Time is able to play natively on just about every
         | system system imagineable (pretty sure native PS1 builds exist)
         | 
         | You got me curious so I googled it, are you confusing it with a
         | port for the _Playstation Classic_? Thats a modern console that
         | uses a Android phone chip and emulates the PS1. I couldn 't
         | find any references to the original PS1 and I don't think any
         | amount of wizard coding could get that game to run on such a
         | resource constrained hardware. There is so much of that game
         | that was only possible on N64 level hardware or better.
        
           | cubefox wrote:
           | It would probably be possible to rewrite the whole game to
           | fit the hardware, change assets etc. Obviously that would be
           | a major effort and not as simple as running it on a modern
           | PC.
        
             | saturn8601 wrote:
             | I don't think the PSX has enough ram to allow large open
             | world and near instant movement from one open world to
             | another. Yes there were things like streaming in textures
             | like Spyro did but if you watch footage of Zelda 64 in the
             | big open worlds I just can't see it being done that way on
             | the PSX. Even spyro had long load times between worlds.
             | There was a lot of innovation on the PSX in terms of genres
             | but little to no major open world games.
        
           | doublerabbit wrote:
           | I think OP may of got titles confused.
           | 
           | Majora's Mask has been dissembled and then recompiled to
           | native. They are currently working on Oceania of Time.
           | 
           | https://github.com/Zelda64Recomp/Zelda64Recomp
           | 
           | Shame I've never been a fan of Zelda.
        
             | ThatPlayer wrote:
             | Recompile and decompile are also different things. The goal
             | of a recompile is a working binary for another platform
             | (x86), while the goal of a decompile is source code.
             | 
             | https://github.com/Zelda64Recomp/Zelda64Recomp?tab=readme-
             | ov...
             | 
             | https://github.com/zeldaret/oot is the seperate Ocarina of
             | Time decompile project, and I believe is what the
             | Playstation Classic port uses. They're also working on a
             | Majora's Mask decompile, but it is incomplete. Probably why
             | the recompile targeted that game first.
        
           | dgrabla wrote:
           | https://www.shipofharkinian.com/
        
       | rossy wrote:
       | Man, I'm really keen for this. The GBA Sonic games are often
       | slept on but I think they were amazing at recreating the feel of
       | the original Mega Drive games, with great music and sprite work
       | too. I've long thought they deserved a modern PC port in the
       | style of Sonic 1 Forever or Sonic Origins, to free them from the
       | cramped GBA screen.
       | 
       | Sonic fans have been making a lot of these unofficial, enhanced,
       | moddable PC ports using decompilation, recompilation and
       | emulation techniques, including Sonic 1 Forever, Sonic 3 A.I.R.
       | and recently, the Sonic Unleashed PC port. PC (including Linux)
       | is getting to be the definitive platform for playing a lot of
       | these older Sonic games, which is great to see.
        
         | ac2u wrote:
         | Agreed, when Sonic Mania came along I often heard "the first 2D
         | Sonic game since 3+K" and thought that people were forgetting
         | the advance series. You could tell they were crafted by a team
         | that respected the feel of the games that came before and
         | understood that Sonic was a solid platformer with speed as a
         | reward gameplay mechanic. Not to mention it had a colour
         | palette that never confused the main character from the
         | background, something I think mania gets wrong from time to
         | time.
        
       | starkparker wrote:
       | Why distribute copyrighted PNGs in the code repo?
        
         | johnisgood wrote:
         | Where would you like it to be distributed for an old GameBoy
         | game?
        
       | nake89 wrote:
       | This is amazing news. I loved this game as a kid. I still have my
       | original gba and the game itself.
        
       | dpedu wrote:
       | Is it known how much of the decompiled code comes from the game's
       | developers, versus some sort of SDK for the original platform?
        
         | aikinai wrote:
         | They might have used some middleware, but GBA had no SDK I
         | believe.
        
           | mmaniac wrote:
           | The GBA SDK is pretty minimal in terms of library support.
           | It's mostly functions for accessing save data plus wrappers
           | around syscalls found in the bootrom. Those syscalls are some
           | basic math functions, a few decompression algorithms, and an
           | early version of the MusicPlayer2000 sound engine.
        
         | freshollie wrote:
         | Dimps developed a "game engine" of sort for their GBA games. As
         | far as I understand SA1 was the first implementation of this
         | engine and then they iterated upon it for their future games.
         | It's an extremely minimal engine, implements some helpers for
         | rendering sprites and backgrounds, and a task system (since the
         | GBA doesn't have threading or any task system in it's SDK).
         | 
         | You can see this SDK in the root of the src, everything in game
         | was written specifically for the Sonic Advance trilogy.
        
       | russellbeattie wrote:
       | I wonder how old codebases are managed at Sega. Is there a server
       | somewhere where you can see the code and assets for all the
       | various games they've published going back to the 80s? 90s? Is it
       | walled off? In cold storage? Could some junior dev decide to go
       | check out the original GBA Sonic code just for fun?
        
         | zorked wrote:
         | Probably most source code has been lost. Games were considered
         | throwaway projects, executives barely knew what source code
         | was, and game dev work was considered entry-level and low-
         | status. The main source of 80s and early 90s code that we have
         | are floppy disks that developers took home rather than the
         | companies that published the games.
         | 
         | Consider that version control was something that was basically
         | only used by Unix developers back then. E.g. DOOM, with a
         | particularly technically proficient team, was developed by
         | passing disks with source files around.
        
           | GabrielTFS wrote:
           | Sonic Advance 2 might be late enough that developers started
           | to take that seriously, e.g. I recall hearing that earlier
           | games like Ocarina of Time already were being developed using
           | CVS, for instance, and another game from around that time
           | that I specifically recall would be Pokemon Diamond & Pearl,
           | developed in an SVN repository
        
             | freshollie wrote:
             | This may be true, but since the game was published by THQ
             | in the west who then went bankrupt, no one knows who owns
             | the rights to this game and so no one is likely to ever
             | release it. If source was ever released we still wouldn't
             | use it in the decompilation since that then becomes much
             | more of a legal issue.
             | 
             | The spongebob movie GBA source was released recently:
             | https://archive.org/details/the-spongebob-squarepants-
             | movie-...
        
       | msk-lywenn wrote:
       | Shame... All those sprites and tile backgrounds are just begging
       | for a DMCA take down. Why not just put up the tools that
       | disassemble those from the ROM instead?
        
         | GabrielTFS wrote:
         | SEGA seems to always have been a lot more generous with this
         | kind of thing... Much of the disassembly or decompilation
         | projects I've seen come out of old SEGA games include all the
         | assets with them (e.g. look up disassemblies for the Genesis
         | games), and ROM hacks are typically distributed as full ROMs -
         | I've basically never seen SEGA use the DMCA against any
         | disassemblies/decompilations/ROM hacks.
        
         | hnlmorg wrote:
         | If this were Nintendo then I'd agree but sega have always been
         | really chilled about this so long as the community does t
         | profit off their IP (which is a fair line to draw).
         | 
         | Because of this, you'll fine tonnes of Sega fan stuff. From
         | multiple active Phantasy Star Online servers through to entire
         | fan-made Sonic games.
         | 
         | In fact iirc Sonic Mania started life as a fan game and Sega
         | asked them to produce a full game.
        
           | ThatPlayer wrote:
           | Even Nintendo hasn't taken action for similar projects for
           | Pokemon. They're also in nice and easy PNG format:
           | https://github.com/pret/pokeplatinum/tree/main/res/pokemon
        
         | freshollie wrote:
         | Do you wanna develop that tool? The sprite and midi extraction
         | is pretty complex in this game, it was much easier for us to
         | extract them by hand and then in the future we will produce
         | something which extracts them automatically. Until we have that
         | tooling in place we don't plan to release any binaries.
        
           | rawbot wrote:
           | You'll get DMCA'd just by hosting the sprites and MIDIs. A
           | binary is not the act that will get you DMCA'd.
        
             | freshollie wrote:
             | If that happens we will keep the repo private and develop
             | the tooling to extract these in an automated way. As others
             | have said, SEGA doesn't police their IP in this way.
             | Checkout this game which has existed since the early 2000s
             | https://www.srb2.org/
        
           | 3np wrote:
           | Just omit the problematic parts from public? And perhaps you
           | want to migrate to some more resilient and friendly host than
           | github.com, while you still have a chance to redirect people.
           | All it takes is one form submission to nuke your repo.
           | 
           | (Assuming you care about your work and sharing it. Sure "Sega
           | is chill" so far but you are really pushing it here and
           | giving them a great display of why they might want to
           | reconsider)
        
       | hobozilla wrote:
       | How good (or bad) is AI at mapping assembly back to C?
        
         | freshollie wrote:
         | For matching decompilations like this, pretty terrible. It can
         | give a rough layout of a function with some branching, but it
         | fails to create reasonable human like structs (which have to be
         | inferred from the assembly), and matching what it has created
         | can be the majority of the work. We did this without any AI
         | assistance, but I relied on the Ghidra decompilation feature
         | for outlining a functions layout (though even that had it's
         | limitations).
         | 
         | The training data is just too minimal for this sort of thing.
         | The decomp.me database would probably be really good to train a
         | model on.
        
       | greeniskool wrote:
       | I wonder if the Android port of Advance 3 came in hand here. That
       | version was ported to Java -- and being unobfuscated, would've
       | been a great reference point.
        
         | freshollie wrote:
         | It didn't. The Java port is an entirely different source.
         | Essentially a re-write.
        
       | mikae1 wrote:
       | Why are there suddenly so many decompilation projects? Has there
       | been a technical leap?
        
         | mikae1 wrote:
         | https://decomp.me perhaps?
        
       ___________________________________________________________________
       (page generated 2025-03-28 23:02 UTC)