projects
/
dcpu16
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor cleanup
[dcpu16]
/
dcpu16.c
diff --git
a/dcpu16.c
b/dcpu16.c
index 165b58984e298d76a2cdce30334a2dc141826344..23ef53a41747da7aadb9a51baec085033d5e1bab 100644
(file)
--- a/
dcpu16.c
+++ b/
dcpu16.c
@@
-26,6
+26,8
@@
* TODO
* change api to print into buffers rather than stdio
* refactor opcode functiontables into switch statements
* TODO
* change api to print into buffers rather than stdio
* refactor opcode functiontables into switch statements
+ * let callbacks determine whether to override events, or just observe
+ * sort init callbacks by base addr, to call in-order
*/
static const char * const src_id_ = "$Id$";
*/
static const char * const src_id_ = "$Id$";
@@
-691,6
+693,8
@@
void dcpu16_step(struct dcpu16 *d) {
if (!d) return;
if (!d) return;
+ acct_event_(d, DCPU16_ACCT_EV_CYCLE, d->pc);
+
/*
PC is advanced while decoding the operands by the opcode functions.
Things like this could be organized a little better..
/*
PC is advanced while decoding the operands by the opcode functions.
Things like this could be organized a little better..
@@
-763,7
+767,7
@@
void dcpu16_dump_ram(struct dcpu16 *d, DCPU16_WORD start, DCPU16_WORD end) {
* Register callback fn to be triggered whenever event matching any events
* in bitwise mask occur.
*/
* Register callback fn to be triggered whenever event matching any events
* in bitwise mask occur.
*/
-int dcpu16_acct_add(struct dcpu16 *vm, dcpu16_acct_event mask,
void (*fn)(struct dcpu16 *, dcpu16_acct_event, DCPU16_WORD, void *)
, void *data) {
+int dcpu16_acct_add(struct dcpu16 *vm, dcpu16_acct_event mask,
dcpu16_ev_cb_t *fn
, void *data) {
struct dcpu16_acct_cb cb;
cb.mask = mask;
struct dcpu16_acct_cb cb;
cb.mask = mask;