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 GBMBCReset(struct GB* gb);
21void GBMBCSwitchBank(struct GB* gb, int bank);
22void GBMBCSwitchBank0(struct GB* gb, int bank);
23void GBMBCSwitchHalfBank(struct GB* gb, int half, int bank);
24void GBMBCSwitchSramBank(struct GB* gb, int bank);
25void GBMBCSwitchSramHalfBank(struct GB* gb, int half, int bank);
26
27enum GBCam {
28 GBCAM_WIDTH = 128,
29 GBCAM_HEIGHT = 112
30};
31
32struct GBMBCRTCSaveBuffer {
33 uint32_t sec;
34 uint32_t min;
35 uint32_t hour;
36 uint32_t days;
37 uint32_t daysHi;
38 uint32_t latchedSec;
39 uint32_t latchedMin;
40 uint32_t latchedHour;
41 uint32_t latchedDays;
42 uint32_t latchedDaysHi;
43 uint64_t unixTime;
44};
45void GBMBCRTCRead(struct GB* gb);
46void GBMBCRTCWrite(struct GB* gb);
47
48CXX_GUARD_END
49
50#endif