all repos — mgba @ 4a10ea2f699d0d2bade8df17d513ba5f90bef949

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