Run clang-format and update README

This commit is contained in:
Hoe Hao Cheng 2018-10-07 15:58:57 +00:00 committed by hch12907
parent 3492c0b152
commit cc9fd11233
91 changed files with 854 additions and 905 deletions

View file

@ -9,8 +9,7 @@ I can only work on this in my spare time, so I am thankful for any help!
## Current status
Status as of 2018/08/06:
- Primary focus for now is on the GIF/VU's/VIF.
- Work started on the VIFs and VUs, mostly just implementing instructions left.
- Primary focus for now is on the GIF/VIF.
- Work started on the SPU2 (DMA and IOP communication done, sound generation still to be done).
- Work started on the SIO/SIO2 (controllers and MC's), IOP communication done.
- No work done yet on the IPU and GSCore.
@ -32,7 +31,7 @@ Run the following commands to invoke a build:
`cmake ..` optionally specifying `-DBOOST_ROOT={path}` depending on your environment.
`make` (or equivilant)
`make` (or equivalent)
## Running
`./orbumfront`

View file

@ -58,8 +58,7 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(fifo_queue)
);
CEREAL_NVP(fifo_queue));
}
private:

View file

@ -86,7 +86,6 @@ public:
{
archive(
CEREAL_NVP(current_slot),
CEREAL_NVP(branch_pc)
);
CEREAL_NVP(branch_pc));
}
};

View file

@ -84,8 +84,7 @@ struct uqword
{
archive(
CEREAL_NVP(hi),
CEREAL_NVP(lo)
);
CEREAL_NVP(lo));
}
};

View file

@ -51,7 +51,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(b)
);
CEREAL_NVP(b));
}
};

View file

@ -120,7 +120,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(d)
);
CEREAL_NVP(d));
}
};

View file

@ -2,7 +2,6 @@
#include <stdexcept>
#include <cereal/cereal.hpp>
#include "Common/Types/Primitive.hpp"
@ -77,7 +76,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(h)
);
CEREAL_NVP(h));
}
};

View file

@ -142,7 +142,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(q)
);
CEREAL_NVP(q));
}
};

View file

@ -98,7 +98,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(w)
);
CEREAL_NVP(w));
}
};

View file

