In this tool-assisted education video I create a DCPU-16 emulator with C++11. You see me type every line. I also create an assembler for the DCPU-16 with macro support. The program is sort-of portable; it compiles on any architecture that support libSDL, I believe a DCPU-16 emulator is a good beginners' challenge for emulation, due to its simplicity. It doesn't take much time to implement the 1.1 version of the emulator, and the 1.7 version is not _that_ much more complex. This video also showcases all the documentation from which it draws. (Except the C++ standard of course.) The emulator is written in several phases. Phase 1 (0:00 - 7:22) 290 lines -- DCPU-16 version 1.1 emulator with graphics support. Phase 2 (8:33 - 18:02) 681 lines -- Added text mode support and an assembler. Phase 3 (18:27 - 25:53) 848 lines -- DCPU-16 version 1.7 upgrade! Also added extra assembler features such as macros. Phase 4 (26:10 - 32:43) 944 lines. -- Properly implemented the DCPU-16 version 1.7 hardware interface. The outcome from each phase is demonstrated separately. Demo 1 (7:22 - 8:33): Pacman clone. Demo 2 (18:02 - 18:27): Rendering demo. Demo 3 (25:53 - 26:10): Revisiting Pacman shortly, showing that despite quite different machine code, it still runs as long as the assembler language is backward compatible and the I/O hardware is the same. Demo 4 (32:43 - 35:21): DCPU16-CBMBASIC and AtlasOS. You can download all the source code at: http://bisqwit.iki.fi/jutut/kuvat/programming_examples/dcpu16/ Documentation and resources: http://dcpu.com/ https://github.com/gatesphere/demi-16/tree/master/docs The video includes English-language narration by me. I hope it is not too distracting! I am sorry that sometimes my voice clips (http://en.wikipedia.org/wiki/Clipping_%28audio%29 ); it sounded fine with my cheap headphones when I was recording it, despite looking ugly in the waveform editor... But luckily those parts where it does clip are few. It also includes background music. Background music: Zelda Wind Waker ocean theme, composited from two MIDI covers by different authors played at the same time through OPL3 emulation. I had previously chosen the OMF music for it in June 2012, but I ended up using that song for the 1000 subscriber special instead (http://youtu.be/QIUVSD3yqqE) as this project got delayed. I began creating this emulator in early 2012, but I shelved the project for a long time for unspecified reasons. In January 10, 2014 I picked it up again and spent a week finishing it, and another week refactoring it into a YouTube video, and a day or two choosing the background music for it. Then I spent 10 days recording the narration, and here we are. Enjoy! Links I mentioned in my narration: http://bisqwit.iki.fi/story/howto/openmp/ http://fingswotidun.com/dcpu16/pac.html http://en.wikipedia.org/w/index.php?title=Karvalakki&oldid=442532992 Approximate line-count tally of the finished program by category: Lines 1-17 Defines Lines 18-21 Graphics Lines 22-24 Disassembler Lines 25-26 CPU emulation Lines 27-27 Disassembler & Assembler Lines 28-32 CPU emulation Lines 33-502 Disassembler & Assembler Lines 503-509 CPU emulation Lines 510-523 Defines (SDL initialization) Lines 524-545 CPU emulation (hardware framework) Lines 546-570 Hardware:Clock support Lines 571-708 Hardware:Monitor support Lines 709-770 Hardware:Keyboard support Lines 771-777 CPU emulation (hardware framework) Lines 778-830 CPU emulation Lines 831-837 Disassembler Lines 838-931 CPU emulation Lines 932-938 Defines (Loading the kernel) Lines 939-941 CPU emulation Total: 481 Disassembler & Assembler 193 CPU emulation 142 Graphics 62 Keyboard 38 Defines 25 Clock Approximate time spent in the video with each feature: 0:00-3:53 CPU emulation 3:53-4:36 Graphics 4:36-5:06 Keyboard 5:06-6:41 Graphics 6:41-7:22 Video postprocessing (style) 8:33-16:45 Assembler 16:45-17:24 Disassembler 17:24-18:01 Graphics (textmode support) 18:27-19:54 Assembler & Disassembler 19:54-21:41 CPU emulation 21:41-25:53 Assembler 26:10-27:54 CPU emulation 27:54-28:26 Clock 28:26-30:57 Graphics 30:57-32:32 Keyboard 32:32-32:43 CPU emulation Total: 14.5 minutes Assembler & Disassembler (8.9 minutes for v1.1 only) 7.6 minutes CPU emulation (3.8 minutes for version 1.1 only) 5.4 minutes Graphics (2.3 minutes for version 1.1 only) 2.1 minutes Keyboard (0.5 minutes for version 1.1 only) 0.5 minutes Clock Number of lines with comments: 148 (16%) Number of lines with nothing but a comment: 123 (13%) Number of lines excluding blank lines after comments removal: 761 No, this is not code-golf. I'm making these statistics mostly for my own interest. P.S. While making this video I realized that the small pixel fonts such as the VGA 8x8 font are best for maintaining legibility of the text even at small sizes. When I used a 8x12 font, the text was much harder to read with 160x60 screen dimensions than it is with a 8x8 font.