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;
|
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
|
bool
|
||||||
bus_load_file(bus_t *t, uint16_t addr, const char *filename)
|
bus_load_file(bus_t *t, uint16_t addr, const char *filename)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,7 @@ void bus_write_1(bus_t *, uint16_t, uint8_t);
|
|||||||
bus_t bus_init();
|
bus_t bus_init();
|
||||||
void bus_finish(bus_t *);
|
void bus_finish(bus_t *);
|
||||||
bool bus_load_file(bus_t *, uint16_t, const char *);
|
bool bus_load_file(bus_t *, uint16_t, const char *);
|
||||||
|
bool bus_load_buf(bus_t *, uint16_t, uint8_t *, uint16_t);
|
||||||
|
|
||||||
#endif /* _BUS_H_ */
|
#endif /* _BUS_H_ */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user