include/mgba/gb/interface.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 GB_INTERFACE_H
7#define GB_INTERFACE_H
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13enum GBModel {
14 GB_MODEL_AUTODETECT = 0xFF,
15 GB_MODEL_DMG = 0x00,
16 GB_MODEL_SGB = 0x40,
17 GB_MODEL_CGB = 0x80,
18 GB_MODEL_AGB = 0xC0
19};
20
21enum GBMemoryBankControllerType {
22 GB_MBC_AUTODETECT = -1,
23 GB_MBC_NONE = 0,
24 GB_MBC1 = 1,
25 GB_MBC2 = 2,
26 GB_MBC3 = 3,
27 GB_MBC5 = 5,
28 GB_MBC6 = 6,
29 GB_MBC7 = 7,
30 GB_MMM01 = 0x10,
31 GB_HuC1 = 0x11,
32 GB_HuC3 = 0x12,
33 GB_MBC3_RTC = 0x103,
34 GB_MBC5_RUMBLE = 0x105
35};
36
37struct GBSIODriver {
38 struct GBSIO* p;
39
40 bool (*init)(struct GBSIODriver* driver);
41 void (*deinit)(struct GBSIODriver* driver);
42 void (*writeSB)(struct GBSIODriver* driver, uint8_t value);
43 uint8_t (*writeSC)(struct GBSIODriver* driver, uint8_t value);
44};
45
46CXX_GUARD_END
47
48#endif