all repos — mgba @ 4f24b82036e7219fe80fabe7161811902e4c5e0e

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