src/core/core.h (view raw)
1/* Copyright (c) 2013-2016 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 M_CORE_H
7#define M_CORE_H
8
9#include "util/common.h"
10
11struct VFile;
12
13struct mCore {
14 void* cpu;
15 void* board;
16
17 bool (*init)(struct mCore*);
18 void (*deinit)(struct mCore*);
19
20 void (*desiredVideoDimensions)(struct mCore*, unsigned* width, unsigned* height);
21 void (*setVideoBuffer)(struct mCore*, void* buffer, size_t stride);
22
23 bool (*isROM)(struct mCore*, struct VFile* vf);
24 bool (*loadROM)(struct mCore*, struct VFile* vf, struct VFile* save, const char* fname);
25 void (*unloadROM)(struct mCore*);
26
27 bool (*loadBIOS)(struct mCore*, struct VFile* vf, int biosID);
28 bool (*selectBIOS)(struct mCore*, int biosID);
29
30 void (*reset)(struct mCore*);
31 void (*runFrame)(struct mCore*);
32 void (*runLoop)(struct mCore*);
33 void (*step)(struct mCore*);
34
35 void (*setKeys)(struct mCore*, uint32_t keys);
36};
37
38#endif