Exemplo n.º 1
0
Arquivo: cpu.c Projeto: saper/em400
// -----------------------------------------------------------------------
int cpu_init(struct cfg_em400 *cfg)
{
    int res;

    regs[R_KB] = cfg->keys;

    cpu_mod_present = cfg->cpu_mod;
    cpu_user_io_illegal = cfg->cpu_user_io_illegal;
    exit_on_hlt = cfg->exit_on_hlt;
    cpu_awp = cfg->cpu_awp;

    struct em400_instr *instr = em400_ilist;
    while (instr->var_mask) {
        res = cpu_register_op(em400_op_tab, instr->opcode, instr->var_mask, &instr->op);
        if (res != E_OK) {
            return res;
        }
        instr++;
    }

    int_update_mask(0);

    // seems to be checked only at power-on!
    // (unless power supply sends -PON at hw reset)
    if (mem_mega_boot()) {
        LOG(L_CPU, 1, "Bootstrap from MEGA PROM is enabled");
        regs[R_IC] = 0xf000;
    }

    cpu_mod_off();

    return E_OK;
}
Exemplo n.º 2
0
Arquivo: cpu.c Projeto: jakubfi/em400
// -----------------------------------------------------------------------
int ectl_capa()
{
	int capa = 0;

	if (cpu_mod_present) capa |= 1 << ECTL_CAPA_MX16;
	if (cpu_mod_active) capa |= 1 << ECTL_CAPA_CRON;
	if (awp) capa |= 1 << ECTL_CAPA_AWP;
	if (!cpu_user_io_illegal) capa |= 1 << ECTL_CAPA_UIO;
	if (mem_mega_boot()) capa |= 1 << ECTL_CAPA_MEGABOOT;
	//TODO: if (nomem_stop) capa |= 1 << ECTL_CAPA_NOMEMSTOP;

	LOG(L_ECTL, "ECTL capabilities: 0x%04x", capa);
	return capa;
}