Live data from Hacker News

Super Mario 64 has been decompiled

github.com

71–80 of 180 posts

Re: Super Mario 64 has been decompiled

#71

Earlier quoted context omitted.

Same as any other impractical-but-fun project that gets featured on HN. It's weird to me that people keep being surprised.

It's more an indicator that apparently either not many meaningful things happen (which I doubt) or somehow people use this a some retro-wanking where they imagine "Uh yeah back in high school I was also working on stuff like this, those were the days". What I am saying is that it doesn't surprise me people do these projects, what surprises me is that enough people care about them for it to make the front page of HN.

'useless' projects like this are much easier to share than useful projects that might be tied to a company and therefore hard to release.

Re: Super Mario 64 has been decompiled

#72

Still amazes me that people actually spend time on such things :D. Decompiling 100 year old software whose source code most likely didn't look much different from what the decompiler spits out. What's the point?

Is the problem that there's no point or that you're being flippant, dismissive, and too lazy to see the point? Have you even taken a look through the code?

Let me just say this. Although not a complete restructuring, it's a TON more readable than a bog-standard decompilation of the ROM. This is something you'd know if you spent 10 minutes reading it.

Re: Super Mario 64 has been decompiled

#73

Earlier quoted context omitted.

WINE is not emulating/translating instructions to a diffrent ISA. It rather has a win32 loader and inserts some shims to map some calls to windows library functions and others to native(as in host ex. Linux). That's how I understand it. You can however theoretically run x86 WINE to run a x86 windows binary on ARM with Qemu user emulation.

Doesn’t WINE support 16-bit emulation for Win311-stuff because you can’t run 16-bit code in x64 mode? Or was that a Windows limitation?

That's a Windows limitation. X64 chips are plenty capable of running 16-bit protected mode code while the OS runs in long mode. It's that Windows didn't want to deal with translating HANDLEs back and forth between the two modes.

Re: Super Mario 64 has been decompiled

#74
post #55
post #9

One thing I've always been curious about: is there any sort of clear continuity of architecture or design patterns between the games in the Super Mario series? Yes, they're probably all from-scratch rewrites of the engine, but could each successive engine be said to be a "descendant" of a previous one, on a design level? One thing I know (and can be seen in this repo) is that SM64 emulates a version of the NES/SNES "…

Super Mario 3D World's architecture goes back to Super Mario Sunshine. Some parts go back all the way to Super Mario 64, but not the object / actor management. The ring buffer isn't really emulating OAM, either. You can trace the evolution of "LiveActor" all the way through until it ends up in Super Mario Odyssey. Sunshine - https://github.com/shibbo/Corona/blob/master/include/actor/T... Galaxy 1 - https://github.com…

> The ring buffer isn't really emulating OAM, either.

I mean, you're right, it's not a literal implementation of OAM in the sense of controlling the same things OAM controls. I was speaking kinda metaphorically.

NES/SNES OAM was useful for reading back entity physics data (because it gave objects X/Y position registers) which meant that developers (incl. Nintendo themselves) often chose to rely on the OAM-object "components" of a entity as the canonical handle for tracking the entity in the game physics (Rather than having a table somewhere in work-RAM of separate "physical" components for entities.) Games like SMW literally just index a table of actor behaviors off the OAM-object's name-table data; what an entity "is" from the game's perspective, is determined by what it currently looks like!

Since the OAM had a finite size, this reliance on OAM for tracking entities forced games into a structure where entities' lifetimes are coupled to the lifetime of their OAM-object representations. Which meant that every NES/SNES game relying on OAM to track entities needed an algorithm for dynamically allocating OAM-object slots to entities; and so, for evicting entities if OAM was exhausted. (Level design was done with a hard eye for avoiding OAM "thrashing" by keeping entities spaced apart, but the system still needed to be able to handle the case where mobile entities ended up following you and piling up.) Which brought into existence the common OAM LRU cache-eviction algorithm—i.e., the practice of "despawning" the oldest off-screen entities when new on-screen entities need OAM slots.

This determined a lot about the design of these NES/SNES games. It made mobs in these games into things that would lose their state whenever they were scrolled "far enough" off the screen; which in turn forced a design where—rather than a level just running a "start script" that would spawn entities at initial positions, tracking them in RAM from then on—you instead had adopt a hybrid approach where entities had both an OAM-object representation, and also an associated "spawner" (usually existing just as static level-data in ROM, though sometimes coupled to a bitflag tracking destroyed spawns) that would trigger [re]spawning for the entity.

