Giter VIP home page Giter VIP logo

6502's Introduction

6502 Emulator CI codecov

What's a 6502?

It was the CPU of choice for the very first mass market home computers and so, played a central role in the home computer revolution.
It was the brain of the first computers from Apple, Commodore, Acorn, and Atari. It ran the Atari 2600 game console, and its core was incorporated into the central processor of Nintendo's NES.

Compiling / Building

Installing Dependencies

Arch Linux

yay -Sy clang cmake lcov glfw libx11 libxcursor libxinerama libxrandr vulkan-headers xorg-server-devel xorg-xinput

Ubuntu

sudo apt-get install clang cmake lcov libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev

Usage

Setup

This will build cmake files and download dependencies

make setup

Build

# Debug build
make debug
# Release build
make release

Run Tests

This will build and run unity tests

make test

Code Coverage Checks

This will build and run unity tests and generate reports for coverage (depends on lcov)

make coverage
# This part is optional: Generates a html with more coverage details
genhtml build/coverage/coverage.info --output-directory build/coverage/out

Clean

This will delete generated files for debug and release

make clean

Run Binary

# Debug bin
./build/debug/bin/6502
./build/debug/bin/6502_disasm
# Release bin
./build/release/bin/6502
./build/release/bin/6502_disasm

Simulator

This emulator is based on Easy6502, all ASM examples in easy6502 website should run fine in our implementation.

Compiling ASM

You need to install C65 in your machine, create a file with the ASM you want to compile and run the following command:

cl65 -t none test-program.asm

This will compile and link a binary with your code, to run this in your emulator you need to:

./build/release/bin/6502 <path-to-your-bin>/test-program

You can find some precomiled examples in the resource folder.

State

Implemented OPCODES

  • ADC
  • AND
  • ASL
  • BCC
  • BCS
  • BEQ
  • BIT
  • BMI
  • BNE
  • BPL
  • BRK
  • BVC
  • BVS
  • CLC
  • CLD
  • CLI
  • CLV
  • CMP
  • CPX
  • CPY
  • DEC
  • DEX
  • DEY
  • EOR
  • INC
  • INX
  • INY
  • JMP
  • JSR
  • LDA
  • LDX
  • LDY
  • LSR
  • NOP
  • ORA
  • PHA
  • PHP
  • PLA
  • PLP
  • ROL
  • ROR
  • RTI
  • RTS
  • SBC
  • SEC
  • SED
  • SEI
  • STA
  • STX
  • STY
  • TAX
  • TAY
  • TSX
  • TXA
  • TXS
  • TYA

License

This is free and unencumbered software released into the public domain For more information, please refer to http://unlicense.org/

6502's People

Contributors

lucascebertin avatar rafaeldelboni avatar

Watchers

 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.