home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 100 / af100b.adf / patches.lzx / PinballDreamsPatch / src / lib / utils_macros.i < prev    next >
Encoding:
Text File  |  1997-06-18  |  1.7 KB  |  111 lines

  1. STORE_REGS: MACRO
  2.     movem.l    D0-D7/A0-A6,-(A7)
  3.     ENDM
  4.  
  5. RESTORE_REGS: MACRO
  6.     movem.l    (A7)+,D0-D7/A0-A6
  7.     ENDM
  8.  
  9. JSRGEN:MACRO
  10.     move.l    A5,-(sp)
  11.     move.l    _general_pbuffer(PC),A5
  12.     add.l    #_\1,A5
  13.     sub.l    #_GeneralPatchRoutines,A5
  14.     JSR    (A5)
  15.     move.l    (sp)+,A5
  16.     ENDM
  17.  
  18. JMPGEN:MACRO
  19.     move.l    _general_pbuffer(PC),A5
  20.     add.l    #_\1,A5
  21.     sub.l    #_GeneralPatchRoutines,A5
  22.     JMP    (A5)
  23.     ENDM
  24.  
  25. GETGENADDR:MACRO
  26.     move.l    _general_pbuffer(PC),D0
  27.     add.l    #_\1,D0
  28.     sub.l    #_GeneralPatchRoutines,D0
  29.     ENDM
  30.  
  31. WAIT_LMB: MACRO
  32. wl\@
  33.     btst    #6,$BFE001
  34.     bne    wl\@
  35.     ENDM
  36.  
  37. ; ******* Macro Printf ********
  38. ; Mac_printf "text"   -> text + linefeed
  39. ; Mac_printf "text",*any argument* -> text without linefeed
  40.  
  41. Mac_printf: MACRO
  42.     move.l    A1,-(A7)
  43.     lea    text\@$(PC),A1
  44.     JSRABS    Display
  45.     bra    ftext\@$
  46. text\@$
  47.     dc.b    \1
  48.     IFLE    NARG-1
  49.     dc.b    10,13
  50.     ENDC
  51.     dc.b    0
  52.     even
  53. ftext\@$
  54.     move.l    (A7)+,A1
  55.     ENDM
  56.  
  57. PUTS: MACRO
  58.     move.l    A1,-(A7)
  59.     move.l    \1,A1
  60.     JSRABS    Display
  61.     move.l    (A7)+,A1
  62.     ENDM
  63.  
  64. NEWLINE: MACRO
  65.     move.l    A1,-(A7)
  66.     lea    text\@$(PC),A1
  67.     JSRABS    Display
  68.     bra    ftext\@$
  69. text\@$
  70.     dc.b    10,13,0
  71.     even
  72. ftext\@$
  73.     move.l    (A7)+,A1
  74.     ENDM
  75.  
  76.  
  77.  
  78. JSRABS:MACRO
  79.     jsr    _\1
  80.     ENDM
  81.  
  82. JMPABS:MACRO
  83.     jmp    _\1
  84.     ENDM
  85.  
  86. STOP_SOUND:MACRO
  87.     move.l    A5,-(sp)
  88.     lea    $DFF000,A5
  89.     move.w    #$0000,aud0+ac_len(A5)
  90.     move.w    #$0000,aud1+ac_len(A5)
  91.     move.w    #$0000,aud2+ac_len(A5)
  92.     move.w    #$0000,aud3+ac_len(A5)        ; shhhhht
  93.  
  94.     move.w    #$0000,aud0+ac_vol(A5)
  95.     move.w    #$0000,aud1+ac_vol(A5)
  96.     move.w    #$0000,aud2+ac_vol(A5)
  97.     move.w    #$0000,aud3+ac_vol(A5)        ; shhhhht
  98.     move.l    (sp)+,A5
  99.     ENDM
  100.  
  101. RELOCATE_GEN:MACRO
  102.     movem.l    D0/A0/A1,-(sp)
  103.     move.l    _general_pbuffer(PC),D0
  104.     add.l    #\1,D0
  105.     sub.l    #_GeneralPatchRoutines,D0
  106.     move.l    D0,A0
  107.     move.l    #\1,A1        ; to be sure to get absolute address.
  108.     move.l    (A1),(A0)    ; relocation in the general patch routines zone.
  109.     movem.l    (sp)+,D0/A0/A1
  110.     ENDM
  111.