dreamcast/sh7091/imask.hpp
Zack Buhman dcb9f36120 sh7091_bits.ods: partial
Notably missing is:

- BSC (PDTRA / PCTRA)

This also updates a handful of files to use the new sh7091_bits.hpp.
2024-01-01 23:43:06 +08:00

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)
);
}