mirror of
https://github.com/pret/pokeruby.git
synced 2026-08-08 02:24:08 -05:00
Decompile money
This commit is contained in:
parent
4967d2b5d6
commit
2b99f7bcec
480
asm/money.s
480
asm/money.s
|
|
@ -1,480 +0,0 @@
|
|||
.include "constants/gba_constants.inc"
|
||||
.include "constants/species_constants.inc"
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start IsEnoughMoney
|
||||
IsEnoughMoney: @ 80B79A8
|
||||
push {lr}
|
||||
cmp r0, r1
|
||||
bcs _080B79B2
|
||||
movs r0, 0
|
||||
b _080B79B4
|
||||
_080B79B2:
|
||||
movs r0, 0x1
|
||||
_080B79B4:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end IsEnoughMoney
|
||||
|
||||
thumb_func_start sub_80B79B8
|
||||
sub_80B79B8: @ 80B79B8
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, [r2]
|
||||
adds r1, r0, r1
|
||||
cmp r0, r1
|
||||
bls _080B79CC
|
||||
ldr r0, _080B79C8 @ =0x000f423f
|
||||
b _080B79D4
|
||||
.align 2, 0
|
||||
_080B79C8: .4byte 0x000f423f
|
||||
_080B79CC:
|
||||
str r1, [r2]
|
||||
ldr r0, _080B79DC @ =0x000f423f
|
||||
cmp r1, r0
|
||||
bls _080B79D6
|
||||
_080B79D4:
|
||||
str r0, [r2]
|
||||
_080B79D6:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B79DC: .4byte 0x000f423f
|
||||
thumb_func_end sub_80B79B8
|
||||
|
||||
thumb_func_start sub_80B79E0
|
||||
sub_80B79E0: @ 80B79E0
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, [r2]
|
||||
cmp r0, r1
|
||||
bcs _080B79EE
|
||||
movs r0, 0
|
||||
b _080B79F0
|
||||
_080B79EE:
|
||||
subs r0, r1
|
||||
_080B79F0:
|
||||
str r0, [r2]
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80B79E0
|
||||
|
||||
thumb_func_start sub_80B79F8
|
||||
sub_80B79F8: @ 80B79F8
|
||||
push {r4,lr}
|
||||
adds r3, r0, 0
|
||||
lsls r2, 24
|
||||
lsrs r4, r2, 24
|
||||
ldr r0, _080B7A0C @ =0x000f423f
|
||||
cmp r1, r0
|
||||
bls _080B7A10
|
||||
movs r2, 0x7
|
||||
b _080B7A46
|
||||
.align 2, 0
|
||||
_080B7A0C: .4byte 0x000f423f
|
||||
_080B7A10:
|
||||
ldr r0, _080B7A1C @ =0x0001869f
|
||||
cmp r1, r0
|
||||
bls _080B7A20
|
||||
movs r2, 0x6
|
||||
b _080B7A46
|
||||
.align 2, 0
|
||||
_080B7A1C: .4byte 0x0001869f
|
||||
_080B7A20:
|
||||
ldr r0, _080B7A2C @ =0x00002710
|
||||
cmp r1, r0
|
||||
bls _080B7A30
|
||||
movs r2, 0x5
|
||||
b _080B7A46
|
||||
.align 2, 0
|
||||
_080B7A2C: .4byte 0x00002710
|
||||
_080B7A30:
|
||||
ldr r0, _080B7A90 @ =0x000003e7
|
||||
movs r2, 0x4
|
||||
cmp r1, r0
|
||||
bhi _080B7A46
|
||||
movs r2, 0x3
|
||||
cmp r1, 0x63
|
||||
bhi _080B7A46
|
||||
movs r2, 0x1
|
||||
cmp r1, 0x9
|
||||
bls _080B7A46
|
||||
movs r2, 0x2
|
||||
_080B7A46:
|
||||
movs r0, 0xFC
|
||||
strb r0, [r3]
|
||||
movs r0, 0x14
|
||||
strb r0, [r3, 0x1]
|
||||
movs r0, 0x6
|
||||
strb r0, [r3, 0x2]
|
||||
adds r3, 0x3
|
||||
movs r0, 0
|
||||
subs r2, r4, r2
|
||||
cmp r0, r2
|
||||
bge _080B7A6C
|
||||
movs r4, 0
|
||||
_080B7A5E:
|
||||
strb r4, [r3]
|
||||
adds r3, 0x1
|
||||
adds r0, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r2
|
||||
blt _080B7A5E
|
||||
_080B7A6C:
|
||||
movs r0, 0xB7
|
||||
strb r0, [r3]
|
||||
adds r3, 0x1
|
||||
adds r0, r3, 0
|
||||
bl ConvertIntToDecimalString
|
||||
adds r3, r0, 0
|
||||
movs r0, 0xFC
|
||||
strb r0, [r3]
|
||||
movs r0, 0x14
|
||||
strb r0, [r3, 0x1]
|
||||
movs r0, 0
|
||||
strb r0, [r3, 0x2]
|
||||
movs r0, 0xFF
|
||||
strb r0, [r3, 0x3]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B7A90: .4byte 0x000003e7
|
||||
thumb_func_end sub_80B79F8
|
||||
|
||||
thumb_func_start sub_80B7A94
|
||||
sub_80B7A94: @ 80B7A94
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x10
|
||||
adds r4, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r5, r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r6, r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r7, r3, 24
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_80B79F8
|
||||
mov r0, sp
|
||||
bl sub_8072CA4
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 3
|
||||
cmp r2, r0
|
||||
blt _080B7ACE
|
||||
mov r0, sp
|
||||
adds r1, r6, 0
|
||||
adds r2, r7, 0
|
||||
bl MenuPrint
|
||||
b _080B7AE4
|
||||
_080B7ACE:
|
||||
adds r1, r6, 0x1
|
||||
adds r1, r5
|
||||
lsls r1, 3
|
||||
subs r1, r2
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r2, r7, 3
|
||||
mov r0, sp
|
||||
movs r3, 0x1
|
||||
bl MenuPrint_PixelCoords
|
||||
_080B7AE4:
|
||||
add sp, 0x10
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80B7A94
|
||||
|
||||
thumb_func_start sub_80B7AEC
|
||||
sub_80B7AEC: @ 80B7AEC
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x20
|
||||
adds r3, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
mov r6, sp
|
||||
movs r0, 0xB7
|
||||
strb r0, [r6]
|
||||
adds r6, 0x1
|
||||
adds r0, r6, 0
|
||||
adds r1, r3, 0
|
||||
bl ConvertIntToDecimalString
|
||||
adds r6, r0, 0
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl MenuPrint_RightAligned
|
||||
movs r0, 0xFC
|
||||
strb r0, [r6]
|
||||
movs r0, 0x14
|
||||
strb r0, [r6, 0x1]
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x2]
|
||||
movs r0, 0xFF
|
||||
strb r0, [r6, 0x3]
|
||||
add sp, 0x20
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80B7AEC
|
||||
|
||||
thumb_func_start sub_80B7B34
|
||||
sub_80B7B34: @ 80B7B34
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0x4
|
||||
mov r8, r0
|
||||
adds r5, r1, 0
|
||||
mov r9, r2
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
mov r1, r9
|
||||
lsls r1, 8
|
||||
mov r9, r1
|
||||
ldr r4, _080B7BD8 @ =gDecoration10000_Gfx
|
||||
adds r0, r1, r4
|
||||
lsls r6, r5, 4
|
||||
subs r6, r5
|
||||
lsls r1, r6, 6
|
||||
mov r3, r8
|
||||
adds r3, 0x1
|
||||
lsls r3, 5
|
||||
ldr r2, _080B7BDC @ =0x06008000
|
||||
adds r3, r2
|
||||
adds r1, r3
|
||||
movs r2, 0x20
|
||||
str r3, [sp]
|
||||
bl CpuFastSet
|
||||
adds r4, 0x80
|
||||
add r9, r4
|
||||
adds r0, r5, 0x1
|
||||
lsls r4, r0, 4
|
||||
subs r4, r0
|
||||
lsls r1, r4, 6
|
||||
ldr r3, [sp]
|
||||
adds r1, r3
|
||||
mov r0, r9
|
||||
movs r2, 0x20
|
||||
bl CpuFastSet
|
||||
movs r3, 0
|
||||
lsls r5, 5
|
||||
mov r0, r8
|
||||
adds r7, r5, r0
|
||||
lsls r6, 1
|
||||
adds r6, 0x1
|
||||
add r6, r8
|
||||
ldr r1, _080B7BE0 @ =0xfffff000
|
||||
adds r5, r1, 0
|
||||
ldr r0, _080B7BE4 @ =0x0600f800
|
||||
mov r12, r0
|
||||
ldr r1, _080B7BE8 @ =0x0600f840
|
||||
mov r9, r1
|
||||
lsls r4, 1
|
||||
adds r4, 0x1
|
||||
add r4, r8
|
||||
_080B7BAA:
|
||||
adds r1, r7, r3
|
||||
lsls r1, 1
|
||||
mov r0, r12
|
||||
adds r2, r1, r0
|
||||
adds r0, r3, r6
|
||||
adds r0, r5
|
||||
strh r0, [r2]
|
||||
add r1, r9
|
||||
adds r0, r3, r4
|
||||
adds r0, r5
|
||||
strh r0, [r1]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
cmp r3, 0x3
|
||||
bls _080B7BAA
|
||||
add sp, 0x4
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B7BD8: .4byte gDecoration10000_Gfx
|
||||
_080B7BDC: .4byte 0x06008000
|
||||
_080B7BE0: .4byte 0xfffff000
|
||||
_080B7BE4: .4byte 0x0600f800
|
||||
_080B7BE8: .4byte 0x0600f840
|
||||
thumb_func_end sub_80B7B34
|
||||
|
||||
thumb_func_start sub_80B7BEC
|
||||
sub_80B7BEC: @ 80B7BEC
|
||||
push {r4,lr}
|
||||
adds r4, r1, 0
|
||||
adds r3, r2, 0
|
||||
lsls r4, 24
|
||||
lsls r3, 24
|
||||
movs r1, 0xC0
|
||||
lsls r1, 19
|
||||
adds r4, r1
|
||||
lsrs r4, 24
|
||||
movs r1, 0x80
|
||||
lsls r1, 17
|
||||
adds r3, r1
|
||||
lsrs r3, 24
|
||||
movs r1, 0x6
|
||||
adds r2, r4, 0
|
||||
bl sub_80B7A94
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80B7BEC
|
||||
|
||||
thumb_func_start sub_80B7C14
|
||||
sub_80B7C14: @ 80B7C14
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
mov r8, r0
|
||||
adds r4, r1, 0
|
||||
adds r3, r2, 0
|
||||
lsls r4, 24
|
||||
lsls r3, 24
|
||||
lsrs r6, r4, 24
|
||||
movs r0, 0xD0
|
||||
lsls r0, 20
|
||||
adds r4, r0
|
||||
lsrs r4, 24
|
||||
lsrs r5, r3, 24
|
||||
movs r1, 0xC0
|
||||
lsls r1, 18
|
||||
adds r3, r1
|
||||
lsrs r3, 24
|
||||
adds r0, r6, 0
|
||||
adds r1, r5, 0
|
||||
adds r2, r4, 0
|
||||
bl MenuDrawTextWindow
|
||||
mov r0, r8
|
||||
adds r1, r6, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_80B7BEC
|
||||
ldr r0, _080B7C88 @ =gUnknown_083CF584
|
||||
bl LoadCompressedObjectPic
|
||||
ldr r0, _080B7C8C @ =gUnknown_083CF58C
|
||||
bl LoadCompressedObjectPalette
|
||||
ldr r0, _080B7C90 @ =gSpriteTemplate_83CF56C
|
||||
lsls r6, 19
|
||||
movs r1, 0x98
|
||||
lsls r1, 13
|
||||
adds r6, r1
|
||||
asrs r6, 16
|
||||
lsls r5, 19
|
||||
movs r1, 0xB0
|
||||
lsls r1, 12
|
||||
adds r5, r1
|
||||
asrs r5, 16
|
||||
adds r1, r6, 0
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
ldr r1, _080B7C94 @ =gUnknown_02038734
|
||||
strb r0, [r1]
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B7C88: .4byte gUnknown_083CF584
|
||||
_080B7C8C: .4byte gUnknown_083CF58C
|
||||
_080B7C90: .4byte gSpriteTemplate_83CF56C
|
||||
_080B7C94: .4byte gUnknown_02038734
|
||||
thumb_func_end sub_80B7C14
|
||||
|
||||
thumb_func_start RemoveMoneyLabelObject
|
||||
RemoveMoneyLabelObject: @ 80B7C98
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r0, _080B7CDC @ =gUnknown_02038734
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, _080B7CE0 @ =gSprites
|
||||
adds r0, r1
|
||||
bl DestroySpriteAndFreeResources
|
||||
ldr r0, _080B7CE4 @ =0x00002722
|
||||
bl FreeSpritePaletteByTag
|
||||
adds r2, r4, 0
|
||||
adds r2, 0xD
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
adds r3, r5, 0x3
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl MenuZeroFillWindowRect
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B7CDC: .4byte gUnknown_02038734
|
||||
_080B7CE0: .4byte gSprites
|
||||
_080B7CE4: .4byte 0x00002722
|
||||
thumb_func_end RemoveMoneyLabelObject
|
||||
|
||||
thumb_func_start sub_80B7CE8
|
||||
sub_80B7CE8: @ 80B7CE8
|
||||
push {lr}
|
||||
ldr r0, _080B7D04 @ =gSaveBlock1
|
||||
movs r1, 0x92
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
ldr r1, _080B7D08 @ =gSpecialVar_0x8005
|
||||
ldrh r1, [r1]
|
||||
bl IsEnoughMoney
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_080B7D04: .4byte gSaveBlock1
|
||||
_080B7D08: .4byte gSpecialVar_0x8005
|
||||
thumb_func_end sub_80B7CE8
|
||||
|
||||
thumb_func_start sub_80B7D0C
|
||||
sub_80B7D0C: @ 80B7D0C
|
||||
push {lr}
|
||||
ldr r0, _080B7D1C @ =gSaveBlock1 + 0x490
|
||||
ldr r1, _080B7D20 @ =gSpecialVar_0x8005
|
||||
ldrh r1, [r1]
|
||||
bl sub_80B79E0
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080B7D1C: .4byte gSaveBlock1 + 0x490
|
||||
_080B7D20: .4byte gSpecialVar_0x8005
|
||||
thumb_func_end sub_80B7D0C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
|
|
@ -297,15 +297,6 @@ void *picbox_close(void);
|
|||
// asm/naming_screen.o
|
||||
void DoNamingScreen(u8 r0, struct SaveBlock2 *r1, u16 r2, u16 r3, u8 s0, MainCallback s4);
|
||||
|
||||
// asm/money.o
|
||||
bool8 IsEnoughMoney(u32, u32);
|
||||
void sub_80B79B8(u32 *, u32);
|
||||
void sub_80B79E0(u32 *, u32);
|
||||
void sub_80B7AEC(u32, u8 left, u8 top);
|
||||
void sub_80B7BEC(u32, u8, u8);
|
||||
void sub_80B7C14(u32, u8, u8);
|
||||
void RemoveMoneyLabelObject(u8, u8);
|
||||
|
||||
// asm/secret_base.o
|
||||
void sub_80BB5B4(void);
|
||||
u8 sub_80BBB24(void);
|
||||
|
|
|
|||
17
include/money.h
Normal file
17
include/money.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef GUARD_MONEY_H
|
||||
#define GUARD_MONEY_H
|
||||
|
||||
bool8 IsEnoughMoney(u32, u32);
|
||||
void sub_80B79B8(u32 *, u32);
|
||||
void sub_80B79E0(u32 *, u32);
|
||||
void sub_80B79F8(u8 *buffer, u32 arg1, u8 arg2);
|
||||
void sub_80B7A94(u32 arg0, u8 arg1, u8 x, u8 y);
|
||||
void sub_80B7AEC(u32, u8 left, u8 top);
|
||||
void sub_80B7B34(void);
|
||||
void sub_80B7BEC(u32, u8, u8);
|
||||
void sub_80B7C14(u32, u8, u8);
|
||||
void RemoveMoneyLabelObject(u8, u8);
|
||||
bool8 sub_80B7CE8(void);
|
||||
void sub_80B7D0C(void);
|
||||
|
||||
#endif // GUARD_MONEY_H
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
#define CHAR_SPACE 0x00
|
||||
#define CHAR_QUESTION_MARK 0xAC
|
||||
#define CHAR_HYPHEN 0xAE
|
||||
#define CHAR_CURRENCY 0xB7
|
||||
#define CHAR_COLON 0xF0
|
||||
#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code
|
||||
#define PLACEHOLDER_BEGIN 0xFD // string placeholder
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ SECTIONS {
|
|||
src/berry.o(.text);
|
||||
asm/script_menu.o(.text);
|
||||
asm/naming_screen.o(.text);
|
||||
asm/money.o(.text);
|
||||
src/money.o(.text);
|
||||
asm/contest_effect.o(.text);
|
||||
src/record_mixing.o(.text);
|
||||
asm/record_mixing.o(.text);
|
||||
|
|
|
|||
291
src/money.c
Normal file
291
src/money.c
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
#include "global.h"
|
||||
#include "money.h"
|
||||
#include "decompress.h"
|
||||
#include "menu.h"
|
||||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
|
||||
#define SPRITE_TAG_MONEY (0x2722)
|
||||
|
||||
extern u16 gSpecialVar_0x8005;
|
||||
extern u8 gUnknown_02038734;
|
||||
|
||||
extern const struct SpriteSheet gUnknown_083CF584;
|
||||
extern const struct SpritePalette gUnknown_083CF58C;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_83CF56C;
|
||||
|
||||
bool8 IsEnoughMoney(u32 budget, u32 cost) {
|
||||
if (budget >= cost) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80B79B8(u32 *arg0, u32 arg1) {
|
||||
if (*arg0 > *arg0 + arg1) {
|
||||
*arg0 = 999999;
|
||||
return;
|
||||
}
|
||||
|
||||
*arg0 = *arg0 + arg1;
|
||||
if (*arg0 > 999999) {
|
||||
*arg0 = 999999;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80B79E0(u32 *arg0, u32 arg1) {
|
||||
if (*arg0 < arg1) {
|
||||
*arg0 = 0;
|
||||
} else {
|
||||
*arg0 = *arg0 - arg1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80B79F8(u8 *buffer, u32 arg1, u8 arg2) {
|
||||
u8 width;
|
||||
u8 i;
|
||||
|
||||
if (arg1 > 999999) {
|
||||
width = 7;
|
||||
} else if (arg1 > 99999) {
|
||||
width = 6;
|
||||
} else if (arg1 > 10000) {
|
||||
width = 5;
|
||||
} else if (arg1 > 999) {
|
||||
width = 4;
|
||||
} else if (arg1 > 99) {
|
||||
width = 3;
|
||||
} else if (arg1 > 9) {
|
||||
width = 2;
|
||||
} else {
|
||||
width = 1;
|
||||
}
|
||||
|
||||
buffer[0] = EXT_CTRL_CODE_BEGIN;
|
||||
buffer[1] = 0x14;
|
||||
buffer[2] = 0x06;
|
||||
buffer += 3;
|
||||
|
||||
for (i = 0; i < arg2 - width; i++) {
|
||||
buffer[0] = CHAR_SPACE;
|
||||
buffer += 1;
|
||||
}
|
||||
|
||||
buffer[0] = CHAR_CURRENCY;
|
||||
buffer += 1;
|
||||
|
||||
buffer = ConvertIntToDecimalString(buffer, arg1);
|
||||
|
||||
buffer[0] = EXT_CTRL_CODE_BEGIN;
|
||||
buffer[1] = 0x14;
|
||||
buffer[2] = 0x00;
|
||||
buffer[3] = EOS;
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_80B7A94(u32 arg0, u8 size, u8 x, u8 y) {
|
||||
u8 buffer[16];
|
||||
u8 stringWidth;
|
||||
|
||||
sub_80B79F8(buffer, arg0, size);
|
||||
stringWidth = sub_8072CA4(buffer);
|
||||
|
||||
if (stringWidth >= (size + 1) * 8) {
|
||||
MenuPrint(buffer, x, y);
|
||||
} else {
|
||||
u8 pixelX = (size + 1) * 8 - stringWidth;
|
||||
MenuPrint_PixelCoords(buffer, pixelX, y * 8, 1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
__attribute__((naked))
|
||||
void sub_80B7A94(u32 arg0, u8 arg1, u8 x, u8 y) {
|
||||
asm(".syntax unified\n\
|
||||
push {r4-r7,lr}\n\
|
||||
sub sp, 0x10\n\
|
||||
adds r4, r0, 0\n\
|
||||
lsls r1, 24\n\
|
||||
lsrs r5, r1, 24\n\
|
||||
lsls r2, 24\n\
|
||||
lsrs r6, r2, 24\n\
|
||||
lsls r3, 24\n\
|
||||
lsrs r7, r3, 24\n\
|
||||
mov r0, sp\n\
|
||||
adds r1, r4, 0\n\
|
||||
adds r2, r5, 0\n\
|
||||
bl sub_80B79F8\n\
|
||||
mov r0, sp\n\
|
||||
bl sub_8072CA4\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r2, r0, 24\n\
|
||||
adds r0, r5, 0x1\n\
|
||||
lsls r0, 3\n\
|
||||
cmp r2, r0\n\
|
||||
blt _080B7ACE\n\
|
||||
mov r0, sp\n\
|
||||
adds r1, r6, 0\n\
|
||||
adds r2, r7, 0\n\
|
||||
bl MenuPrint\n\
|
||||
b _080B7AE4\n\
|
||||
_080B7ACE:\n\
|
||||
adds r1, r6, 0x1\n\
|
||||
adds r1, r5\n\
|
||||
lsls r1, 3\n\
|
||||
subs r1, r2\n\
|
||||
lsls r1, 24\n\
|
||||
lsrs r1, 24\n\
|
||||
lsls r2, r7, 3\n\
|
||||
mov r0, sp\n\
|
||||
movs r3, 0x1\n\
|
||||
bl MenuPrint_PixelCoords\n\
|
||||
_080B7AE4:\n\
|
||||
add sp, 0x10\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.syntax divided\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void sub_80B7AEC(u32 arg0, u8 left, u8 top) {
|
||||
u8 buffer[32];
|
||||
u8 *ptr;
|
||||
|
||||
ptr = &buffer[0];
|
||||
|
||||
ptr[0] = CHAR_CURRENCY;
|
||||
ptr++;
|
||||
|
||||
ptr = ConvertIntToDecimalString(ptr, arg0);
|
||||
|
||||
MenuPrint_RightAligned(buffer, left, top);
|
||||
|
||||
ptr[0] = 0xFC;
|
||||
ptr[1] = 0x14;
|
||||
ptr[2] = 0x00;
|
||||
ptr[3] = 0xFF;
|
||||
}
|
||||
|
||||
__attribute__((naked))
|
||||
void sub_80B7B34(void) {
|
||||
asm(".syntax unified\n\
|
||||
push {r4-r7,lr}\n\
|
||||
mov r7, r9\n\
|
||||
mov r6, r8\n\
|
||||
push {r6,r7}\n\
|
||||
sub sp, 0x4\n\
|
||||
mov r8, r0\n\
|
||||
adds r5, r1, 0\n\
|
||||
mov r9, r2\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
mov r8, r0\n\
|
||||
lsls r5, 24\n\
|
||||
lsrs r5, 24\n\
|
||||
mov r1, r9\n\
|
||||
lsls r1, 8\n\
|
||||
mov r9, r1\n\
|
||||
ldr r4, _080B7BD8 @ =gDecoration10000_Gfx\n\
|
||||
adds r0, r1, r4\n\
|
||||
lsls r6, r5, 4\n\
|
||||
subs r6, r5\n\
|
||||
lsls r1, r6, 6\n\
|
||||
mov r3, r8\n\
|
||||
adds r3, 0x1\n\
|
||||
lsls r3, 5\n\
|
||||
ldr r2, _080B7BDC @ =0x06008000\n\
|
||||
adds r3, r2\n\
|
||||
adds r1, r3\n\
|
||||
movs r2, 0x20\n\
|
||||
str r3, [sp]\n\
|
||||
bl CpuFastSet\n\
|
||||
adds r4, 0x80\n\
|
||||
add r9, r4\n\
|
||||
adds r0, r5, 0x1\n\
|
||||
lsls r4, r0, 4\n\
|
||||
subs r4, r0\n\
|
||||
lsls r1, r4, 6\n\
|
||||
ldr r3, [sp]\n\
|
||||
adds r1, r3\n\
|
||||
mov r0, r9\n\
|
||||
movs r2, 0x20\n\
|
||||
bl CpuFastSet\n\
|
||||
movs r3, 0\n\
|
||||
lsls r5, 5\n\
|
||||
mov r0, r8\n\
|
||||
adds r7, r5, r0\n\
|
||||
lsls r6, 1\n\
|
||||
adds r6, 0x1\n\
|
||||
add r6, r8\n\
|
||||
ldr r1, _080B7BE0 @ =0xfffff000\n\
|
||||
adds r5, r1, 0\n\
|
||||
ldr r0, _080B7BE4 @ =0x0600f800\n\
|
||||
mov r12, r0\n\
|
||||
ldr r1, _080B7BE8 @ =0x0600f840\n\
|
||||
mov r9, r1\n\
|
||||
lsls r4, 1\n\
|
||||
adds r4, 0x1\n\
|
||||
add r4, r8\n\
|
||||
_080B7BAA:\n\
|
||||
adds r1, r7, r3\n\
|
||||
lsls r1, 1\n\
|
||||
mov r0, r12\n\
|
||||
adds r2, r1, r0\n\
|
||||
adds r0, r3, r6\n\
|
||||
adds r0, r5\n\
|
||||
strh r0, [r2]\n\
|
||||
add r1, r9\n\
|
||||
adds r0, r3, r4\n\
|
||||
adds r0, r5\n\
|
||||
strh r0, [r1]\n\
|
||||
adds r0, r3, 0x1\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r3, r0, 16\n\
|
||||
cmp r3, 0x3\n\
|
||||
bls _080B7BAA\n\
|
||||
add sp, 0x4\n\
|
||||
pop {r3,r4}\n\
|
||||
mov r8, r3\n\
|
||||
mov r9, r4\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.align 2, 0\n\
|
||||
_080B7BD8: .4byte gDecoration10000_Gfx\n\
|
||||
_080B7BDC: .4byte 0x06008000\n\
|
||||
_080B7BE0: .4byte 0xfffff000\n\
|
||||
_080B7BE4: .4byte 0x0600f800\n\
|
||||
_080B7BE8: .4byte 0x0600f840\n\
|
||||
.syntax divided\n");
|
||||
}
|
||||
|
||||
void sub_80B7BEC(u32 arg0, u8 x, u8 y) {
|
||||
sub_80B7A94(arg0, 6, x + 6, y + 1);
|
||||
}
|
||||
|
||||
void sub_80B7C14(u32 arg0, u8 x, u8 y) {
|
||||
MenuDrawTextWindow(x, y, x + 13, y + 3);
|
||||
sub_80B7BEC(arg0, x, y);
|
||||
|
||||
LoadCompressedObjectPic(&gUnknown_083CF584);
|
||||
LoadCompressedObjectPalette(&gUnknown_083CF58C);
|
||||
|
||||
gUnknown_02038734 = CreateSprite(&gSpriteTemplate_83CF56C, x * 8 + 19, y * 8 + 11, 0);
|
||||
}
|
||||
|
||||
void RemoveMoneyLabelObject(u8 x, u8 y) {
|
||||
DestroySpriteAndFreeResources(&gSprites[gUnknown_02038734]);
|
||||
FreeSpritePaletteByTag(SPRITE_TAG_MONEY);
|
||||
MenuZeroFillWindowRect(x, y, x + 13, y + 3);
|
||||
}
|
||||
|
||||
bool8 sub_80B7CE8(void) {
|
||||
return IsEnoughMoney(gSaveBlock1.money, gSpecialVar_0x8005);
|
||||
}
|
||||
|
||||
void sub_80B7D0C(void) {
|
||||
sub_80B79E0(&gSaveBlock1.money, gSpecialVar_0x8005);
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
#include "asm_fieldmap.h"
|
||||
#include "main.h"
|
||||
#include "menu.h"
|
||||
#include "money.h"
|
||||
#include "decoration.h"
|
||||
#include "field_message_box.h"
|
||||
#include "sound.h"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "menu.h"
|
||||
#include "money.h"
|
||||
#include "palette.h"
|
||||
#include "pokedex.h"
|
||||
#include "rom4.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user