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