@ -116,7 +116,8 @@ void CVif::STCYCL(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::OFFSET(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: OFFSET") % unit->core_id);
return;
}
@ -136,7 +137,8 @@ void CVif::OFFSET(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::BASE(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: BASE") % unit->core_id);
return;
}
@ -163,7 +165,8 @@ void CVif::STMOD(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::MSKPATH3(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: MSKPATH3") % unit->core_id);
return;
}
@ -184,7 +187,8 @@ void CVif::FLUSHE(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::FLUSH(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: FLUSH") % unit->core_id);
return;
}
@ -195,7 +199,8 @@ void CVif::FLUSH(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::FLUSHA(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: FLUSHA") % unit->core_id);
return;
}
@ -214,7 +219,8 @@ void CVif::MSCNT(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::MSCALF(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: MSCALF") % unit->core_id);
return;
}
@ -241,7 +247,8 @@ void CVif::MPG(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::DIRECT(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: DIRECT") % unit->core_id);
return;
}
@ -252,7 +259,8 @@ void CVif::DIRECT(VifUnit_Base* unit, const VifcodeInstruction inst)
void CVif::DIRECTHL(VifUnit_Base* unit, const VifcodeInstruction inst)
{
// VIF1 only
if (unit->core_id != 1) {
if (unit->core_id != 1)
{
BOOST_LOG(Core::get_logger()) << str(boost::format("Warning: VIF%d called a VIF1-only instruction: DIRECTHL") % unit->core_id);
return;
}

View file

@ -1,6 +1,7 @@
#include <boost/format.hpp>
#include "Controller/Ee/Vpu/Vu/CVu.hpp"
#include "Resources/RResources.hpp"
CVu::CVu(Core* core) :

View file

@ -1,8 +1,8 @@
#pragma once
#include "Core.hpp"
#include "Controller/CController.hpp"
#include "Controller/ControllerEvent.hpp"
#include "Core.hpp"
class Core;

View file

@ -1,6 +1,7 @@
#include <boost/format.hpp>
#include <variant>
#include <boost/format.hpp>
#include "Controller/Ee/Vpu/Vu/Interpreter/CVuInterpreter.hpp"
#include "Core.hpp"
@ -156,11 +157,14 @@ int CVuInterpreter::execute_lower_instruction(VuUnit_Base* unit, const VuInstruc
unit->lsu.consume_cycle(1);
// If the units have finished execution, replace the original regs with new ones
if (!unit->efu.is_running()) unit->p = unit->efu.new_p;
if (!unit->fdiv.is_running()) unit->q = unit->fdiv.new_q;
if (!unit->efu.is_running())
unit->p = unit->efu.new_p;
if (!unit->fdiv.is_running())
unit->q = unit->fdiv.new_q;
// If there's a data hazard, stall
if (check_data_hazard(unit, decoder)) return 1;
if (check_data_hazard(unit, decoder))
return 1;
switch (info.pipeline)
{
@ -246,7 +250,8 @@ int CVuInterpreter::execute_upper_instruction(VuUnit_Base* unit, VuInstruction i
}
// If there's a data hazard, stall
if (check_data_hazard(unit, decoder)) return 1;
if (check_data_hazard(unit, decoder))
return 1;
for (FmacPipeline& fmac : unit->fmac)
{
@ -274,19 +279,20 @@ bool CVuInterpreter::check_data_hazard(VuUnit_Base* unit, const VuInstructionDec
const int lower_read[2] = {
decoder.lower_src(0).value_or(-1),
decoder.lower_src(1).value_or(-1)
};
decoder.lower_src(1).value_or(-1)};
// If the instruction is WAITP, return true if EFU is running
if ((decoder.get_lower_inst().value) & 0x7FF == 0x7BF)
{
if (unit->efu.is_running()) return true;
if (unit->efu.is_running())
return true;
}
// If the instruction is WAITQ, return true if FDIV is running
if ((decoder.get_lower_inst().value) & 0x7FF == 0x3BF)
{
if (unit->fdiv.is_running()) return true;
if (unit->fdiv.is_running())
return true;
}
// Upper Instructions data hazard check
@ -301,16 +307,20 @@ bool CVuInterpreter::check_data_hazard(VuUnit_Base* unit, const VuInstructionDec
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(upper_read[0], inst.dest())) return true;
if (fmac.is_using_register(upper_read[1], 1 << (3 - inst.bc()))) return true;
if (fmac.is_using_register(upper_read[0], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[1], 1 << (3 - inst.bc())))
return true;
}
}
else if (decoder.decode_upper().field == VuDecodedInst::Dest)
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(upper_read[0], inst.dest())) return true;
if (fmac.is_using_register(upper_read[1], inst.dest())) return true;
if (fmac.is_using_register(upper_read[0], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[1], inst.dest()))
return true;
}
}
}
@ -320,18 +330,24 @@ bool CVuInterpreter::check_data_hazard(VuUnit_Base* unit, const VuInstructionDec
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(upper_read[0], inst.dest())) return true;
if (fmac.is_using_register(upper_read[1], inst.dest())) return true;
if (fmac.is_using_register(upper_read[2], 1 << (3 - inst.bc()))) return true;
if (fmac.is_using_register(upper_read[0], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[1], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[2], 1 << (3 - inst.bc())))
return true;
}
}
else if (decoder.decode_upper().field == VuDecodedInst::Dest)
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(upper_read[0], inst.dest())) return true;
if (fmac.is_using_register(upper_read[1], inst.dest())) return true;
if (fmac.is_using_register(upper_read[2], inst.dest())) return true;
if (fmac.is_using_register(upper_read[0], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[1], inst.dest()))
return true;
if (fmac.is_using_register(upper_read[2], inst.dest()))
return true;
}
}
}
@ -345,21 +361,26 @@ bool CVuInterpreter::check_data_hazard(VuUnit_Base* unit, const VuInstructionDec
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(lower_read[0], inst.fsf())) return true;
if (fmac.is_using_register(lower_read[1], inst.ftf())) return true;
if (fmac.is_using_register(lower_read[0], inst.fsf()))
return true;
if (fmac.is_using_register(lower_read[1], inst.ftf()))
return true;
}
}
else if (decoder.decode_lower().field == VuDecodedInst::Dest)
{
for (FmacPipeline& fmac : unit->fmac)
{
if (fmac.is_using_register(lower_read[0], inst.dest())) return true;
if (fmac.is_using_register(lower_read[1], inst.dest())) return true;
if (fmac.is_using_register(lower_read[0], inst.dest()))
return true;
if (fmac.is_using_register(lower_read[1], inst.dest()))
return true;
}
}
else if (decoder.decode_lower().field == VuDecodedInst::Int)
{
if (unit->lsu.is_using_register(lower_read[0])) return true;
if (unit->lsu.is_using_register(lower_read[0]))
return true;
}
}

