summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurausukun <lord.uber1@gmail.com>2021-05-23 22:26:34 -0400
committerhuderlem <huderlem@gmail.com>2021-05-24 13:31:54 -0500
commit94939e395b58cf3e774a76d49b8518b8c2937432 (patch)
treea696b4f7ff486aeadc6e8fbd6083bc73f65e8dff
parentaca96a1510879906237a4b6b2176fe5e342e1386 (diff)
one last goto
-rw-r--r--gflib/bg.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/gflib/bg.c b/gflib/bg.c
index b6d1b0b92..0c702ae0f 100644
--- a/gflib/bg.c
+++ b/gflib/bg.c
@@ -173,36 +173,30 @@ u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode)
u16 offset;
s8 cursor;
- if (!IsInvalidBg(bg) && sGpuBgConfigs.configs[bg].visible)
- {
- switch (mode)
- {
- case 0x1:
- offset = sGpuBgConfigs.configs[bg].charBaseIndex * BG_CHAR_SIZE;
- break;
- case 0x2:
- offset = sGpuBgConfigs.configs[bg].mapBaseIndex * BG_SCREEN_SIZE;
- break;
- default:
- cursor = -1;
- goto end;
- }
+ if (IsInvalidBg(bg) || !sGpuBgConfigs.configs[bg].visible)
+ return -1;
+ switch (mode)
+ {
+ case 0x1:
+ offset = sGpuBgConfigs.configs[bg].charBaseIndex * BG_CHAR_SIZE;
offset = destOffset + offset;
-
cursor = RequestDma3Copy(src, (void*)(offset + BG_VRAM), size, 0);
-
if (cursor == -1)
- {
return -1;
- }
- }
- else
- {
- return -1;
+ break;
+ case 0x2:
+ offset = sGpuBgConfigs.configs[bg].mapBaseIndex * BG_SCREEN_SIZE;
+ offset = destOffset + offset;
+ cursor = RequestDma3Copy(src, (void*)(offset + BG_VRAM), size, 0);
+ if (cursor == -1)
+ return -1;
+ break;
+ default:
+ cursor = -1;
+ break;
}
-end:
return cursor;
}