Merge pull request #90 from gizmo98/patch-2
[libretro-ppsspp.git] / headless / StubHost.h
blob39290b7bc238894dd4026885efb9c349aab7da4f
1 // Copyright (c) 2012- PPSSPP Project.
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0 or later versions.
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 2.0 for more details.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official git repository and contact information can be found at
16 // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
18 #pragma once
20 #include "Core/Host.h"
21 #include "Core/Debugger/SymbolMap.h"
23 // TODO: Get rid of this junk
24 class HeadlessHost : public Host
26 public:
27 // void StartThread() override
28 void UpdateUI() override {}
30 void UpdateMemView() override {}
31 void UpdateDisassembly() override {}
33 void SetDebugMode(bool mode) { }
35 bool InitGraphics(std::string *error_message) override {return false;}
36 void ShutdownGraphics() override {}
38 void InitSound() override {}
39 void UpdateSound() override {}
40 void ShutdownSound() override {}
42 // this is sent from EMU thread! Make sure that Host handles it properly
43 void BootDone() override {}
45 bool IsDebuggingEnabled() override { return false; }
46 bool AttemptLoadSymbolMap() override { symbolMap.Clear(); return false; }
48 bool ShouldSkipUI() override { return true; }
50 void SendDebugOutput(const std::string &output) override {
51 if (output.find('\n') != output.npos) {
52 DoFlushDebugOutput();
53 fwrite(output.data(), sizeof(char), output.length(), stdout);
54 } else {
55 debugOutputBuffer_ += output;
58 virtual void FlushDebugOutput() {
59 DoFlushDebugOutput();
61 inline void DoFlushDebugOutput() {
62 if (!debugOutputBuffer_.empty()) {
63 fwrite(debugOutputBuffer_.data(), sizeof(char), debugOutputBuffer_.length(), stdout);
64 debugOutputBuffer_.clear();
67 virtual void SetComparisonScreenshot(const std::string &filename) {}
70 // Unique for HeadlessHost
71 virtual void SwapBuffers() {}
73 protected:
74 std::string debugOutputBuffer_;