optiom menu move data to C

This commit is contained in:
DizzyEggg 2018-01-16 19:39:35 +01:00
parent a6072ae293
commit 4dd06dbcd3
7 changed files with 83 additions and 42 deletions

View File

@ -1,20 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2, 0
gUnknown_0855C604:: @ 855C604
.incbin "baserom.gba", 0x55c604, 0x60
gUnknown_0855C664:: @ 855C664
.incbin "baserom.gba", 0x55c664, 0x1c
gUnknown_0855C680:: @ 855C680
.incbin "baserom.gba", 0x55c680, 0x18
gUnknown_0855C698:: @ 855C698
.incbin "baserom.gba", 0x55c698, 0x8
gUnknown_0855C6A0:: @ 855C6A0
.incbin "baserom.gba", 0x55c6a0, 0x4

View File

@ -4399,25 +4399,25 @@ gText_ABtnTitleScreen:: @ 85EE572
gText_Option:: @ 85EE589 gText_Option:: @ 85EE589
.string "OPTION$" .string "OPTION$"
gUnknown_085EE590:: @ 85EE590 gText_TextSpeed:: @ 85EE590
.string "TEXT SPEED$" .string "TEXT SPEED$"
gUnknown_085EE59B:: @ 85EE59B gText_BattleScene:: @ 85EE59B
.string "BATTLE SCENE$" .string "BATTLE SCENE$"
gUnknown_085EE5A8:: @ 85EE5A8 gText_BattleStyle:: @ 85EE5A8
.string "BATTLE STYLE$" .string "BATTLE STYLE$"
gUnknown_085EE5B5:: @ 85EE5B5 gText_Sound:: @ 85EE5B5
.string "SOUND$" .string "SOUND$"
gUnknown_085EE5BB:: @ 85EE5BB gText_Frame:: @ 85EE5BB
.string "FRAME$" .string "FRAME$"
gUnknown_085EE5C1:: @ 85EE5C1 gText_OptionMenuCancel:: @ 85EE5C1
.string "CANCEL$" .string "CANCEL$"
gUnknown_085EE5C8:: @ 85EE5C8 gText_ButtonMode:: @ 85EE5C8
.string "BUTTON MODE$" .string "BUTTON MODE$"
gText_TextSpeedSlow:: @ 85EE5D4 gText_TextSpeedSlow:: @ 85EE5D4

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
255 180 82
197 123 0
255 139 131
255 49 24
74 74 74
213 213 205
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -186,5 +186,13 @@ extern const u8 gText_ButtonTypeNormal[];
extern const u8 gText_ButtonTypeLR[]; extern const u8 gText_ButtonTypeLR[];
extern const u8 gText_ButtonTypeLEqualsA[]; extern const u8 gText_ButtonTypeLEqualsA[];
extern const u8 gText_Option[]; extern const u8 gText_Option[];
extern const u8 gText_OptionMenu[];
extern const u8 gText_TextSpeed[];
extern const u8 gText_BattleScene[];
extern const u8 gText_BattleStyle[];
extern const u8 gText_Sound[];
extern const u8 gText_Frame[];
extern const u8 gText_OptionMenuCancel[];
extern const u8 gText_ButtonMode[];
#endif //GUARD_STRINGS_H #endif //GUARD_STRINGS_H

View File

