X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=dcpu16.c;fp=dcpu16.c;h=a0e1ad0ca3864ee2be54535b1f5030c79713a9a2;hp=6ab689888d70a28587f07a47560adf1130d254cd;hb=8b552fe61db48874f043bccfb589e5444509444c;hpb=57241bb9e6f6b1acb019efe4f32eb758cf9e93d7 diff --git a/dcpu16.c b/dcpu16.c index 6ab6898..a0e1ad0 100644 --- a/dcpu16.c +++ b/dcpu16.c @@ -172,7 +172,7 @@ void dcpu16_cycle_inc(struct dcpu16 *vm, unsigned int n) { /* signal attached hardware */ for (i = 0; i < vm->hw_table_entries_; i++) { TRACE("%s>> notifying %s", __func__, vm->hw_table_[i].name_); - vm->hw_table_[i].cycle(vm, vm->hw_table_[i].data); + vm->hw_table_[i].cycle(vm, &vm->hw_table_[i]); } } } @@ -533,7 +533,7 @@ OP_IMPL(nbi_hwi) { dcpu16_cycle_inc(vm, 4); if (vm->hw_table_[*a].hwi) - vm->hw_table_[*a].hwi(vm, vm->hw_table_[*a].data); + vm->hw_table_[*a].hwi(vm, &vm->hw_table_[*a]); else WARN("hardware 0x%04x has no interrupt handler", *a); } @@ -1396,7 +1396,7 @@ void dcpu16_hw_del(struct dcpu16_hw **hw) { /* dcpu16_hw_add * registers new 'hardware' device with system */ -int dcpu16_hw_add(struct dcpu16 *vm, struct dcpu16_hw *hw) { +int dcpu16_hw_attach(struct dcpu16 *vm, struct dcpu16_hw *hw) { if (!vm || !hw) return -1; @@ -1485,7 +1485,7 @@ void dcpu16_reset(struct dcpu16 *vm) { /* signal attached hardware */ for (i = 0; i < vm->hw_table_entries_; i++) { if (vm->hw_table_[i].reset) - vm->hw_table_[i].reset(vm, vm->hw_table_[i].data); + vm->hw_table_[i].reset(vm, &vm->hw_table_[i]); } memset(vm->reg, 0, sizeof vm->reg);