⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nullgpu.cpp

📁 一个任天堂掌上游戏机NDS的源代码
💻 CPP
字号:
/*************************************************************************** DSemu - The Next Generation                                             ** Null GPU plugin: Implementation [nullgpu.cpp]                           ** Copyright Imran Nazar, 2005; released under the BSD public licence.     ***************************************************************************/#include <string>#include "events.h"#include "defs.h"#include "nullgpu.h"#include "log.h"//---Static private class members------------------------------------------// Every plugin has an INFO structure attached, with info about the plugin.PLUGININFO nullGPU::pInfo={    PLUGIN_TYPE_GPU,    0x00010001,    "Null graphics plugin",    "DSemu-ng"};GUIPlugin *nullGPU::GUI;std::string nullGPU::pluginName;void nullGPU::drawline(Plugin *in) { ((nullGPU*)in)->line(); }void nullGPU::line(){    GUI->eventPush(1000, EVENT_HBLANK_START, (vfptr)drawline, this);}// Tell the GPU where it'll be rendering tovoid nullGPU::setDisplay(u8 *buf){}// Initialise plugin: Allocate memories, register with MMUnullGPU::nullGPU(std::string name, REQPTR req, UNREQPTR unreq){    pName = std::string(name);    pClass = pName.substr(0, pName.find(".")+1);    pRequest = req;    pUnrequest = unreq;    pluginName = std::string(pName);    GUI = (GUIPlugin*)pRequest("UI");        Logger::log(pName) << "Initialised.";}// Shut down plugin: Free up memoriesnullGPU::~nullGPU(){    pUnrequest("UI", 0); GUI = NULL;        Logger::log(pName) << "Shutdown.";}// Reset plugin: Clear memories, read config filevoid nullGPU::reset(){    // First scanline call: In a thousand cycles, come back and draw a line    GUI->eventPush(1000, EVENT_HBLANK_START, (vfptr)drawline, this);        Logger::log(pName) << "Reset";}// Provide status: Fill palette-window framebuffervoid nullGPU::status(int opt1=0, int opt2=0){}//---Plugin architecture support-------------------------------------------// Retrieve Plugin class from outside// Parameters: plg   - Address of a pointer to a Plugin class to 'new'//             name  - FQPN of plugin as listed in INI file//             req   - Pointer to PluginRequest API function//             unreq - Pointer to PluginUnrequest API functionEXPORTFUNC void getPlugin(Plugin **plg,                          std::string name,                          REQPTR req, UNREQPTR unreq){   *plg = new nullGPU(name, req, unreq);}// Provide plugin version informationPLUGININFO *nullGPU::getinfo(){    return &pInfo;}// Release plugin from outsidevoid nullGPU::release(){    // Delete the Test plugin that was 'new'd in getPlugin.    delete this;}/*** EOF: nullgpu.cpp ****************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -