mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Add 2 more slots for Power Discs on Infinity Base
This commit is contained in:
parent
afa7a27f33
commit
3ba4c8a1c7
4 changed files with 43 additions and 17 deletions
|
@ -183,11 +183,24 @@ infinity_figure& infinity_base::get_figure_by_order(u8 order_added)
|
|||
|
||||
u8 infinity_base::derive_figure_position(u8 position)
|
||||
{
|
||||
while (position > 2)
|
||||
position -= 2;
|
||||
switch (position)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return 1;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return 2;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
return 3;
|
||||
|
||||
position++;
|
||||
return position;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void infinity_base::query_block(u8 fig_num, u8 block, std::array<u8, 32>& reply_buf, u8 sequence)
|
||||
|
@ -265,9 +278,13 @@ bool infinity_base::remove_figure(u8 position)
|
|||
|
||||
if (figure.present)
|
||||
{
|
||||
figure.present = false;
|
||||
|
||||
position = derive_figure_position(position);
|
||||
if (position == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
figure.present = false;
|
||||
|
||||
std::array<u8, 32> figure_change_response = {0xab, 0x04, position, 0x09, figure.order_added,
|
||||
0x01};
|
||||
|
@ -329,6 +346,10 @@ u32 infinity_base::load_figure(const std::array<u8, 0x14 * 0x10>& buf, fs::file
|
|||
order_added = figure.order_added;
|
||||
|
||||
position = derive_figure_position(position);
|
||||
if (position == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::array<u8, 32> figure_change_response = {0xab, 0x04, position, 0x09, order_added, 0x00};
|
||||
figure_change_response[6] = generate_checksum(figure_change_response, 6);
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
protected:
|
||||
shared_mutex infinity_mutex;
|
||||
std::array<infinity_figure, 7> figures;
|
||||
std::array<infinity_figure, 9> figures;
|
||||
|
||||
private:
|
||||
u8 generate_checksum(const std::array<u8, 32>& data, int num_of_bytes) const;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <QCompleter>
|
||||
|
||||
infinity_dialog* infinity_dialog::inst = nullptr;
|
||||
std::array<std::optional<u32>, 7> infinity_dialog::figure_slots = {};
|
||||
std::array<std::optional<u32>, 9> infinity_dialog::figure_slots = {};
|
||||
static QString s_last_figure_path;
|
||||
|
||||
LOG_CHANNEL(infinity_log, "infinity");
|
||||
|
@ -426,8 +426,9 @@ figure_creator_dialog::figure_creator_dialog(QWidget* parent, u8 slot)
|
|||
// Only display entry if it is a piece appropriate for the slot
|
||||
if ((slot == 0 &&
|
||||
((figure > 0x1E8480 && figure < 0x2DC6BF) || (figure > 0x3D0900 && figure < 0x4C4B3F))) ||
|
||||
((slot == 1 || slot == 2) && figure < 0x1E847F) ||
|
||||
((slot == 3 || slot == 4 || slot == 5 || slot == 6) &&
|
||||
((slot == 1 || slot == 2) && (figure > 0x3D0900 && figure < 0x4C4B3F)) ||
|
||||
((slot == 3 || slot == 6) && figure < 0x1E847F) ||
|
||||
((slot == 4 || slot == 5 || slot == 7 || slot == 8) &&
|
||||
(figure > 0x2DC6C0 && figure < 0x3D08FF)))
|
||||
{
|
||||
const u32 qnum = (figure << 8) | entry.second.first;
|
||||
|
@ -681,17 +682,21 @@ infinity_dialog::infinity_dialog(QWidget* parent)
|
|||
|
||||
add_figure_slot(vbox_group, QString(tr("Play Set/Power Disc")), 0);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player One")), 1);
|
||||
add_figure_slot(vbox_group, QString(tr("Power Disc Two")), 1);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player One Ability One")), 3);
|
||||
add_figure_slot(vbox_group, QString(tr("Power Disc Three")), 2);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player One")), 3);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player One Ability One")), 4);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player One Ability Two")), 5);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two")), 2);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two")), 6);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two Ability One")), 4);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two Ability One")), 7);
|
||||
add_line(vbox_group);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two Ability Two")), 6);
|
||||
add_figure_slot(vbox_group, QString(tr("Player Two Ability Two")), 8);
|
||||
|
||||
group_figures->setLayout(vbox_group);
|
||||
vbox_panel->addWidget(group_figures);
|
||||
|
|
|
@ -41,8 +41,8 @@ protected:
|
|||
void load_figure_path(u8 slot, const QString& path);
|
||||
|
||||
protected:
|
||||
std::array<QLineEdit*, 7> m_edit_figures{};
|
||||
static std::array<std::optional<u32>, 7> figure_slots;
|
||||
std::array<QLineEdit*, 9> m_edit_figures{};
|
||||
static std::array<std::optional<u32>, 9> figure_slots;
|
||||
|
||||
private:
|
||||
void add_figure_slot(QVBoxLayout* vbox_group, QString name, u8 slot);
|
||||
|
|
Loading…
Add table
Reference in a new issue