What's new

Chip 8

Garstyciuks

New member
Doomulation he meant the "half pixel" scrolling, which may occure when using scrolling functions in the chip8 video mode (64x32).

Anyways, I can't see why is it more accurate than my emulator :p
 

Doomulation

?????????????????????????
Oh...... ya, I don't know of any game that uses that but it should be in there for the sake of completeness. And... chip8 games can also switch between regular chip8 and super chip 8 of the fly... but I don't know of any games that utilizes such techniques.
 

Melvo

New member
Thanks for the comments :)

@Garstyciuks: I said is more accurate because I saw it could run Sokoban, I tried it on yours and couldn't.

If you already fixed the problem, I apologize and will edit post.
 

Garstyciuks

New member
Well, it can run it now, but not the high levels :) I think I'm going to make a new chip8 emulator using some more advanced emulation technique. (But I can scrap this idea too :p)
 

Melvo

New member
Ok, I fixed carry calculation stuff...

Here's the new binary and source:


BTW, Garstyciuks: Indeed, Mine's more accurate now :p
But anyway, who cares? lol
 
Last edited:

hap

New member
Some interesting information (upper 2 especially) from http://sbrune.com/COSMAC/ and from the cosmacelf Yahoo group (part of http://www.cosmacelf.com/ ).

- VIP_Manual.pdf: RCA COSMAC VIP CDP18S711 Instruction Manual (VIP-311), missing some pages, some errors due to OCR. In case you don't know, CHIP-8 was born here. Note that it seems that originally I (not me :p ) *does* change when using memory instructions, though this breaks newer games.
- COSMAC_VIP_Game1.zip: RCA COSMAC VIP Game Manual (VP-710) games. CHIP-8X seems to be an extension to CHIP-8 with colour support. Includes disassembly by Josh Bensadon of original CHIP-8/X interpreters.
- ELF CHIP-8 Interpreter.pdf: COSMAC ELF CHIP-8 article
- CHIP-8 programs.zip: programs for the above article

ext.zip contains the programs extracted from these, usable on PC emulators. Some don't work correctly over here, maybe due to typos. The hybrid ones won't run (properly) unless you'd write a COSMAC VIP emulator.


---

Melvo: Good job Sokoban works on your emulator :D and indeed, we don't like penile size bragging, I mean emulator accuracy bragging.
 
Last edited:

Doomulation

?????????????????????????
hap said:
- VIP_Manual.pdf: RCA COSMAC VIP CDP18S711 Instruction Manual (VIP-311), missing some pages, some errors due to OCR. In case you don't know, CHIP-8 was born here. Note that it seems that originally I (not me :p ) *does* change when using memory instructions, though this breaks newer games.
Oh? Do you know any games that suffers problems when this is not present?
This really causes trouble. It might require a switchable hack to make all games playable.
 

hap

New member
Hey, yes.

- Animal Race [Brian Astle].c8
- Sequence Shoot [Joyce Weisbecker].c8

(in above ext.zip)
 

Doomulation

?????????????????????????
hap said:
Hey, yes.

- Animal Race [Brian Astle].c8
- Sequence Shoot [Joyce Weisbecker].c8

(in above ext.zip)
Oh no :plain:
That means a hack needs to be implemted next time I actually work on that damned thing...
 

cloudy

New member
Hey all,

can someone please check my code for the DXXX opcode please? Im not sure if it is correct.

Code:
void opD000(){
for (int yline=0;yline<(opcode&0x000F);yline++){
    data = memory[I+yline]; //this retreives the byte for a give line of pixels
         for(int xpix=0;xpix<8;xpix++){
                                   if ((data&(0x80>>xpix))!=0){
                                      if (screen[(registers[registerEx()]+xpix) +((registers[registerEx2()]*64)+yline)]==1) registers[15]=1; //there has been a collision
                                   screen[(registers[registerEx()]+xpix) +((registers[registerEx2()]*64)+yline)]^=1; //note: coordinate registers from opcode
                                   }
         }
}     
    system("cls");
	for(int y = 0; y < 32; y++) {
		for(int x = 0; x < 64; x++) {
			if(screen[x + (y*64)] == 1)
				cout<<"#";
			else
				cout<<" ";
		}
		cout<<endl;
    
}
}

Thanks
 

refraction

PCSX2 Coder
after a quick look it looks ok but dont forget to clear VF before the op, else itll just think there is a collision even if there isnt
 

drsl

New member
Emulator speed...

Hi!

I'm working now on simple Chip8 emu, and i've got few problems:

1. My emu runs veeerrrry fast, how to bount it to one speed?
2. How to check on what speed my emu runs (need to display CPU core speed e.g. 60Hz or 120 MHz)?
 

Cyberman

Moderator
Moderator
drsl said:
Hi!

I'm working now on simple Chip8 emu, and i've got few problems:

1. My emu runs veeerrrry fast, how to bount it to one speed?
2. How to check on what speed my emu runs (need to display CPU core speed e.g. 60Hz or 120 MHz)?
There is a sticky thread specifically for Chip8 discussion. Please post questions relating to the chip8 to that. Checking the chip8 specs will help you determine what you are asking as well.
I'm merging this thread with the chip8 thread. So that people who are working or have worked on Chip8 emulators can answer your questions. Did you look at the chip8 thread by the way?

Cyb
 

bcrew1375

New member
I don't entirely understand the second question. As far as reducing speed. You're going to need to decide on a number of instructions to run per second, as the Chip-8 has no set speed. Try speeds of 100 instructions or less per second. You need to use a function that will return the number of milliseconds passed since midnight, or something similar. Get the current number of milliseconds into a variable. Once the number of instructions you chose have been run, stop running instructions until the timer function returns a value that is at least 1000 more than the value in the variable. That means one second has passed.
 

drsl

New member
bcrew1375 said:
I don't entirely understand the second question.

I was thinking about information which could be show in windows title bar in many emu's, e.g.:
__________________________________
| CPU Speed: XX %, YY Mhz | FPS: ZZ |
---------------------------------------
 

Melvo

New member
What bcrew1375 said is wrong, because: say that your PC is able to execute two times faster than your desired intructions per second, and as soon as the emulator finishes executing your desired instructions/sec, it will halt and wait until that second is passed, which will cause a desynchronization on timing.(The emulator will execute the instructions/sec under half of the second, which will cause the emulator to double the desired speed on by half a second, but the other half will just wait until the other second, and that's not what you want).

Secondly, 100 instructions per second is too slow, try 500~800.


Let's say you want to execute 1,000 instructions per second, then, after EACH instruction, you will have to wait until 1 millisecond has passed before executing the next instruction.


Time should be checked on every instruction(if you want it to be as accurate as specified), not every second.
 

Top