From d0b9923b0ab4727e054e23356d34c7db7b660aeb Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 19 Nov 2017 17:37:36 +0100 Subject: [PATCH] Move XFB settings in DTM header back to where they were 7f0834c9 moved the locations of the Real XFB (now XFB to RAM) and Disabled XFB (now Immediate Mode) settings. There are programs other than Dolphin that parse DTM headers, so this is not good. Note that Immediate XFB actually is the inversion of Disabled XFB. I hope that's not too much of a problem... --- Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp | 8 ++++---- Source/Core/Core/Movie.cpp | 4 ++-- Source/Core/Core/Movie.h | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp index 3585df4cc3..36f7c12c2b 100644 --- a/Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp @@ -41,9 +41,9 @@ static void LoadFromDTM(Config::Layer* config_layer, Movie::DTMHeader* dtm) config_layer->Set(Config::GFX_HACK_EFB_ACCESS_ENABLE, dtm->bEFBAccessEnable); config_layer->Set(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, dtm->bSkipEFBCopyToRam); - config_layer->Set(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, dtm->bSkipXFBCopyToRam); - config_layer->Set(Config::GFX_HACK_IMMEDIATE_XFB, dtm->bImmediateXFB); config_layer->Set(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, dtm->bEFBEmulateFormatChanges); + config_layer->Set(Config::GFX_HACK_IMMEDIATE_XFB, dtm->bImmediateXFB); + config_layer->Set(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, dtm->bSkipXFBCopyToRam); } void SaveToDTM(Movie::DTMHeader* dtm) @@ -64,9 +64,9 @@ void SaveToDTM(Movie::DTMHeader* dtm) dtm->bEFBAccessEnable = Config::Get(Config::GFX_HACK_EFB_ACCESS_ENABLE); dtm->bSkipEFBCopyToRam = Config::Get(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM); - dtm->bSkipXFBCopyToRam = Config::Get(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM); - dtm->bImmediateXFB = Config::Get(Config::GFX_HACK_IMMEDIATE_XFB); dtm->bEFBEmulateFormatChanges = Config::Get(Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES); + dtm->bImmediateXFB = Config::Get(Config::GFX_HACK_IMMEDIATE_XFB); + dtm->bSkipXFBCopyToRam = Config::Get(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM); // This never used the regular config dtm->bSkipIdle = true; diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 58247a60e6..9d0114ecfc 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -1373,9 +1373,9 @@ void SetGraphicsConfig() { g_Config.bEFBAccessEnable = tmpHeader.bEFBAccessEnable; g_Config.bSkipEFBCopyToRam = tmpHeader.bSkipEFBCopyToRam; - g_Config.bSkipXFBCopyToRam = tmpHeader.bSkipXFBCopyToRam; - g_Config.bImmediateXFB = tmpHeader.bImmediateXFB; g_Config.bEFBEmulateFormatChanges = tmpHeader.bEFBEmulateFormatChanges; + g_Config.bImmediateXFB = tmpHeader.bImmediateXFB; + g_Config.bSkipXFBCopyToRam = tmpHeader.bSkipXFBCopyToRam; } // NOTE: EmuThread / Host Thread diff --git a/Source/Core/Core/Movie.h b/Source/Core/Core/Movie.h index 7500fc7456..b4ab682d8c 100644 --- a/Source/Core/Core/Movie.h +++ b/Source/Core/Core/Movie.h @@ -52,6 +52,8 @@ struct ControllerState static_assert(sizeof(ControllerState) == 8, "ControllerState should be 8 bytes"); #pragma pack(pop) +// When making changes to the DTM format, keep in mind that there are programs other +// than Dolphin that parse DTM files. The format is expected to be relatively stable. #pragma pack(push, 1) struct DTMHeader { @@ -88,10 +90,10 @@ struct DTMHeader bool bEFBAccessEnable; bool bEFBCopyEnable; bool bSkipEFBCopyToRam; - bool bSkipXFBCopyToRam; - bool bImmediateXFB; bool bEFBCopyCacheEnable; bool bEFBEmulateFormatChanges; + bool bImmediateXFB; + bool bSkipXFBCopyToRam; u8 memcards; // Memcards inserted (from least to most significant, the bits are slot A and B) bool bClearSave; // Create a new memory card when playing back a movie if true u8 bongos; // Bongos plugged in (from least to most significant, the bits are ports 1-4)