Emulators in Rust with async/await

A few months ago I implemented a(nother) Game Boy emulator in Rust, where I repurposed Rust’s async await into coroutines for fun and no profit.

The Problem

The Game Boy’s hardware consists of several independent components – the CPU, Pixel Processing Unit (PPU), Audio Processing Unit (APU), etc. Each component advances in discrete time steps called M-cycles.

How do you keep the flow of code simple and direct inside each component while still being able to interleave their operations? Here’s what I mean:

![Left image shows 5 M-cycles and different components advancing in parallel on various cycles. Right image shows this simulated in a single-threaded environment by advancing components…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help