all repos — mgba @ d1ef27cff90eda02bde9f90cc526e901a4c81d83

mGBA Game Boy Advance Emulator

src/platform/python/core.c (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#include "core.h"
 7
 8#include <mgba/core/core.h>
 9
10struct mCoreCallbacks* mCorePythonCallbackCreate(void* pyobj) {
11	struct mCoreCallbacks* callbacks = malloc(sizeof(*callbacks));
12	callbacks->videoFrameStarted = _mCorePythonCallbacksVideoFrameStarted;
13	callbacks->videoFrameEnded = _mCorePythonCallbacksVideoFrameEnded;
14	callbacks->coreCrashed = _mCorePythonCallbacksCoreCrashed;
15	callbacks->sleep = _mCorePythonCallbacksSleep;
16
17	callbacks->context = pyobj;
18	return callbacks;
19}