sparc: assume that sparclite waitstate page check is per cs

This commit is contained in:
hap 2021-11-24 12:19:39 +01:00
parent bbc35b4f29
commit eb7996ee5a
3 changed files with 11 additions and 11 deletions

View File

@ -16,7 +16,7 @@ The module doesn't have its own LCD screen. It has a grill+fan underneath
at the front part, and a heatsink on the CPU.
TODO:
- runs too slow? opening book moves take around 3 seconds, but on the real
- runs too slow? opening book moves take around 2.5 seconds, but on the real
device less than 1 second
***************************************************************************/

View File

@ -659,8 +659,8 @@ void mb86930_device::device_reset()
m_spmr = 0;
m_spmr_mask = ~0ULL;
std::fill_n(&m_wssr[0], 3, 0);
m_last_masked_addr = 0ULL;
std::fill_n(&m_last_masked_addr[0], 6, 0ULL);
std::fill_n(&m_same_page_waits[0], 6, 0);
std::fill_n(&m_other_page_waits[0], 6, 0);
@ -819,14 +819,14 @@ uint32_t mb86930_device::mmu_r(offs_t offset, uint32_t mem_mask)
{
const uint64_t full_addr = ((uint64_t)Asi << 30) | offset;
const uint64_t masked_addr = full_addr & m_spmr_mask;
const bool is_same_page = (masked_addr == m_last_masked_addr);
m_last_masked_addr = masked_addr;
for (int cs = 0; cs < 6; cs++)
{
if ((full_addr & m_full_masks[cs]) == m_full_ranges[cs])
{
const uint64_t masked_addr = full_addr & m_spmr_mask;
const bool is_same_page = (masked_addr == m_last_masked_addr[cs]);
m_last_masked_addr[cs] = masked_addr;
eat_cycles(is_same_page ? m_same_page_waits[cs] : m_other_page_waits[cs]);
return m_cs_r[cs](offset, mem_mask);
}
@ -839,14 +839,14 @@ template <uint8_t Asi> void mb86930_device::mmu_w(offs_t offset, uint32_t data,
{
const uint64_t full_addr = ((uint64_t)Asi << 30) | offset;
const uint64_t masked_addr = full_addr & m_spmr_mask;
const bool is_same_page = (masked_addr == m_last_masked_addr);
m_last_masked_addr = masked_addr;
for (int cs = 0; cs < 6; cs++)
{
if ((full_addr & m_full_masks[cs]) == m_full_ranges[cs])
{
const uint64_t masked_addr = full_addr & m_spmr_mask;
const bool is_same_page = (masked_addr == m_last_masked_addr[cs]);
m_last_masked_addr[cs] = masked_addr;
eat_cycles(is_same_page ? m_same_page_waits[cs] : m_other_page_waits[cs]);
m_cs_w[cs](offset, data, mem_mask);
return;

View File

@ -419,7 +419,7 @@ protected:
u32 m_amr[6];
u64 m_full_masks[6];
u64 m_full_ranges[6];
u64 m_last_masked_addr;
u64 m_last_masked_addr[6];
int m_same_page_waits[6];
int m_other_page_waits[6];