What's new

Chip 8

hap

New member
Try to get this working perfectly ;)

Code:
Rush Hour for CHIP-8 by hap 17-12-06, http://home.planet.nl/~haps/
Based on a boardgame by Nobuyuki Yoshigahara "Nob" and ThinkFun,
http://www.thinkfun.com/

This game contains 170 puzzles. Most were taken from the original cardsets,
some were made by me, and some were generated with Michel's PyTraffic,
http://alpha.uhasselt.be/Research/Algebra/Members/pytraffic . Refer to
the source code for detailed information on this.

The game should work fine on any CHIP-8 interpreter. Moreover, it has been
tested on an RCA COSMAC VIP (4KB) emulator, so hopefully it will work on the
original machine too. Due to memory constraints, password generation was
removed for the VIP version.


FILES
=====

Rush Hour.txt   this
Rush Hour.c8    game for a CHIP-8 interpreter
Rush Hour.vip   game for the COSMAC VIP (includes the CHIP-8 interpreter)
rh.chp          source code


HOW TO PLAY
===========

The goal of the game is to slide the arrow block(s) out of the 6*6 grid.
Completing 10 boards will be awarded with the inclusion of the next boardset(s)
as seen from the connections on the boardset select screen, a password will be
given so you don't have to complete the game in a single session.

 HEX key   PC key*   Use
---------------------------
 5         W         up
 8         S         down
 7         A         left
 9         D         right
 A         Z         ok/hold to slide
 1         1         option(in-game)/back

* = for interpreters that have the 4*4 keypad at 1234/QWER/ASDF/ZXCV.
 

Doomulation

?????????????????????????
Hmmm, love to, but it seems the good ol' chip8 project doesn't compile anymore. Meh. Lots of work to do to get it working again.
And kudos to Microsoft who seem to have removed the old, good code from their SDK of newer versions. Reaaal nice.... now I have to hunt down old code or substiute it for something else, and frankly, I have no desire.
Anyone have any diutil.h, diutil.cpp, dxutil.h, d3dfont.h from the DX9 SDK lying around?
 
Last edited:

hap

New member
Thanks ShizZy. It shouldn't be too hard getting it to work, CHIP-8 isn't exactly Gamecube ;)

I've never bothered to update the DirectX SDK, well.. I did once, but then the huge download stopped near the 100%, so yeah, I have those files. I see all the files you requested are from /Samples/C++/Common, attached is that whole folder.
 

Doomulation

?????????????????????????
Thanks!
I've lost my SDK a couple of times in the past and well... newer version sucks.
Hmmm, it must be a newer (or older) version than I had, but I found another function to solve my problem.

Well, I don't know how to play it or how it should look like, but here's how it looks for me.
 
Last edited:

nahteecirp

