This commit is contained in:
Davide Pesavento 2025-07-27 06:28:51 +00:00 committed by GitHub
commit 6ab91ceeea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 42 additions and 19 deletions

View File

@ -442,22 +442,22 @@ void GPU::UpdateDMARequest()
{
case BlitterState::Idle:
m_GPUSTAT.ready_to_send_vram = false;
m_GPUSTAT.ready_to_recieve_dma = (m_fifo.IsEmpty() || m_fifo.GetSize() < m_command_total_words);
m_GPUSTAT.ready_to_receive_dma = (m_fifo.IsEmpty() || m_fifo.GetSize() < m_command_total_words);
break;
case BlitterState::WritingVRAM:
m_GPUSTAT.ready_to_send_vram = false;
m_GPUSTAT.ready_to_recieve_dma = (m_fifo.GetSize() < m_fifo_size);
m_GPUSTAT.ready_to_receive_dma = (m_fifo.GetSize() < m_fifo_size);
break;
case BlitterState::ReadingVRAM:
m_GPUSTAT.ready_to_send_vram = true;
m_GPUSTAT.ready_to_recieve_dma = false;
m_GPUSTAT.ready_to_receive_dma = false;
break;
case BlitterState::DrawingPolyLine:
m_GPUSTAT.ready_to_send_vram = false;
m_GPUSTAT.ready_to_recieve_dma = (m_fifo.GetSize() < m_fifo_size);
m_GPUSTAT.ready_to_receive_dma = (m_fifo.GetSize() < m_fifo_size);
break;
default:
@ -473,11 +473,11 @@ void GPU::UpdateDMARequest()
break;
case GPUDMADirection::FIFO:
dma_request = m_GPUSTAT.ready_to_recieve_dma;
dma_request = m_GPUSTAT.ready_to_receive_dma;
break;
case GPUDMADirection::CPUtoGP0:
dma_request = m_GPUSTAT.ready_to_recieve_dma;
dma_request = m_GPUSTAT.ready_to_receive_dma;
break;
case GPUDMADirection::GPUREADtoCPU:

View File

@ -205,7 +205,7 @@ union GPUSTAT
BitField<u32, bool, 25, 1> dma_data_request;
BitField<u32, bool, 26, 1> gpu_idle;
BitField<u32, bool, 27, 1> ready_to_send_vram;
BitField<u32, bool, 28, 1> ready_to_recieve_dma;
BitField<u32, bool, 28, 1> ready_to_receive_dma;
BitField<u32, GPUDMADirection, 29, 2> dma_direction;
BitField<u32, bool, 31, 1> display_line_lsb;

View File

@ -544,23 +544,19 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
case Column_Year:
{
if (ge->dbentry && ge->dbentry->release_date != 0)
{
return QStringLiteral("%1").arg(
QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), QTimeZone::utc())
.date()
.year());
}
else
{
return QString();
}
if (!ge->dbentry || ge->dbentry->release_date == 0)
return {};
return QString::number(
QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), QTimeZone::utc())
.date()
.year());
}
case Column_Players:
{
if (!ge->dbentry || ge->dbentry->min_players == 0)
return QString();
return {};
else if (ge->dbentry->min_players == ge->dbentry->max_players)
return QStringLiteral("%1").arg(ge->dbentry->min_players);
else
@ -596,6 +592,9 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
else
return {};
}
default:
return {};
}
}
@ -651,6 +650,30 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
const_cast<GameListModel*>(this)->loadOrGenerateCover(ge);
return *m_cover_pixmap_cache.Insert(ge->path, m_loading_pixmap);
}
default:
return {};
}
}
case Qt::ToolTipRole:
{
switch (index.column())
{
case Column_TimePlayed:
if (ge->total_played_time == 0)
return {};
else
return QtUtils::StringViewToQString(GameList::FormatTimespan(ge->total_played_time, false));
case Column_LastPlayed:
if (ge->last_played_time == 0)
return {};
else
return QtHost::FormatNumber(Host::NumberFormatType::LongDateTime, static_cast<s64>(ge->last_played_time));
default:
return {};
}
}
}