Through ScrCmd_getbraillestringwidth
This commit is contained in:
-281
@@ -5,287 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start ScrCmd_yesnobox
|
||||
ScrCmd_yesnobox: @ 806BA80
|
||||
push {lr}
|
||||
ldr r2, [r0, 0x8]
|
||||
ldrb r3, [r2]
|
||||
adds r2, 0x1
|
||||
str r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
adds r2, 0x1
|
||||
str r2, [r0, 0x8]
|
||||
adds r0, r3, 0
|
||||
bl sub_809CDEC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0806BAA2
|
||||
movs r0, 0
|
||||
b _0806BAA8
|
||||
_0806BAA2:
|
||||
bl ScriptContext1_Stop
|
||||
movs r0, 0x1
|
||||
_0806BAA8:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_yesnobox
|
||||
|
||||
thumb_func_start ScrCmd_multichoice
|
||||
ScrCmd_multichoice: @ 806BAAC
|
||||
push {r4,r5,lr}
|
||||
ldr r2, [r0, 0x8]
|
||||
ldrb r5, [r2]
|
||||
adds r2, 0x1
|
||||
str r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
adds r3, r2, 0x1
|
||||
str r3, [r0, 0x8]
|
||||
ldrb r2, [r2, 0x1]
|
||||
adds r4, r3, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
ldrb r3, [r3, 0x1]
|
||||
adds r4, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
adds r0, r5, 0
|
||||
bl ScriptMenu_Multichoice
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0806BADA
|
||||
movs r0, 0
|
||||
b _0806BAE0
|
||||
_0806BADA:
|
||||
bl ScriptContext1_Stop
|
||||
movs r0, 0x1
|
||||
_0806BAE0:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_multichoice
|
||||
|
||||
thumb_func_start ScrCmd_multichoicedefault
|
||||
ScrCmd_multichoicedefault: @ 806BAE8
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x4
|
||||
ldr r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
mov r8, r1
|
||||
adds r2, 0x1
|
||||
str r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
adds r3, r2, 0x1
|
||||
str r3, [r0, 0x8]
|
||||
ldrb r2, [r2, 0x1]
|
||||
adds r5, r3, 0x1
|
||||
str r5, [r0, 0x8]
|
||||
ldrb r6, [r3, 0x1]
|
||||
adds r4, r5, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
ldrb r3, [r5, 0x1]
|
||||
adds r4, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
str r6, [sp]
|
||||
mov r0, r8
|
||||
bl ScriptMenu_MultichoiceWithDefault
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0806BB26
|
||||
movs r0, 0
|
||||
b _0806BB2C
|
||||
_0806BB26:
|
||||
bl ScriptContext1_Stop
|
||||
movs r0, 0x1
|
||||
_0806BB2C:
|
||||
add sp, 0x4
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_multichoicedefault
|
||||
|
||||
thumb_func_start ScrCmd_drawbox
|
||||
ScrCmd_drawbox: @ 806BB38
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end ScrCmd_drawbox
|
||||
|
||||
thumb_func_start ScrCmd_multichoicegrid
|
||||
ScrCmd_multichoicegrid: @ 806BB3C
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x4
|
||||
ldr r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
mov r8, r1
|
||||
adds r2, 0x1
|
||||
str r2, [r0, 0x8]
|
||||
ldrb r1, [r2]
|
||||
adds r3, r2, 0x1
|
||||
str r3, [r0, 0x8]
|
||||
ldrb r2, [r2, 0x1]
|
||||
adds r5, r3, 0x1
|
||||
str r5, [r0, 0x8]
|
||||
ldrb r6, [r3, 0x1]
|
||||
adds r4, r5, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
ldrb r3, [r5, 0x1]
|
||||
adds r4, 0x1
|
||||
str r4, [r0, 0x8]
|
||||
str r6, [sp]
|
||||
mov r0, r8
|
||||
bl sub_809CEC8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0806BB7A
|
||||
movs r0, 0
|
||||
b _0806BB80
|
||||
_0806BB7A:
|
||||
bl ScriptContext1_Stop
|
||||
movs r0, 0x1
|
||||
_0806BB80:
|
||||
add sp, 0x4
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_multichoicegrid
|
||||
|
||||
thumb_func_start ScrCmd_erasebox
|
||||
ScrCmd_erasebox: @ 806BB8C
|
||||
ldr r1, [r0, 0x8]
|
||||
adds r1, 0x4
|
||||
str r1, [r0, 0x8]
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end ScrCmd_erasebox
|
||||
|
||||
thumb_func_start ScrCmd_drawboxtext
|
||||
ScrCmd_drawboxtext: @ 806BB98
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end ScrCmd_drawboxtext
|
||||
|
||||
thumb_func_start ScrCmd_showmonpic
|
||||
ScrCmd_showmonpic: @ 806BB9C
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
bl ScriptReadHalfword
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl VarGet
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
ldr r0, [r5, 0x8]
|
||||
ldrb r1, [r0]
|
||||
adds r0, 0x1
|
||||
str r0, [r5, 0x8]
|
||||
ldrb r2, [r0]
|
||||
adds r0, 0x1
|
||||
str r0, [r5, 0x8]
|
||||
adds r0, r4, 0
|
||||
bl sub_809D2F0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl PlayCry7
|
||||
movs r0, 0
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_showmonpic
|
||||
|
||||
thumb_func_start ScrCmd_hidemonpic
|
||||
ScrCmd_hidemonpic: @ 806BBD8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_809D3CC
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0
|
||||
beq _0806BBF0
|
||||
adds r0, r4, 0
|
||||
bl SetupNativeScript
|
||||
movs r0, 0x1
|
||||
b _0806BBF2
|
||||
_0806BBF0:
|
||||
movs r0, 0
|
||||
_0806BBF2:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_hidemonpic
|
||||
|
||||
thumb_func_start ScrCmd_showcontestwinner
|
||||
ScrCmd_showcontestwinner: @ 806BBF8
|
||||
ldr r1, [r0, 0x8]
|
||||
adds r1, 0x1
|
||||
str r1, [r0, 0x8]
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end ScrCmd_showcontestwinner
|
||||
|
||||
thumb_func_start ScrCmd_braillemessage
|
||||
ScrCmd_braillemessage: @ 806BC04
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
adds r5, r0, 0
|
||||
bl ScriptReadWord
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne _0806BC16
|
||||
ldr r4, [r5, 0x64]
|
||||
_0806BC16:
|
||||
bl sub_80F6E9C
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl sub_80F6EE4
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
str r0, [sp, 0x8]
|
||||
movs r1, 0x6
|
||||
adds r2, r4, 0
|
||||
movs r3, 0
|
||||
bl AddTextPrinterParameterized
|
||||
movs r0, 0
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end ScrCmd_braillemessage
|
||||
|
||||
thumb_func_start ScrCmd_getstringwidth
|
||||
ScrCmd_getstringwidth: @ 806BC40
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl ScriptReadWord
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0
|
||||
bne _0806BC50
|
||||
ldr r1, [r4, 0x64]
|
||||
_0806BC50:
|
||||
ldr r4, _0806BC68 @ =gSpecialVar_0x8004
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
movs r0, 0x6
|
||||
bl GetStringWidth
|
||||
strh r0, [r4]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_0806BC68: .4byte gSpecialVar_0x8004
|
||||
thumb_func_end ScrCmd_getstringwidth
|
||||
|
||||
thumb_func_start ScrCmd_vmessage
|
||||
ScrCmd_vmessage: @ 806BC6C
|
||||
push {lr}
|
||||
|
||||
+12
-12
@@ -613,8 +613,8 @@ _0809CDE0:
|
||||
_0809CDE8: .4byte gUnknown_83E0748
|
||||
thumb_func_end sub_809CD48
|
||||
|
||||
thumb_func_start sub_809CDEC
|
||||
sub_809CDEC: @ 809CDEC
|
||||
thumb_func_start ScriptMenu_YesNo
|
||||
ScriptMenu_YesNo: @ 809CDEC
|
||||
push {r4,lr}
|
||||
ldr r4, _0809CE04 @ =task_yes_no_maybe
|
||||
adds r0, r4, 0
|
||||
@@ -649,7 +649,7 @@ _0809CE28:
|
||||
.align 2, 0
|
||||
_0809CE30: .4byte gSpecialVar_Result
|
||||
_0809CE34: .4byte sub_809D6D4
|
||||
thumb_func_end sub_809CDEC
|
||||
thumb_func_end ScriptMenu_YesNo
|
||||
|
||||
thumb_func_start sub_809CE38
|
||||
sub_809CE38: @ 809CE38
|
||||
@@ -733,8 +733,8 @@ _0809CEBC:
|
||||
_0809CEC4: .4byte gSpecialVar_Result
|
||||
thumb_func_end task_yes_no_maybe
|
||||
|
||||
thumb_func_start sub_809CEC8
|
||||
sub_809CEC8: @ 809CEC8
|
||||
thumb_func_start ScriptMenu_MultichoiceGrid
|
||||
ScriptMenu_MultichoiceGrid: @ 809CEC8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@@ -862,7 +862,7 @@ _0809CFCC: .4byte gSpecialVar_Result
|
||||
_0809CFD0: .4byte sub_809D6D4
|
||||
_0809CFD4: .4byte gUnknown_83E04B0
|
||||
_0809CFD8: .4byte gTasks
|
||||
thumb_func_end sub_809CEC8
|
||||
thumb_func_end ScriptMenu_MultichoiceGrid
|
||||
|
||||
thumb_func_start sub_809CFDC
|
||||
sub_809CFDC: @ 809CFDC
|
||||
@@ -1241,8 +1241,8 @@ _0809D2E8:
|
||||
bx r0
|
||||
thumb_func_end sub_809D288
|
||||
|
||||
thumb_func_start sub_809D2F0
|
||||
sub_809D2F0: @ 809D2F0
|
||||
thumb_func_start ScriptMenu_ShowPokemonPic
|
||||
ScriptMenu_ShowPokemonPic: @ 809D2F0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
@@ -1344,10 +1344,10 @@ _0809D3C2:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_809D2F0
|
||||
thumb_func_end ScriptMenu_ShowPokemonPic
|
||||
|
||||
thumb_func_start sub_809D3CC
|
||||
sub_809D3CC: @ 809D3CC
|
||||
thumb_func_start ScriptMenu_GetPicboxWaitFunc
|
||||
ScriptMenu_GetPicboxWaitFunc: @ 809D3CC
|
||||
push {lr}
|
||||
ldr r0, _0809D3F0 @ =sub_809D288
|
||||
bl FindTaskIdByFunc
|
||||
@@ -1374,7 +1374,7 @@ _0809D3FC:
|
||||
_0809D3FE:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_809D3CC
|
||||
thumb_func_end ScriptMenu_GetPicboxWaitFunc
|
||||
|
||||
thumb_func_start sub_809D404
|
||||
sub_809D404: @ 809D404
|
||||
|
||||
@@ -212,7 +212,7 @@ gScriptCmdTable:: @ 815F9B4
|
||||
.4byte ScrCmd_cmdD0
|
||||
.4byte ScrCmd_warpD1
|
||||
.4byte ScrCmd_setmonmetlocation
|
||||
.4byte ScrCmd_getstringwidth
|
||||
.4byte ScrCmd_getbraillestringwidth
|
||||
.4byte ScrCmd_cmdDA
|
||||
|
||||
gScriptCmdTableEnd:: @ 815FD08
|
||||
|
||||
@@ -31,6 +31,7 @@ void PlayCry3(u16 species, s8 pan, u8 mode);
|
||||
void PlayCry4(u16 species, s8 pan, u8 mode);
|
||||
void PlayCry5(u16 species, u8 mode);
|
||||
void PlayCry6(u16 species, s8 pan, u8 mode);
|
||||
void PlayCry7(u16 species, u8 mode);
|
||||
void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode);
|
||||
bool8 IsCryFinished(void);
|
||||
void StopCryAndClearCrySongs(void);
|
||||
|
||||
+168
@@ -23,6 +23,7 @@
|
||||
#include "new_menu_helpers.h"
|
||||
#include "window.h"
|
||||
#include "start_menu.h"
|
||||
#include "script_menu.h"
|
||||
|
||||
extern u16 (*const gSpecials[])(void);
|
||||
extern u16 (*const gSpecialsEnd[])(void);
|
||||
@@ -1407,3 +1408,170 @@ SCRCMD_DEF(waitbuttonpress)
|
||||
SetupNativeScript(ctx, WaitForAorBPress);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(yesnobox)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_YesNo(left, top) == TRUE)
|
||||
{
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
SCRCMD_DEF(multichoice)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
SCRCMD_DEF(multichoicedefault)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 defaultChoice = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE)
|
||||
{
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
SCRCMD_DEF(drawbox)
|
||||
{
|
||||
/*u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 right = ScriptReadByte(ctx);
|
||||
u8 bottom = ScriptReadByte(ctx);
|
||||
|
||||
MenuDrawTextWindow(left, top, right, bottom);*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(multichoicegrid)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 numColumns = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceGrid(left, top, multichoiceId, ignoreBPress, numColumns) == TRUE)
|
||||
{
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
SCRCMD_DEF(erasebox)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 right = ScriptReadByte(ctx);
|
||||
u8 bottom = ScriptReadByte(ctx);
|
||||
|
||||
// MenuZeroFillWindowRect(left, top, right, bottom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(drawboxtext)
|
||||
{
|
||||
// u8 left = ScriptReadByte(ctx);
|
||||
// u8 top = ScriptReadByte(ctx);
|
||||
// u8 multichoiceId = ScriptReadByte(ctx);
|
||||
// u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
/*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(showmonpic)
|
||||
{
|
||||
u16 species = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 x = ScriptReadByte(ctx);
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
|
||||
ScriptMenu_ShowPokemonPic(species, x, y);
|
||||
PlayCry7(species, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(hidemonpic)
|
||||
{
|
||||
bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc();
|
||||
|
||||
if (func == NULL)
|
||||
return FALSE;
|
||||
SetupNativeScript(ctx, func);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(showcontestwinner)
|
||||
{
|
||||
u8 v1 = ScriptReadByte(ctx);
|
||||
|
||||
/*
|
||||
if (v1)
|
||||
sub_812FDA8(v1);
|
||||
ShowContestWinner();
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
*/
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(braillemessage)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
|
||||
sub_80F6E9C();
|
||||
sub_80F6EE4(0, 1);
|
||||
AddTextPrinterParameterized(0, 6, ptr, 0, 1, 0, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SCRCMD_DEF(getbraillestringwidth)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
|
||||
gSpecialVar_0x8004 = GetStringWidth(6, ptr, -1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user