home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / manutenzione / smartinfo / sfs / timer.asm < prev   
Assembly Source File  |  1999-10-14  |  1KB  |  59 lines

  1. *-----------------------------------------------*
  2. *    @AskTimerInt                *
  3. *-----------------------------------------------*
  4.  
  5. AskTimerInt:
  6.     move.l    exec(a4),a6
  7.     move.l    timer_io(a4),a1
  8.     st    bfTimerActive(a4)
  9.     move.w    #TR_ADDREQUEST,IO_COMMAND(a1)
  10.     addq.l    #1,IOTV_TIME+TV_SECS(a1)
  11.     jmp    _LVOSendIO(a6)
  12.  
  13. *-----------------------------------------------*
  14. *    @GetTimerMsg                *
  15. *-----------------------------------------------*
  16.  
  17. GetTimerMsg:
  18.     move.l    exec(a4),a6
  19.     move.l    timerport(a4),a0
  20.     jsr    _LVOGetMsg(a6)
  21.     tst.l    d0
  22.     beq.b    .x
  23.     bsr    AskTimerInt
  24.     bra    UpdateTimer
  25. .x    rts
  26.  
  27. *-----------------------------------------------*
  28. *    @UpdateTimer                *
  29. *-----------------------------------------------*
  30.  
  31. UpdateTimer:
  32.     move.l    TimerBase(a4),a6
  33.     lea    ElapsedTime(a4),a0
  34.     jsr    _LVOGetSysTime(a6)
  35.     lea    StartTime(a4),a1
  36.     jsr    _LVOSubTime(a6)
  37.     move.l    (a0),d0
  38.     divu.w    #60,d0
  39.     move.l    exec(a4),a6
  40.     move.w    d0,d1
  41.     swap    d0
  42.     ext.l    d1
  43.     move.w    d0,4(a4)
  44.     divu.w    #60,d1
  45.     lea    TimeFormat-t(a5),a0
  46.     move.w    d1,(a4)
  47.     move.l    a4,a1
  48.     swap    d1
  49.     lea    putchar(pc),a2
  50.     move.w    d1,2(a4)
  51.  
  52.     lea    TimeText(a4),a3
  53.     jsr    _LVORawDoFmt(a6)
  54.  
  55.     move.l    intui(a4),a6
  56.     move.l    TX_Defrag_Time-t(a5),a0
  57.     SET2    #MUIA_Text_Contents,A3
  58.     rts
  59.