23 June 2019, 18:04 | #1 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
Understanding framerate
I think I'm confusing myself!
Simple question... If I have a main loop such as this (pseudo code): Code:
while (!mouseClick()) { gameLogic(); WaitTOF(); updatePlayfield(); } [EDIT] I'll leave the question there but never mind. As soon as I posted I noticed I had a setting wrong in my WinUAE display settings!! |
05 July 2019, 06:17 | #2 | |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
|
Quote:
Code:
while (!mouseClick()) { ticks = (currentTime - lastTime) gameLogic(ticks); updateDisplay(); } I could be wrong though, that was many years ago |
|
05 July 2019, 12:15 | #3 |
Registered User
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
|
Well I did consider that perhaps I should be using a timer but I was more thinking about that from a knowing my FPS point of view which in the end I just enabled the onscreen display in Win-UAE and my monitor
[EDIT] I just added an artificial delay to my 'GameLogic' method and realised that the WinUAE FPS display is always displaying 50 anyway regardless of how many updates per second my game is doing because at the end of the day, that's the FPS of the emulated monitor. So I could do with an FPS display anyway. Hmm, so I am going to need to tackle fonts earlier than I thought! BUT, doesn't that only work if you're double-buffering and can therefore write to the screen at any point? I need to ensure I'm not updating the display outside of VBlank which is why I have the Wait in there. I'm still a little stuck but for a different reason and I think my current problem is more ensuring that the sprite hardware doesn't read from my sprite struct when I'm updating it which works 99.9% of the time but it looks like it occasionally doesn't work. Last edited by MartinW; 05 July 2019 at 12:24. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saint Dragon framerate fix | Puggsy | project.WHDLoad | 20 | 22 May 2019 19:05 |
WHDLoad low framerate - tooltype options? | AndersHP | support.Apps | 5 | 07 March 2011 14:22 |
[A1200] Weird skips in framerate (WHDLoad) | 8bitbubsy | support.Hardware | 2 | 16 January 2010 12:39 |
Stunt Car Racer framerate | john4p | support.WinUAE | 18 | 03 December 2008 21:45 |
Framerate limit not working when JIT enabled | rsn8887 | support.WinUAE | 0 | 18 October 2008 05:09 |
|
|