I wrote a NES emulator in QuickBASIC... and a QuickBASIC compiler.
In this video I'm downloading QBC and compiling it. Then I'm downloading QBNES and compiling it, and demonstrating it with two example cartridge dumps. Unlike most of my videos, this was recorded entirely in real time and in single shot. However, sometimes there was a lag spike with the custom desktop screen recorder, which caused a long pause in the video followed by a sudden jump of animation. NO AUDIO. Sorry. The screen recorder does not capture audio. The emulator DOES have sound. I also made this with very little preparation time. Twitter: https://twitter.com/RealBisqwit Patreon: https://patreon.com/Bisqwit (alternatives at https://iki.fi/bisqwit/donate.html) Twitch: https://twitch.tv/RealBisqwit Homepage: https://iki.fi/bisqwit/ You can download QBC at: https://bisqwit.iki.fi/source/qbc.html You can download QBNES at: https://bisqwit.iki.fi/jutut/kuvat/programming_examples/qbnes/ There's a version that compiles in either QBC or QB64, and a version that compiles in QBC, QB64 and Microsoft QuickBASIC 4.5. Note: Compiling with QB64 is not recommended (even though I designed this emulator for QB64 specifically). QB64 (as of version 0.980) generates atrociously pessimal code. It is even worse than the relatively non-optimized 16-bit MS-DOS code generated by QuickBASIC 4.5. You can read more about that here: http://www.qb64.net/forum/index.php?topic=11869 When I published the NES emulator in C++11 video in 2011 -- you can see it here if you haven't seen it yet by the way: https://www.youtube.com/watch?v=y71lli8MS8s I joked that there's nothing special in the emulator really; if one wanted, one could even write it in QuickBASIC. So now I did it. However, this is a new design, not a translation of the previous emulator. I rewrote this emulator entirely from scratch, only sometimes taking and applying ideas from my previous emulator. The main problem is that BASIC is quite a crude language. It does not contain templates or any manner of compile-time code generation like C++11 does. Thus I had to resort to a much more classic emulation approach. It is by far not a classic emulator though. I do all the rendering by simulating a NTSC television. The television has no knowledge whatsoever of PPU's internals, and is completely dependent on interpreting correctly the composite NTSC signal that the PPU pushes out, to know where each frame begins, how many scanlines there are, and so on. :-) The CPU in this emulator is very accurate -- more accurate than the one in nesemu1. It is cycle-accurate, flag-accurate in all corner cases, instruction-accurate, and even a cyclewise memory-access-accurate clone of 6502. There is decimal mode support, but for NES it is disabled. The PPU passes some accuracy tests, but it is quite so-so so far. FAQ: Q) Why did you write it? A) Just because. Q) Why did you publish this video? A) To reply to someone who pondered how difficult it is to install&use QBC in a discussion thread about QBEMU. Q) Yes but why did you publish it? A) I figured if I make a video and upload it, there's no harm in publishing it. Might spark some discussion, then again it might not. I'm sorry that this video is low on education value. But you can download the source code.
Download
0 formatsNo download links available.