Fix for item slots (#137)

* fix item slots

* formatting
This commit is contained in:
kipcode66 2021-08-14 07:20:23 -04:00 committed by GitHub
parent ba5ad31b54
commit 6867475c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 23 deletions

View File

@ -5,10 +5,10 @@
#include "dolphin/types.h"
#define DEFAULT_SELECT_ITEM_INDEX 0
#define MAX_SELECT_ITEM 3
#define MAX_SELECT_ITEM 4
#define MAX_EQUIPMENT 6
#define MAX_EVENTS 256
#define MAX_ITEM_SLOTS 24
#define ITEM_XY_MAX_DUMMY 8
#define LIGHT_DROP_STAGE 4
#define LETTER_INFO_BIT 64
#define BOMB_BAG_MAX 3
@ -349,11 +349,11 @@ private:
/* 0x06 */ u16 mMaxOil;
/* 0x08 */ u16 mOil;
/* 0x0A */ u8 unk10;
/* 0x0B */ u8 mSelectItem[3];
/* 0x0E */ u8 mMixItem[3];
/* 0x11 */ u8 unk17;
/* 0x12 */ u8 unk18;
/* 0x13 */ u8 mSelectEquip[6];
/* 0x0B */ u8 mSelectItem[MAX_SELECT_ITEM]; // For GC: first 2 are X & Y, others unused; For
// Wii (in order): Left, Right, Down, B
/* 0x0F */ u8 mMixItem[MAX_SELECT_ITEM]; // Combo items; For GC: first 2 are X & Y, others
// unused; For Wii (in order): Left, Right, Down, B
/* 0x13 */ u8 mSelectEquip[MAX_EQUIPMENT];
/* 0x19 */ u8 mWalletSize;
/* 0x1A */ u8 mMaxMagic;
/* 0x1B */ u8 mMagic;
@ -623,19 +623,31 @@ public:
void setSound(u8);
u8 getVibration(void);
void setVibration(u8);
inline u8 getAttentionType(void) { return mAttentionType; }
inline void setAttentionType(u8 i_mAttentionType) { mAttentionType = i_mAttentionType; }
inline u16 getCalibrateDist(void) { return mCalibrateDist; }
inline void setCalibrateDist(u16 i_mCalibrateDist) { mCalibrateDist = i_mCalibrateDist; }
inline u8 getCalValue(void) { return mCalValue; }
inline void setCalValue(u8 i_mCalValue) { mCalValue = i_mCalValue; }
inline bool getShortCut(void) { return mShortCut; }
inline void setShortCut(bool i_mShortCut) { mShortCut = i_mShortCut; }
inline u8 getCameraControl(void) { return mCameraControl; }
inline void setCameraControl(u8 i_mCameraControl) { mCameraControl = i_mCameraControl; }
inline bool getPointer(void) { return mPointer; }
inline void setPointer(bool i_mPointer) { mPointer = i_mPointer; }
private:
u8 unk0;
u8 mSoundMode;
u8 mAttentionType;
u8 mAttentionType; // 0 : hold, 1 : switch
u8 mVibration;
u8 unk4;
u8 unk5;
u16 mCalibrateDist;
u8 mCalValue;
u8 mShortCut;
u8 mCameraControl;
u8 mPointer;
u16 mCalibrateDist; // Wii pointer horizontal calibration. Default is 0x015E
u8 mCalValue; // Wii pointer vertical calibration. Default is 0x00
bool mShortCut; // Wii icon shortcut enabled/disabled.
u8 mCameraControl; // 0 : normal, 1 : inverted
bool mPointer; // Wii pointer enabled/disabled.
u8 padding[4];
};

View File

@ -294,13 +294,13 @@ void dSv_player_status_a_c::init() {
mOil = 0;
unk10 = 0;
for (int i = 0; i < 4; i++) {
for (int i = 0; i < MAX_SELECT_ITEM; i++) {
mSelectItem[i] = NO_ITEM;
mMixItem[i + 1] = NO_ITEM;
mMixItem[i] = NO_ITEM;
dComIfGp_setSelectItem__Fi(i);
}
for (int i = 0; i < 6; i++) {
for (int i = 0; i < MAX_EQUIPMENT; i++) {
mSelectEquip[i] = 0;
}
@ -322,27 +322,27 @@ void dSv_player_status_a_c::init() {
}
void dSv_player_status_a_c::setSelectItemIndex(signed int i_no, u8 item_index) {
if (i_no < ITEM_XY_MAX_DUMMY / 2) {
if (i_no < MAX_SELECT_ITEM) {
mSelectItem[i_no] = item_index;
}
}
u8 dSv_player_status_a_c::getSelectItemIndex(signed int i_no) const {
if (i_no < ITEM_XY_MAX_DUMMY / 2) {
if (i_no < MAX_SELECT_ITEM) {
return mSelectItem[i_no];
}
return 0;
}
void dSv_player_status_a_c::setMixItemIndex(signed int i_no, u8 item_index) {
if (i_no < ITEM_XY_MAX_DUMMY / 2) {
mMixItem[i_no + 1] = item_index;
if (i_no < MAX_SELECT_ITEM) {
mMixItem[i_no] = item_index;
}
}
u8 dSv_player_status_a_c::getMixItemIndex(signed int i_no) const {
if (i_no < ITEM_XY_MAX_DUMMY / 2) {
return mMixItem[i_no + 1];
if (i_no < MAX_SELECT_ITEM) {
return mMixItem[i_no];
}
return 0;
}
@ -598,7 +598,7 @@ void dSv_player_item_c::setItem(int item_slot, u8 item_id) {
dComIfGp_setSelectItem__Fi(select_item_index);
}
select_item_index++;
} while (select_item_index < MAX_SELECT_ITEM);
} while (select_item_index < MAX_SELECT_ITEM - 1);
}
#else
#pragma push