From 2efb260b4483204edbca5fd8cc09e91b6930bf5d Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 7 Apr 2022 13:17:34 -0700 Subject: [PATCH] GPU: Client fetch objects can now have names and descriptions. --- desmume/src/GPU.cpp | 16 ++++++++++++++++ desmume/src/GPU.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 695d2ac5b..c75c5afb9 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -5913,6 +5913,12 @@ GPUClientFetchObject::GPUClientFetchObject() memset(&_fetchDisplayInfo[i], 0, sizeof(NDSDisplayInfo)); } + memset(_name, 0, sizeof(_name)); + strncpy(_name, "Generic Video", sizeof(_name) - 1); + + memset(_description, 0, sizeof(_description)); + strncpy(_description, "No description.", sizeof(_description) - 1); + _clientData = NULL; _lastFetchIndex = 0; } @@ -5997,6 +6003,16 @@ void GPUClientFetchObject::SetFetchDisplayInfo(const NDSDisplayInfo &displayInfo this->_fetchDisplayInfo[displayInfo.bufferIndex] = displayInfo; } +const char* GPUClientFetchObject::GetName() const +{ + return this->_name; +} + +const char* GPUClientFetchObject::GetDescription() const +{ + return this->_description; +} + u8 GPUClientFetchObject::GetLastFetchIndex() const { return this->_lastFetchIndex; diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index e76e8419f..b78295391 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -1991,6 +1991,9 @@ public: class GPUClientFetchObject { protected: + char _name[256]; + char _description[256]; + NDSDisplayInfo _fetchDisplayInfo[MAX_FRAMEBUFFER_PAGES]; volatile u8 _lastFetchIndex; void *_clientData; @@ -2006,6 +2009,9 @@ public: virtual void SetFetchBuffers(const NDSDisplayInfo ¤tDisplayInfo); virtual void FetchFromBufferIndex(const u8 index); + const char* GetName() const; + const char* GetDescription() const; + u8 GetLastFetchIndex() const; void SetLastFetchIndex(const u8 fetchIndex);