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};
31
32void GBASIODolphinCreate(struct GBASIODolphin*);
33void GBASIODolphinDestroy(struct GBASIODolphin*);
34
35bool GBASIODolphinConnect(struct GBASIODolphin*, const struct Address* address, short dataPort, short clockPort);
36bool GBASIODolphinIsConnected(struct GBASIODolphin*);
37
38CXX_GUARD_END
39
40#endif