Fixed issue caused by cooked mode
This commit is contained in:
parent
95ae145cd1
commit
7d5096b7ff
1
tty.c
1
tty.c
|
@ -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
1
vm.c
|
@ -1,5 +1,4 @@
|
|||
#include "vm.h"
|
||||
//#define DEBUG true
|
||||
uint32_t performance_counter;
|
||||
|
||||
/* Prototypes for functions in vm_instructions.c*/
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue