Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/chip8Public

Chip-8 / Super-Chip emulator

NotificationsYou must be signed in to change notification settings

ajor/chip8

Repository files navigation

Play online athttp://ajor.co.uk/chip8

Native Build

This code has only been tested on Linux, although it may work on other platforms provided the required dependencies are available.

Requirements

  • A C++11 compiler
  • GLFW3
  • GLEW (OpenGL Extension Wrangler)

Compilation

Then compile using CMake:

mkdir buildcd buildcmake ../make

or just run:

g++ main.cpp chip8.cpp font_loader.cpp -std=c++11 -lglfw -lGLEW -lGL -lGLU -pthread -O3 -Wall -pedantic

Emscripten/asm.js Build

Requirements

Compilation

Compile using CMake, substituting the path to the Emscripten.cmake toolchain file on your system:

mkdir buildcd buildcmake ../ -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Releasemake

Usage

Native

./chip8 [options] romOptions:  -i  Instructions per step (default: 10)  -s  Screen scale factor (default: 20)

Emscripten/asm.js

Place chip8.html and the generated chip8.js and chip8.js.mem files in the same directory and open in a web browser.

General

You can adjust the speed of the emulator by changinginstructions_per_step (defaults to 10). This parameter represents the number of Chip-8 instructions executed per frame.

Assuming a frame rate of 60fps, aninstructions_per_step value of 10 (or a little higher) works well for most Chip-8 games tested, but Connect4 needsinstructions_per_step=1 to be playable. Super-Chip games generally need to be run a bit faster - somewhere in the 20-60 range seems to work well.

Keyboard map

Chip-8:    QWERTY keyboard:1 2 3 C        1 2 3 44 5 6 D        Q W E R7 8 9 E        A S D FA 0 B F        Z X C V

Pressing Enter resets the emulator.

Compatibility

  • All Chip-8 and Super-Chip games tested appear to work correctly

TODO

  • Stop using abort() everywhere
  • Fix threading

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp