Skip to content

Commit

Permalink
SI: Add 16bit accessors for SI IO buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
booto committed Aug 15, 2018
1 parent 60f12e1 commit 79f6d57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/Core/Core/HW/SI/SI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum
SI_COM_CSR = 0x34,
SI_STATUS_REG = 0x38,
SI_EXI_CLOCK_COUNT = 0x3C,
SI_IO_BUFFER = 0x80,
};

// SI Channel Output
Expand Down Expand Up @@ -416,11 +417,18 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
// Register SI buffer direct accesses.
for (size_t i = 0; i < s_si_buffer.size(); i += sizeof(u32))
{
const u32 address = base | static_cast<u32>(s_si_buffer.size() + i);
const u32 address = base | static_cast<u32>(SI_IO_BUFFER + i);

mmio->Register(address, MMIO::DirectRead<u32>((u32*)&s_si_buffer[i]),
MMIO::DirectWrite<u32>((u32*)&s_si_buffer[i]));
}
for (size_t i = 0; i < s_si_buffer.size(); i += sizeof(u16))
{
const u32 address = base | static_cast<u32>(SI_IO_BUFFER + i);

mmio->Register(address, MMIO::DirectRead<u16>((u16*)&s_si_buffer[i]),
MMIO::DirectWrite<u16>((u16*)&s_si_buffer[i]));
}

// In and out for the 4 SI channels.
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
Expand Down

0 comments on commit 79f6d57

Please sign in to comment.