diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/irc.c | 12 | ||||
| -rw-r--r-- | src/jifsec.s | 10 |
2 files changed, 17 insertions, 5 deletions
@@ -121,6 +121,7 @@ static void do_priv_nick(void) { static void print_ping_time(char *p) { extern void print_jif_sec(unsigned int j); static unsigned int now, pingtime; + // static unsigned int sec, frac; now = read_rtclok(); pingtime = (unsigned int)a2uint(p); @@ -128,9 +129,20 @@ static void print_ping_time(char *p) { /* correct for rtclock rollover (every ~9 mins) */ if(now < pingtime) now |= 0x8000; + /* + pingtime = now - pingtime; + sec = pingtime / timers.hz; + frac = pingtime % timers.hz; + frac *= 100; + frac /= timers.hz; + */ + scr_print_active("*** "); scr_print_active(msg_src); scr_print_active(" lag: "); + // scr_act_printnum(sec); + // scr_putc_active('.'); + // scr_act_printnum(frac); print_jif_sec(now - pingtime); scr_putc_active('s'); } diff --git a/src/jifsec.s b/src/jifsec.s index ca5aac7..86648c1 100644 --- a/src/jifsec.s +++ b/src/jifsec.s @@ -1,13 +1,13 @@ ; print jiffies as seconds, with possible decimal point, to the ; active screen. ; unsigned divide based on Ullrich von Bassewitz's runtime/udiv.s. -; uses FR0 as a temp, rather than any of cc65's ZP storage, +; uses FR1 as a temp, rather than any of cc65's ZP storage, ; to avoid clobbering. - FR0 = $d4 - acc16 = FR0 ; 16 bits - remainder = FR0+2 ; 8 bits - temp = FR0+3 ; 16 bits + FR1 = $e0 + acc16 = FR1 ; 16 bits + remainder = FR1+2 ; 8 bits + temp = FR1+3 ; 16 bits _hz = $f0 ; must agree with timers.h! |
