all repos — mgba @ 5fd8ebbbaf2e9db17bb0ab388478bbbb09eafc51

mGBA Game Boy Advance Emulator

include/mgba/gba/interface.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_INTERFACE_H
 7#define GBA_INTERFACE_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/interface.h>
14
15enum GBASIOMode {
16	SIO_NORMAL_8 = 0,
17	SIO_NORMAL_32 = 1,
18	SIO_MULTI = 2,
19	SIO_UART = 3,
20	SIO_GPIO = 8,
21	SIO_JOYBUS = 12
22};
23
24struct GBA;
25struct GBAAudio;
26struct GBASIO;
27struct GBAVideoRenderer;
28
29extern const int GBA_LUX_LEVELS[10];
30
31enum {
32	mPERIPH_GBA_LUMINANCE = 0x1000
33};
34
35struct GBALuminanceSource {
36	void (*sample)(struct GBALuminanceSource*);
37
38	uint8_t (*readLuminance)(struct GBALuminanceSource*);
39};
40
41struct GBASIODriver {
42	struct GBASIO* p;
43
44	bool (*init)(struct GBASIODriver* driver);
45	void (*deinit)(struct GBASIODriver* driver);
46	bool (*load)(struct GBASIODriver* driver);
47	bool (*unload)(struct GBASIODriver* driver);
48	uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
49};
50
51CXX_GUARD_END
52
53#endif