Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSPAnalyzer: Use a std::array for the code flags #1445

Merged
merged 1 commit into from Oct 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Source/Core/Core/DSP/DSPAnalyzer.cpp
Expand Up @@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <array>

#include "Core/DSP/DSPAnalyzer.h"
#include "Core/DSP/DSPInterpreter.h"
#include "Core/DSP/DSPMemoryMap.h"
Expand All @@ -10,7 +12,7 @@
namespace DSPAnalyzer {

// Holds data about all instructions in RAM.
u8 code_flags[ISPACE];
std::array<u8, ISPACE> code_flags;

// Good candidates for idle skipping is mail wait loops. If we're time slicing
// between the main CPU and the DSP, if the DSP runs into one of these, it might
Expand Down Expand Up @@ -62,7 +64,7 @@ const u16 idle_skip_sigs[NUM_IDLE_SIGS][MAX_IDLE_SIG_SIZE + 1] =

static void Reset()
{
memset(code_flags, 0, sizeof(code_flags));
code_flags.fill(0);
}

static void AnalyzeRange(int start_addr, int end_addr)
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/DSP/DSPAnalyzer.h
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include <array>
#include "Core/DSP/DSPInterpreter.h"

// Basic code analysis.
Expand All @@ -27,7 +28,7 @@ enum
// Easy to query array covering the whole of instruction memory.
// Just index by address.
// This one will be helpful for debuggers and jits.
extern u8 code_flags[ISPACE];
extern std::array<u8, ISPACE> code_flags;

// This one should be called every time IRAM changes - which is basically
// every time that a new ucode gets uploaded, and never else. At that point,
Expand Down