Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SI: Add 16bit accessors for SI IO buffer #7331

Merged
merged 1 commit into from Sep 28, 2018

Conversation

booto
Copy link
Contributor

@booto booto commented Aug 15, 2018

Adding some extra accessors to the SI IO buffer.

Dolphin has traditionally treated the SI IO buffer (128 bytes) as a set of
32 little endian u32s. This works out fine if you only ever read/write
using aligned 32bit accesses. Different sized accesses or misaligned reads
will mess it up. Byte swapping reads/writes will fix this up, but all the
SI devices that use the SI IO buffer need to be fixed.

m_code->SHR(64, R(m_dst_reg), Imm8(48));
break;
case 32:
m_code->SHR(64, R(m_dst_reg), Imm8(32));

This comment was marked as off-topic.

This comment was marked as off-topic.

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

This comment was marked as off-topic.

This comment was marked as off-topic.

@booto booto changed the title SI: Add 16bit accessors for SI IO buffer [WIP] SI: Add 16bit accessors for SI IO buffer Aug 16, 2018
@JMC47
Copy link
Contributor

JMC47 commented Aug 22, 2018

Works with all of our devices. Tested Keyboard, Dancemat (lol), Standard Controller, Steering Wheel, and Bongos.

@booto booto changed the title [WIP] SI: Add 16bit accessors for SI IO buffer SI: Add 16bit accessors for SI IO buffer Aug 22, 2018
Dolphin has traditionally treated the SI IO buffer (128 bytes) as a set of
32 little endian u32s. This works out fine if you only ever read/write
using aligned 32bit accesses. Different sized accesses or misaligned reads
will mess it up. Byte swapping reads/writes will fix this up, but all the
SI devices that use the SI IO buffer need to be adjusted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants