all repos — mgba @ 99f7e5f035cec1ffa859f8a19f8609d3a7f1d3c4

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/input.h"
13
14struct GBAContext {
15	struct GBA* gba;
16	struct ARMCore* cpu;
17	struct GBAVideoRenderer* renderer;
18	struct VFile* rom;
19	struct VFile* save;
20	struct VFile* bios;
21	struct ARMComponent* components[GBA_COMPONENT_MAX];
22	struct GBAConfig config;
23	struct GBAOptions opts;
24	struct GBAInputMap inputMap;
25};
26
27bool GBAContextInit(struct GBAContext* context, const char* port);
28void GBAContextDeinit(struct GBAContext* context);
29
30bool GBAContextLoadROM(struct GBAContext* context, const char* path, bool autoloadSave);
31bool GBAContextLoadROMFromVFile(struct GBAContext* context, struct VFile* rom, struct VFile* save);
32bool GBAContextLoadBIOS(struct GBAContext* context, const char* path);
33bool GBAContextLoadBIOSFromVFile(struct GBAContext* context, struct VFile* bios);
34
35bool GBAContextStart(struct GBAContext* context);
36void GBAContextStop(struct GBAContext* context);
37void GBAContextFrame(struct GBAContext* context, uint16_t keys);
38
39#endif