Giter Site home page Giter Site logo

v6502's People

Contributors

airloaf avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

v6502's Issues

Support for Unofficial Opcodes

If we look at the op code table we have defined, there are many gaps. These gaps represent unofficial opcodes. While they were not intended to be used as instructions, an actual 6502 cpu can still process it as an instruction.

NESDev Unofficial opcodes This site right here has a list of unofficial opcodes. It even details some NES games which utilize such opcodes. For a true NES emulator these would have to be implemented into the 6502 CPU library.

CPU Monitor

In order to run programs and ensure correctness of the CPU, a CPU monitor should be implemented.

Requirements:

  • View all CPU registers
  • View current location in memory (program counter)
  • Print current instruction

Cycle Accurate Implementation

Currently we are only Instruction accurate since we are not modifying the registers and memory correctly per cycle. NES Dev wiki has a page on the CPU cycle details that should help in making a cycle accurate emulation of the 6502 processor. Cycle Details.

Remove Default case in instruction tick

The default case for this switch statement should never be called on, but it is required for successful execution of the processor. We need to figure out why this is the case and remove it.

image

Remove allocations for addressing modes and instructions

The CPU is very sluggish when running it on VNES. I can imagine it has to do with all the allocations that come into play when creating a new instruction as well as addressing modes. I think the best move will be to move the addressing mode functionality within the instruction class and we should only allocate a single instruction object and re-use it constantly. This should improve the CPU's performance greatly.

NesDev CPU Tests

On the NesDev wiki, there are many CPU tests which can test the correctness of our CPU. CPU Tests

Requirements:

  • Implement test to check for NesTest.nes by kevtris
  • Implement test to check for nstr_test_v5 by blargg

Tests and implementation for interrupts

We currently do not have tests for interrupts (BRK, NMI and IRQ).

We should test for the following scenarios

  • IRQ during a BRK
  • NMI during a BRK
  • Properly returning from an interrupt
  • IRQ when the I flag is set

Pipelined instructions

The 6502 performs some form of pipe lining. The first cycle of each instruction (getting the actual opcode of the instruction) occurs at the last cycle of the previous instruction. This is also why crossing page boundaries on some instructions causes an extra cycle to be thrown. See the cycle information for each instruction here

Change Address Bus to Memory Bus

The name Address Bus should be changed to Memory Bus. According to the datasheet, you write addresses to the address bus and then read the data for that corresponding address in the data bus. Memory Bus is a more suitable name since it both reads and writes into memory.

Unit Test Instructions Individually

The current tests for V6502 are difficult to write. They involve writing certain values into memory. We should unit test the instructions individually. In order to do so, we will need to extract each function and have the bare necessaries required to execute each individual instruction.

Doxygen Documentation

Doxygen can create some good looking documentation web pages. This should be used when uploading a web format of the API.

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.