• Advertisement
Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163898

(.)(.)

Sign in to follow this  

157 views

More "real progress" in the past week. I've gotten about 3 demos fully working and 4 half-working(they break down after awhile). This is all due to fixing LDM and STM, and adding the VBlank and VCount interrupts although VCount is still a mess.

Another plasma demo I got to run:


I've also made a high-performance timer class to help with things like VCount and opcode cycle timing.


class HighTimer{
private:
LARGE_INTEGER OldTime,NewTime;
public:
unsigned long long PausedCycles,Cycles,Frequancy,Intervals,OldIntervals;
HighTimer(){LARGE_INTEGER Freq;QueryPerformanceFrequency(&Freq);Frequancy=Freq.QuadPart;Cycles=0;Intervals=0;return;}
void Reset(){Cycles=0;return;}
bool Process(unsigned long long Freq,unsigned long long Max){
if(Cycles==0){QueryPerformanceCounter(&OldTime);}
QueryPerformanceCounter(&NewTime);
Cycles=NewTime.QuadPart-OldTime.QuadPart;
OldIntervals=Intervals;
Intervals=Cycles/Freq;
if(Intervals>=Max){Intervals=Cycles=0;return 1;}
return 0;}
};



(some formatting so mattd doesn't bitch at me)

It's pretty niffty. For example to get my emulator to run at 60FPS regardless of the monitors refresh rate:

HighTimer VBlank;
//blah blah balh
VBlank.Process(VBlank.Frequancy/60,60);
if(VBlank.Intervals!=VBlank.OldIntervals){
//render
}


Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement