[Simh] idling documentation??

Fernan Bolando fernanbolando at mailc.net
Mon Dec 20 08:14:01 EST 2010


hi all

i dont understand how the idle parts work, anybody have any documentation?
why cant we just do it like the how i did it below. aside from the
side effect that the system clock of guest os loooses track, it seems
to work ok. From what i can see from the code idle only works for VAX
and few others, not PDP11


--code start
int idler;
t_stat sim_os_poll_kbd (void)
{
int status;
unsigned char buf[1];

#if defined(_PLAN9)
if(!kbhit()) {idler++; usleep(idler); return SCPE_OK;}
#endif
idler = 0;
status = read (0, buf, 1);
if (status != 1) return SCPE_OK;
if (sim_brk_char && (buf[0] == sim_brk_char))
    return SCPE_BREAK;
else return (buf[0] | SCPE_KFLAG);
}

t_stat sim_os_putchar (int32 out)
{
char c;

c = out;
#if defined (_PLAN9)
if (c == '\r') c = ' ';
#endif
write (1, &c, 1);
idler=0;
return SCPE_OK;

--code end--



More information about the Simh mailing list