View file

@ -380,8 +380,7 @@ public:
&CVuInterpreter::EEXP,
&CVuInterpreter::XGKICK,
&CVuInterpreter::XTOP,
&CVuInterpreter::XITOP
};
&CVuInterpreter::XITOP};
private:
bool check_data_hazard(VuUnit_Base* unit, const VuInstructionDecoder& decoder) const;

View file

@ -1,6 +1,7 @@
#include <boost/format.hpp>
#include <cmath>
#include <boost/format.hpp>
#include "Controller/Ee/Vpu/Vu/Interpreter/CVuInterpreter.hpp"
#include "Core.hpp"

View file

@ -1,6 +1,7 @@
#include <boost/format.hpp>
#include <cmath>
#include <boost/format.hpp>
#include "Controller/Ee/Vpu/Vu/Interpreter/CVuInterpreter.hpp"
#include "Core.hpp"
#include "Resources/RResources.hpp"

View file

@ -251,7 +251,6 @@ void CVuInterpreter::LOI(VuUnit_Base* unit, const VuInstruction inst)
unit->i.write_uword(inst.value);
// (In case you are wondering... LOI is a pseudo-instruction, it's
// not supposed to be referenced)
}

View file

@ -12,8 +12,8 @@
#include <boost/log/utility/setup/file.hpp>
#include <Console.hpp>
#include <Macros.hpp>
#include <Datetime.hpp>
#include <Macros.hpp>
#include "Core.hpp"

View file

@ -95,8 +95,7 @@ public:
CEREAL_NVP(access_read_write),
CEREAL_NVP(access_area_index),
CEREAL_NVP(access_max_block_index),
CEREAL_NVP(access_block_index)
);
CEREAL_NVP(access_block_index));
}
};

View file

@ -37,8 +37,7 @@ public:
{
archive(
CEREAL_NVP(ready),
CEREAL_NVP(data_in)
);
CEREAL_NVP(data_in));
}
};
@ -69,7 +68,6 @@ public:
{
archive(
cereal::base_class<SizedByteRegister>(this),
CEREAL_NVP(write_latch)
);
CEREAL_NVP(write_latch));
}
};

View file

@ -37,7 +37,6 @@ public:
CEREAL_NVP(day),
CEREAL_NVP(month),
CEREAL_NVP(year),
CEREAL_NVP(microseconds)
);
CEREAL_NVP(microseconds));
}
};

View file

@ -107,7 +107,6 @@ public:
CEREAL_NVP(key_xor),
CEREAL_NVP(dec_set),
CEREAL_NVP(nvram),
CEREAL_NVP(rtc)
);
CEREAL_NVP(rtc));
}
};

View file

@ -120,7 +120,6 @@ public:
CEREAL_NVP(dvbm),
CEREAL_NVP(pccr),
CEREAL_NVP(pcr0),
CEREAL_NVP(pcr1)
);
CEREAL_NVP(pcr1));
}
};

View file

@ -127,8 +127,7 @@ public:
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(interrupts_masked),
CEREAL_NVP(operating_context),
CEREAL_NVP(count_interrupts_enabled)
);
CEREAL_NVP(count_interrupts_enabled));
}
};
@ -171,8 +170,7 @@ public:
{
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(irq_lines)
);
CEREAL_NVP(irq_lines));
}
};

View file

@ -47,7 +47,6 @@ public:
CEREAL_NVP(fpr),
CEREAL_NVP(acc),
CEREAL_NVP(irr),
CEREAL_NVP(csr)
);
CEREAL_NVP(csr));
}
};

View file

@ -50,7 +50,6 @@ public:
CEREAL_NVP(gpr),
CEREAL_NVP(hi),
CEREAL_NVP(lo),
CEREAL_NVP(sa)
);
CEREAL_NVP(sa));
}
};

View file

@ -47,7 +47,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(tlb_entries)
);
CEREAL_NVP(tlb_entries));
}
};

View file

