What's new

Chip 8

Doomulation

?????????????????????????
It's quite simple. Each element in the array represents a pixel on the screen. If it's true, then you XOR the pixel in that location (meaning, if there is no pixel at that position, then you write it; and if there is a pixel on that location, you erase it).
If it's false, you do nothing.

Code:
bool Memory[0xFF][0xFF]; // Dummy values!
for (int i = 0; i < 0xFF; i++)
{
    for (int j = 0; j < 0xFF; j++)
    {
        if (Memory[i][i])
            XorPixel(i, j);
    }
}
 

Thesuperchang

New member
I've located the source of quite a few bugs within my emulator, however graphics is cactus. Below is my DXYN (drawing) operation code. For the life of me I cannot figure out what is going wrong with it now.



PHP:
void DrawSpriteXbyN(unsigned short int opCode, bool **screen, unsigned char *gReg, unsigned short int *aReg, unsigned char *memory, _Window *window) {
	// DXYN
	int i, n;
	
	gReg[0x0F] = 0x00;
	for(n = 0; n < (opCode & 0x000F); n++) {
		for(i = 0; i < 8; i++) {
			if( memory[*aReg + n] & (0x80 >> i) ) {
				screen[gReg[(opCode & 0x00F0) >> 4] + n][gReg[(opCode & 0x0F00) >> 8] + i] =
					!screen[gReg[(opCode & 0x00F0) >> 4] + n][gReg[(opCode & 0x0F00) >> 8] + i];
				if(screen[gReg[(opCode & 0x00F0) >> 4] + n][gReg[(opCode & 0x0F00) >> 8] + i] == true) {
					XFillRectangle(window->display, window->window, window->colour[0]->gc, ((gReg[(opCode & 0x0F00) >> 8] + i) * RESOLUTION), ((gReg[(opCode & 0x00F0) >> 4] + n) * RESOLUTION), RESOLUTION, RESOLUTION);// Draw pixel
				}
				else {
					XClearArea(window->display, window->window, ((gReg[(opCode & 0x0F00) >> 8] + i) * RESOLUTION), ((gReg[(opCode & 0x00F0) >> 4] + n) * RESOLUTION), RESOLUTION, RESOLUTION, 0);// Erase Pixel
					gReg[0x0F] = 0x01;
				}
			}
		}
	}
//	*aReg += n;
	
	return;
}

Any suggestions would be greatly appreciated.

Regards,
-Thesuperchang
 
Last edited:

Aire83

New member
Hey Doom. Thanks for replying, but i still don't it. lets say videoMem[0x3a, 0x3c] is true. how do i tell the api to draw the pixel. Do i choose the dimension of the pixel and draw the pixel at (0x3a, 0x3a)?
 

Thesuperchang

New member
I slowed my emulator down to one operation per second. The graphics were mostly fine, with exception to the aliens in INVADERS. My address pointer is probably getting screwed up somewhere. As far as I'm concerned, it's good enough to brush under the bed and start a new project.

The source to my Chip-8 emulator can be found below;
http://www.megaupload.com/?d=ZGEE89D4

The source also contains a very basic graphics library that I made. It calls functions from the X Window System and hides all the verbose crap from the nice looking source. It should work under any system that supports the X Window System.
 

Aire83

New member
k i got the pictures to display on the screen, but how do i make the pictures to fix on the screen? i tried to multiply the position of the pixel to be drawn by 4 cause my window is 4 times bigger but that didnt seem to work

can someone help me?
 

Thesuperchang

New member
My method was to define a constant called RESOLUTION which would act as a magnification multiplier. To draw sprites, rather then doing a draw pixel command, I used a fill rectangle command. The origin of the rectangle multiplied by the constant RESOLUTION as is the width and height. This method is displayed above in an earlier post I made.
 

Aire83

New member
Can someone tell me what's wrong with my draw method?

Code:
 DrawSprite( byte rVX, byte rVY, byte opcode )
        {
            registers[0xF] = 0;
            

            int pixelWidth = 8;
            byte pixelData;

            int xSprite = rVX ;
            int ySprite = rVY ;

            int pixelHeight =  ( opcode & 0x000F );
            //if (!chip8)
            //{ pixelHeight = 16; }

            if (pixelHeight == 0) pixelHeight = 16;
            

            for (int y = 0; y < pixelHeight; y++)
            {
                pixelData = memory[I + y]; //retrive the byte for  pixels

                for (int x = 0; x < pixelWidth; x++)
                {

                    if (( pixelData & (0x80 >> x)) != 0)
                    {
                        int row = (xSprite + x) ;
                        int column = (ySprite + y) ;

                        if (videoMemory[row, column] == true)
                            { registers[0xF] = 1; }
                        videoMemory[row, column] ^= true;
                     }
                 }
             }
         }
 

