Giter Club home page Giter Club logo

chip8-asm64-emu's Introduction

CHIP-8 64-bits assembly emulator

This emulator was written from scratch originally with the help alone of the Wikipedia (CHIP-8), and later on with Cowgod's Manual.

The emulator is written in a single main.s assembly file and graphics are rendered to screen through the help of SDL, which you need if you want to compile. The emulator was written for the x86-64 platform under Linux (important to note that the data is stored in memory as little-endian, primarily to swap two bytes, as the CHIP-8 uses big-endian).

The file is heavily commented, so you should be able to follow along even if you have little experience with assembly, and I hope it can teach people something.

As for a quick overview on the code, the machine registers and program memory are just "variables" defined on the .data segment.

There are methods to set/unset the pressed state of the keys, to draw the screen buffer, and to beep while the sound timer is not zero.

The emulateprogram method reads instructions one by one and parses the operation by jumping to the right position (e.g. 0xFx29 jumps to F), further performing more comparisons if more fine-tuning is necessary to determine the operation to execute. There's a delay to mimic the 60Hz of the machine, and events (e.g. key events) are polled right proceeding.

The main method reads the ROM into memory and sets up SDL, exiting on error.

I do not own any of the ROMs available in the roms/ folder, which were picked up from other several websites hosting them, neither I do own the text written by Thomas P. Greene CHIP8-TECHNICAL.txt.

An amazing reference on calling conventions (and more) for the x86-64 platform is available at http://wiki.osdev.org/System_V_ABI#x86-64.

You can find most of the used SDL methods on https://wiki.libsdl.org/.

chip8-asm64-emu's People

Contributors

davidbuchanan314 avatar lonami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.