home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18572 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.9 KB  |  77 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!mcsun!sunic!dkuug!imada!news
  3. From: breese@monet.imada.ou.dk (Bjoern Reese)
  4. Subject: SetIntVector?
  5. Message-ID: <1993Jan12.154003.14265@imada.ou.dk>
  6. Sender: news@imada.ou.dk (USENET News System)
  7. Organization: Dept. of Math. & Computer Science, Odense University, Denmark
  8. Date: Tue, 12 Jan 1993 15:40:03 GMT
  9. Lines: 66
  10.  
  11. I've been trying to use SetIntVector() but something goes
  12. wrong. Using SetIntVector() to install my own server works
  13. just fine, but when I'm about to reinstall the old server
  14. it goes coma. I've tried debugging and found out that the
  15. value returned by SetIntVector() is zero, and not a pointer
  16. to the old server. What did I do wrong?
  17.  
  18. ;----------------------------------------------------------
  19.     INCLUDE    INCLUDE:exec/exec_lib.i
  20.     INCLUDE    INCLUDE:exec/nodes.i
  21.     INCLUDE    INCLUDE:hardware/intbits.i
  22.     INCLUDE    INCLUDE:hardware/custom.i
  23.  
  24. CALL:    MACRO
  25.     jsr    _LVO\1(a6)
  26.     ENDM
  27.  
  28.  
  29. start:
  30.     move.l    (_SysBase).w,a6
  31.     CALL    Forbid            ;Forbid multitasking
  32.     moveq.l    #INTB_VERTB,d0
  33.     lea    VBlankServer(pc),a1
  34.     CALL    SetIntVector        ;Install new server
  35.     move.l    d0,OldServer
  36.  
  37. wait    btst    #6,$bfe001        ;Left mouse buttom?
  38.     bne.s    .wait            ;Dirty, but so what.
  39.                     ;It's just an quick hack.
  40.  
  41.     move.l    (_SysBase).w,a6
  42.     moveq.l    #INTB_VERTB,d0
  43.     move.l    OldServer(pc),a1
  44.     CALL    SetIntVector        ;Reinstall old server
  45.     CALL    Permit            ;Permit multitasking
  46.     moveq.l    #0,d0
  47.     rts
  48.  
  49. IntLevel3:
  50.     movem.l    d0-d7/a0-a6,-(sp)
  51.     move.w    intreqr(a0),d0        ;a0 contains custom base
  52.     and.w    intenar(a0),d0
  53.     move.w    d0,intreq(a0)        ;Clear interrupt request
  54.  
  55.     move.w    #$0500,d0        ;Do some fancy color stuff
  56. loop    move.w    d0,color(a0)
  57.     dbra    d0,.loop
  58.  
  59.     movem.l    (sp)+,d0-d7/a0-a6
  60.     rts
  61.  
  62. OldServer:    dc.l    0
  63.  
  64. VBlankServer:
  65.     dc.l    0,0        ;ln_Succ,ln_Pred
  66.     dc.b    2,0        ;ln_Type,ln_Pri
  67.     dc.l    IntName        ;ln_Name
  68.     dc.l    0,IntLevel3    ;is_Data,is_Code
  69.  
  70. IntName:dc.b    "name",0
  71.     EVEN
  72.  
  73. --
  74.  
  75. Bjoern Reese                   |     Email: breese@imada.ou.dk
  76. Odense University, Denmark     |     Voice: +45 65 932 182 (private)
  77.