mirror of
https://github.com/thiagoauler/apple1.git
synced 2024-11-22 00:31:55 +00:00
creating interface i/o functions
This commit is contained in:
parent
50a17cd13b
commit
1170f3eaae
29
src/6502.c
29
src/6502.c
@ -1,5 +1,3 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user