diff options
-rw-r--r-- | asm/pokemon_storage_system.s | 77 | ||||
-rw-r--r-- | include/pokemon_storage_system.h | 9 | ||||
-rw-r--r-- | src/pokemon/pokemon_storage_system_3.c | 16 |
3 files changed, 23 insertions, 79 deletions
diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index 3f9795384..3c4a03ad5 100644 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -5,83 +5,6 @@ .text - thumb_func_start sub_809900C -sub_809900C: @ 809900C - push {r4-r6,lr} - lsls r1, 24 - lsrs r1, 24 - ldr r4, _08099058 @ =gPokemonStorageSystemPtr - ldr r5, [r4] - ldr r3, _0809905C @ =0x0000117c - adds r2, r5, r3 - movs r3, 0 - strb r3, [r2] - ldr r6, _08099060 @ =0x0000117d - adds r2, r5, r6 - strb r0, [r2] - ldr r2, _08099064 @ =0x0000117b - adds r0, r5, r2 - strb r1, [r0] - subs r6, 0xB - adds r2, r5, r6 - movs r0, 0x20 - strh r0, [r2] - lsls r1, 24 - asrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - negs r0, r0 - adds r6, 0x4 - adds r2, r5, r6 - strh r0, [r2] - ldr r2, _08099068 @ =0x00001178 - adds r0, r5, r2 - strh r3, [r0] - cmp r1, 0 - ble _08099070 - ldr r3, _0809906C @ =0x0000117a - adds r1, r5, r3 - movs r0, 0 - b _08099076 - .align 2, 0 -_08099058: .4byte gPokemonStorageSystemPtr -_0809905C: .4byte 0x0000117c -_08099060: .4byte 0x0000117d -_08099064: .4byte 0x0000117b -_08099068: .4byte 0x00001178 -_0809906C: .4byte 0x0000117a -_08099070: - ldr r6, _080990A0 @ =0x0000117a - adds r1, r5, r6 - movs r0, 0x5 -_08099076: - strb r0, [r1] - ldr r2, [r4] - ldr r1, _080990A0 @ =0x0000117a - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, 0x64 - ldr r3, _080990A4 @ =0x00001174 - adds r1, r2, r3 - strh r0, [r1] - ldr r6, _080990A8 @ =0x00001176 - adds r2, r6 - movs r1, 0 - ldrsh r0, [r2, r1] - bl sub_8098DE0 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080990A0: .4byte 0x0000117a -_080990A4: .4byte 0x00001174 -_080990A8: .4byte 0x00001176 - thumb_func_end sub_809900C - thumb_func_start sub_80990AC sub_80990AC: @ 80990AC push {r4-r6,lr} diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 295084eea..0f20bfa16 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -101,9 +101,14 @@ struct PokemonStorageSystemData { u8 filler_10c8[8]; u16 unk_10d0[40]; u16 unk_1120[40]; - u8 filler_1170[8]; + u8 filler_1170[2]; + u16 unk_1172; + u16 unk_1174; + s16 unk_1176; u16 unk_1178; - u8 filler_117a[3]; + u8 unk_117a; + u8 unk_117b; + u8 unk_117c; u8 unk_117d; u8 filler_117e[0x6a]; u8 *unk_11e8; diff --git a/src/pokemon/pokemon_storage_system_3.c b/src/pokemon/pokemon_storage_system_3.c index 77d85de65..af050d324 100644 --- a/src/pokemon/pokemon_storage_system_3.c +++ b/src/pokemon/pokemon_storage_system_3.c @@ -193,3 +193,19 @@ u8 sub_8098EE0(u8 a0, u16 a1, s16 a2) } return count; } + +void sub_809900C(u8 a0, s8 a1) +{ + gPokemonStorageSystemPtr->unk_117c = 0; + gPokemonStorageSystemPtr->unk_117d = a0; + gPokemonStorageSystemPtr->unk_117b = a1; + gPokemonStorageSystemPtr->unk_1172 = 32; + gPokemonStorageSystemPtr->unk_1176 = -6 * a1; + gPokemonStorageSystemPtr->unk_1178 = 0; + if (a1 > 0) + gPokemonStorageSystemPtr->unk_117a = 0; + else + gPokemonStorageSystemPtr->unk_117a = 5; + gPokemonStorageSystemPtr->unk_1174 = 24 * gPokemonStorageSystemPtr->unk_117a + 0x64; + sub_8098DE0(gPokemonStorageSystemPtr->unk_1176); +} |