all repos — mgba @ 4bde13effb788e4e30c0165ae521e357897ebfa0

mGBA Game Boy Advance Emulator

include/mgba/internal/ds/ipc.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 DS_IPC_H
 7#define DS_IPC_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/log.h>
14
15mLOG_DECLARE_CATEGORY(DS_IPC);
16
17DECL_BITFIELD(DSIPCFIFOCNT, int16_t);
18DECL_BIT(DSIPCFIFOCNT, SendEmpty, 0);
19DECL_BIT(DSIPCFIFOCNT, SendFull, 1);
20DECL_BIT(DSIPCFIFOCNT, SendIRQ, 2);
21DECL_BIT(DSIPCFIFOCNT, SendClear, 3);
22DECL_BIT(DSIPCFIFOCNT, RecvEmpty, 8);
23DECL_BIT(DSIPCFIFOCNT, RecvFull, 9);
24DECL_BIT(DSIPCFIFOCNT, RecvIRQ, 10);
25DECL_BIT(DSIPCFIFOCNT, Error, 14);
26DECL_BIT(DSIPCFIFOCNT, Enable, 15);
27
28struct ARMCore;
29struct DSCommon;
30void DSIPCWriteSYNC(struct ARMCore* remoteCpu, uint16_t* remoteIo, int16_t value);
31int16_t DSIPCWriteFIFOCNT(struct DSCommon* dscore, int16_t value);
32void DSIPCWriteFIFO(struct DSCommon* dscore, int32_t value);
33int32_t DSIPCReadFIFO(struct DSCommon* dscore);
34
35CXX_GUARD_END
36
37#endif