src/gba/vfame.h (view raw)
1/* Copyright (c) 2016 taizou
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
7// Support for copy protected unlicensed games from the company Vast Fame
8
9#ifndef GBA_VFAME_H
10#define GBA_VFAME_H
11
12#include "util/common.h"
13
14CXX_GUARD_START
15
16enum GBAVFameCartType {
17 VFAME_NO = 0,
18 VFAME_STANDARD = 1,
19 VFAME_GEORGE = 2
20};
21
22struct GBAVFameCart {
23 enum GBAVFameCartType cartType;
24 int sramMode;
25 int romMode;
26 int8_t writeSequence[5];
27 bool acceptingModeChange;
28};
29
30void GBAVFameInit(struct GBAVFameCart* cart);
31void GBAVFameDetect(struct GBAVFameCart* cart, uint32_t* rom, size_t romSize);
32void GBAVFameSramWrite(struct GBAVFameCart* cart, uint32_t address, uint8_t value, uint8_t* sramData);
33uint32_t GBAVFameModifyRomAddress(struct GBAVFameCart* cart, uint32_t address, size_t romSize);
34uint32_t GBAVFameGetPatternValue(uint32_t address, int bits);
35
36CXX_GUARD_END
37
38#endif