What's new

Help

smcd

Active member
Well it kinda works, pong puts stuff on the screen but how do you control it now? Also, the cpu speeds could do with a bit of work. =)
 

refraction

PCSX2 Coder
couple of bugs there in your op codes, causing the text to mess up, heres the op codes under my old chip8 emu, the fonts work on it and most games which is a start :)

and pixel wise, i wouldnt worry which is faster, the emu works too fast as it is!! tho i imagine DX will be faster than plotting with MFC.

Note: this file is same as my new one, but i thought switch case's would be easier to understand than jump tables :) dont just copy the code tho.. understand why ive done mine like i have and check it against the technical docs so you know where you went wrong :)
 
OP
MXP

MXP

MXP
Keys and CPU Speed

sethmcdoogle said:
Well it kinda works, pong puts stuff on the screen but how do you control it now? Also, the cpu speeds could do with a bit of work. =)
Use arrow keys in pong to control those babies and use cpu speed to fit my emu according to your machine :bye3:
I need some web hosting for publisihing my emu :icecream: :evil: :bouncy: :plain: :whistling :p :yucky: :bye3: :bye3: :bye3: :bye3:
 

Doomulation

?????????????????????????
refraction said:
couple of bugs there in your op codes, causing the text to mess up, heres the op codes under my old chip8 emu, the fonts work on it and most games which is a start :)

and pixel wise, i wouldnt worry which is faster, the emu works too fast as it is!! tho i imagine DX will be faster than plotting with MFC.

Note: this file is same as my new one, but i thought switch case's would be easier to understand than jump tables :) dont just copy the code tho.. understand why ive done mine like i have and check it against the technical docs so you know where you went wrong :)
Does not. Try emulating the more complex games.
In this case MFC isn't needed, though. Go for DX. In a more complex emulator, you'll definetly need DX.
 
OP
MXP

MXP

MXP
Hey Can Some one provide me 2600 documentation I need them with op codes(Yeah you guessed correct thats my next emu)
 
OP
MXP

MXP

MXP
More help

:yucky: Well i am having a problem with Direct X i want coordinates of DX attached with my window, How can i obtain coordinates of the window client area(drawing area) top left ,and bottom right (see image attached for details).(Or what arguments shoul i use in creating back surface for window)

Also i have attached new my emu when i run Tank on it something starnge happens what??? it will produdce a debug.txt for helping you conatining

Memory Loaction: OPcode

I can`nt figure it out lets see if u can
 
Last edited:

refraction

PCSX2 Coder
have you finished all your opcodes yet? cos im getting an invalid opcode error in tetris, but its not showing anything in the debug thats not a valid opcode....
 

zenogais

New member
MXP said:
:yucky: Well i am having a problem with Direct X i want coordinates of DX attached with my window, How can i obtain coordinates of the window client area(drawing area) top left ,and bottom right (see image attached for details).(Or what arguments shoul i use in creating back surface for window)

Also i have attached new my emu when i run Tank on it something starnge happens what??? it will produdce a debug.txt for helping you conatining

Memory Loaction: OPcode

I can`nt figure it out lets see if u can

DirectX doesn't quite work like that. But basically the coordinate of the upper-left hand corner is where drawing starts and it is always (0, 0) or since I'm guessing you're using Direct3D (0, 0, 0). The bottom left depends on the size of the screen. If you were in 800x600 mode the bottom left would be (799, 599). Hope this helps.

Also for arguability, I do use MFC myself. And I find it to be much easier to whip up a simple window in MFC than using the Win32 API. Alot of people view MFC as a complex beast, I know I once did, but its actually quite simple.
This is my favorite MFC tutorial, and the one that demystified it for me: http://esprit.campus.luth.se/~humus/Articles/OpenGL_Basic_Framework/index.html
 
Last edited:

Doomulation

?????????????????????????
Indeed, zenogais is right.
Now, about directx. I know about d3d, if that's what you use.
When you create a device, you'll normally specify the backbuffer dimensions (height & width). If you create one at 1024x768, then 1024 is to the far right and 768 is the bottom.

You can also obtain your window size by the GetClientRect API I think...
hope that helps.
 
OP
MXP

MXP

MXP
refraction said:
have you finished all your opcodes yet? cos im getting an invalid opcode error in tetris, but its not showing anything in the debug thats not a valid opcode....
I have implemented all opcodes of chip 8 and the warining appears due to eog(end of game).(PC goes beyond instructions)
and by the way in NEOCHIP8 emu it shows wrong memory locations i.e. PC
 
Last edited:

zenogais

New member
MXP said:
I have implemented all opcodes of chip 8 and the warining appears due to eog(end of game).(PC goes beyond instructions)
and by the way in NEOCHIP8 emu it shows wrong memory locations i.e. PC

What game are you testing exactly? And can you post the errors or a screenshot to show exactly what you're talking about?
 

refraction

PCSX2 Coder
MXP said:
and by the way in NEOCHIP8 emu it shows wrong memory locations i.e. PC

yeh thats just the debug thats wrong, where its incramented after the op is read from memory i didnt put int "PC-2" into the debug output :p

but dont worry, it does call the right location.
 
OP
MXP

MXP

MXP
Finally i got the problem :p Chip 8 Invlolve some of the SChip OPCODES so i need to correct them :yucky:
 
OP
MXP

MXP

MXP
Finally i got something stupid in my emu ,,,,
the opcode 0xEXXX

Here is some code :

bool opE(){
byte id=(cpu.opcode & 0x0F00)>>8;
short keyP=(GetKeyState(key[cpu.V[id]]));
switch(cpu.opcode&0x00FF)
{
case 0x9E:
if(!keyP)
cpu.PC+=2;
break;
case 0xA1:
if(keyP)
cpu.PC+=2;
break;
default:
return false;
}
cpu.PC+=2;
return true;
}

it do not works right due to which tank and tetris like games are effected...
:p Solutions required

I only have to check the key state how can i do it
 

Doomulation

?????????????????????????
You need to have an array with all keys. Those ops will look like this 0xEXNN. X identifies the register which will contain the key that you will check. The easiest way is, as I said, an array. Then you'd simply do this:

Code:
int key = [ (opcode & 0x0F00) >> 8 ];

case 0x9E:
if (keys[key]) 
    PC += 4;

case 0xA1:
if (!keys[key])
    PC += 4;

Get me?
 

refraction

PCSX2 Coder
MXP said:
What values are stored against keys in registers;
I launched the site for my emu
http://www.chirp.co.nr


its just the number of the key, for example the register has key E stored, the opcode will check if key E is pressed, so if you have an array of 15 places and get them to set true or false when the key is pressed, itll check position 14 to see if the condition is true, if it is itll say to the system that the key is pressed as it returns true, if its not pressed it should return false from the array. you follow?
 

Top