New member
Hey, awhile ago I wrote up a simple Chip-8 challenge for the Ruby community ( Ruby Quiz - Chip-8 (#88) ). It ran successfully there, but I was wondering how good you all thought the explanation was (like how understandable it was, or if I blatantly got something wrong). I figure it would be a pretty good as a down to earth explanation of Chip-8 for those looking to start a Chip-8 emulator, so I'm considering expanding it to cover all aspects of Chip-8. Like I said, just curious to what you guys thought of it. Thanks again.
 

Doomulation

?????????????????????????
First thing I found wrong at your page is this:

Emulation is where raw operation codes (the most low-level way of feeding instructions to a computer) are translated by another computer, giving a totally different system the ability to run programs not designed for it.

That's not right. Emulating means to simulate the workings of the target architecture, so that software designed for it can run on a different platform. That's how I see it. However, emulation does not need to duplicate exactly how the hardware does it; it simply needs to achieve the same OUTPUT.
Remember, the processor is just ONE component of an architecture.

1. Make the emulator read the file. All opcodes are four digit hex numbers,
but those will need to be split.
IMO, it's better to say 2 bytes. Hexdecimal or not, a CPU doesn't care. All opcodes are encoded in bits; it may just be a coincidence that the information can be easily extracted using hex.

0000 This is nothing. If you see this, it should mean that you are at the end
of the file and have nothing left to read, so you therefore need to exit
gracefully.
I'm unsure you should specify this. On languages like C/C++, when you read past the end of file, it doesn't write any data to the buffer at all. Plus, no chip8 game should ever reach the end of the file. If it does, then you've done something wrong. There is an opcode for terminating the system, however.

A note on most/least significant bits: these words can be confusing to people who haven't worked much with bit manipulating. Perhaps you should explain the terms...

Say we had the opcode 100F, that means we would jump to after byte 16 (it is a hex remember).
The jump opcodes specify the exact location in memory to jump to; it is NOT relative. The opcode above is invalid because it would jump to interpreter memory (which ranges from 0 to 0x200). A valid opcode might look like 0x120F.

As for you explanation on carry, I find it simpler to explain how we typically do it. We add or subtract normally and not bit-wise. We simply set carry if the registers loop. That is, if we subtract something and it becomes a negative number (under 0), or we add something and it becomes bigger than 255, in both cases which, due to the registers only being one byte unsigned, they loop.

I haven't checked your opcode table, though, but let me find my doc and I'll check them too.
 

dolqube

Winphin Developer
Nice Post Doomulation ;)

I especially liked

Quote:
That's not right. Emulating means to simulate the workings of the target architecture, so that software designed for it can run on a different platform. That's how I see it. However, emulation does not need to duplicate exactly how the hardware does it; it simply needs to achieve the same OUTPUT.


HLE until the end. :evil:

on another note I was thinking of writing a chip 8 emu today cos i was bored.
and gc emu (is hard!!!) ie. really long and boring.
I always seem to put it for weeks on hold.
 
Last edited:

Danny

Programmer | Moderator
im currently porting TJA's chip8 emu to the psp...

so far its at compiling stage with no errors...

just have to adjust the controls and screen etc now :D

a few other things too , rom browser etc
 

smcd

Active member
I'm going back to learning some basic graphics programming (SDL) so maybe I can finish mine finally - have had the the core done for a while just need graphics (and to set up input for SDL)
 

Danny

Programmer | Moderator
YAY, real progress today, my emu port (to PSP) is now running pong (harcoded to play one rom so i havnt tested more) which seems full speed. :D

now to add control input :)
 
Last edited:

Cyberman

Moderator
Moderator
You know this looks like something fun to port to the Palm.
Hmmm Apart from all the other wacked projects I have this looks like fun. I'll schedule it in a few months. :D

Cyb
 

Danny

Programmer | Moderator
damn input, i never imagined it would be so tiresome..

13hrs and still no shagging input :rofl:

only took 5 to get roms working lol :p

edit : input is working :p finally lol

out of pong and connect4 . imput is only working on connnect 4 ...

the two games seem to use different checks in the code for input so im going to have to do a bit more work yet ;)
 
Last edited:

Danny

Programmer | Moderator
sorry for double post

thought id show you guys the emu so far ;)

Im re-writing it all from scratch though as i dont like the way it was done, so lets hope it doesnt take too long :D

edit - inputs working great now :) just have to touch it up somemore and il release a update :)

btw i called it dreamchip because it was never given a name and i thought dreamchip suited it :p
 
Last edited:

_Chrono_

aka Chrono Archangel
Hey guys. ShizZy kinda inspired me to finally do my Chip8 emu.
All I can offer right now is a screenshot and an explanation.

First off I wrote my emulator in Microsoft Axapta 3.0 (latest version being Microsoft Dynamics AX 4.0) using X++. How cool is that! :p The software itself is an ERP and is in no way geared towards this kind of coding.
The emulator is slow as hell... in part because the language sucks for this kind of stuff and because I'm running through a remote desktop on a slow server.

I would provide source code but I doubt any of you can actually import the project and try it out. Aniway here's a shot. Most games boot but I do have things to add like fonts and input. Still bugs to iron out since UFO crashes.
 

Falcon4ever

Plugin coder / Betatester
zion: How did you do the drawing part for the psp port?

I can imagine doing smth with putpixel would be incredibly slow...

(hehe thats how my current chip8 emu on windows does it... ah well... its like an inbuild gamespeedlimiter :whistling )
 

Danny

Programmer | Moderator
the drawing code was mainly unchanged, just a few lines of code modified.

It does draw slow though and im going to do it a better way once ive finished my other aims for the emu :)

thanks for the question :D

this thread is coming alive once more :D
 

Top