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