MCPcopy Index your code
hub / github.com/NetHack/NetHack / tty_delay_output

Function tty_delay_output

win/tty/termcap.c:790–835  ·  view source on GitHub ↗

delay 50 ms */

Source from the content-addressed store, hash-verified

788
789/* delay 50 ms */
790void
791tty_delay_output(void)
792{
793#if defined(MICRO)
794 int i;
795#endif
796 if (iflags.debug_fuzzer)
797 return;
798#ifdef TIMED_DELAY
799 if (flags.nap) {
800 (void) fflush(stdout);
801 msleep(50); /* sleep for 50 milliseconds */
802 return;
803 }
804#endif
805#if defined(MICRO)
806 /* simulate the delay with "cursor here" */
807 for (i = 0; i < 3; i++) {
808 cmov(ttyDisplay->curx, ttyDisplay->cury);
809 (void) fflush(stdout);
810 }
811#else /* MICRO */
812 /* BUG: if the padding character is visible, as it is on the 5620
813 then this looks terrible. */
814 if (flags.null) {
815 tputs(
816#ifdef TERMINFO
817 "$<50>",
818#else
819 "50",
820#endif
821 1, xputc);
822
823 } else if (ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) {
824 /* delay by sending cm(here) an appropriate number of times */
825 int cmlen =
826 (int) strlen(tgoto(nh_CM, ttyDisplay->curx, ttyDisplay->cury));
827 int i = 500 + tmspc10[ospeed] / 2;
828
829 while (i > 0) {
830 cmov((int) ttyDisplay->curx, (int) ttyDisplay->cury);
831 i -= cmlen * tmspc10[ospeed];
832 }
833 }
834#endif /* MICRO */
835}
836
837/* must only be called with curx = 1 */
838void

Callers

nothing calls this directly

Calls 4

fflushFunction · 0.85
tgotoFunction · 0.85
cmovFunction · 0.70
msleepFunction · 0.50

Tested by

no test coverage detected