I built a Game Boy emulator in F#
nickkossolapov.github.io
I built a Game Boy emulator in F#
1–10 of 84 posts
Re: I built a Game Boy emulator in F#
#2There is some hope for humanity after all I suppose.
Re: I built a Game Boy emulator in F#
#3Re: I built a Game Boy emulator in F#
#4Re: I built a Game Boy emulator in F#
#5Re: I built a Game Boy emulator in F#
#6That's so cool! I love F#, but I wrote a little Smalltalk interpreter in it and I can confirm it isn't exactly a speed demon for that kind of thing if you use it as intended lol
For example, I usually like using the `Map` data structure, and that's a pretty neat immutable structure and is usually fine for most stuff, but when performance becomes critical, it's easy enough to break into a boring imperative loop with a regular hash map. If I keep everything contained into one function, I usually can avoid feeling super dirty about it.
Re: I built a Game Boy emulator in F#
#7I mean, ideally, we'd run different color test patterns through, in different lighting conditions, to build a really detailed model, right?
Re: I built a Game Boy emulator in F#
#8Re: I built a Game Boy emulator in F#
#9That's so cool! I love F#, but I wrote a little Smalltalk interpreter in it and I can confirm it isn't exactly a speed demon for that kind of thing if you use it as intended lol
Re: I built a Game Boy emulator in F#
#10Some low hanging fruit to reduce allocations: the discriminated unions in Instructions.fs could be [], reusing field names to reuse internal fields.
Also, minor nitpick but I'm confused about some of the registers. They are already of type byte, the setters with `a &&& 0xFFuy` don't add anything over `member val A = 0uy with get, set`. I'm guessing this changed over time.