Skip to content

Emulation running too fast #38

Description

@Morphlng

I'm trying to use the gameboycore library and using this project as a reference. I cloned the source code, removed the networking part and compiled myself with VS2019+Qt 5.15.2.

However, when it comes to testing/playing, the game is just running too fast. For example, in game Mario the time counts down about 20 in game seconds per real time seconds.

I believe this part of code doesn't do what it supposed to do.

void run()
{
while (running_)
{
core_.update(512);
}
}

The screen renders every 16ms, but the cpu cycles never stops. I changed the logic in this part as below, and it runs nearly normal:

void run() 
 { 
 	while (running_) 
 	{ 
 		core_.emulateFrame();
                msleep(16);
 	} 
 } 

Calling thread to sleep still doesn't seems right, I guess a proper signal/slot should be the final solution to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions