What's new

My PotatoChipAte

Doomulation

?????????????????????????
A data breakpoint is a breakpoint that breaks whenever the contents of a variable changes or meets a certain condition.
In NET, it's easy to add one of these. Simply right-click the variable to add a breakpoint for, select new breakpoint, goto the data tab, and lastly, remove the function delcaration (the part before the first comma) so that it looks in all functions.
 
OP
glVertex3f

glVertex3f

Crap Cracker
I noticed that if I add 0x200 to the MemoryIndex in the rts function the games kinda actually work. So................. thats really odd....
 

refraction

PCSX2 Coder
glVertex3f said:
"Add a data breakpoint "

What is that exactly.. heh... :blush:


he means pause the program where you can look at the data that is in the registers and what the opcode is that is called, where your emu is pointing etc


I noticed that if I add 0x200 to the MemoryIndex in the rts function the games kinda actually work. So................. thats really odd....

how do you mean exactly?? the only play anything should have 0x200 is right at the start, the return sub function should be pointing at the location directly after the last subrouting was called, nothing else.
 
OP
glVertex3f

glVertex3f

Crap Cracker
the only play anything should have 0x200 is right at the start, the return sub function should be pointing at the location directly after the last subrouting was called, nothing else.

I know that.... You know that... My emulator... im not so sure.

I noticed that when the rts function returned it seems to be exactly 200 below where it should be.. so i thought.. hmm... and added 200, and it worked. So what can be causing the index loss?

(And as far as the break points and stuff, Im learning how to use the MSVC++ Express Beta because Dev-C++ seems like to much of a chore)
 

Doomulation

?????????????????????????
glVertex: I recommend you take a better look at your subroutine return code. Because actually, that might even be incorrect. Some games are mostly unaffected by this (pong), and some others crash later (most schip8 games, ie alien, dragon, etc).
When you use the express beta, do as I instructed, it should work in there. You need to learn this aspect of debugging. Someday, you will go nuts if you don't have this in store.
 
OP
glVertex3f

glVertex3f

Crap Cracker
Yup I finally realized exactly what your talkin about doom lol.

I am currently rewriting the emulator in the express beta. Im sure i'll be back soon :p
 
OP
glVertex3f

glVertex3f

Crap Cracker
MSVC Express beta error output
Code:
------ Build started: Project: ChipAte, Configuration: Debug Win32 ------
Compiling...
InitWin.cpp
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(85) : error C2143: syntax error : missing ')' before ';'
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(85) : error C2660: 'glOrtho' : function does not take 2 arguments
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(85) : error C2143: syntax error : missing ';' before ','
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(85) : error C2143: syntax error : missing ';' before ','
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(85) : error C2059: syntax error : ')'
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(122) : error C2143: syntax error : missing ')' before ';'
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(122) : error C2660: 'CreateChip8Window' : function does not take 2 arguments
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(122) : error C2143: syntax error : missing ';' before ','
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(122) : error C2143: syntax error : missing ';' before ','
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(122) : error C2059: syntax error : ')'
c:\VCProj\ChipAte\ChipAte\InitWin.cpp(128) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
main.cpp
c:\VCProj\ChipAte\ChipAte\main.cpp(88) : warning C4244: '=' : conversion from 'LRESULT' to 'LONG', possible loss of data
Generating Code...
Build log was saved at "file://c:\VCProj\ChipAte\ChipAte\Debug\BuildLog.htm"
ChipAte - 11 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Heres the lines(and funsctions) in question...

Code:
void SizeOpenGLScreen(int width, int height)
{
  if(height == 0)
    height = 1;

  glViewport(0, 0, width, height);

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();

  glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, -15, 0, 1); <--HERE

  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR cmdline, int ishow)
{
  HWND  hWnd;

  hWnd = CreateChip8Window("Potato ChipAte", SCREEN_WIDTH, SCREEN_HEIGHT, hInstance); <--here

  if(hWnd == NULL) return TRUE;

  Init(hWnd);

  return MainLoop();
}
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
yup same thing on release.

wait how do you switch to release mode.... lol
 
Last edited:

refraction

PCSX2 Coder
make sure its compiling in C++ and not C in your project options, ive had problem with it in the past, plus make sure you havent accidently left anything open which shouldnt be just before that code.
 
OP
glVertex3f

glVertex3f

Crap Cracker
640 and 320

EDIT: I replaced thee macros with the actual numbers and it worked... odd

Code:
------ Build started: Project: ChipAte, Configuration: Debug Win32 ------
Linking...
InitWin.obj : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "bool __cdecl bSetUpPixelFormat(struct HDC__ *)" (?bSetUpPixelFormat@@YA_NPAUHDC__@@@Z)
InitWin.obj : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "bool __cdecl bSetUpPixelFormat(struct HDC__ *)" (?bSetUpPixelFormat@@YA_NPAUHDC__@@@Z)
Debug/ChipAte.exe : fatal error LNK1120: 2 unresolved externals
Build log was saved at "file://c:\VCProj\ChipAte\ChipAte\Debug\BuildLog.htm"
ChipAte - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

...

Im linking

user32.lib
advapi32.lib
opengl32.lib
glu32.lib

Oh the errors... the errors...
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
hmm mine are Opengl32.lib and GLU32.lib... and GLAUX.lib

Mine must be Microsofts version and yours is Silicon's
 
Last edited:
OP
glVertex3f

glVertex3f

Crap Cracker
so.... what in the world do i do now... lol

EDIT: rofl...
Code:
#define SCREEN_WIDTH  640;
#define SCREEN_HEIGHT 320;
#define SCREEN_DEPTH   16;

lol semicolons...
 
Last edited:

Top