From 47253d8398a0469a3658b9fd23ebd8e3610c474d Mon Sep 17 00:00:00 2001 From: Bart Trzynadlowski Date: Sat, 11 Nov 2023 13:55:02 -0800 Subject: [PATCH] Fixed graphics analysis -gfx-state option --- Src/Model3/Model3GraphicsState.h | 12 ++++++------ Src/OSD/SDL/Main.cpp | 14 ++++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Src/Model3/Model3GraphicsState.h b/Src/Model3/Model3GraphicsState.h index 1675c1e..5096835 100644 --- a/Src/Model3/Model3GraphicsState.h +++ b/Src/Model3/Model3GraphicsState.h @@ -1,12 +1,12 @@ /** ** Supermodel ** A Sega Model 3 Arcade Emulator. - ** Copyright 2011-2016 Bart Trzynadlowski, Nik Henson + ** Copyright 2011-2016 Bart Trzynadlowski, Nik Henson ** ** This file is part of Supermodel. ** ** Supermodel is free software: you can redistribute it and/or modify it under - ** the terms of the GNU General Public License as published by the Free + ** the terms of the GNU General Public License as published by the Free ** Software Foundation, either version 3 of the License, or (at your option) ** any later version. ** @@ -18,10 +18,10 @@ ** You should have received a copy of the GNU General Public License along ** with Supermodel. If not, see . **/ - + /* * Model3GraphicsState.h - * + * * Minimalistic implementation of IEmulator designed to load and view graphics * state. */ @@ -52,7 +52,7 @@ public: void SaveState(CBlockFile *SaveState) override { } - + void LoadState(CBlockFile *SaveState) override { m_real3D.LoadState(SaveState); @@ -116,7 +116,7 @@ public: else rom_set.get_rom("vrom").CopyTo(m_vrom.get(), 64*0x100000); int stepping = ((m_game.stepping[0] - '0') << 4) | (m_game.stepping[2] - '0'); - m_real3D.SetStepping(stepping, false); + m_real3D.SetStepping(stepping); return OKAY; } diff --git a/Src/OSD/SDL/Main.cpp b/Src/OSD/SDL/Main.cpp index d9b3c32..8d9085c 100644 --- a/Src/OSD/SDL/Main.cpp +++ b/Src/OSD/SDL/Main.cpp @@ -547,6 +547,7 @@ void Screenshot() #include static std::string s_gfxStatePath; +static const std::string k_gfxAnalysisPath = "GraphicsAnalysis/"; static std::string GetFileBaseName(const std::string &file) { @@ -603,7 +604,7 @@ static void TestPolygonHeaderBits(IEmulator *Emu) if ((unknownPolyBits[idx] & mask)) { Emu->RenderFrame(); - std::string file = Util::Format() << s_analysisPath << GetFileBaseName(s_gfxStatePath) << "." << "poly" << "." << idx << "_" << Util::Hex(mask) << ".bmp"; + std::string file = Util::Format() << k_gfxAnalysisPath << GetFileBaseName(s_gfxStatePath) << "." << "poly" << "." << idx << "_" << Util::Hex(mask) << ".bmp"; SaveFrameBuffer(file); } } @@ -619,7 +620,7 @@ static void TestPolygonHeaderBits(IEmulator *Emu) if ((unknownCullingNodeBits[idx] & mask)) { Emu->RenderFrame(); - std::string file = Util::Format() << s_analysisPath << GetFileBaseName(s_gfxStatePath) << "." << "culling" << "." << idx << "_" << Util::Hex(mask) << ".bmp"; + std::string file = Util::Format() << k_gfxAnalysisPath << GetFileBaseName(s_gfxStatePath) << "." << "culling" << "." << idx << "_" << Util::Hex(mask) << ".bmp"; SaveFrameBuffer(file); } } @@ -628,7 +629,7 @@ static void TestPolygonHeaderBits(IEmulator *Emu) glReadBuffer(readBuffer); // Generate the HTML GUI - std::string file = Util::Format() << s_analysisPath << "_" << GetFileBaseName(s_gfxStatePath) << ".html"; + std::string file = Util::Format() << k_gfxAnalysisPath << "_" << GetFileBaseName(s_gfxStatePath) << ".html"; std::ofstream fs(file); if (!fs.good()) ErrorLog("Unable to open '%s' for writing.", file.c_str()); @@ -1603,8 +1604,13 @@ static void Help(void) #ifdef SUPERMODEL_DEBUGGER puts(" -disable-debugger Completely disable debugger functionality"); puts(" -enter-debugger Enter debugger at start of emulation"); - puts(""); #endif // SUPERMODEL_DEBUGGER +#ifdef DEBUG + puts(" -gfx-state= Produce graphics analysis for save state (works only"); + puts(" with the legacy 3D engine and requires a"); + puts(" GraphicsAnalysis directory to exist)"); +#endif + puts(""); } struct ParsedCommandLine