Code Monkey home page Code Monkey logo

batatinha-core's Introduction

Batatinha core

This is (not a libretro core, don't ask) a Java CHIP-8/Superchip emulator library, made from the guts my other CHIP-8 emulator (Batatinha), created to be used on an Android port (Batatinha v2).
It is based on the VIP and SCHIP 1.1 instruction sets, auto choosing which based on the instructions used. Some newer games are made to be run with Octo instruction set, so they might not run correctly.

Usage:

  1. Instantiate Chip8 class: final Chip8 chip8 = new Chip8();
  2. Call the loadProgram(InputStream program) method: chip8.loadProgram(new FileInputStream(file));
  3. Call the step() method for each cpu tick: for(int i = 0, i < 8; i++){ chip8.step(); } //~500Hz @ 60fps
  4. Call the timerStep() method separately at 60Hz, it returns true if theres a sound beep
  5. Get the display framebuffer from the getDisplayBuffer() method, it is an array composed of 0s and 1s, just draw it using your favorite method
  6. Input is processed using the methods presKey(Key key) and releaseKey(Key key)
  7. Use the sineWave(int frequency, int amplitude, int sampleRate, int sampleSize) method from the class Buzzer along with the emun Note to create a sine wave that can be played with a Clip

References:
http://mattmik.com/retro.html
http://devernay.free.fr/hacks/chip8
https://github.com/Chromatophore/HP48-Superchip
https://github.com/AfBu/haxe-CHIP-8-emulator/wiki/(Super)CHIP-8-Secrets
https://github.com/JohnEarnest/Octo

batatinha-core's People

Contributors

jbatistareis avatar

Stargazers

 avatar

Watchers

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