add place-holder directory for the a3000 wd533c93 scsi controller implementation.
[AROS.git] / workbench / system / SysMon / video.c
blobac66b903f468405c9b3ec51d105b429492d96190
1 /*
2 Copyright © 1995-2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "sysmon_intern.h"
8 #include <clib/alib_protos.h>
10 /* Video information */
11 #include <proto/graphics.h>
12 #include <proto/oop.h>
13 #include <hidd/gfx.h>
15 #define DVMEM(x)
17 #undef HiddBitMapAttrBase
18 OOP_AttrBase HiddGfxAttrBase;
19 OOP_AttrBase HiddBitMapAttrBase;
21 struct Library * OOPBase = NULL;
22 OOP_Object * gfxhidd;
24 /* Videofunctions */
25 static BOOL InitVideo(struct SysMonData *smdata)
27 struct OOP_ABDescr attrbases[] =
29 { IID_Hidd_Gfx, &HiddGfxAttrBase },
30 { IID_Hidd_BitMap, &HiddBitMapAttrBase },
31 { NULL, NULL }
33 struct Screen * wbscreen;
35 OOPBase = OpenLibrary("oop.library", 0L);
37 if (!OOPBase)
38 return FALSE;
40 if (!OOP_ObtainAttrBases(attrbases))
41 return FALSE;
43 wbscreen = LockPubScreen(NULL);
44 OOP_GetAttr(HIDD_BM_OBJ(wbscreen->RastPort.BitMap), aHidd_BitMap_GfxHidd, (APTR)&gfxhidd);
45 D(bug("[SysMon:Video] %s: gfxhidd @ 0x%p\n", __func__, gfxhidd);)
46 UnlockPubScreen(NULL, wbscreen);
48 return TRUE;
51 static VOID DeInitVideo(struct SysMonData *smdata)
53 OOP_ReleaseAttrBase(IID_Hidd_BitMap);
55 CloseLibrary(OOPBase);
58 VOID UpdateVideoStaticInformation(struct SysMonData * smdata)
60 TEXT buffer[64] = {0};
61 struct TagItem memTags[] =
63 {tHidd_Gfx_MemTotal, 0 },
64 {tHidd_Gfx_MemAddressableTotal, 0 },
65 {TAG_DONE, 0 }
68 DVMEM(bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__, memTags);)
69 OOP_GetAttr(gfxhidd, aHidd_Gfx_MemoryAttribs, (IPTR *)memTags);
71 __sprintf(buffer, "%ld kB", (ULONG)(memTags[0].ti_Data / 1024));
72 set(smdata->memorysize[MEMORY_VMEM], MUIA_Text_Contents, buffer);
73 __sprintf(buffer, "%ld kB", (ULONG)(memTags[1].ti_Data / 1024));
74 set(smdata->memorysize[MEMORY_VMEMWINDOW], MUIA_Text_Contents, buffer);
77 VOID UpdateVideoInformation(struct SysMonData * smdata)
79 TEXT buffer[64] = {0};
80 struct TagItem memTags[] =
82 {tHidd_Gfx_MemFree, 0 },
83 {tHidd_Gfx_MemAddressableFree, 0 },
84 {TAG_DONE, 0 }
87 DVMEM(bug("[SysMon:Video] %s: memTags @ 0x%p\n", __func__, memTags);)
88 OOP_GetAttr(gfxhidd, aHidd_Gfx_MemoryAttribs, (IPTR *)memTags);
90 __sprintf(buffer, "%ld kB", (ULONG)(memTags[0].ti_Data / 1024));
91 set(smdata->memoryfree[MEMORY_VMEM], MUIA_Text_Contents, buffer);
92 __sprintf(buffer, "%ld kB", (ULONG)(memTags[1].ti_Data / 1024));
93 set(smdata->memoryfree[MEMORY_VMEMWINDOW], MUIA_Text_Contents, buffer);
96 struct SysMonModule videomodule =
98 .Init = InitVideo,
99 .DeInit = DeInitVideo,