all repos — mgba @ 811d8281c3f285e9e7421cf290ecefaefb46069d

mGBA Game Boy Advance Emulator

src/gba/context/context.h (view raw)

 1/* Copyright (c) 2013-2015 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 CONTEXT_H
 7#define CONTEXT_H
 8
 9#include "util/common.h"
10
11#include "core/directories.h"
12#include "core/config.h"
13#include "core/sync.h"
14#include "gba/input.h"
15
16struct GBAContext {
17	struct GBA* gba;
18	struct ARMCore* cpu;
19	struct GBAVideoRenderer* renderer;
20	struct VFile* rom;
21	const char* fname;
22	struct VFile* save;
23	struct VFile* bios;
24#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
25	struct mDirectorySet dirs;
26#endif
27	struct ARMComponent* components[GBA_COMPONENT_MAX];
28	struct mCoreConfig config;
29	struct GBAOptions opts;
30	struct GBAInputMap inputMap;
31};
32
33bool GBAContextInit(struct GBAContext* context, const char* port);
34void GBAContextDeinit(struct GBAContext* context);
35
36bool GBAContextLoadROM(struct GBAContext* context, const char* path, bool autoloadSave);
37bool GBAContextLoadROMFromVFile(struct GBAContext* context, struct VFile* rom, struct VFile* save);
38bool GBAContextLoadBIOS(struct GBAContext* context, const char* path);
39bool GBAContextLoadBIOSFromVFile(struct GBAContext* context, struct VFile* bios);
40void GBAContextUnloadROM(struct GBAContext* context);
41
42bool GBAContextStart(struct GBAContext* context);
43void GBAContextStop(struct GBAContext* context);
44void GBAContextReset(struct GBAContext* context);
45void GBAContextFrame(struct GBAContext* context, uint16_t keys);
46
47#endif