all repos — mgba @ 4ac4733cfd4c4524c6a56d0406ba138d173fad61

mGBA Game Boy Advance Emulator

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