Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Creating a NES emulator in C++11 (PART 2/2)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
8,652
Google+
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 7, 2011

In this tool-assisted education video I compile and run the NES emulator that I created in the first part. I showcase a few TASes from http://tasvideos.org/ , some simultaneously.
The emulator is very accurate, and sort-of portable; it compiles on any architecture that support libSDL, but it outputs audio through an external program and reads joypad input from a file.
This video is part 2/2.
-- Part 1 ( http://youtu.be/y71lli8MS8s ): Creating the emulator.
-- Part 2 ( http://youtu.be/XZWw745wPXY ): Compiling and running.

Because of the 15 minute limit that YouTube still imposes on my account (I have no idea why; none of the restrictions mentioned on their help pages should apply to my account, and I have even sms-validated it); I had to develop many techniques to shorten the code dramatically. I also had to type it very quickly... And I had to split the actual demonstration into a second video, which is this video.

Link to this comment:

Share to:

Uploader Comments (Bisqwit)

  • Very impressive! How many years did you work with C++ language?

  • @darkzone4822 I first learned about C++ in ~1995, using Borland C++ 3.1, which was pre-standard. However, I didn't truly begin using C++ until ~1999, when my friend (whose YouTube channel is WarpRulez) showed me a simple program that reads words of text, sorts them, and counts how many times each word appeared. It used STL. It impressed me greatly. The program had no hardcoded limits, and it was only about 10 lines long. After that, C++ has been my primary programming language. No regrets.

  • I meant OS

    

  • @BurnInHell7 Linux. The graphical UI in this video was created in postprocess from the following sources: The DOSBox text output (I run a terminal emulator within DOSBox; within the terminal emulator, the Linux system is accessed); the emulator windows (SDL, as in the source code; though I used a special version of the emulator that outputs raw video into stdout instead); and all custom graphics (UI glue) added by a video processing program I created for this particular video.

  • @Bisqwit I am curious at what kind of knowledge you have? I am self-taught in c++ and at a uni learning Java but I have not gone through any development course. What maths do you know what kind of programming experience would i have to have in order to learn this? I could kind follow your code but the reasons for using certain numbers for memory seem arbitrary

  • @DamarSweetness I used NES architecture documents extensively from e.g. nesdev. Knowledge of them is implied. Bit indexes for registers are part of the hardware's specification. It would have been a major inconvenience to try and explain those in the source code. Some, such as bitmasks, I could have reasonably put as consts/enums, I admit. In the rendering loop, things happen in a marching succession: step 1, do this. step 2, do this. steps 3 and 5, do this. All of this is applied documentation.

Video Responses

This video is a response to Creating a NES emulator in C++11 (PART 1/2)
see all

All Comments (44)

Sign In or Sign Up now to post a comment!
  • Hes a fucking genious lol I read the code and try to understand it and probably could with time but jesus fucking christ dude you are one in a million

  • @Bisqwit Wow I very much agree with you on that. I actually have a 500mhz 94meg box that I put arch linux on and used for a few years as one of my desktops. Did everything I wanted it too at the time, the main reason I have a new computer is for newer games but I still use the old machine.

  • finally I found a hacker on youtube

  • Which SO do yo use?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more