@ -55,8 +55,7 @@ public:
archive(
CEREAL_NVP(pagemask),
CEREAL_NVP(evenodd_mask),
CEREAL_NVP(tlb_mask)
);
CEREAL_NVP(tlb_mask));
}
};
@ -89,8 +88,7 @@ public:
CEREAL_NVP(pfn),
CEREAL_NVP(c),
CEREAL_NVP(d),
CEREAL_NVP(v)
);
CEREAL_NVP(v));
}
} physical_info[2]; // Index 0 = Even, index 1 = Odd.
@ -104,7 +102,6 @@ public:
CEREAL_NVP(g),
CEREAL_NVP(asid),
CEREAL_NVP(s),
CEREAL_NVP(physical_info)
);
CEREAL_NVP(physical_info));
}
};

View file

@ -40,7 +40,6 @@ public:
CEREAL_NVP(cop0),
CEREAL_NVP(fpu),
CEREAL_NVP(tlb),
CEREAL_NVP(scratchpad_memory)
);
CEREAL_NVP(scratchpad_memory));
}
};

View file

@ -82,8 +82,7 @@ public:
CEREAL_NVP(tag_exit),
CEREAL_NVP(tag_stall),
CEREAL_NVP(tag_irq),
CEREAL_NVP(dma_tag)
);
CEREAL_NVP(dma_tag));
}
};

View file

@ -58,8 +58,7 @@ public:
CEREAL_NVP(channel_id),
CEREAL_NVP(madr),
CEREAL_NVP(qwc),
CEREAL_NVP(chcr)
);
CEREAL_NVP(chcr));
}
};
@ -81,8 +80,7 @@ public:
{
archive(
cereal::base_class<EeDmacChannel_Base<EeDmacChannelRegister_Chcr_Ty>>(this),
CEREAL_NVP(tadr)
);
CEREAL_NVP(tadr));
}
};
@ -104,8 +102,7 @@ public:
{
archive(
cereal::base_class<EeDmacChannel_Tadr<EeDmacChannelRegister_Chcr_Ty>>(this),
CEREAL_NVP(asr)
);
CEREAL_NVP(asr));
}
};
@ -127,8 +124,7 @@ public:
{
archive(
cereal::base_class<EeDmacChannel_Base<EeDmacChannelRegister_Chcr_Ty>>(this),
CEREAL_NVP(sadr)
);
CEREAL_NVP(sadr));
}
};
@ -152,7 +148,6 @@ public:
archive(
cereal::base_class<EeDmacChannel_Base<EeDmacChannelRegister_Chcr_Ty>>(this),
CEREAL_NVP(tadr),
CEREAL_NVP(sadr)
);
CEREAL_NVP(sadr));
}
};

View file

@ -84,7 +84,6 @@ public:
{
archive(
CEREAL_NVP(tag0),
CEREAL_NVP(tag1)
);
CEREAL_NVP(tag1));
}
};

View file

@ -98,7 +98,6 @@ public:
CEREAL_NVP(memory_e070),
CEREAL_NVP(memory_f500),
CEREAL_NVP(memory_f530),
CEREAL_NVP(memory_f5a0)
);
CEREAL_NVP(memory_f5a0));
}
};

View file

@ -1,7 +1,7 @@
#pragma once
#include <cereal/cereal.hpp>
#include <cereal/access.hpp>
#include <cereal/cereal.hpp>
#include <cereal/types/polymorphic.hpp>
#include <cereal/types/string.hpp>
@ -45,7 +45,8 @@ public:
archive(
cereal::base_class<ArrayByteMemory>(this)
#if DEBUG_LOG_SIO_MESSAGES
,CEREAL_NVP(sio_buffer)
,
CEREAL_NVP(sio_buffer)
#endif
);
}
@ -79,8 +80,7 @@ public:
{
archive(
cereal::base_class<ArrayByteMemory>(this),
CEREAL_NVP(rdram_sdevid)
);
CEREAL_NVP(rdram_sdevid));
}
};

View file

@ -40,7 +40,6 @@ public:
CEREAL_NVP(cnt),
CEREAL_NVP(p3cnt),
CEREAL_NVP(p3tag),
CEREAL_NVP(memory_30b0)
);
CEREAL_NVP(memory_30b0));
}
};

View file

@ -22,7 +22,6 @@ public:
archive(
CEREAL_NVP(mask),
CEREAL_NVP(stat),
CEREAL_NVP(memory_f020)
);
CEREAL_NVP(memory_f020));
}
};

View file

@ -29,7 +29,6 @@ public:
CEREAL_NVP(ctrl),
CEREAL_NVP(bp),
CEREAL_NVP(top),
CEREAL_NVP(memory_2040)
);
CEREAL_NVP(memory_2040));
}
};

