Is the NES Classic's emulator a port of an existing one?

Discussion in 'General Gaming Discussion' started by Harsky, Nov 15, 2016.

  1. Harsky

    Harsky Madmin

    Aug 2, 2004
    Sorry if this has already been discussed but looking at this page:

    Shows that the NES Classic has some open sourced software which Nintendo has released as part of the licensing agreement. Does this mean that they took an existing emulator and modified it or is it a case of they were cherry picking some software while using proprietry software as well?

    I just find it interesting that they decided not to use an existing emulator from the Wii/3ds/Wii U.
  2. xtheman

    xtheman GBAtemp Guru

    Jan 28, 2016
    United States
    The thing is suppose to be running linux so sources have to be given.
  3. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    At this point I have downloaded the thing linked and am now looking through it. I have not read any analysis of emulator binaries, nor any other analysis beyond seeing headlines about it being hacked and running Linux of some flavour.
    They might well have used modified versions of their existing emulators though, the filters and such they were showing off the other month are not especially long winded things to code, though nice to have I guess. Many times this sort of thing is often just the code used in the menus, help files (if it is all HTML then why write your own browser when you can just port/compile and existing one and release any changes? If you are not in the business of selling a browser or having it as a main feature of your device...) and whatever else. It looks like the hacking is already done so no great use for me in doing version number analysis to see about exploits.

    Anyway in the download


    One of the Linux sound... I don't want to say libraries as it is more than that but it is one of the methods Linux distros manage sound with. I don't know how popular it is right now as some other things have risen up and are nipping at its heels but is it not a niche thing by any means.

    Designed for embedded linux. It bills itself as a program that bundles the features of many other command line programs Linux uses into one big program.
    Useful to have, saves maintaining a whole list of them or removing specific ones if you are locking things down a bit.

    A Nintendo developed program/library/tool/module,
    " * Controllers I2C driver
    * Copyright (C) 2016 Nintendo Co. Ltd
    MODULE_AUTHOR("Christophe Aguettaz <>");
    MODULE_DESCRIPTION("Nintendo Clover/Wii Classic/Wii Pro controllers on I2C");
    Was Clover the dev name of the device? Anyway i2c is a popular chip to chip communications protocol, used by wii nunchucks and many things besides
    Probably of interest to those making PC adapters or adapting controllers to this device.
    I attached it to this as it is tiny and might save someone downloading a couple of hundred megs for no great gain otherwise.

    A means to allow disc encryption to interact with various aspects of Linux. I imagine Nintendo encrypted the NAND image and whatever else and encryption is usually only any good if you can have the people/things that need to read it actually able to do so. (the times where it is not useful being when you want your enemies to spend their resources analysing essentially random information).

    It says " fork of systemd-eudev. Potentially contentious this one, though not for this module.
    systemd is a newer way of having things load at startup, compared to the older init stuff, and this is then a thing which acts as a device manager for it.

    "LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language."
    Project Homepage:
    Lua is a popular, ish, programming language and one with a long history in emulation and embedded systems (I have fished it out of commercial DS games on several occasions). Just In Time is a method of turning script based coding stuff into actual executable code but not long before it is run but actually on the system, possibly just before it is run and maybe in response to other things which have happened before it. You would probably have heard about it in relation to Java before, maybe also in discussion in the 3ds' appalling javascript performance. Alternatively it is sort of related to the concept used in many higher level emulators which is known as dynamic recompilation.
    Anyway nothing particularly interesting, other than speaking to a more flexible security setup for memory than the 3ds. I don't know if it will be able to speak to emulators a la or is used somewhere else in the system.

    I could waffle but from the readme
    "Simple DirectMedia Layer is a cross-platform development library designed
    to provide low level access to audio, keyboard, mouse, joystick, and graphics
    hardware via OpenGL and Direct3D. It is used by video playback software,
    emulators, and popular games including Valve's award winning catalog
    and many Humble Bundle games."

    SDL mixer
    Once more the readme says nice things
    "Due to popular demand, here is a simple multi-channel audio mixer.
    It supports 8 channels of 16 bit stereo audio, plus a single channel
    of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
    I opened one of the batch files in it and it mentions along with a bunch of very windows related stuff, nothing but a basic just installed hosting page on the site
    Doing a whois on said site
    "Registrant Name: Nintendo Support IT
    Registrant Organization: MOBICLIP
    Registrant Street: 128 rue de Rivoli
    Registrant City: PARIS
    Registrant State/Province: Ile-de-France
    Registrant Postal Code: 75001
    Registrant Country: FR
    Registrant Phone: +33.153300365
    Registrant Phone Ext:
    Registrant Fax: +33.153300122
    Registrant Fax Ext:
    Registrant Email: [it is there on the whois]
    Mobiclip is a company Nintendo purchased some time back which made a video format used by various Nintendo consoles ever since.

    "SoLoud is an easy to use, free, portable c/c++ audio engine for games."
    Curious as the folks over at nesdev have questioned the audio quality for this emulation.
    Not sure what goes with alsa and the mixer library above though.

    lib C
    Standard C library used with linux and its dev tools.

    "kmod is a set of tools to handle common tasks with Linux kernel modules like
    insert, remove, list, check properties, resolve dependencies and aliases."

    A library for viewing PNG images. Very popular for this sort of thing. Not sure of its exploit history but historically a lot of image libraries have been good places to look (the PSP having several).

    The Linux kernel and bulk of the download. 3.4 is an older kernel ( Linux 3.4 has been released on 20 May, 2012. ), other things in this source date from 2015 but seemingly not that.

    A logical volume manager. Keeps the various drives and files/devices purporting to be them and the kernel running the show all happy. Might have been of some interest if injecting new games proves to be hard at some level

    " LZO is a portable lossless data compression library written in ANSI C.
    It offers pretty fast compression and very fast decompression.
    Decompression requires no memory."
    Compression is useful to have, this is one that works and is pretty well tested.

    pax global header is just a file which git dumps have to help identify times and people involved.

    "This is the popt(3) command line option parsing library...
    Complete documentation on popt(3) is available in (included in [the download]".
    There have been some interesting things in command line fiddling over the years, shellshock for instance ( ), but whether this would be interesting to the general hacker I am not sure.

    "U-Boot, a boot loader for
    Embedded boards based on PowerPC, ARM, MIPS and several other
    processors, which can be installed in a boot ROM and used to
    initialize and test the hardware or to download and run application
    Tapping into bootup is a goal of hackers of embedded devices like this, I don't know if uboot itself is inherently interesting as the stuff layered on top of it. Might be worth seeing what was changed and if that gives any clues on the crypto involved. That said nobody cares if it is 2 cycles or 2 seconds into bootup where you take over so if you have another means to get your code in then why spend the effort, unless you are doing some kind of brick protection I guess.

    Another bundle program containing common commands seen in Linux. Might be worth having a look to see what was stripped out or nerfed, if anything, as it does include some fairly far reaching commands if the wikipedia page is anything to go by

    Another popular compression library, used everywhere for everything really.


    So yeah no emulator code included, mostly just libraries and things. I imagine some poor bastard had to go through it and see what went but they also appear to have released stuff which could almost compile as is rather than a list of changes (which is the extent of their legal obligation). I certainly did not undertake any kind of analysis of anything here (no compares against current or the versions they were based on, much less anything I might want to work up into an exploit) and this is just a basic overview and what might be interesting to would be hackers. The controller stuff and the web stuff mentioned are the things I am looking at with most interest, though the udev stuff I don't want to dismiss either.
    Certainly no indication that they just took fceux and recompiled it or anything, though again I await analysis of the binaries to see how similar it might be to some virtual console or GBA emulators or anything like that really.

    Attached Files:

  4. RevPokemon

    RevPokemon GBATemp's 3rd Favorite Transgirl

    Aug 24, 2014
    United States
    Fort Gay, West Virginia
    In order for them not to have to they could have just done like Valve did with SteamOS.

    Of course the issue which would prevent them is the fact of the legal reasons as most of the NES emulators use a GPL variety and would be required to give their code which I doubt they would want to show to be completely honest. But I would argue it is likely at least semi based off their current NES emulators.
  5. Sonic Angel Knight

    Sonic Angel Knight GBAtemp Legend

    May 27, 2016
    United States
    New York
    Maybe they will release a Gameboy classic system that is just rapsberry pi inside of the original game boy or gameboy color with 30 games to play, have like a 720P 5 inch screen. :P
    hobbledehoy899 likes this.
  6. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    Who knows who might have looked at what when writing something else. That said they have rolled their own NES emulators since the GBA at least (various commercial devs did use pocketnes quite legitimately but Nintendo's classic nes/famicom mini line was their own work from what I saw, and people did drill into it, and similar stories with the Wii VC. Not sure about the GC Animal Crossing stuff).
    The question then becomes what modifications would Nintendo have to/want to do to FCEUX (which yes is GPL2 licensed if is anything to go by) or the MAME core (also GPL as of not so long ago) that handles NES stuff? Accuracy wise it seems they are better than Nintendo's present offering, assuming that nesdev thread is accurate and I have no reason to doubt that, and that mainly leaves just stripping out all the functionality you might not want. Maybe if those fancy filters they were showing off represented some real work (for my money nothing shown there was anything close to what had however many years ago that was showcased), though I would also find it hard to believe they could not do an end run around that somehow.

    I reckon the bigger issue would be it then legitimises the emulators they and that puts it somewhat at odds with the "emulation is basically piracy" stance they took otherwise ( ), and have done nothing to dissuade ( ) since.
  7. RevPokemon

    RevPokemon GBATemp's 3rd Favorite Transgirl

    Aug 24, 2014
    United States
    Fort Gay, West Virginia
    In some sense it almost makes my think of Napster (off topic watch Downloaded if you can as it is a great documentary) in that you have the technology side of it which everyone knows is great and impressive yet you have the fact that the impressive technology is mainly used for questionable reasons. In fact even when I read what they think it is basically like Napster in that it is not the technologies that they are against (since they use them as do other companies like Capcom or Sega) but it is the fact that so often they are used against their wishes. And I would add that they know this as well. However I feel that from their stand point it is hard to separate the cool tech side from the piracy side which causes them to hate this technology and want to attack it. But at the same time it is not just Nintendo as most companies have similar attitudes to some extent since regardless it is costing them some money in their eyes (as seen by the views of the ESA) altough many have heavily taken cue.
  8. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    Though there are laws based upon people, a majority or a significant in some way minority, not being able to handle things (drugs, weapons and animals being popular examples) most tech stuff tends to have phrases like "substantial non infringing uses" fly all around in the eventual rulings and judgements. As homebrew would then be part of that use*, and emulation as an alternative in the case of legitimately owned software probably could be some flavour of OK (I know what I would rule but I don't want to bet on what a judge might be swayed to do), possibly also disabled peoples getting a chance to play then that gets hard to argue against emulation.

    *given the DMCA exemptions that get revisited every so often specifically exempt a lot of things to do with running user code on locked devices then I reckon that could almost be some kind of precedent, even if we do end up throwing out sega vs accolade or galoob and Nintendo..