mirror of
https://github.com/rkujawa/rk65c02.git
synced 2025-03-04 05:29:22 +00:00
Add ability to load things onto bus from buffer.
This commit is contained in:
parent
eb7179f89a
commit
3075ed87fa
17
src/bus.c
17
src/bus.c
@ -47,6 +47,23 @@ bus_init()
|
||||
return t;
|
||||
}
|
||||
|
||||
bool
|
||||
bus_load_buf(bus_t *t, uint16_t addr, uint8_t *buf, uint16_t bufsize)
|
||||
{
|
||||
uint16_t i;
|
||||
|
||||
i = 0;
|
||||
|
||||
/* XXX: add sanity checks */
|
||||
|
||||
while (i < bufsize) {
|
||||
t->space[i] = buf[i]; // XXX: overflow addr
|
||||
i++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
bus_load_file(bus_t *t, uint16_t addr, const char *filename)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user