Target platform: real Mac Plus
Secondary target platform for quick bug squashing: mini-vMac
My project has been real challenging. I've stumbled upon every possible bug, like always, despite avoiding a ton more. But I feel like mastering this brings me significantly closer to my fluid game engine goal.
I've been juggling 3 types of events:
1) Do some moderate DrawString + FillRect to erase it + load strings from resources, on a small portion of the screen, on both screen buffers for good measure as to not get a sudden discontinuity when the screen flips
2) Screen flipping (happens every 4 or 5 seconds at worst, usually 10 seconds.
3) getting PICT from resources and drawing them on only 1 screen
The VBL task decrements one counter for each and nothing else - I kept it very simple so it can get nope out of there quickly and let the main loop retake control.
A hard coded array (for each) tells when the next event occurs in tick count, which gets pumped into the globals that are tracked within the VBL task.
Anticipating problem #1: maybe the getting and drawing of a PICT (512x300) would have take too long sometimes, so I made sure to balance it right in the middle of screen flips.
Anticipating problem #2: the time it takes to draw and do offscreen stuff used to be not taken into account. I'd finish the task, then set the timer for the next one (wasn't noticeable under the emulator in all-out speed mode, but very noticeable under real metal conditions). Now, I get the signal to perform the task, I add the next one as a pending event right away, then perform the task(s) at hand. I've even let my loop deal with only one pending task of each type per loop pass, accepting that there might be more than 1 per type waiting. It patiently waits until the next pass of the main loop to get to it. This lets a catching up mechanism occur.
Anticipating problem #3: Fearing the PICT events the most, I've loaded ALL of it in advance in memory at the start of the program, at worst it uses around 220kb of RAM, which is not that bad. Only the draw to main/alt as offscreen manipulation occurs in the main loop now.
Still, I'm having issues getting a snappy, on-time unfolding of events. I'm tempted to just throw the towel once more and have you guys take a look if you're interested.
Secondary target platform for quick bug squashing: mini-vMac
My project has been real challenging. I've stumbled upon every possible bug, like always, despite avoiding a ton more. But I feel like mastering this brings me significantly closer to my fluid game engine goal.
I've been juggling 3 types of events:
1) Do some moderate DrawString + FillRect to erase it + load strings from resources, on a small portion of the screen, on both screen buffers for good measure as to not get a sudden discontinuity when the screen flips
2) Screen flipping (happens every 4 or 5 seconds at worst, usually 10 seconds.
3) getting PICT from resources and drawing them on only 1 screen
The VBL task decrements one counter for each and nothing else - I kept it very simple so it can get nope out of there quickly and let the main loop retake control.
A hard coded array (for each) tells when the next event occurs in tick count, which gets pumped into the globals that are tracked within the VBL task.
Anticipating problem #1: maybe the getting and drawing of a PICT (512x300) would have take too long sometimes, so I made sure to balance it right in the middle of screen flips.
Anticipating problem #2: the time it takes to draw and do offscreen stuff used to be not taken into account. I'd finish the task, then set the timer for the next one (wasn't noticeable under the emulator in all-out speed mode, but very noticeable under real metal conditions). Now, I get the signal to perform the task, I add the next one as a pending event right away, then perform the task(s) at hand. I've even let my loop deal with only one pending task of each type per loop pass, accepting that there might be more than 1 per type waiting. It patiently waits until the next pass of the main loop to get to it. This lets a catching up mechanism occur.
Anticipating problem #3: Fearing the PICT events the most, I've loaded ALL of it in advance in memory at the start of the program, at worst it uses around 220kb of RAM, which is not that bad. Only the draw to main/alt as offscreen manipulation occurs in the main loop now.
Still, I'm having issues getting a snappy, on-time unfolding of events. I'm tempted to just throw the towel once more and have you guys take a look if you're interested.
Last edited: