Search
lxdream.org :: lxdream/src/gui_jni.c
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 (12 years ago)
permissions -rw-r--r--
last change Android support WIP
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * JNI wrappers for operating the emulator from Java.
     5  *
     6  * Copyright (c) 2012 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #include <jni.h>
    20 #include <android/log.h>
    21 #include <libisofs.h>
    22 #include "dreamcast.h"
    23 #include "gui.h"
    24 #include "config.h"
    25 #include "display.h"
    26 #include "gdlist.h"
    27 #include "hotkeys.h"
    28 #include "serial.h"
    29 #include "aica/audio.h"
    30 #include "maple/maple.h"
    31 #include "vmu/vmulist.h"
    33 JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_init(JNIEnv * env, jobject obj,  jint width, jint height)
    34 {
    35     lxdream_make_config_dir( );
    36     lxdream_load_config( );
    37     iso_init();
    38     gdrom_list_init();
    39     vmulist_init();
    40     dreamcast_init(1);
    42     audio_init_driver(NULL);
    43     display_driver_t display_driver = get_display_driver_by_name(NULL);
    44     display_set_driver(display_driver);
    46     hotkeys_init();
    47     serial_init();
    48     maple_reattach_all();
    49     INFO( "%s! ready...", APP_NAME );
    50 }
    52 JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_setViewSize(JNIEnv * env, jobject obj, jint width, jint height)
    53 {
    55 }
    57 JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, jobject obj)
    58 {
    59     dreamcast_run();
    60 }
    62 JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, jobject obj)
    63 {
    64     dreamcast_stop();
    65 }
    67 gboolean gui_parse_cmdline( int *argc, char **argv[] )
    68 {
    69     return TRUE;
    70 }
    72 gboolean gui_init( gboolean debug, gboolean fullscreen )
    73 {
    74     return TRUE;
    75 }
    77 void gui_main_loop( gboolean run ) {
    78     if( run ) {
    79         dreamcast_run();
    80     }
    81 }
    83 gboolean gui_error_dialog( const char *fmt, ... )
    84 {
    85     return TRUE;
    86 }
    88 void gui_update_state()
    89 {
    90 }
    92 void gui_set_use_grab( gboolean grab )
    93 {
    94 }
    96 void gui_update_io_activity( io_activity_type activity, gboolean active )
    97 {
    98 }
   100 void gui_do_later( do_later_callback_t func )
   101 {
   102     func();
   103 }
.