Thesuperchang

New member
Maybe this.

Code:
 DrawSprite( byte rVX, byte rVY, byte opcode )
        {
            registers[0xF] = 0;
            

            int pixelWidth = 8;
            byte pixelData;

            int xSprite = rVX ;
            int ySprite = rVY ;

            int pixelHeight =  ( opcode & 0x000F );
            //if (!chip8)
            //{ pixelHeight = 16; }

            if (pixelHeight == 0) pixelHeight = 16;
            

            for (int y = 0; y < pixelHeight; y++)
            {
                pixelData = memory[I + y]; //retrive the byte for  pixels

                for (int x = 0; x < pixelWidth; x++)
                {

                    if (( pixelData & (0x80 >> x)) != 0)
                    {
                        int row = (xSprite + x) ;
                        int column = (ySprite + y) ;
                        videoMemory[row, column] = !videoMemory[row, column];
                     }
                 }
             }
         }

The boolean data type can either hold a state of true or false. From my experience on the windows platform the bool can be defined as below;
Code:
typedef char bool;
#define true 0x01
#define false 0x00
In ansi C, true is defined as not 0. Alright now that we have that out of the way, the problem with your code is that "^" is a bitwise operation. Therefore the result of your array will always retain the value false. eg.
Code:
uint8 varA;
varA = 0x01;
for(;;)
{
    varA = varA ^ varA; // varA evaluate as 0x00 forever.
}

I hope that helps.
 
Last edited:

Thesuperchang

New member
hmm.. i thought the way chip8 draws the sprites is by using XOR

It does. Reference to the XOR truth tables below. When we attempt to activate a point on the screen with chip-8 we XOR it.
Let input A be the current state of the point.
Let input B be a constant 1.
Given that we know B is always a constant, the result in rows 0 and 3 can be ignored. Looking at rows 1 and 2 we can see the boolean equation is 0 == !A

Code:
| A | B || O |
|------------|
| 0 | 0 || 0 | - Row 0
| 0 | 1 || 1 | - Row 1
| 1 | 1 || 0 | - Row 2
| 1 | 0 || 1 | - Row 3
 

Doomulation

?????????????????????????
How, exactly, to draw something to the screen is very API-specific. Firstly, you would have to mention what API you are using.
Secondly, C++ defines bool as a datatype which can contain true or false; C does not define such a type. However, usually C++ is used to create emulators and games. This, simply because, C++ is an evolution of C - it maintains backwards compatibility, speed, flexibility, as well as adds more modern features to make the projects more maintainable.

I would also stress that an emulator should not have any bugs, such as corrupting pointers.
Emulating everything and correctly is another matter.
 

dreampeppers99

New member
I'm having problems with my Schip8 "emulator".
The chip8 games runs fine however the schip8 runs but the "screen" is presented some strange cuts ... look the "pac man" and "ant"

b7f2934fbe332f4c47090c75ea5b77d1.jpg


My ant game doesn't show the "land"...

999e972364f46a9f2384220ed9c4a5e0.jpg


The dragon2 seems to have some issues too...

The I thought this could be a Scroll stuff and I made this test below but the results seems to be correct.

Code:
        Processor cpu = new Processor();
        int initialAddress = 0x200;

        Engine videoMock =new Engine(cpu);
        Emulator.setVideo(videoMock);
        Emulator.init();
        
        cpu.dataRegister.V[1] = 0x0; //x
        cpu.dataRegister.V[2] = 0x0; //y
        cpu.addressRegisterI = 0x20A; //initial sprit 16x16
        
        cpu.getMemory().writeAt(initialAddress++, (short)0x00); //setting schip mode
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF);
        cpu.getMemory().writeAt(initialAddress++, (short)0xD1); //draw 1 2 16x16 from 0x20A
        cpu.getMemory().writeAt(initialAddress++, (short)0x20);
        cpu.getMemory().writeAt(initialAddress++, (short)0x00); //scroll down 1
        cpu.getMemory().writeAt(initialAddress++, (short)0xC1);
        cpu.getMemory().writeAt(initialAddress++, (short)0x00); //scroll 4 to rigth
        cpu.getMemory().writeAt(initialAddress++, (short)0xFB);
        cpu.getMemory().writeAt(initialAddress++, (short)0x00); //scroll 4 to left
        cpu.getMemory().writeAt(initialAddress++, (short)0xFC);
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111
        cpu.getMemory().writeAt(initialAddress++, (short)0x80); //10000000
        cpu.getMemory().writeAt(initialAddress++, (short)0xFF); //11111111

        cpu.step(); //set high
        cpu.step(); //false draw, just put the 1s and 0s on matrix
        print(videoMock.getFrame()); // take a snapshot, 1

        cpu.step(); //scroll down 1
        print(videoMock.getFrame()); // take a snapshot, 2

        cpu.step(); //scroll 4 or 2 for rigth
        print(videoMock.getFrame()); // take a snapshot, 3

        cpu.step(); //scroll 4 or 2 for left
        print(videoMock.getFrame()); // take a snapshot, 4

