PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

hang and then connection loss with evc++

Ok, as you all know, I am porting/optimizing the FPSE emulator. Well, I was stepping though the code today, and the program hung on the spot where it calls the function screen_update() (which updates the screen or course). After a few seconds, I get a message saying that the connection has been lost, and I need to restart evc++. It has done this like 7 times (at this very spot). I have my e200 pluged in, and firmly in the cradel. Now, the function screen_update is located in a different c file than the function that calls it, and is defined in a header which is shared by both files. Does anyone know why it may be hanging as I try and step into the function?

here is the code to the function I am stepping into (just in case I am doing something illegal in it)

Code:

void screen_update()
{
static long nf = 0;

if(++framecount>frameskip)
{
if (!NoRender) {
if (!FullScreen) Dsp.render_frame((UINT32*)buffer,0,endW);
else {
UINT16 tmp[fullscrW*fullscrH];
soft_scale((UINT16*)buffer,CurW,CurH,tmp,fullscrW,fullscrH);
Dsp.render_frame((UINT32*)tmp,0,fullscrW);
}
}
framecount=0;
if (joy0_ret) {
switch (joy0_ret) {
case KEY_F6: FullScreen = 1 - FullScreen;
if (!FullScreen) Dsp.resize(CurW,CurH);
else Dsp.resize(fullscrW,fullscrH);
break;
case KEY_F7: FpsCount = 1 - FpsCount; Dsp.change_title("FPSE");
break;
case KEY_F8: NoRender = 1 - NoRender; break;
case KEY_KP_PLUS:
case KEY_PLUS: frameskip++; break;
case KEY_KP_MINUS:
case KEY_MINUS: frameskip--; break;
}
joy0_ret = 0;
}
}
}


this is where it is called
Code:
void GPU_Update(void)
{
/* interlace odd/even */
gpu.status^=0x80000000;

/* Update Image */
if (toUpdate)
{
screen_update();
toUpdate = 0;
}
}
Can you step into (F11) screen_update?

Dan East
no. I haven't tried using f11 (I usually just hit the step button on the debugg tool bar. Is it possible that the it has run out of room to call the fuction? I don't know how many things it has called up to this point, but I know that this is pretty deep in the loop. Isn't there a way to increase the stack size or would that not be related?
Here is a copy of the call stack directly before I step into it..

Code:

GPU_Update() line 148
win_update() line 167
update_hw() line 247
go() line 39 + 4 bytes
WinMain(HINSTANCE__ * 0x8fbc5f12, HINSTANCE__ * 0x00000000, unsigned short * 0x1e2cfef8, int 5) line 417
WinMainCRTStartup(HINSTANCE__ * 0x001ff6e0 gpu, HINSTANCE__ * 0x9486260a, unsigned short * 0x00000001, int 1) line 9
1ffa17f8()
anyone have any thoughts? This is really wierd. I know that it has happened once before in another project, but I don't remember why, or how I fixed it.
ok, fixed it. Here is what was wrong, fyi. I remembered from before how every time it tried to call a funtion set to dsp (like Dsp.render_frame) it would get an address error. Well, looking though that function, I noticed several, and in order to save time later, I changed them. Then I tested it, just for the heck of it, and what do you know, it's not paused inside the function.