home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / apilot.lha / APilot / APilot_Ser / vertbserver.asm < prev   
Encoding:
Assembly Source File  |  1994-12-03  |  1.8 KB  |  53 lines

  1. ****************************************************************************
  2. *
  3. * vertbserver.asm. Interrupt server for vertical blank
  4. *
  5. *-------------------------------------------------------------------------
  6. * Authors: Casper Gripenberg  (casper@alpha.hut.fi)
  7. *          Kjetil Jacobsen  (kjetilja@stud.cs.uit.no)
  8. *
  9.  
  10.     INCLUDE "exec/types.i"
  11.     INCLUDE "hardware/custom.i"
  12.     INCLUDE "hardware/intbits.i"
  13.  
  14.         XDEF    _VertBServer
  15.         XDEF    @VertBServer
  16.  
  17. JSRLIB MACRO
  18.         XREF _LVO\1
  19.         JSR  _LVO\1(a6)
  20.         ENDM
  21.  
  22.         STRUCTURE VERTBDATA,0
  23.           APTR  VBD_maintask
  24.           ULONG VBD_mainsig
  25.           UWORD VBD_sigframe
  26.           APTR  VBD_nframes
  27.         LABEL VERTBDATA_SIZEOF
  28.  
  29.  
  30. * Entered with:       A0 == scratch (execpt for highest pri vertb server)
  31. *  D0 == scratch      A1 == is_Data
  32. *  D1 == scratch      A5 == vector to interrupt code (scratch)
  33. *                     A6 == scratch
  34. *
  35.     section code
  36.  
  37. _VertBServer:
  38. @VertBServer:
  39.          MOVE.L  VBD_nframes(a1),a0  ; get pointer to framcounts
  40.          ADDI.W  #1,(a0)             ; increments framecounts
  41.          MOVE.W  VBD_sigframe(a1),d0 ; get framenumber for signal
  42.          CMP.W   (a0),d0             ; see if the specified amount of frames has been reached
  43.          BGT.S   OuttaHere           ; exit if not
  44.          MOVE.L  VBD_mainsig(a1),d0  ; get signal allocated by main
  45.          MOVE.L  VBD_maintask(a1),a1 ; and pointer to main task
  46.          MOVE.L  4,a6                ; execbase
  47.          JSRLIB  Signal              ; tell main it's time for a screenchange
  48. OuttaHere:
  49.      MOVEQ.L #0,d0               ; set Z flag to continue to process other vb-servers
  50.          MOVE.L  #$dff000,a0         ; custom chip address
  51.          RTS                         ; return to exec
  52.          END
  53.