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
24struct GBMBCRTCSaveBuffer {
25 uint32_t sec;
26 uint32_t min;
27 uint32_t hour;
28 uint32_t days;
29 uint32_t daysHi;
30 uint32_t latchedSec;
31 uint32_t latchedMin;
32 uint32_t latchedHour;
33 uint32_t latchedDays;
34 uint32_t latchedDaysHi;
35 uint64_t unixTime;
36};
37void GBMBCRTCRead(struct GB* gb);
38void GBMBCRTCWrite(struct GB* gb);
39
40CXX_GUARD_END
41
42#endif