start cute sketch

This commit is contained in:
DizzyEggg 2017-08-14 12:54:01 +02:00
parent 3f0250648e
commit 067a71db77
4 changed files with 165 additions and 439 deletions

View File

@ -6,445 +6,6 @@
.text
thumb_func_start sub_80FC7A0
sub_80FC7A0: @ 80FC7A0
push {lr}
ldr r2, _080FC7E8 @ =gUnknown_03005DEC
ldr r1, [r0, 0x4]
str r1, [r2]
ldr r2, _080FC7EC @ =gUnknown_03005E00
ldrb r1, [r0, 0x1F]
strb r1, [r2]
ldr r2, _080FC7F0 @ =gUnknown_03005DE8
ldrb r1, [r0, 0x19]
strb r1, [r2]
ldr r2, _080FC7F4 @ =gUnknown_03005DFC
ldrb r1, [r0, 0x1A]
strb r1, [r2]
ldr r2, _080FC7F8 @ =gUnknown_03005DF8
ldrb r1, [r0, 0x1B]
strb r1, [r2]
ldr r2, _080FC7FC @ =gUnknown_03005DF0
ldrb r1, [r0, 0x1C]
strb r1, [r2]
ldr r2, _080FC800 @ =gUnknown_03005E04
ldrb r1, [r0, 0x1D]
strb r1, [r2]
ldr r2, _080FC804 @ =gUnknown_03005DF4
ldrb r1, [r0, 0x1E]
strb r1, [r2]
ldrb r0, [r0]
subs r0, 0x2
cmp r0, 0x22
bls _080FC7DC
b _080FC928
_080FC7DC:
lsls r0, 2
ldr r1, _080FC808 @ =_080FC80C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_080FC7E8: .4byte gUnknown_03005DEC
_080FC7EC: .4byte gUnknown_03005E00
_080FC7F0: .4byte gUnknown_03005DE8
_080FC7F4: .4byte gUnknown_03005DFC
_080FC7F8: .4byte gUnknown_03005DF8
_080FC7FC: .4byte gUnknown_03005DF0
_080FC800: .4byte gUnknown_03005E04
_080FC804: .4byte gUnknown_03005DF4
_080FC808: .4byte _080FC80C
.align 2, 0
_080FC80C:
.4byte _080FC898
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC8F8
.4byte _080FC928
.4byte _080FC89E
.4byte _080FC8A4
.4byte _080FC8B8
.4byte _080FC8CA
.4byte _080FC928
.4byte _080FC8E0
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC928
.4byte _080FC8E6
.4byte _080FC8C4
.4byte _080FC8EC
.4byte _080FC8F2
.4byte _080FC928
.4byte _080FC928
.4byte _080FC904
_080FC898:
bl sub_80FCAA4
b _080FC928
_080FC89E:
bl sub_80FCB5C
b _080FC928
_080FC8A4:
bl sub_80FCD54
ldr r0, _080FC8B4 @ =gUnknown_03005E00
ldrb r0, [r0]
bl sub_80FCC18
b _080FC928
.align 2, 0
_080FC8B4: .4byte gUnknown_03005E00
_080FC8B8:
bl sub_80FCD54
bl sub_80FCEA4
bl sub_80FCCBC
_080FC8C4:
bl sub_80FCEA4
b _080FC928
_080FC8CA:
bl sub_80FCD54
bl sub_80FD06C
bl sub_80FD06C
bl sub_80FD114
bl sub_80FCCBC
b _080FC928
_080FC8E0:
bl sub_80FCF3C
b _080FC928
_080FC8E6:
bl sub_80FCD54
b _080FC928
_080FC8EC:
bl sub_80FD06C
b _080FC928
_080FC8F2:
bl sub_80FD114
b _080FC928
_080FC8F8:
bl sub_80FCAC4
movs r0, 0x3
bl sub_80FC92C
b _080FC928
_080FC904:
bl sub_80FCD54
bl sub_80FD06C
bl sub_80FD114
bl sub_80FCCBC
bl sub_80FCB5C
bl sub_80FCB5C
movs r0, 0x2
bl sub_80FC92C
movs r0, 0x4
bl sub_80FC9E4
_080FC928:
pop {r0}
bx r0
thumb_func_end sub_80FC7A0
thumb_func_start sub_80FC92C
sub_80FC92C: @ 80FC92C
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 24
lsrs r7, r0, 24
movs r2, 0
ldr r0, _080FC9CC @ =gUnknown_03005DF0
mov r8, r0
ldrb r0, [r0]
cmp r2, r0
bcs _080FC9BE
ldr r1, _080FC9D0 @ =gUnknown_03005DF8
mov r12, r1
ldr r3, _080FC9D4 @ =gUnknown_03005E04
mov r10, r3
ldr r0, _080FC9D8 @ =gUnknown_03005DE8
mov r9, r0
_080FC952:
ldr r1, _080FC9DC @ =gUnknown_03005DFC
ldrb r0, [r1]
adds r0, r2
mov r3, r10
ldrb r1, [r3]
muls r0, r1
lsls r0, 1
ldr r3, _080FC9E0 @ =gUnknown_03005DEC
ldr r1, [r3]
adds r1, r0
mov r3, r9
ldrb r0, [r3]
lsls r0, 1
adds r3, r1, r0
movs r4, 0
adds r5, r2, 0x1
mov r0, r12
ldrb r0, [r0]
cmp r4, r0
bcs _080FC9B2
movs r6, 0x80
lsls r6, 8
_080FC97E:
ldrh r1, [r3]
adds r0, r6, 0
ands r0, r1
cmp r0, 0
bne _080FC9A2
movs r0, 0x1F
ands r0, r1
adds r0, r7
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x1F
bls _080FC998
movs r2, 0x1F
_080FC998:
lsls r0, r2, 10
lsls r1, r2, 5
orrs r0, r1
orrs r0, r2
strh r0, [r3]
_080FC9A2:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
adds r3, 0x2
mov r1, r12
ldrb r1, [r1]
cmp r4, r1
bcc _080FC97E
_080FC9B2:
lsls r0, r5, 24
lsrs r2, r0, 24
mov r3, r8
ldrb r3, [r3]
cmp r2, r3
bcc _080FC952
_080FC9BE:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080FC9CC: .4byte gUnknown_03005DF0
_080FC9D0: .4byte gUnknown_03005DF8
_080FC9D4: .4byte gUnknown_03005E04
_080FC9D8: .4byte gUnknown_03005DE8
_080FC9DC: .4byte gUnknown_03005DFC
_080FC9E0: .4byte gUnknown_03005DEC
thumb_func_end sub_80FC92C
thumb_func_start sub_80FC9E4
sub_80FC9E4: @ 80FC9E4
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 24
lsrs r0, 24
mov r8, r0
movs r2, 0
ldr r0, _080FCA8C @ =gUnknown_03005DF0
ldrb r0, [r0]
cmp r2, r0
bcs _080FCA7C
ldr r1, _080FCA90 @ =gUnknown_03005DF8
mov r10, r1
_080FCA02:
ldr r3, _080FCA94 @ =gUnknown_03005DFC
ldrb r0, [r3]
adds r0, r2
ldr r3, _080FCA98 @ =gUnknown_03005E04
ldrb r1, [r3]
muls r0, r1
lsls r0, 1
ldr r3, _080FCA9C @ =gUnknown_03005DEC
ldr r1, [r3]
adds r1, r0
ldr r3, _080FCAA0 @ =gUnknown_03005DE8
ldrb r0, [r3]
lsls r0, 1
adds r3, r1, r0
movs r5, 0
adds r7, r2, 0x1
mov r0, r10
ldrb r0, [r0]
cmp r5, r0
bcs _080FCA70
movs r1, 0x80
lsls r1, 8
mov r9, r1
movs r0, 0x1F
mov r12, r0
mov r1, r8
subs r6, r0, r1
_080FCA38:
ldrh r1, [r3]
mov r0, r9
ands r0, r1
cmp r0, 0
bne _080FCA60
movs r4, 0x1F
mov r2, r12
ands r2, r1
cmp r2, r6
ble _080FCA56
mov r1, r8
lsrs r0, r1, 1
subs r0, r4, r0
lsls r0, 24
lsrs r2, r0, 24
_080FCA56:
lsls r0, r2, 10
lsls r1, r2, 5
orrs r0, r1
orrs r0, r2
strh r0, [r3]
_080FCA60:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
adds r3, 0x2
mov r0, r10
ldrb r0, [r0]
cmp r5, r0
bcc _080FCA38
_080FCA70:
lsls r0, r7, 24
lsrs r2, r0, 24
ldr r1, _080FCA8C @ =gUnknown_03005DF0
ldrb r1, [r1]
cmp r2, r1
bcc _080FCA02
_080FCA7C:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080FCA8C: .4byte gUnknown_03005DF0
_080FCA90: .4byte gUnknown_03005DF8
_080FCA94: .4byte gUnknown_03005DFC
_080FCA98: .4byte gUnknown_03005E04
_080FCA9C: .4byte gUnknown_03005DEC
_080FCAA0: .4byte gUnknown_03005DE8
thumb_func_end sub_80FC9E4
thumb_func_start sub_80FCAA4
sub_80FCAA4: @ 80FCAA4
push {r4,r5,lr}
movs r4, 0
ldr r5, _080FCAC0 @ =0x00000c7f
_080FCAAA:
lsls r0, r4, 16
lsrs r0, 16
bl sub_80FD1C8
adds r4, 0x1
cmp r4, r5
bls _080FCAAA
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_080FCAC0: .4byte 0x00000c7f
thumb_func_end sub_80FCAA4
thumb_func_start sub_80FCAC4
sub_80FCAC4: @ 80FCAC4
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x4
movs r2, 0
ldr r0, _080FCB44 @ =gUnknown_03005DF0
ldrb r0, [r0]
cmp r2, r0
bcs _080FCB36
ldr r0, _080FCB48 @ =gUnknown_03005DEC
mov r8, r0
ldr r3, _080FCB4C @ =gUnknown_03005DF8
_080FCADC:
ldr r0, _080FCB50 @ =gUnknown_03005DFC
ldrb r1, [r0]
adds r1, r2
ldr r0, _080FCB54 @ =gUnknown_03005E04
ldrb r0, [r0]
muls r0, r1
lsls r0, 1
mov r4, r8
ldr r1, [r4]
adds r1, r0
ldr r0, _080FCB58 @ =gUnknown_03005DE8
ldrb r0, [r0]
lsls r0, 1
adds r4, r1, r0
movs r5, 0
adds r6, r2, 0x1
ldrb r0, [r3]
cmp r5, r0
bcs _080FCB2A
movs r0, 0x80
lsls r0, 8
adds r7, r0, 0
_080FCB08:
ldrh r0, [r4]
ands r0, r7
cmp r0, 0
bne _080FCB1C
adds r0, r4, 0
str r3, [sp]
bl sub_80FD39C
strh r0, [r4]
ldr r3, [sp]
_080FCB1C:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
adds r4, 0x2
ldrb r0, [r3]
cmp r5, r0
bcc _080FCB08
_080FCB2A:
lsls r0, r6, 24
lsrs r2, r0, 24
ldr r0, _080FCB44 @ =gUnknown_03005DF0
ldrb r0, [r0]
cmp r2, r0
bcc _080FCADC
_080FCB36:
add sp, 0x4
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080FCB44: .4byte gUnknown_03005DF0
_080FCB48: .4byte gUnknown_03005DEC
_080FCB4C: .4byte gUnknown_03005DF8
_080FCB50: .4byte gUnknown_03005DFC
_080FCB54: .4byte gUnknown_03005E04
_080FCB58: .4byte gUnknown_03005DE8
thumb_func_end sub_80FCAC4
thumb_func_start sub_80FCB5C
sub_80FCB5C: @ 80FCB5C

