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

Repost after borked post.

Sign in to follow this  

122 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;}
};





(I formatted it just for you, mattd)

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
}

Edit: looks like this one worked, damn broke-ass GDNet.

Edit 2: Appears to have just been an FF bug, of course [rolleyes]
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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