Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Apr 2009
Offline Last Active Jul 19 2015 07:38 AM

Topics I've Started

Emulator plays faster than it should

19 July 2015 - 07:25 AM

I'm trying to emulate a gameboy, but it plays a little too fast.

This how I'm doing my timing inside the main loop.

if (cpu.T >= CLOCKSPEED / 40) // if more than 1/40th of cycles passed
        // Get milliseconds passed
	unsigned long long counter = EndCounter.QuadPart - LastCounter.QuadPart;
	MSperFrame = 1000.0 * ((double)counter / (double)PerfCountFrequency);
	LastCounter = EndCounter;

        // if 1/40th of a second hasn't passed, wait until it passes
	if (MSperFrame < 25)
		Sleep(25 - MSperFrame);

	cpu.T -= CLOCKSPEED / 40;

CLOCKSPEED is the cycles per second of the emulated cpu (4194304)

cpu.T is cycles passed.


I'm using Visual Studio 2013. I even tried switching to C++ and using steady_clock but nothing changed. What could be the problem?

Can't open program outside Visual Studio

30 July 2013 - 05:41 AM



I made a simple 2D game using the allegro library. When I run it inside Visual Studio, it works fine, both in the release and debug builds.

But when I open the exe file in windows explorer I get an error message:

First it said: "The program can't start because allegro-4.4.2-md.dll is missing from your computer. Try reinstalling the program to fix the problem."

So I pasted that file in the same folder as the exe. And I got the same error message, but for another file, "libgcc_s_dw2-1.dll".
I pasted that file in there folder too, and started the exe again. Now, a blank window opens, and I get an error message:
(Project2.exe has stopped working. Close program or check online for solution).


What do I do with this?

Find WiFi MAC address using J2ME

12 July 2013 - 10:48 AM


I just started trying out J2ME but I can't find a way to do something. If the phone is connected to my modem wirelessly, is there any way I can get the modem's MAC address in the application?

What should I do next

04 May 2013 - 06:12 AM

I have learned C++ and Java (I prefer C++). I made some simple 2D games with the allegro library (pong, tetris, space invaders, pac-man without the AI). And now I'm a little out of ideas to try. I think I need some more practice before trying to make an RPG game or getting into 3D.
What should I try next? A new language? Some other game? Learn more on a specific aspect of game programming (AI, sprites, animation, audio etc).


EDIT: Is there any website similar to projecteuler, but for game programming?

C++ 11 thread not working on CodeBlocks

03 May 2013 - 10:21 AM

I wanted to try out the new std::thread in C++11 in Code Blocks and I'm not sure if I'm doing it right.

This is the code:

#include <iostream>
#include <thread>

void foo()
    std::cout << "\n thread started. \n";

int main()
    std::cout << "starting thread";
    std::thread thr1(foo);

    std::cout << "waiting for thread to finish\n";

    std::cout << "done!\n";
    return 0;


At first I got some kind of warning that I had to use a compiler flag (-std=c++11), so I did.

And now I get 'thread is not a member of std'

I'm using GNU GCC compiler on windows 7. What should I do?