From 9f53825ce2701f94470a98b3decd8013fbeba91a Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 7 Sep 2013 23:38:19 -0400 Subject: move common asm from engine/ to common/ engine/ was getting really bloated and common asm wasnt what it was made for --- common/delay.asm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 common/delay.asm (limited to 'common/delay.asm') diff --git a/common/delay.asm b/common/delay.asm new file mode 100644 index 000000000..4e8b2147c --- /dev/null +++ b/common/delay.asm @@ -0,0 +1,23 @@ +DelayFrame: ; 45a +; Wait for one frame + ld a, 1 + ld [VBlankOccurred], a + +; Wait for the next VBlank, halting to conserve battery +.halt + halt ; rgbasm adds a nop after this instruction by default + ld a, [VBlankOccurred] + and a + jr nz, .halt + ret +; 468 + + +DelayFrames: ; 468 +; Wait c frames + call DelayFrame + dec c + jr nz, DelayFrames + ret +; 46f + -- cgit v1.2.3