diff options
| author | 2017-01-28 14:48:13 -0800 | |
|---|---|---|
| committer | 2017-02-09 00:04:24 -0800 | |
| commit | f241bb72f5b6b0b213053e000051bf3b7e6b4bb0 (patch) | |
| tree | 8e5b02afe942842d4e86b420dfc4474224bbe114 /src/video_core/regs.h | |
| parent | VideoCore: Use union to index into Regs struct (diff) | |
| download | yuzu-f241bb72f5b6b0b213053e000051bf3b7e6b4bb0.tar.gz yuzu-f241bb72f5b6b0b213053e000051bf3b7e6b4bb0.tar.xz yuzu-f241bb72f5b6b0b213053e000051bf3b7e6b4bb0.zip | |
Pica/Regs: Use binary search to look up reg names
This gets rid of the static unordered_map. Also changes the return type
const char*, avoiding unnecessary allocations (the result was only used
by calling .c_str() on it.)
Diffstat (limited to 'src/video_core/regs.h')
| -rw-r--r-- | src/video_core/regs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/regs.h b/src/video_core/regs.h index e38ab4333..86826088b 100644 --- a/src/video_core/regs.h +++ b/src/video_core/regs.h | |||
| @@ -64,8 +64,8 @@ struct Regs { | |||
| 64 | std::array<u32, NUM_REGS> reg_array; | 64 | std::array<u32, NUM_REGS> reg_array; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | // Map register indices to names readable by humans | 67 | /// Map register indices to names readable by humans |
| 68 | static std::string GetCommandName(int index); | 68 | static const char* GetRegisterName(u16 index); |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Regs struct has wrong size"); | 71 | static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Regs struct has wrong size"); |