Skip to content

Commit

Permalink
simpler WaitForChar
Browse files Browse the repository at this point in the history
  • Loading branch information
bebbo committed Mar 25, 2024
1 parent cc165a4 commit 2bad53e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions amitools/vamos/lib/DosLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,9 @@ def WaitForChar(self, ctx):
# file,timeout)(d1/d2)
fh_b_addr = ctx.cpu.r_reg(REG_D1)
fh = self.file_mgr.get_by_b_addr(fh_b_addr, False)
if select.select([fh.obj], [], [], 0.)[0]:
return self.DOSTRUE

ms = ctx.cpu.r_reg(REG_D2)
if ms > 0:
time.sleep(ms * 1e-3)

if select.select([fh.obj], [], [], 0.)[0]:
return self.DOSTRUE
if select.select([fh.obj], [], [], ms * 1e-3)[0]:
return self.DOSTRUE

return self.DOSFALSE

Expand Down

0 comments on commit 2bad53e

Please sign in to comment.