NES emulator written in D

Manu turkeyman at gmail.com
Tue Nov 13 08:24:05 UTC 2018


On Mon, Nov 12, 2018 at 10:30 PM blahness via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:
>
> On Tuesday, 13 November 2018 at 05:59:52 UTC, Manu wrote:
> >
> > Nice work.
> >
> > Oh wow, this is pretty rough!
> > ```
> > void createTable() {
> >   this.table = [
> >     &this.brk, &this.ora, &this.kil, &this.slo, &this.nop,
> > &this.ora,
> > &this.asl, &this.slo, &this.php, &this.ora, &this.asl,
> > &this.aac,
> > &this.nop, &this.ora, &this.asl, &this.slo,
> >     ...
> > ```
> >
> > Here's one I prepared earlier:
> > https://github.com/TurkeyMan/superemu (probably doesn't work
> > with DMD from the last year or 2!) Extensible architecture,
> > supports a bunch of systems.
>
> That's an artifact from the original code which was written in
> Go. My main focus was adding missing instructions & fixing any
> timing issues. It now passes nearly every NES specific CPU
> instruction & timing test I can throw at it so I'm fairly happy
> with it. Any improvements are always welcome though.

A great test is to emulate an Atari2600; you'll know your 6502 is 100%
perfect if you can play pitfall or some other complex 2600 games ;)
I can't see how your cycle counting logic works, it looks like it's
missing a lot of cycles. How do you clock your scanlines against your
CPU?
Can you run Battletoads or Super Mario Bros? They're pretty sensitive
to proper timing.


More information about the Digitalmars-d-announce mailing list