This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BigSHinyToys's profile picture

CHIP-8

Started by BigSHinyToys, 07 November 2012 - 10:46 PM
BigSHinyToys #1
Posted 07 November 2012 - 11:46 PM

After reading http://hackaday.com/2012/11/06/reliving-1977s-cutting-edge-computer-with-the-pocket-mini-computer/ I was thinking how hard would it be to make an emulator for the http://en.wikipedia.org/wiki/COSMAC_VIP that could run CHIP 8 and make all the CHIP 8 games palyable on the Computer Craft computers. original it was a 1.6 Mhz machine with 4 KB RAM I'm just guessing but i think it might be possible.

look at these games made for CHIP 8
http://www.chip8.com/?page=84

so I'm posting this here for destruction of feasibility of emulating CHIP 8 on the CC computer.
nitrogenfingers #2
Posted 08 November 2012 - 12:14 AM
I'm not familiar with CHIP-8, but over a browse on their website it does seem like an intelligent choice of emulation (one of the very, very, very few).

As most chip languages are very low level, and Lua is very high level there will be a high level of redundancy, memory operations for example but that almost makes it a more attractive option.

Can't afford the time to look into this in much detail but will keep my eye on the thread.
Sorroko #3
Posted 08 November 2012 - 07:47 AM
Brilliant idea, I shall see how far i can get with making something like this if you don't mind. Of course, knowing me I won't get very far. :P/>/>
BigSHinyToys #4
Posted 08 November 2012 - 09:46 AM
@nitrogenfingers

I had not considered things from that perspective you are right there would be huge redundancy. I was thinking it might be possible good to hear another with the same opinion

Brilliant idea, I shall see how far i can get with making something like this if you don't mind. Of course, knowing me I won't get very far. :P/>/>
I just ran across something interesting and wanted to see what people thought about it you don't need any permission from me to do this so have fun
AfterLifeLochie #5
Posted 08 November 2012 - 06:33 PM
From the sites listed above and the specifications I've found around the place, I've started knocking up a prototype.

It doesn't support many useful opcodes (yet), but has all the tables, memory and pointers it needs. It currently has the classic restrictions (4K memory, 16x 8-bit registers for objects), but, I haven't bothered implementing checking for overflows and other related problems. Something, at least. :P/>/>
gamax92 #6
Posted 10 November 2012 - 08:53 AM
I'm wondering, how are you going to properly impliment keyboard input. Keyboard input in CC is like DOS.
holding a key = first key, then delay, then a whole lotta keys

Where in chip-8, the input is expected to be like:
holding a key = key stays down.
Xtansia #7
Posted 10 November 2012 - 12:08 PM
The only real issues with trying to implement a CHIP-8 emulator in CC, are:
- The fact that CC doesn't have key_up/down events or a static way of getting key states
- It would be impossible to get 60Hz (ie 60 'cycles/ticks/steps' a second) in CC
gamax92 #8
Posted 12 November 2012 - 08:57 AM

Presenting, Gamax92's CHIP-8 emulator, created in 2 days.
My Emulator for the most part works, It fully passes Tronix's test rom up to the SuperCHIP features, not gonna impliment them.




NOTE: The display on the terminal looks like crap because it has to compress 64x32 to 50x18, That is why a monitor is required.

I recommend you use CCInput so you can play on the monitor.

Usage: chip8 <rom> <monitor side> <debug: any random string>

Changelog:

V1.1.1

New Terminal rendering code, isn't as blotchy as before.


V1.1.0:
Found a bug where the FX55 and FX65 opcodes were writing to string registers instead of interger registers.
Added overflow checking of FX1E opcode.
Added overflow checking of 8XYE opcode.
15puzzle now works.


V1.0.0

First release

Many programs don't work correctly, and the ones that partially work don't display correctly.

15puzzle doesn't work, blinky doesnt work, pong's paddles dont work.

pong's paddle detection is broken, detects above the paddles.

spaceinvaders's title scroll doesn't work. Fails test rom.
BigSHinyToys #9
Posted 12 November 2012 - 10:59 PM
I have hacked in chip 8 launch support in Mouse File Browser
http://pastebin.com/nzyscgZm
This is not an full release of mouse file browser.
It now has support for spaces in file and folder names meaning you can launch games directly and not need to rename all of them.

Chip 8 games can be downloaded from http://www.chip8.com/?page=109

to use the Chip8 launch you need gamax92's emulator saved as "chip8" on the computers root "/chip8" and a monitor on any side (don't wrap to the monitor!) then run mouse file browser and you can launch games with spaces in there names by right click them and selecting chip8

upon gamax92's request I will remove this launch capability from my program (If you would like me to do that that is.)

The emulator works better than I expected and there are some interesting games from chip8 great work gamax92
gamax92 #10
Posted 13 November 2012 - 12:52 PM
Thanks! For usage of my programs in other things, I only expect credit and that the original work is still intact.