Set ERROR_NO_FREE_STORE upon failure if called from a process (this is
[tangerine.git] / rom / graphics / finddisplayinfo.c
blob18496eaf0b97664d785dc718c82a11c0923b9ec3
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function FindDisplayInfo()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <proto/graphics.h>
10 #include <graphics/displayinfo.h>
11 #include <hidd/graphics.h>
12 #include "dispinfo.h"
13 #include "graphics_intern.h"
15 /*****************************************************************************
17 NAME */
18 #include <proto/graphics.h>
20 AROS_LH1(DisplayInfoHandle, FindDisplayInfo,
22 /* SYNOPSIS */
23 AROS_LHA(ULONG, ID, D0),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 121, Graphics)
28 /* FUNCTION
29 Search for a DisplayInfo which matches the ID key.
31 INPUTS
32 ID - identifier
34 RESULT
35 handle - handle to a displayinfo record with that key
36 or NULL if no match
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 graphics/displayinfo.h
47 INTERNALS
49 HISTORY
52 ******************************************************************************/
54 AROS_LIBFUNC_INIT
56 DisplayInfoHandle ret = NULL;
57 HIDDT_ModeID hiddmode;
58 OOP_Object *sync, *pixfmt;
60 D(bug("FindDisplayInfo(id=%x)\n", ID));
62 /* Check for the NOTNULLMASK */
63 if ((ID & NOTNULLMASK) != NOTNULLMASK) {
64 D(bug("!!! NO AROS MODEID IN FindDisplayInfo() !!!\n"));
65 return NULL;
68 hiddmode = AMIGA_TO_HIDD_MODEID(ID);
70 /* Try to get mode info for the mode */
71 if (!HIDD_Gfx_GetMode(SDD(GfxBase)->gfxhidd, hiddmode, &sync, &pixfmt)) {
72 D(bug("!!! NO AROS MODEID IN FindDisplayInfo() !!!\n"));
73 return NULL;
76 ret = (DisplayInfoHandle)ID;
78 return ret;
80 AROS_LIBFUNC_EXIT
81 } /* FindDisplayInfo */