1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 553
5#include "menu_draw.hpp"
13#include "battlemenu.hpp"
16#include "dataalloc.hpp"
18#include "dun/gameloop.hpp"
19#include "editatra.hpp"
22#include "mainitemmodel.hpp"
23#include "mainselect.hpp"
25#include "memorycardaccess.hpp"
26#include "menu_dungeon.hpp"
27#include "menu_inventory.hpp"
28#include "menu_misc.hpp"
29#include "menuitemstep.hpp"
36#include "userstatus.hpp"
46char MenuGrobalDir[64];
51#include "editloop.hpp"
57static char AllMenuTextureDir[9] =
"commenu/";
60static char *ComMenuContryName[7] = {
"a_jpn/",
"a_usa/",
"a_eng/",
"a_fre/",
"a_ger/",
"a_ita/",
"a_spa/"};
62char *GetMenuTextureDir() {
63 return AllMenuTextureDir;
66int GetMenuLangFlag() {
70char *GetNowSelectLanguage(
int language) {
71 if ((language < 0) || (language >= 7)) {
75 return ComMenuContryName[language];
78void GetPathReadDifferntLang(
char *path) {
79 strcpy(path, GetMenuTextureDir());
80 strcat(path, GetNowSelectLanguage(GetMenuLangFlag()));
83int LoadFileBGMenuData(
char *name, u_long128 *buffer) {
86 if ((name == NULL) || (buffer == NULL)) {
90 GetPathReadDifferntLang(MenuGrobalDir);
91 strcat(MenuGrobalDir, name);
92 LoadFileBG(MenuGrobalDir, buffer, &size);
96int LoadFileMenuData(
char *name,
unsigned int *buffer) {
99 GetPathReadDifferntLang(MenuGrobalDir);
100 strcat(MenuGrobalDir, name);
101 LoadFile(MenuGrobalDir, buffer, &size);
105u_long128 *BtlMenuBufferSet(
int mode) {
109 case BATTLE_MENU_MODE_DUNGEON:
110 buffer = (u_long128 *) read_buffer;
112 case BATTLE_MENU_MODE_TOWN:
113 buffer = (u_long128 *) (EdMenuBuffer.
base + EdMenuBuffer.
used * 0x10);
119u_long128 *MenuCalcBufAlignment(u_long128 *buffer) {
120 int offset = (int) buffer;
121 int remainder = offset & 0x3F;
123 if ((offset < 0) && (remainder != 0)) {
127 if (remainder != 0) {
128 offset = ((offset >> 6) + 1) << 6;
131 return (u_long128 *) offset;
134int GetAtoraMaxVillage() {
138 for (village = 4; village >= 0; village--) {
140 max_village = village + 3;
149 if ((max_village < 3) || (max_village > 8)) {
156int GetNowMapTransAtraMap(
int map_no) {
159 s16 map_to_village[35] = {
160 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 3, 4, 5, 5,
161 5, 3, 1, 4, 4, 4, 4, 1, 3, 2, 3, 4, 5, 2, 5,
168 }
else if (map_no >= 0xB && map_no < 0x29) {
169 village = map_to_village[map_no - 0xB];
170 }
else if (map_no >= 0xC8) {
171 village = map_no - 0xC8;
174 if (GetAtoraMaxVillage() - 3 < village) {
175 village = GetAtoraMaxVillage() - 3;
181void MenuWorldTrans(
CCamera *camera) {
182 sceVu0FMATRIX camera_matrix;
183 sceVu0FVECTOR eye_pos;
184 sceVu0FMATRIX view_matrix;
185 sceVu0FMATRIX unit_matrix;
187 MGSetProjection(800.0f);
191 sceVu0UnitMatrix(unit_matrix);
192 sceVu0MulMatrix(view_matrix, unit_matrix, camera_matrix);
193 MGSetViewMatrix(view_matrix, eye_pos);
196void MenuPolygonDraw(
int ambient_alpha,
void (*draw)()) {
197 float ref_pos[4] = {0.0f, 0.0f, -45.0f, 1.0f};
198 float eye_pos[4] = {0.0f, 0.0f, 60.0f, 1.0f};
200 MenuCamera.
SetRef(ref_pos);
201 MenuCamera.
SetPos(eye_pos);
203 float light_dir[4][4] = {
204 {0.3f, 0.0f, 0.0f, 0.0f},
205 {0.3f, 0.0f, 0.0f, 0.0f},
206 {0.3f, 0.0f, 0.0f, 0.0f},
207 {0.0f, 0.0f, 0.0f, 0.0f},
209 float light_colour[4][4] = {
210 {96.0f, 96.0f, 96.0f, 0.0f},
211 {0.0f, 0.0f, 0.0f, 0.0f},
212 {0.0f, 0.0f, 0.0f, 0.0f},
213 {0.0f, 0.0f, 0.0f, 0.0f},
215 float saved_ambient[4];
217 float saved_light_dir[4][4];
218 float saved_light_colour[4][4];
220 MGGetPLight(saved_light_dir, saved_light_colour);
221 MGGetAmbient(saved_ambient);
222 ambient[0] = ambient[1] = ambient[2] = 80.0f;
223 ambient[3] = (float) ambient_alpha;
225 float light_vector[4] = {0.3f, 1.0f, 0.3f, 0.0f};
226 float light_normal[4];
228 sceVu0Normalize(light_normal, light_vector);
229 light_dir[0][0] = light_normal[0];
230 light_dir[1][0] = light_normal[1];
231 light_dir[2][0] = light_normal[2];
232 MGSetPLight(light_dir, light_colour);
233 MGSetAmbient(ambient);
235 MGSetPLight(saved_light_dir, saved_light_colour);
236 MGSetAmbient(saved_ambient);
239void Get3DPosTo2DPos(
CFrame *frame,
int *screen) {
241 float origin[4] = {0.0f, 0.0f, 0.0f, 1.0f};
244 frame->GetWorldPosition(world, origin);
245 MGRotTransPers2D(screen_pos, world, 0);
246 screen[0] = screen_pos[0];
247 screen[1] = screen_pos[1];
250int GetMenuCommonFontW(
int language,
int style) {
251 s8 font_widths[7] = {16, 11, 11, 11, 11, 11, 11};
252 return font_widths[language];
255int GetMenuCommonPutXY(
ClsMes *mes,
int x) {
264 put_x -= size[2] >> 1;
272static inline void ResetMenuMes(
ClsMes *mes) {
294 for (
int i = 0; i < 10; i++) {
298 for (
int i = 0; i < 8; i++) {
312 for (
int i = 0; i < 10; i++) {
318void InitMenuMesSet(
int mode,
short *messages) {
319 CommonMenuMes1.
tex_buff = MesWinTexBuff_01;
320 CommonMenuMes2.
tex_buff = MesWinTexBuff_02;
321 CommonMenuMes3.
tex_buff = MesWinTexBuff_11;
322 AtoraNameMes.
tex_buff = MesWinTexBuff_12;
323 ResetMenuMes(&CommonMenuMes1);
324 ResetMenuMes(&CommonMenuMes2);
325 ResetMenuMes(&CommonMenuMes3);
326 ResetMenuMes(&AtoraNameMes);
331 CommonMenuMes1.
SetBuff(messages);
332 CommonMenuMes2.
SetBuff(messages);
333 CommonMenuMes3.
SetBuff(messages);
334 AtoraNameMes.
SetBuff(messages);
344 switch (GetMenuLangFlag()) {
347 CommonMenuMes1.
rows = 3;
351 CommonMenuMes2.
rows = 3;
355 CommonMenuMes3.
rows = 4;
362 case LANG_ENGLISH_US:
363 CommonMenuMes1.
rows = 3;
367 CommonMenuMes2.
rows = 4;
372 CommonMenuMes3.
rows = 4;
385 CommonMenuMes1.
auto_pos = MES_POS_NONE;
386 CommonMenuMes2.
auto_pos = MES_POS_NONE;
387 CommonMenuMes3.
auto_pos = MES_POS_NONE;
388 AtoraNameMes.
auto_pos = MES_POS_NONE;
389 CommonMenuMes1.
style = MES_EDGE_NONE;
390 CommonMenuMes2.
style = MES_EDGE_NONE;
391 CommonMenuMes3.
style = MES_EDGE_NONE;
392 AtoraNameMes.
style = MES_EDGE_NONE;
395 case MENU_MES_SET_ALLMENU:
396 CommonMenuMes1.
Preset(MES_PRESET_SYSTEM);
397 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
398 CommonMenuMes3.
Preset(MES_PRESET_NAME);
399 AtoraNameMes.
Preset(MES_PRESET_NAME);
405 case MENU_MES_SET_EVENT_ITEM:
406 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
409 CommonMenuMes2.
rows = 4;
410 CommonMenuMes1.
Preset(MES_PRESET_SYSTEM);
413 case MENU_MES_SET_SHOP:
414 CommonMenuMes1.
Preset(MES_PRESET_SYSTEM);
415 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
416 CommonMenuMes3.
Preset(MES_PRESET_FUKIDASHI);
417 AtoraNameMes.
Preset(MES_PRESET_SYSTEM);
419 CommonMenuMes1.
rows = 3;
424 CommonMenuMes3.
rows = 3;
428 AtoraNameMes.
rows = 1;
430 switch (GetMenuLangFlag()) {
436 case LANG_ENGLISH_US:
442 case MENU_MES_SET_NAME_ENTRY:
443 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
444 CommonMenuMes3.
Preset(MES_PRESET_SYSTEM);
445 AtoraNameMes.
Preset(MES_PRESET_SYSTEM);
446 CommonMenuMes2.
style = MES_EDGE_DOUBLE;
447 CommonMenuMes3.
style = MES_EDGE_DOUBLE;
448 AtoraNameMes.
style = MES_EDGE_DOUBLE;
449 CommonMenuMes2.
rows = 3;
450 CommonMenuMes3.
rows = 2;
451 AtoraNameMes.
rows = 1;
453 case MENU_MES_SET_ATLA_NAME:
454 AtoraNameMes.
Preset(MES_PRESET_NAME);
455 AtoraNameMes.
rows = 1;
457 case MENU_MES_SET_WORLD_MAP:
458 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
459 CommonMenuMes3.
Preset(MES_PRESET_NAME);
460 CommonMenuMes3.
rows = 1;
462 case MENU_MES_SET_DUNGEON_ENTER:
463 CommonMenuMes2.
Preset(MES_PRESET_SYSTEM);
465 CommonMenuMes2.
rows = 2;
472void DrawMenuClsMes(
ClsMes *message,
int x,
int y) {
473 if (message != NULL) {
481void ComMenuSePlay(
int sound) {
483 SndSePlay(sound, -1, 0);
488 set2DSprite(GetVif1Packet(), texture, screen, texel, alpha);
491void DrawMenu2DSprite(
CTexture *texture,
CRect_i_ screen,
CRect_i_ texel,
unsigned char r,
unsigned char g,
unsigned char b,
int alpha) {
492 set2DSprite(GetVif1Packet(), texture, screen, texel, r, g, b, alpha);
496 set2DSprite(GetVif1Packet(), texture, screen, texel, top_left, top_right, bottom_left, bottom_right, 1);
499void MenuTextureReload(
int block) {
500 TexManager.ReloadTexture(GetVif1Packet(), block);
503void MenuTextureDelete(
int *blocks) {
504 for (
int i = 0; blocks[i] != -1; i++) {
505 TexManager.DeleteTextureBlock(blocks[i]);
506 printf(
"delete block: %d\n", blocks[i]);
510void AllFillBoxForMenu(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char alpha) {
511 if (r < 0 || r > 0xFF) {
515 if (g < 0 || g > 0xFF) {
519 if (b < 0 || b > 0xFF) {
523 if (alpha < 0 || alpha > 0xFF) {
527 MGFillBox(
CRect_i_(0, 0, 0x2800, (SCREEN_HEIGHT << 4)), r, g, b, alpha);
530void AllFadeForMenu(
int alpha) {
531 AllFillBoxForMenu(0, 0, 0, (
unsigned char) alpha);
534void FrameImageDraw(
int brightness,
int alpha) {
536 CTexture *texture = TexManager.GetTexture(
"frame_image", -1);
538 if (texture != NULL) {
539 TexManager.ReloadTexture(GetVif1Packet(), texture->
block);
546 DrawMenu2DSprite(texture, MenuDispRc, MenuDispRc, brightness, brightness, brightness, alpha);
548 set2DSprite(GetVif1Packet(), texture, MenuDispRc, MenuDispRc, brightness, brightness, brightness, alpha);
555 set2DSpriteC4(GetVif1Packet(), rect, top_left, top_right, bottom_left, bottom_right);
559 set2DSpriteC4(GetVif1Packet(), rect, left, right, left, right);
569static void DrawDontSetItemMark(
int x,
int y,
int top,
int bottom,
int alpha) {
574 if (y < top - 31 || y > bottom - 1) {
581 MenuTextureClip(position, source, length, top, bottom);
582 DrawMenu2DSprite(PerBoardTex,
CRect_i_(x, position, 32, length),
CRect_i_(0x13C, source, 32, length), alpha);
585void DrawIconParts(
int item_no,
int x,
int y,
int top,
int bottom,
int alpha,
int number) {
593 if (y < top - 31 || y > bottom - 1) {
598 info = GetCommonItemInfo(item_no);
601 texture = RetCTex(item_no, u, v);
603 if (texture != NULL) {
605 MenuTextureClip(position, v, length, top, bottom);
607 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x + 2, position + 1, 32, length), source, 0, 0, 0, alpha * 0x50 >> 7);
608 DrawMenu2DSprite(texture,
CRect_i_(x, position, 32, length), source, alpha);
609 DrawAttachNumberOrWeapon(x, y, top, bottom, item_no, number, alpha, 0);
614void DrawAttachNumberOrWeapon(
int x,
int y,
int top,
int bottom,
int item_no,
int value,
int alpha,
int vibe) {
620 TexManager.GetTexture(
"wepicon", -1);
622 if (0 < value && item_no >= ITEM_ATTACH_STAT_START && item_no < ITEM_ATTACH_GEM_START) {
623 int number_x = x + 12;
625 u = (value - 1) * 0x12 + 0x84;
628 MenuTextureClip(draw_y, v, height, top, bottom - 2);
630 if (draw_y < bottom) {
631 CRect_i_ source(u, v, 0x12, height);
634 DrawObjectVibe(number_x, draw_y, StayTex, source, 0x80, 0x80);
636 DrawMenu2DSprite(StayTex,
CRect_i_(number_x, draw_y, 0x12, height), source, alpha);
641 if (item_no == ITEM_ATTACH_SYNTHESIS_SPHERE) {
642 CTexture *texture = RetCTex((s16) value, u, v);
644 if (texture != NULL) {
647 MenuTextureClip(draw_y, v, height, top, bottom);
648 CRect_i_ source(u, v, 0x20, height);
651 DrawObjectVibe(x, draw_y, texture, source, 0x80, 0x80);
655 DrawMenu2DSprite(texture,
CRect_i_(x, draw_y, 0x20, height), source, (alpha * 0x80) >> 7);
660void FadeTexX(
int left_x,
int left_width,
int right_x,
int right_width,
char *name,
int dim) {
661 CTexture texture = *TexManager.GetTexture(name, -1);
666 if (&texture == NULL) {
675 right.
r = right.
g = right.
b = 0x40;
676 left.
r = left.
g = left.
b = 0x40;
678 if (left_width != 0) {
681 set2DSprite(GetVif1Packet(), &texture,
CRect_i_(0, 0, left_x, SCREEN_HEIGHT),
CRect_i_(0, 0, left_x, (SCREEN_HEIGHT - 1)), &left, &right, &left, &right, 1);
691 set2DSprite(GetVif1Packet(), &texture,
CRect_i_(left_x, 0, left_width, SCREEN_HEIGHT),
CRect_i_(left_x, 0, left_width, (SCREEN_HEIGHT - 1)), &left, &right, &left, &right, 1);
699 set2DSprite(GetVif1Packet(), &texture,
CRect_i_(right_x, 0, right_width, SCREEN_HEIGHT),
CRect_i_(right_x, 0, right_width, (SCREEN_HEIGHT - 1)), &left, &right, &left, &right, 1);
701 if (right_width != 0) {
704 set2DSprite(GetVif1Packet(), &texture,
CRect_i_(right_x + right_width, 0, 0x280 - right_x - right_width, SCREEN_HEIGHT),
CRect_i_(right_x + right_width, 0, 0x280 - right_x - right_width, (SCREEN_HEIGHT - 1)), &left, &right, &left, &right, 1);
710CTexture *RetCTex(
short item_no,
int &u,
int &v) {
724 u = ((icon + 8) % 8) << 5;
725 v = (icon >> 3) << 5;
727 switch (info->
kind) {
731 case ITEMKIND_ATTACH:
732 case ITEMKIND_WEAPON:
740void MenuTextureClip(
int &position,
int &source,
int &length,
int minimum,
int maximum) {
741 if (position < minimum && position + length > minimum) {
742 length = position + length - minimum;
743 source += minimum - position;
747 if (position < maximum && position + length > maximum) {
748 length = maximum - position;
752int GetNumberKeta(
int value) {
755 while (value >= 10) {
766 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x5E, 0x1E, 0xB},
767 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x3A, 0x1E, 0xC},
768 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x1E0, 0x84, 0x32, 0x1E, 0xD},
769 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0xA0, 0x1E, 0xE},
770 {4, 0, 0x124, 0, 0x160, 0x28, 0x140, 0xC0, 0x72, 0x1E, 0x10},
771 {5, 0, 0x15E, 0, 0x190, 0x28, 0x140, 0xA2, 0x4E, 0x1E, 0x18},
772 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x212, 0x84, 0x6E, 0x1E, 0x1A},
773 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0xA0, 0x1E, 0xF},
774 {8, 0, 0x40, 0, 0xA0, 0x28, 0xA0, 0x48, 0xA0, 0x1E, 0x11},
775 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0xA0, 0x66, 0xA0, 0x1E, 0x12},
776 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0x66, 0x72, 0x1E, 0x16},
777 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0x140, 0x84, 0x8C, 0x1E, 0x17},
778 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x220, 0x66, 0x60, 0x1E, 0x13},
779 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0x140, 0x48, 0x9E, 0x1E, 0x15},
782 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
783 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
784 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
785 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x90, 0x1E, 0xE},
786 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
787 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
788 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
789 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
790 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
791 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
792 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
793 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
794 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
795 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
798 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
799 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
800 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
801 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x90, 0x1E, 0xE},
802 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
803 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
804 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
805 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
806 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
807 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
808 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
809 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
810 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
811 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
814 {0, 0, 0x246, 0, 0x250, 0x28, 0x1D0, 0x48, 0x3C, 0x1E, 0xB},
815 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E8, 0x66, 0x4A, 0x1E, 0xC},
816 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x232, 0x66, 0x4E, 0x1E, 0xD},
817 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1EA, 0xA2, 0x96, 0x1E, 0xE},
818 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
819 {5, 0, 0x15E, 0, 0x190, 0x28, 0x168, 0x48, 0x50, 0x1E, 0x18},
820 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x224, 0x84, 0x5C, 0x1E, 0x1A},
821 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1EE, 0xC0, 0x92, 0x1E, 0xF},
822 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xCC, 0x1E, 0x11},
823 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x94, 0x1E, 0x12},
824 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0xA6, 0x1E, 0x16},
825 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0x8E, 0x1E, 0x17},
826 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x236, 0x48, 0x4A, 0x1E, 0x13},
827 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0x82, 0x1E, 0x15},
830 {0, 0, 0x246, 0, 0x250, 0x28, 0x1AE, 0x66, 0x6E, 0x1E, 0xB},
831 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1B8, 0x4A, 0x46, 0x1E, 0xC},
832 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x21C, 0x66, 0x62, 0x1E, 0xD},
833 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1F0, 0xA2, 0x8C, 0x1E, 0xE},
834 {4, 0, 0x124, 0, 0x160, 0x28, 0x15E, 0x66, 0x50, 0x1E, 0x10},
835 {5, 0, 0x15E, 0, 0x190, 0x28, 0x15E, 0x48, 0x5C, 0x1E, 0x18},
836 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x74, 0x1E, 0x1A},
837 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1EE, 0xC0, 0x90, 0x1E, 0xF},
838 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0x82, 0x1E, 0x11},
839 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
840 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x9E, 0x1E, 0x16},
841 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
842 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x1FE, 0x48, 0x82, 0x1E, 0x13},
843 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
846 {0, 0, 0x246, 0, 0x250, 0x28, 0x1CA, 0x48, 0x42, 0x1E, 0xB},
847 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1EA, 0x66, 0x3E, 0x1E, 0xC},
848 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x52, 0x1E, 0xD},
849 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1DC, 0xA2, 0xA4, 0x1E, 0xE},
850 {4, 0, 0x124, 0, 0x160, 0x28, 0x16C, 0x66, 0x5A, 0x1E, 0x10},
851 {5, 0, 0x15E, 0, 0x190, 0x28, 0x162, 0x48, 0x56, 0x1E, 0x18},
852 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F4, 0x84, 0x64, 0x1E, 0x1A},
853 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0xA2, 0x1E, 0xF},
854 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
855 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x92, 0x1E, 0x12},
856 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x98, 0x1E, 0x16},
857 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB6, 0x1E, 0x17},
858 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x212, 0x48, 0x6E, 0x1E, 0x13},
859 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xBC, 0x1E, 0x15},
862 {0, 0, 0x246, 0, 0x250, 0x28, 0x1D2, 0x48, 0x4C, 0x1E, 0xB},
863 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E4, 0x66, 0x3E, 0x1E, 0xC},
864 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x224, 0x66, 0x5A, 0x1E, 0xD},
865 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1DA, 0xA2, 0x9E, 0x1E, 0xE},
866 {4, 0, 0x124, 0, 0x160, 0x28, 0x16C, 0x66, 0x4E, 0x1E, 0x10},
867 {5, 0, 0x15E, 0, 0x190, 0x28, 0x168, 0x48, 0x5E, 0x1E, 0x18},
868 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1EE, 0x84, 0x6A, 0x1E, 0x1A},
869 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1D2, 0xC0, 0xAE, 0x1E, 0xF},
870 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
871 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x14A, 0xA2, 0x80, 0x1E, 0x12},
872 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x14E, 0xC0, 0x74, 0x1E, 0x16},
873 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB0, 0x1E, 0x17},
874 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x228, 0x48, 0x40, 0x1E, 0x13},
875 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA4, 0x48, 0xB0, 0x1E, 0x15},
881 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x5E, 0x1E, 0xB},
882 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x3A, 0x1E, 0xC},
883 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x1E0, 0x84, 0x32, 0x1E, 0xD},
884 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0xA0, 0x1E, 0xE},
885 {4, 0, 0x124, 0, 0x160, 0x28, 0x140, 0xC0, 0x72, 0x1E, 0x10},
886 {5, 0, 0x15E, 0, 0x190, 0x28, 0x140, 0xA2, 0x4E, 0x1E, 0x18},
887 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x212, 0x84, 0x6E, 0x1E, 0x1A},
888 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0xA0, 0x1E, 0xF},
889 {8, 0, 0x40, 0, 0xA0, 0x28, 0xA0, 0x48, 0xA0, 0x1E, 0x11},
890 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0xA0, 0x66, 0xA0, 0x1E, 0x12},
891 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0x66, 0x72, 0x1E, 0x16},
892 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0x140, 0x84, 0x8C, 0x1E, 0x17},
893 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x220, 0x66, 0x60, 0x1E, 0x13},
894 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0x140, 0x48, 0x9E, 0x1E, 0x15},
897 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
898 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
899 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
900 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x8E, 0x1E, 0xE},
901 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
902 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
903 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
904 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
905 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
906 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
907 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
908 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
909 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
910 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
913 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
914 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
915 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
916 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x85, 0x1E, 0xE},
917 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
918 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
919 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
920 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
921 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
922 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
923 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
924 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
925 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
926 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
929 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
930 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
931 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
932 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x85, 0x1E, 0xE},
933 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
934 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
935 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
936 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
937 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
938 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
939 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
940 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
941 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
942 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
945 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
946 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
947 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
948 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x85, 0x1E, 0xE},
949 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
950 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
951 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
952 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
953 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
954 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
955 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
956 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
957 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
958 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
961 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
962 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
963 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
964 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x85, 0x1E, 0xE},
965 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
966 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
967 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
968 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
969 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
970 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
971 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
972 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
973 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
974 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
977 {0, 0, 0x246, 0, 0x250, 0x28, 0x1E0, 0x48, 0x30, 0x1E, 0xB},
978 {1, 0, 0x20C, 0, 0x220, 0x28, 0x1E0, 0x66, 0x4E, 0x1E, 0xC},
979 {2, 0, 0x1D2, 0, 0x1F0, 0x28, 0x22E, 0x66, 0x4B, 0x1E, 0xD},
980 {3, 0, 0x198, 0, 0x1C0, 0x28, 0x1E0, 0xA2, 0x85, 0x1E, 0xE},
981 {4, 0, 0x124, 0, 0x160, 0x28, 0x170, 0x66, 0x4B, 0x1E, 0x10},
982 {5, 0, 0x15E, 0, 0x190, 0x28, 0x170, 0x48, 0x35, 0x1E, 0x18},
983 {6, 0, 0xA0, 0x84, 0x1A, 0x48, 0x1F1, 0x84, 0x5C, 0x1E, 0x1A},
984 {7, 0, 0x78, 0, 0xD0, 0x28, 0x1E0, 0xC0, 0x98, 0x1E, 0xF},
985 {8, 0, 0x40, 0, 0xA0, 0x28, 0x140, 0x84, 0xAA, 0x1E, 0x11},
986 {9, 0, 0x108, 0x84, 0xD8, 0x84, 0x140, 0xA2, 0x8E, 0x1E, 0x12},
987 {0xA, 0, 0xEA, 0, 0x130, 0x28, 0x140, 0xC0, 0x89, 0x1E, 0x16},
988 {0xB, 0, 0xB0, 0, 0x100, 0x28, 0xA0, 0x66, 0xB4, 0x1E, 0x17},
989 {0xC, 0, 0x108, 0xAC, 0xD8, 0xA4, 0x210, 0x48, 0x70, 0x1E, 0x13},
990 {0xD, 0, 0x198, 0, 0x1C0, 0x28, 0xA0, 0x48, 0xAD, 0x1E, 0x15},
996 return &MenuIcon[GetMenuLangFlag()][icon];
999void DrawMainMenuIcon(
int x,
int y,
int icon,
int selected,
int bright,
int alpha) {
1000 if (StayTex == NULL) {
1001 StayTex = TexManager.GetTexture(
"stayframe", -1);
1003 if (StayTex == NULL) {
1016 s16 frame_size[2][2] = {
1020 int width = frame_size[selected][0];
1021 int height = frame_size[selected][1];
1027 if (icon == info->
id) {
1032 set2DSprite(GetVif1Packet(), StayTex,
CRect_i_(x, y, width, height - 1),
CRect_i_(u, v, width, height), bright, bright, bright, alpha);
1042 set2DSprite(GetVif1Packet(), StayTex,
CRect_i_(x, y, info->
label_width, info->
label_height - 1),
CRect_i_(info->
label_u, info->
label_v, info->
label_width, info->
label_height), bright, bright, bright, alpha);
1045void DrawMenuVibeItem(
int x,
int y,
int offset_x,
int offset_y,
int alpha) {
1046 int item_x = x + offset_x;
1047 int item_y = y + offset_y;
1049 CRect_i_ shadow(0x80, 0x28, 0x20, 0x20);
1052 CTexture *texture = RetCTex(item_no, u, v);
1054 if (texture != NULL) {
1055 DrawObjectVibe(x + 4, y + 2, TexManager.GetTexture(
"StayTex", -1), shadow, 0, 0x50);
1057 DrawObjectVibe(item_x + 4, item_y + 2, texture, source, 0, 0x50);
1058 DrawObjectVibe(item_x, item_y, texture, source, 0x80, 0x80);
1059 int number = GetAttachVolumeForMsg(&PerBoardPt->
held_attach);
1061 if (item_no == ITEM_ATTACH_SYNTHESIS_SPHERE) {
1065 DrawAttachNumberOrWeapon(item_x, item_y, 0, 0x280, item_no, number, 0x80, 1);
1069int GetMainMenuRightHelpWinLangOffset(
float &x,
float &y,
float &width,
float &height) {
1070 float offsets[7][4] = {
1071 {320.0f, 325.0f, 14.6f, 2.2f},
1073 {318.0f, 352.0f, 15.6f, 2.7f},
1074 {318.0f, 352.0f, 15.6f, 2.7f},
1075 {318.0f, 352.0f, 15.6f, 2.7f},
1076 {318.0f, 352.0f, 15.6f, 2.7f},
1077 {318.0f, 352.0f, 15.6f, 2.7f},
1078 {318.0f, 352.0f, 15.6f, 2.7f},
1080 {318.0f, 320.0f, 15.6f, 2.7f},
1081 {318.0f, 320.0f, 15.6f, 2.7f},
1082 {318.0f, 320.0f, 15.6f, 2.7f},
1083 {318.0f, 320.0f, 15.6f, 2.7f},
1084 {318.0f, 320.0f, 15.6f, 2.7f},
1085 {318.0f, 320.0f, 15.6f, 2.7f},
1088 int lang = GetMenuLangFlag();
1090 x = offsets[lang][0];
1091 y = offsets[lang][1];
1092 width = offsets[lang][2];
1093 height = offsets[lang][3];
1097int GetMainMenuRightHelpMsgLangOffset(
int &x,
int &y) {
1098 s8 offsets[7][2] = {
1111 int lang = GetMenuLangFlag();
1113 x = offsets[lang][0];
1114 y = offsets[lang][1];
1119 memset(item, -1, 0x14U);
1123 memset(weapon, 0, 0xF8U);
1128 memset(attachment, 0, 0x20U);
1131void MenuDataSwap(s16 *first, s16 *second) {
1134 if ((first == NULL) || (second == NULL)) {
1143void MenuDataSwap(
int *first,
int *second) {
1146 if ((first == NULL) || (second == NULL)) {
1158 if ((first == NULL) || (second == NULL)) {
1170 if ((first == NULL) || (second == NULL)) {
1179void SetMenuTrushMark(
ITEM_PACK *items) {
1180 int quick_count = 0;
1184 for (i = 0; i < 3; i++) {
1188 for (slot = items->
num - 1; slot >= 0; slot--) {
1189 if (items->
item[slot] < ITEM_DUNGEON_START && quick_count > 0) {
1190 MenuTrushMark[slot] = 1;
1193 MenuTrushMark[slot] = 0;
1198void DeleteMenuTrushMark() {
1199 memset(MenuTrushMark, 0,
sizeof(MenuTrushMark));
1203 PerBoardStatusPt = status;
1206 if (PerBoardTex == NULL) {
1207 PerBoardTex = TexManager.GetTexture(
"perbrd", -1);
1211 PerBoardPt->
page = page;
1216 int rows = PersonalRetMax(PerBoardPt->
page) / 5;
1222 PerBoardPt->
y = 0x7F - PerBoardPt->
top_row * 0x28;
1223 PerBoardPt->
scroll = 140.0f + 114.0f * PerBoardPt->
top_row / rows;
1224 PerBoardPt->
cursor_area = PERSONAL_BOARD_AREA_CELLS;
1226 InitHaveWep(&PerBoardPt->
weapon);
1230 DeleteMenuTrushMark();
1231 s16 full = BOARD_PAGE_NONE;
1236 if (pack->
item[pack->
num] >= ITEM_DUNGEON_START) {
1237 full = BOARD_PAGE_ITEM;
1241 full = BOARD_PAGE_ATTACH;
1244 for (
int i = 0; i < 6; i++) {
1245 if (((
CUserStatus *) PerBoardStatusPt)->chara_weapons[i][10].item_no >= ITEM_WEAPON_START) {
1246 full = BOARD_PAGE_WEAPON;
1252 case BOARD_PAGE_ITEM:
1253 SetMenuTrushMark(pack);
1259int BoardModeChangeKey() {
1260 int board_mode = PerBoardPt->
page;
1262 if (GamePad.
Down(PAD_L2 | PAD_L1)) {
1264 case PERSONAL_BOARD_ITEM:
1267 if (PerBoardPt->
page < BOARD_PAGE_ITEM) {
1268 PerBoardPt->
page = BOARD_PAGE_ATTACH;
1272 case PERSONAL_BOARD_ATLA:
1273 case PERSONAL_BOARD_WEAPON_ATTACH:
1278 if (GamePad.
Down(PAD_R2 | PAD_R1)) {
1280 case PERSONAL_BOARD_ITEM:
1283 if (PerBoardPt->
page > BOARD_PAGE_ATTACH) {
1284 PerBoardPt->
page = BOARD_PAGE_ITEM;
1288 case PERSONAL_BOARD_ATLA:
1289 case PERSONAL_BOARD_WEAPON_ATTACH:
1294 if (board_mode != PerBoardPt->
page) {
1301void PersonalBoardLimmitCheck() {
1302 int page = PerBoardPt->
page;
1303 int *cursor = &PerBoardPt->
cursor;
1304 int max = PersonalRetMax(page);
1305 int top_row = PerBoardPt->
top_row;
1306 int last_top = max / 5 - 4;
1312 if (max - 1 < *cursor) {
1313 while (*cursor >= max) {
1317 PerBoardPt->
top_row = *cursor / 5 - 3;
1319 if (PerBoardPt->
top_row < 0) {
1323 PerBoardPt->
y = 0x7F - PerBoardPt->
top_row * 0x28;
1330 PerBoardPt->
scroll = 140.0f + 114.0f * PerBoardPt->
top_row / rows;
1334 if (last_top < top_row) {
1339 while (last_top < PerBoardPt->top_row) {
1345int PersonalBoardKeySub() {
1348 int page = PerBoardPt->
page;
1349 int *cursor = &PerBoardPt->
cursor;
1350 int max = PersonalRetMax(page);
1352 if (GamePad.
Down(PAD_UP) != 0) {
1354 case PERSONAL_BOARD_AREA_CELLS:
1359 if (*cursor / 5 < PerBoardPt->
top_row) {
1364 case PERSONAL_BOARD_AREA_TRASH:
1369 if (GamePad.
Down(PAD_DOWN) != 0) {
1371 case PERSONAL_BOARD_AREA_CELLS:
1372 if (*cursor < max - 5) {
1376 if (*cursor / 5 > PerBoardPt->
top_row + 3) {
1381 case PERSONAL_BOARD_AREA_TRASH:
1386 if (GamePad.
Down(PAD_RIGHT) != 0) {
1388 case PERSONAL_BOARD_AREA_TRASH:
1390 case PERSONAL_BOARD_AREA_CELLS: {
1391 int column = *cursor % 5;
1395 }
else if (column == 4 && PerBoardPt->
menu_kind != PERSONAL_BOARD_ATLA) {
1396 PerBoardPt->
cursor_area = PERSONAL_BOARD_AREA_TRASH;
1404 if (GamePad.
Down(PAD_LEFT) != 0) {
1406 case PERSONAL_BOARD_AREA_TRASH:
1407 PerBoardPt->
cursor_area = PERSONAL_BOARD_AREA_CELLS;
1409 case PERSONAL_BOARD_AREA_CELLS:
1410 if (*cursor % 5 == 0) {
1421 ComMenuSePlay(MENU_SOUND_CURSOR);
1427int PersonalBoardKey() {
1428 BoardModeChangeKey();
1429 PersonalBoardLimmitCheck();
1430 return PersonalBoardKeySub();
1436int PersonalBoardItemPush(
IHAVEITEM *item,
int board_pos) {
1437 int enabled =
false;
1438 int kind = WhatIsKindofItem(item->
item_no);
1440 if (kind == BOARD_PAGE_ITEM || kind < 0) {
1444 if (MenuTrushMark[board_pos] == 1) {
1447 MenuDataSwap(board_item, &item->
item_no);
1448 MenuDataSwap(board_volume, &item->
volume);
1450 if (item->
item_no >= ITEM_ATTACH_START) {
1455 if (item->
item_no >= ITEM_DUNGEON_START || *board_item >= ITEM_DUNGEON_START) {
1464int PersonalBoardWeaponPush(
IHAVEITEM *item,
int board_pos) {
1466 int kind = WhatIsKindofItem(item->
item_no);
1467 int chara = board_pos / 10;
1468 int slot = board_pos % 10;
1472 int weapon_no = weapon->
item_no;
1474 if (kind == BOARD_PAGE_ITEM) {
1475 if (weapon_no < ITEM_WEAPON_START) {
1479 if (item->
item_no == ITEM_REPAIR_POWDER) {
1483 if (weapon->
item_no == GetDefaultWeaponNo(chara)) {
1485 WepDataListToHaveCopy(weapon->
item_no, weapon);
1493 if (item->
item_no == ITEM_POWERUP_POWDER) {
1494 if (weapon->
experience < GetWeaponMaxExp(weapon) && weapon->
level < 99) {
1495 int item_no = weapon->
item_no;
1497 if (item_no != GetDefaultWeaponNo(chara)) {
1498 if (item_no == ITEM_WEAPON_SERPENT_SWORD) {
1499 if (GetMenuHebikiriFlag() != 0) {
1510 if (kind == BOARD_PAGE_WEAPON || kind < 0) {
1511 if (kind == BOARD_PAGE_WEAPON) {
1512 int owner = WhoIsWeaponEquip(item->
item_no);
1514 if (owner != chara) {
1519 MenuDataSwap(&PerBoardPt->
weapon, weapon);
1547 InitHaveWep(weapon);
1550 if (weapon->
item_no >= ITEM_WEAPON_START || item->
item_no >= ITEM_WEAPON_START) {
1562int PersonalBoardAttachPush(
IHAVEITEM *item,
int board_pos) {
1563 int enabled =
false;
1564 int kind = WhatIsKindofItem(item->
item_no);
1566 if (kind == BOARD_PAGE_ATTACH || kind < 0) {
1573 s16 slot_item_no = slot->
item_no;
1579 if (item->
item_no >= ITEM_ATTACH_START || slot->
item_no >= ITEM_ATTACH_START) {
1587int PersonalBoardItemGetorSwap(
int board_pos) {
1591 switch (PerBoardPt->
page) {
1592 case BOARD_PAGE_ITEM:
1593 result = PersonalBoardItemPush(item, board_pos);
1595 case BOARD_PAGE_WEAPON:
1596 result = PersonalBoardWeaponPush(item, board_pos);
1598 case BOARD_PAGE_ATTACH:
1599 result = PersonalBoardAttachPush(item, board_pos);
1606void PersonalBoardItemCancel() {
1611 case BOARD_PAGE_ITEM: {
1614 MenuDataSwap(item, &have->
item_no);
1615 MenuDataSwap(volume, &have->
volume);
1617 case BOARD_PAGE_WEAPON: {
1623 if (held >= ITEM_WEAPON_START) {
1629 MenuDataSwap(&PerBoardPt->
weapon, weapon);
1644 case BOARD_PAGE_ATTACH: {
1648 int placed = item->
id;
1656 if (have->
item_no < ITEM_ATTACH_START) {
1658 InitHaveWep(&PerBoardPt->
weapon);
1663int PersonalRetMax(
int board_mode) {
1666 switch (board_mode) {
1667 case BOARD_PAGE_ITEM:
1670 case BOARD_PAGE_WEAPON:
1673 case BOARD_PAGE_ATTACH:
1676 case BOARD_PAGE_ATLA_VILLAGE:
1677 case BOARD_PAGE_ATLA_VILLAGE + 1:
1678 case BOARD_PAGE_ATLA_VILLAGE + 2:
1679 case BOARD_PAGE_ATLA_VILLAGE + 3:
1680 case BOARD_PAGE_ATLA_VILLAGE + 4:
1681 case BOARD_PAGE_ATLA_VILLAGE + 5:
1689void DrawPersonalBoard(
int x,
int y,
int board_mode,
int alpha,
int unused) {
1690 int max = PersonalRetMax(board_mode);
1692 int bottom = top + 0xA0;
1693 int left = x + 0x13;
1694 int row_y = y - 0x11;
1697 row_y = row_y + 0x17 - PerBoardPt->
top_row * 40;
1698 PerBoardPt->
y += (row_y - PerBoardPt->
y) / 4.0f;
1699 row_y = PerBoardPt->
y;
1702 case PERSONAL_BOARD_ATLA:
1703 case PERSONAL_BOARD_ITEM:
1704 MenuTextureReload(PerBoardTex->
block);
1710 switch (board_mode) {
1711 case BOARD_PAGE_WEAPON:
1716 DrawPerBoardDraw(mark, max, left, row_y, top, bottom, PerBoardTex, alpha);
1719 case PERSONAL_BOARD_ATLA:
1720 MenuTextureReload(PerBoardTex->
block);
1722 case PERSONAL_BOARD_ITEM:
1723 MenuTextureReload(ItemMenuWeaponIconReadBlock);
1727 CommonIconDraw(board_mode, max, left + 2, row_y + 6, top, bottom, alpha);
1728 MenuTextureReload(PerBoardTex->
block);
1729 PersonalBoardOptionDraw(board_mode, max, x, y, PerBoardTex, alpha);
1739static void DrawNowEquipWeaponMark(
int x,
int y,
int top,
int bottom,
int alpha) {
1744 MenuTextureClip(position, v, length, top, bottom);
1746 if (position + length < top || bottom <= position) {
1750 MenuTextureReload(PerBoardTex->
block);
1751 DrawMenu2DSprite(PerBoardTex,
CRect_i_(x, position, 0x28, length),
CRect_i_(0x114, v, 0x28, length), alpha);
1754void CommonIconDraw(
int page,
int count,
int x,
int y,
int top,
int bottom,
int alpha) {
1757 int weapon_x = x + 4;
1762 case BOARD_PAGE_ATTACH: {
1763 if (PerBoardPt->
menu_kind == PERSONAL_BOARD_WEAPON_ATTACH) {
1764 MenuTextureReload(MenuShadowReadBlock);
1766 icon = TexManager.GetTexture(
"wepicon", -1);
1769 MenuTextureReload(icon->
block);
1777 for (
int i = 0; i < count; i++) {
1778 int id = attach[i].item_no;
1780 if (
id >= ITEM_ATTACH_STAT_START &&
id < ITEM_ATTACH_GEM_START) {
1781 value = attach[i].status[
id - ITEM_ATTACH_STAT_START];
1784 if (
id == ITEM_ATTACH_SYNTHESIS_SPHERE) {
1785 value = attach[i].sphere_weapon_no;
1788 DrawIconParts(
id, draw_x, draw_y, top, bottom, alpha, value);
1799 case BOARD_PAGE_ITEM: {
1804 s16 *items = pack->
item;
1807 for (slot = 0; slot < 3; slot++) {
1811 for (
int i = 0; i < count; i++) {
1812 DrawIconParts(items[i], draw_x, draw_y, top, bottom, alpha, 0);
1814 if (MenuTrushMark[i] != 0) {
1815 DrawDontSetItemMark(draw_x, draw_y, top, bottom, alpha);
1828 case BOARD_PAGE_WEAPON: {
1834 icon = TexManager.GetTexture(
"wepicon", -1);
1837 MenuTextureReload(icon->
block);
1844 for (
int i = 0; i < count; i++) {
1846 item_no = weapons[slot].
item_no;
1849 if (party >= i / 10 + 1 && equipped >= 0 && slot == equipped) {
1850 DrawNowEquipWeaponMark(draw_x - 2, draw_y - 4, top + 1, bottom, alpha);
1853 MenuTextureReload(icon->
block);
1857 DrawIconParts(item_no, draw_x, draw_y, top, bottom, alpha, 0);
1864 if (i != 0 && slot == 9) {
1874 case BOARD_PAGE_ATLA_VILLAGE:
1875 case BOARD_PAGE_ATLA_VILLAGE + 1:
1876 case BOARD_PAGE_ATLA_VILLAGE + 2:
1877 case BOARD_PAGE_ATLA_VILLAGE + 3:
1878 case BOARD_PAGE_ATLA_VILLAGE + 4:
1879 case BOARD_PAGE_ATLA_VILLAGE + 5: {
1880 int left = weapon_x - 2;
1883 for (
int i = 0; i < 120; i++) {
1884 DrawAtoraParts(draw_x, draw_y, PerBoardPt->
atla_elements[i], top, bottom - 4, alpha);
1898void PersonalBoardDrawWaku(
int x,
int y,
CTexture *texture,
int alpha) {
1899 DrawMenu2DSprite(texture,
CRect_i_(x, y + 1, 0x14, 0xBF),
CRect_i_(0, 0, 0x14, 0xC0), alpha);
1900 DrawMenu2DSprite(texture,
CRect_i_(x + 0x14, y + 1, 0xC8, 0x13),
CRect_i_(0x14, 0, 0xC8, 0x14), alpha);
1901 DrawMenu2DSprite(texture,
CRect_i_(x + 0xDC, y + 1, 0x24, 0xBF),
CRect_i_(0xDC, 0, 0x24, 0xC0), alpha);
1902 DrawMenu2DSprite(texture,
CRect_i_(x + 0x14, y + 0xA1, 0xC8, 0x1F),
CRect_i_(0x14, 0xA0, 0xC8, 0x20), alpha);
1905void PersonalBoardOptionDraw(
int board_mode,
int count,
int x,
int y,
CTexture *texture,
int alpha) {
1906 PersonalBoardTagDraw(board_mode, x, y, texture, 0, alpha);
1907 PersonalBoardDrawWaku(x, y, texture, alpha);
1908 PersonalBoardScrlBarDraw(count, x, y, PerBoardPt->
scroll, PerBoardPt->
top_row, texture, alpha);
1909 PersonalBoardMaxDraw(count, x, y, texture, alpha);
1912void PersonalBoardTagDraw(
int tag,
int x,
int y,
CTexture *texture,
int shift,
int alpha) {
1918 case PERSONAL_BOARD_WEAPON_ATTACH:
1920 case PERSONAL_BOARD_ITEM:
1921 for (
int kind = 0, i = 0; i < 3; i++, kind++) {
1925 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, top + 2, 0x100, 0x2F),
CRect_i_(0x100, row, 0x100, 0x30), bright, bright, bright, alpha);
1931 DrawMenu2DSprite(texture,
CRect_i_(x, top + 2, 0x100, 0x2F),
CRect_i_(0x100, row, 0x100, 0x30), alpha);
1932 x = x + 0x12 + tag * 0x44;
1944 s8 sources[7][3] = {
1953 s8 offsets[7][3] = {
1962 int lang = GetMenuLangFlag();
1963 int width = widths[lang][tag];
1964 int source = sources[lang][tag];
1966 x += offsets[lang][tag];
1970 DrawMenu2DSprite(texture,
CRect_i_(x, top + 1, width, 0x1B),
CRect_i_(source, 0xC0, width, 0x1C), alpha);
1974 case PERSONAL_BOARD_ATLA:
1975 if (VillageBar != NULL) {
1976 MenuTextureReload(VillageBar->
block);
1979 int max_village = GetAtoraMaxVillage();
1988 if (max_village < village) {
1989 village = max_village;
1992 if (village == tag) {
1993 if (step == 1 && village == max_village) {
1995 }
else if (step == -1) {
1997 }
else if (step == 1) {
1999 village = max_village;
2003 int index = village - 3;
2004 int left = x + index * 0x1A;
2007 DrawMenu2DSprite(VillageBar,
CRect_i_(x, y - 0x12, 0x100, 0x13),
CRect_i_(0, 0x90, 0x100, 0x14), alpha);
2011 int column = (index % 2) * 0x60;
2012 row = (index >> 1) * 0x30;
2013 set2DSprite(GetVif1Packet(), VillageBar,
CRect_i_(left, top + 2, 0x60, 0x2F),
CRect_i_(column, row, 0x60, 0x30), bright, bright, bright, alpha);
2025 row = (tag - 3) * 0x28;
2026 DrawMenu2DSprite(VillageName,
CRect_i_(x, top + 1, 0x100, 0x27),
CRect_i_(0, row, 0x100, 0x28), alpha);
2033void PersonalBoardScrlBarDraw(
int count,
int x,
int y,
float &scroll,
unsigned char top_row,
CTexture *texture,
int alpha) {
2034 int bar_x = x + 0xE8;
2035 int rows = count / 5;
2041 int length = (int) (456.0f / rows - 8.0f);
2043 if (114.0f < (
float) length) {
2048 float bar_y = (float) (y + 0x16) + 114.0f * top_row / rows;
2049 bar_y = scroll + (bar_y - scroll) / 4.0f;
2051 DrawMenu2DSprite(texture,
CRect_i_(bar_x, (
int) bar_y, 8, 4), source, alpha);
2053 DrawMenu2DSprite(texture,
CRect_i_(bar_x, (
int) (4.0f + bar_y), 8, length + 1), source, alpha);
2055 DrawMenu2DSprite(texture,
CRect_i_(bar_x, (
int) (4.0f + bar_y + length), 8, 4), source, alpha);
2058void PersonalBoardMaxDraw(
int num,
int x,
int y,
CTexture *texture,
int alpha) {
2059 int left = x + 0xD2;
2062 DrawMenu2DSprite(texture,
CRect_i_(left, top + 1, 0x30, 0x2F),
CRect_i_(0x100, 0x90, 0x30, 0x30), alpha);
2063 RECT digits = {0x90, 0xDC, 12, 12};
2067 if (PerBoardPt->
menu_kind == PERSONAL_BOARD_ATLA) {
2071 DrawMenuNumber(num, left, top, texture, digits, 1, alpha);
2079 switch (PerBoardPt->
page) {
2080 case BOARD_PAGE_ITEM:
2081 case BOARD_PAGE_WEAPON:
2082 case BOARD_PAGE_ATTACH:
2083 max = GetNowModeMaxNum(PerBoardPt->
page, &full);
2086 if (item >= ITEM_ATTACH_START) {
2087 int kind = WhatIsKindofItem(item);
2089 if (kind == PerBoardPt->
page) {
2099 case BOARD_PAGE_ATLA_VILLAGE:
2100 case BOARD_PAGE_ATLA_VILLAGE + 1:
2101 case BOARD_PAGE_ATLA_VILLAGE + 2:
2102 case BOARD_PAGE_ATLA_VILLAGE + 3:
2103 case BOARD_PAGE_ATLA_VILLAGE + 4:
2104 case BOARD_PAGE_ATLA_VILLAGE + 5:
2105 for (
int i = 0; i < num; i++) {
2122 DrawMenuNumber(max, left, top, texture, digits, 1, alpha);
2132static void DrawPersonalBoardBase(
int x,
int y,
int top,
int bottom,
int count,
CTexture *texture,
int alpha) {
2140 if (y < top - 39 || y > bottom - 1) {
2146 MenuTextureClip(y, v, length, top, bottom);
2148 upper.
r = upper.
g = upper.
b = 0x80;
2149 lower.
r = lower.
g = lower.
b = 0x80 - step;
2153 for (i = 0; i < count; i++) {
2154 set2DSprite(GetVif1Packet(), texture,
CRect_i_(x, y, 0x28, length),
CRect_i_(0x20, v, 0x28, length), &upper, &lower, &upper, &lower, 1);
2155 upper.
r = upper.
g = upper.
b = lower.
r;
2156 lower.
r = lower.
g = lower.
b = lower.
r - step;
2162void DrawPerBoardDraw(
int mark,
int count,
int x,
int y,
int top,
int bottom,
CTexture *texture,
int alpha) {
2166 for (
int row = 0; row < 26; row++) {
2167 DrawPersonalBoardBase(board_x, row_y, top, bottom, 5, texture, alpha);
2180 if (row % 2 == 0 && row != 0) {
2187 if (draw_mark != 0) {
2189 int mark_y = row_y - 8;
2193 if (top <= mark_y + 0x10 && mark_y < bottom) {
2194 MenuTextureClip(mark_y, v, height, top, bottom);
2198 left.
r = left.
g = left.
b = 0x80;
2199 right.
r = right.
g = right.
b = 0x80 - step;
2203 for (
int i = 0; i < 5; i++) {
2204 set2DSprite(GetVif1Packet(), texture,
CRect_i_(mark_x, mark_y, 0x28, height),
CRect_i_(0x20, v, 0x28, height), &left, &right, &left, &right, 1);
2205 left.
r = left.
g = left.
b = right.
r;
2206 right.
r = right.
g = right.
b = right.
r - step;
2215 if (bottom < row_y) {
2228void CommonTrushDraw(
int x,
int y,
int alpha) {
2231 CRect_i_ source(0x190, 0x90, 0x30, 0x30);
2232 CRect_i_ dest(x, y + 1, 0x30, 0x2F);
2234 switch (trash->
anim) {
2236 int frame = trash->
frame;
2238 if (frame <= 3 || frame > 12) {
2240 }
else if (frame > 6 && frame <= 9) {
2244 DrawMenu2DSprite(PerBoardTex, dest, source, alpha);
2255 if (board->
cursor_area == PERSONAL_BOARD_AREA_TRASH) {
2259 DrawMenu2DSprite(PerBoardTex, dest, source, alpha);
2264int IsEnableTrushThrow(
int item_no) {
2267 if (item_no >= ITEM_WEAPON_START) {
2268 int owner = WhoIsWeaponEquip(item_no);
2271 int default_no = GetDefaultWeaponNo(owner);
2273 for (
int i = 0; i < 11; i++) {
2274 int weapon_no = weapons[i].
item_no;
2276 if (weapon_no == default_no || weapon_no == default_no + 1) {
2282 if (PerBoardStatusPt->
party_size - 1 < owner) {
2286 if (item_no == ITEM_WEAPON_SERPENT_SWORD) {
2287 int flag = GetMenuHebikiriFlag();
2299 if (item_no >= ITEM_ATTACH_START && item_no < ITEM_WEAPON_START) {
2303 switch (info->
kind) {
2304 case ITEMKIND_ATTACH:
2305 if (GetAttachData(item_no) != NULL) {
2310 case ITEMKIND_ITEM: {
2330void CommonMoneyBoardDraw(
int x,
int y,
int money,
int alpha) {
2333 DrawMenu2DSprite(PerBoardTex,
CRect_i_(x, top, 0x1A, 0x1B),
CRect_i_(0x160, 0xC0, 0x1A, 0x1C), alpha);
2334 DrawMenu2DSprite(PerBoardTex,
CRect_i_(x + 0x1A, top, 0x2A, 0x1B),
CRect_i_(0x17A, 0xC0, 0x20, 0x1C), alpha);
2335 DrawMenu2DSprite(PerBoardTex,
CRect_i_(x + 0x44, top, 0x1A, 0x1B),
CRect_i_(0x19A, 0xC0, 0x1A, 0x1C), alpha);
2336 RECT digits = {0, 0xDC, 12, 12};
2337 DrawMenuNumber(money, x + 0x55, y + 8, PerBoardTex, digits, 0, alpha);
2340int SearchBoardNowPosItemExist(
int page,
int cell) {
2344 case BOARD_PAGE_ITEM: {
2348 item_no = pack->
item[cell];
2353 case BOARD_PAGE_WEAPON: {
2354 int chara = cell / 10;
2355 int slot = cell % 10;
2360 if (weapon != NULL) {
2366 case BOARD_PAGE_ATTACH: {
2369 if (items != NULL) {
2370 item_no = items[cell].
id;
2380int GetBoardSpace(
int item_no,
int *page) {
2383 if (item_no < ITEM_ATTACH_START) {
2387 *page = WhatIsKindofItem(item_no);
2388 int max = PersonalRetMax(*page);
2391 case BOARD_PAGE_ITEM: {
2397 for (i = 0; i < 3; i++) {
2401 for (i = 0; i < max - quick; i++) {
2402 if (pack->
item[i] < ITEM_DUNGEON_START && MenuTrushMark[i] == 0) {
2410 case BOARD_PAGE_WEAPON: {
2411 int owner = WhoIsWeaponEquip(item_no);
2416 for (i = 0; i < 10; i++) {
2417 if (weapons[i].item_no < ITEM_WEAPON_START) {
2418 space = i + owner * 10;
2425 case BOARD_PAGE_ATTACH: {
2429 for (i = 0; i < max; i++) {
2431 if (items[i].
id < ITEM_ATTACH_START) {
2444void SwapItem(
ITEM_PACK *items,
int first_pos,
int second_pos) {
2445 s16 item = items->
item[first_pos];
2446 s16 vol = items->
item_vol[first_pos];
2448 items->
item[first_pos] = items->
item[second_pos];
2450 items->
item[second_pos] = item;
2455static int sort_table[9] = {9, 0, 1, 2, 3, 4, 5, 6, 7};
2457int CompItem(
int first_item_no,
int second_item_no) {
2458 ITEM_DATA *first = GetItemData(first_item_no);
2459 ITEM_DATA *second = GetItemData(second_item_no);
2461 int second_rank = 0;
2463 if (first != NULL) {
2464 first_rank = sort_table[first->
sort_key];
2467 if (second != NULL) {
2468 second_rank = sort_table[second->
sort_key];
2471 if (first_item_no < ITEM_DUNGEON_START) {
2475 if (second_item_no < ITEM_DUNGEON_START) {
2479 if (first_rank > second_rank) {
2483 if (first_rank < second_rank) {
2487 if (first_item_no > second_item_no) {
2491 if (first_item_no < second_item_no) {
2501int SeitonItemBoardSub(
ITEM_PACK *items) {
2504 int type = sort_top_type;
2508 sort_table[type] = i;
2519 for (i = 0; i < items->
num - 1; i++) {
2520 for (j = i + 1; j < items->
num; j++) {
2521 if (CompItem(items->
item[i], items->
item[j]) > 0) {
2522 SwapItem(items, i, j);
2532 if (items != NULL) {
2534 if (SeitonItemBoardSub(items) != 0) {
2547int GetAttachKind(
int item_no) {
2548 if ((item_no >= ITEM_ATTACH_START) && (item_no < ITEM_ATTACH_ATTACK)) {
2552 if ((item_no >= ITEM_ATTACH_ATTACK) && (item_no < ITEM_ATTACH_AMETHYST)) {
2556 if ((item_no >= ITEM_ATTACH_AMETHYST) && (item_no < ITEM_ATTACH_GEM_END)) {
2560 if ((item_no >= ITEM_ATTACH_DINOSLAYER) && (item_no <= ITEM_ATTACH_SLAYER_END)) {
2568static int asort_table[5] = {5, 1, 2, 3, 4};
2571 int first_rank = asort_table[GetAttachKind(first->
item_no)];
2572 int second_rank = asort_table[GetAttachKind(second->
item_no)];
2574 if (first->
item_no < ITEM_ATTACH_START) {
2578 if (second->
item_no < ITEM_ATTACH_START) {
2582 if (first_rank > second_rank) {
2586 if (first_rank < second_rank) {
2602static int asort_top_type = 1;
2604int SeitonAttachBoardSub(
ATTACH_LIST *attachments) {
2607 int type = asort_top_type;
2610 for (i = 0; i < 5; i++) {
2611 asort_table[type] = i;
2622 for (i = 0; i < 39; i++) {
2623 for (j = i + 1; j < 40; j++) {
2624 if (CompAttach(&attachments[i], &attachments[j]) > 0) {
2625 MenuDataSwap(&attachments[i], &attachments[j]);
2635 if (attachments == NULL) {
2639 for (
int i = 0; i < 5; i++) {
2640 if (SeitonAttachBoardSub(attachments) != 0) {
2646 if (asort_top_type >= 5) {
2653int WhatIsKindofItem(
int item_no) {
2657 return BOARD_PAGE_NONE;
2660 int board_kind[3] = {BOARD_PAGE_ATTACH, BOARD_PAGE_ITEM, BOARD_PAGE_WEAPON};
2661 return board_kind[info->
kind];
2664int WhoIsWeaponEquip(
int weapon_no) {
2668 info = GetCommonItemInfo(weapon_no);
2674 if (info->
kind != ITEMKIND_WEAPON) {
2678 data = GetWeaponDataInfo((s32) info->
index);
2681 return (s8) data->
owner;
2687int GetWeaponHoleNum(
int weapon_no) {
2694 if (info->
kind != ITEMKIND_WEAPON) {
2706 for (
int i = 0; i <= 5; i++) {
2707 if (data->
hole[i] > 0) {
2718 if (weapon == NULL) {
2725 for (
int i = 0; i < 6; i++) {
2736 if (weapon == NULL) {
2746 int experience = *(s8 *) &data->
exp_base;
2748 for (
int i = 0; i < weapon->
level; i++) {
2752 if (experience > 999) {
2756 if (experience <= 0) {
2763int GetNowItemNum(
short item_no,
ITEM_PACK *items) {
2768 for (i = 0; i < items->
num; i++) {
2769 if (items->
item[i] == item_no) {
2774 for (j = 0; j < 3; j++) {
2783void DeleteItemAfterUseItem(
short item_no,
ITEM_PACK *items) {
2787 for (i = 0; i < items->
num; i++) {
2788 if (items->
item[i] == item_no) {
2789 items->
item[i] = -1;
2796 for (i = 0; i < 3; i++) {
2810int GetNowModeMaxNum(
int page,
int *overflow) {
2815 case BOARD_PAGE_ITEM: {
2821 for (i = 0; i < (num = pack->
num) + 3; i++) {
2822 if (pack->
item[i] >= ITEM_DUNGEON_START) {
2827 for (j = 0; j < 3; j++) {
2833 if (overflow != NULL && num < count) {
2839 case BOARD_PAGE_WEAPON:
2840 for (
int chara = 0; chara < 6; chara++) {
2844 for (i = 0; i < 11; i++) {
2845 if (weapons[i].item_no >= ITEM_WEAPON_START) {
2848 if (i == 10 && overflow != NULL) {
2849 *overflow = chara + 1;
2856 case BOARD_PAGE_ATTACH:
2860 for (i = 0; i < 43; i++) {
2861 if (items[i].
id >= ITEM_ATTACH_START) {
2866 if (overflow != NULL && count > 40) {
2877void WepDataListToHaveCopy(
int weapon_no,
WEAPON_HAVE *weapon) {
2884 if (weapon != NULL && weapon_no > 0) {
2885 if (weapon_no < ITEM_ATTACH_START) {
2889 data = GetWeaponData(weapon_no);
2901 for (i = 0; i < 5; i++) {
2904 if (weapon->
elem[i] > best_value) {
2905 best_value = weapon->
elem[i];
2912 for (j = 0; j < 10; j++) {
2918 if (IsDefaultWeapon(weapon->
item_no) < 0) {
2919 int chance = rand() % 1000;
2921 if (chance < 1000) {
2934void AttachDataListToHaveCopy(
int attachment_no,
ATTACH_LIST *attachment) {
2935 if ((attachment_no < ITEM_ATTACH_START) || (attachment_no >= ITEM_DUNGEON_START)) {
2939 if (attachment != NULL) {
2940 memcpy(attachment, GetAttachData(attachment_no), 0x20U);
2944int ItemDataToHaveCopy(
int item_no) {
2947 if (item_no < ITEM_DUNGEON_START || item_no > ITEM_WEAPON_START - 1) {
2959 if (item_no == ITEM_DRAN_S_FEATHER) {
2960 int angle = rand() % 360;
2969 if (item_no >= ITEM_ANTI_FREEZE_AMULET && item_no <= ITEM_ANTIDOTE_AMULET) {
2970 vol = rand() % 5 + 3;
2973 printf(
"vol = %d\n", vol);
2977void DrawFullSizePicture(
CTexture *texture,
int x,
int y,
int alpha) {
2978 if (texture != NULL) {
2981 DrawMenu2DSprite(texture, rect,
CRect_i_(0, 0, 640, 448), alpha);
2983 DrawMenu2DSprite(texture,
CRect_i_(x, y, MenuDispRc.
width, MenuDispRc.
height), MenuDispRc, alpha);
virtual void Step(int steps)
void GetCameraMatrix(float(*matrix)[4])
void SetRef(CFrame *parent, float x, float y, float z)
void SetPos(CFrame *parent, float x, float y, float z)
CDngStatusData * GetDngStatus()
int QuestDungeon(int dungeon_no, int add)
int VisitMap(int map_no, int add)
DNG_CONSUMABLE consumable_items[43]
WEAPON_HAVE chara_weapons[6][11]
s8 equipped_weapon_slot[6]
void NeedMesWinWH(int mes_no, int *out)
void SetBuff(short *buff)
MES_LINE_POS line_pos[10]
void SetBuff_system(short *buff)
DNG_CONSUMABLE * consumables