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