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? :)
Posted on 2002-06-28 03:32:47 by Maverick
Maverick,

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)
Posted on 2002-06-28 04:05:26 by bazik
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:
Posted on 2002-06-28 04:12:03 by Maverick


<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 :)
Posted on 2002-06-28 04:14:51 by bazik



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 :)
Yes, I know, and I set it to Shutdown.. but sometimes Windows just forgets it. ;)
Posted on 2002-06-28 04:50:21 by Maverick
I did forgot about this test,

Just did it now and it works Ok on Win98 and on Win2k

it uses QPF API?
Posted on 2002-07-04 15:37:26 by BogdanOntanu
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.
Posted on 2002-07-04 19:41:20 by AmkG

I did forgot about this test,

Just did it now and it works Ok on Win98 and on Win2k

it uses QPF API?
Yes, it does.

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.
Posted on 2002-07-05 02:45:33 by Maverick
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 ;)
Posted on 2002-07-05 08:41:09 by BogdanOntanu
Ignore flag_no_messages? So how would I exit the main game loop?
Posted on 2002-07-06 03:49:17 by AmkG
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 ;)
Posted on 2002-07-06 05:26:49 by BogdanOntanu
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?
Posted on 2002-07-07 09:35:57 by AmkG
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
Posted on 2002-07-08 15:53:42 by BogdanOntanu
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.
Posted on 2002-07-13 10:53:14 by ti_mo_n
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?
Posted on 2002-07-13 22:48:30 by AmkG
29D1CE84=701615748 on my Celeron700 MHz, ok.
Posted on 2002-07-16 11:54:46 by scientica
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.
???
Posted on 2002-07-18 02:32:21 by scarpelius

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.
???
Please, could you test using also other utilities and report?
Posted on 2002-07-18 03:35:29 by Maverick
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.
Posted on 2002-07-18 05:37:34 by scarpelius
Thank you.
Posted on 2002-07-18 15:16:11 by Maverick