home *** CD-ROM | disk | FTP | other *** search
- ''
- '' $Id: VSPrintf.bas,v 1.2 1994/05/12 14:20:53 alex Rel $
- ''
- '' Amiga.lib (sort-of) style VSPrintf function
- ''
- '' (c) Copyright 1994 HiSoft
- ''
-
- 'REM $INCLUDE Exec.bh
-
- SUB VSPrintf(BYVAL buffer&, BYVAL fmt&, BYVAL args&)
- STATIC vspfPCP&, vspfJunk&
-
- IF vspfPCP& = 0& THEN
- ' wizardry to stuff a bit of assembler into a static variable;
- ' we need to flush its cached location afterwards
-
- vspfPCP& = &h16c04e75 ' move.b d0,(a3)+; rts
- IF PEEKW(LIBRARY("exec.library") + LibNode + lib_Version) >= 37 THEN
- ' CacheClearE is >= V37 only, without the flush this code will
- ' certainly not work on a 68040 (but does 1.3 work on an '040?)
-
- CacheClearE VARPTR(vspfPCP&), 4, CACRF_ClearI& OR CACRF_ClearD&
- END IF
- END IF
- vspfJunk& = RawDoFmt&(fmt&, args&, VARPTR(vspfPCP&), buffer&)
- END SUB
-