Git Product home page Git Product logo

chip-8xx's Introduction

Chip-8xx

Chip-8 emulator with assembler written in C++.
See chip8.md for information about CHIP-8 assembly.

Examples

Program to show the pressed key:

	ld v0, 5
	ld v1, 5

loop:
	ld v4, K
	ld F, v4
	cls
	drw v0, v1, 5
	jp loop

Program to move a ball using WASD keys:

define W v2
define A v3
define S v4
define D v5
define KEY vC
define BEEP_TIME vD
define XPOS v0
define YPOS v1
define LIM vA
define ONE vB

	ld I, ball ; Load sprite
	ld ONE, 1
	ld XPOS, 0
	ld YPOS, 0
	ld W, 0x5 ; W
	ld A, 0x7 ; A
	ld S, 0x8 ; S
	ld D, 0x9 ; D
	ld BEEP_TIME, 4
loop:
	ld KEY, K
	ld ST, BEEP_TIME
	; Move X
	sknp A
	sub XPOS, ONE
	sknp D
	add XPOS, ONE
	; Move Y
	sknp S
	add YPOS, ONE ; Y is inverted
	sknp W
	sub YPOS, ONE
	; Constrain
	ld LIM, 63
	and XPOS, LIM
	ld LIM, 31
	and YPOS, LIM
	; Clear & Draw
	cls
	drw XPOS, YPOS, 2
	jp loop


ball:
db 0b11000000
db 0b11000000

chip-8xx's People

Contributors

cmdneo avatar

Stargazers

 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.