all repos — mgba @ ec1fc632b23749add411a2d9a9a4a32bd957a99c

mGBA Game Boy Advance Emulator

include/mgba/internal/gb/mbc.h (view raw)

 1/* Copyright (c) 2013-2016 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 GB_MBC_H
 7#define GB_MBC_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/log.h>
14
15mLOG_DECLARE_CATEGORY(GB_MBC);
16
17struct GB;
18struct GBMemory;
19void GBMBCInit(struct GB* gb);
20void GBMBCSwitchBank(struct GB* gb, int bank);
21void GBMBCSwitchBank0(struct GB* gb, int bank);
22void GBMBCSwitchHalfBank(struct GB* gb, int half, int bank);
23void GBMBCSwitchSramBank(struct GB* gb, int bank);
24
25enum GBCam {
26	GBCAM_WIDTH = 128,
27	GBCAM_HEIGHT = 112
28};
29
30struct GBMBCRTCSaveBuffer {
31	uint32_t sec;
32	uint32_t min;
33	uint32_t hour;
34	uint32_t days;
35	uint32_t daysHi;
36	uint32_t latchedSec;
37	uint32_t latchedMin;
38	uint32_t latchedHour;
39	uint32_t latchedDays;
40	uint32_t latchedDaysHi;
41	uint64_t unixTime;
42};
43void GBMBCRTCRead(struct GB* gb);
44void GBMBCRTCWrite(struct GB* gb);
45
46CXX_GUARD_END
47
48#endif