mgba/include/mgba-util/patch/fast.h

39 lines
874 B
C
Raw Normal View History

2016-08-29 06:01:39 +00:00
/* Copyright (c) 2013-2016 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef PATCH_FAST_H
#define PATCH_FAST_H
#include <mgba-util/common.h>
2016-08-29 06:01:39 +00:00
2016-12-27 05:01:55 +00:00
CXX_GUARD_START
#include <mgba-util/patch.h>
#include <mgba-util/vector.h>
2016-08-29 06:01:39 +00:00
2017-04-29 06:45:08 +00:00
#define PATCH_FAST_EXTENT 128
2016-08-29 06:01:39 +00:00
struct PatchFastExtent {
size_t length;
size_t offset;
uint32_t extent[PATCH_FAST_EXTENT];
};
DECLARE_VECTOR(PatchFastExtents, struct PatchFastExtent);
struct PatchFast {
struct Patch d;
struct PatchFastExtents extents;
};
void initPatchFast(struct PatchFast*);
void deinitPatchFast(struct PatchFast*);
bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size);
2016-12-27 05:01:55 +00:00
CXX_GUARD_END
2016-08-29 06:01:39 +00:00
#endif