+Cafeman Posted August 28, 2002 Share Posted August 28, 2002 You know, I've tried to be as efficient in Koffi:Yellow Kopter as possible because I didn't know how much time I had in between vertical blanks. I am using an engine based off Dan's example, where I have a loop that ends in a JSR WAITVB. I also have 6-8 DLI's on each screen, and I still don't understand what effect that has on the total time I have for game code to execute (any?). I'm in Antic E. I just keep on adding stuff. Is there any way to know if my code goes too long, and then when i hit the JSR WAITVB, it'd wait until the next one? I don't really notice any adverse effects, although I have noticed a few oddities as the game has progressed but I can't put my finger on anything concrete. If I do miss a frame here & there, would I even notice? Just wondering. Quote Link to comment Share on other sites More sharing options...
+Cafeman Posted August 28, 2002 Author Share Posted August 28, 2002 I just thought of saving off the value of $02 for both its previous and new values within the waitvblank routine. Every time I halted the VSS execution, the two values were identical. $a9,$a9. Which doesn't make sense, unless I am pausing it while within waitvb itself, before it updates my hold variable with the current value of $02. Then I ran the program to a particular line of code, and I finally saw what I expected -- PrevVBlankTimer = $a9, VBlankTimer = $aa, for example. If I had seen a differences > 1, I'd have assumed that I skipped a frame. I might just put in a little routine to check if these values are ever > 1 away from each other and to "do something" if so. But it seems to me that I'm okay for now. Still, please feel free to give your thoughts on the matter. Quote Link to comment Share on other sites More sharing options...
+Cafeman Posted August 28, 2002 Author Share Posted August 28, 2002 eh, I think my little test above is flawed. My head spins..... Quote Link to comment Share on other sites More sharing options...
DEBRO Posted August 28, 2002 Share Posted August 28, 2002 There is the potential of missing a frame doing your code this way. You actually might not see it but it's possible. For example let's say you're in your game code and right when you load the accumulator with RTCLOK+1 the value changes because VBLANK happened. You would end up waiting a frame (1/60 of a second) before your code executed again. Again you might not see it. If you have code that is based on the 1/60th frame rate then you would notice a delay. I remember Tempest seeing this with his timer for Cypher. It would lag every once in a while because he was using the same method. Once he moved his code to the VVBLKD then the clock was consistently firing every second. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.