Live data from Hacker News

Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

github.com

51–60 of 108 posts

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#51
I feel like the GB/GBC/GBA are pretty much what the VT102 is to writing grid-cell software. The demo scene keeps cranking. Chiptune is still in love with the hardware - especially with the OG DMG, with a pro sound mod. Writing new software for the GBA feels a lot like targeting a tiny, modern ARM microcontroller. The hardware is well documented and understood by the enthusiasts, and it's a stable target.

Plus there are plenty of emulators focusing on different aspects: one is focusing on perfect emulation; another will try to squeeze out performance; another might offer memory inspection and "cheat codes"; this one makes it available on the web. There's beauty in all of that.

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#53
post #52

This is very cool. Whenever I see a project like this I wonder "how did they even get started".

A gameboy emulator is a very popular project. There are plenty of guides on how to get started. Checkout "build your own x" repo for some project ideas

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#54
Tangentially related - I recently picked up a retro gaming handheld from Aliexpress for the meagre sum of £50, which is capable of playing consoles from gameboy to snes to playstation 1, and apparently even a smattering of N64 and dreamcast (with poor performance).

There are a dizzying array of options (game boy form factor, horizontal, clamshell design ala the advance SP), and although I'm sure the build quality leaves a lot to be desired, for my personal circumstances of "I'm travelling a lot but can't quite justify a steam deck right now" it has truly been an utter delight. There's a scene of various custom firmwares to install, and apps for these firmwares to add various functionality.

I'd encourage anyone who feels a desire to play some emulated games check out /r/SBCGaming to see what's out there!

Just don't ignore the warnings that these devices don't negotiate USB C charging correctly, and also buy yourself a very small weak charger...

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#58

Why does almost every project written in rust have "written in rust" advertised in the title/description?

Because people are interested in how technology is built, and if they’re interested in rust they might be interested in seeing how it’s used in other projects

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#59
post #4

It plays really slow in Firefox, and there are also audio issues (they may be related?) But in Chrome, this plays really well! Great work!

For me it runs at full speed in both stable and developer versions of Firefox (but even then, audio is bad at times). But still, I looked at performance out of curiosity.

After running it under FF's profiler for a moment, it looks like a sync executed after every opcode recalculates the framebuffer (`step_until_next_audio_buffer -> cpu::microops::read_byte_from_memory -> emulator::sync -> gpu::scanline::write_scanlines`) and uploads it to the canvas with `putImageData`, which takes ~35% of execution time. Sounds like that could be redundant work, since I'm pretty sure the canvas isn't actually redrawn until the wasm execution yields back to the browser.

EDIT: also, the emulator can't really be ran in debug mode, since 1. it blows the wasm stack (presumably when creating the huge `Emulator` struct, a not uncommon issue in Rust; I had to hack in bigger stack size with linker args), and 2. is panics on int overflows `apu::step`.

Re: Retro Boy: simple Game Boy emulator written in Rust, can be played on the web

#60

Why does almost every project written in rust have "written in rust" advertised in the title/description?

Because people are interested in how technology is built, and if they’re interested in rust they might be interested in seeing how it’s used in other projects

sure that "being written in C" or in "PHP" would have gathered far less interest
Post reply on HN