summaryrefslogtreecommitdiff
path: root/emu/6502.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-12-29 11:08:58 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-12-29 11:08:58 +0100
commit53569267c59204f56e4c0fddb669536d28706e5c (patch)
tree0c358de956e824d6c47f4820fdc8013ae3fa3089 /emu/6502.c
parentdd4174bb32973d1212235dc8e262c23013b88912 (diff)
download6502-53569267c59204f56e4c0fddb669536d28706e5c.tar.gz
6502-53569267c59204f56e4c0fddb669536d28706e5c.tar.bz2
- testing of correct cycles
- fixed some SDL includes
Diffstat (limited to 'emu/6502.c')
-rw-r--r--emu/6502.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/emu/6502.c b/emu/6502.c
index 53af7a0..98af83a 100644
--- a/emu/6502.c
+++ b/emu/6502.c
@@ -182,7 +182,7 @@ static const int cycles[NOF_OPCODES] = {
/* B */ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* C */ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0,
/* D */ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- /* E */ 3, 0, 0, 0, 0, 0, 5, 0, 0, 2, 2, 0, 0, 0, 0, 0,
+ /* E */ 2, 0, 0, 0, 0, 0, 5, 0, 0, 2, 2, 0, 0, 0, 0, 0,
/* F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
@@ -427,6 +427,7 @@ void cpu_6502_step( cpu_6502_t *cpu )
cpu->PC++;
if( !cpu_6502_is_zero( cpu ) ) {
cpu->PC += (int8_t)operand8;
+ cpu->cycles++;
}
break;
@@ -435,6 +436,7 @@ void cpu_6502_step( cpu_6502_t *cpu )
cpu->PC++;
if( !cpu_6502_is_carry( cpu ) ) {
cpu->PC += (int8_t)operand8;
+ cpu->cycles++;
}
break;
@@ -443,6 +445,7 @@ void cpu_6502_step( cpu_6502_t *cpu )
cpu->PC++;
if( cpu_6502_is_carry( cpu ) ) {
cpu->PC += (int8_t)operand8;
+ cpu->cycles++;
}
break;