@ -429,7 +429,6 @@ SECTIONS {
data/wild_encounter.o(.rodata); data/wild_encounter.o(.rodata);
data/field_effect.o(.rodata); data/field_effect.o(.rodata);
src/option_menu.o(.rodata); src/option_menu.o(.rodata);
data/option_menu.o(.rodata);
src/pokedex.o(.rodata); src/pokedex.o(.rodata);
data/pokedex.o(.rodata); data/pokedex.o(.rodata);
data/trainer_card.o(.rodata); data/trainer_card.o(.rodata);

View File

@ -74,16 +74,51 @@ static void sub_80BB154(void);
EWRAM_DATA static bool8 sArrowPressed = FALSE; EWRAM_DATA static bool8 sArrowPressed = FALSE;
// const rom data // const rom data
/* static const u16 sUnknown_0855C604[] = INCBIN_U16("graphics/misc/option_menu_text.gbapal");
const u16 gUnknown_0839F5FC[] = INCBIN_U16("graphics/misc/option_menu_text.gbapal");
// note: this is only used in the Japanese release // note: this is only used in the Japanese release
const static u8 gUnknown_0839F63C[] = INCBIN_U8("graphics/misc/option_menu_equals_sign.4bpp"); static const u8 sEqualSignGfx[] = INCBIN_U8("graphics/misc/option_menu_equals_sign.4bpp");
*/
extern const struct BgTemplate gUnknown_0855C698[2]; static const u8 *const OptionMenuItemsNames[MENUITEM_COUNT] =
extern const struct WindowTemplate gUnknown_0855C680[]; {
extern const u16 gUnknown_0855C6A0[1]; gText_TextSpeed,
extern const u16 gUnknown_0855C604[16]; gText_BattleScene,
extern const u8 *const gUnknown_0855C664[MENUITEM_COUNT]; gText_BattleStyle,
gText_Sound,
gText_ButtonMode,
gText_Frame,
gText_OptionMenuCancel,
};
static const struct WindowTemplate sOptionMenuWinTemplates[] =
{
{1, 2, 1, 0x1A, 2, 1, 2},
{0, 2, 5, 0x1A, 0xE, 1, 0x36},
DUMMY_WIN_TEMPLATE
};
static const struct BgTemplate sOptionMenuBgTemplates[] =
{
{
.bg = 1,
.charBaseIndex = 1,
.mapBaseIndex = 30,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 0,
.charBaseIndex = 1,
.mapBaseIndex = 31,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
}
};
static const u16 sUnknown_0855C6A0[] = {0x7E51};
// code // code
static void MainCB2(void) static void MainCB2(void)
@ -132,7 +167,7 @@ void CB2_InitOptionMenu(void)
DmaClear16(3, PLTT, PLTT_SIZE); DmaClear16(3, PLTT, PLTT_SIZE);
SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_DISPCNT, 0);
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, gUnknown_0855C698, ARRAY_COUNT(gUnknown_0855C698)); InitBgsFromTemplates(0, sOptionMenuBgTemplates, ARRAY_COUNT(sOptionMenuBgTemplates));
ChangeBgX(0, 0, 0); ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0); ChangeBgY(0, 0, 0);
ChangeBgX(1, 0, 0); ChangeBgX(1, 0, 0);
@ -141,7 +176,7 @@ void CB2_InitOptionMenu(void)
ChangeBgY(2, 0, 0); ChangeBgY(2, 0, 0);
ChangeBgX(3, 0, 0); ChangeBgX(3, 0, 0);
ChangeBgY(3, 0, 0); ChangeBgY(3, 0, 0);
InitWindows(gUnknown_0855C680); InitWindows(sOptionMenuWinTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WIN0V, 0);
@ -168,12 +203,12 @@ void CB2_InitOptionMenu(void)
gMain.state++; gMain.state++;
break; break;
case 4: case 4:
LoadPalette(gUnknown_0855C6A0, 0, sizeof(gUnknown_0855C6A0)); LoadPalette(sUnknown_0855C6A0, 0, sizeof(sUnknown_0855C6A0));
LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, 0x70, 0x20); LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, 0x70, 0x20);
gMain.state++; gMain.state++;
break; break;
case 5: case 5:
LoadPalette(gUnknown_0855C604, 0x10, sizeof(gUnknown_0855C604)); LoadPalette(sUnknown_0855C604, 0x10, sizeof(sUnknown_0855C604));
gMain.state++; gMain.state++;
break; break;
case 6: case 6:
@ -601,7 +636,7 @@ static void DrawOptionMenuTexts(void)
FillWindowPixelBuffer(WIN_OPTIONS, 0x11); FillWindowPixelBuffer(WIN_OPTIONS, 0x11);
for (i = 0; i < MENUITEM_COUNT; i++) for (i = 0; i < MENUITEM_COUNT; i++)
{ {
PrintTextOnWindow(WIN_OPTIONS, 1, gUnknown_0855C664[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); PrintTextOnWindow(WIN_OPTIONS, 1, OptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL);
} }
CopyWindowToVram(WIN_OPTIONS, 3); CopyWindowToVram(WIN_OPTIONS, 3);
} }