home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
553.lha
/
NewAvailFonts
/
OldNewAF.c
< prev
Wrap
C/C++ Source or Header
|
1991-09-09
|
1KB
|
57 lines
#include <exec/types.h>
#include <exec/exec.h>
#include <proto/exec.h>
#include <libraries/diskfont.h>
#include <dos/dos.h>
int CXBRK(void) {return 0;}
int chkabort(void) {return 0;}
//#pragma libcall DiskfontBase AvailFonts 24 10803
LONG (* __asm __saveds oldAvailFonts) ( register __a0 struct AvailFontsHeader *buffer,
register __d0 LONG bufBytes,
register __d1 ULONG flags,
register __a6 ULONG base );
/* ------------------------------------------------------------------------ */
LONG __asm __saveds newAvailFonts( register __a0 struct AvailFontsHeader *buffer,
register __d0 LONG bufBytes,
register __d1 ULONG flags,
register __a6 ULONG base )
{
printf ("AvailFonts(0x%X, %d, 0x%X)\n", buffer, bufBytes, flags);
if (flags == 0xff) // Pour prowrite
flags = AFF_SCALED | AFF_DISK | AFF_MEMORY;
flags |= AFF_SCALED;
return oldAvailFonts (buffer, bufBytes, flags, base);
}
/* ------------------------------------------------------------------------ */
void main (LONG argc, char *argv[])
{
S Library *dfbase;
dfbase = OpenLibrary ("diskfont.library", 0);
if (dfbase == NULL) {
printf ("pas de diskfont.library\n");
return;
}
oldAvailFonts = SetFunction (dfbase, -(0x24), (APTR)newAvailFonts);
printf ("AvailFonts() patchée avec 0x%X\n", newAvailFonts);
Wait (SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D);
SetFunction (dfbase, -(0x24), (APTR)oldAvailFonts);
CloseLibrary (dfbase);
return;
}