1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 639
5#include "menu_dungeon.hpp"
12#include "battlemenu.hpp"
13#include "btactstatus.hpp"
17#include "dataalloc.hpp"
19#include "debugfont.hpp"
20#include "dun/gameloop.hpp"
21#include "editatra.hpp"
24#include "mainitemmodel.hpp"
25#include "mainselect.hpp"
28#include "memorycardaccess.hpp"
29#include "menu_inventory.hpp"
30#include "menu_misc.hpp"
32#include "menuitemstep.hpp"
36#include "shot_freefuncs.hpp"
39#include "userstatus.hpp"
46 CHARA_CHANGE_SELECT = 0,
47 CHARA_CHANGE_TURNING = 1,
48 CHARA_CHANGE_ITEM_PROMPT = 2,
49 CHARA_CHANGE_BLOCKED = 3,
50 CHARA_CHANGE_UNK_4 = 4,
51 CHARA_CHANGE_LOADING = 5,
52 CHARA_CHANGE_LOADED = 6,
53 CHARA_CHANGE_UNK_7 = 7,
100static int maxFloorTbl__4[7] = {15, 17, 18, 18, 15, 25, 100};
109static int DunEnterMenuKey();
118static void DunEnterDraw();
127static void DunEnterBoard(
int x,
int y,
int alpha);
136static void DrawGetAtoraNumBoard(
int floor,
int x,
int y,
int top,
int bottom,
int alpha);
145static void DrawDunNumberClip(
int x,
int y,
int top,
int bottom,
int digit,
int alpha);
154static void DrawDunEnterBack(
int alpha);
163static void DrawDunEnterFloorName(
int x,
int y,
int floor,
int top,
int bottom,
int alpha);
172static void DrawItemDataView(
int item_no);
184 for (i = 0; i < 4; i++) {
188 for (i = 0; i < 5; i++) {
189 base->
elem[i] += add->
elem[i] * scale;
192 for (i = 0; i < 10; i++) {
197int GetWeaponAttachStatusUp(
WEAPON_HAVE *weapon,
int stat) {
201 if (GetWeaponData(weapon->
item_no) == NULL || weapon->
item_no < ITEM_WEAPON_START) {
207 for (i = 0; i < 6; i++) {
221 total += attach->
status[stat - 1] * multiplier;
222 }
else if (stat >= 8 && stat < 0xD) {
223 total += attach->
elem[stat - 8] * multiplier;
225 total += attach->
vs_monster[stat - 14] * multiplier;
233 if (result == NULL) {
239 if (dng_status == NULL) {
240 printf(
"cdng is NULL!!!!\n");
249 if (equipped == NULL) {
250 printf(
"actwep is NULL\n", chara);
254 WeaponAllValueSet(equipped, result, 0);
267 data = GetWeaponData(weapon->
item_no);
273 attaches = weapon->
attach;
275 rate = GetNowWeaponRate(weapon);
282 flags |= weapon->
flags;
285 for (i = 0; i < GetWeaponHoleNum(weapon->
item_no); i++) {
286 if (data->
hole[i] <= 0) {
296 PlusAttachmentVolume(&total, &attaches[i], scale);
298 if (attaches[i].item_no == ITEM_ATTACH_SYNTHESIS_SPHERE && attaches[i].sphere_flags != 0 && attaches[i].sphere_flags != 1) {
303 result->
flags = CheckWeaponOptionStatus(flags);
310 if (limit[0] < value) {
311 result->
attack = limit[0];
319 if (limit[1] < value) {
328 if (value >= limit[2]) {
329 result->
speed = limit[2];
331 result->
speed = value;
337 if (limit[3] < value) {
338 result->
magic = limit[3];
340 result->
magic = value;
343 for (i = 0; i < 5; i++) {
344 value = result->
elem[i] + total.
elem[i];
348 result->
elem[i] = 99;
350 result->
elem[i] = value;
354 for (i = 0; i < 10; i++) {
366int SetAttachMentValue(
int item_no,
int slot,
short level,
ATTACH_LIST *unused) {
372 if (item_no < ITEM_ATTACH_START || item_no >= ITEM_DUNGEON_START) {
379 data = GetAttachData(item_no);
382 if (held_no < ITEM_ATTACH_START || held_no >= ITEM_DUNGEON_START) {
398 if (held_no >= ITEM_ATTACH_ATTACK && held_no <= ITEM_ATTACH_MAGICAL_POWER) {
399 attach->
status[held_no - ITEM_ATTACH_ATTACK] += level;
408 if (attach == NULL) {
414 if (attach->
item_no >= ITEM_ATTACH_STAT_START && attach->
item_no < ITEM_ATTACH_GEM_START) {
415 volume = attach->
status[attach->
item_no - ITEM_ATTACH_STAT_START];
418 if (attach->
item_no == ITEM_ATTACH_SYNTHESIS_SPHERE) {
425int InitDunEnterMenu(
int texture_block,
int dungeon,
int requested_floor) {
440 buffer = (u_long128 *) read_buffer;
441 buffer = MenuCalcBufAlignment(buffer);
443 GetPathReadDifferntLang(path);
444 strcat(path,
"dunenter/dunenter%d.pak");
445 sprintf(path, path, DEnterMenu.
dungeon);
446 LoadFileBG(path, buffer, &size);
453 DEnterMenu.
state = DUN_ENTER_FADE_IN;
456 if (requested_floor >= 0) {
457 DEnterMenu.
state = DUN_ENTER_DIRECT;
465 if (floor >= maxFloorTbl__4[dungeon]) {
466 floor = maxFloorTbl__4[dungeon] - 1;
469 printf(
"maxfloor = %d\n", floor);
478 for (floor = 0; floor < maxFloorTbl__4[dungeon]; floor++) {
481 DEnterMenu.
kills[floor] = DEnterStatusPt->
ChkKills(dungeon, floor);
483 if (DEnterMenu.
kills[floor] > 999) {
484 DEnterMenu.
kills[floor] = 999;
495 if (first_open > -1) {
509 printf(
"DEnterMenu.topline = %d\n", DEnterMenu.
scroll_top);
518 GamePad.
SetAutoRepeat(PAD_L2 | PAD_R2 | PAD_L1 | PAD_R1 | PAD_DPAD, 30, 5);
530static void ExitDunEnterMenu() {
534 DngActiveItemTextureCopy();
535 DngActiveWeaponTextureCopy();
539int DunEnterMenuLoop() {
542 int result = DunEnterMenuKey();
549 result = DEnterMenu.
result;
555static int DunEnterMenuKey() {
564 switch (DEnterMenu.
state) {
565 case DUN_ENTER_FADE_IN:
566 case DUN_ENTER_DIRECT:
569 {(
char *)
"#frame_menu_enter#640#" SCREEN_HEIGHT_STR
"#4", DEnterMenu.
texture_block, 0},
573 archive = GetReadBGFile(0);
574 textures[1].
name = (
char *) GetPackFile((u_int *) archive->
buffer, (
char *)
"dunenter.img", NULL);
576 TexManager.CleanUpTextureList();
577 TexManager.LoadTextureBlockEX(-1, textures);
578 DunLogBoard = TexManager.GetTexture(
"dunenter", DEnterMenu.
texture_block);
579 DunLogBoard2 = TexManager.GetTexture(
"kaisou", DEnterMenu.
texture_block);
580 InitMenuMesSet(MENU_MES_SET_DUNGEON_ENTER, (
short *) GetPackFile((u_int *) archive->
buffer, (
char *)
"dunlog.bin", NULL));
585 printf(
"tex enter end \n");
595 DEnterMenu.
state = DUN_ENTER_SELECT;
599 DEnterMenu.
state = DUN_ENTER_FADE_OUT;
606 case DUN_ENTER_FADE_OUT:
614 case DUN_ENTER_SELECT:
618 if (GamePad.
Down(PAD_UP)) {
624 }
else if (GamePad.
Down(PAD_DOWN)) {
630 }
else if (GamePad.
Down(PAD_R2 | PAD_R1 | PAD_RIGHT)) {
633 }
else if (GamePad.
Down(PAD_L2 | PAD_L1 | PAD_LEFT)) {
654 if (GamePad.
Down2(PAD_R1)) {
655 int max_floor = maxFloorTbl__4[DEnterMenu.
dungeon];
658 for (
int floor = 0; floor < DEnterMenu.
floor_count; floor++) {
663 ComMenuSePlay(MENU_SOUND_CONFIRM);
666 if (GamePad.
On2(PAD_CROSS)) {
672 if (GamePad.
On2(PAD_CIRCLE)) {
705 if (abs(DEnterMenu.
scroll_top - scroll_top) > 4) {
711 ComMenuSePlay(MENU_SOUND_CURSOR);
714 if (GamePad.
Down(PAD_CROSS)) {
716 DEnterMenu.
state = DUN_ENTER_FADE_OUT;
717 ComMenuSePlay(MENU_SOUND_CONFIRM);
720 if (GamePad.
Down(PAD_CIRCLE)) {
721 ComMenuSePlay(MENU_SOUND_REFUSE);
730static void DunEnterDraw() {
743 CRect_i_ screen(0, 0, 0x2800, (SCREEN_HEIGHT << 4));
747 switch (DEnterMenu.
state) {
748 case DUN_ENTER_FADE_IN:
771 DrawDunEnterBack(alpha);
772 DunEnterBoard(0x46, 0x5A, alpha);
775 if (CursorVibeCnt > 0x107AC0) {
779 if (DEnterMenu.
state == DUN_ENTER_SELECT) {
781 static int DunWakuCnt;
789 wave = 0.2f * DunWakuCnt;
791 top = cursor_y + wave;
792 right = 204.0f - wave;
793 bottom = (cursor_y + 0x18) - wave;
794 RECT corner = {0x40, 0x60, 0x10, 0x10};
801 if (DunWakuCnt < 0 || DunWakuCnt >= 30) {
805 CRect_i_ cursor(0x20, 0x60, 0x20, 0x20);
806 DrawObjectVibe(0x49, cursor_y + 2, DunLogBoard, cursor, 0, alpha);
807 DrawObjectVibe(0x46, cursor_y, DunLogBoard, cursor, 0x80, alpha);
810 MenuTextureReload(CommonMenuMes2.
tex_block);
814 CommonMenuMes2.
text_y = 0x16c;
816 CommonMenuMes2.
text_y = 0x158;
819 GetMenuCommonPutXY(&CommonMenuMes2, 0x148 - half_width);
820 CommonMenuMes2.
Step();
823 MGFillBox(screen, 0, 0, 0, 0x80);
828 switch (DEnterMenu.
state) {
829 case DUN_ENTER_FADE_IN:
830 cover = 0x80 - DEnterMenu.
counter * 6;
832 case DUN_ENTER_FADE_OUT:
833 cover = DEnterMenu.
counter * 9;
845 switch (DEnterMenu.
state) {
846 case DUN_ENTER_FADE_IN:
847 case DUN_ENTER_FADE_OUT:
848 MGFillBox(screen, 0, 0, 0, cover);
862static void DunEnterBoardWaku(
int x,
int y,
int alpha) {
872 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x, y - 1, 0x20, 0xFA),
CRect_i_(0, 0, 0x20, 0xF8), alpha);
873 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x + 0x20, y, 0x1CC, 0x20),
CRect_i_(0x20, 0, 0x1B8, 0x20), alpha);
874 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x + 0x1EC, y - 1, 0x28, 0xFA),
CRect_i_(0x1D8, 0, 0x28, 0xF8), alpha);
875 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x + 0x20, y + 0xD9, 0x1CC, 0x20),
CRect_i_(0x20, 0xD8, 0x1B8, 0x20), alpha);
886 height = (int) (540.0f / count);
888 while (y + 0x98 < draw_y + (height + 8)) {
892 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, draw_y, 8, 4),
CRect_i_(0x60, 0x60, 8, 4), alpha);
893 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, draw_y + 4, 8, height),
CRect_i_(0x60, 0x64, 8, 4), alpha);
894 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, draw_y + height + 4, 8, 4),
CRect_i_(0x60, 0x68, 8, 4), alpha);
906 v = (icon % 3) * 40 + 0x100;
909 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, draw_y, 0x80, 0x23),
CRect_i_(0x20, 0x80, 0x80, 0x24), alpha);
910 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x + 0x80, draw_y, 0x80, 0x23),
CRect_i_(0x20, 0xA4, 0x80, 0x24), alpha);
912 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, draw_y, 0x100, 0x28),
CRect_i_(u, v, 0x100, 0x28), alpha);
919static void DunEnterBoard(
int x,
int y,
int alpha) {
940 int target = y + 0x1C - DEnterMenu.
scroll_top * 40;
941 int step = (int) ((
float) target - DEnterMenu.
list_y);
942 DEnterMenu.
list_y += step >> 2;
945 DEnterMenu.
list_y = target;
948 row_y = (int) DEnterMenu.
list_y;
950 CRect_i_ rule_source(0x20, 0x20, 0x28, 7);
951 dim = (alpha * 80) >> 7;
952 rule_x = (int) (32.0f + lane);
955 DrawMenu2DSprite(DunLogBoard,
CRect_i_(rule_x - 10, 0x73, 10, 3), rule_source, dim);
957 for (
int segment = 0; segment < 11; segment++) {
958 DrawMenu2DSprite(DunLogBoard,
CRect_i_(rule_x, 0x73, 0x28, 3), rule_source, dim);
962 DrawMenu2DSprite(DunLogBoard,
CRect_i_(rule_x, 0x73, 10, 3), rule_source, dim);
973 for (i = 0; i < 100; i++) {
976 int position = row_y;
979 if (!(row_y < bottom)) {
983 if (row_y + 0x28 <= top) {
988 MenuTextureClip(position, source, length, top, bottom);
989 CRect_i_ edge_source(0x20, source, 10, length);
990 DrawMenu2DSprite(DunLogBoard,
CRect_i_((
int) (lane - 10.0f), position, 10, length), edge_source, dim);
992 for (
int segment = 0; segment < 12; segment++) {
993 DrawMenu2DSprite(DunLogBoard,
CRect_i_((
int) lane, position, 0x28, length),
CRect_i_(0x20, source, 0x28, length), dim);
997 DrawMenu2DSprite(DunLogBoard,
CRect_i_((
int) lane, position, 10, length), edge_source, dim);
1004 position = row_y + 4;
1005 DrawDunEnterFloorName(column_x, position, i + 1, top, bottom, alpha);
1006 int dungeon = DEnterMenu.
dungeon;
1007 int max_floor = maxFloorTbl__4[dungeon];
1009 if (i == max_floor - 1) {
1010 int unused[6] = {20, 0, 30, 60, 20, 16};
1011 int draw_x = column_x + 0x82;
1012 position = row_y + 6;
1014 source = dungeon * 24 + 0x20;
1015 MenuTextureClip(position, source, length, top, bottom);
1017 if (position < bottom) {
1018 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, position, 0xDC, length),
CRect_i_(0xFC, source, 0xDC, length), alpha);
1020 }
else if (dungeon < 6) {
1021 int draw_x = column_x + 0x72;
1025 MenuTextureClip(position, source, length, top - 10, bottom);
1027 if (position < bottom) {
1030 for (
int mark = 0; mark < remaining; mark++) {
1031 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, position, 0x20, length),
CRect_i_(0x48, source, 0x20, length), alpha);
1035 for (
int mark = 0; mark < (u8) DEnterMenu.
collected_atra[i]; mark++) {
1036 DrawMenu2DSprite(DunLogBoard,
CRect_i_(draw_x, position, 0x20, length),
CRect_i_(0x68, source, 0x20, length), alpha);
1045 MenuTextureReload(DunLogBoard->
block);
1046 row_y = (int) DEnterMenu.
list_y;
1049 for (
int floor = 0; floor < 100; floor++) {
1050 if (floor == maxFloorTbl__4[DEnterMenu.
dungeon] - 1) {
1058 int board_x = x + 0x16E;
1060 if (row_y < bottom) {
1061 DrawGetAtoraNumBoard(floor, board_x, row_y, top, bottom, alpha);
1067 DunEnterBoardWaku(x, y, alpha);
1077static void DrawEnemyNum(
int x,
int y,
int top,
int bottom,
int number,
int alpha) {
1085 for (digits = GetNumberKeta(number); 0 < digits; digits--) {
1087 digit = number % 10;
1089 u = digit * 12 + 0x20;
1092 MenuTextureClip(position, source, length, top, bottom);
1093 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x, position, 12, length - 1),
CRect_i_(u, source, 12, length), alpha);
1101static inline int KillCountX(
int x) {
1105static void DrawGetAtoraNumBoard(
int floor,
int x,
int y,
int top,
int bottom,
int alpha) {
1110 if (!(top < y + 0x24) || bottom <= y) {
1114 MenuTextureClip(position, source, length, top, bottom);
1115 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x, position, 0x2B, length),
CRect_i_(0x88, source, 0x2B, length), alpha);
1120 if (top < position) {
1121 DrawDunNumberClip(x + 5, position, top, bottom, collected, alpha);
1124 position = y + 0x10;
1125 int maximum = (u8) DEnterMenu.
max_atra[floor];
1126 DrawDunNumberClip(x + 0x1B, position, top, bottom, maximum, alpha);
1128 int kills = DEnterMenu.
kills[floor];
1133 MenuTextureClip(position, source, length, top, bottom);
1135 if (position < bottom) {
1136 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x, position, 0x1E, length),
CRect_i_(0xB3, source, 0x1E, length), alpha);
1139 position = y + 0x10;
1141 if (position < bottom - 4) {
1142 DrawEnemyNum(x + 0x44, position, top, bottom - 6, kills, alpha);
1146static void DrawDunNumberClip(
int x,
int y,
int top,
int bottom,
int digit,
int alpha) {
1153 u = digit * 12 + 0x20;
1156 MenuTextureClip(position, source, length, top, bottom);
1158 if (position < bottom) {
1159 DrawMenu2DSprite(DunLogBoard,
CRect_i_(x, position, 12, length),
CRect_i_(u, source, 12, length), alpha);
1163static void DrawDunEnterBack(
int alpha) {
1165 DrawFullSizePicture(TexManager.GetTexture(
"frame", -1), 0, 0, 0x80);
1167 DrawMenu2DSprite(TexManager.GetTexture(
"frame", -1), MenuDispRc, MenuDispRc, 0x80);
1169 MGFillBox(
CRect_i_(0, 0, 0x2800, SCREEN_HEIGHT * 0x10), 10, 10, 10, (alpha * 4) >> 7);
1175int QuickCharaPos[2];
1180s16 CharaChangeTexBlock;
1185s16 CharaChangeReadFlag;
1190u_long128 *chara_change_buf;
1203int MDebugItemPolyViewFlag;
1206char chara_change_frame_image[] __attribute__((section(
".rodata"))) =
"#frame_image#640#" SCREEN_HEIGHT_STR
"#4";
1208static void DrawDunEnterFloorName(
int x,
int y,
int floor,
int top,
int bottom,
int alpha) {
1217 source = DEnterMenu.
dungeon * 32;
1219 if (DEnterMenu.
dungeon >= 6) {
1221 source = (DEnterMenu.
dungeon - 6) * 32;
1224 MenuTextureClip(position, source, height, top, bottom);
1226 if (position + height >= top) {
1227 DrawMenu2DSprite(DunLogBoard2,
CRect_i_(x, position, 0x70, height),
CRect_i_(u, source, 0x70, height), alpha);
1230 if (DEnterMenu.
dungeon == 5) {
1231 floor = BtGetFloorLevel(floor - 1);
1245 if (floor >= 10 && floor < 100) {
1253 if (DEnterMenu.
dungeon == 6 && GetMenuLangFlag() > LANG_JAPANESE) {
1257 if (DEnterMenu.
dungeon == 6 && GetMenuLangFlag() == LANG_ENGLISH_US) {
1265 s8 name_width[7][7] = {
1266 {0x50, 0x6E, 0x48, 0x68, 0x38, 0x30, 0x50},
1267 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1268 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1269 {0x52, 0x68, 0x60, 0x62, 0x38, 0x30, 0x66},
1270 {0x5C, 0x68, 0x60, 0x60, 0x2E, 0x30, 0x64},
1271 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1272 {0x52, 0x68, 0x60, 0x60, 0x38, 0x50, 0x64},
1275 s8 name_width[7][7] = {
1276 {0x50, 0x6E, 0x48, 0x68, 0x38, 0x30, 0x50},
1277 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1278 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1279 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1280 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1281 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1282 {0x52, 0x68, 0x60, 0x60, 0x38, 0x30, 0x64},
1285 x = offset + (x + name_width[GetMenuLangFlag()][DEnterMenu.
dungeon]);
1287 RECT digits = {0, 0xC0, 0x10, 0x1C};
1289 if (y + height >= top) {
1290 DrawMenuNumber(floor, x, y, digits, DunLogBoard2, 0, top, bottom, alpha);
1295float changeMenu_long = 60.0f;
1300static inline void SetChangeMenuCursor() {
1305void StartQuickChange(u_long128 *buffer,
int texture_block,
int *positions,
int mode) {
1307 {chara_change_frame_image, 0, 0},
1311 TexManager.DeleteTextureBlock(texture_block);
1312 TexManager.CleanUpTextureList();
1313 TexManager.LoadTextureBlockEX(-1, table);
1314 chara_change_buf = buffer;
1315 chara_change_buf = MenuCalcBufAlignment(buffer);
1317 LoadFileBGMenuData(
"quickchr.pac", chara_change_buf);
1318 CharaChangeReadFlag = 0;
1320 QuickCharaPos[0] = positions[0];
1321 QuickCharaPos[1] = positions[1];
1324 if (ChangeStatusDataPt == NULL) {
1331 StayTex = TexManager.GetTexture(
"stayframe", -1);
1332 CommonMenuMes3.
text_x = 200;
1333 CommonMenuMes3.
text_y = 190;
1334 changeMenu_long = 60.0f;
1335 ChangeMenu.
mode = mode;
1341 if (zone < 6 && zone >= 0) {
1347 if (ChangeMenu.
mode != 0) {
1348 ChangeMenu.
step = CHARA_CHANGE_ITEM_PROMPT;
1349 SetChangeMenuCursor();
1351 ChangeMenu.
step = CHARA_CHANGE_SELECT;
1355 SetChangeMenuCursor();
1357 printf(
" not change area \n");
1359 SetChangeMenuCursor();
1372 for (i = 0; i < ChangeMenu.
party_size; i++) {
1379 float angle = PI + step * ChangeMenu.
ring_slot[i];
1380 ChangeMenu.
ring_pos[i][0] = changeMenu_long * cos(angle);
1381 ChangeMenu.
ring_pos[i][1] = changeMenu_long * sin(angle);
1386 CharaChangeTexBlock = texture_block;
1389int CharaChangeLoop() {
1390 if (ReadBGSync() == 0 && CharaChangeReadFlag == 0) {
1392 {chara_change_frame_image, 0, 0},
1396 table[0].
block_no = CharaChangeTexBlock;
1397 table[1].
block_no = CharaChangeTexBlock;
1404 table[1].
name = (
char *) GetPackFile((u_int *) file->
buffer,
"quickchr.img", NULL);
1405 TexManager.DeleteTextureBlock(CharaChangeTexBlock);
1406 TexManager.CleanUpTextureList();
1407 TexManager.LoadTextureBlockEX(-1, table);
1408 QuickCharaTex = TexManager.GetTexture(
"quickchara", -1);
1409 chara_change_buf = file->
buffer + (file->
size >> 4) + 4;
1410 chara_change_buf = MenuCalcBufAlignment(chara_change_buf);
1411 CharaChangeReadFlag = 1;
1412 InitMenuMesSet(MENU_MES_SET_ALLMENU, (s16 *) GetPackFile((u_int *) file->
buffer,
"qchr.mes", NULL));
1413 CommonMenuMes3.
auto_pos = MES_POS_NONE;
1414 CommonMenuMes3.
Preset(MES_PRESET_SYSTEM);
1426 CommonMenuMes1.
Preset(MES_PRESET_SYSTEM);
1432 if (CharaChangeReadFlag != 0) {
1433 result = CharaChangeKey();
1440 MenuTextureReload(CharaChangeTexBlock);
1441 DngActiveWeaponTextureCopy();
1442 CharaChangeReadFlag = 0;
1446 TexManager.DeleteTextureBlock(CharaChangeTexBlock);
1447 TexManager.CleanUpTextureList();
1449 {chara_change_frame_image, 0, 0},
1452 restore[0].
block_no = CharaChangeTexBlock;
1453 TexManager.LoadTextureBlockEX(-1, restore);
1462static inline void SetStatusChara(
CDngStatusData *status, s8 chara) {
1466int CharaChangeKey() {
1471 switch (ChangeMenu.
step) {
1472 case CHARA_CHANGE_LOADING:
1475 if (ReadBGSync() == 0 && ChangeMenu.
unk_4c > 0x10) {
1478 CharaChangeInitToGL2(0);
1479 ChangeMenu.
step = CHARA_CHANGE_LOADED;
1483 case CHARA_CHANGE_LOADED:
1486 if (ReadBGSync() == 0 && ChangeMenu.
unk_4c > 0x10) {
1494 case CHARA_CHANGE_BLOCKED:
1495 case CHARA_CHANGE_UNK_4: {
1506 if (CommonMenuMes3.
mes_made != message) {
1510 if (GamePad.
Down(PAD_CIRCLE | PAD_CROSS)) {
1511 if (ChangeMenu.
mode != 0) {
1512 ChangeMenu.
step = CHARA_CHANGE_ITEM_PROMPT;
1515 ChangeMenu.
step = CHARA_CHANGE_SELECT;
1518 ComMenuSePlay(MENU_SOUND_REFUSE);
1523 case CHARA_CHANGE_TURNING:
1528 for (
int i = 0; i < 6; i++) {
1536 for (
int i = 0; i < ChangeMenu.
party_size; i++) {
1545 ChangeMenu.
step = CHARA_CHANGE_SELECT;
1551 case CHARA_CHANGE_ITEM_PROMPT: {
1558 if (CommonMenuMes3.
mes_made != message) {
1562 if (GamePad.
Down(PAD_UP | PAD_DOWN)) {
1569 ComMenuSePlay(MENU_SOUND_CURSOR);
1573 if (DebugMode && GamePad.
Down2(PAD_CROSS)) {
1574 ChangeStatusDataPt->
GetItem(ITEM_STAND_IN_POWDER, 0);
1578 if (GamePad.
Down(PAD_CROSS)) {
1580 int count = GetNowItemNum(ITEM_STAND_IN_POWDER, pack);
1584 ComMenuSePlay(MENU_SOUND_CONFIRM);
1586 ComMenuSePlay(MENU_SOUND_REFUSE);
1587 ChangeMenu.
step = CHARA_CHANGE_BLOCKED;
1590 ComMenuSePlay(MENU_SOUND_REFUSE);
1591 ChangeMenu.
step = CHARA_CHANGE_BLOCKED;
1593 }
else if (count > 0) {
1594 ChangeMenu.
step = CHARA_CHANGE_SELECT;
1595 ComMenuSePlay(MENU_SOUND_CONFIRM);
1597 ComMenuSePlay(MENU_SOUND_REFUSE);
1599 }
else if (GamePad.
Down(PAD_CIRCLE)) {
1600 ComMenuSePlay(MENU_SOUND_REFUSE);
1605 case CHARA_CHANGE_SELECT: {
1606 if (GamePad.
Down(PAD_CROSS)) {
1608 ComMenuSePlay(MENU_SOUND_REFUSE);
1609 ChangeMenu.
step = CHARA_CHANGE_BLOCKED;
1614 ComMenuSePlay(MENU_SOUND_REFUSE);
1616 ChangeMenu.
step = CHARA_CHANGE_BLOCKED;
1622 ChangeMenu.
step = CHARA_CHANGE_BLOCKED;
1623 ComMenuSePlay(MENU_SOUND_REFUSE);
1631 if (hp <= 0 || (flags & AILMENT_KNOCKED_OUT)) {
1632 ComMenuSePlay(MENU_SOUND_REFUSE);
1637 ComMenuSePlay(MENU_SOUND_CONFIRM);
1638 SetStatusChara(ChangeStatusDataPt, ChangeMenu.
selected);
1640 if (ChangeMenu.
mode == 1) {
1641 ChangeStatusDataPt->
LostItem(ITEM_STAND_IN_POWDER);
1645 ChangeMenu.
step = CHARA_CHANGE_LOADING;
1646 ChangeMenu.
mode = 0;
1650 ComMenuSePlay(MENU_SOUND_CONFIRM);
1651 }
else if (GamePad.
Down(PAD_CIRCLE)) {
1652 if (ChangeStatusDataPt->
hp[ChangeStatusDataPt->
cur_chara] < 0 || ChangeMenu.
mode != 0) {
1653 ChangeMenu.
step = CHARA_CHANGE_ITEM_PROMPT;
1661 ComMenuSePlay(MENU_SOUND_REFUSE);
1664 int previous = ChangeMenu.
selected;
1666 if (GamePad.
Down(PAD_UP | PAD_RIGHT)) {
1675 if (GamePad.
Down(PAD_DOWN | PAD_LEFT)) {
1684 if (previous != ChangeMenu.
selected) {
1685 ChangeMenu.
step = CHARA_CHANGE_TURNING;
1687 u_long128 *buffer = chara_change_buf;
1688 CharaChangeInitToGL(buffer, ChangeMenu.
selected);
1689 ComMenuSePlay(MENU_SOUND_CURSOR);
1694 case CHARA_CHANGE_UNK_7:
1697 if (ChangeMenu.
unk_4c > 0xFA) {
1707void CharaChangeDraw() {
1717 FrameImageDraw(100, 0x80);
1719 if (CharaChangeReadFlag != 0) {
1720 MenuTextureReload(CharaChangeTexBlock);
1722 CTexture *frame = TexManager.GetTexture(
"stayframe", -1);
1724 CTexture *frame = TexManager.GetTexture(stay_frame_name, -1);
1726 int frame_x = QuickCharaPos[0] - 2.0f * changeMenu_long;
1727 int frame_y = QuickCharaPos[1] - 1.4f * changeMenu_long;
1730 switch (ChangeMenu.
step) {
1731 case CHARA_CHANGE_LOADED:
1732 case CHARA_CHANGE_LOADING:
1733 alpha = 0x80 - ChangeMenu.
unk_4c * 4;
1744 switch (ChangeMenu.
step) {
1745 case CHARA_CHANGE_LOADED:
1746 case CHARA_CHANGE_LOADING:
1747 changeMenu_long += ChangeMenu.
unk_4c;
1748 turn = step / 20.0f;
1754 for (i = 0; i < ChangeMenu.
party_size; i++) {
1755 angle = PI + (step * ChangeMenu.
ring_slot[i] + turn * ChangeMenu.
unk_4c);
1756 ChangeMenu.
ring_pos[i][0] = changeMenu_long * cos(angle);
1757 ChangeMenu.
ring_pos[i][1] = changeMenu_long * sin(angle);
1761 case CHARA_CHANGE_TURNING:
1762 turn = step / 20.0f;
1768 for (i = 0; i < ChangeMenu.
party_size; i++) {
1770 ChangeMenu.
ring_pos[i][0] = changeMenu_long * cos(angle);
1771 ChangeMenu.
ring_pos[i][1] = changeMenu_long * sin(angle);
1777 CTexture *portraits = QuickCharaTex;
1779 for (
int chara = 0; chara < ChangeMenu.
party_size; chara++) {
1780 float x = QuickCharaPos[0] + ChangeMenu.
ring_pos[chara][0];
1781 float y = QuickCharaPos[1] + ChangeMenu.
ring_pos[chara][1];
1783 int u = chara * 0x30;
1787 u = (chara - 3) * 0x30;
1791 if (ChangeStatusDataPt != NULL && ChangeStatusDataPt->
hp[chara] <= 0) {
1795 DrawMenu2DSprite(portraits,
CRect_i_(x, y, 0x30, 0x30),
CRect_i_(u, v, 0x30, 0x30), shade, shade, shade, alpha);
1798 if (ChangeMenu.
step != CHARA_CHANGE_LOADED && ChangeMenu.
step != CHARA_CHANGE_LOADING && ChangeMenu.
step != CHARA_CHANGE_BLOCKED && ChangeMenu.
step != CHARA_CHANGE_UNK_4) {
1799 DrawMenuWaku(QuickCharaPos[0] - changeMenu_long - 11.0f, QuickCharaPos[1] - 12, 0x34, 0x34, 0, StayTex, 0x80);
1802 if (ChangeMenu.
step == CHARA_CHANGE_ITEM_PROMPT || ChangeMenu.
step == CHARA_CHANGE_BLOCKED || ChangeMenu.
step == CHARA_CHANGE_UNK_4) {
1803 AllFadeForMenu(0x40);
1805 CommonMenuMes3.
auto_pos = MES_POS_CENTRE;
1806 MenuTextureReload(CommonMenuMes3.
tex_block);
1807 CommonMenuMes3.
Step();
1809 cursor_x = CommonMenuMes3.
text_x - 0x1E;
1816 CommonMenuMes3.
auto_pos = MES_POS_NONE;
1817 cursor_x = QuickCharaPos[0] - changeMenu_long - 32.0f;
1818 cursor_y = QuickCharaPos[1] + 6;
1820 if (cursor_x < -40 || cursor_x > 640 || cursor_y < -40 || cursor_y > 450) {
1828 if (CursorVibeCnt > 1080000) {
1833 if (ChangeMenu.
mode != 0) {
1834 MenuTextureReload(CharaChangeTexBlock);
1835 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x5C, 0x138, 0x1A, 0x1B),
CRect_i_(0xA6, 0, 0x1A, 0x1C), alpha);
1836 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x76, 0x138, 0x30, 0x1B),
CRect_i_(0xC0, 0, 0x20, 0x1C), alpha);
1837 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0xA6, 0x138, 0x1A, 0x1B),
CRect_i_(0xE0, 0, 0x1A, 0x1C), alpha);
1839 RECT value_digits = {0x70, 0x74, 0xC, 0xC};
1840 DrawMenuNumber(value, 0xB7, 0x140, QuickCharaTex, value_digits, 0, alpha);
1841 int lang = GetMenuLangFlag();
1842 float help_width[7] = {10.6f, 10.6f, 10.6f, 14.0f, 12.0f, 11.8f, 10.7f};
1843 MenuHelpWinDraw(100, 0x154, help_width[lang], 0.9f, alpha);
1844 u8 count_shift[7] = {0, 0, 0, 56, 28, 16, 0};
1845 int count_x = count_shift[lang];
1846 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x76, 0x164, 0x20, 0x20),
CRect_i_(0, 0x60, 0x20, 0x20), alpha);
1847 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(count_x + 0x104, 0x16C, 0x10, 0x10),
CRect_i_(0x20, 0x60, 0x10, 0x10), alpha);
1848 MenuTextureReload(CommonMenuMes1.
tex_block);
1850 if (lang == LANG_JAPANESE) {
1851 DrawMenuClsMes(&CommonMenuMes1, 0xA0, 0x154);
1857 CommonMenuMes1.
Step();
1861 RECT count_digits = {0, 0x9E, 0xC, 0x12};
1863 int count = GetNowItemNum(ITEM_STAND_IN_POWDER, pack);
1865 count_x += (count_digits.
width >> 1) * GetNumberKeta(count);
1866 DrawMenuNumber(count, count_x, 0x16C, count_digits, StayTex, 0, 0, SCREEN_HEIGHT, alpha);
1870 if (ChangeMenu.
mode != 0) {
1871 MenuTextureReload(CharaChangeTexBlock);
1872 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x5C, 0x124, 0x1A, 0x1B),
CRect_i_(0xA6, 0, 0x1A, 0x1C), alpha);
1873 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x76, 0x124, 0x30, 0x1B),
CRect_i_(0xC0, 0, 0x20, 0x1C), alpha);
1874 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0xA6, 0x124, 0x1A, 0x1B),
CRect_i_(0xE0, 0, 0x1A, 0x1C), alpha);
1876 RECT value_digits = {0x70, 0x74, 0xC, 0xC};
1877 DrawMenuNumber(value, 0xB7, 0x12C, QuickCharaTex, value_digits, 0, alpha);
1878 MenuHelpWinDraw(100, 0x140, 10.6f, 0.9f, alpha);
1879 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x76, 0x150, 0x20, 0x20),
CRect_i_(0, 0x60, 0x20, 0x20), alpha);
1880 DrawMenu2DSprite(QuickCharaTex,
CRect_i_(0x104, 0x158, 0x10, 0x10),
CRect_i_(0x20, 0x60, 0x10, 0x10), alpha);
1881 MenuTextureReload(CommonMenuMes1.
tex_block);
1886 CommonMenuMes1.
Step();
1888 RECT count_digits = {0, 0x9E, 0xC, 0x12};
1890 int count = GetNowItemNum(ITEM_STAND_IN_POWDER, pack);
1891 int count_x = 0x122;
1892 count_x += (count_digits.
width >> 1) * GetNumberKeta(count);
1893 DrawMenuNumber(count, count_x, 0x158, count_digits, StayTex, 0, 0, 0x1C0, alpha);
1897 if (ChangeMenu.
step != CHARA_CHANGE_LOADED && ChangeMenu.
step != CHARA_CHANGE_LOADING && ChangeMenu.
step != CHARA_CHANGE_BLOCKED && ChangeMenu.
step != CHARA_CHANGE_UNK_4) {
1898 DrawMenuObjectVibe(cursor_x, cursor_y, 1, 0x40);
1905int DngActItemModelReadStart(u_long128 *buffer) {
1906 char model_path[64];
1907 char texture_path[76];
1909 u_long128 *model_buffer;
1910 u_long128 *texture_buffer;
1921 model_buffer = MenuCalcBufAlignment(buffer);
1922 texture_buffer = model_buffer + 0xFA1;
1923 texture_buffer = MenuCalcBufAlignment(texture_buffer);
1926 for (i = 0; i < 3; i++) {
1928 printf(
"mds = %p\n", model_buffer);
1929 printf(
"img = %p\n", texture_buffer);
1930 BtGetItemNamePath(model_path, texture_path, pack->
quick_item_slot[i]);
1931 LoadFileBG(model_path, model_buffer, &size);
1932 model_buffer += (((size >> 6) + 1) << 6) >> 4;
1933 LoadFileBG(texture_path, texture_buffer, &size);
1934 texture_buffer += (((size >> 6) + 1) << 6) >> 4;
1945int DngActItemModelBuild(
int wait) {
1948 u_int *model_buffer;
1949 u_int *texture_buffer;
1954 if (ReadBGSync() != 0) {
1956 while (ReadBGSync() != 0) {
1968 for (i = 0; i < 3; i++) {
1969 if (items[i] < ITEM_DUNGEON_START) {
1973 model = GetReadBGFile(read_index * 2);
1974 texture = GetReadBGFile(read_index * 2 + 1);
1977 if (model != NULL) {
1978 model_buffer = (u_int *) model->
buffer;
1981 if (texture != NULL) {
1982 texture_buffer = (u_int *) texture->
buffer;
1983 texture_size = texture->
size;
1986 if (model == NULL || texture == NULL) {
1990 if (activeItem.
model[i + 1] != -1) {
1992 activeItem.
model[i + 1] = -1;
1995 if (activeItem.
model[i + 1] != -1) {
1999 activeItem.
model[i + 1] = activeItem.
models->
SetCashModel(items[i], model_buffer, texture_buffer, texture_size);
2000 activeItem.
model[i + 5] = 0;
2001 activeItem.
item[i + 1] = items[i];
2007int DngActiveItemTextureCopy() {
2015 char source[] =
"itemicon";
2017 for (i = 0; i < 3; i++) {
2020 if (item_no >= ITEM_DUNGEON_START) {
2026 if (icon >= 0 && icon <= 256) {
2027 int u = (icon % 8) * 32;
2028 int v = (icon >> 3) * 32;
2029 setItemToReserved(source, u, v,
"itempack", i * 32 + 32, 0);
2038char item_view_frame_image[] __attribute__((section(
".rodata"))) =
"#frame_menuwep#640#" SCREEN_HEIGHT_STR
"#4";
2043char debug_item_font_texture[] __attribute__((section(
".rodata"))) =
"dbgwork_menu";
2045char item_templete_no[] __attribute__((section(
".rodata"))) =
"ItemNo :%d\n";
2046char item_templete_type[] __attribute__((section(
".rodata"))) =
"type: :%s\n";
2047char item_templete_use[] __attribute__((section(
".rodata"))) =
"use :%s\n";
2048char item_templete_attribute[] __attribute__((section(
".rodata"))) =
"attribute:%s\n";
2049char item_templete_name_index[] __attribute__((section(
".rodata"))) =
"nameIndex:%d\n";
2050char item_templete_help_index[] __attribute__((section(
".rodata"))) =
"helpIndex:%d\n";
2051char item_templete_volume[] __attribute__((section(
".rodata"))) =
"volume[3]:%3d, %3d, %3d\n";
2052char item_templete_gold[] __attribute__((section(
".rodata"))) =
"gold :%d\n";
2054int DngActiveWeaponTextureCopy() {
2056 char source[] =
"wepicon";
2060 int default_no = GetDefaultWeaponNo(chara);
2066 s16 weapons[3] = {weapon->
item_no, default_no + 1, default_no};
2068 for (
int i = 0; i < 3; i++) {
2073 int u = (icon % 8) * 32;
2074 int v = (icon >> 3) * 32;
2075 setItemToReserved(source, u, v,
"itempack", pos[i][0], pos[i][1]);
2085 if (weapon == NULL) {
2091 if (item_no < ITEM_WEAPON_START) {
2095 return GetCommonItemInfo((s32) item_no)->
msg + 0x64;
2098int GetWeaponMsgNo2(s32 item_no) {
2101 info = GetCommonItemInfo(item_no);
2110void DrawWepAttach(
int x,
int y,
WEAPON_HAVE *weapon,
int selected,
int alpha) {
2120 holes = GetWeaponHoleNum(weapon->
item_no);
2126 for (i = 0; i < holes; i++) {
2129 if (item_no >= ITEM_ATTACH_START) {
2131 texture = RetCTex(item_no, u, v);
2134 DrawMenu2DSprite(texture, dest, src, alpha);
2135 volume = GetAttachVolumeForMsg(&weapon->
attach[i]);
2137 if (item_no == ITEM_ATTACH_SYNTHESIS_SPHERE) {
2141 DrawAttachNumberOrWeapon(x, y, 0, 0x280, item_no, volume, alpha, 0);
2151int GetAtraTipNowHave(
int tip_no,
int georama_no) {
2163 if (tip_no < 0x28) {
2166 if (plot_info != NULL && plot_info->
obtained != 0) {
2172 for (i = 0; i < 0x80; i++, elem++) {
2173 if (*elem == tip_no - 0x28) {
2180 for (plot = 0; plot < 0x18; plot++) {
2182 atra = GetEditAtraPartsData(georama_no, plot);
2184 for (slot = 0; slot < 6; slot++) {
2188 if (
id >= 0 &&
id == tip_no - 0x28 && info->
element_enabled[slot] != 0) {
2199int GetDispVolumeForFloat(
float volume) {
2203 whole = (int) volume;
2206 if (volume - (
float) whole > 0.0) {
2216int InitItemPolygonView(
int item_no, u_long128 *buffer) {
2217 char model_path[64];
2218 char texture_path[76];
2220 u_long128 *texture_buffer;
2222 if (item_no < ITEM_ATTACH_START || item_no >= ITEM_WEAPON_START) {
2226 BtGetItemNamePath(model_path, texture_path, item_no);
2228 MDebugItemPolyViewFlag = 0;
2229 buffer = MenuCalcBufAlignment(buffer);
2231 if (LoadFileBG(model_path, buffer, &size) == 0) {
2235 texture_buffer = buffer + (size >> 4) + 1;
2236 texture_buffer = MenuCalcBufAlignment(texture_buffer);
2238 if (LoadFileBG(texture_path, texture_buffer, &size) == 0) {
2242 ItemPolyView = NULL;
2247float menudebugpos[4] = {4.0f, 0.0f, 0.0f, 1.0f};
2250float menudebugrot[3] = {0.0f, 0.0f, 0.0f};
2253float menudebugrscale[3] = {3.0f, 3.0f, 3.0f};
2267static int EnterItemPolygonView() {
2271 if (ReadBGSync() == 0 && polyreadflag == 0 && MDebugItemPolyViewFlag == 0) {
2273 {item_view_frame_image, 0, 0},
2277 table[0].
block_no = BtlMenuExReadBlock;
2278 table[1].
block_no = BtlMenuExReadBlock;
2279 model = GetReadBGFile(0);
2280 texture = GetReadBGFile(1);
2282 TexManager.DeleteTextureBlock(BtlMenuExReadBlock);
2283 TexManager.CleanUpTextureList();
2284 TexManager.LoadTextureBlockEX(-1, table);
2286 if (model == NULL) {
2290 if (texture == NULL) {
2294 MenuItemCashBuffer.
base = (u_char *) (texture->
buffer + (texture->
size >> 4) + 1);
2295 MenuItemCashBuffer.
limit = 0x6080;
2296 MenuItemCashBuffer.
Reset();
2297 MDebugItemPolyViewFlag = 1;
2298 ItemPolyView = (
CFrame *) LoadMDSFile((u_int *) model->
buffer, &MenuItemCashBuffer, 0, NULL, NULL);
2299 sceVu0FVECTOR position = {4.0f, 0.0f, 0.0f, 1.0f};
2300 float rotation[3] = {0.0f, 0.0f, 0.0f};
2301 float scale[3] = {3.0f, 3.0f, 3.0f};
2303 memcpy(menudebugpos, position,
sizeof(sceVu0FVECTOR));
2304 memcpy(menudebugrot, rotation,
sizeof(sceVu0FVECTOR));
2305 memcpy(menudebugrscale, scale,
sizeof(sceVu0FVECTOR));
2319static void LocalDrawItemPolygonView() {
2324 if (MDebugItemPolyViewFlag != 0 && ItemPolyView != NULL && polyreadflag != 0) {
2327 menudebugrot[0] += tilt / 32.0f;
2328 menudebugrot[1] += turn / 32.0f;
2330 for (i = 0; i < 3; i++) {
2331 if (menudebugrot[i] < -PI) {
2332 menudebugrot[i] += TWO_PI;
2335 if (menudebugrot[i] > PI) {
2336 menudebugrot[i] -= TWO_PI;
2340 if (GamePad.
Down2(PAD_CIRCLE)) {
2341 MDebugItemPolyViewFlag = 0;
2344 if (GamePad.
On2(PAD_TRIANGLE)) {
2345 for (i = 0; i < 3; i++) {
2346 if (menudebugrscale[i] <= 5.0f) {
2347 menudebugrscale[i] += 0.1f;
2352 if (GamePad.
On2(PAD_SQUARE)) {
2353 for (i = 0; i < 3; i++) {
2354 if (0.1f < menudebugrscale[i]) {
2355 menudebugrscale[i] -= 0.1f;
2360 ItemPolyView->SetRotation(menudebugrot[0], menudebugrot[1], menudebugrot[2]);
2361 ItemPolyView->SetScale(menudebugrscale);
2362 ItemPolyView->SetPosition(menudebugpos);
2363 MGDraw(ItemPolyView);
2367void DrawItemPolygonView() {
2368 MenuTextureReload(BtlMenuExReadBlock);
2369 MenuPolygonDraw(0x80, LocalDrawItemPolygonView);
2375void InitDebugItemGet() {
2381 MenuDbgMsg.
x = 0x15E;
2382 MenuDbgMsg.
y = 0x50;
2383 MenuDbgMsg.
width = 0x100;
2384 MenuDbgMsg.
height = 0xE0;
2385 MenuDbgMsg.
alpha = 0x60;
2396static int ConvDebugSelectToExcelListNo(
int selection) {
2399 item_no = selection + 0x81;
2401 if ((item_no > ITEM_WEAPON_SCORPION) && (item_no < ITEM_WEAPON_SUPER_STEVE)) {
2405 if ((selection >= 0xF8) && (selection < 0x120)) {
2406 item_no = selection - 0xA7;
2412int DebugItemGetKey() {
2422 page = ItemAutoGet.
page;
2424 if (GamePad.
Down(PAD_UP)) {
2428 if (GamePad.
Down(PAD_DOWN)) {
2432 if (GamePad.
Down(PAD_RIGHT)) {
2436 if (GamePad.
Down(PAD_LEFT)) {
2440 if (GamePad.
Down(PAD_SELECT)) {
2447 polyreadflag = InitItemPolygonView(ConvDebugSelectToExcelListNo(ItemAutoGet.
selection), BtlMenuReadBuf);
2450 if (GamePad.
Down(PAD_L2 | PAD_L1)) {
2454 if (GamePad.
Down(PAD_R2 | PAD_R1)) {
2468 if (selection != ItemAutoGet.
selection || page != ItemAutoGet.
page) {
2469 ComMenuSePlay(MENU_SOUND_CURSOR);
2472 if (GamePad.
Down(PAD_CROSS)) {
2473 ComMenuSePlay(MENU_SOUND_CONFIRM);
2474 count = rand() % 3 + 1;
2475 BtlMenuStatusPt->
GetItem(ConvDebugSelectToExcelListNo(ItemAutoGet.
selection), count);
2478 if (GamePad.
Down(PAD_CIRCLE)) {
2481 ComMenuSePlay(MENU_SOUND_REFUSE);
2484 if (GamePad.
Down2(PAD_CROSS)) {
2485 for (item_no = ITEM_WEAPON_START; item_no < ITEM_WEAPON_END; item_no++) {
2486 data = GetWeaponData(item_no);
2488 if (data != NULL && data->
flags != 0 && data->
flags != 1) {
2489 BtlMenuStatusPt->
GetItem(item_no, 0);
2493 ComMenuSePlay(MENU_SOUND_CONFIRM);
2499void DebugItemGetDraw() {
2500 CTexture *sheets[5] = {ItemIcon, ItemIcon, WepIcon, WepIcon, WepIcon};
2501 int sheet_y[5] = {0, 0x100, 0, 0x100, 0x200};
2503 int y = sheet_y[ItemAutoGet.
page];
2506 if (ItemAutoGet.
page == 4) {
2510 if (sheet != NULL) {
2511 MenuTextureReload(sheet->
block);
2514 MGFillBox(
CRect_i_(0x460, 0x280, 0x1000, 0x800), 0, 0, 0, 0x60);
2515 DrawMenu2DSprite(sheet,
CRect_i_(0x46, 0x50, 0x100, height),
CRect_i_(0, y, 0x100, height), 0x80);
2516 int item_no = ConvDebugSelectToExcelListNo(ItemAutoGet.
selection);
2519 DrawItemDataView(item_no);
2523 DrawMenuObjectVibe((cell % 8) * 32 + 0x2E, (cell / 8) * 32 + 0x50, 1, 0x40);
2527 int message = info->
msg + 500;
2529 if (CommonMenuMes2.
mes_made != message) {
2546char *ItemTemplete[8] = {
2547 item_templete_no, item_templete_type, item_templete_use, item_templete_attribute,
2548 item_templete_name_index, item_templete_help_index, item_templete_volume, item_templete_gold,
2552static void DrawItemDataView(
int item_no) {
2555 switch (BtlMenuMode) {
2556 case BATTLE_MENU_MODE_DUNGEON:
2559 case BATTLE_MENU_MODE_TOWN:
2564 MenuTextureReload(block);
2566 char type[128] =
"";
2568 if (0 <= item_no && item_no < ITEM_ATTACH_START) {
2573 if (item_no >= ITEM_ATTACH_START && item_no < ITEM_DUNGEON_END) {
2574 int index = item_no - ITEM_ATTACH_START;
2581 if (MDebugItemPolyViewFlag == 0) {
2582 MenuDbgMsg.
length += sprintf(&MenuDbgMsg.
text[MenuDbgMsg.
length],
"-----ItemData View-----\n");
2583 MenuDbgMsg.
length += sprintf(&MenuDbgMsg.
text[MenuDbgMsg.
length], ItemTemplete[line++], item_no);
2584 MenuDbgMsg.
length += sprintf(&MenuDbgMsg.
text[MenuDbgMsg.
length], ItemTemplete[line], type);
2588 if (GamePad.
Down(PAD_TRIANGLE)) {
2589 polyreadflag = InitItemPolygonView(ConvDebugSelectToExcelListNo(ItemAutoGet.
selection), BtlMenuReadBuf);
2592 if (polyreadflag == 0) {
2593 polyreadflag = EnterItemPolygonView();
2596 if (polyreadflag != 0) {
2597 DrawItemPolygonView();
s16 ChkKills(int georama_no, int floor)
int GetItem(int item_id, int qty)
int LostItem(int item_id)
int GetAtraNum(int georama_no, int floor)
int GetMaxAtraNum(int georama_no, int floor)
s32 GetActiveCharaStatus(int chara_no)
void MenuModeOn(int threshold)
void SetAutoRepeat(int mask, int initial_delay, int repeat_delay)
void DeleteModel(int model_no)
int SetCashModel(int item_no, unsigned int *model_data, unsigned int *texture_data, int texture_size)
CDngStatusData * GetDngStatus()
int QuestDungeon(int dungeon_no, int add)
s16 * GetElemData(int georama_no)
SV_EDIT_PARTS_INFO * GetEditPartsInfo(int georama_no, int plot_no)
DNG_CONSUMABLE consumable_items[43]
WEAPON_HAVE chara_weapons[6][11]
s8 equipped_weapon_slot[6]
s32 res_limit_zone_current
MES_LINE_POS line_pos[10]
int MakeMesWin(int mes_no)
EDIT_CHIP_ATTACH_DATA elements[6]