Skip to content
Permalink
Browse files
Merge pull request #9718 from Pokechu22/better-fifo-analyzer-part-3
Fifo analyzer improvements, part 3
  • Loading branch information
JMC47 committed Dec 20, 2021
2 parents 1714dc6 + ffa512f commit 32fed91
Show file tree
Hide file tree
Showing 66 changed files with 2,688 additions and 2,626 deletions.
@@ -55,9 +55,9 @@ class EnumFormatter
constexpr auto parse(fmt::format_parse_context& ctx)
{
auto it = ctx.begin(), end = ctx.end();
// 'u' for user display, 's' for shader generation
if (it != end && (*it == 'u' || *it == 's'))
formatting_for_shader = (*it++ == 's');
// 'u' for user display, 's' for shader generation, 'n' for name only
if (it != end && (*it == 'u' || *it == 's' || *it == 'n'))
format_type = *it++;
return it;
}

@@ -68,19 +68,24 @@ class EnumFormatter
const auto value_u = static_cast<std::make_unsigned_t<T>>(value_s); // Always unsigned
const bool has_name = m_names.InBounds(e) && m_names[e] != nullptr;

if (!formatting_for_shader)
switch (format_type)
{
default:
case 'u':
if (has_name)
return fmt::format_to(ctx.out(), "{} ({})", m_names[e], value_s);
else
return fmt::format_to(ctx.out(), "Invalid ({})", value_s);
}
else
{
case 's':
if (has_name)
return fmt::format_to(ctx.out(), "{:#x}u /* {} */", value_u, m_names[e]);
else
return fmt::format_to(ctx.out(), "{:#x}u /* Invalid */", value_u);
case 'n':
if (has_name)
return fmt::format_to(ctx.out(), "{}", m_names[e]);
else
return fmt::format_to(ctx.out(), "Invalid ({})", value_s);
}
}

@@ -92,5 +97,5 @@ class EnumFormatter

private:
const array_type m_names;
bool formatting_for_shader = false;
char format_type = 'u';
};
@@ -103,16 +103,10 @@ add_library(core
DSP/LabelMap.h
DSPEmulator.cpp
DSPEmulator.h
FifoPlayer/FifoAnalyzer.cpp
FifoPlayer/FifoAnalyzer.h
FifoPlayer/FifoDataFile.cpp
FifoPlayer/FifoDataFile.h
FifoPlayer/FifoPlaybackAnalyzer.cpp
FifoPlayer/FifoPlaybackAnalyzer.h
FifoPlayer/FifoPlayer.cpp
FifoPlayer/FifoPlayer.h
FifoPlayer/FifoRecordAnalyzer.cpp
FifoPlayer/FifoRecordAnalyzer.h
FifoPlayer/FifoRecorder.cpp
FifoPlayer/FifoRecorder.h
FreeLookConfig.cpp

This file was deleted.

This file was deleted.

0 comments on commit 32fed91

Please sign in to comment.