summaryrefslogtreecommitdiffhomepage
path: root/dev/LibSCI
diff options
context:
space:
mode:
authorAmlal <amlal.elmahrouss@icloud.com>2025-02-21 08:29:52 +0100
committerAmlal <amlal.elmahrouss@icloud.com>2025-02-21 08:29:52 +0100
commit1517ad3c9d8ee73086365763edd1f3b4d935074d (patch)
tree5da121158e77af795a32f556b0401047cf9718a1 /dev/LibSCI
parent00f4fd8e3ae003d458ea0b6ae47b9ba3c9067bcf (diff)
Moved FB API to GPU.h Add Format, Message and Filesystem API.
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/LibSCI')
-rw-r--r--dev/LibSCI/GPU.h42
-rw-r--r--dev/LibSCI/Macros.h8
-rw-r--r--dev/LibSCI/SCI.h18
3 files changed, 46 insertions, 22 deletions
diff --git a/dev/LibSCI/GPU.h b/dev/LibSCI/GPU.h
index 52ae6b1d..bbcd1300 100644
--- a/dev/LibSCI/GPU.h
+++ b/dev/LibSCI/GPU.h
@@ -3,7 +3,7 @@
Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
File: GPU.h
-Purpose: GFX System Calls.
+Purpose: GPU/FB System Calls.
------------------------------------------- */
@@ -16,41 +16,57 @@ Purpose: GFX System Calls.
/// @brief GPU API.
/// ------------------------------------------------------------------------------------------ //
-struct GPUCmdBuffer;
+struct GPUCmd;
typedef VoidPtr GPUObject;
/// ------------------------------------------------------------------------------------------ //
-/// @brief Command buffer structure type.
+/// @brief Command structure type.
/// ------------------------------------------------------------------------------------------ //
-struct GPUCmdBuffer final
+
+struct GPUCmd
{
VoidPtr Data{nullptr};
SizeT DataSz{0};
SizeT BufferLayer{0};
- Bool IsGPGPUData{false};
- Bool BufferFirst{false};
+ BOOL IsGPGPUData{NO};
- Bool isGPGPUData()
+ BOOL isGPGPUData()
{
- return this->isValid() && !this->BufferFirst && this->IsGPGPUData;
+ return this->isValid() && this->IsGPGPUData;
}
- Bool isBackBuffer()
+ BOOL isBackBuffer()
{
- return !this->BufferFirst;
+ return this->BufferLayer > 0;
}
- Bool isValid()
+ BOOL isValid()
{
return this->Data && (this->DataSz > 0) && (MmGetHeapFlags(this->Data) != -1);
}
};
-IMPORT_C GPUObject GPUNewFromDeviceName(_Input const Char* device_name);
+IMPORT_C BOOL GPUListDevices(const Char** list, SizeT cnt);
+
+IMPORT_C GPUObject GPUGetFromDeviceName(_Input const Char* device_name);
+
+IMPORT_C GPUObject GPUQueryInfo(_Input const GPUObject* device_name, VoidPtr* out, SizeT out_sz);
IMPORT_C SInt32 GPUDisposeDevice(GPUObject gpu_handle, Bool cancel_all, Bool flush_all);
-IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPUCmdBuffer** cmd_list, SizeT cmd_list_cnt);
+IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPUCmd** cmd_list, SizeT cmd_list_cnt);
+
+// ------------------------------------------------------------------------------------------ //
+// @brief FB API.
+// ------------------------------------------------------------------------------------------ //
+
+IMPORT_C SInt32 FBAcquireBuffer(GPUObject* out, SInt32 width, SInt32 height);
+
+IMPORT_C SInt32 FBDisposeBuffer(GPUObject* in);
+
+IMPORT_C SInt32 FBGetColorProfile(GPUObject in);
+
+IMPORT_C SInt32 FBQueryInfo(GPUObject handle, VoidPtr* info_ptr, SizeT* info_sz);
#endif // ifndef SCI_GPU_H
diff --git a/dev/LibSCI/Macros.h b/dev/LibSCI/Macros.h
index 92461f3f..ccdfb485 100644
--- a/dev/LibSCI/Macros.h
+++ b/dev/LibSCI/Macros.h
@@ -33,6 +33,14 @@ typedef bool BOOL;
typedef bool Boolean;
typedef void Void;
+#ifndef __cplusplus
+#define true 1
+#define false 0
+#endif
+
+#define YES true
+#define NO false
+
typedef __UINT64_TYPE__ UInt64;
typedef __UINT32_TYPE__ UInt32;
typedef __UINT16_TYPE__ UInt16;
diff --git a/dev/LibSCI/SCI.h b/dev/LibSCI/SCI.h
index 3b03bee2..a7d449d4 100644
--- a/dev/LibSCI/SCI.h
+++ b/dev/LibSCI/SCI.h
@@ -318,17 +318,9 @@ IMPORT_C SInt32 SchedKill(PID, SInt32 req);
IMPORT_C SInt32 SchedBreakPoint(Void);
// ------------------------------------------------------------------------------------------ //
-// @brief Video API.
+// @brief Filesystem API.
// ------------------------------------------------------------------------------------------ //
-IMPORT_C SInt32 VideoGetBuffer(VoidPtr* out);
-
-IMPORT_C SInt32 VideoDisposeBuffer(VoidPtr* in);
-
-IMPORT_C SInt32 VideoGetColorProfile(VoidPtr* in);
-
-IMPORT_C SInt32 VideoQueryInfo(VoidPtr* info_ptr, SizeT* info_sz);
-
IMPORT_C BOOL FsCopy(const char* path, const char* dst);
IMPORT_C BOOL FsMove(const char* path, const char* dst);
@@ -338,8 +330,16 @@ IMPORT_C BOOL FsCreateDir(const char* path);
IMPORT_C BOOL FsCreateFile(const char* path);
IMPORT_C BOOL FsCreateAlias(const char* path, const char* from);
+// ------------------------------------------------------------------------------------------ //
+// @brief Format API.
+// ------------------------------------------------------------------------------------------ //
+
IMPORT_C Char* StrFmt(const Char* fmt, ...);
+// ------------------------------------------------------------------------------------------ //
+// @brief Message API.
+// ------------------------------------------------------------------------------------------ //
+
IMPORT_C SInt32 MsgFree(VoidPtr handle);
IMPORT_C SInt32 MsgShow(VoidPtr handle);