-struct dcpu16_hw *spc2000_new(struct dcpu16 *vm) {
- struct dcpu16_hw *hw;
-
- hw = calloc(1, sizeof *hw);
- if (hw == NULL) {
- vm->warn_cb_("%s():%s", "calloc", strerror(errno));
- return NULL;
- }
-
- memcpy(hw, &hw_, sizeof *hw);
-
- hw->data = calloc(1, sizeof(struct spc2000_));
- if (hw->data == NULL) {
- vm->warn_cb_("%s():%s", "calloc", strerror(errno));
- free(hw);
- return NULL;
- }
-
- hw->vm = vm;
-
- return hw;
-}
+static struct dcpu16_hw hw_ = {
+ .vm = NULL,
+ .name_ = "SPC2000 - Suspension Chamber 2000",
+ .id_l = 0x1d9d,
+ .id_h = 0x40e4,
+ .ver = 0x005e,
+ .mfg_l = 0x8b36,
+ .mfg_h = 0x1c6c,
+ .hwi = spc2000_hwi_,
+ .cycle = spc2000_cycle_,
+ .reset = spc2000_reset_,
+ .data = (struct spc2000_ *)NULL
+};