Yes, precision is few thousands Hz.. but, you know, I'm maniacal when it comes to precision and don't consider that precise. :grin:
I'm immersed into urgent work, but after I finish that I'll post a "definitive" CPU speed routine (cumulative precision, i.e. after some seconds it goes down to the Hz.. so RDTSC is all one needs for any critical timings application). :)
Still, I'd like to see if QPx really doesn't work on Bog's HP PC.
Thank you to all those that tested it.
bitRAKE: just curious.. did you copy it by hand, or do you have a clipboard capable of copying from simple MessageBox:es? :)
I'm immersed into urgent work, but after I finish that I'll post a "definitive" CPU speed routine (cumulative precision, i.e. after some seconds it goes down to the Hz.. so RDTSC is all one needs for any critical timings application). :)
Still, I'd like to see if QPx really doesn't work on Bog's HP PC.
Thank you to all those that tested it.
bitRAKE: just curious.. did you copy it by hand, or do you have a clipboard capable of copying from simple MessageBox:es? :)
Maverick,
Just press CTRL+C when the MessageBox has the focus and insert it with CTRL+V:
(made on my machine here at work)
Just press CTRL+C when the MessageBox has the focus and insert it with CTRL+V:
---------------------------
Message HEX U64
---------------------------
000000003B9B6CF0
---------------------------
OK
---------------------------
(made on my machine here at work)
Uh.. thanks bAZiK it's always nice to learn something new :)
This is something I don't like of Windows: lack of "orthogonality" (linearity?). For example, you can't highlight with the mouse the text on the MessageBox, thus I thought there was no clipboard support. Also, no menu was available for that. But CTRL-C works.. argh.
It happens for many other things.. like in the Connect To Internet box, where sometimes things f**k up, and if you click on Connect it doesn't work, but if you press Enter it does. :grin:
I think that both actions should trigger the same code, not two different routines that do the same thing.
I'd have many other examples, but I tend to forget such traumatic experiences. :grin:
<EDIT>It just happened again, for example, that if I press the ATX poweroff button it doesn't want to shut down anymore, but commanding it from the menu it does.. bah</EDIT>
Anyway, thanks for the tip.. I'm a bit less ignorant now in my life. :alright:
This is something I don't like of Windows: lack of "orthogonality" (linearity?). For example, you can't highlight with the mouse the text on the MessageBox, thus I thought there was no clipboard support. Also, no menu was available for that. But CTRL-C works.. argh.
It happens for many other things.. like in the Connect To Internet box, where sometimes things f**k up, and if you click on Connect it doesn't work, but if you press Enter it does. :grin:
I think that both actions should trigger the same code, not two different routines that do the same thing.
I'd have many other examples, but I tend to forget such traumatic experiences. :grin:
<EDIT>It just happened again, for example, that if I press the ATX poweroff button it doesn't want to shut down anymore, but commanding it from the menu it does.. bah</EDIT>
Anyway, thanks for the tip.. I'm a bit less ignorant now in my life. :alright:
<EDIT>It just happened again, for example, that if I press the ATX poweroff button it doesn't want to shut down anymore, but commanding it from the menu it does.. bah</EDIT>
You can set in the "Energy Options" what should happen when you press the poweroff button: Standby, Shutdown, Sleep, Nothing :)
I set it to "Nothing" on my box, because I often hit the Butten when I put a CD from the Burner to the DVD drive :)
You can set in the "Energy Options" what should happen when you press the poweroff button: Standby, Shutdown, Sleep, Nothing :)
I set it to "Nothing" on my box, because I often hit the Butten when I put a CD from the Burner to the DVD drive :)
I did forgot about this test,
Just did it now and it works Ok on Win98 and on Win2k
it uses QPF API?
Just did it now and it works Ok on Win98 and on Win2k
it uses QPF API?
Originally posted by BogdanOntanu
;=========================================
; so...there are no win messages....
; HERE we do our GAME MAIN LOOP
;=========================================
nu_sunt_msg:
pushad
Is the pushad and popad really needed?
;=======================================
; test: is game loop on?
; so that in future we dont make useless/dummy/dangerouse
; paint to screen/direct draw even on pause....
;=======================================
Call Game_Main
;==================================
; just return to WIN message loop
;=================================
popad
;====================================
; return to main Message Loop
;====================================
cmp [flag_no_messages],1
jz nu_sunt_msg
Does Game_Main set flag_no_messages when it detects a message? Or does some other thing set this flag_no_message flag?
Just wondering.
I did forgot about this test,
Just did it now and it works Ok on Win98 and on Win2k
it uses QPF API?
I imagined QPx must have worked also on your HP, that's why I wanted to test it anyway.
And these are good news. ;)
Your previous attempts probably failed because you forgot to align (to at least a 32bit boundary) the 64bit variable that is gonna be passed to QPx via a pointer. In 9x this works, in NT it doesn't. Weird, because there's no good reason (besides Microsoft weirdness) to a behaviour like this.
Anyway, to my best knowledge QPx works on every x86 Windows PC.
AMKG
Nope the pushad/popad are not really needed (well it depends on what you do insides main game loop) but basically its just my paranoia ;)
flag_no_messages is setup inside game main but you can ignore it for now, as its more advanced stuff ;)
Nope the pushad/popad are not really needed (well it depends on what you do insides main game loop) but basically its just my paranoia ;)
flag_no_messages is setup inside game main but you can ignore it for now, as its more advanced stuff ;)
Ignore flag_no_messages? So how would I exit the main game loop?
Please notice that in the original code i posted there are two comment lines just adviceing you to do that, code will fall thru to the jmp msg_loop instruction and and everything will go on once again...
Game main is just a call so it will return with a ret instruction ... of course after doing one frame of GFX / game AI ;)
Game main is just a call so it will return with a ret instruction ... of course after doing one frame of GFX / game AI ;)
Ooops my bad... my brain didn't process the loop properly, sorry. So why is using a flag_no_messages more advanced, what technique would require this?
Well it will require that u use Directinput exclusive mode to deal with mouse and keyboard events, wait for Alt+tab and Ctrl+Alt+del in your own handler and only then reenable window message loop after disabling your own stuff etc, just to get a little independent and a little faster, also windows messages can slow down your game sometimes...
but you do not need such stuff for a normal beginner game ;)
whem you will fell the need you will do so... dont try to learn too much without experience :P
but you do not need such stuff for a normal beginner game ;)
whem you will fell the need you will do so... dont try to learn too much without experience :P
on pentium, pentium mmx, and pII it is better to have something like this as a loopL:
check if we have message
if yes -> jump DOWn <-- it's very important: message processing must be AFTER our loop
process some loop
jmp 'check for message'
process message
jmp 'check for message'
it'll be faster than: jump if there are no messages
on my celeron it works the same: 'jumping on message' is faster than 'jumping on no-message'.
ehhhm, anyone understands?
it's because if CPU detects conditional jump to lower address (jump-back) it jumps in default, and it DOESN"T jump in default if we have jump-forward.
it's because CPU cannot guess, whether conditional jump will succeed.
so:
conditional jumps to higher addresses are guessed as failed
conditional jumps to lower addresses are guessed as succedded
and then pipeline is filled with new instructions, after conditional-jump instruction.
if anyone understands thatm then e-mail me because i don't understand :) :P.
i know that this text is not very clean to understand, but please! i haven't slept for something about 20 hrs, so i'm going to bed right now.
check if we have message
if yes -> jump DOWn <-- it's very important: message processing must be AFTER our loop
process some loop
jmp 'check for message'
process message
jmp 'check for message'
it'll be faster than: jump if there are no messages
on my celeron it works the same: 'jumping on message' is faster than 'jumping on no-message'.
ehhhm, anyone understands?
it's because if CPU detects conditional jump to lower address (jump-back) it jumps in default, and it DOESN"T jump in default if we have jump-forward.
it's because CPU cannot guess, whether conditional jump will succeed.
so:
conditional jumps to higher addresses are guessed as failed
conditional jumps to lower addresses are guessed as succedded
and then pipeline is filled with new instructions, after conditional-jump instruction.
if anyone understands thatm then e-mail me because i don't understand :) :P.
i know that this text is not very clean to understand, but please! i haven't slept for something about 20 hrs, so i'm going to bed right now.
Ah... interesting....
Say, what would WndProc handle? I presume there's one because your doing a message loop? Presumably it will never receive WM_PAINT anymore, so maybe it just processes WM_KEY and WM_MOUSE?
Say, what would WndProc handle? I presume there's one because your doing a message loop? Presumably it will never receive WM_PAINT anymore, so maybe it just processes WM_KEY and WM_MOUSE?
29D1CE84=701615748 on my Celeron700 MHz, ok.
Maverick
On my home computer is not showing the expected freq.
In BIOS I have PIII at 933 Mhz.
Your progy show only 766 Mhz.
???
On my home computer is not showing the expected freq.
In BIOS I have PIII at 933 Mhz.
Your progy show only 766 Mhz.
???
Maverick
On my home computer is not showing the expected freq.
In BIOS I have PIII at 933 Mhz.
Your progy show only 766 Mhz.
???
Yes, this is my intention.
But I have spoken whith few friends and it seems to me that I have a funny CPU. Or problem with motherboard (440BX). Any way I will test it with wcpu30g. Also I dwld a tool to test from Intel.
I let you know the result.
But I have spoken whith few friends and it seems to me that I have a funny CPU. Or problem with motherboard (440BX). Any way I will test it with wcpu30g. Also I dwld a tool to test from Intel.
I let you know the result.
Thank you.