From 3cfe0390b88e3956f2588435be0b4a2dc1c1d442 Mon Sep 17 00:00:00 2001 From: Thiago Auler dos Santos Date: Thu, 16 Nov 2017 23:21:21 -0200 Subject: [PATCH] little adjustments... woz monitor tentative run --- src/6502.c | 2 +- src/memory.c | 4 ++-- src/opcodes.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/6502.c b/src/6502.c index 663c06f..9ba0c5a 100644 --- a/src/6502.c +++ b/src/6502.c @@ -31,7 +31,7 @@ void decode() db aaacc = (aaa << 2) | cc; db bbbcc = (bbb << 2) | cc; - opcode_in_list = ir; + opcode_in_list = ir; opcode_in_table = aaacc; address_mode = bbb; diff --git a/src/memory.c b/src/memory.c index a0c8da1..df6d515 100644 --- a/src/memory.c +++ b/src/memory.c @@ -78,10 +78,10 @@ void write_mem(dw address, db data) // 4KB memory RAM ram_memory[address] = data; } - else if (address == 0xD010) + else if (address == 0xD012) { // output character to video - printf("%c", data); + printf("%c", data & 0x7F); } // any other addressed memory will be ignored on write diff --git a/src/opcodes.c b/src/opcodes.c index e16c7f9..7ea5150 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -197,6 +197,10 @@ void bcc() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void bcs() @@ -207,6 +211,10 @@ void bcs() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void beq() @@ -217,6 +225,10 @@ void beq() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void bit() @@ -236,6 +248,10 @@ void bmi() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void bne() @@ -246,6 +262,10 @@ void bne() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void bpl() @@ -256,6 +276,10 @@ void bpl() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void brk() @@ -274,6 +298,10 @@ void bvc() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void bvs() @@ -284,6 +312,10 @@ void bvs() fetch_operand(); pc = address; } + else + { + pc = pc + 1; + } } void clc()