diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2020-12-13 16:48:05 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 16:48:05 -0600 |
commit | 4b7009286856fea6a6727dc09169e8ba7b3eefc0 (patch) | |
tree | 77f8dbd111b582ddcc327dcda0bfb178197f14fd /src/music.c | |
parent | c1606fc87ed78f04708bbb6ea8c61496a7764149 (diff) | |
parent | b02a392e94e05d98a6c8fa2b20bdca99861c7df8 (diff) |
Merge pull request #9 from mateon1/nonmatchings
Fix a lot of nonmatchings
Diffstat (limited to 'src/music.c')
-rw-r--r-- | src/music.c | 61 |
1 files changed, 3 insertions, 58 deletions
diff --git a/src/music.c b/src/music.c index 13544d9..8997887 100644 --- a/src/music.c +++ b/src/music.c @@ -99,12 +99,8 @@ void nullsub_179(void) { } -#ifndef NONMATCHING -NAKED -#endif u8 sub_800CA38(u32 songIndex) { -#ifdef NONMATCHING if(IsBGSong(songIndex)) { if(sub_800CAE0(songIndex) == 0) @@ -114,70 +110,19 @@ u8 sub_800CA38(u32 songIndex) } if(sub_800CACC(songIndex)) { - // TODO compiler gets weird here wanted to skip to next check if(sub_800CAE0(songIndex) == 1) { - _0800CA70: return 1; } } - if(sub_800CAAC(songIndex)) + else if(sub_800CAAC(songIndex)) { - if((sub_800CAE0(songIndex) > 1)) + if(sub_800CAE0(songIndex) > 1) { - goto _0800CA70; + return 1; } } return 0; -#else - asm_unified("\tpush {r4,lr}\n" - "\tadds r4, r0, 0\n" - "\tbl IsBGSong\n" - "\tlsls r0, 24\n" - "\tcmp r0, 0\n" - "\tbeq _0800CA54\n" - "\tlsls r0, r4, 16\n" - "\tlsrs r0, 16\n" - "\tbl sub_800CAE0\n" - "\tlsls r0, 16\n" - "\tcmp r0, 0\n" - "\tbeq _0800CA70\n" -"_0800CA54:\n" - "\tadds r0, r4, 0\n" - "\tbl sub_800CACC\n" - "\tlsls r0, 24\n" - "\tcmp r0, 0\n" - "\tbeq _0800CA74\n" - "\tlsls r0, r4, 16\n" - "\tlsrs r0, 16\n" - "\tbl sub_800CAE0\n" - "\tlsls r0, 16\n" - "\tlsrs r0, 16\n" - "\tcmp r0, 0x1\n" - "\tbne _0800CA90\n" -"_0800CA70:\n" - "\tmovs r0, 0x1\n" - "\tb _0800CA92\n" -"_0800CA74:\n" - "\tadds r0, r4, 0\n" - "\tbl sub_800CAAC\n" - "\tlsls r0, 24\n" - "\tcmp r0, 0\n" - "\tbeq _0800CA90\n" - "\tlsls r0, r4, 16\n" - "\tlsrs r0, 16\n" - "\tbl sub_800CAE0\n" - "\tlsls r0, 16\n" - "\tlsrs r0, 16\n" - "\tcmp r0, 0x1\n" - "\tbhi _0800CA70\n" -"_0800CA90:\n" - "\tmovs r0, 0\n" -"_0800CA92:\n" - "\tpop {r4}\n" - "\tpop {r1}\n" - "\tbx r1"); -#endif } void nullsub_19(void) |