What's new

My PotatoChipAte

refraction

PCSX2 Coder
with HP48 flags you can use it simular to the Writing V values to memory, you can either make them in a position below 0x200 (you only need 8 spaces as they at < 8) or you can create a seperate unsigned char array to store them in, its up to you.

As sethmcdoogle said its not really used on chip8 games, but if you come to implement schip8 games (which is probably a nice idea) then its a good idea to put them in.
 
OP
glVertex3f

glVertex3f

Crap Cracker
I am begining to think this will not work this way.

When I swithc between Chip8 and SuperChip8 modes.. I do a
Code:
delete [] display;
display = new unsigned char [SCHIP8_DISPLAY_SIZE];

Is that supposed to work that way?
 
OP
glVertex3f

glVertex3f

Crap Cracker
Must be a problem somewhere else in my code then...

All of the normal chip 8 roms run great. When I run Schip games, it has some display problems. Like "scrambled" graphics and it doesnt clear the screen correctly.. I'll post the SCHIP related code in a sec...

EDIT:
Heres the code related to changing the display mode and the clear screen function

Code:
void CPU::setChip8()
{
  cVideo.superChip = FALSE;	
	
  cVideo.pixelWidth = 10;
	
  cVideo.screenW = 64;
  cVideo.screenH = 38;

  cVideo.resetMode();
}

void CPU::setSuperChip8()
{
  cVideo.superChip = TRUE;
	
  cVideo.pixelWidth = 5;
	
  cVideo.screenW = 128;
  cVideo.screenH = 64;
	
  cVideo.resetMode();
}

void CPU::cls()
{
  if(cVideo.superChip)
    memset(cVideo.display, 0, SCHIP8_DISPLAY_SIZE);  
	
  else memset(cVideo.display, 0, CHIP8_DISPLAY_SIZE);
	
  cVideo.draw();
}

here is the resetMode function

Code:
void Video::resetMode()
{
  if(superChip) {
    delete [] display;
    display = new unsigned char [SCHIP8_DISPLAY_SIZE];
  }
	
  else {
    delete [] display;
    display = new unsigned char [CHIP8_DISPLAY_SIZE];
  }
}
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
What the freak, I made a SDL version of my emu, and I used std::cout to display some text... WHY THE SHIZNIT di SDL send it to a file called stdout.txt!? the text never showed up in the console..! lol, is this normal or am I going crazy.

EDIT: keep in mind the text is a "Enter rom name: " BEFORE I Initialize SDL.
 

smcd

Active member
Yes, stdout/stderr to files is normal. You could use windows functions to spawn a file picker dialog instead of having them type in the filename?
 
OP
glVertex3f

glVertex3f

Crap Cracker
Yeah I guess i'll just have to go that route I guess.

I just remember seeing an emulator that used cout... might have been Zenogais's
 
OP
glVertex3f

glVertex3f

Crap Cracker
I think im gonna put this ChipAte to rest for a while. It is the only project ive been working on for the past month or so. Here is the latest binary and source. I believe it is a very decent Chip 8 emulator, not so much for Super CHip 8 though. Not alot of options at all (pause and reset.. thats it)

If anyone is interested in testing it here it is. I might resurect it oneday(or tommorow, who knows :p)

EDIT: I would like to go on to another project but I dont know what that would be... aprentice seems to think I should not do a GB emu, but I dont know what else to tackle. It seems like an atari would be more complicated?

If an Atari 2600 would be the way to go... I suppose that I need to emulate the 6502 processor?
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
I know you thought I was gone, but dont let out that sigh of relief yet. :p

Did any of you have trouble with the rom BLINKY when you programmed your Chip8 emu's.

It only took me a good day or so to get everything running except for blinky
(And of course Super Chip roms, but I cant expect them to work if theres a problem in the basic Chip 8 code).

All the roms run fine except for Blinky. I was wondering if any of you had this problem and what caused it.
 
OP
glVertex3f

glVertex3f

Crap Cracker
Oh, crap, I meant on the SDL version of the emu ive been working on.

I havent posted source/executable yet, I was just wondering if any of you had a problem with blinky, while programming your emulator. Its the only chip8 rom that wont work correctly.
 

refraction

PCSX2 Coder
hmm i did have a problem with the ghosts like echoing on the screen, but i think it was down to the bit shifts being wrong or something silly.

i did originally have a problem where it was killing me if i hit a wall, but i cant remember how i fixed it ;p
 
OP
glVertex3f

glVertex3f

Crap Cracker
blinky.jpg


I tihnk my Blinky problem is a tad more severe lol.

Its just odd, all the other games work, so theres something that happens in blinky that doesnt happen in other roms.

EDIT:
Finally got a couple SChip roms working, Chip8 BLINKY still has the same problem.

I know you all are busy now with GB emu's but just in case you take a break :)

Here is current Source/Binary

(note: the source is probably pretty sloppy, but what can I say, thats what you get for programming while your half asleep)

Also, a few function keys in the emu...

ESC - Quit
F1 - Pause
F2 - Reset
F3 - Cycle through a few colors
F4 - Toggle Sound
F5 - muahaha, try it and see :devil:
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
Well, The past couple of days I have builta Chip 8 emulator from scratch.

I believe that this is the only Chip8 emulator to use Graphics plugins. Thats right... I made a graphics plugin for a chip 8 emulator. Any way... here is a screen shot.

BMC8.jpg


[note]
The "Plugin" only has code in it to actually draw to the screen.

e.g.
Code:
void Draw(int x, int y, int width, int height, bool on)
{
    
    if(on) {
        
        glBegin(GL_TRIANGLE_STRIP);
    
            glColor3f(1.0f, 1.0f, 1.0f);
	    glVertex2i( (x * width) + width , (y * height)        );
			
	    glColor3f(1.0f, 1.0f, 1.0f);
	    glVertex2i( (x * width)         , (y * height)        );
			
	    glColor3f(0.0f, 0.5f, 0.0f);
	    glVertex2i( (x * width) + width , (y * height) + height);
			
	    glColor3f(0.0f, 0.4f, 0.0f);
	    glVertex2i( (x * width)         , (y * height) + height);
        
        glEnd();
        
    }
    
    else {
        
        glBegin(GL_TRIANGLE_STRIP);
    
	    glColor3f(0.0f, 0.0f, 0.0f);
	    glVertex2i( (x * width) + width , (y * height)        );
			
	    glColor3f(0.0f, 0.0f, 0.0f);
	    glVertex2i( (x * width)         , (y * height)        );
			
	    glColor3f(0.0f, 0.0f, 0.0f);
	    glVertex2i( (x * width) + width , (y * height) + height);
			
	    glColor3f(0.0f, 0.0f, 0.0f);
	    glVertex2i( (x * width)         , (y * height) + height);
        
        glEnd();
        
    }        
    
}

I might make the plugins more flexible... we'll see...

I havent added Super Chip 8 support yet.
I might get around to doing that soon, Im about ready to take a break from ANYTHING chip 8.

I think you'll see from my source that I definately have learned alot from everyone here. You all have taken me from noob to almost intermediate :p

The code does have a few problems such as some global variables. I need to start making an opengl class for my projects.

[note] FMOD is used for sound and the fmod.dll is included.

Let me know what you think.

[edit]
Ah, forgot to upload the freakin file.
 
Last edited:

Top