What's new

Chip 8

Doomulation

?????????????????????????
Well, as I think ector stated before, the gc is actually easier to emulate than the older systems (eg snes?). Meh, it doesn't matter.
 

Lordus

New member
Anyway thanks for the suggestions.
Another thing i would find interesting, is to do something like a virtual console. I mean to design the emulated machine myself... as i like to do pointless projects.
Probably the software for testing might be a bit scarce though :whistling
But i could make a compiler for it and write some. I like the idea at least.
Or am i completely stupid? :blush:
 

ShizZy

Emulator Developer
Would be a cool idea, but a shit load of work. Would be even cooler if you could build the system when you're done, but doubt that's gonna happen :p
 

Lordus

New member
Yeah and then someone can emulate it :term:
No, but really i am getting more and more into the idea. And i am kind of doing something like that professionaly, so i can at least estimate what a shit load of work it might be...
At least i wont give up the idea and work on it a bit to get an overview. Anyway ill still continue with 'normal' emulators and i kind of started with Genesis now, so all this is off topic now, but still more on topic than PDF, so i dont feel guilty...
 

XTale

New member
I've a small question regarding the jump opcode.
The first Opcode in Blitz is the following:
0x1217 --> jump to 217

OK - I'm jumping to 217 and I'm lost ;)
I looked at CrazyChip Debugger and there it jumps to 216 (the right location). But why 216??
 

Lordus

New member
The first opcode after the jmp is A341h and it is at position 17h in the blitz rom, so at 217h in your ram. Im jumping there and it works.
 

XTale

New member
Hm... ok
than the CrazyChip Debugger output is crap - and I've some other mistakes in the emulator (as I don't see anything on the screen).

OK, I'll keep on trying ;)
 

blueshogun96

A lowdown dirty shame
Doomulation said:
Snes, afaik, is awfully complicated.
I agree. I'm not an snes emu author, but sound on snes is hard to emulate correctly afaik. The only accurate snes emulator I know of is znes.

I was thinking about Genesis or Atari2600
I'd reccomend genesis first because its VERY hard to find sufficient (as well as accurate) documentation on the atari2600. I had the same idea (using OpenGL for an atari emulator) and let me tell you, it aint easy. I'm not trying to be discouraging at all because I'm sure you can do it but trying to emulate PitfallII is no walk in the park.

than the CrazyChip Debugger output is crap - and I've some other mistakes in the emulator (as I don't see anything on the screen).
Yeah, I noticed that some of it's core operations were in the wrong places, emulating the wrong instructions at the wrong time. That is part of the reason why you are getting those errors.
 
Last edited:
S

shangt

Guest
Hey guys I've been writing a chip8 emulator but there are some problems. Look at these screenshots, I cant figure out what is wrong, I debugged my opcodes and its all fine except the error appear when it draws sprites

Blitz:
1blitz2zy.gif


Space Invaders:
2si0oe.gif


Pong:
3pong0nd.gif


here is my drawing code:

Code:
v[0xF] = 0;

for(int row = 0; row < n; row++)
{
    pixels = memory[i + row];
                        
    for(int pixel = 0; pixel < 8; pixel++)
    {
        if((pixels & (0x80 >> pixel)) != 0)
        {
            if(vid_mem[v[x] + pixel + ((v[y] + row) * 64)] == 1) v[0xF] = 1;
        }

        else vid_mem[v[x] + pixel + ((v[y] + row) * 64)] ^= 1;
    }
}
            
for(int yb = 0; yb < 32; yb++)
    for(int xb = 0; xb < 64; xb++)
        if(vid_mem[xb + (yb * 64)] != 0)
            putpixel(buffer, xb, yb, 0xFF);
        else putpixel(buffer, xb, yb, 0x0);
                            
stretch_blit(buffer, screen, 0, 0, 64, 32, 0, 0, 640, 480);

Anyone got an idea :icecream:
 

hap

New member
Code:
changing:

        if((pixels & (0x80 >> pixel)) != 0)
        {
            if(vid_mem[v[x] + pixel + ((v[y] + row) * 64)] == 1) v[0xF] = 1;
        }

        else vid_mem[v[x] + pixel + ((v[y] + row) * 64)] ^= 1;

