Updated Improving the WaitForVBlank function (markdown)

ExpoSeed 2021-01-26 14:24:24 -06:00
parent f26e64f3ba
commit 8a2a34d7a8
1 changed files with 1 additions and 1 deletions

@ -8,7 +8,7 @@ In Emerald, Gamefreak used a `while` loop that kept on checking for VBlank over
The correct way to vsync is to use a [software interrupt/BIOS call](https://www.coranac.com/tonc/text/swi.htm#sec-vsync2). In short, we put the CPU in low power mode while we wait for the next VBlank, and on the next VBlank the CPU comes back to life. The correct way to vsync is to use a [software interrupt/BIOS call](https://www.coranac.com/tonc/text/swi.htm#sec-vsync2). In short, we put the CPU in low power mode while we wait for the next VBlank, and on the next VBlank the CPU comes back to life.
The easiest way to do so, is by copying and pasting the function directly from Ruby and Sapphire, which means modifying the function like this: The easiest way to do so, is by copying and pasting the function directly from Ruby and Sapphire, which means modifying the function in `src/main.c` like this:
```diff ```diff
static void WaitForVBlank(void) static void WaitForVBlank(void)