Search
lxdream.org :: lxdream/src/gui_jni.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui_jni.c
changeset 1239:be3121267597
next1241:74f8e11ab4b8
author nkeynes
date Sat Feb 25 21:30:49 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Android support WIP
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/gui_jni.c Sat Feb 25 21:30:49 2012 +1000
1.3 @@ -0,0 +1,103 @@
1.4 +/**
1.5 + * $Id$
1.6 + *
1.7 + * JNI wrappers for operating the emulator from Java.
1.8 + *
1.9 + * Copyright (c) 2012 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#include <jni.h>
1.23 +#include <android/log.h>
1.24 +#include <libisofs.h>
1.25 +#include "dreamcast.h"
1.26 +#include "gui.h"
1.27 +#include "config.h"
1.28 +#include "display.h"
1.29 +#include "gdlist.h"
1.30 +#include "hotkeys.h"
1.31 +#include "serial.h"
1.32 +#include "aica/audio.h"
1.33 +#include "maple/maple.h"
1.34 +#include "vmu/vmulist.h"
1.35 +
1.36 +JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_init(JNIEnv * env, jobject obj, jint width, jint height)
1.37 +{
1.38 + lxdream_make_config_dir( );
1.39 + lxdream_load_config( );
1.40 + iso_init();
1.41 + gdrom_list_init();
1.42 + vmulist_init();
1.43 + dreamcast_init(1);
1.44 +
1.45 + audio_init_driver(NULL);
1.46 + display_driver_t display_driver = get_display_driver_by_name(NULL);
1.47 + display_set_driver(display_driver);
1.48 +
1.49 + hotkeys_init();
1.50 + serial_init();
1.51 + maple_reattach_all();
1.52 + INFO( "%s! ready...", APP_NAME );
1.53 +}
1.54 +
1.55 +JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_setViewSize(JNIEnv * env, jobject obj, jint width, jint height)
1.56 +{
1.57 +
1.58 +}
1.59 +
1.60 +JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, jobject obj)
1.61 +{
1.62 + dreamcast_run();
1.63 +}
1.64 +
1.65 +JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, jobject obj)
1.66 +{
1.67 + dreamcast_stop();
1.68 +}
1.69 +
1.70 +gboolean gui_parse_cmdline( int *argc, char **argv[] )
1.71 +{
1.72 + return TRUE;
1.73 +}
1.74 +
1.75 +gboolean gui_init( gboolean debug, gboolean fullscreen )
1.76 +{
1.77 + return TRUE;
1.78 +}
1.79 +
1.80 +void gui_main_loop( gboolean run ) {
1.81 + if( run ) {
1.82 + dreamcast_run();
1.83 + }
1.84 +}
1.85 +
1.86 +gboolean gui_error_dialog( const char *fmt, ... )
1.87 +{
1.88 + return TRUE;
1.89 +}
1.90 +
1.91 +void gui_update_state()
1.92 +{
1.93 +}
1.94 +
1.95 +void gui_set_use_grab( gboolean grab )
1.96 +{
1.97 +}
1.98 +
1.99 +void gui_update_io_activity( io_activity_type activity, gboolean active )
1.100 +{
1.101 +}
1.102 +
1.103 +void gui_do_later( do_later_callback_t func )
1.104 +{
1.105 + func();
1.106 +}
.