Readit News logoReadit News
binji commented on Writing a Game Boy Emulator in OCaml (2022)   linoscope.github.io/writi... · Posted by u/ibobev
le-mark · 6 months ago
This is a very nice write up of not only Ocaml but also gameboy emulator implementation. Great job and thank you to the author!

As an aside I’ve always thought it would be awesome to create a single page app with an assembler editor and assembler/linker/loader to enable doing gameboy homebrew in the browser. I think it would be a great, accessible embedded development teaching opportunity.

binji · 6 months ago
rgbds-live is more-or-less this same idea, with an embedded version of RGBDS: https://gbdev.io/rgbds-live/
binji commented on McDonald's just dropped a brand new Game Boy game   retrododo.com/mcdonalds-g... · Posted by u/outime
brennopost · 3 years ago
Thank you for your emulators. I've used pokegb as reference to my own emulator, and used binjgb debugger to fix many issues.
binji · 3 years ago
Glad they've helped! There are plenty of better emulators, but I'm pretty proud of binjgb for being small, pretty fast, and pretty accurate.
binji commented on McDonald's just dropped a brand new Game Boy game   retrododo.com/mcdonalds-g... · Posted by u/outime
Andrex · 3 years ago
If this is the same emulator ejected by GB Studio when it exports to web, that makes sense. All GB Studio projects on Itch.io likely use your emu too!

https://itch.io/games/made-with-gb-studio

725 listed so far (lots of asset packs and tech demos I'm sure, but still.)

binji · 3 years ago
heh, good point! Most of the older ones are using GameBoy-Online[0] instead, since that was the GB Studio default for a while. But I think everything since GBStudio 3 should be binjgb.

[0] https://github.com/taisel/GameBoy-Online

binji commented on McDonald's just dropped a brand new Game Boy game   retrododo.com/mcdonalds-g... · Posted by u/outime
hackernewds · 3 years ago
do you get compensated for use?
binji · 3 years ago
nah, people can do whatever they want with it :)
binji commented on McDonald's just dropped a brand new Game Boy game   retrododo.com/mcdonalds-g... · Posted by u/outime
binji · 3 years ago
This is using my gameboy emulator, binjgb[0], on the website! (well one of my gameboy emulators, heh [1][2]) It's been used as the emulator for GB Studio for a little while now, but I don't know how often people embed it in their websites, so it's really cool to see.

[0] https://github.com/binji/binjgb [1] https://github.com/binji/pokegb [2] https://binji.github.io/raw-wasm/badgb/

binji commented on Smolnes: A NES emulator in less than 5000 significant bytes of C++   github.com/binji/smolnes... · Posted by u/jpegqs
lioeters · 3 years ago
Big fan of this author's work.

They have a Gameboy emulator written in C, which can be compiled to WASM and run in the browser.

https://github.com/binji/binjgb

I learned a lot from the code.

Also I love this project with a bunch of demos in hand-written WebAssembly Text (WAT) format, which is like low-level Lisp that works only with raw memory, numbers, and minimal syntax.

https://github.com/binji/raw-wasm

Then I discovered the same author is quite active in the WebAssembly ecosystem, including specs and tooling. Fascinating stuff!

https://github.com/WebAssembly/spec

https://github.com/WebAssembly/wabt

binji · 3 years ago
Thanks! I don't work much on WebAssembly anymore, but I'm super excited to see all the progress being made.
binji commented on Smolnes: A NES emulator in less than 5000 significant bytes of C++   github.com/binji/smolnes... · Posted by u/jpegqs
pvitz · 3 years ago
While reading the code I stumbled upon "case 1 ... 10:” or similar and asked myself how I could have missed this range feature for so many years. It turns out that this is a GCC extension and indeed not part of the language. A list of the C extensions (and C++ extensions) can be found here: https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/C-Extensions.ht...
binji · 3 years ago
That's true, I should have mentioned that I use this extension. It is supported by clang as well, however.
binji commented on Smolnes: A NES emulator in less than 5000 significant bytes of C++   github.com/binji/smolnes... · Posted by u/jpegqs
userbinator · 3 years ago
IOCCC entry? Tiny emulators seem to appear there semi-regularly, e.g. this one was memorable years ago: https://news.ycombinator.com/item?id=18198374
binji · 3 years ago
This was brought up for the last one of these I made, but the code here is c++ so wouldn't be allowed. I don't use a lot of c++ features, but it might be hard to keep the code size small without them.
binji commented on Smolnes: A NES emulator in less than 5000 significant bytes of C++   github.com/binji/smolnes... · Posted by u/jpegqs
binji · 3 years ago
Hi all, author here! Happy to answer any questions y'all have
binji commented on Smolnes: A NES emulator in less than 5000 significant bytes of C++   github.com/binji/smolnes... · Posted by u/jpegqs
a_t48 · 3 years ago
I did something similar, but couldn’t figure out a clever enough way of resampling the audio from “native” rate down to something that Windows was happy with. What was your strategy?
binji · 3 years ago
I didn't handle audio for this emulator. But you can see how I handle resampling in my more fully-featured NES emulator here: https://github.com/binji/binjnes/blob/ca6977469168069a165176...

I'm not sure it's the right technique, but it seems to work pretty well!

u/binji

KarmaCake day433November 12, 2013View Original