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

This commit is contained in:
Lioncash 2014-10-30 12:45:27 -04:00
parent d734ba1469
commit b09ce72605
2 changed files with 6 additions and 3 deletions

View File

@ -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"
@ -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
@ -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)

View File

@ -4,6 +4,7 @@
#pragma once
#include <array>
#include "Core/DSP/DSPInterpreter.h"
// Basic code analysis.
@ -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,