diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-12-31 00:40:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-31 00:40:45 -0500 |
commit | ec85c01e7c6d15060eddcc653db33a4b317646d2 (patch) | |
tree | 4266c43bcdc1c80c52def44e1470182d3f1c665c /src/multiboot.c | |
parent | 093610b46e99b517a416ccd5a572054dff09801b (diff) | |
parent | 0c74e2097ffbe8395d6f3659c2a49fc829d69b99 (diff) |
Merge branch 'master' into doc-factscreen
Diffstat (limited to 'src/multiboot.c')
-rw-r--r-- | src/multiboot.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/multiboot.c b/src/multiboot.c index c7e14392e..19245b5b3 100644 --- a/src/multiboot.c +++ b/src/multiboot.c @@ -1,3 +1,4 @@ +#include "global.h" #include "gba/gba.h" #include "multiboot.h" @@ -435,23 +436,23 @@ static int MultiBootHandShake(struct MultiBootParam *mp) #undef must_data } -static NOINLINE void MultiBootWaitCycles(u32 cycles) +NAKED +static void MultiBootWaitCycles(u32 cycles) { - asm("mov r2, pc"); - asm("lsr r2, #24"); - asm("mov r1, #12"); - asm("cmp r2, #0x02"); - asm("beq MultiBootWaitCyclesLoop"); - - asm("mov r1, #13"); - asm("cmp r2, #0x08"); - asm("beq MultiBootWaitCyclesLoop"); - - asm("mov r1, #4"); - - asm("MultiBootWaitCyclesLoop:"); - asm("sub r0, r1"); - asm("bgt MultiBootWaitCyclesLoop"); + asm_unified("\ + mov r2, pc\n\ + lsrs r2, 24\n\ + movs r1, 12\n\ + cmp r2, 2\n\ + beq MultiBootWaitCyclesLoop\n\ + movs r1, 13\n\ + cmp r2, 8\n\ + beq MultiBootWaitCyclesLoop\n\ + movs r1, 4\n\ +MultiBootWaitCyclesLoop:\n\ + subs r0, r1\n\ + bgt MultiBootWaitCyclesLoop\n\ + bx lr\n"); } static void MultiBootWaitSendDone(void) |