Repost after borked post.

Published October 14, 2005
Advertisement
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]
Previous Entry (.)(.)
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement