X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=hw_spc2000.c;h=f34b276021dedf3f790bd1075fcdf0a4ed0de47a;hb=1470698024f5511a3b94b7bb50b1097cc6659b32;hp=f07489578b1157e80842a8ac0d7027761395ed99;hpb=8b552fe61db48874f043bccfb589e5444509444c;p=dcpu16 diff --git a/hw_spc2000.c b/hw_spc2000.c index f074895..f34b276 100644 --- a/hw_spc2000.c +++ b/hw_spc2000.c @@ -16,7 +16,7 @@ int spc2000_data_init_(struct dcpu16_hw *hw, void *data) { hw->data = calloc(1, sizeof(struct spc2000_)); if (hw->data == NULL) { - hw->vm->warn_cb_("%s():%s", "calloc", strerror(errno)); + hw->vm->msg_cb_(MSG_ERROR, "%s():%s", "calloc", strerror(errno)); return -1; } return 0; @@ -66,7 +66,7 @@ void spc2000_hwi_(struct dcpu16 *vm, struct dcpu16_hw *hw) { || vm->reg[DCPU16_REG_C] != 0) break; /* trigger */ - vm->warn_cb_("spc2000 triggered\n"); + vm->msg_cb_(MSG_INFO, "spc2000 triggered\n"); break; case 1: /* SET_UNIT_TO_SKIP */ @@ -85,9 +85,9 @@ void spc2000_hwi_(struct dcpu16 *vm, struct dcpu16_hw *hw) { } } -static struct dcpu16_hw hw_ = { - .vm = NULL, +struct dcpu16_hw_module dcpu16_hw_module_spc2000 = { .name_ = "SPC2000 - Suspension Chamber 2000", + .id_l = 0x1d9d, .id_h = 0x40e4, .ver = 0x005e, @@ -96,11 +96,9 @@ static struct dcpu16_hw hw_ = { .hwi = spc2000_hwi_, .cycle = spc2000_cycle_, .reset = spc2000_reset_, - .data = (struct spc2000_ *)NULL -}; -struct dcpu16_hw_module dcpu16_hw_module_spc2000 = { - .template = &hw_, .data_init = spc2000_data_init_, .data_free = spc2000_data_free_, + .ctl = NULL, + .ctl_cmd = NULL, };