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
14enum GBAVFameCartType {
15 VFAME_NO = 0,
16 VFAME_STANDARD = 1,
17 VFAME_GEORGE = 2
18};
19
20struct GBAVFameCart {
21 enum GBAVFameCartType cartType;
22 int sramMode;
23 int romMode;
24 int8_t writeSequence[5];
25 bool acceptingModeChange;
26};
27
28void GBAVFameInit(struct GBAVFameCart* cart);
29void GBAVFameDetect(struct GBAVFameCart* cart, uint32_t* rom, size_t romSize);
30void GBAVFameSramWrite(struct GBAVFameCart* cart, uint32_t address, uint8_t value, uint8_t* sramData);
31uint32_t GBAVFameModifyRomAddress(struct GBAVFameCart* cart, uint32_t address, size_t romSize);
32uint32_t GBAVFameGetPatternValue(uint32_t address, int bits);
33
34#endif