kNES is a Nintendo Entertainment System (NES) emulator written in Kotlin, forked from the vNES Java emulator. This project was created primarily for fun and educational purposes, allowing developers to learn about emulation techniques and NES hardware while enjoying classic games.
kNES is a reimplementation and extension of the vNES emulator (originally developed by Brian F. R.) in Kotlin. The project aims to:
- Provide a modern, Kotlin-based NES emulator
- Serve as an educational resource for those interested in emulation
- Demonstrate different UI implementation approaches in the JVM ecosystem
- Have fun with retro gaming and programming!
This project is distributed under the GNU General Public License v3.0 (GPL-3.0), ensuring it remains free and open source.
- Supports only basic mapper (will elaborate more in the future, why)
- Do not clean memory upon start, which messes up some games (check releases)... but this is a feature I want to build upon in future ;)
The project is organized into the following modules:
- knes-emulator: Core emulator functionality, including CPU, PPU, memory, and mappers.
- knes-applet-ui: Java Applet-based UI for the emulator (legacy support).
- knes-compose-ui: Jetpack Compose-based UI for the emulator (modern desktop UI).
- knes-terminal-ui: Terminal-based UI for the emulator (text-based interface) - slow AF, but freaking fun.
- knes-skiko-ui: Skiko-based UI for the emulator (Kotlin multiplatform graphics).
NES.mp4
- Java 17 or higher
- Gradle 7.0 or higher
./gradlew build
./gradlew run
This will launch the main application, which allows choosing between the different UI implementations.
You can run specific UI implementations directly:
# Applet UI
./gradlew :knes-applet-ui:run
# Compose UI
./gradlew :knes-compose-ui:run
# Terminal UI
./gradlew :knes-terminal-ui:run
# Skiko UI
./gradlew :knes-skiko-ui:run
The emulator uses a modular architecture with a clear separation between the core emulator functionality and the UI. This allows for different UI implementations to be used with the same core emulator.
The core emulator is contained in the knes-emulator
module and provides the following components:
- CPU: 6502 CPU emulation
- PPU: Picture Processing Unit emulation
- Memory: Memory management
- Mappers: ROM mappers for different game cartridges
The UI abstraction is provided by the NESUIFactory
interface, which allows different UI implementations to be plugged into the core emulator. The interface provides methods for creating UI components such as input handlers and screen views.
Next Step
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
vNES was originally developed by Brian F. R. (bfirsh) and released under the GPL-3.0 license. This project is a reimplementation and extension of that work.