diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-04 09:37:56 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-04 09:37:56 -0400 |
commit | d53b7d3b2eb17cc6e7973b50f460709df658bad5 (patch) | |
tree | 7e7614f61dced8925b73ed776916d4779333fe4b | |
parent | ae417f7590829d6018cd80e02364834dedd88fe4 (diff) |
A couple more small functions in decoration.s
-rwxr-xr-x | asm/decoration.s | 42 | ||||
-rwxr-xr-x[-rw-r--r--] | include/global.fieldmap.h | 26 | ||||
-rwxr-xr-x | src/decoration.c | 12 |
3 files changed, 25 insertions, 55 deletions
diff --git a/asm/decoration.s b/asm/decoration.s index 44ec1ebb4..62dc1d1ab 100755 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -8,48 +8,6 @@ .equiv ewram_1f000, 0x0201f000 - thumb_func_start sub_8100874 -sub_8100874: @ 8100874 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_0810087A: - lsls r0, r4, 5 - adds r0, 0x84 - adds r0, r5, r0 - lsls r2, r4, 1 - adds r1, r5, 0x4 - adds r1, r2 - ldrh r1, [r1] - bl sub_8100740 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _0810087A - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8100874 - - thumb_func_start sub_810089C -sub_810089C: @ 810089C - lsls r0, 16 - ldr r1, _081008B4 @ =gMapHeader - ldr r1, [r1] - ldr r1, [r1, 0x14] - ldr r1, [r1, 0xC] - lsrs r0, 15 - adds r0, r1 - ldrh r1, [r0] - ldr r0, _081008B8 @ =0x00000fff - ands r0, r1 - bx lr - .align 2, 0 -_081008B4: .4byte gMapHeader -_081008B8: .4byte 0x00000fff - thumb_func_end sub_810089C - thumb_func_start sub_81008BC sub_81008BC: @ 81008BC push {r4-r7,lr} diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index a0fe0e6ab..b8bab45d8 100644..100755 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -44,23 +44,23 @@ typedef void (*TilesetCB)(void); struct Tileset { - bool8 isCompressed; - bool8 isSecondary; - void *tiles; - void *palettes; - void *metatiles; - void *metatileAttributes; - TilesetCB callback; + /*0x00*/ bool8 isCompressed; + /*0x01*/ bool8 isSecondary; + /*0x04*/ void *tiles; + /*0x08*/ void *palettes; + /*0x0c*/ void *metatiles; + /*0x10*/ void *metatileAttributes; + /*0x14*/ TilesetCB callback; }; struct MapData { - s32 width; - s32 height; - u16 *border; - u16 *map; - struct Tileset *primaryTileset; - struct Tileset *secondaryTileset; + /*0x00*/ s32 width; + /*0x04*/ s32 height; + /*0x08*/ u16 *border; + /*0x0c*/ u16 *map; + /*0x10*/ struct Tileset *primaryTileset; + /*0x14*/ struct Tileset *secondaryTileset; }; struct BackupMapData diff --git a/src/decoration.c b/src/decoration.c index 3dd3d4dd3..eed0f9f67 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1956,3 +1956,15 @@ void sub_8100740(u8 *dest, u16 flags) break; } } + +void sub_8100874(struct UnkStruct_02038900 *unk_02038900) +{ + u16 i; + for (i=0; i<0x40; i++) + sub_8100740(&unk_02038900->unk_084[i * 32], unk_02038900->unk_004[i]); +} + +u16 sub_810089C(u16 a0) +{ + return ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles)[a0] & 0xfff; +} |