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