Açıklama Yok

PeakRacing e667ea4054 fix:mapper65异常 8 saat önce
.devcontainer b79152599a update:更新说明 5 ay önce
.gitee bc503ec7d3 Initial commit 3 yıl önce
.github b79152599a update:更新说明 5 ay önce
docs 61bc829970 fix:修复恶魔城2选择界面异常问题 1 gün önce
inc 265c9a8c3c fix:mapper45 YG6023 异常 9 saat önce
port bb05b65794 add:继续补全mapper 4 gün önce
rtthread dc36dc1d5c add:添加更多mapper 4 gün önce
sdl a29c46d785 add:sdl3图形化支持中文rom调用 1 gün önce
src e667ea4054 fix:mapper65异常 8 saat önce
.gitignore b3e260b5d9 add:添加mapper9 4 gün önce
LICENSE d081375f25 update:license 1 yıl önce
README.md 5d65955c1a update:更新readme 3 hafta önce
README_zh.md b4499d7fb7 fix:Videomation(mapper13)异常 1 gün önce
SConscript 601dfd0702 add:rtthread适配 3 ay önce

README.md

English | 中文

nes simulator

Pull Requests Welcomefirst-timers-only Friendly

github licenseLatest ReleaseWindowsLinuxMacos

github: PeakRacing/nes: A NES emulator in C (github.com) (recommend)

gitee: nes: c语言实现的nes模拟器 (gitee.com) (updates may not be timely due to synchronization issues)

Introduction

​ The nes simulator implemented in C , requires C11 or above

attention:This repository is only for the nes simulator and does not provide the game !!!

Platform support:

  • [x] Windows

  • [x] Linux

  • [x] MacOS

Simulator support:

  • [x] CPU (All instructions)

  • [x] PPU (Simulating at pixel-level precision)

  • [x] APU (Fixed-point calculation)

mapper support:

​ 0, 1, 2, 3, 4, 7, 94, 177, 180

Software Architecture

​ The example is based on SDL for image and sound output, without special dependencies, and you can port to any hardware by yourself

Compile Tutorial

​ clone repository,install xmake,execute xmake directly to compile

Compile Preparation

Windows:

​ install MSVC(Visual Studio)

​ install xmake

Linux(Ubuntu):

sudo add-apt-repository ppa:xmake-io/xmake -y
sudo apt-get update -y
sudo apt-get install -y git make gcc p7zip-full libsdl2-dev xmake

Macox:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install make gcc sdl2 xmake

Compilation Method

​ clone repository,execute xmake directly to compile

Note: This project supports both SDL2 and SDL3, use SDL2 to execute 'xmake' under SDL/SDL2

Download link

github: https://github.com/PeakRacing/nes/releases

gitee: https://gitee.com/PeakRacing/nes/releases

Instructions

​ on linux or macos enter ./nes xxx.nes load the game to run

​ on windows enter .\nes.exe xxx.nes load the game to run

Key mapping

joystick up down left right select start A B
P1 W S A D V B J K
P2 1 2 5 6

Note: P2 uses numberic keypad

Transplant instructions

​ The source code in the incand src directories does not need to be modified, only the three files in the port directory nes_conf.h nes_port.c nes_port.h

  • nes_conf.h is a configuration file, configure according to your needs, such as printing extra definitions, the implementation of nes_log_printf
  • nes_port.c is the main porting file, which needs to be ported according to the needs

Note: If the target platform for migration has weak performance and small space, some macro configurations are specially reserved:

  • NES_ENABLE_SOUND can be set to 0 to turn off the APU to increase the running speed
  • NES_RAM_LACK can be set to 1, using a half-screen refresh to reduce RAM consumption (running at a slower speed)
  • You can configure NES_FRAME_SKIP to skip frames
  • NES_ROM_STREAM can be set to 1 to dynamically switch banks from a file. This mode only requires a 40KB active bank buffer (PRG 32KB, CHR 8KB). The file handle remains open, but the bank switching speed will decrease. It is designed for low memory.
  • If SPI 8-byte transmission is used for embedded platforms, the color anomaly configuration NES_COLOR_SWAP can be used to switch the large and small ends

Showcase

mapper 0:

Super Mario Bros F1_race Star Luster (J) Ikki (J)
Circus Charlie

mapper 2:

Contra1 Castlevania Journey Lifeporce
mega_man Athena (J)

mapper 3:

contra Donkey_kong

mapper 94:

Senjou no Ookami

mapper 180:

Crazy Climber

Discussion group

Non-technical support, only for the purpose of interest exchange.

Communication

Literature reference

https://www.nesdev.org/