What's new

Chip 8

Doomulation

?????????????????????????
Since super chip 8 just has double precision that chip 8 that would mean that you need to do chip8 gfx in super chip 8 resolution to achieve perfect emulation (which you'd know if you had read me doc). This really explains the "half-pixel" shift that winter's doc speaks about.
 

XTale

New member
I'm actually using your doc -- I just should have read the part about video emulation more closely ;)
 

XTale

New member
Which game is using the shift-right/left opcodes? I wanted to implement these, but I don't know which file to use for testing (I am too lazy to try out all the roms ;))
 

blueshogun96

A lowdown dirty shame
hap said:
Why rewrite ? The chance is big you'll make some same mistakes again, and new ones.

I had another quick look:
8xxx: no default in the switch
8xx6: carry is wrong
8xxe: opcode isn't there
cxxx: and, not modulo
dxxx: 00 and default should be switched around!! also, there's no break in the default case
exxx: no default in the switch
fxxx: no default in the switch
fx55 and fx65 will probably overflow and crash the emu, since you're using the contents of the register instead of the register number for the loop
Hey :)

Sorry it took me so long to reply to your post (almost a month), but I applied your fixes and I found a few possible bugs on my own. Thanks for your help sir, I really appreciate you. It's not exactly up to par yet, but here is what I'm getting so far. I attached my current source and pics below.

EDIT: Thanks to hap, I fixed my invaders crash. But many games still tend to get "stuck".

tapeworm
tapeworm.jpg


invaders
invaders.jpg


ibm
ibm.jpg


ch8pic
ch8pic.jpg


alien
alien.jpg
 
Last edited:

ShizZy

Emulator Developer
Nice :p A little hard to read, but progress. If you want, I'll take a look at your source for bugs.
 

blueshogun96

A lowdown dirty shame
ShizZie said:
Nice :p A little hard to read, but progress. If you want, I'll take a look at your source for bugs.
Thank you sir, I appreciate it. :bouncy:
I'll take another look this afternoon to see if I see anything else wrong. :icecream:

EDIT: I noticed a small bug in my debugger. Nothing major, just anoying. Haven't gotten a chance to fix it as of yet.
 

ShizZy

Emulator Developer
Okay, downloaded your files, and looked them over briefly. It's a mess :p That's okay, I'm a pretty sloppy coder too. I'll try and find some more time to actual pick through it and spot some bugs.
 

XTale

New member
OK - I had some time to look at my emulator again.
I just implemented the scroll left/right. Ant is scrolling left correctly, but neither the nice ant-sprite nor the arrow sprite will show up after scrolling :/

fish'n'chips shows the sprites - but doesn't have a debugger. crazychip8 and jachtse (which both have a debugger) can't emulatore ant :(
Is there a chip8 emulator with debugger that may be helpful to find my ant bug?

Another thing: How are you doing the timing stuff? atm my emulator renders as fast as the system allows (if you choose a big enough screen sdl slows it down enough to play the games ;)) - that's not how an emulator should behave.
But I don't really now how to do the timing/synchronization right.
 

Doomulation

?????????????????????????
Yes, I did have one. But that's at home, though. Maybe I can compile a release version with the debugger to supply you with. Otherwise there should be other debuggers out there - or even better yet, you could write your own. Good experience.
 

refraction

PCSX2 Coder
yes write your own debugger, thats probably the best idea.

if you are using SDL there is a speed limiter function in the library which you could use which is probably the best solution for slowing it down, alternatively you can set it to run say one opcode every 1000 ticks on your processor which will slow it down, but unfortunately this could prove slow for other machines.

as for actual timing, there isnt really any as such, the only specificatoins i know is it runs 60 ops per second and the screen is updated on every draw command.
 

XTale

New member
hm...
I tried to limit it to 60 ops / second using SDL_GetTicks():

Code:
   int timer;
    for (;;)
    {
        timer=SDL_GetTicks();
        cpu->executeOP();

        //get all events
        while(SDL_PollEvent(&event))
        {
           //eventhandling
        }
        int timer2 = SDL_GetTicks();

        if ((timer2-timer)<16) {
            SDL_Delay(16-(timer2 - timer));
        } 
    }

