Giter Site home page Giter Site logo

unes's Introduction

UNES

UNES is an emulator plug-in that runs Nintendo Entertainment System Nintendo FC Game *.nes files in the Unity environment. The project is based on Emulator.NES to achieve cross-platform through Unity.

license Release Version topLanguage size last 996.icu

[中文文档]

1. Start

    1. Create a new or select a GameObject in the scene and add the UNESBehaviour component.
    1. Create a new RenderTexture to render the game screen.
    1. Use any way you want to display the RenderTexture file in the game.
    1. Use the default input method or realize custom input on demand.
    1. Implement the loading of *.nes files on demand to obtain byte[] format data.
    1. Call the UNESBehaviour.Boot(byte[] romData) interface to start the game.

2. Load

2.1. Resources loading

If you need to use the Resources.Load() interface to load the ROM file, you need to pay attention to changing the .nes extension to .bytes, and then use the following method to load:

var bytes = Resources.Load<TextAsset>(romPath).bytes;
UNES.BootRom(bytes);

2.2. FileStream loading

If you use the method of loading the original file byte stream, you can directly call the UNESBehaviour.Boot(byte[] romData) interface.

3. Configuration

3.1. Filter Mode

Filter mode of game screen rendering:

Mode Description
Point Texture pixels become blocky at close range.
Bilinear Bilinear bilinear filtering-averages the texture samples.
Trilinear Trilinear Trilinear filtering-averages texture samples and blends between mipmap levels.

For detailed explanation, please refer to FilterMode

3.2. Logic Thread

If the Logic Thread option is turned on, the simulation calculations of the CPU and PPU parts will be executed by other thread, and the Unity main thread is only responsible for reading the status data to refresh the game screen, which can significantly increase the number of frames.

3.3. Input Config

Customize the physical keyboard keys corresponding to the native keys.

4. input

Default configuration control method:

Native buttons Operation buttons
Start Num1
Select Num2
Up Up Arrow
Down Down Arrow
Left Left Arrow
Right Right Arrow
A A
B S

5. API

5.1. Boot

Obtain the byte array format of the original ROM file in any way for the emulator to start:

public void Boot(byte[] romData);

5.2. Save

The simulator itself only provides the data of the current running state, and does not provide the persistence implementation of the data file. Need to realize the preservation of archived data by oneself.

public byte[] GetSaveData();

5.3. Load

Obtain archive file data in any way for the emulator to restore game progress:

public void LoadSaveData(byte[] saveData);

6. Mapper

There are many Mapper extension formats in NES, and the implemented part of the project implementation can theoretically support most common games.

0 NROM
1 MMC1
2 UxROM
3 CNROM
4 MMC3
7 AxROM
9 MMC2 (Mike Tyson's Punch-Out!!)
10 MMC4
11 Color Dreams
66 GxROM
71 Camerica
79 NINA-003-006
94 Senjou no Ookami
140 Jaleco
155 MMC1A
180 Crazy Climber
206 DxROM

7. Problem

  • Audio APU simulation is not implemented.
  • Only realize Unity basic input system and pure keyboard operation mode.
  • Not all Mappers are implemented.
  • The performance of the PPU simulation part is low, and the frame number is unstable on the low-end mobile devices.

unes's People

Contributors

ls9512 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.