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

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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 #12614 of 15019 |
Re: [gbadev] timer-problems

> while(REG_TM3D < 263){} //doesn't work
>
> while(REG_TM3D < 263){WaitVblank();} //works....

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 at roughly 60Hz... That's probably not what
you want when you use a timer, because you won't be able to test the timer's
value while the CPU is on halt (you will only peek once a frame so the timer
will probably loop a few times in the meantime, depending on timer
frequency).

Jan-Lieuwe





Thu Sep 5, 2002 4:40 pm

jan-lieuwe@...
Send Email Send Email

Forward
Message #12614 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
Online Now 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