SM64 is essentially "emulating OAM" in the sense that it assigns entities handles in a fixed-sized buffer, and then uses a very OAM-like logic (basically, "memory pressure" on this buffer) to decide when entities should be de-spawned; and then uses spawners to recreate entities that have been de-spawned due to this memory pressure (meaning that most entities don't "exist" until you get close enough to them.)

SM64 didn't need to do things this way; the N64 has enough RAM to track all the entities in every SM64 map at once, IIRC. They chose to impose this constraint artificially, in order to continue to build SM64 levels according to the design philosophy they had "discovered" due to the original constraints of the OAM system.

Later games in the Mario series, if-and-when they choose to have this de-spawn/re-spawn tracking feature†, are essentially "pretending to have OAM", but not really emulating it the way SM64 does. For example, Mario Maker de-spawns entities when they're scrolled sufficiently far off the screen, in a way that mimics OAM sufficiently well that re-spawning and enemy spawner semantics still work—but which isn't really an OAM-like system, in that there's no static buffer with memory-pressure causing de-spawning (and in fact, as long as the entities are willing to squeeze into one visual screen, existing entities will never be forced to de-spawn.)

† You could get a very interesting analysis of the way Nintendo probably internally divides/project-manages the Mario games, by just determining which titles "emulate" OAM the way SM64 does; which titles loosely mimic OAM, like Mario Maker; and which titles don't even bother with de-spawn/re-spawn tracking at all, but instead have persistent physical entities that just "go quiescent" when they're out of sight. (IIRC there's no Mario title that uses the fourth option—pure view-frustum culling of distant models that continue to "tick" while culled.)

Re: Super Mario 64 has been decompiled

#75

Earlier quoted context omitted.

WINE is not emulating/translating instructions to a diffrent ISA. It rather has a win32 loader and inserts some shims to map some calls to windows library functions and others to native(as in host ex. Linux). That's how I understand it. You can however theoretically run x86 WINE to run a x86 windows binary on ARM with Qemu user emulation.

Doesn’t WINE support 16-bit emulation for Win311-stuff because you can’t run 16-bit code in x64 mode? Or was that a Windows limitation?

Not to my knowledge, I believe WINE targets Windows 95 and newer. There is no ISA emulation, just DLL and other related Windows emulation.

Re: Super Mario 64 has been decompiled

#77
post #35

Earlier quoted context omitted.

QEMU is thought of as a hardware emulator, but supports "userland" emulation where the processor ISA is emulated but syscalls and memory are translated to the host OS.

I didn't even know QEMU could do that. That's insanely cool; kind of a weird combination of traditional virtualization and Wine.

On a distro like debian you can even use it to build-and-run userspace binaries for an unrelated architecture (some chroot magic was required last time I checked).

Re: Super Mario 64 has been decompiled

#79
post #65
post #58

Earlier quoted context omitted.

Maybe the confusion could have been avoided if instead of: > It would be great if this could be done... codesushi42 would have said (emphasis mine): > It would be great if this would be done... Not that I think it was incorrect as it was, just a little ambiguous, I guess.

Not a native english speaker, but this seems like a nitpicky non-issue to me. How is it not the same as "could you please pass me a glass of water" vs. "would you please pass me a glass of water"? Both indicate a request rather than talking about actual physical ability to perform the action. Also, I would agree more with your point if the parent said "It could be great if this could be done..." instead of "It would…

> Not a native english speaker, but this seems like a nitpicky non-issue to me. How is it not the same as "could you please pass me a glass of water" vs. "would you please pass me a glass of water"? Both indicate a request rather than talking about actual physical ability to perform the action.

in the case of something like the glass of water, "could" makes the sentence more indirect, and more polite.

the original post is "it would be great if [huge task undertaken by unspecified persons] could be done". this native speaker would not attempt to polite-ify a request for something like that (and i don't think other native speakers would either), so the original post can't be making a request. it is expressing a hope that the thing is possible. mburns (reasonably) then explains that it is possible. then codesushi42 sort of goes on the rails, and i can't figure out what they're attempting to convey at this point.

Re: Super Mario 64 has been decompiled

#80
post #47

I am looking forward to the mods that this will enable. I highly recommend trying mario 64 on dolphin EMU at 1080P with a texture pack. A HD mod that added a few more polygons would really round out the experience.

Is a raspberry pi a good-enough platform to run N64 1080P games on?

I got a pi 3b+ as I romanticized the idea of it, but it struggles a bit with SM64. I just use OpenEmu on my higher-powered laptop and HDMI out instead.

Pi format is still fun to tinker with and I encourage you to get one if you're at all interested. The 3b+ just wasn't the right tool for the job in my case. I haven't tried the pi 4, however.

Post reply on HN