60ops/sec -> 16ms for each op, and SDL_Delay should return ms - but using this I jsut get something around 2fps ;) (see efcs16.7z)
You're sure that chip8 is really SOO slow?
 

hap

New member
Chip8 doesn't have a predefined 'cpu' speed, since it's just an interpreter.
Yes, 60 ops per second is too slow, go for something like 600 per second; just emulate 10 ops in one 60hz timeslice.
 

Doomulation

?????????????????????????
It's hard to say, really. Some games seem to require more power than some others. And super chip 8 definetly require more than regular chip 8.
 

newsdee

New member
Chip8 emulator in Flash

Hi all, I've been lurking here for a while while I was writing my Schip8 emu in Flash. I'm almost done with it, so here's the link:
Code:
[URL="http://newsdee.com/flip8/"]Flip8 Redux[/URL] (Flash 8 required).
The debugger is pretty good, and you can load games from your browser. The debugger should be useful to compare with your emu if you are trying to see how a command should perform. I still have one or two elusive bugs (games marked as yellow or red won't work correctly) but everything else is in working order. If you suspect what might be wrong with a game, feel free to let me know. :cat:
 

hap

New member
Welcome newsdee :p . Flip8 Redux is working well over here. It's nice, to the end user, that you've remapped controls to the arrow keys/spacebar.

- If the Space Fight 2091 bug is a dance of messed up sprites, I've fixed that by adding a carry check to opcode fX1e, though I'm not sure if that's correct.
- In my emulator, Schip8 mode test counts from 0 to 9, not from 0 to a.
- U-Boat: too much description text (part of the small orange text goes under the game list)

Could you upload some, I mean many ;p, of the 'roms' to here ? : flip8 logo, laser, loopz, matches, memory, airplane, figures, landing, paddles, pong (1 player), soccer, space flight, time bomb, tron, hex mixt, linedemo, robot demo, screen test, schip8 test 128, worms, newsdee's font test

*edit* nevermind, I've found them... and extracted yours (logo, fonttest) from your emulator.
'memory' is not a ROM btw, it's a plain text file :p
 
Last edited:

hap

New member
New version of my emulator. My homepage is dead, so I'll upload it here.

- cleaned up a bit of source code (renamed standard typedefs to prevent collision with Windows typedefs, removed support for binary, merged font.h with fishie.h to data.h, shortcuts for commonly used functions, version info)
- changed some default settings (higher CPU speed, disabled wrapping, different colours, larger window)
- removed the ROMs from the release, even though they're freeware
- the loaded ROM filename is now shown in the titlebar
- timing should be more accurate
- added a $100 start address option, for Boot-128 (so the start address selector added in 1.1 was useful after all)
- moved font data to the $000-$0FF region

*edit* removed the files, this is an outdated version, you may get the current version from my homepage (see profile)..
 
Last edited:

hap

New member
***
Sorry, emutalk gave an error on uploading the update, "Upload failed due to failure writing temporary file." Get it from my homepage: http://hap.samor.nl/
***


A collection of CHIP-8 (c8), CHIP-8X (c8x), and SCHIP (sc) programs, including hybrid ones (mixed with 1802 code). Authors, if known, are placed between brackets. If you have any additions and/or corrections, post them here, and (as long as I'm alive and interested in CHIP-8 :p ) I'll update this post.

These programs are free. They should not be sold or used for commercial purposes without permission from the author(s). My apologies for purposely excluding documentation or source code of individual programs; it would make this collection a bit too bloated.

If you're having trouble downloading it, you can get a copy at my homepage: hap's stuff

Code:
*** history ***

started Jan 7th 2006 (83 entries)

Feb 15th 2006:
- added Chip8 emulator Logo [Garstyciuks].c8
- added Keypad Test [hap].c8
- added Scroll Test (modified) [Garstyciuks].sc

Feb 17th 2006:
- added Loopz (with difficulty select) [hap].sc

Apr 1st 2006:
- removed version numbers from filenames
- Boot-128: removed note from filename that start address=$100
- Vers is by JMN
- Worm is by RB
- Brix is by Andreas Gustafsson
- switched Space Invaders a1 and normal (a1=older version now)
- switched Guess a1 and normal (a1=older version now)
- renamed SYZYGY to Syzygy
- renamed Race to Car Race Demo [Erik Bryntse]
- added Brick (Brix hack).c8
- added Blinky [Hans Christian Egeberg] (a1).c8 (older version)
- added Field! [Al Roland] (a1).sc (older version)
- added Joust [Erin S. Catto] (a1).sc (older version)
- deleted X-Mirror.c8, looks like a garbage file to me

Apr 8th 2006:
- added Sokoban [hap].sc

Apr 9th 2006:
- added (correct) X-Mirror.c8

Apr 11th 2006:
- added Addition Problems [Paul C. Moews].c8 (from a 1979 article about CHIP-8
  on the COSMAC ELF)
- renamed Kaleid to Kaleidoscope
- updated Sokoban (and a1=older version)

Jun 8th 2006:
- Kaleidoscope is by Joseph Weisbecker
- Wipe Off is by Joseph Weisbecker
- added Video Display Drawing Game [Joseph Weisbecker] (hybrid).c8 (all the
  non-CHIP-8 code does is saving the drawing into memory, so it works fine)
- added several games from the RCA COSMAC VIP Game manual (probably from the
  late 70s), courtesy of Josh Bensadon:
  * Animal Race [Brian Astle].c8
  * Bingo [Andrew Modla] (hybrid).c8
  * Biorhythm [Jef Winsor].c8
  * Blackjack [Andrew Modla] (hybrid).c8
  * Blockout [Steve Houk].c8x
  * Bowling [Gooitzen van der Wal].c8
  * Deflection [John Fort].c8
  * Lunar Lander.c8
  * Message Center [Andrew Modla] (hybrid).c8
  * Most Dangerous Game [Peter Maruhnic].c8
  * Pinball [Andrew Modla] (hybrid).c8
  * Programmable Spacefighters [Jef Winsor].c8
  * Reversi [Philip Baltzer].c8
  * Sequence Shoot [Joyce Weisbecker].c8
  * Slide [Joyce Weisbecker].c8
  * Sum Fun [Joyce Weisbecker].c8
- renamed all "a1" to "alt"
- Boot-128 is a hybrid program

Dec 27th 2006:
- added Rush Hour [hap].c8

Jul 29th 2007:
- added SCHIP Test [IQ_132].sc

Aug 9th 2007:
- added BMP Viewer [IQ_132].sc
- added BMP Viewer (Google) [IQ_132].sc
- added BMP Viewer (16x16 tiles) [IQ_132].sc (for this to be useful, you'll need
  a converter available at http://neosource.1emu.net/forums/index.php?topic=713.0 )
- added BMP Viewer (16x16 tiles) (MAME) [IQ_132].sc

Feb 8th 2008:
- added Bounce [Les Harris].sc
- updated Rush Hour (and alt=older version)


*** complete list ***

15 Puzzle [Roger Ivie] (alt).c8
15 Puzzle [Roger Ivie].c8
Addition Problems [Paul C. Moews].c8
Airplane.c8
Alien [Jonas Lindstedt].sc
Animal Race [Brian Astle].c8
Ant - In Search of Coke [Erin S. Catto].sc
Bingo [Andrew Modla] (hybrid).c8
Biorhythm [Jef Winsor].c8
Blackjack [Andrew Modla] (hybrid).c8
Blinky [Hans Christian Egeberg] (alt).c8
Blinky [Hans Christian Egeberg].c8
Blinky [Hans Christian Egeberg].sc
Blitz [David Winter].c8
Blockout [Steve Houk].c8x
BMP Viewer - Flip-8 logo [newsdee].sc
BMP Viewer - Hello (C8 example) [hap].c8
BMP Viewer - Kyori (SC example) [hap].sc
BMP Viewer - Let's Chip-8! [Koppepan].sc
BMP Viewer (16x16 tiles) (MAME) [IQ_132].sc
BMP Viewer (16x16 tiles) [IQ_132].sc
BMP Viewer (Google) [IQ_132].sc
BMP Viewer [hap].sc
BMP Viewer [IQ_132].sc
Boot-128 (hybrid).c8
Bounce [Les Harris].sc
Bowling [Gooitzen van der Wal].c8
Breakout (Brix hack) [David Winter].c8
Brick (Brix hack).c8
Brix [Andreas Gustafsson].c8
Car [Klaus von Sengbusch].sc
Car Race Demo [Erik Bryntse].sc
Cave.c8
Chip8 emulator Logo [Garstyciuks].c8
Chip8 Picture.c8
Connect 4 [David Winter].c8
Deflection [John Fort].c8
Emutest [hap].sc
Field! [Al Roland] (alt).sc
Field! [Al Roland].sc
Figures.c8
Filter.c8
Fishie [hap].c8
Font Test [newsdee].sc
Guess [David Winter] (alt).c8
Guess [David Winter].c8
H. Piper [Paul Raines].sc
Hex Mixt.sc
Hidden [David Winter].c8
IBM Logo.c8
Joust [Erin S. Catto] (alt).sc
Joust [Erin S. Catto].sc
Kaleidoscope [Joseph Weisbecker].c8
Keypad Test [hap].c8
Landing.c8
Laser.sc
Line Demo.sc
Loopz (with difficulty select) [hap].sc
Loopz [Andreas Daumann].sc
Lunar Lander.c8
Magic Square [David Winter].sc
Matches.sc
Maze [David Winter] (alt).c8
Maze [David Winter].c8
Maze [David Winter].sc
Merlin [David Winter].c8
Message Center [Andrew Modla] (hybrid).c8
Mines! - The minehunter [David Winter].sc
Missile [David Winter].c8
Most Dangerous Game [Peter Maruhnic].c8
Paddles.c8
Pinball [Andrew Modla] (hybrid).c8
Pong (1 player).c8
Pong [Paul Vervalin] (alt).c8
Pong [Paul Vervalin].c8
Pong 2 (Pong hack) [David Winter].c8
Programmable Spacefighters [Jef Winsor].c8
Puzzle.c8
Reversi [Philip Baltzer].c8
Robot.sc
Rocket Launch [Jonas Lindstedt].c8
Rocket.c8
Rush Hour [hap] (alt).c8
Rush Hour [hap].c8
SCHIP Test [IQ_132].sc
Scroll Test (modified) [Garstyciuks].sc
Scroll Test.sc
Sequence Shoot [Joyce Weisbecker].c8
Single Dragon (Bomber Section) [David Nurser].sc
Single Dragon (Stages 1-2) [David Nurser].sc
Slide [Joyce Weisbecker].c8
Soccer.c8
Sokoban [hap] (alt).sc
Sokoban [hap].sc
Space Flight.c8
Space Invaders [David Winter] (alt).c8
Space Invaders [David Winter].c8
Spacefight 2091 [Carsten Soerensen].sc
Squash [David Winter].c8
Sum Fun [Joyce Weisbecker].c8
Syzygy [Roy Trevino].c8
Tank.c8
Tapeworm [JDR].c8
Test 128.sc
Test.sc
Tetris [Fran Dachille].c8
Tic-Tac-Toe [David Winter].c8
Timebomb.c8
Tron.c8
U-Boat [Michael Kemper].sc
UFO.c8
Vers [JMN].c8
Vertical Brix [Paul Robson].c8
Video Display Drawing Game [Joseph Weisbecker] (hybrid).c8
Wall [David Winter].c8
Wipe Off [Joseph Weisbecker].c8
Worm [RB].sc
Worms.sc
X-Mirror.c8

total: 119
 
Last edited:

Top