all repos — mgba @ 44d1dd7f8438ce41f9d85b0e5baf09f7b2423968

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 "gba/context/config.h"
12#include "gba/context/directories.h"
13#include "gba/context/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	struct GBADirectorySet dirs;
25	struct ARMComponent* components[GBA_COMPONENT_MAX];
26	struct GBAConfig config;
27	struct GBAOptions opts;
28	struct GBAInputMap inputMap;
29};
30
31bool GBAContextInit(struct GBAContext* context, const char* port);
32void GBAContextDeinit(struct GBAContext* context);
33
34bool GBAContextLoadROM(struct GBAContext* context, const char* path, bool autoloadSave);
35bool GBAContextLoadROMFromVFile(struct GBAContext* context, struct VFile* rom, struct VFile* save);
36bool GBAContextLoadBIOS(struct GBAContext* context, const char* path);
37bool GBAContextLoadBIOSFromVFile(struct GBAContext* context, struct VFile* bios);
38void GBAContextUnloadROM(struct GBAContext* context);
39
40bool GBAContextStart(struct GBAContext* context);
41void GBAContextStop(struct GBAContext* context);
42void GBAContextReset(struct GBAContext* context);
43void GBAContextFrame(struct GBAContext* context, uint16_t keys);
44
45#endif