Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
timer-problems   Message List  
Reply | Forward Message #12612 of 15019 |
hello there..

since i need a timer in my game, i tried to create a function which uses one of
the internal timer registers (obviously).
the problem i encountered was:

if i create a while-loop and check the value of the counter, it never stops!
(means: the cpu doesn't check the value of the counter, but if i insert
something like
"WaitforVBlank()" into the while-loop, the counter works correctly (but
significantly slower...).

while(REG_TM3D < 263){} //doesn't work

while(REG_TM3D < 263){WaitVblank();} //works....

i also tried to enable the interrupt-on-overflow...didn't work either...

it just seems that counting occupies the cpu to 100% so he doesn't have the time
anymore to check if the abort-conditions have already reached...
i really don't have a clue how to fix that.

cheers

roman


[Non-text portions of this message have been removed]





Thu Sep 5, 2002 2:19 pm

schoebey
Offline Offline
Send Email Send Email

Forward
Message #12612 of 15019 |
Expand Messages Author Sort by Date

hello there.. since i need a timer in my game, i tried to create a function which uses one of the internal timer registers (obviously). the problem i...
Roman Schaub
schoebey
Offline Send Email
Sep 5, 2002
4:20 pm

You're sure you have declared REG_TM3D to be volatile right? Otherwise the value will likely be cached, thus changes in it will be unnoticed? Just something...
Wogan
wogan_gwb
Offline Send Email
Sep 5, 2002
4:59 pm

... How is 'REG_TMD3D' defined? Is it volatile? Waiting for Vblank within the while loop puts the CPU on halt until a Vblank interrupt fires, so that happens...
Jan-Lieuwe Koopmans
jan-lieuwe@...
Send Email
Sep 5, 2002
5:02 pm

Normally there is no need to check the timer yourself.. The normal timer usage is this: Set the correct period to use.. (every 1, 64, 256 or 1024 clocks) Set...
Willem Kokke
thezensunni
Offline Send Email
Sep 5, 2002
5:03 pm

... the ... well, that is exactly the plan. i wanted to implement a timer that is accurate to 1/1000 s... ... volatile ... it was indeed the problem that the...
schoebey
Offline Send Email
Sep 5, 2002
9:05 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help