/* Wrappers for the different CPU types */ static CPU_INIT( v20 ) { nec_state_t *nec_state = get_safe_token(device); nec_init(device, irqcallback); nec_state->fetch_xor = 0; nec_state->chip_type=V20_TYPE; nec_state->prefetch_size = 4; /* 3 words */ nec_state->prefetch_cycles = 4; /* four cycles per byte */ }
static CPU_INIT( v30 ) { nec_state_t *nec_state = get_safe_token(device); nec_init(device, irqcallback); nec_state->fetch_xor = BYTE_XOR_LE(0); nec_state->chip_type=V30_TYPE; nec_state->prefetch_size = 6; /* 3 words */ nec_state->prefetch_cycles = 2; /* two cycles per byte / four per word */ }
static CPU_INIT( v33 ) { nec_state_t *nec_state = get_safe_token(device); nec_init(device, irqcallback); nec_state->chip_type=V33_TYPE; nec_state->prefetch_size = 6; /* FIXME: Need information about prefetch size and cycles for V33. * complete guess below, nbbatman will not work * properly without. */ nec_state->prefetch_cycles = 1; /* two cycles per byte / four per word */ nec_state->fetch_xor = BYTE_XOR_LE(0); }
void necInit(int cpu, int type) { nec_state_t *nec_state = &sChips[cpu]; nec_init(cpu); switch (type) { case V20_TYPE: { nec_state->fetch_xor = 0; nec_state->chip_type=V20_TYPE; nec_state->prefetch_size = 4; /* 3 words */ nec_state->prefetch_cycles = 4; /* four cycles per byte */ } break; case V30_TYPE: { nec_state->fetch_xor = 0; nec_state->chip_type=V30_TYPE; nec_state->prefetch_size = 6; /* 3 words */ nec_state->prefetch_cycles = 2; /* two cycles per byte / four per word */ } break; case V33_TYPE: { nec_state->fetch_xor = 0; nec_state->chip_type=V33_TYPE; nec_state->prefetch_size = 6; /* FIXME: Need information about prefetch size and cycles for V33. * complete guess below, nbbatman will not work * properly without. */ nec_state->prefetch_cycles = 1; /* two cycles per byte / four per word */ } break; } }