all repos — mgba @ 2d02719fa57d4e4a33168955a8e0c34dfabc301a

mGBA Game Boy Advance Emulator

src/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 "util/common.h"
10
11CXX_GUARD_START
12
13#include "util/patch.h"
14#include "util/vector.h"
15
16#define PATCH_FAST_EXTENT 256
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