View file

@ -78,7 +78,6 @@ public:
CEREAL_NVP(memory_f410),
CEREAL_NVP(register_f420),
CEREAL_NVP(memory_mch),
CEREAL_NVP(memory_f450)
);
CEREAL_NVP(memory_f450));
}
};

View file

@ -44,8 +44,7 @@ public:
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(is_overflowed),
CEREAL_NVP(prescale_target),
CEREAL_NVP(prescale_count)
);
CEREAL_NVP(prescale_count));
}
};
@ -89,7 +88,6 @@ public:
{
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(write_latch)
);
CEREAL_NVP(write_latch));
}
};

View file

@ -40,8 +40,7 @@ public:
archive(
CEREAL_NVP(count),
CEREAL_NVP(mode),
CEREAL_NVP(compare)
);
CEREAL_NVP(compare));
}
};
@ -59,7 +58,6 @@ public:
{
archive(
cereal::base_class<EeTimersUnit_Base>(this),
CEREAL_NVP(hold)
);
CEREAL_NVP(hold));
}
};

View file

@ -28,7 +28,6 @@ public:
CEREAL_NVP(unit_0),
CEREAL_NVP(unit_1),
CEREAL_NVP(unit_2),
CEREAL_NVP(unit_3)
);
CEREAL_NVP(unit_3));
}
};

View file

@ -26,7 +26,6 @@ public:
archive(
CEREAL_NVP(stat),
CEREAL_NVP(vif),
CEREAL_NVP(vu)
);
CEREAL_NVP(vu));
}
};

View file

@ -21,7 +21,6 @@ public:
{
archive(
CEREAL_NVP(unit_0),
CEREAL_NVP(unit_1)
);
CEREAL_NVP(unit_1));
}
};

View file

@ -69,7 +69,6 @@ public:
CEREAL_NVP(code),
CEREAL_NVP(stat),
CEREAL_NVP(fbrst),
CEREAL_NVP(err)
);
CEREAL_NVP(err));
}
};

View file

@ -27,7 +27,6 @@ public:
archive(
CEREAL_NVP(unit_0),
CEREAL_NVP(unit_1),
CEREAL_NVP(fbrst)
);
CEREAL_NVP(fbrst));
}
};

View file

@ -107,7 +107,6 @@ public:
CEREAL_NVP(current_slot),
CEREAL_NVP(branch_pc),
CEREAL_NVP(second_branch_pc),
CEREAL_NVP(second_branch_pending)
);
CEREAL_NVP(second_branch_pending));
}
};

View file

@ -1,4 +1,5 @@
#include "Resources/Ee/Vpu/Vu/VuInstruction.hpp"
#include "Resources/Ee/Vpu/Vu/VuPipelines.hpp"
MipsInstructionInfo VU_INSTRUCTION_TABLE[Constants::EE::VPU::VU::NUMBER_VU_INSTRUCTIONS] =

View file

@ -80,7 +80,6 @@ struct VuInstruction : public MipsInstruction
return fs();
}
ubyte opcode() const
{
return static_cast<ubyte>(OPCODE.extract_from(value));
@ -101,7 +100,8 @@ struct VuInstruction : public MipsInstruction
return static_cast<ubyte>(FSF.extract_from(value));
}
ubyte imm5() const {
ubyte imm5() const
{
// FD is IMM5 in some instructions
return static_cast<ubyte>(FD.extract_from(value));
}

View file

@ -223,8 +223,7 @@ std::optional<int> VuInstructionDecoder::upper_src(int index) const
const std::optional<VuDecodeInfo>* src_regs[3] = {
&decoded_inst_upper.source_reg_1,
&decoded_inst_upper.source_reg_2,
&decoded_inst_upper.source_reg_3
};
&decoded_inst_upper.source_reg_3};
if (src_regs[index]->has_value())
{
@ -257,8 +256,7 @@ std::optional<int> VuInstructionDecoder::lower_src(int index) const
const std::optional<VuDecodeInfo>* src_regs[3] = {
&decoded_inst_lower.source_reg_1,
&decoded_inst_lower.source_reg_2,
&decoded_inst_lower.source_reg_3
};
&decoded_inst_lower.source_reg_3};
if (src_regs[index]->has_value())
{

View file

@ -48,8 +48,7 @@ struct VuDecodedInst
std::optional<VuDecodeInfo> src_1,
std::optional<VuDecodeInfo> src_2,
std::optional<VuDecodeInfo> src_3,
int dest_field
) :
int dest_field) :
dest_reg(dest),
source_reg_1(src_1),
source_reg_2(src_2),

