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 GBALogLevel {
14 GBA_LOG_FATAL = 0x01,
15 GBA_LOG_ERROR = 0x02,
16 GBA_LOG_WARN = 0x04,
17 GBA_LOG_INFO = 0x08,
18 GBA_LOG_DEBUG = 0x10,
19 GBA_LOG_STUB = 0x20,
20
21 GBA_LOG_GAME_ERROR = 0x100,
22 GBA_LOG_STATUS = 0x400,
23 GBA_LOG_SIO = 0x800,
24
25 GBA_LOG_ALL = 0xF3F,
26};
27
28enum GBASIOMode {
29 SIO_NORMAL_8 = 0,
30 SIO_NORMAL_32 = 1,
31 SIO_MULTI = 2,
32 SIO_UART = 3,
33 SIO_GPIO = 8,
34 SIO_JOYBUS = 12
35};
36
37struct GBA;
38struct GBAAudio;
39struct GBASIO;
40struct GBAVideoRenderer;
41
42extern const int GBA_LUX_LEVELS[10];
43
44struct GBALuminanceSource {
45 void (*sample)(struct GBALuminanceSource*);
46
47 uint8_t (*readLuminance)(struct GBALuminanceSource*);
48};
49
50struct GBASIODriver {
51 struct GBASIO* p;
52
53 bool (*init)(struct GBASIODriver* driver);
54 void (*deinit)(struct GBASIODriver* driver);
55 bool (*load)(struct GBASIODriver* driver);
56 bool (*unload)(struct GBASIODriver* driver);
57 uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
58 int32_t (*processEvents)(struct GBASIODriver* driver, int32_t cycles);
59};
60
61#endif