mirror of https://github.com/pret/pokeemerald.git
Updated Improving the WaitForVBlank function (markdown)
parent
f26e64f3ba
commit
8a2a34d7a8
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue