Git Product home page Git Product logo

chip-8's Introduction

CHIP-8

CHIP-8 emulator in C++. POC for my Bachelor's Degree Thesis.

Opcodes

  • 0x00E0: Clear screen
  • 0x00EE: Return from subroutine
  • 0x1NNN: Jump to location
  • 0x2NNN: Call a subroutine at address NNN
  • 0x3XKK: Skip next instr. if V[X] == KK
  • 0x4XKK: Skip next instr. if V[X] != KK
  • 0x5XY0: Skip next instr. if V[X] == V[Y]
  • 0x6XKK: V[X] = KK
  • 0x7XKK: V[X] += KK
  • 0x8XY0: V[X] = V[Y]
  • 0x8XY1: V[X] OR V[Y]
  • 0x8XY2: V[X] AND V[Y]
  • 0x8XY3: V[X] XOR V[Y]
  • 0x8XY4: V[X] ADD V[Y]
  • 0x8XY5: V[X] SUB V[Y]
  • 0x8XY6: V[X] = V[X] / 2
  • 0x8XY7: V[X] SUBN V[X]
  • 0x8XYE: V[X] = V[X] * 2
  • 0x9XY0: Skip next instr. if V[X] != V[Y]
  • 0xANNN: I = NNN
  • 0xBNNN: pc = NNN + V[0x0]
  • 0xCXKK: V[X] = random byte AND KK
  • 0xDXYN: Display n-byte sprite starting at memory location I (V[X, V[Y]), V[F] = collision
  • 0xEX9E: Skip next instr. if key with value of V[X] is pressed
  • 0xEXA1: Skip next instr. if key with value of V[X] is NOT pressed
  • 0xFX07: V[X] = delay_timer
  • 0xFX0A: Wait for key press, store value of pressed key in V[X]
  • 0xFX15: delay_timer = V[X]
  • 0xFX18: sound_timer = V[X]
  • 0xFX1E: I = I + V[X]
  • 0xFX29: I + location_of_sprite_for_digit_V[X]
  • 0xFX33: Store BCD representation of V[X] in memory locations I, I+1 and I+2
  • 0xFX55: Store registers V[0x0] through V[X] in memory starting at location I
  • 0xFX65: Read registers V[0x0] through V[X] from memory starting at location I

Roms

Tests

  • CHIP-8 splash screen
  • IBM logo
  • Corax+ opcode test
  • Flags test
  • Quirks test
  • Keypad test
  • Beep test

Games

T.B.A.

Side Quests

  • Add debug mode
  • Add telemetry
  • Translate C++ code into WebAssembly
  • Host assembly code on server

Materials

chip-8's People

Contributors

kiwigrenade avatar

Stargazers

 avatar  avatar

Watchers

 avatar

chip-8's Issues

Make timers run on separate threads

The timers should be active only when timer registers are not zero. They should than update with frequency of 60Hz (1/60th of a second) and deactivate when the timer register value is equal to zero. Opcode 0xFX0A should not be affecting the timers.

Test 3 fails

Test test/3-corax+.ch8 fails. Right before entering the infinitre loop some chunks of already printed sprites vanish. Investigate what might cause this.

Slow down cycle speed

The emulator is too fast. I need some kind of internal clock device that will limit the amount of cycles per second.

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.