Change input from scanf() to getchar() !
This commit is contained in:
parent
caf2b81431
commit
c9b291ce38
@ -15,7 +15,7 @@ int main(int argc, char *argv[])
|
|||||||
uint8_t op_code;
|
uint8_t op_code;
|
||||||
uint16_t pc = 0;
|
uint16_t pc = 0;
|
||||||
int data_addr=0;
|
int data_addr=0;
|
||||||
char quit;
|
int quit='n';
|
||||||
bool run = true;
|
bool run = true;
|
||||||
|
|
||||||
if(initialise_ram(ram,argc,argv)==-1) return 1;
|
if(initialise_ram(ram,argc,argv)==-1) return 1;
|
||||||
@ -33,10 +33,13 @@ int main(int argc, char *argv[])
|
|||||||
pc=find_data(ram[pc]); //jump if ACCU is ZERO
|
pc=find_data(ram[pc]); //jump if ACCU is ZERO
|
||||||
else pc++;
|
else pc++;
|
||||||
printf("(n)ext step or (q)uit or (c)oredump ?\n");
|
printf("(n)ext step or (q)uit or (c)oredump ?\n");
|
||||||
scanf("%c",&quit);
|
while((quit = getchar()) != '\n' && quit != EOF)
|
||||||
|
{
|
||||||
if(quit == 'c') makeHexDump(true,ram);
|
if(quit == 'c') makeHexDump(true,ram);
|
||||||
|
|
||||||
else if(quit == 'q') run = false;
|
else if(quit == 'q') run = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user