There were two notable bugs: - the maple transfer/data sizes were not being set correctly - align_32byte always realigned the address of `_scene`, and not the `mem` parameter as expected. This had the effect of the maple-DMA send and receive buffers being the same buffer. On real hardware, this causes unpredicable behavior.
21 lines
231 B
C++
21 lines
231 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
inline void set_imask(uint32_t imask)
|
|
{
|
|
uint32_t sr;
|
|
|
|
asm volatile ("stc sr,%0"
|
|
: "=r" (sr)
|
|
:
|
|
);
|
|
|
|
sr = (sr & ~0xf0) | (imask << 4);
|
|
|
|
asm volatile ("ldc %0,sr"
|
|
:
|
|
: "r" (sr)
|
|
);
|
|
}
|