Fixed minor user interaction bug in Development mode and fixed the continued execution of a Halted vm in the IDE

This commit is contained in:
Jeremiah Orians 2016-08-24 19:26:45 -04:00
parent 67e31f7d70
commit bd803a996b
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
3 changed files with 8 additions and 2 deletions

View File

@ -1998,7 +1998,7 @@ void eval_instruction(struct lilith* vm, struct Instruction* current)
case 0xFF: /* Deal with HALT */
{
vm->halted = true;
fprintf(stderr, "Computer Program has Halted\n");
fprintf(stderr, "Computer Program has Halted\nAfter Executing %i instructions\n", performance_counter);
break;
}
default: /* Deal with illegal instruction */

View File

@ -231,6 +231,9 @@ void vm_FPUTC(struct lilith* vm)
if (0x00000000 == vm->reg[1])
{
fputc(byte, stdout);
#ifdef tty_lib
fflush(stdout);
#endif
}
if(0x00001100 == vm->reg[1])

View File

@ -48,7 +48,10 @@ void load_lilith(char* name)
unsigned int step_lilith()
{
execute_vm(Globalvm);
if(!Globalvm->halted)
{
execute_vm(Globalvm);
}
return Globalvm->ip;
}