to:

        if((pixels & (0x80 >> pixel)) != 0)
        {
            if(vid_mem[v[x] + pixel + ((v[y] + row) * 64)] == 1) v[0xF] = 1;
            vid_mem[v[x] + pixel + ((v[y] + row) * 64)] ^= 1;
        }

helps ?
 

XTale

New member
My brix looks the same, and the ball collides with the stones -- but collision detection doesn't work with the paddle --> still unplayable ;)
 
S

shangt

Guest
damn what would cause this

the ones digit is always 0 it does this in brix too until you reach 10, 20 etc

from "Guess"

5guess3pd.gif
 
S

shangt

Guest
memory = v[x] / 100;
memory[i + 1] = (v[x] % 100) / 10;
memory[i + 2] = v[x] % 10;


I debugged this bcd instruction it is correct im pretty sure. maybe the error its from 8XY4 because this error occur when it calls that opcode many times in succession. maybe set carry is wrong i have been following doomulations docs

Code:
case 0x0:
    v[x] = v[y];
    break;
                    
case 0x1:
    v[x] |= v[y];
    break;
                    
case 0x2:
    v[x] &= v[y];
    break;
                    
case 0x3:
    v[x] ^= v[y];
    break;
                    
case 0x4:
    v[0xF] = v[x] & 0x1;
    v[x] += v[y];
    break;
                    
case 0x5:
    if(v[x] >= v[y]) v[0xF] = 1;
    else v[0xF] = 0;
    v[x] -= v[y];
    break;
                    
case 0x6:
    v[0xF] = v[x] & 0x1;
    v[x] >>= 1;
    break;
                    
case 0x7:
    if(v[y] >= v[x]) v[0xF] = 1;
    else v[0xF] = 0;
    v[x] = v[y] - v[x];
    break;
                    
case 0xE:
    v[0xF] = (v[x] >> 7) & 0x1;
    v[x] <<= 1;
    break;
                    
default:
    break;
 

hap

New member
a carry is generated on overflow, so in this case it's something like v[0xf]=(v[x]+v[y])>0xff; or v[0xf]=(v[x]+v[y])>>8;
 

gunder

New member
Hello all, I've been gone for a while due to some real life problems. I'm back now and I want to start working on my Chip8 emu again. I searched through all 58 pages of this thread looking to see what rom most of you got working first but I wasn't able to find anything. Do any of you have any suggestions about which would be a good one to try and get working first?

-gunder
 
S

shangt

Guest
hap said:
a carry is generated on overflow, so in this case it's something like v[0xf]=(v[x]+v[y])>0xff; or v[0xf]=(v[x]+v[y])>>8;

well hap. i tried this method but it gives the same effect.

so do you know of good docs because all docs must be inaccurate including doomulations docs. even though at zophar's domain his emulator doesnt have those errors! SO, i downloaded the Chuit source code from zophar and his opcodes.cpp is empty!! what is this a monopoly :yucky:
 

blueshogun96

A lowdown dirty shame
Hey everybody, I finally finished my chip8 emulator. I call it ChipAint. I stopped working on it for a while, then got back to it later because I had another project to tend to. It uses OpenGL API for the graphics. But it isn't working too well. I was wondering if anyone could help me figure out what my problem with my emu is. It does some rather wierd stuff. Besides the screwed gfx sometimes it will get "stuck" between two or more opcodes and the codeindex will go back and forth between two numbers. :huh:

The emu has some useful features though, it outputs a debuglog.txt and performs a hexdump of the program memory. I get alot of unknown opcodes and wierd results. You can disable these features by editing my source code, change #define LOG Yes to #define LOG No (same goes for hex dump). You can find these defines in CPU.c

I attached the source code and binary below as well as some screen shots if anyone is interested.

tapeworm
tapeworm.jpg


vers
vers.jpg


merlin
merlin.jpg


pong2
pong2.jpg


ch8pic
ch8pic.jpg


cave
cave.jpg


car
car.jpg


EDIT: dragon
dragon1.jpg


http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/alien.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/wipeoff.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/wall.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/ufo.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/tictac.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/syzygy.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/squash.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/spacefig.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/rocket.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/invaders.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/ibm.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/hidden.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/filter.jpg
http://i23.photobucket.com/albums/b374/blueshogun96/ChipAintGLv1_0/field.jpg

Any ideas and/or comments are welcome, thanks. :whistling:

EDIT: You can check my readme file for more info.
 
Last edited:

Top