Fix up compile errors, added lock to EE DMAC while suspending channel (fixes a hang).

This commit is contained in:
Marco Satti 2018-01-22 22:37:31 +08:00
parent 61c77807fa
commit d44c0b9c18
9 changed files with 18 additions and 12 deletions

View file

@ -118,7 +118,7 @@ int CEeCoreInterpreter::time_step(const int ticks_available) const
#endif
// Return the number of cycles completed.
return inst.get_info()->cpi;
return 1; // TODO: fix CPI's. inst.get_info()->cpi;
}
void CEeCoreInterpreter::handle_interrupt_check() const
@ -155,7 +155,7 @@ void CEeCoreInterpreter::debug_print_interrupt_info() const
uword im_status = cop0.status.extract_field(EeCoreCop0Register_Status::IM);
BOOST_LOG(Core::get_logger()) <<
boost::format("EECore IntEx @ cycle = 0x%llX, PC = 0x%08X, BD = %d.")
boost::format("EeCore IntEx @ cycle = 0x%llX, PC = 0x%08X, BD = %d.")
% DEBUG_LOOP_COUNTER
% r.ee.core.r5900.pc.read_uword()
% r.ee.core.r5900.bdelay.is_branch_pending();

View file

@ -212,6 +212,7 @@ int CEeDmac::transfer_data(EeDmacChannel & channel) const
void CEeDmac::set_state_suspended(EeDmacChannel & channel) const
{
auto& r = core->get_resources();
auto _lock = r.ee.dmac.stat.scope_lock();
// Emit the interrupt status bit.
r.ee.dmac.stat.insert_field(EeDmacRegister_Stat::CHANNEL_CIS_KEYS[*channel.channel_id], 1);
@ -424,7 +425,7 @@ bool CEeDmac::transfer_interleaved(EeDmacChannel & channel) const
void CEeDmac::handle_interrupt_check() const
{
auto& r = core->get_resources();
auto _stat_lock = r.ee.dmac.stat.scope_lock();
auto _lock = r.ee.dmac.stat.scope_lock();
// Set the interrupt line if there was a condition set, otherwise clear the interrupt line.
if (r.ee.dmac.stat.is_interrupt_pending())

View file

@ -116,7 +116,7 @@ int CIopCoreInterpreter::time_step(const int ticks_available) const
#endif
// Return the number of cycles completed.
return inst.get_info()->cpi;
return 1; // TODO: fix CPI's. inst.get_info()->cpi;
}
void CIopCoreInterpreter::handle_interrupt_check() const
@ -150,7 +150,7 @@ void CIopCoreInterpreter::debug_print_interrupt_info() const
auto& mask = r.iop.intc.mask;
BOOST_LOG(Core::get_logger()) <<
boost::format("IOPCore IntEx @ cycle = 0x%llX, PC = 0x%08X, BD = %d.")
boost::format("IopCore IntEx @ cycle = 0x%llX, PC = 0x%08X, BD = %d.")
% DEBUG_LOOP_COUNTER
% r.iop.core.r3000.pc.read_uword()
% r.iop.core.r3000.bdelay.is_branch_pending();

View file

@ -90,7 +90,7 @@ void CSio0::handle_irq_check() const
// Raise IOP INTC IRQ if requested.
if (stat.extract_field(Sio0Register_Stat::IRQ))
{
auto& _lock = r.iop.intc.stat.scope_lock();
auto _lock = r.iop.intc.stat.scope_lock();
r.iop.intc.stat.insert_field(IopIntcRegister_Stat::SIO0, 1);
}
}

View file

@ -43,9 +43,14 @@ CoreOptions CoreOptions::make_default()
"",
"",
"",
50,
100,
std::thread::hardware_concurrency() - 1,
EnumMap<ControllerType::Type, double>(1.0)
{2.0, 1.0, 1.0, 1.0, // TODO: while in development, cheat for now :)
1.0, 1.0, 1.0, 1.0,
2.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0 }
// EnumMap<ControllerType::Type, double>(1.0)
};
}

View file

@ -38,7 +38,7 @@ struct EeDmacConstants
static constexpr int STS_MAP[4] = { 0, 5, 8, 3 };
static constexpr int STD_MAP[4] = { 0, 1, 2, 6 };
static constexpr char * MNEMONICS[Constants::EE::DMAC::NUMBER_DMAC_CHANNELS] =
static constexpr const char * MNEMONICS[Constants::EE::DMAC::NUMBER_DMAC_CHANNELS] =
{
"VIF0",
"VIF1",

View file

@ -4,7 +4,7 @@
struct EeIntcConstants
{
static constexpr char * MNEMONICS[Constants::EE::INTC::NUMBER_IRQ_LINES] =
static constexpr const char * MNEMONICS[Constants::EE::INTC::NUMBER_IRQ_LINES] =
{
"GS",
"SBUS",

View file

@ -4,7 +4,7 @@
struct IopDmacConstants
{
static constexpr char * MNEMONICS[Constants::IOP::DMAC::NUMBER_DMAC_CHANNELS] =
static constexpr const char * MNEMONICS[Constants::IOP::DMAC::NUMBER_DMAC_CHANNELS] =
{
"toMDEC",
"fromMDEC",

View file

@ -4,7 +4,7 @@
struct IopIntcConstants
{
static constexpr char * MNEMONICS[Constants::IOP::INTC::NUMBER_IRQ_LINES] =
static constexpr const char * MNEMONICS[Constants::IOP::INTC::NUMBER_IRQ_LINES] =
{
"VBLANK",
"GPU",