all repos — mgba @ 1b68ac4d610ba9efa96db6fd6493cef38a8a0ebe

mGBA Game Boy Advance Emulator

include/mgba/internal/gba/sio/dolphin.h (view raw)

 1/* Copyright (c) 2013-2017 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 SIO_DOLPHIN_H
 7#define SIO_DOLPHIN_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/timing.h>
14#include <mgba/internal/gba/sio.h>
15
16#include <mgba-util/socket.h>
17
18extern const uint16_t DOLPHIN_CLOCK_PORT;
19extern const uint16_t DOLPHIN_DATA_PORT;
20
21struct GBASIODolphin {
22	struct GBASIODriver d;
23	struct mTimingEvent event;
24
25	Socket data;
26	Socket clock;
27
28	int32_t clockSlice;
29	int state;
30	bool active;
31};
32
33void GBASIODolphinCreate(struct GBASIODolphin*);
34void GBASIODolphinDestroy(struct GBASIODolphin*);
35
36bool GBASIODolphinConnect(struct GBASIODolphin*, const struct Address* address, short dataPort, short clockPort);
37bool GBASIODolphinIsConnected(struct GBASIODolphin*);
38
39CXX_GUARD_END
40
41#endif