View File

View File

@ -198,6 +198,7 @@ SECTIONS {
src/dewford_trend.o(.text);
src/heal_location.o(.text);
src/region_map.o(.text);
src/cute_sketch.o(.text);
asm/cute_sketch.o(.text);
src/decoration.o(.text);
asm/slot_machine.o(.text);

164
src/cute_sketch.c Normal file
View File

@ -0,0 +1,164 @@
#include "global.h"
#include "cute_sketch.h"
#include "contest_painting.h"
extern u16 (*gUnknown_03005DEC)[][32];
extern u8 gUnknown_03005E00;
extern u8 gUnknown_03005DFC;
extern u8 gUnknown_03005DF8;
extern u8 gUnknown_03005DF0;
extern u8 gUnknown_03005E04;
extern u8 gUnknown_03005DF4;
extern u8 gUnknown_03005DE8;
// this file's functions
void sub_80FCAA4(void);
void sub_80FCB5C(void);
void sub_80FCD54(void);
void sub_80FCEA4(void);
void sub_80FCCBC(void);
void sub_80FD06C(void);
void sub_80FD114(void);
void sub_80FCF3C(void);
void sub_80FCAC4(void);
void sub_80FCC18(u8);
void sub_80FC92C(u8);
void sub_80FC9E4(u8);
void sub_80FD1C8(u16);
u16 sub_80FD39C(u16*);
u16 sub_80FD68C(u16*, u16*, u16*);
void sub_80FC7A0(struct Unk03005E20* info)
{
gUnknown_03005DEC = info->var_4;
gUnknown_03005E00 = info->var_1F;
gUnknown_03005DE8 = info->var_19;
gUnknown_03005DFC = info->var_1A;
gUnknown_03005DF8 = info->var_1B;
gUnknown_03005DF0 = info->var_1C;
gUnknown_03005E04 = info->var_1D;
gUnknown_03005DF4 = info->var_1E;
switch (info->var_0)
{
case 2:
sub_80FCAA4();
break;
case 8:
sub_80FCB5C();
break;
case 9:
sub_80FCD54();
sub_80FCC18(gUnknown_03005E00);
break;
case 10:
sub_80FCD54();
sub_80FCEA4();
sub_80FCCBC();
case 31:
sub_80FCEA4();
break;
case 11:
sub_80FCD54();
sub_80FD06C();
sub_80FD06C();
sub_80FD114();
sub_80FCCBC();
break;
case 13:
sub_80FCF3C();
break;
case 30:
sub_80FCD54();
break;
case 32:
sub_80FD06C();
break;
case 33:
sub_80FD114();
break;
case 6:
sub_80FCAC4();
sub_80FC92C(3);
break;
case 36:
sub_80FCD54();
sub_80FD06C();
sub_80FD114();
sub_80FCCBC();
sub_80FCB5C();
sub_80FCB5C();
sub_80FC92C(2);
sub_80FC9E4(4);
break;
}
}
#define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r))
void sub_80FC92C(u8 a0) // it changes palette someway somehow... .__.
{
u8 i, j;
for (i = 0; i < gUnknown_03005DF0; i++)
{
u16* var2 = &(*gUnknown_03005DEC)[0][(gUnknown_03005DFC + i) * gUnknown_03005E04];
u16* pal = &var2[gUnknown_03005DE8];
for (j = 0; j < gUnknown_03005DF8; j++, pal++)
{
if (!(0x8000 & *pal))
{
u8 val = (31 & *pal);
val += a0;
if (val > 31)
val = 31;
*pal = RGB2(val, val, val);
}
}
}
}
void sub_80FC9E4(u8 a0)
{
u8 i, j;
for (i = 0; i < gUnknown_03005DF0; i++)
{
u16* var2 = &(*gUnknown_03005DEC)[0][(gUnknown_03005DFC + i) * gUnknown_03005E04];
u16* pal = &var2[gUnknown_03005DE8];
for (j = 0; j < gUnknown_03005DF8; j++, pal++)
{
if (!(0x8000 & *pal))
{
u8 val = (31 & *pal);
if (val > 31 - a0)
val = 31 - (a0 >> 1);
*pal = RGB2(val, val, val);
}
}
}
}
void sub_80FCAA4(void)
{
u32 i;
for (i = 0; i < 3200; i++)
sub_80FD1C8(i);
}
void sub_80FCAC4(void)
{
u8 i, j;
for (i = 0; i < gUnknown_03005DF0; i++)
{
u16* var2 = &(*gUnknown_03005DEC)[0][(gUnknown_03005DFC + i) * gUnknown_03005E04];
u16* pal = &var2[gUnknown_03005DE8];
for (j = 0; j < gUnknown_03005DF8; j++, pal++)
{
if (!(0x8000 & *pal))
{
*pal = sub_80FD39C(pal);
}
}
}
}