include/mgba-util/patch/fast.h (view raw)
1/* Copyright (c) 2013-2016 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef PATCH_FAST_H
7#define PATCH_FAST_H
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba-util/patch.h>
14#include <mgba-util/vector.h>
15
16#define PATCH_FAST_EXTENT 128
17
18struct PatchFastExtent {
19 size_t length;
20 size_t offset;
21 uint32_t extent[PATCH_FAST_EXTENT];
22};
23
24DECLARE_VECTOR(PatchFastExtents, struct PatchFastExtent);
25
26struct PatchFast {
27 struct Patch d;
28
29 struct PatchFastExtents extents;
30};
31
32void initPatchFast(struct PatchFast*);
33void deinitPatchFast(struct PatchFast*);
34bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size);
35
36CXX_GUARD_END
37
38#endif