all repos — mgba @ 845ecfe81e4458645688af34e347e99bb0b53ed0

mGBA Game Boy Advance Emulator

src/gba/cheats/gameshark.h (view raw)

 1/* Copyright (c) 2013-2015 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 GBA_CHEATS_GAMESHARK_H
 7#define GBA_CHEATS_GAMESHARK_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13extern const uint32_t GBACheatGameSharkSeeds[4];
14
15enum GBACheatGameSharkVersion {
16	GBA_GS_NOT_SET = 0,
17	GBA_GS_GSAV1 = 1,
18	GBA_GS_GSAV1_RAW = 2,
19	GBA_GS_PARV3 = 3,
20	GBA_GS_PARV3_RAW = 4
21};
22
23struct GBACheatSet;
24void GBACheatDecryptGameShark(uint32_t* op1, uint32_t* op2, const uint32_t* seeds);
25void GBACheatReseedGameShark(uint32_t* seeds, uint16_t params, const uint8_t* t1, const uint8_t* t2);
26void GBACheatSetGameSharkVersion(struct GBACheatSet* cheats, enum GBACheatGameSharkVersion version);
27bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2);
28int GBACheatGameSharkProbability(uint32_t op1, uint32_t op2);
29
30CXX_GUARD_END
31
32#endif