View file

@ -5,7 +5,8 @@
struct VuPipeline
{
enum {
enum
{
FMAC = 0,
FDIV = 1,
EFU = 2,

View file

@ -1,8 +1,9 @@
#pragma once
#include <optional>
#include <cereal/cereal.hpp>
#include <cereal/types/polymorphic.hpp>
#include <optional>
#include "Common/Constants.hpp"
#include "Common/Types/Bus/ByteBus.hpp"
@ -107,8 +108,7 @@ public:
CEREAL_NVP(mac),
CEREAL_NVP(clipping),
CEREAL_NVP(pc),
CEREAL_NVP(cmsar)
);
CEREAL_NVP(cmsar));
}
};
@ -147,8 +147,7 @@ public:
archive(
cereal::base_class<VuUnit_Base>(this),
CEREAL_NVP(memory_micro),
CEREAL_NVP(memory_mem)
);
CEREAL_NVP(memory_mem));
}
};
@ -169,7 +168,6 @@ public:
archive(
cereal::base_class<VuUnit_Base>(this),
CEREAL_NVP(memory_micro),
CEREAL_NVP(memory_mem)
);
CEREAL_NVP(memory_mem));
}
};

View file

@ -77,7 +77,6 @@ public:
CEREAL_NVP(siglblid),
CEREAL_NVP(memory_1090),
CEREAL_NVP(memory_1100),
CEREAL_NVP(memory_2000)
);
CEREAL_NVP(memory_2000));
}
};

View file

@ -65,7 +65,6 @@ public:
CEREAL_NVP(cause),
CEREAL_NVP(epc),
CEREAL_NVP(prid),
CEREAL_NVP(erreg)
);
CEREAL_NVP(erreg));
}
};

View file

@ -78,8 +78,7 @@ public:
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(interrupts_masked),
CEREAL_NVP(operating_context)
);
CEREAL_NVP(operating_context));
}
};
@ -116,8 +115,7 @@ public:
{
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(irq_lines)
);
CEREAL_NVP(irq_lines));
}
};

View file

@ -42,7 +42,6 @@ public:
CEREAL_NVP(bdelay),
CEREAL_NVP(gpr),
CEREAL_NVP(hi),
CEREAL_NVP(lo)
);
CEREAL_NVP(lo));
}
};

View file

@ -27,7 +27,6 @@ public:
archive(
CEREAL_NVP(r3000),
CEREAL_NVP(cop0),
CEREAL_NVP(scratchpad_memory)
);
CEREAL_NVP(scratchpad_memory));
}
};

View file

@ -73,8 +73,7 @@ public:
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(dma_started),
CEREAL_NVP(dma_tag)
);
CEREAL_NVP(dma_tag));
}
};
@ -107,8 +106,7 @@ public:
{
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(transfer_length)
);
CEREAL_NVP(transfer_length));
}
};

View file

@ -52,8 +52,7 @@ public:
archive(
CEREAL_NVP(madr),
CEREAL_NVP(bcr),
CEREAL_NVP(chcr)
);
CEREAL_NVP(chcr));
}
};
@ -75,7 +74,6 @@ public:
{
archive(
cereal::base_class<IopDmacChannel_Base<IopDmacChannelRegister_Chcr_Ty>>(this),
CEREAL_NVP(tadr)
);
CEREAL_NVP(tadr));
}
};

View file

@ -66,7 +66,6 @@ public:
{
archive(
CEREAL_NVP(tag0),
CEREAL_NVP(tag1)
);
CEREAL_NVP(tag1));
}
};

View file

@ -66,7 +66,6 @@ public:
CEREAL_NVP(channel_sif0),
CEREAL_NVP(channel_sif1),
CEREAL_NVP(channel_tosio2),
CEREAL_NVP(channel_fromsio2)
);
CEREAL_NVP(channel_fromsio2));
}
};

View file

@ -19,7 +19,6 @@ public:
archive(
CEREAL_NVP(ctrl),
CEREAL_NVP(mask),
CEREAL_NVP(stat)
);
CEREAL_NVP(stat));
}
};

View file

