home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 553.lha / NewAvailFonts / OldNewAF.c < prev   
C/C++ Source or Header  |  1991-09-09  |  1KB  |  57 lines

  1. #include <exec/types.h>
  2. #include <exec/exec.h>
  3. #include <proto/exec.h>
  4. #include <libraries/diskfont.h>
  5.  
  6. #include <dos/dos.h>
  7.  
  8. int CXBRK(void) {return 0;}
  9. int chkabort(void) {return 0;}
  10.  
  11. //#pragma libcall DiskfontBase AvailFonts 24 10803
  12. LONG (* __asm __saveds oldAvailFonts) (    register __a0 struct AvailFontsHeader *buffer,
  13.                                         register __d0 LONG bufBytes,
  14.                                         register __d1 ULONG flags,
  15.                                         register __a6 ULONG base );
  16.  
  17.  
  18. /* ------------------------------------------------------------------------    */
  19. LONG __asm __saveds newAvailFonts(    register __a0 struct AvailFontsHeader *buffer,
  20.                                     register __d0 LONG bufBytes,
  21.                                     register __d1 ULONG flags,
  22.                                     register __a6 ULONG base )
  23. {
  24.     printf ("AvailFonts(0x%X, %d, 0x%X)\n", buffer, bufBytes, flags);
  25.  
  26.     if (flags == 0xff)    // Pour prowrite
  27.         flags = AFF_SCALED | AFF_DISK | AFF_MEMORY;
  28.  
  29.     flags |= AFF_SCALED;
  30.  
  31.     return oldAvailFonts (buffer, bufBytes, flags, base);
  32. }
  33.  
  34. /* ------------------------------------------------------------------------    */
  35. void main (LONG argc, char *argv[])
  36. {
  37. S Library    *dfbase;
  38.  
  39.     dfbase = OpenLibrary ("diskfont.library", 0);
  40.     if (dfbase == NULL) {
  41.         printf ("pas de diskfont.library\n");
  42.         return;
  43.         }
  44.  
  45.     oldAvailFonts = SetFunction (dfbase, -(0x24), (APTR)newAvailFonts);
  46.     printf ("AvailFonts() patchée avec 0x%X\n", newAvailFonts);
  47.  
  48.     Wait (SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D);
  49.  
  50.  
  51.     SetFunction (dfbase, -(0x24), (APTR)oldAvailFonts);
  52.  
  53.     CloseLibrary (dfbase);
  54.  
  55.     return;
  56. }
  57.