Beispiel #1
0
/**
 * @brief Logical OR on Accumulator
 */
void Cpu::ora(uint8_t v, uint8_t cycles)
{
  a(a()|v);
  SET_ZF(a());
  SET_NF(a());
  tick(cycles);
}
Beispiel #2
0
/**
 * @brief Logical AND
 */
void Cpu::_and(uint8_t v, uint8_t cycles)
{
  a(a()&v);
  SET_ZF(a());
  SET_NF(a());
  tick(cycles);
}
Beispiel #3
0
/**
 * @brief Transfer Y to Accumulator 
 */
void Cpu::tya()
{
  a(y());
  SET_ZF(a());
  SET_NF(a());
  tick(2);
}
Beispiel #4
0
/**
 * @brief PuLl Accumulator 
 */
void Cpu::pla()
{
  a(pop());
  SET_ZF(a());
  SET_NF(a());
  tick(4);
}
Beispiel #5
0
/**
 * @brief Transfer Accumulator to X 
 */
void Cpu::tax()
{
  x(a());
  SET_ZF(x());
  SET_NF(x());
  tick(2);
}
Beispiel #6
0
/**
 * @brief Transfer Accumulator to Y 
 */
void Cpu::tay()
{
  y(a());
  SET_ZF(y());
  SET_NF(y());
  tick(2);
}
Beispiel #7
0
/**
 * @brief Transfer X to Accumulator 
 */
void Cpu::txa()
{
  a(x());
  SET_ZF(a());
  SET_NF(a());
  tick(2);
}
Beispiel #8
0
/**
 * @brief LoaD Y
 */
void Cpu::ldy(uint8_t v, uint8_t cycles)
{
  y(v);
  SET_ZF(y());
  SET_NF(y());
  tick(cycles);
}
Beispiel #9
0
/**
 * @brief LoaD X
 */
void Cpu::ldx(uint8_t v, uint8_t cycles)
{
  x(v);
  SET_ZF(x());
  SET_NF(x());
  tick(cycles);
}
Beispiel #10
0
/**
 * @brief LoaD Accumulator
 */
void Cpu::lda(uint8_t v, uint8_t cycles)
{
  a(v);
  SET_ZF(a());
  SET_NF(a());
  tick(cycles);
}
Beispiel #11
0
/**
 * @brief Transfer Stack pointer to X
 */
void Cpu::tsx()
{
  x(sp());
  SET_ZF(x());
  SET_NF(x());
  tick(2);
}
Beispiel #12
0
/**
 * @brief ROtate Left
 */
uint8_t Cpu::rol(uint8_t v)
{
  uint16_t t = (v << 1) | (uint8_t)cf();
  cf((t&0x100)!=0);
  SET_ZF(t);
  SET_NF(t);
  return (uint8_t)t;
}
Beispiel #13
0
/**
 * @brief BIT test
 */
void Cpu::bit(uint16_t addr, uint8_t cycles)
{
  uint8_t t = load_byte(addr);
  of((t&0x40)!=0);
  SET_NF(t);
  SET_ZF(t&a());
  tick(cycles);
}
static void ddr_get_dpll_cfg(uint32_t *p)
{
	uint32_t nmhz, NO, NF, NR;

	nmhz = ddr_get_phy_pll_freq();
	if (nmhz <= 150)
		NO = 6;
	else if (nmhz <= 250)
		NO = 4;
	else if (nmhz <= 500)
		NO = 2;
	else
		NO = 1;

	NR = 1;
	NF = 2 * nmhz * NR * NO / 24;

	p[0] = SET_NR(NR) | SET_NO(NO);
	p[1] = SET_NF(NF);
	p[2] = SET_NB(NF / 2);
}