Skip to content

NES Emulator written in C using our own device drivers for UART, GPU, Keyboard, Mouse, RTC and timer 🕹️

Notifications You must be signed in to change notification settings

ricardoyang00/NES_Emulator-LCOM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MINIX - NES Emulator

An NES emulator coded entirely in C using device drivers developed for LCOM course at @FEUP.


Table of Contents

  1. Introduction
  2. Features
  3. System Requirements
  4. Installation
  5. Usage
  6. Acknowledgements

Introduction

Welcome to the NES Emulator! This project aims to provide an emulator for the Nintendo Entertainment System (NES), written from the ground up to be portable and easily compatible with various device drivers, whether for Linux, Windows and Minix. This allows users to play classic NES games on modern hardware.

Features

  • Accurate emulation of NES CPU, PPU, cartidge loading, mapping and contoller connection.
  • Support for the popular NES file formats (.nes) with iNES headers.
  • Serial connection to real controller through a ESP8266 being used as a bridge.
  • Various resolutions and scalling.
  • Very fast loading and unloading of games.

System Requirements

This repository only runs on the Minix image developed for the LCOM course at FEUP.

You can download the image here.

Since we are working with low-level hardware configurations and direct access to the programmatic interface of a computer’s I/O devices raises security risks, it is recommended to use a virtual machine to emulate this project. The suggested solution is to run it on VirtualBox (the link above contains the .vb file).

Installation

  1. Install VirtualBox: Download and install VirtualBox for your system.

  2. Download MINIX Image: Get the MINIX image provided in the System Requirements.

  3. Open MINIX in VirtualBox:

  • Double-click the .vbox file to open VirtualBox with the settings for the MINIX-LCOM VM.
  1. Clone the Repository:
# clone the repository
git clone git@github.com:ricardoyang00/NES_Emulator-LCOM.git
  1. Set Up Shared Folder:
  • In the MINIX-LCOM/ folder, create a shared/ folder.
  • Open the settings for the MINIX VM in VirtualBox and set the shared folder to the shared/ directory you just created.
  • Move the cloned repository into the shared/ folder.
  1. Start the VM:
  • Boot up the VM. Use lcom for the login and lcom for the password.
  1. Get the ROMs:
  • To use the emulator, ensure all ROMs are placed in the roms/ folder.
  • The roms that are expected to have are supermariobros, soccer, DonkeyKong, mspacman, and BattleCity.
  1. Build and Run the Project:
cd labs/src/
make
lcom_run proj

# see more in USAGE about extra flags
  1. To exit the emulator's interface you can press exit key.

Usage

To run use lcom_run proj

You can also use these flags:

Syntax Description
--no-uart Disables serial connection
--player-1-serial Swaps controller 1 from keyboard to Serial
--vmode 0x115 Enables VBE_MODE_DC_24 video mode while emulator running

(Don't forget to wrap the flags in " ")

for example lcom_run proj "--no-uart"

Controls

Menu

  • Mouse - to select game
  • Arrows - ← and → to change menu page
  • Exit - to quit the program

Game (emulator)

controller or keyboard instructions image

Acknowledgements

A big thanks to:

  • Professor Nuno Cardoso for his unwavering support and encouragement, inspiring us to learn more and never give up.
  • OneLoneCoder (Javidx9) for his insightful series on NES emulator development, and his community for helping me understand the inner workings of the NES.

About

NES Emulator written in C using our own device drivers for UART, GPU, Keyboard, Mouse, RTC and timer 🕹️

Topics

Resources

Stars

Watchers

Forks

Languages

  • C 76.4%
  • C++ 23.6%