From 1170f3eaae3f6a96d4ae4d969092f319fc9be4d6 Mon Sep 17 00:00:00 2001 From: Thiago Auler Date: Mon, 20 Nov 2017 12:36:53 -0200 Subject: [PATCH] creating interface i/o functions --- src/6502.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/6502.c b/src/6502.c index 0b7a2f7..93cf4d8 100644 --- a/src/6502.c +++ b/src/6502.c @@ -1,5 +1,3 @@ -#include - #include "inc/types.h" #include "inc/memory.h" #include "inc/opcodes.h" @@ -9,6 +7,8 @@ oct opcode_in_table; void init() { + io_init(); + // pc is set using 0xFFFC pc = read_word(0xFFFC); sp = 0xFF; @@ -81,7 +81,7 @@ void execute() case BMI: return bmi(); case BNE: return bne(); case BPL: return bpl(); - case BRK: return bkk(); + case BRK: return brk(); case BVC: return bvc(); case BVS: return bvs(); case CLC: return clc(); @@ -139,25 +139,6 @@ void execute() } } -void display() -{ - //if (display_control == 0xA7) - { - // display is ready to ouptup - if (display_buffer & 0x80) - { - // outputs the buffer character - display_buffer = display_buffer & 0x7F; - printf("%c", display_buffer); - } - } -} - -void read_input() -{ - // verifies if the keyboard is being pressed... -} - void run() { while (1) @@ -166,8 +147,8 @@ void run() decode(); execute(); - display(); - read_input(); + input(); + output(); } }