
Nintendo has reportedly suffered a significant legacy console leak - synthecypher
https://www.videogameschronicle.com/news/nintendo-has-reportedly-suffered-a-significant-legacy-console-leak/
======
TheAceOfHearts
Modern Vintage Gamer just released a video [0] discussing this leak in greater
detail along with its expected implications.

Anyone who's curious can find the download links by backtracking through all
the Pokemon Prototype General threads under the Pokemon board on 4chan.

One of the leaks that caught my attention was the source for Pokemon Blue,
partially because of nostalgia and partially out of curiosity to see what an
old game's codebase even looks like. The first thing that stood out to me was
the project's flat folder structure, full of hundreds of files; I guess I was
expecting things to be a bit more structured. The source is more readable and
approachable than I expected, although I've only poked around in some of the
more obvious places and definitions. I'd recommend watching The Ultimate Game
Boy Talk [1] before trying to dive into any code.

[0]
[https://www.youtube.com/watch?v=n8G7eq0GlQs](https://www.youtube.com/watch?v=n8G7eq0GlQs)

[1]
[https://www.youtube.com/watch?v=HyzD8pNlpwI](https://www.youtube.com/watch?v=HyzD8pNlpwI)

~~~
dehrmann
I have zero experience in the video game industry, but I'd think that since
video games get ~zero attention after they're shipped, writing maintainable
code is less of a priority.

I'd be really curious to see how the Pokemon Red/Blue split was done. Is it a
C precompiler flag? Build config? Actual config? Cloned repo?

~~~
TheAceOfHearts
In the Pokemon Blue codebase they use 2 flag variables to distinguish between
the different games, these are `pokemon_type` and `pokemon_type_blue`. The
name of the second flag definitely hints that it was added later in
development.

These are the values for each game:

    
    
        Green:  pokemon_type=0 pokemon_type_blue=0
        Red:    pokemon_type=1 pokemon_type_blue=0
        Blue:   pokemon_type=1 pokemon_type_blue=1
    

The general pattern for branching between game variations looks like this
across the codebase:

    
    
        ifn pokemon_type
          ifn pokemon_type_blue
            ; blue
          else
            ; red
          endif
        else
          ; green
        endif
    

Conditional assembly directives like `ifn` are resolved statically during
assembly, so only the code between matching conditions is included as part of
the output. To anyone interested in exploring this a bit more, I'd recommend
reading Chapter 8 Section 13 of the DOS version of The Art of Assembly
Language Programming [0], which starts on page 43 of the linked PDF.

Bonus fun-fact: In the Pokemon Yellow codebase it says `pokemon_type=1` is
yellow, while `pokemon_type=0` is pink! This suggests to me that the idea of
Pokemon Pink with Jigglypuff as your starter was probably being floated around
but it was eventually scrapped. (The only remaining options for a pink starter
pokemon with a pink evolution in the original 151 would be Clefairy and
Slowpoke, neither of which are very cute.) The idea of Jigglypuff as a starter
is further supported by her appearance alongside Pikachu on the roster of the
original Super Smash Bros. which seems rather unexpected unless they had
bigger plans for her.

[0] [http://www.plantation-
productions.com/Webster/www.artofasm.c...](http://www.plantation-
productions.com/Webster/www.artofasm.com/DOS/pdf/ch08.pdf)

~~~
abaga129
I found some supporting evidence from bulbapedia "Clefairy was originally
going to be the official mascot of Pokémon, but Pikachu was used instead due
to the popularity of the anime and Pikachu's familiarity with fans".

Source:
[https://m.bulbapedia.bulbagarden.net/wiki/Clefairy_(Pok%C3%A...](https://m.bulbapedia.bulbagarden.net/wiki/Clefairy_\(Pok%C3%A9mon\))

Very cool find about the pink version!

------
roblabla
To be clear, this doesn't just contain the source code of the software. It
also contains the Verilog for the N64 GPU and other important hardware
component, which is hugely important. From what I gather, it also contains
full version history from their VCS.

While it is very interesting, it's worth noting that anybody hoping to use
this for anything "serious" risks getting the Nintendo lawyers on their ass.
Emulators won't touch this, neither will console clones. This leak is both a
blessing and a curse.

~~~
wolfram74
It's a bit of shame, too, because from what I gather, the N64 has a bit of an
atypical architecture[1] that's made it hard to get the same quality of
emulation that the game cube and wii have. It doesn't have a straight up and
down GPU, it has what it calls a reality processing unit, that does graphics
and sound. And it can be reconfigured with cartridge specific microcode? It's
getting into the weeds on hardware design and I'm not experienced enough to
have a strong opinion on the matter.

[1][https://en.wikipedia.org/wiki/Nintendo_64_technical_specific...](https://en.wikipedia.org/wiki/Nintendo_64_technical_specifications#Reality_Coprocessor)

~~~
Jasper_
The N64 emulation scene has always been heavily drama filled, going back at
least 20 years to the original Oman archives. While the system architecture is
bizarre, that's fine, we can cope with that. It's always just been a very
toxic social space that has pushed a lot of the more talented emulator
developers away.

As someone who is in "emulation-adjacent" communities, just yesterday I ran
into a giant new pocket of N64 drama I was previously unaware of.

~~~
temac
The whole emulation scene (well at least a very good part of it) is full of
drama. That's fascinating; they somehow have the time for that after writing
state of the art whole system highly optimized emulators, sometimes inventing
new techniques on the fly...

~~~
callesgg
The person that spends the time required to learn about game consoles on a
deep technical level to write emulators. Will not have much time left to
refine their social skills.

It is allot of personal free time they put in to these projects so I guess it
is understandable that they want to protect their work.

------
zelon88
I like drawing metaphors from Tamiya. Tamiya is a Japanese scale modelling and
remote-controlled vehicle company with a loooong history of making quality
products that the industry just eats up. Like Nintendo, Tamiya has always been
in the back row when it comes to technological innovation, but lead the pack
when it came to functionality, reliability, and quality. Just like Nintendo,
there are Tamiya fan clubs where people are enthusiastic about products from
this one company. The rest of the industry doesn't exist to them. I'm trying
to illustrate how Tamiya is to the R/C world what Nintendo is to console
games.

That said, vintage Tamiya products new in original packaging from the 70s and
80s can sell for thousands and thousands of dollars. Simple plastic and
aluminum parts that were consumable in the 80s were selling for hundreds of
dollars in the late 2000s. The market was a rough place. I have about a dozen
antique Tamiya models, so I was one of those people engaged in bidding wars
for 1/4" long tie-rod ends. A brand new Tamiya in the 80s was probably about
$100 for a rolling kit. Now people are paying that for individual parts.
Nobody was having fun with their models anymore. Everyone was just dusting
them off and spending money keeping them pretty.

Tamiya had to get the kids playing with their models again. They had to take
this exclusive, elitist market they created by accident 30 years ago and start
making money off of it again.

So Tamiya re-released nearly _ALL_ of their vintage kits. Brand new, with
original design, documentation, decals, and packaging. This was in addition to
their new models and high-tech racing vehicles which were still being released
on a regular schedule at the same time. Initially all the collectors (myself
included) were livid, because for a while it meant my $1,100 Bruiser 3-speed
was only worth $500. That didn't happen either. For a time the prices dipped
significantly, but collectors still demanded vintage parts to repair their
vintage models. The prices soon stabilized. Now that market is healthy and
stable, vintage vehicles can be repaired cheaply if desired, and collectors
can still spend thousands on NIB models.

If Nintendo embraced their market they could possibly reap the same benefits.
The enthusiasm for their products is there. Tamiya has shown it is possible to
separate collector demand from commodity demand and still have those
ecosystems thrive side-by-side. I think Nintendo could pull that off as well.

~~~
ginko
One of my dreams was always if Nintendo released "development diary" editions
of old titles(in particular Super Mario 64 and Ocarina of Time) where you'd
get to try out a playable showcase of the game's builds at particular states
in development from very early initial tests, to Alpha, Beta, various trade
conference demos etc. Each with developer commentary, perhaps design sketches,
deleted content and maybe maybe also some source code.

Essentially like what's pretty much standard for special edition BluRays. Pack
that in a nice hardcover booklet and people would eat it up.

~~~
striking
You might enjoy the content on
[https://tcrf.net/The_Cutting_Room_Floor](https://tcrf.net/The_Cutting_Room_Floor)
and [https://www.unseen64.net/](https://www.unseen64.net/), among others.

~~~
ginko
Yeah, I'm aware of these. The point is these sites exist because the interest
is there but game developers aren't interested in serving it. That's why
people try to find leaked beta copies and even resort to hacking like here.

------
gregjw
Is this bad? Am I misunderstanding?

What financial damage does this do when Nintendo no longer manufacturers this
console or actively developers for it and hasn't for years, or a decade in the
N64/GameCube's case?

~~~
lidHanteyk
You might be missing the concept of "face" [0]. This is _only_ bad in that it
causes Nintendo to lose face, and Nintendo _hates_ losing face. For example,
examine Wikipedia; Nintendo's page about legal disputes [1] is whitewashed to
reword all of Nintendo's abuses towards Free Software and the public domain as
"protection" of Nintendo's "property".

Face allows Nintendo to take their holier-than-thou attitude. It is why they
feel that they are allowed to both destroy the community's own work [2][3][4]
and steal it for themselves [5][6]. We profess love for Mario, Zelda, Pikachu,
and Metroid, and in return, they are socially empowered to abuse us.

Imagine a world where copyright were only 14 years, as in the original, or 2
years, as in my back-of-napkin estimation of how long it takes to publish
something and have it fully saturate the world market. In such a world,
Nintendo's back catalog would no longer have the force of law behind its
monopoly; they would still publish excellent games, but they would not be able
to prevent others from enjoying them. Indeed, there is not any reasonable
claim to financial damages, just facial damages.

[0]
[https://en.wikipedia.org/wiki/Face_(sociological_concept)](https://en.wikipedia.org/wiki/Face_\(sociological_concept\))

[1]
[https://en.wikipedia.org/wiki/Nintendo#Intellectual_property...](https://en.wikipedia.org/wiki/Nintendo#Intellectual_property_protection)

[2]
[https://github.com/github/dmca/blob/4dbf90f837296db72ca959e1...](https://github.com/github/dmca/blob/4dbf90f837296db72ca959e1d9aac8e11ad3c208/2015-07-06-nintendo.md)

[3]
[https://github.com/github/dmca/blob/master/2016/2016-12-27-N...](https://github.com/github/dmca/blob/master/2016/2016-12-27-Nintendo.md)

[4]
[https://github.com/github/dmca/blob/master/2017/2017-06-22-N...](https://github.com/github/dmca/blob/master/2017/2017-06-22-Nintendo.md)

[5] [https://www.eurogamer.net/articles/2017-01-18-did-
nintendo-d...](https://www.eurogamer.net/articles/2017-01-18-did-nintendo-
download-a-mario-rom-and-sell-it-back-to-us)

[6]
[https://old.reddit.com/r/emulation/comments/9as2ii/did_ninte...](https://old.reddit.com/r/emulation/comments/9as2ii/did_nintendo_actually_download_roms_for_their/)

~~~
sgift
5/6 sounds interesting to me. On the one hand Nintendo is the IP holder of the
original ROM, so they would be the only ones allowed to legally download it if
I understand it correctly. On the other hand the ROM was modified and contains
a header which was made by someone else. So, to that part they don't hold the
rights to download it? Or is it okay, because it's a derivative of their work?

~~~
dehrmann
You might be able to argue the header was implicitly licensed because the
author knowingly distributed it.

~~~
yjftsjthsd-h
Not at all. For instance, if I publish code on github without a license, it
remains proprietary / all rights reserved.

------
intopieces
From an archiving perspective, this is incredible. I don't trust corporations,
even those as wonderful as Nintendo, to do proper archiving of their systems
and release it even 100 years on.

------
MaximumMadness
One of the most interesting parts of this is the story behind Nintendo's use
of friend codes rather than Gamertags.

There was a presentation [0] leaked that outlined that usernames "weren't
simple enough". It's a great look into Nintendo's Wi-Fi Strategy

[0] [https://www.docdroid.net/Qr3JNsl/wi-fi-concept-
pdf#page=11](https://www.docdroid.net/Qr3JNsl/wi-fi-concept-pdf#page=11)

~~~
hombre_fatal
All of their points looks like an attempt to justify bad decisions.

SW-7899-1252-5983 is simpler than username systems children could figure out
on Neopets and Club Penguin? People can guess your username because they know
your name is Billy?

Discord and Blizzard have the ultimate ez solution: What username do you want?
Billy. Alright, if you want someone to find you, give them this string:
Billy#1201.

Nintendo still hasn't made an online system as good as Xbox Live in 2002. How
they justify SW-7899-1252-5983 as the ideal trade-off sheds some light that
they might have an institional-level lack of intuition about what a compelling
online experience looks like. Which is interesting because I think most people
by now assumed catastrophic indifference.

------
umanwizard
So... if someone who isn’t me wanted to download this, where would they look?

~~~
dubcanada
Actually I am gonna remove this google "download nintendo leak routefree" and
you'll find what you need somewhere in the results.

~~~
EvenThisAcronym
> However I MUST say this is from 4chan so BE CAREFUL about what you download
> and how you play with stuff.

The only danger in downloading something leaked on 4chan is that you run the
risk of learning a little more about dolphins than you might have liked.

~~~
zozbot234
Nah, Dolphin is 100% open source and above board, they're going to avoid this
stuff like the plague.

~~~
dathinab
True I don't think they would take the risk, it's just not worth it.

Through I'm wondering if Nintendo will try to use that as a excuse just
claiming they used that material.

~~~
blaser-waffle
Nintendo is a conservative company with strong, well known brands (Mario,
Donkey Kong, Legend of Zelda, etc.). I'd be surprised if they rolled over and
let this slide.

I'd be doubly surprised if they ever open sourced anything.

------
xwdv
God I would love to see Mario 64 re-released with a full ray-tracing engine
for an Nvidia RTX. The PC port is already there, perhaps with the help of
information stolen in this leak.

------
happycube
The irony is that N64 got leaked and not Saturn, Jaguar or some console where
the owner isn't continually exploiting the IP in some fashion...

~~~
Topgamer7
Its not irony, its certainly going to be based on interest. People (hackers
and non-hackers) are going to be more interested in the more popular IP. More
people owned Nintendo products than the other brands. More interest leads to
bigger target.

------
sickcodebruh
> The PC emulation community could also theoretically use the data to improve
> their software so that it imitates the original systems perfectly. However,
> since the leaked documentation has been illegally obtained this would put
> them in murky territory.

I'd love to hear opinions about this whole thing from folks who work on
emulators.

~~~
coldpie
I don't work on emulators, but I do work on Wine. We explicitly forbid any
contributions from anyone who has seen any Microsoft source code. The risk of
introducing work derived from code owned by Microsoft is too high. I don't
know how strict emulator authors are about this--they're non-commercial and so
have less at stake than we do--but if I were an emulator author, I would cut
ties with anyone known to have looked at this material. The whole reason
emulators are legal and ROMs aren't is because emulators are original work not
owned by the console developer. Once you start introducing derived work, that
all flies out the window, and Nintendo can crack down on the emulators
themselves.

~~~
devit
That policy obviously just results in Wine contributors not disclosing seeing
Microsoft source code, which is a good thing for Wine, but does not imply that
having Microsoft source code (or Nintendo's in this case) is useless.

Also looking at source code and documentation does not mean that the code you
write is derived work (although it makes it very slightly more risky that it
is).

~~~
coldpie
> That policy obviously just results in Wine contributors not disclosing
> seeing Microsoft source code

Absolutely not, we take it very seriously. If there's a hint of looking at
Microsoft source code or REing Microsoft binaries, then contributions are
banned. It's not a wink-wink kind of situation.

~~~
devit
I mean that almost surely there are people that do so and carefully make sure
to not mention that and make sure that their contributions are not derived
work and don't have such "hints".

The main technique to do so is "parallel construction": e.g. you reverse
engineer a binary or look at source code, find out a special case not
implemented in Wine, then construct a test case that tests the special case
and behaves differently in Windows and Wine and claim that you found the test
case experimentally, from a personal project that didn't work in Wine or from
open source code you find that triggers it (rather than from RE or source code
reading); you then implement a patch in the way you find most optimal without
influence from how the code you reversed or read did it.

This is in fact good for Wine since it results in both having high quality
contributions and having no additional liability.

So Wine's policy effect is not to stop such activity, but to make the Wine
project not liable for it; thus, any leaks of Microsoft's source code are in
fact good for the project since they enable this activity and the Nintendo
situation here is similar.

~~~
1123581321
What evidence do you have for this?

~~~
lostgame
If there was evidence it wouldn’t be effective.

That’s like asking a spy for evidence of their current mission.

Does the spy’s denial of knowledge or a lack of evidence of that spy’s mission
mean that individual was not a spy? Quite the opposite. It means they were an
effective spy.

~~~
1123581321
This isn’t enlightening. It sounds like there is no evidence and the user to
which I originally replied just wanted to besmirch the reputation of the Wine
project without a good reason why they are lying about rejecting legally
troublesome contributions. It is possible to go about an open source
alternative honestly.

------
intopieces
Does this mean I'll be able to pick up a good clone in Shenzhen next year?
Serious question.

~~~
elldoubleyew
I doubt it. Refurbishing and selling original hardware is still likely to be
much cheaper than the engineering effort required to build one from scratch.

The Wii is old enough that modern commodity hardware can emulate it well
enough that it almost indistinguishable from running games on the actual
device. Wii clones already exist as emulator boxes and that will continue to
be the most financially sound way of producing clones.

If this leak were to include design specifications of more modern hardware
(such as in the Switch) I think you _would_ see some good clones in Shenzhen
in less than a year.

~~~
rasz
Not if someone turns N64 on a chip design for $30 200-in-1 handhelds.

------
boredgamer2
It would be amazing to see the Gameboy/N64 emulator hacker community expand,
and NEW games begin to be developed based on these docs. Maybe Nintendo could
double-down on this and turn it into good publicity

~~~
zozbot234
The article mentions that this would be unwise due to these documents being
released illegally. Reverse engineering some existing system for the purpose
of interoperability (as is common among homebrew enthusiasts) is legal;
hacking into a Nintendo subcontractor's IT and leaking internal documentation
obviously isn't.

~~~
Zenbit_UX
A developer can use the leak as a reference without being the one responsible
for the leak. It sounds like it would be hugely beneficial.

~~~
roywiggins
If Nintendo can prove they used it as a reference, that's evidence for a nasty
lawsuit.

There's a reason why people go to these lengths:

[https://en.m.wikipedia.org/wiki/Clean_room_design](https://en.m.wikipedia.org/wiki/Clean_room_design)

------
ngcc_hk
Did have to remember the linux law case of a few lines of code nearly got the
case. Very hard checking about anyone copy a few lines. Not a good development
short term. Good for historical analysis.

------
mikorym
Would this make the N64 any easier to emulate?

------
chadlavi
Nintendo "suffering" a leak is one (very pro-corporation) take on this.
Probably not the one most people would have on hearing about this though.

~~~
paulcole
This isn't pro-corporation at all IMO. It's acting like this is something that
happened rather than an action someone took.

Headline should be closer to "Hacker leaks Nintendo source code ..."

