2023-08-28 22:31:24 +02:00
|
|
|
#include "doctest.h"
|
|
|
|
|
2023-08-29 23:11:31 +02:00
|
|
|
#include <memory/bus.h>
|
|
|
|
#include <memory/ram.h>
|
2023-08-28 21:56:54 +02:00
|
|
|
|
2023-08-28 22:31:24 +02:00
|
|
|
TEST_CASE("Bus can map same device twice")
|
2023-08-28 21:56:54 +02:00
|
|
|
{
|
|
|
|
RAM r(0x1000);
|
|
|
|
Bus b;
|
|
|
|
|
|
|
|
b.map_device(0x0000, 0x0FFF, &r);
|
|
|
|
b.map_device(0x2000, 0x2FFF, &r);
|
|
|
|
|
|
|
|
b.write8(0x60, 42);
|
2023-08-28 22:31:24 +02:00
|
|
|
CHECK(b.read8(0x2060) == 42);
|
2023-08-28 21:56:54 +02:00
|
|
|
}
|