all repos — mgba @ 495ca50dc00b580f37d576d084ace2a05ec2812d

mGBA Game Boy Advance Emulator

include/mgba/internal/ds/slot1.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_SLOT1_H
 7#define DS_SLOT1_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/log.h>
14
15mLOG_DECLARE_CATEGORY(DS_SLOT1);
16
17DECL_BITFIELD(DSSlot1AUXSPICNT, uint16_t);
18
19DECL_BITFIELD(DSSlot1ROMCNT, uint32_t);
20DECL_BIT(DSSlot1ROMCNT, WordReady, 23);
21DECL_BITS(DSSlot1ROMCNT, BlockSize, 24, 3);
22DECL_BIT(DSSlot1ROMCNT, BlockBusy, 31);
23
24struct DSSlot1 {
25	uint8_t command[8];
26	uint32_t address;
27	uint32_t transferSize;
28	uint32_t transferRemaining;
29	uint8_t readBuffer[4];
30};
31
32struct DS;
33DSSlot1AUXSPICNT DSSlot1Configure(struct DS* ds, DSSlot1AUXSPICNT config);
34DSSlot1ROMCNT DSSlot1Control(struct DS* ds, DSSlot1ROMCNT control);
35uint32_t DSSlot1Read(struct DS* ds);
36
37CXX_GUARD_END
38
39#endif