Project · 2022 – 2023

K8 (Kate)

A CHIP-8 emulator in Kotlin Multiplatform that handles every quirk and mode, running on Android, iOS, desktop and the web from one codebase.

Status
Finished
Stack
Kotlin Multiplatform · Coroutines · Assembly
Code
github.com/AshishEkka97/k8

What it is

CHIP-8 is a tiny virtual machine from the 1970s, and writing an emulator for it is a classic way to learn how computers run code. K8 implements it fully, including the behaviour quirks that differ between the original interpreter and its later variants, and the extended modes.

How it’s built

  • One emulator core in shared Kotlin, with thin platform layers for display, input and sound.
  • Four targets from the same code: Android, iOS, desktop and the web.
  • Coroutines drive the CPU timing and the 60 Hz timers.
  • The module boundaries are drawn so another system could be added later without touching the core.