What's new

My PotatoChipAte

OP
glVertex3f

glVertex3f

Crap Cracker
but the bSetPixelFormat problem stil stands :(

EDIT: I had to link the gdi32.lib to my project. So alls well! FOR NOW!
 
Last edited:

Doomulation

?????????????????????????
You know... although it might seem nice, the vc++ 2005 express beta is bad. Really bad. Buggy and missing functionality. I'd really use something else in place of it.
 
OP
glVertex3f

glVertex3f

Crap Cracker
Ok, maybe its because im tired... i dunno. Im afraid its just one of those problems that so simple you overlook it.

My emulator.. wont emulate.

After having trouble with MSVC++ beta, I rewrote (again) my emulator in Dev-C++.

Its now in C++ and not C and (to me anyway) cleaned up a bit.

If you notice anything wrong please let me know.
 
Last edited:

smcd

Active member
Ever tried Mingw Studio? (semi-offtopic) but it kicks Dev-Cpp's ass. (uses the same compiler, mingw)
 
OP
glVertex3f

glVertex3f

Crap Cracker
:plain: I just downloaded it...... Wow....... Why didnt you tell me sooner :p


EDIT:
Upon using it... im not so sure... it seems a bit sloppy.. maybe its just me being tired i dunno.


EDIT2: About the code, Overlook the part in the sprite function
Code:
Display[x + lx][y + lx]
I fixed that part but still shows nothing.
 
Last edited:

refraction

PCSX2 Coder
hmm i dunno if you need to read up a bit on open gl http://nehe.gamedev.net

I think its probably the same as SDL as its based on opengl, but you need to lock the screen before drawing the pixels then unlock it when youve finished.
 
OP
glVertex3f

glVertex3f

Crap Cracker
wha...? lock the screen?

Yes I am new to OpenGL(WinAPI for that matter) but ive made several programs with it i'm not sure what you mean by locking the screen.

EDIT:
refraction, I just looked over several OpenGL tutorials and I dont see anything about locking the screen. And I did the drawing code the same way I did my other emulator and it "worked".
 
Last edited:

Doomulation

?????????????????????????
Btw, I just wanted to ask you... have you ran into any troubles using a two-dimensional array? Last I looked, which was some time ago, two-dimensional array for the screen seemed like a bad idea.
How about you?
 
OP
glVertex3f

glVertex3f

Crap Cracker
I havent had any trouble. Thats how ive always done tilebased games.

It seems alot easier that doing it with out an array.
 
Last edited:

refraction

PCSX2 Coder
hmm, ill have to have a look through the rest of your code then and see if i can see anything.. ive never used raw opengl so i dont know, locking the screen is a method used in SDL (opengl wrapper) i just assumed it was a feature of OpenGL
 

zenogais

New member
refraction said:
hmm, ill have to have a look through the rest of your code then and see if i can see anything.. ive never used raw opengl so i dont know, locking the screen is a method used in SDL (opengl wrapper) i just assumed it was a feature of OpenGL

SDL != OpenGL Wrapper

SDL is a cross-platform library for 2D graphics. On windows it actually wraps DirectX, on Linux I would guess it wraps some form of OpenGL or other graphics API. However, SDL does have the ability to integrate with OpenGL on both Platforms, how this is accomplished I haven't checked.
 

refraction

PCSX2 Coder
Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.


i was close :)
 
OP
glVertex3f

glVertex3f

Crap Cracker
Interesting... Look what happens when I load BLITZ

ss6.jpg
 
OP
glVertex3f

glVertex3f

Crap Cracker
not to mention the last 3 letters :p

Oh and as far as the flickering...

would simply drawing every other frame work or do I need something more complex to eliminate flickering.
 

smcd

Active member
If you use Windows GDI for the graphics, you can use an offscreen DC & then BitBlt it onto the screen, this helps.
 
OP
glVertex3f

glVertex3f

Crap Cracker
Ok found a couple of problems

Code:
// i was assigning the registers with this
OpCode&0xFFF;
//instead of
OpCode&0x0FFF;

simple typo, but it still wont work.

EDIT:

I think ive found a problem... how can I use the C++ fstream function "read"
Code:
Rom.read(Memory, filesize);
and start at 0x200.... how do I start at 0x200...
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
lol are you serious....

i thought it would be the same as 0xFFF0...

anyway, can you help me with my other problem up there.
Its boggling my mind!

To make it simpler

Code:
bool CPU::LoadRom(char *sFileName)
{
  ifstream Rom(sFileName);

  if(!Rom.is_open())
    return FALSE;

  Rom.seekg(0, ios::end);
  long size = Rom.tellg();
  Rom.seekg(0, ios::beg);

  Rom.read(Memory, size);

  Rom.close();
  return TRUE;
}

how can I make it start reading it in at 0x200 in the array?

EDIT:
Got It:
Code:
 Rom.read(Memory + 0x200, size);


Also heres the updated source. It runs games but the graphics are a bit messed up, some games simply close the window, some crash and somelock up.

Now its just some debugging.
 
Last edited:

refraction

PCSX2 Coder
you realise in your source youve missed out the PC+=2; after its called the op? so its infinately calling the same one, apart from with you skip instruction commands (which do the normal jump to next op code) and your jump op command which seems to move to the new position then step back one, why you did that i dont know :p

take the PC-=2 out of the jump opcode and put PC+=2; just after youve called the opcode you want and read it in.

plus you want to set I to 0x200 on reset as well.
 

Top