mirror of
https://github.com/pret/pokeruby.git
synced 2026-08-09 19:07:50 -05:00
sub_80FF5BC
This commit is contained in:
parent
1ef73db929
commit
3d82de46b8
135
asm/decoration.s
135
asm/decoration.s
|
|
@ -8,141 +8,6 @@
|
|||
|
||||
.equiv ewram_1f000, 0x0201f000
|
||||
|
||||
thumb_func_start sub_80FF58C
|
||||
sub_80FF58C: @ 80FF58C
|
||||
push {lr}
|
||||
movs r1, 0
|
||||
ldr r0, _080FF5A8 @ =ewram_1f000
|
||||
ldrb r2, [r0, 0x8]
|
||||
cmp r1, r2
|
||||
bcs _080FF5B6
|
||||
ldr r3, [r0]
|
||||
_080FF59A:
|
||||
adds r0, r3, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _080FF5AC
|
||||
movs r0, 0x1
|
||||
b _080FF5B8
|
||||
.align 2, 0
|
||||
_080FF5A8: .4byte ewram_1f000
|
||||
_080FF5AC:
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, r2
|
||||
bcc _080FF59A
|
||||
_080FF5B6:
|
||||
movs r0, 0
|
||||
_080FF5B8:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80FF58C
|
||||
|
||||
thumb_func_start sub_80FF5BC
|
||||
sub_80FF5BC: @ 80FF5BC
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r0, _080FF5E4 @ =ewram_1f000
|
||||
ldrb r0, [r0, 0x9]
|
||||
cmp r0, 0x1
|
||||
bne _080FF5F0
|
||||
ldr r0, _080FF5E8 @ =gUnknown_020388F6
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x6
|
||||
beq _080FF5F0
|
||||
cmp r0, 0x7
|
||||
beq _080FF5F0
|
||||
bl sub_80FEF74
|
||||
bl sub_80FED1C
|
||||
ldr r1, _080FF5EC @ =gSecretBaseText_DecorCantPlace
|
||||
b _080FF66E
|
||||
.align 2, 0
|
||||
_080FF5E4: .4byte ewram_1f000
|
||||
_080FF5E8: .4byte gUnknown_020388F6
|
||||
_080FF5EC: .4byte gSecretBaseText_DecorCantPlace
|
||||
_080FF5F0:
|
||||
bl sub_80FEFA4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _080FF688
|
||||
bl sub_80FF58C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _080FF62C
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
bl fade_screen
|
||||
ldr r1, _080FF624 @ =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
strh r1, [r0, 0xC]
|
||||
ldr r1, _080FF628 @ =sub_80FF6AC
|
||||
str r1, [r0]
|
||||
b _080FF69C
|
||||
.align 2, 0
|
||||
_080FF624: .4byte gTasks
|
||||
_080FF628: .4byte sub_80FF6AC
|
||||
_080FF62C:
|
||||
bl sub_80FEF74
|
||||
bl sub_80FED1C
|
||||
ldr r0, _080FF654 @ =gStringVar1
|
||||
ldr r4, _080FF658 @ =ewram_1f000
|
||||
ldrb r1, [r4, 0x8]
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl ConvertIntToDecimalStringN
|
||||
ldrb r0, [r4, 0x9]
|
||||
cmp r0, 0
|
||||
bne _080FF664
|
||||
ldr r0, _080FF65C @ =gStringVar4
|
||||
ldr r1, _080FF660 @ =gSecretBaseText_NoMoreDecor
|
||||
bl StringExpandPlaceholders
|
||||
b _080FF66C
|
||||
.align 2, 0
|
||||
_080FF654: .4byte gStringVar1
|
||||
_080FF658: .4byte ewram_1f000
|
||||
_080FF65C: .4byte gStringVar4
|
||||
_080FF660: .4byte gSecretBaseText_NoMoreDecor
|
||||
_080FF664:
|
||||
ldr r0, _080FF67C @ =gStringVar4
|
||||
ldr r1, _080FF680 @ =gSecretBaseText_NoMoreDecor2
|
||||
bl StringExpandPlaceholders
|
||||
_080FF66C:
|
||||
ldr r1, _080FF67C @ =gStringVar4
|
||||
_080FF66E:
|
||||
ldr r2, _080FF684 @ =sub_80FEFF4
|
||||
adds r0, r5, 0
|
||||
movs r3, 0
|
||||
bl DisplayItemMessageOnField
|
||||
b _080FF69C
|
||||
.align 2, 0
|
||||
_080FF67C: .4byte gStringVar4
|
||||
_080FF680: .4byte gSecretBaseText_NoMoreDecor2
|
||||
_080FF684: .4byte sub_80FEFF4
|
||||
_080FF688:
|
||||
bl sub_80FEF74
|
||||
bl sub_80FED1C
|
||||
ldr r1, _080FF6A4 @ =gSecretBaseText_InUseAlready
|
||||
ldr r2, _080FF6A8 @ =sub_80FEFF4
|
||||
adds r0, r5, 0
|
||||
movs r3, 0
|
||||
bl DisplayItemMessageOnField
|
||||
_080FF69C:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080FF6A4: .4byte gSecretBaseText_InUseAlready
|
||||
_080FF6A8: .4byte sub_80FEFF4
|
||||
thumb_func_end sub_80FF5BC
|
||||
|
||||
thumb_func_start sub_80FF6AC
|
||||
sub_80FF6AC: @ 80FF6AC
|
||||
push {r4-r7,lr}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GUARD_DECORATION_H
|
||||
#define GUARD_DECORATION_H
|
||||
|
||||
enum {
|
||||
enum DecoCat {
|
||||
/*0*/ DECOCAT_DESK,
|
||||
/*1*/ DECOCAT_CHAIR,
|
||||
/*2*/ DECOCAT_PLANT,
|
||||
|
|
@ -12,7 +12,7 @@ enum {
|
|||
/*7*/ DECOCAT_CUSHION
|
||||
};
|
||||
|
||||
enum{
|
||||
enum DecoId {
|
||||
/*000*/ DECOR_NONE,
|
||||
/*001*/ DECOR_SMALL_DESK,
|
||||
/*002*/ DECOR_POKEMON_DESK,
|
||||
|
|
@ -227,6 +227,7 @@ void sub_80FECB8(u8);
|
|||
void sub_80FECE0(u8);
|
||||
void sub_80FEF50(u8);
|
||||
void sub_80FF394(u16, u16, u16);
|
||||
void sub_80FF6AC(u8);
|
||||
void sub_8109DAC(u8);
|
||||
|
||||
#endif // GUARD_DECORATION_H
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "fieldmap.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "event_data.h"
|
||||
#include "field_weather.h"
|
||||
#include "decoration.h"
|
||||
|
||||
extern Script gUnknown_0815F399;
|
||||
|
|
@ -744,3 +745,52 @@ void sub_80FF474(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80FF58C/*IsThereRoomForMoreDecorations*/(void)
|
||||
{
|
||||
u16 i;
|
||||
for (i=0; i<ewram_1f000.size; i++)
|
||||
{
|
||||
if (ewram_1f000.items[i] == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80FF5BC(u8 taskId)
|
||||
{
|
||||
if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECOCAT_DOLL && gUnknown_020388F6 != DECOCAT_CUSHION)
|
||||
{
|
||||
sub_80FEF74();
|
||||
sub_80FED1C();
|
||||
DisplayItemMessageOnField(taskId, gSecretBaseText_DecorCantPlace, sub_80FEFF4, 0);
|
||||
} else if (sub_80FEFA4() == TRUE)
|
||||
{
|
||||
if (sub_80FF58C() == TRUE)
|
||||
{
|
||||
fade_screen(1, 0);
|
||||
gTasks[taskId].data[2] = 0;
|
||||
gTasks[taskId].func = sub_80FF6AC;
|
||||
} else
|
||||
{
|
||||
sub_80FEF74();
|
||||
sub_80FED1C();
|
||||
ConvertIntToDecimalStringN(gStringVar1, ewram_1f000.size, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
if (!ewram_1f000.isPlayerRoom)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gSecretBaseText_NoMoreDecor);
|
||||
} else
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gSecretBaseText_NoMoreDecor2);
|
||||
}
|
||||
DisplayItemMessageOnField(taskId, gStringVar4, sub_80FEFF4, 0);
|
||||
}
|
||||
} else
|
||||
{
|
||||
sub_80FEF74();
|
||||
sub_80FED1C();
|
||||
DisplayItemMessageOnField(taskId, gSecretBaseText_InUseAlready, sub_80FEFF4, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user