1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 #include "sjme/nvm/nvm.h"
11 #include "sjme/debug.h"
12 #include "3rdparty/libretro/libretro.h"
13 #include "frontend/libretro/shared.h"
15 /** Variables to use within the core. */
16 static const struct retro_variable sjme_libretro_coreVariables
[] =
18 #if defined(SJME_CONFIG_DEBUG) && defined(SJME_CONFIG_UNIT_TEST)
21 SJME_LIBRETRO_CONFIG_UNIT_TESTS
,
22 "Run Unit Tests; false|true"
30 sjme_attrUnused RETRO_API
void retro_cheat_reset(void)
32 static sjme_jint trigger
;
34 sjme_message("Impl. %s?", __func__
);
37 sjme_attrUnused RETRO_API
void retro_cheat_set(unsigned index
, bool enabled
,
40 static sjme_jint trigger
;
42 sjme_message("Impl. %s?", __func__
);
45 sjme_attrUnused RETRO_API
unsigned retro_get_region(void)
47 static sjme_jint trigger
;
49 sjme_message("Impl. %s?", __func__
);
52 sjme_attrUnused RETRO_API
void retro_get_system_info(
53 sjme_attrInNotNull
struct retro_system_info
* info
)
55 /* Base information. */
56 info
->library_name
= "SquirrelJME";
57 info
->library_version
= SQUIRRELJME_VERSION
;
59 /* These are all of the Java related extensions. */
60 info
->valid_extensions
= "zip|jam|jar|jad|adf|sec|sto|kjx";
62 /* We need the full path for executables. */
63 info
->need_fullpath
= true;
65 /* RetroArch is not permitted to unzip entries for us. */
66 info
->block_extract
= true;
69 sjme_attrUnused RETRO_API
void retro_set_environment(
70 retro_environment_t environment
)
73 enum retro_pixel_format pixelFormat
;
75 /* Store the callback pointer. */
76 sjme_libretro_envCallback
= environment
;
79 retro_set_controller_port_device(0, 0);
81 /* Playing with no software is supported. */
82 supportsNoGame
= true;
83 sjme_libretro_envCallback(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME
,
84 (void*)&supportsNoGame
);
86 /* Declare extension interface for special functions. */
87 sjme_libretro_envCallback(RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK
,
88 (void*)sjme_libretro_extInterface());
91 pixelFormat
= RETRO_PIXEL_FORMAT_XRGB8888
;
92 sjme_libretro_envCallback(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT
,
96 sjme_libretro_envCallback(RETRO_ENVIRONMENT_SET_VARIABLES
,
97 (void*)&sjme_libretro_coreVariables
);