all repos — mgba @ e063e056623dcd1ca1ed516e154a68e306b93595

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
31struct GBALuminanceSource {
32	void (*sample)(struct GBALuminanceSource*);
33
34	uint8_t (*readLuminance)(struct GBALuminanceSource*);
35};
36
37struct GBASIODriver {
38	struct GBASIO* p;
39
40	bool (*init)(struct GBASIODriver* driver);
41	void (*deinit)(struct GBASIODriver* driver);
42	bool (*load)(struct GBASIODriver* driver);
43	bool (*unload)(struct GBASIODriver* driver);
44	uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
45};
46
47CXX_GUARD_END
48
49#endif