Fixed issue caused by cooked mode

This commit is contained in:
Jeremiah Orians 2016-07-18 21:32:23 -04:00
parent 95ae145cd1
commit 7d5096b7ff
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
3 changed files with 10 additions and 1 deletions

1
tty.c
View File

@ -8,6 +8,7 @@
* wish to use. Please note that they contain bugs *
****************************************************/
#define tty_lib true
/* In order to restore at exit.*/
static struct termios orig_termios;

1
vm.c
View File

@ -1,5 +1,4 @@
#include "vm.h"
//#define DEBUG true
uint32_t performance_counter;
/* Prototypes for functions in vm_instructions.c*/

View File

@ -2,6 +2,10 @@
FILE* tape_01;
FILE* tape_02;
#ifdef tty_lib
char tty_getchar();
#endif
/* Correctly write out bytes on little endian hardware */
void writeout_Reg(struct lilith* vm, uint32_t p, uint32_t value)
{
@ -199,7 +203,12 @@ void vm_FGETC(struct lilith* vm)
if (0x00000000 == vm->reg[1])
{
#ifdef tty_lib
byte = tty_getchar();
#endif
#ifndef tty_lib
byte = fgetc(stdin);
#endif
}
if(0x00001100 == vm->reg[1])