@ -109,7 +109,6 @@ public:
CEREAL_NVP(register_1568),
CEREAL_NVP(register_15f0),
CEREAL_NVP(register_2070),
CEREAL_NVP(register_3800)
);
CEREAL_NVP(register_3800));
}
};

View file

@ -23,7 +23,6 @@ public:
CEREAL_NVP(data),
CEREAL_NVP(stat),
CEREAL_NVP(mode),
CEREAL_NVP(ctrl)
);
CEREAL_NVP(ctrl));
}
};

View file

@ -76,7 +76,6 @@ public:
{
archive(
CEREAL_NVP(command_queue),
CEREAL_NVP(response_queue)
);
CEREAL_NVP(response_queue));
}
};

View file

@ -72,7 +72,6 @@ public:
CEREAL_NVP(recv3),
CEREAL_NVP(register_8278),
CEREAL_NVP(register_827c),
CEREAL_NVP(intr)
);
CEREAL_NVP(intr));
}
};

View file

@ -46,7 +46,6 @@ public:
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(write_latch),
CEREAL_NVP(port_transfer_started)
);
CEREAL_NVP(port_transfer_started));
}
};

View file

@ -29,8 +29,7 @@ public:
archive(
CEREAL_NVP(ctrl_1),
CEREAL_NVP(ctrl_2),
CEREAL_NVP(ctrl_3)
);
CEREAL_NVP(ctrl_3));
}
};
@ -44,7 +43,6 @@ public:
void serialize(Archive& archive)
{
archive(
CEREAL_NVP(ctrl_3)
);
CEREAL_NVP(ctrl_3));
}
};

View file

@ -55,7 +55,6 @@ public:
CEREAL_NVP(transfer_port),
CEREAL_NVP(transfer_port_count),
CEREAL_NVP(transfer_direction),
CEREAL_NVP(write_latch)
);
CEREAL_NVP(write_latch));
}
};

View file

@ -55,8 +55,7 @@ public:
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(is_overflowed),
CEREAL_NVP(prescale_target),
CEREAL_NVP(prescale_count)
);
CEREAL_NVP(prescale_count));
}
};
@ -108,7 +107,6 @@ public:
{
archive(
cereal::base_class<SizedWordRegister>(this),
CEREAL_NVP(write_latch)
);
CEREAL_NVP(write_latch));
}
};

View file

@ -25,7 +25,6 @@ public:
archive(
CEREAL_NVP(count),
CEREAL_NVP(mode),
CEREAL_NVP(compare)
);
CEREAL_NVP(compare));
}
};

View file

@ -32,7 +32,6 @@ public:
CEREAL_NVP(unit_2),
CEREAL_NVP(unit_3),
CEREAL_NVP(unit_4),
CEREAL_NVP(unit_5)
);
CEREAL_NVP(unit_5));
}
};

View file

@ -114,8 +114,7 @@ public:
CEREAL_NVP(fifo_spu2c1),
CEREAL_NVP(fifo_dev9),
CEREAL_NVP(fifo_fromsio2),
CEREAL_NVP(fifo_tosio2)
);
CEREAL_NVP(fifo_tosio2));
}
};

View file

@ -62,7 +62,6 @@ public:
CEREAL_NVP(memory_0346),
CEREAL_NVP(memory_0746),
CEREAL_NVP(memory_07b0),
CEREAL_NVP(memory_07ce)
);
CEREAL_NVP(memory_07ce));
}
};

View file

@ -17,6 +17,5 @@ struct Spu2CoreConstants
static constexpr Spu2CoreInfo SPU2_STATIC_INFO[Constants::SPU2::NUMBER_CORES] =
{
{0x2000, 0x2200},
{0x2400, 0x2600}
};
{0x2400, 0x2600}};
};

View file

@ -103,8 +103,7 @@ public:
{
archive(
cereal::base_class<SizedHwordRegister>(this),
CEREAL_NVP(dma_offset)
);
CEREAL_NVP(dma_offset));
}
};

View file

@ -42,7 +42,6 @@ public:
CEREAL_NVP(lsaxh),
CEREAL_NVP(lsaxl),
CEREAL_NVP(naxh),
CEREAL_NVP(naxl)
);
CEREAL_NVP(naxl));
}
};

View file

@ -271,7 +271,6 @@ public:
CEREAL_NVP(voice_20),
CEREAL_NVP(voice_21),
CEREAL_NVP(voice_22),
CEREAL_NVP(voice_23)
);
CEREAL_NVP(voice_23));
}
};