all repos — mgba @ ff637c84d1f229b0891e0d7f9a40ad5c7a8b12f0

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 INTERFACE_H
 7#define 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	int32_t (*processEvents)(struct GBASIODriver* driver, int32_t cycles);
44};
45
46#endif