1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-23 07:30:31 +00:00

Merge branch 'master' of github.com:rkujawa/rk65c02

This commit is contained in:
Radosław Kujawa 2017-02-20 21:32:22 +01:00
commit ec235796c0

View File

@ -126,9 +126,10 @@ emul_bbr(rk65c02emu_t *e, void *id, instruction_t *i, uint8_t bit)
{ {
uint8_t val; uint8_t val;
/* read value from zero page */
val = instruction_data_read_1(e, (instrdef_t *) id, i); val = instruction_data_read_1(e, (instrdef_t *) id, i);
/* is bit is clear then branch */ /* if bit is clear then branch */
if (!(BIT(val, bit))) if (!(BIT(val, bit)))
program_counter_branch(e, (int8_t) i->op2); program_counter_branch(e, (int8_t) i->op2);
else else
@ -182,9 +183,10 @@ emul_bbs(rk65c02emu_t *e, void *id, instruction_t *i, uint8_t bit)
{ {
uint8_t val; uint8_t val;
/* read value from zero page */
val = instruction_data_read_1(e, (instrdef_t *) id, i); val = instruction_data_read_1(e, (instrdef_t *) id, i);
/* is bit is set then branch */ /* if bit is set then branch */
if (BIT(val, bit)) if (BIT(val, bit))
program_counter_branch(e, (int8_t) i->op2); program_counter_branch(e, (int8_t) i->op2);
else else
@ -245,6 +247,7 @@ emul_bit(rk65c02emu_t *e, void *id, instruction_t *i)
else else
e->regs.P |= P_ZERO; e->regs.P |= P_ZERO;
/* immediate addressing does not affect the overflow flag */
if ( ((instrdef_t *)id)->mode != IMMEDIATE) { if ( ((instrdef_t *)id)->mode != IMMEDIATE) {
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6)) if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
e->regs.P |= P_SIGN_OVERFLOW; e->regs.P |= P_SIGN_OVERFLOW;
@ -685,7 +688,7 @@ emul_plx(rk65c02emu_t *e, void *id, instruction_t *i)
e->regs.X = stack_pop(e); e->regs.X = stack_pop(e);
} }
/* PLY - pull from stack to X */ /* PLY - pull from stack to Y */
void void
emul_ply(rk65c02emu_t *e, void *id, instruction_t *i) emul_ply(rk65c02emu_t *e, void *id, instruction_t *i)
{ {