Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    I

    Imran Nazar

    imrannazar.com · Personal blog · on HN since 2010

    Imran Nazar writes about web development and retrocomputing, including a Game Boy emulator tutorial in JavaScript and Commodore 64 projects.

    Visit blogRSSHN submissions
    Retro ComputingProgrammingGames
    What HN says

    Commenters recommend his Game Boy emulation series as an excellent writeup, and one is porting it to TypeScript to learn emulator writing.

    Stats for nerds
    41HN people shared it
    36linked in comments
    411story points
    Jan 2026last shared
    2011people per year2026

    Top posts on HN

    1. 1
      De-Googling TOTP Authenticator Codes
      1 person · 105 points · first shared 2025 · 135 comments on HN
    2. 2
      Steganography with Brainfuck
      1 person · 75 points · first shared 2011 · 13 comments on HN
    3. 3
      Let's build a JPEG decoder: Huffman tables
      1 person · 69 points · first shared 2013 · 13 comments on HN
    4. 4
      Gameboy Emulation in Javascript and HTML5
      10 people · 53 points · first shared 2010 · 7 comments on HN
    5. 5
      Let's Build a JPEG Decoder, part one: Exploring the concepts of JPEG compression
      1 person · 21 points · first shared 2013 · Discussion on HN
    6. 6
      GameBoy Emulation in JavaScript: Graphics
      1 person · 15 points · first shared 2010 · Discussion on HN
    7. 7
      GameBoy Emulation in JavaScript: The CPU
      17 people · 14 points · first shared 2010 · Discussion on HN
    8. 8
      Extended Text Mode on the C64
      2 people · 12 points · first shared 2018 · 1 comments on HN
    9. 9
      The Curious Case of Debian 12 and the SSH Failure
      1 person · 7 points · first shared 2024 · 3 comments on HN
    10. 10
      Pong Wars on the Commodore 64
      3 people · 5 points · first shared 2026 · 1 comments on HN

    What HN people wrote when they linked it

    • drbawbJan 2015

      Sure!

      This walkthrough[1] writing a Gameboy emulator in Javascript was very helpful in seeing how an emulator should be structured. -- Though the full source is available: the actual tutorial is more of a guideline that introduces you to the hardware and structure of the emulator. It often shows code-snippets instead of working code.

      The Gameboy CPU Manual[2] and OP code chart[3] have been invaluable tools. In my experience: I spent most of my time flipping between the opcode chart and my CPU implementation.

      As a tip: lots of the CPU instructions do the same thing w/ different register pairs. There is huge potential for code reuse here. In Rust I achieved it with macros, though.

      Lastly: the "Pan Docs"[4] are more or less the same thing as the CPU Manual, but in a slightly more readable format.

      Also there[5] are some test ROMs[6] that you can use for debugging.
      I'm trying to find a good way to verify their results using Rust's unit testing.

      `opus5.gb`[6] is a nice way to test the graphics subsystem; it's also a good "first ROM" to run because it has no additional ROM or RAM in the cartridge. In other-words: you don't need to implement the memory bank controllers to get it working.

      ---

      And a little bit of friendly advice: _always_ keep debugging in the back of your mind. I usually resort to "printf debugging" but that really doesn't work inside a loop that's supposed to be ticking at 4.19MHz! :)

      I accidentally filled up my disk once already; I forgot I had redirected…

    • simiasApr 2019

      If you're interested in making a GB emulator here are a few resources that helped me when I did just that a few years ago:

      - An intro to making a GB emulator in JS (it doesn't matter if you don't plan on using JS, it still explains the basic concepts pretty well): http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-CPU

      - Opcode map (note that the GB CPU is not a stock Z80, it has different timings, different registers, different flags and different opcodes, do not use stock Z80 docs as a reference lest you end up with broken CPU emulation): http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html

      - The GameBoy programming manual: http://www.romhacking.net/documents/544/

      - Accuracy test ROMs, very useful to make sure your timings are ok and you emulate various quirks of the hardware: http://tasvideos.org/EmulatorResources/GBAccuracyTests.html

      Also note that even if you focus on making an original (DMG) GameBoy emulator you should be able to add GameBoy Color support later without too much difficulty, it's a fairly straightforward evolution of the original hardware.

    • mattlondonApr 2020

      Porting http://imrannazar.com/GameBoy-Emulation-in-JavaScript to Typescript as a way to learn about how to write an emulator, as well as taking advantage of newer JavaScript APIs (e.g. requestAnimationFrame, ArrayBuffer etc) that were not available when this series of articles was written in 2010.

      We had a gameboy as a kid, but the ZX Spectrum (also Z80 CPU-based) meant more to me so hope to take what I learn from the great articles from imrannazar.com and apply to writing a ZX Speccy emulator (the gameboy had dedicated-hardware for sprites etc so not everything will be transferable).

      Yes both gameboy & spectrum emulators in javascript have been done already, but this is just for personal learning/fun/itch-scratching. It has been quite instructive both from a remembering-fundamental-cs-classes/how-computers-really-work perspective, as well as modern javascript

    • JonnieCacheJan 2011

      There used to be a demo floating around where someone had hacked this together with the firefox nightlies' support for the orientation sensor that allowed to your drive the kart by tilting your device. It worked for macbook as well as smartphones. Unfortunately the page is now down :( http://dougt.org/random/orientationdemo/index.xhtml

      In lieu of that, I present to you something much more interesting: A complete step-by-step guide to writing your own fully functioning gameboy emulator in javascript+html5 (without sound.) It's really easy to follow even if you know nothing at all about emulators.

      http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-CPU

    • timbit42Jan 2026

      It was not for no reason. When adding a screw hole in the motherboard so it could be mounted in the case, they accidentally removed the high speed wire, dooming the C64 to the same slow data speed of the VIC-20 with it's faulty VIA.

      The C64 data speed actually ended up being even slower than the VIC-20. You can read the full detailed here: https://imrannazar.com/articles/commodore-1541

    • KlonoarJan 2011

      This is some incredible work. There's a few ports out there I've tried, but this is by far the most performant yet. Definitely interested to see how further it's taken.

      I'm also interested to see where the author learned about the inner workings of the Gameboy (i.e, if Nazar's work had any influence: http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-CPU )

    Related

    PhobosLabphoboslab.org123 people

    QOI: Lossless Image Compression in O(n) Time

    PhobosLab
    Personal · last shared 2026
    byuubyuu.org77 people

    Color Emulation

    byuu
    Personal · last shared 2023
    Dave Griffithspawfal.org50 people

    Fluxus – A 3D game engine for live-coding worlds into existence

    Dave Griffiths
    Personal · last shared 2022
    Shonumishonumi.github.io21 people

    Glucoboy

    Shonumi
    Personal · last shared 2026
    Lode Vandevennelodev.org36 people

    The XOR Texture (2004)

    Lode Vandevenne
    Personal · last shared 2026
    Gaffer On Gamesgafferongames.com159 people

    UDP vs TCP

    Gaffer On Games
    Personal · last shared 2026
    mGBA Blogmgba.io22 people

    The Infinite Loop That Wasn't

    mGBA Blog
    Company · last shared 2024
    JeeLabsjeelabs.org21 people

    Low-end Linux

    JeeLabs
    Personal · last shared 2025