3 void bus_t::add_device(reg_t addr
, abstract_device_t
* dev
)
8 bool bus_t::load(reg_t addr
, size_t len
, uint8_t* bytes
)
10 fprintf(stderr
, "bus load(0x%lx, %ld)\n", addr
, len
);
11 auto it
= devices
.lower_bound(-addr
);
12 if (it
== devices
.end()) {
13 fprintf(stderr
, " -> false\n");
16 return it
->second
->load(addr
- -it
->first
, len
, bytes
);
19 bool bus_t::store(reg_t addr
, size_t len
, const uint8_t* bytes
)
21 auto it
= devices
.lower_bound(-addr
);
22 if (it
== devices
.end())
24 return it
->second
->store(addr
- -it
->first
, len
, bytes
);