diff options
| author | 2014-12-21 17:26:51 -0500 | |
|---|---|---|
| committer | 2014-12-21 17:26:51 -0500 | |
| commit | b3cee192892e9ee770c42f203e5a14bca17d4ba0 (patch) | |
| tree | 3bd0c394f0c0243fcd23d7222d77b61ac9a7b8ca /src | |
| parent | CFG: Corrected the licenses in cfg_i.cpp and cfg_u.cpp (diff) | |
| download | yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.gz yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.xz yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.zip | |
CFG: Changed the CreateConfigInfoBlk search loop
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/cfg/cfg.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index d41e15285..2697f8036 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp | |||
| @@ -69,19 +69,16 @@ ResultCode CreateConfigInfoBlk(u32 block_id, u32 size, u32 flags, const u8* data | |||
| 69 | // Insert the block header with offset 0 for now | 69 | // Insert the block header with offset 0 for now |
| 70 | config->block_entries[config->total_entries] = { block_id, 0, size, flags }; | 70 | config->block_entries[config->total_entries] = { block_id, 0, size, flags }; |
| 71 | if (size > 4) { | 71 | if (size > 4) { |
| 72 | s32 total_entries = config->total_entries - 1; | ||
| 73 | u32 offset = config->data_entries_offset; | 72 | u32 offset = config->data_entries_offset; |
| 74 | // Perform a search to locate the next offset for the new data | 73 | // Perform a search to locate the next offset for the new data |
| 75 | // use the offset and size of the previous block to determine the new position | 74 | // use the offset and size of the previous block to determine the new position |
| 76 | while (total_entries >= 0) { | 75 | for (int i = config->total_entries - 1; i >= 0; --i) { |
| 77 | // Ignore the blocks that don't have a separate data offset | 76 | // Ignore the blocks that don't have a separate data offset |
| 78 | if (config->block_entries[total_entries].size > 4) { | 77 | if (config->block_entries[i].size > 4) { |
| 79 | offset = config->block_entries[total_entries].offset_or_data + | 78 | offset = config->block_entries[i].offset_or_data + |
| 80 | config->block_entries[total_entries].size; | 79 | config->block_entries[i].size; |
| 81 | break; | 80 | break; |
| 82 | } | 81 | } |
| 83 | |||
| 84 | --total_entries; | ||
| 85 | } | 82 | } |
| 86 | 83 | ||
| 87 | config->block_entries[config->total_entries].offset_or_data = offset; | 84 | config->block_entries[config->total_entries].offset_or_data = offset; |