Exemplo n.º 1
0
inline void CpuCalcTacts(unsigned long cmdClk) {
	if (turboMultiplier < 2) {
		devClkCounter += (uint64_t)cmdClk;
		cpuClk += (uint64_t)cmdClk;
	} else if (unturbo) {
		cmdClk *= turboMultiplier;
		devClkCounter += (uint64_t)cmdClk;
		cpuClk += (uint64_t)cmdClk;
	} else {
		actDevClkCounter += (uint64_t)cmdClk;
		actClk += (uint64_t)cmdClk;

		devClkCounter = (actDevClkCounter + (uint64_t)(turboMultiplier-1)) / (uint64_t)turboMultiplier;
		cpuClk = (actClk + (uint64_t)(turboMultiplier-1)) / (uint64_t)turboMultiplier;
	}

	devClk = cpuClk;
	C_Tape::Process();

	if (runDebuggerFlag || breakpoints[z80ex_get_reg(cpu, regPC)]) {
		if (SDL_MUSTLOCK(renderSurf)) {
			SDL_UnlockSurface(renderSurf);
		}

		runDebuggerFlag = false;
		RunDebugger();

		if (SDL_MUSTLOCK(renderSurf)) {
			if (SDL_LockSurface(renderSurf) < 0) {
				printf("Can't lock surface\n");
				return;
			}
		}
	}
}
Exemplo n.º 2
0
uint16_t Z80CPUBase::getRegister(const reg_t regID)
{
    if (m_context == 0) return 0;

    switch(regID)
    {
    case REG_A:
        return z80ex_get_reg(m_context, regAF) >> 8;
    case REG_B:
        return z80ex_get_reg(m_context, regBC) >> 8;
    case REG_C:
        return z80ex_get_reg(m_context, regBC) & 0xFF;
    case REG_D:
        return z80ex_get_reg(m_context, regDE) >> 8;
    case REG_E:
        return z80ex_get_reg(m_context, regDE) & 0xFF;
    case REG_H:
        return z80ex_get_reg(m_context, regHL) >> 8;
    case REG_L:
        return z80ex_get_reg(m_context, regHL) & 0xFF;
    case REG_IX:
        return z80ex_get_reg(m_context, regIX);
    case REG_IY:
        return z80ex_get_reg(m_context, regIY);
    case REG_BC:
        return z80ex_get_reg(m_context, regBC);
    case REG_DE:
        return z80ex_get_reg(m_context, regDE);
    case REG_HL:
        return z80ex_get_reg(m_context, regHL);
    case REG_SP:
        return z80ex_get_reg(m_context, regSP);
    case REG_PC:
        return z80ex_get_reg(m_context, regPC);
    default:
        return 0;
    }
}