sanity checks
This commit is contained in:
parent
093cfdeb0c
commit
3acf43acf7
1 changed files with 5 additions and 0 deletions
5
bus.cpp
5
bus.cpp
|
@ -635,6 +635,11 @@ void bus::clearMMR1()
|
||||||
|
|
||||||
void bus::addToMMR1(const int8_t delta, const uint8_t reg)
|
void bus::addToMMR1(const int8_t delta, const uint8_t reg)
|
||||||
{
|
{
|
||||||
|
assert(reg >= 0 && reg <= 7);
|
||||||
|
assert(delta >= -2 && delta <= 2);
|
||||||
|
|
||||||
|
assert(MMR1 < 256);
|
||||||
|
|
||||||
MMR1 <<= 8;
|
MMR1 <<= 8;
|
||||||
|
|
||||||
MMR1 |= (delta & 31) << 3;
|
MMR1 |= (delta & 31) << 3;
|
||||||
|
|
Loading…
Add table
Reference in a new issue