Snapshot 1 (just draw)
===============================================================================
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0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|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
1|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|


Im my "loggin" system shows...
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=31
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=32
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=30
....
So I think it can be a error of my part make the boundary over 131 (I made 0-127 ==[2*64] ).
You guys mark pixel on this coordinate? (at x=132)

I notice too the ant... starts with:
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=57
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=133,y=58


Debugger says me:

[CPU] DEBUG: high
[CPU] DEBUG: old drw 4
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=55
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=57
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=133,y=58
[CPU] DEBUG: scl
[CPU] DEBUG: old drw 4
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=55
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=57
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=133,y=58
[CPU] DEBUG: scl
[CPU] DEBUG: old drw 4
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=55
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=132,y=57
[VideoEngine] ERROR: Pixel[1] --> it couldn't be happen' x=133,y=58
[CPU] DEBUG: scl

The game plot and give the scroll left 4 pixels...

But why if the resolution is 128x64?

I just solve this changing:
//private int widhtSchip = 128, heigthSchip = 64;
private int widhtSchip = 148, heigthSchip = 84;
The question is why I must have an array bigger than the resolution?


Best regards,
 
Last edited:

MicBeaudoin

New member
Hello, my name is Michael and this is my first post, but I've been looking around for a long time and learnt a lot from these forums.

So I did the Chip-8 emulator, like everyone else here. It was a fun project. Getting a result from emulator programming takes a lot of time, but it's incredibly rewarding once it's done.

My emulator is very basic and is called 'ChipLol'. I made a zip file with a lot of Chip8 games so you can (re)try them now. It's in french(I'm from Montreal and my primary language is french), but you shouldn't have much trouble finding how to open a rom knowing there is only one useful menu item in the window.

Before leaving, I read somewhere that it's faster to make a texture from an array of pixel and display it with one GL_QUADS. I don't know much about OpenGl(only basic polygon creation and color), but I think my method is VERY slow :

For each Chip8 pixel:
If(ON)
Draw a rectangle
EndIf
End for

I just don't know how to create a texture from an array of data so it will wait.

I decided not to post the source because it is very messy right now.

I couldn't upload the file here(the forum message says:"unable to move/copy file") so I put it on Megaupload for now:

http://wikisend.com/download/884570/ChipLol.zip
http://www.megaupload.com/fr/?d=UQD4XDRT
 
Last edited:

dreampeppers99

New member
For a while I'll release my chip8 schip8 implementation and source code too... I hope it can help anyone that are looking for info to chip8 schip8....
The language was Java and the render engine was Java2D (you can not believe, but it can be slow if you are a bad coder as I'm). So it is the Chip8 Emulator made with Java.

The chip8 games running under JChip8BR
6f20751bfa1fc6f57a2c203ad49ae4f3.jpg


The schip8 games running under JChip8BR
4e5e91be7eaebdec196b6e4c6fe3d064.jpg


Disassember in two ways
7e6ed6508400a0927757d9f90599a6ce.jpg


The memory viewer
9d71c90d777b02853d9459b5bef75a28.jpg


You can debug step by step and see the registers values thus like the Screen. (pong is doing that here)
be62ff0adad6514466c65073c4cbfae2.jpg


The configs
06b3b484e78b41d6aff64569bd50be8b.jpg


The source and emulator link
http://www.2shared.com/file/4611492/b4e7c445/jchip8br.html
 

CodeSlinger

New member
Good work on your debugger mate, looks pretty slick.

I always intended to write a debugger for my sega master system emulator but never got round to it. I'll have to write one for the sega mega drive/genesis before I start emulating that system as I dont think I'll get far without one!
 

dreampeppers99

New member
Good work on your debugger mate, looks pretty slick.

I always intended to write a debugger for my sega master system emulator but never got round to it. I'll have to write one for the sega mega drive/genesis before I start emulating that system as I dont think I'll get far without one!
Thanks!
I think write a debugger can help fix and find "bugs" (besides to put more challenges on project)
 

Death the Kid

New member
I have coded all my opcodes i need for my chip8 emulator and I created a started coding the graphics with directx, but tbh i dont know how to tie the two together from there on, any point in the right direction would be greatly appreciated. :batman:
 

Doomulation

?????????????????????????
The last page contains a lot of discussion regarding the graphics. I have no idea what you are looking for.
 

Top