Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sven 2018-08-07 17:35:16 -04:00
commit b48321737d
93 changed files with 1552 additions and 934 deletions

View File

@ -16,10 +16,11 @@
- LOCALIZATION: Update Spanish translation.
- MIDI: Add MIDI support to the libretro API. Dosbox is the first proof of concept core implementing libretro MIDI.
- MIDI: Add a Windows driver for MIDI, based on winmm.
- MENU/QT/WIMP: QT QSlider styling for Dark Theme.
- MENU/QT/WIMP: Qt QSlider styling for Dark Theme.
- MENU/QT/WIMP: Remove button ghostly inside highlighting.
- MENU/QT/WIMP: Initial grid view.
- MENU/QT/WIMP: Drag&drop to add new playlist items, add option to add/edit/delete playlists.
- MENU/QT/WIMP: Add menu option to update RetroArch (Windows only for now).
- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13.
- METAL: Supports XMB/MaterialUI, has a menu display driver. Has a font rendering driver.
- METAL/SLANG: Slang shaders should be compatible with Metal video driver.

View File

@ -345,9 +345,9 @@ MOC_HEADERS += ui/drivers/ui_qt.h \
ui/drivers/qt/ui_qt_load_core_window.h \
ui/drivers/qt/flowlayout.h
DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) -DHAVE_MAIN
DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS) -DHAVE_MAIN
#DEFINES += $(QT5WEBENGINE_CFLAGS)
LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS)
LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS) $(QT5NETWORK_LIBS)
#LIBS += $(QT5WEBENGINE_LIBS)
NEED_CXX_LINKER = 1
@ -379,39 +379,86 @@ HAVE_GTKPLUS = 0
ifeq ($(HAVE_SSL), 1)
DEFINES += -DHAVE_SSL
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
ifeq ($(DEBUG), 1)
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
endif
# MinGW requires this for some reason, even though the include paths are relative to the source
INCLUDE_DIRS += -Ideps/mbedtls
OBJS_TLS_CRYPTO = deps/mbedtls/aes.o deps/mbedtls/aesni.o deps/mbedtls/arc4.o \
deps/mbedtls/asn1parse.o deps/mbedtls/asn1write.o deps/mbedtls/base64.o \
deps/mbedtls/bignum.o deps/mbedtls/blowfish.o deps/mbedtls/camellia.o \
deps/mbedtls/ccm.o deps/mbedtls/cipher.o deps/mbedtls/cipher_wrap.o \
deps/mbedtls/cmac.o deps/mbedtls/ctr_drbg.o deps/mbedtls/des.o \
deps/mbedtls/dhm.o deps/mbedtls/ecdh.o deps/mbedtls/ecdsa.o \
deps/mbedtls/ecjpake.o deps/mbedtls/ecp.o \
deps/mbedtls/ecp_curves.o deps/mbedtls/entropy.o deps/mbedtls/entropy_poll.o \
deps/mbedtls/error.o deps/mbedtls/gcm.o deps/mbedtls/havege.o \
deps/mbedtls/hmac_drbg.o deps/mbedtls/md.o deps/mbedtls/md2.o \
deps/mbedtls/md4.o deps/mbedtls/md5.o deps/mbedtls/md_wrap.o \
deps/mbedtls/memory_buffer_alloc.o deps/mbedtls/oid.o \
deps/mbedtls/padlock.o deps/mbedtls/pem.o deps/mbedtls/pk.o \
deps/mbedtls/pk_wrap.o deps/mbedtls/pkcs12.o deps/mbedtls/pkcs5.o \
deps/mbedtls/pkparse.o deps/mbedtls/pkwrite.o deps/mbedtls/platform.o \
deps/mbedtls/ripemd160.o deps/mbedtls/rsa.o deps/mbedtls/sha1.o \
deps/mbedtls/sha256.o deps/mbedtls/sha512.o deps/mbedtls/threading.o \
deps/mbedtls/timing.o deps/mbedtls/version.o \
deps/mbedtls/version_features.o deps/mbedtls/xtea.o
OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \
deps/mbedtls/aesni.o \
deps/mbedtls/arc4.o \
deps/mbedtls/asn1parse.o \
deps/mbedtls/asn1write.o \
deps/mbedtls/base64.o \
deps/mbedtls/bignum.o \
deps/mbedtls/blowfish.o \
deps/mbedtls/camellia.o \
deps/mbedtls/ccm.o \
deps/mbedtls/cipher.o \
deps/mbedtls/cipher_wrap.o \
deps/mbedtls/cmac.o \
deps/mbedtls/ctr_drbg.o \
deps/mbedtls/des.o \
deps/mbedtls/dhm.o \
deps/mbedtls/ecdh.o \
deps/mbedtls/ecdsa.o \
deps/mbedtls/ecjpake.o \
deps/mbedtls/ecp.o \
deps/mbedtls/ecp_curves.o \
deps/mbedtls/entropy.o \
deps/mbedtls/entropy_poll.o \
deps/mbedtls/error.o \
deps/mbedtls/gcm.o \
deps/mbedtls/havege.o \
deps/mbedtls/hmac_drbg.o \
deps/mbedtls/md.o \
deps/mbedtls/md2.o \
deps/mbedtls/md4.o \
deps/mbedtls/md5.o \
deps/mbedtls/md_wrap.o \
deps/mbedtls/memory_buffer_alloc.o \
deps/mbedtls/oid.o \
deps/mbedtls/padlock.o \
deps/mbedtls/pem.o \
deps/mbedtls/pk.o \
deps/mbedtls/pk_wrap.o \
deps/mbedtls/pkcs12.o \
deps/mbedtls/pkcs5.o \
deps/mbedtls/pkparse.o \
deps/mbedtls/pkwrite.o \
deps/mbedtls/platform.o \
deps/mbedtls/ripemd160.o \
deps/mbedtls/rsa.o \
deps/mbedtls/sha1.o \
deps/mbedtls/sha256.o \
deps/mbedtls/sha512.o \
deps/mbedtls/threading.o \
deps/mbedtls/timing.o \
deps/mbedtls/version.o \
deps/mbedtls/version_features.o \
deps/mbedtls/xtea.o
OBJS_TLS_X509 = deps/mbedtls/certs.o deps/mbedtls/pkcs11.o deps/mbedtls/x509.o \
deps/mbedtls/x509_create.o deps/mbedtls/x509_crl.o deps/mbedtls/x509_crt.o \
deps/mbedtls/x509_csr.o deps/mbedtls/x509write_crt.o deps/mbedtls/x509write_csr.o
OBJS_TLS_X509 = deps/mbedtls/certs.o \
deps/mbedtls/pkcs11.o \
deps/mbedtls/x509.o \
deps/mbedtls/x509_create.o \
deps/mbedtls/x509_crl.o \
deps/mbedtls/x509_crt.o \
deps/mbedtls/x509_csr.o \
deps/mbedtls/x509write_crt.o \
deps/mbedtls/x509write_csr.o
OBJS_TLS = deps/mbedtls/debug.o deps/mbedtls/net_sockets.o \
deps/mbedtls/ssl_cache.o deps/mbedtls/ssl_ciphersuites.o \
deps/mbedtls/ssl_cli.o deps/mbedtls/ssl_cookie.o \
deps/mbedtls/ssl_srv.o deps/mbedtls/ssl_ticket.o \
OBJS_TLS = deps/mbedtls/debug.o \
deps/mbedtls/net_sockets.o \
deps/mbedtls/ssl_cache.o \
deps/mbedtls/ssl_ciphersuites.o \
deps/mbedtls/ssl_cli.o \
deps/mbedtls/ssl_cookie.o \
deps/mbedtls/ssl_srv.o \
deps/mbedtls/ssl_ticket.o \
deps/mbedtls/ssl_tls.o
OBJ += $(OBJS_TLS_CRYPTO) $(OBJS_TLS_X509) $(OBJS_TLS)

View File

@ -1606,7 +1606,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
static struct config_size_setting *populate_settings_size(settings_t *settings, int *size)
{
unsigned count = 0;
struct config_size_setting *tmp = (struct config_size_setting*)malloc((*size + 1) * sizeof(struct config_size_setting));
struct config_size_setting *tmp = (struct config_size_setting*)calloc((*size + 1), sizeof(struct config_size_setting));
SETTING_SIZE("rewind_buffer_size", &settings->sizes.rewind_buffer_size, true, rewind_buffer_size, false);
@ -2647,11 +2647,9 @@ static bool config_load_file(const char *path, bool set_defaults,
* If the value is less than 10000 then multiple by 1MB because if the retroarch.cfg
* file contains rewind_buffer_size = "100" then that ultimately gets interpreted as
* 100MB, so ensure the internal values represent that.*/
if ( strcmp(size_settings[i].ident, "rewind_buffer_size") == 0 ) {
if ( *size_settings[i].ptr < 10000) {
*size_settings[i].ptr = *size_settings[i].ptr * 1024 * 1024 ;
}
}
if (string_is_equal(size_settings[i].ident, "rewind_buffer_size"))
if (*size_settings[i].ptr < 10000)
*size_settings[i].ptr = *size_settings[i].ptr * 1024 * 1024;
}
for (i = 0; i < MAX_USERS; i++)
@ -3412,12 +3410,14 @@ bool config_load_remap(void)
new_conf = NULL;
free(content_path);
free(remap_directory);
free(core_path);
free(game_path);
return false;
success:
free(content_path);
free(remap_directory);
free(core_path);
free(game_path);
@ -4120,7 +4120,7 @@ bool config_save_file(const char *path)
!retroarch_override_setting_is_set(size_settings[i].override, NULL))
config_set_int(conf,
size_settings[i].ident,
*size_settings[i].ptr);
(int)*size_settings[i].ptr);
free(size_settings);
}
@ -4398,7 +4398,7 @@ bool config_save_overrides(int override_type)
RARCH_LOG(" override: %s=%d\n",
size_overrides[i].ident, (*size_overrides[i].ptr));
config_set_int(conf, size_overrides[i].ident,
(*size_overrides[i].ptr));
(int)(*size_overrides[i].ptr));
}
}
for (i = 0; i < (unsigned)float_settings_size; i++)

2
deps/libFLAC/md5.c vendored
View File

@ -513,7 +513,7 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const
format_input_(&ctx->internal_buf, signal, channels, samples, bytes_per_sample);
FLAC__MD5Update(ctx, ctx->internal_buf.p8, bytes_needed);
FLAC__MD5Update(ctx, ctx->internal_buf.p8, (unsigned)bytes_needed);
return true;
}

5
deps/mbedtls/aes.c vendored
View File

@ -54,10 +54,7 @@
#if !defined(MBEDTLS_AES_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (little endian)

5
deps/mbedtls/arc4.c vendored
View File

@ -47,10 +47,7 @@
#if !defined(MBEDTLS_ARC4_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
void mbedtls_arc4_init( mbedtls_arc4_context *ctx )
{

9
deps/mbedtls/arc4_alt.h vendored Normal file
View File

@ -0,0 +1,9 @@
#ifndef _ARC4_ALT_H
#define _ARC4_ALT_H
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#endif

View File

@ -43,10 +43,7 @@
#define mbedtls_free free
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* ASN.1 DER decoding routines

View File

@ -39,10 +39,7 @@
#if !defined(MBEDTLS_BLOWFISH_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)

View File

@ -48,10 +48,7 @@
#if !defined(MBEDTLS_CAMELLIA_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)
@ -88,7 +85,7 @@ static const unsigned char SIGMA_CHARS[6][8] =
#if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY)
static const unsigned char FSb[256] =
static const unsigned char C_FSb[256] =
{
112,130, 44,236,179, 39,192,229,228,133, 87, 53,234, 12,174, 65,
35,239,107,147, 69, 25,165, 33,237, 14, 79, 78, 29,101,146,189,
@ -108,14 +105,14 @@ static const unsigned char FSb[256] =
64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158
};
#define SBOX1(n) FSb[(n)]
#define SBOX2(n) (unsigned char)((FSb[(n)] >> 7 ^ FSb[(n)] << 1) & 0xff)
#define SBOX3(n) (unsigned char)((FSb[(n)] >> 1 ^ FSb[(n)] << 7) & 0xff)
#define SBOX4(n) FSb[((n) << 1 ^ (n) >> 7) &0xff]
#define SBOX1(n) C_FSb[(n)]
#define SBOX2(n) (unsigned char)((C_FSb[(n)] >> 7 ^ C_FSb[(n)] << 1) & 0xff)
#define SBOX3(n) (unsigned char)((C_FSb[(n)] >> 1 ^ C_FSb[(n)] << 7) & 0xff)
#define SBOX4(n) C_FSb[((n) << 1 ^ (n) >> 7) &0xff]
#else /* MBEDTLS_CAMELLIA_SMALL_MEMORY */
static const unsigned char FSb[256] =
static const unsigned char C_FSb[256] =
{
112, 130, 44, 236, 179, 39, 192, 229, 228, 133, 87, 53, 234, 12, 174, 65,
35, 239, 107, 147, 69, 25, 165, 33, 237, 14, 79, 78, 29, 101, 146, 189,
@ -195,7 +192,7 @@ static const unsigned char FSb4[256] =
7, 85, 238, 10, 73, 104, 56, 164, 40, 123, 201, 193, 227, 244, 199, 158
};
#define SBOX1(n) FSb[(n)]
#define SBOX1(n) C_FSb[(n)]
#define SBOX2(n) FSb2[(n)]
#define SBOX3(n) FSb3[(n)]
#define SBOX4(n) FSb4[(n)]

9
deps/mbedtls/ccm.c vendored
View File

@ -49,10 +49,7 @@
#endif /* MBEDTLS_PLATFORM_C */
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#define CCM_ENCRYPT 0
#define CCM_DECRYPT 1
@ -359,7 +356,7 @@ int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
/*
* The data is the same for all tests, only the used length changes
*/
static const unsigned char key[] = {
static const unsigned char ccm_key[] = {
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
};
@ -406,7 +403,7 @@ int mbedtls_ccm_self_test( int verbose )
mbedtls_ccm_init( &ctx );
if( mbedtls_ccm_setkey( &ctx, MBEDTLS_CIPHER_ID_AES, key, 8 * sizeof key ) != 0 )
if( mbedtls_ccm_setkey( &ctx, MBEDTLS_CIPHER_ID_AES, ccm_key, 8 * sizeof ccm_key ) != 0 )
{
if( verbose != 0 )
mbedtls_printf( " CCM: setup failed" );

View File

@ -60,10 +60,7 @@
#define MBEDTLS_CIPHER_MODE_STREAM
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
static int supported_init = 0;

5
deps/mbedtls/cmac.c vendored
View File

@ -65,10 +65,7 @@
#endif /* MBEDTLS_SELF_TEST */
#endif /* MBEDTLS_PLATFORM_C */
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Multiplication by u in the Galois field of GF(2^n)

View File

@ -49,10 +49,7 @@
#endif /* MBEDTLS_PLATFORM_C */
#endif /* MBEDTLS_SELF_TEST */
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* CTR_DRBG context initialization
@ -509,11 +506,11 @@ static const unsigned char nonce_pers_nopr[16] =
{ 0x1b, 0x54, 0xb8, 0xff, 0x06, 0x42, 0xbf, 0xf5,
0x21, 0xf1, 0x5c, 0x1c, 0x0b, 0x66, 0x5f, 0x3f };
static const unsigned char result_pr[16] =
static const unsigned char ctr_result_pr[16] =
{ 0x34, 0x01, 0x16, 0x56, 0xb4, 0x29, 0x00, 0x8f,
0x35, 0x63, 0xec, 0xb5, 0xf2, 0x59, 0x07, 0x23 };
static const unsigned char result_nopr[16] =
static const unsigned char ctr_result_nopr[16] =
{ 0xa0, 0x54, 0x30, 0x3d, 0x8a, 0x7e, 0xa9, 0x88,
0x9d, 0x90, 0x3e, 0x07, 0x7c, 0x6f, 0x21, 0x8f };
@ -556,7 +553,7 @@ int mbedtls_ctr_drbg_self_test( int verbose )
mbedtls_ctr_drbg_set_prediction_resistance( &ctx, MBEDTLS_CTR_DRBG_PR_ON );
CHK( mbedtls_ctr_drbg_random( &ctx, buf, MBEDTLS_CTR_DRBG_BLOCKSIZE ) );
CHK( mbedtls_ctr_drbg_random( &ctx, buf, MBEDTLS_CTR_DRBG_BLOCKSIZE ) );
CHK( memcmp( buf, result_pr, MBEDTLS_CTR_DRBG_BLOCKSIZE ) );
CHK( memcmp( buf, ctr_result_pr, MBEDTLS_CTR_DRBG_BLOCKSIZE ) );
mbedtls_ctr_drbg_free( &ctx );
@ -577,7 +574,7 @@ int mbedtls_ctr_drbg_self_test( int verbose )
CHK( mbedtls_ctr_drbg_random( &ctx, buf, 16 ) );
CHK( mbedtls_ctr_drbg_reseed( &ctx, NULL, 0 ) );
CHK( mbedtls_ctr_drbg_random( &ctx, buf, 16 ) );
CHK( memcmp( buf, result_nopr, 16 ) );
CHK( memcmp( buf, ctr_result_nopr, 16 ) );
mbedtls_ctr_drbg_free( &ctx );

5
deps/mbedtls/des.c vendored
View File

@ -48,10 +48,7 @@
#if !defined(MBEDTLS_DES_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)

5
deps/mbedtls/dhm.c vendored
View File

@ -57,10 +57,7 @@
#define mbedtls_free free
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* helper to validate the mbedtls_mpi size and import it

5
deps/mbedtls/ecp.c vendored
View File

@ -72,10 +72,7 @@
#define inline __inline
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#if defined(MBEDTLS_SELF_TEST)
/*

View File

@ -59,10 +59,7 @@
#include "mbedtls/havege.h"
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#define ENTROPY_MAX_LOOP 256 /**< Maximum amount to loop before error */

37
deps/mbedtls/gcm.c vendored
View File

@ -77,10 +77,7 @@
}
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Initialize a context
@ -519,7 +516,7 @@ void mbedtls_gcm_free( mbedtls_gcm_context *ctx )
static const int key_index[MAX_TESTS] =
{ 0, 0, 1, 1, 1, 1 };
static const unsigned char key[MAX_TESTS][32] =
static const unsigned char gcm_key[MAX_TESTS][32] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -531,13 +528,13 @@ static const unsigned char key[MAX_TESTS][32] =
0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
};
static const size_t iv_len[MAX_TESTS] =
static const size_t gcm_iv_len[MAX_TESTS] =
{ 12, 12, 12, 12, 8, 60 };
static const int iv_index[MAX_TESTS] =
{ 0, 0, 1, 1, 1, 2 };
static const unsigned char iv[MAX_TESTS][64] =
static const unsigned char gcm_iv[MAX_TESTS][64] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 },
@ -553,7 +550,7 @@ static const unsigned char iv[MAX_TESTS][64] =
0xa6, 0x37, 0xb3, 0x9b },
};
static const size_t add_len[MAX_TESTS] =
static const size_t gcm_add_len[MAX_TESTS] =
{ 0, 0, 0, 20, 20, 20 };
static const int add_index[MAX_TESTS] =
@ -756,12 +753,12 @@ int mbedtls_gcm_self_test( int verbose )
mbedtls_printf( " AES-GCM-%3d #%d (%s): ",
key_len, i, "enc" );
mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len );
mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len );
ret = mbedtls_gcm_crypt_and_tag( &ctx, MBEDTLS_GCM_ENCRYPT,
pt_len[i],
iv[iv_index[i]], iv_len[i],
additional[add_index[i]], add_len[i],
gcm_iv[iv_index[i]], gcm_iv_len[i],
additional[add_index[i]], gcm_add_len[i],
pt[pt_index[i]], buf, 16, tag_buf );
if( ret != 0 ||
@ -783,12 +780,12 @@ int mbedtls_gcm_self_test( int verbose )
mbedtls_printf( " AES-GCM-%3d #%d (%s): ",
key_len, i, "dec" );
mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len );
mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len );
ret = mbedtls_gcm_crypt_and_tag( &ctx, MBEDTLS_GCM_DECRYPT,
pt_len[i],
iv[iv_index[i]], iv_len[i],
additional[add_index[i]], add_len[i],
gcm_iv[iv_index[i]], gcm_iv_len[i],
additional[add_index[i]], gcm_add_len[i],
ct[j * 6 + i], buf, 16, tag_buf );
if( ret != 0 ||
@ -810,11 +807,11 @@ int mbedtls_gcm_self_test( int verbose )
mbedtls_printf( " AES-GCM-%3d #%d split (%s): ",
key_len, i, "enc" );
mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len );
mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len );
ret = mbedtls_gcm_starts( &ctx, MBEDTLS_GCM_ENCRYPT,
iv[iv_index[i]], iv_len[i],
additional[add_index[i]], add_len[i] );
gcm_iv[iv_index[i]], gcm_iv_len[i],
additional[add_index[i]], gcm_add_len[i] );
if( ret != 0 )
{
if( verbose != 0 )
@ -877,11 +874,11 @@ int mbedtls_gcm_self_test( int verbose )
mbedtls_printf( " AES-GCM-%3d #%d split (%s): ",
key_len, i, "dec" );
mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len );
mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len );
ret = mbedtls_gcm_starts( &ctx, MBEDTLS_GCM_DECRYPT,
iv[iv_index[i]], iv_len[i],
additional[add_index[i]], add_len[i] );
gcm_iv[iv_index[i]], gcm_iv_len[i],
additional[add_index[i]], gcm_add_len[i] );
if( ret != 0 )
{
if( verbose != 0 )

View File

@ -39,10 +39,7 @@
#include <string.h>
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/* ------------------------------------------------------------------------
* On average, one iteration accesses two 8-word blocks in the havege WALK

View File

@ -50,10 +50,7 @@
#endif /* MBEDTLS_SELF_TEST */
#endif /* MBEDTLS_PLATFORM_C */
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* HMAC_DRBG context initialization
@ -421,7 +418,7 @@ static const unsigned char entropy_pr[] = {
0x48, 0xa5, 0x84, 0xfe, 0x69, 0xab, 0x5a, 0xee, 0x42, 0xaa, 0x4d, 0x42,
0x17, 0x60, 0x99, 0xd4, 0x5e, 0x13, 0x97, 0xdc, 0x40, 0x4d, 0x86, 0xa3,
0x7b, 0xf5, 0x59, 0x54, 0x75, 0x69, 0x51, 0xe4 };
static const unsigned char result_pr[OUTPUT_LEN] = {
static const unsigned char hmac_result_pr[OUTPUT_LEN] = {
0x9a, 0x00, 0xa2, 0xd0, 0x0e, 0xd5, 0x9b, 0xfe, 0x31, 0xec, 0xb1, 0x39,
0x9b, 0x60, 0x81, 0x48, 0xd1, 0x96, 0x9d, 0x25, 0x0d, 0x3c, 0x1e, 0x94,
0x10, 0x10, 0x98, 0x12, 0x93, 0x25, 0xca, 0xb8, 0xfc, 0xcc, 0x2d, 0x54,
@ -436,7 +433,7 @@ static const unsigned char entropy_nopr[] = {
0x21, 0xc9, 0x13, 0x83, 0x11, 0x46, 0x73, 0x3a, 0xbf, 0x8c, 0x35, 0xc8,
0xc7, 0x21, 0x5b, 0x5b, 0x96, 0xc4, 0x8e, 0x9b, 0x33, 0x8c, 0x74, 0xe3,
0xe9, 0x9d, 0xfe, 0xdf };
static const unsigned char result_nopr[OUTPUT_LEN] = {
static const unsigned char hmac_result_nopr[OUTPUT_LEN] = {
0xc6, 0xa1, 0x6a, 0xb8, 0xd4, 0x20, 0x70, 0x6f, 0x0f, 0x34, 0xab, 0x7f,
0xec, 0x5a, 0xdc, 0xa9, 0xd8, 0xca, 0x3a, 0x13, 0x3e, 0x15, 0x9c, 0xa6,
0xac, 0x43, 0xc6, 0xf8, 0xa2, 0xbe, 0x22, 0x83, 0x4a, 0x4c, 0x0a, 0x0a,
@ -487,7 +484,7 @@ int mbedtls_hmac_drbg_self_test( int verbose )
mbedtls_hmac_drbg_set_prediction_resistance( &ctx, MBEDTLS_HMAC_DRBG_PR_ON );
CHK( mbedtls_hmac_drbg_random( &ctx, buf, OUTPUT_LEN ) );
CHK( mbedtls_hmac_drbg_random( &ctx, buf, OUTPUT_LEN ) );
CHK( memcmp( buf, result_pr, OUTPUT_LEN ) );
CHK( memcmp( buf, hmac_result_pr, OUTPUT_LEN ) );
mbedtls_hmac_drbg_free( &ctx );
mbedtls_hmac_drbg_free( &ctx );
@ -510,7 +507,7 @@ int mbedtls_hmac_drbg_self_test( int verbose )
CHK( mbedtls_hmac_drbg_reseed( &ctx, NULL, 0 ) );
CHK( mbedtls_hmac_drbg_random( &ctx, buf, OUTPUT_LEN ) );
CHK( mbedtls_hmac_drbg_random( &ctx, buf, OUTPUT_LEN ) );
CHK( memcmp( buf, result_nopr, OUTPUT_LEN ) );
CHK( memcmp( buf, hmac_result_nopr, OUTPUT_LEN ) );
mbedtls_hmac_drbg_free( &ctx );
mbedtls_hmac_drbg_free( &ctx );

View File

@ -45,8 +45,7 @@
#endif
#if !defined(MBEDTLS_AES_ALT)
// Regular implementation
//
/* Regular implementation */
#ifdef __cplusplus
extern "C" {

View File

@ -34,6 +34,8 @@
#include <stddef.h>
#include <retro_inline.h>
#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C)
#define MBEDTLS_CIPHER_MODE_AEAD
#endif
@ -46,11 +48,6 @@
#define MBEDTLS_CIPHER_MODE_STREAM
#endif
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif
#define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -0x6080 /**< The selected feature is not available. */
#define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -0x6100 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_CIPHER_ALLOC_FAILED -0x6180 /**< Failed to allocate memory. */
@ -74,7 +71,7 @@ typedef enum {
MBEDTLS_CIPHER_ID_3DES,
MBEDTLS_CIPHER_ID_CAMELLIA,
MBEDTLS_CIPHER_ID_BLOWFISH,
MBEDTLS_CIPHER_ID_ARC4,
MBEDTLS_CIPHER_ID_ARC4
} mbedtls_cipher_id_t;
typedef enum {
@ -126,7 +123,7 @@ typedef enum {
MBEDTLS_CIPHER_AES_256_CCM,
MBEDTLS_CIPHER_CAMELLIA_128_CCM,
MBEDTLS_CIPHER_CAMELLIA_192_CCM,
MBEDTLS_CIPHER_CAMELLIA_256_CCM,
MBEDTLS_CIPHER_CAMELLIA_256_CCM
} mbedtls_cipher_type_t;
typedef enum {
@ -138,7 +135,7 @@ typedef enum {
MBEDTLS_MODE_CTR,
MBEDTLS_MODE_GCM,
MBEDTLS_MODE_STREAM,
MBEDTLS_MODE_CCM,
MBEDTLS_MODE_CCM
} mbedtls_cipher_mode_t;
typedef enum {
@ -146,13 +143,13 @@ typedef enum {
MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding */
MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding */
MBEDTLS_PADDING_ZEROS, /**< zero padding (not reversible!) */
MBEDTLS_PADDING_NONE, /**< never pad (full blocks only) */
MBEDTLS_PADDING_NONE /**< never pad (full blocks only) */
} mbedtls_cipher_padding_t;
typedef enum {
MBEDTLS_OPERATION_NONE = -1,
MBEDTLS_DECRYPT = 0,
MBEDTLS_ENCRYPT,
MBEDTLS_ENCRYPT
} mbedtls_operation_t;
enum {
@ -163,7 +160,7 @@ enum {
/** Key length, in bits (including parity), for DES in two key EDE */
MBEDTLS_KEY_LENGTH_DES_EDE = 128,
/** Key length, in bits (including parity), for DES in three-key EDE */
MBEDTLS_KEY_LENGTH_DES_EDE3 = 192,
MBEDTLS_KEY_LENGTH_DES_EDE3 = 192
};
/** Maximum length of any IV, in bytes */
@ -337,7 +334,7 @@ int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_in
* \return size of the cipher's blocks, or 0 if ctx has not been
* initialised.
*/
static inline unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_context_t *ctx )
static INLINE unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return 0;
@ -354,7 +351,7 @@ static inline unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_c
* \return mode of operation, or MBEDTLS_MODE_NONE if ctx
* has not been initialised.
*/
static inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtls_cipher_context_t *ctx )
static INLINE mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return MBEDTLS_MODE_NONE;
@ -371,7 +368,7 @@ static inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtl
* (0 for ciphers not using IV/NONCE).
* If IV has already been set: actual size.
*/
static inline int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ctx )
static INLINE int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return 0;
@ -390,7 +387,7 @@ static inline int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ct
* \return type of the cipher, or MBEDTLS_CIPHER_NONE if ctx has
* not been initialised.
*/
static inline mbedtls_cipher_type_t mbedtls_cipher_get_type( const mbedtls_cipher_context_t *ctx )
static INLINE mbedtls_cipher_type_t mbedtls_cipher_get_type( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return MBEDTLS_CIPHER_NONE;
@ -405,7 +402,7 @@ static inline mbedtls_cipher_type_t mbedtls_cipher_get_type( const mbedtls_ciphe
*
* \return name of the cipher, or NULL if ctx was not initialised.
*/
static inline const char *mbedtls_cipher_get_name( const mbedtls_cipher_context_t *ctx )
static INLINE const char *mbedtls_cipher_get_name( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return 0;
@ -422,7 +419,7 @@ static inline const char *mbedtls_cipher_get_name( const mbedtls_cipher_context_
* MBEDTLS_KEY_LENGTH_NONE if ctx has not been
* initialised.
*/
static inline int mbedtls_cipher_get_key_bitlen( const mbedtls_cipher_context_t *ctx )
static INLINE int mbedtls_cipher_get_key_bitlen( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return MBEDTLS_KEY_LENGTH_NONE;
@ -439,7 +436,7 @@ static inline int mbedtls_cipher_get_key_bitlen( const mbedtls_cipher_context_t
* or MBEDTLS_OPERATION_NONE if ctx has not been
* initialised.
*/
static inline mbedtls_operation_t mbedtls_cipher_get_operation( const mbedtls_cipher_context_t *ctx )
static INLINE mbedtls_operation_t mbedtls_cipher_get_operation( const mbedtls_cipher_context_t *ctx )
{
if( NULL == ctx || NULL == ctx->cipher_info )
return MBEDTLS_OPERATION_NONE;

View File

@ -81,7 +81,10 @@
* example, if double-width division is implemented in software, disabling
* it can reduce code size in some embedded targets.
*/
//#define MBEDTLS_NO_UDBL_DIVISION
#if 0
#define MBEDTLS_NO_UDBL_DIVISION
#endif
/**
* \def MBEDTLS_HAVE_SSE2
@ -90,7 +93,9 @@
*
* Uncomment if the CPU supports SSE2 (IA-32 specific).
*/
//#define MBEDTLS_HAVE_SSE2
#if 0
#define MBEDTLS_HAVE_SSE2
#endif
/**
* \def MBEDTLS_HAVE_TIME
@ -141,7 +146,9 @@
*
* Enable this layer to allow use of alternative memory allocators.
*/
//#define MBEDTLS_PLATFORM_MEMORY
#if 0
#define MBEDTLS_PLATFORM_MEMORY
#endif
/**
* \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
@ -160,7 +167,9 @@
* Uncomment to prevent default assignment of standard functions in the
* platform layer.
*/
//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
#if 0
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
#endif
/**
* \def MBEDTLS_PLATFORM_EXIT_ALT
@ -185,13 +194,15 @@
* Uncomment a macro to enable alternate implementation of specific base
* platform function
*/
//#define MBEDTLS_PLATFORM_EXIT_ALT
//#define MBEDTLS_PLATFORM_TIME_ALT
//#define MBEDTLS_PLATFORM_FPRINTF_ALT
//#define MBEDTLS_PLATFORM_PRINTF_ALT
//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
//#define MBEDTLS_PLATFORM_NV_SEED_ALT
//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
#if 0
#define MBEDTLS_PLATFORM_EXIT_ALT
#define MBEDTLS_PLATFORM_TIME_ALT
#define MBEDTLS_PLATFORM_FPRINTF_ALT
#define MBEDTLS_PLATFORM_PRINTF_ALT
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
#define MBEDTLS_PLATFORM_NV_SEED_ALT
#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
#endif
/**
* \def MBEDTLS_DEPRECATED_WARNING
@ -206,7 +217,9 @@
*
* Uncomment to get warnings on using deprecated functions.
*/
//#define MBEDTLS_DEPRECATED_WARNING
#if 0
#define MBEDTLS_DEPRECATED_WARNING
#endif
/**
* \def MBEDTLS_DEPRECATED_REMOVED
@ -218,7 +231,9 @@
*
* Uncomment to get errors on using deprecated functions.
*/
//#define MBEDTLS_DEPRECATED_REMOVED
#if 0
#define MBEDTLS_DEPRECATED_REMOVED
#endif
/* \} name SECTION: System support */
@ -241,7 +256,9 @@
* You will need to provide a header "timing_alt.h" and an implementation at
* compile time.
*/
//#define MBEDTLS_TIMING_ALT
#if 0
#define MBEDTLS_TIMING_ALT
#endif
/**
* \def MBEDTLS_AES_ALT
@ -262,19 +279,21 @@
* Uncomment a macro to enable alternate implementation of the corresponding
* module.
*/
//#define MBEDTLS_AES_ALT
//#define MBEDTLS_ARC4_ALT
//#define MBEDTLS_BLOWFISH_ALT
//#define MBEDTLS_CAMELLIA_ALT
//#define MBEDTLS_DES_ALT
//#define MBEDTLS_XTEA_ALT
//#define MBEDTLS_MD2_ALT
//#define MBEDTLS_MD4_ALT
//#define MBEDTLS_MD5_ALT
//#define MBEDTLS_RIPEMD160_ALT
//#define MBEDTLS_SHA1_ALT
//#define MBEDTLS_SHA256_ALT
//#define MBEDTLS_SHA512_ALT
#if 0
#define MBEDTLS_AES_ALT
#define MBEDTLS_ARC4_ALT
#define MBEDTLS_BLOWFISH_ALT
#define MBEDTLS_CAMELLIA_ALT
#define MBEDTLS_DES_ALT
#define MBEDTLS_XTEA_ALT
#define MBEDTLS_MD2_ALT
#define MBEDTLS_MD4_ALT
#define MBEDTLS_MD5_ALT
#define MBEDTLS_RIPEMD160_ALT
#define MBEDTLS_SHA1_ALT
#define MBEDTLS_SHA256_ALT
#define MBEDTLS_SHA512_ALT
#endif
/*
* When replacing the elliptic curve module, pleace consider, that it is
* implemented with two .c files:
@ -284,7 +303,9 @@
* macros as described above. The only difference is that you have to make sure
* that you provide functionality for both .c files.
*/
//#define MBEDTLS_ECP_ALT
#if 0
#define MBEDTLS_ECP_ALT
#endif
/**
* \def MBEDTLS_MD2_PROCESS_ALT
@ -315,20 +336,22 @@
* Uncomment a macro to enable alternate implementation of the corresponding
* function.
*/
//#define MBEDTLS_MD2_PROCESS_ALT
//#define MBEDTLS_MD4_PROCESS_ALT
//#define MBEDTLS_MD5_PROCESS_ALT
//#define MBEDTLS_RIPEMD160_PROCESS_ALT
//#define MBEDTLS_SHA1_PROCESS_ALT
//#define MBEDTLS_SHA256_PROCESS_ALT
//#define MBEDTLS_SHA512_PROCESS_ALT
//#define MBEDTLS_DES_SETKEY_ALT
//#define MBEDTLS_DES_CRYPT_ECB_ALT
//#define MBEDTLS_DES3_CRYPT_ECB_ALT
//#define MBEDTLS_AES_SETKEY_ENC_ALT
//#define MBEDTLS_AES_SETKEY_DEC_ALT
//#define MBEDTLS_AES_ENCRYPT_ALT
//#define MBEDTLS_AES_DECRYPT_ALT
#if 0
#define MBEDTLS_MD2_PROCESS_ALT
#define MBEDTLS_MD4_PROCESS_ALT
#define MBEDTLS_MD5_PROCESS_ALT
#define MBEDTLS_RIPEMD160_PROCESS_ALT
#define MBEDTLS_SHA1_PROCESS_ALT
#define MBEDTLS_SHA256_PROCESS_ALT
#define MBEDTLS_SHA512_PROCESS_ALT
#define MBEDTLS_DES_SETKEY_ALT
#define MBEDTLS_DES_CRYPT_ECB_ALT
#define MBEDTLS_DES3_CRYPT_ECB_ALT
#define MBEDTLS_AES_SETKEY_ENC_ALT
#define MBEDTLS_AES_SETKEY_DEC_ALT
#define MBEDTLS_AES_ENCRYPT_ALT
#define MBEDTLS_AES_DECRYPT_ALT
#endif
/**
* \def MBEDTLS_ECP_INTERNAL_ALT
@ -371,17 +394,23 @@
* function.
*/
/* Required for all the functions in this section */
//#define MBEDTLS_ECP_INTERNAL_ALT
#if 0
#define MBEDTLS_ECP_INTERNAL_ALT
#endif
/* Support for Weierstrass curves with Jacobi representation */
//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
//#define MBEDTLS_ECP_ADD_MIXED_ALT
//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
#if 0
#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
#define MBEDTLS_ECP_ADD_MIXED_ALT
#define MBEDTLS_ECP_DOUBLE_JAC_ALT
#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
#endif
/* Support for curves with Montgomery arithmetic */
//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
#if 0
#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
#endif
/**
* \def MBEDTLS_TEST_NULL_ENTROPY
@ -398,7 +427,9 @@
* Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
*
*/
//#define MBEDTLS_TEST_NULL_ENTROPY
#if 0
#define MBEDTLS_TEST_NULL_ENTROPY
#endif
/**
* \def MBEDTLS_ENTROPY_HARDWARE_ALT
@ -411,7 +442,9 @@
*
* Uncomment to use your own hardware entropy collector.
*/
//#define MBEDTLS_ENTROPY_HARDWARE_ALT
#if 0
#define MBEDTLS_ENTROPY_HARDWARE_ALT
#endif
/**
* \def MBEDTLS_AES_ROM_TABLES
@ -420,7 +453,9 @@
*
* Uncomment this macro to store the AES tables in ROM.
*/
//#define MBEDTLS_AES_ROM_TABLES
#if 0
#define MBEDTLS_AES_ROM_TABLES
#endif
/**
* \def MBEDTLS_CAMELLIA_SMALL_MEMORY
@ -429,7 +464,9 @@
*
* Uncomment this macro to use less memory for Camellia.
*/
//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
#if 0
#define MBEDTLS_CAMELLIA_SMALL_MEMORY
#endif
/**
* \def MBEDTLS_CIPHER_MODE_CBC
@ -483,7 +520,9 @@
*
* Uncomment this macro to enable the NULL cipher and ciphersuites
*/
//#define MBEDTLS_CIPHER_NULL_CIPHER
#if 0
#define MBEDTLS_CIPHER_NULL_CIPHER
#endif
/**
* \def MBEDTLS_CIPHER_PADDING_PKCS7
@ -514,7 +553,9 @@
*
* Uncomment this macro to enable weak ciphersuites
*/
//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
#if 0
#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
#endif
/**
* \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
@ -834,7 +875,9 @@
* enabled as well):
* MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
*/
//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
#if 0
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
#endif
/**
* \def MBEDTLS_PK_PARSE_EC_EXTENDED
@ -892,7 +935,9 @@
*
* Uncomment this macro to prevent loading of default entropy functions.
*/
//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
#if 0
#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
#endif
/**
* \def MBEDTLS_NO_PLATFORM_ENTROPY
@ -903,7 +948,9 @@
*
* Uncomment this macro to disable the built-in platform entropy functions.
*/
//#define MBEDTLS_NO_PLATFORM_ENTROPY
#if 0
#define MBEDTLS_NO_PLATFORM_ENTROPY
#endif
/**
* \def MBEDTLS_ENTROPY_FORCE_SHA256
@ -919,7 +966,9 @@
* This option is only useful if both MBEDTLS_SHA256_C and
* MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
*/
//#define MBEDTLS_ENTROPY_FORCE_SHA256
#if 0
#define MBEDTLS_ENTROPY_FORCE_SHA256
#endif
/**
* \def MBEDTLS_ENTROPY_NV_SEED
@ -947,7 +996,9 @@
* \note The entropy collector will write to the seed file before entropy is
* given to an external source, to update it.
*/
//#define MBEDTLS_ENTROPY_NV_SEED
#if 0
#define MBEDTLS_ENTROPY_NV_SEED
#endif
/**
* \def MBEDTLS_MEMORY_DEBUG
@ -960,7 +1011,9 @@
*
* Uncomment this macro to let the buffer allocator print out error messages.
*/
//#define MBEDTLS_MEMORY_DEBUG
#if 0
#define MBEDTLS_MEMORY_DEBUG
#endif
/**
* \def MBEDTLS_MEMORY_BACKTRACE
@ -972,7 +1025,9 @@
*
* Uncomment this macro to include backtrace information
*/
//#define MBEDTLS_MEMORY_BACKTRACE
#if 0
#define MBEDTLS_MEMORY_BACKTRACE
#endif
/**
* \def MBEDTLS_PK_RSA_ALT_SUPPORT
@ -1013,7 +1068,9 @@
* Uncomment this macro to disable the use of CRT in RSA.
*
*/
//#define MBEDTLS_RSA_NO_CRT
#if 0
#define MBEDTLS_RSA_NO_CRT
#endif
/**
* \def MBEDTLS_SELF_TEST
@ -1036,7 +1093,9 @@
*
* Uncomment to enable the smaller implementation of SHA256.
*/
//#define MBEDTLS_SHA256_SMALLER
#if 0
#define MBEDTLS_SHA256_SMALLER
#endif
/**
* \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
@ -1066,7 +1125,9 @@
* a timing side-channel.
*
*/
//#define MBEDTLS_SSL_DEBUG_ALL
#if 0
#define MBEDTLS_SSL_DEBUG_ALL
#endif
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
*
@ -1129,7 +1190,9 @@
*
* Uncomment this macro to enable hooking functions.
*/
//#define MBEDTLS_SSL_HW_RECORD_ACCEL
#if 0
#define MBEDTLS_SSL_HW_RECORD_ACCEL
#endif
/**
* \def MBEDTLS_SSL_CBC_RECORD_SPLITTING
@ -1166,7 +1229,9 @@
*
* Uncomment this macro to enable support for SSLv2 Client Hello messages.
*/
//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
#if 0
#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
#endif
/**
* \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
@ -1176,7 +1241,9 @@
*
* Uncomment this macro to respect client's ciphersuite order
*/
//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
#if 0
#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
#endif
/**
* \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
@ -1197,7 +1264,9 @@
*
* Comment this macro to disable support for SSL 3.0
*/
//#define MBEDTLS_SSL_PROTO_SSL3
#if 0
#define MBEDTLS_SSL_PROTO_SSL3
#endif
/**
* \def MBEDTLS_SSL_PROTO_TLS1
@ -1372,7 +1441,9 @@
*
* Uncomment this to allow your own alternate threading implementation.
*/
//#define MBEDTLS_THREADING_ALT
#if 0
#define MBEDTLS_THREADING_ALT
#endif
/**
* \def MBEDTLS_THREADING_PTHREAD
@ -1383,7 +1454,9 @@
*
* Uncomment this to enable pthread mutexes.
*/
//#define MBEDTLS_THREADING_PTHREAD
#if 0
#define MBEDTLS_THREADING_PTHREAD
#endif
/**
* \def MBEDTLS_VERSION_FEATURES
@ -1406,7 +1479,9 @@
*
* Uncomment to prevent an error.
*/
//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
#if 0
#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
#endif
/**
* \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
@ -1418,7 +1493,9 @@
*
* Uncomment to prevent an error.
*/
//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
#if 0
#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
#endif
/**
* \def MBEDTLS_X509_CHECK_KEY_USAGE
@ -1477,7 +1554,9 @@
*
* Uncomment to enable use of ZLIB
*/
//#define MBEDTLS_ZLIB_SUPPORT
#if 0
#define MBEDTLS_ZLIB_SUPPORT
#endif
/* \} name SECTION: mbed TLS feature support */
/**
@ -1768,7 +1847,9 @@
* Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
*
*/
//#define MBEDTLS_CMAC_C
#if 0
#define MBEDTLS_CMAC_C
#endif
/**
* \def MBEDTLS_CTR_DRBG_C
@ -1796,7 +1877,9 @@
*
* This module provides debugging functions.
*/
#if 0
#define MBEDTLS_DEBUG_C
#endif
/**
* \def MBEDTLS_DES_C
@ -1886,7 +1969,9 @@
*
* Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
*/
//#define MBEDTLS_ECJPAKE_C
#if 0
#define MBEDTLS_ECJPAKE_C
#endif
/**
* \def MBEDTLS_ECP_C
@ -1963,7 +2048,9 @@
*
* Uncomment to enable the HAVEGE random generator.
*/
//#define MBEDTLS_HAVEGE_C
#if 0
#define MBEDTLS_HAVEGE_C
#endif
/**
* \def MBEDTLS_HMAC_DRBG_C
@ -2001,7 +2088,9 @@
*
* Uncomment to enable support for (rare) MD2-signed X.509 certs.
*/
//#define MBEDTLS_MD2_C
#if 0
#define MBEDTLS_MD2_C
#endif
/**
* \def MBEDTLS_MD4_C
@ -2013,7 +2102,9 @@
*
* Uncomment to enable support for (rare) MD4-signed X.509 certs.
*/
//#define MBEDTLS_MD4_C
#if 0
#define MBEDTLS_MD4_C
#endif
/**
* \def MBEDTLS_MD5_C
@ -2044,7 +2135,9 @@
*
* Enable this module to enable the buffer memory allocator.
*/
//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
#if 0
#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
#endif
/**
* \def MBEDTLS_NET_C
@ -2207,7 +2300,9 @@
* This module enables SSL/TLS PKCS #11 smartcard support.
* Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
*/
//#define MBEDTLS_PKCS11_C
#if 0
#define MBEDTLS_PKCS11_C
#endif
/**
* \def MBEDTLS_PKCS12_C
@ -2421,7 +2516,9 @@
*
* Enable this layer to allow use of mutexes within mbed TLS
*/
//#define MBEDTLS_THREADING_C
#if 0
#define MBEDTLS_THREADING_C
#endif
/**
* \def MBEDTLS_TIMING_C
@ -2585,74 +2682,94 @@
*/
/* MPI / BIGNUM options */
//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
#if 0
#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
#endif
/* CTR_DRBG options */
//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
#if 0
#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
#endif
/* HMAC_DRBG options */
//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
#if 0
#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
#endif
/* ECP options */
//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
#if 0
#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
#endif
/* Entropy options */
//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
#if 0
#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
#endif
/* Memory buffer allocator options */
//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
#if 0
#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
#endif
/* Platform options */
//#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
#if 0
#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
/* Note: your snprintf must correclty zero-terminate the buffer! */
//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
#endif
/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
#if 0
#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
/* Note: your snprintf must correclty zero-terminate the buffer! */
//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
#endif
/* SSL Cache options */
//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
#if 0
#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
#endif
/* SSL options */
//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */
//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
#if 0
#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */
#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
#endif
/**
* Complete list of ciphersuites to use, in order of preference.
@ -2666,11 +2783,15 @@
*
* The value below is only an example, not the default.
*/
//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
#if 0
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
#endif
/* X509 options */
//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
#if 0
#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
#endif
/**
* Allow SHA-1 in the default TLS configuration for certificate signing.
@ -2679,7 +2800,9 @@
* recommended because of it is possible to generte SHA-1 collisions, however
* this may be safe for legacy infrastructure where additional controls apply.
*/
// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
#if 0
#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
#endif
/**
* Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
@ -2695,7 +2818,9 @@
/* \} name SECTION: Customisation configuration options */
/* Target and application specific configurations */
//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h"
#if 0
#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h"
#endif
#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE)
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

View File

@ -35,7 +35,7 @@ extern "C" {
typedef enum
{
MBEDTLS_ECDH_OURS,
MBEDTLS_ECDH_THEIRS,
MBEDTLS_ECDH_THEIRS
} mbedtls_ecdh_side;
/**

View File

@ -73,7 +73,7 @@ typedef enum
MBEDTLS_ECP_DP_CURVE25519, /*!< Curve25519 */
MBEDTLS_ECP_DP_SECP192K1, /*!< 192-bits "Koblitz" curve */
MBEDTLS_ECP_DP_SECP224K1, /*!< 224-bits "Koblitz" curve */
MBEDTLS_ECP_DP_SECP256K1, /*!< 256-bits "Koblitz" curve */
MBEDTLS_ECP_DP_SECP256K1 /*!< 256-bits "Koblitz" curve */
} mbedtls_ecp_group_id;
/**

View File

@ -46,7 +46,7 @@ typedef enum {
MBEDTLS_MD_SHA256,
MBEDTLS_MD_SHA384,
MBEDTLS_MD_SHA512,
MBEDTLS_MD_RIPEMD160,
MBEDTLS_MD_RIPEMD160
} mbedtls_md_type_t;
#if defined(MBEDTLS_SHA512_C)

View File

@ -24,6 +24,8 @@
#ifndef MBEDTLS_PK_H
#define MBEDTLS_PK_H
#include <retro_inline.h>
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
@ -44,11 +46,6 @@
#include "ecdsa.h"
#endif
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif
#define MBEDTLS_ERR_PK_ALLOC_FAILED -0x3F80 /**< Memory allocation failed. */
#define MBEDTLS_ERR_PK_TYPE_MISMATCH -0x3F00 /**< Type mismatch, eg attempt to encrypt with an ECDSA key */
#define MBEDTLS_ERR_PK_BAD_INPUT_DATA -0x3E80 /**< Bad input parameters to function. */
@ -78,7 +75,7 @@ typedef enum {
MBEDTLS_PK_ECKEY_DH,
MBEDTLS_PK_ECDSA,
MBEDTLS_PK_RSA_ALT,
MBEDTLS_PK_RSASSA_PSS,
MBEDTLS_PK_RSASSA_PSS
} mbedtls_pk_type_t;
/**
@ -99,7 +96,7 @@ typedef enum
{
MBEDTLS_PK_DEBUG_NONE = 0,
MBEDTLS_PK_DEBUG_MPI,
MBEDTLS_PK_DEBUG_ECP,
MBEDTLS_PK_DEBUG_ECP
} mbedtls_pk_debug_type;
/**
@ -136,7 +133,7 @@ typedef struct
* \warning You must make sure the PK context actually holds an RSA context
* before using this function!
*/
static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
static INLINE mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
{
return( (mbedtls_rsa_context *) (pk).pk_ctx );
}
@ -149,7 +146,7 @@ static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
* \warning You must make sure the PK context actually holds an EC context
* before using this function!
*/
static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk )
static INLINE mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk )
{
return( (mbedtls_ecp_keypair *) (pk).pk_ctx );
}
@ -240,7 +237,7 @@ size_t mbedtls_pk_get_bitlen( const mbedtls_pk_context *ctx );
*
* \return Key length in bytes, or 0 on error
*/
static inline size_t mbedtls_pk_get_len( const mbedtls_pk_context *ctx )
static INLINE size_t mbedtls_pk_get_len( const mbedtls_pk_context *ctx )
{
return( ( mbedtls_pk_get_bitlen( ctx ) + 7 ) / 8 );
}

View File

@ -30,7 +30,7 @@
#endif
#if defined(MBEDTLS_HAVE_TIME)
#include "mbedtls/platform_time.h"
#include "platform_time.h"
#endif
#ifdef __cplusplus

View File

@ -33,8 +33,7 @@
#include <stdint.h>
#if !defined(MBEDTLS_SHA512_ALT)
// Regular implementation
//
/* Regular implementation */
#ifdef __cplusplus
extern "C" {

View File

@ -52,7 +52,7 @@
#endif
#if defined(MBEDTLS_HAVE_TIME)
#include "mbedtls/platform_time.h"
#include "platform_time.h"
#endif
/*
@ -412,7 +412,7 @@ typedef enum
MBEDTLS_SSL_HANDSHAKE_WRAPUP,
MBEDTLS_SSL_HANDSHAKE_OVER,
MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET,
MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT,
MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT
}
mbedtls_ssl_states;

View File

@ -23,6 +23,8 @@
#ifndef MBEDTLS_SSL_CIPHERSUITES_H
#define MBEDTLS_SSL_CIPHERSUITES_H
#include <retro_inline.h>
#include "pk.h"
#include "cipher.h"
#include "md.h"
@ -246,7 +248,7 @@ typedef enum {
MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
MBEDTLS_KEY_EXCHANGE_ECJPAKE,
MBEDTLS_KEY_EXCHANGE_ECJPAKE
} mbedtls_key_exchange_type_t;
/* Key exchanges using a certificate */
@ -363,7 +365,7 @@ int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info );
int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info );
#if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED)
static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -382,7 +384,7 @@ static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite
#endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */
#if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED)
static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -400,7 +402,7 @@ static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_
#endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */
#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED)
static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -414,7 +416,7 @@ static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersui
}
#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */
static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -432,7 +434,7 @@ static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ci
}
#if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED)
static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -447,7 +449,7 @@ static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuit
#endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */
#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED)
static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{
@ -463,7 +465,7 @@ static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersu
#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */
#if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED)
static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info )
static INLINE int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info )
{
switch( info->key_exchange )
{

5
deps/mbedtls/md.c vendored
View File

@ -48,10 +48,7 @@
#include <stdio.h>
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Reminder: update profiles in x509_crt.c when adding a new hash!

5
deps/mbedtls/md2.c vendored
View File

@ -48,10 +48,7 @@
#if !defined(MBEDTLS_MD2_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
static const unsigned char PI_SUBST[256] =
{

5
deps/mbedtls/md4.c vendored
View File

@ -48,10 +48,7 @@
#if !defined(MBEDTLS_MD4_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (little endian)

9
deps/mbedtls/md5.c vendored
View File

@ -47,10 +47,7 @@
#if !defined(MBEDTLS_MD5_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (little endian)
@ -129,9 +126,9 @@ void mbedtls_md5_process( mbedtls_md5_context *ctx, const unsigned char data[64]
GET_UINT32_LE( X[13], data, 52 );
GET_UINT32_LE( X[14], data, 56 );
GET_UINT32_LE( X[15], data, 60 );
#undef S
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
#undef P
#define P(a,b,c,d,k,s,t) \
{ \
a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \

View File

@ -42,10 +42,7 @@
#include "mbedtls/threading.h"
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#define MAGIC1 0xFF00AA55
#define MAGIC2 0xEE119966

5
deps/mbedtls/pem.c vendored
View File

@ -45,10 +45,7 @@
#endif
#if defined(MBEDTLS_PEM_PARSE_C)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
void mbedtls_pem_init( mbedtls_pem_context *ctx )
{

5
deps/mbedtls/pk.c vendored
View File

@ -43,10 +43,7 @@
#include <limits.h>
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Initialise a mbedtls_pk_context

View File

@ -53,10 +53,7 @@
#include <limits.h>
#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#endif
#if defined(MBEDTLS_RSA_C)

View File

@ -47,10 +47,7 @@
#include "mbedtls/des.h"
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
static int pkcs12_parse_pbe_params( mbedtls_asn1_buf *params,
mbedtls_asn1_buf *salt, int *iterations )

View File

@ -61,10 +61,7 @@
#endif
#if defined(MBEDTLS_FS_IO)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Load all data from a file into a given buffer.

View File

@ -69,10 +69,7 @@
}
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx )
{
@ -138,15 +135,15 @@ void mbedtls_ripemd160_process( mbedtls_ripemd160_context *ctx, const unsigned c
C = Cp = ctx->state[2];
D = Dp = ctx->state[3];
E = Ep = ctx->state[4];
#undef F1
#define F1( x, y, z ) ( x ^ y ^ z )
#define F2( x, y, z ) ( ( x & y ) | ( ~x & z ) )
#define F3( x, y, z ) ( ( x | ~y ) ^ z )
#define F4( x, y, z ) ( ( x & z ) | ( y & ~z ) )
#define F5( x, y, z ) ( x ^ ( y | ~z ) )
#undef S
#define S( x, n ) ( ( x << n ) | ( x >> (32 - n) ) )
#undef P
#define P( a, b, c, d, e, r, s, f, k ) \
a += f( b, c, d ) + X[r] + k; \
a = S( a, s ) + e; \

5
deps/mbedtls/rsa.c vendored
View File

@ -66,10 +66,7 @@
#define mbedtls_free free
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Initialize an RSA context

11
deps/mbedtls/sha1.c vendored
View File

@ -47,10 +47,7 @@
#if !defined(MBEDTLS_SHA1_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)
@ -130,16 +127,16 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6
GET_UINT32_BE( W[13], data, 52 );
GET_UINT32_BE( W[14], data, 56 );
GET_UINT32_BE( W[15], data, 60 );
#undef S
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
#undef R
#define R(t) \
( \
temp = W[( t - 3 ) & 0x0F] ^ W[( t - 8 ) & 0x0F] ^ \
W[( t - 14 ) & 0x0F] ^ W[ t & 0x0F], \
( W[t & 0x0F] = S(temp,1) ) \
)
#undef P
#define P(a,b,c,d,e,x) \
{ \
e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \

55
deps/mbedtls/sha256.c vendored
View File

@ -50,10 +50,7 @@
#if !defined(MBEDTLS_SHA256_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)
@ -134,7 +131,7 @@ void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, int is224 )
}
#if !defined(MBEDTLS_SHA256_PROCESS_ALT)
static const uint32_t K[] =
static const uint32_t SHA256_K[] =
{
0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
@ -153,25 +150,29 @@ static const uint32_t K[] =
0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2,
};
#undef SHRs
#define SHR(x,n) ((x & 0xFFFFFFFF) >> n)
#undef ROTR
#define ROTR(x,n) (SHR(x,n) | (x << (32 - n)))
#undef S0
#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3))
#undef S1
#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10))
#undef S2
#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22))
#undef S3
#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25))
#define F0(x,y,z) ((x & y) | (z & (x | y)))
#undef F1
#define F1(x,y,z) (z ^ (x & (y ^ z)))
#undef R
#define R(t) \
( \
W[t] = S1(W[t - 2]) + W[t - 7] + \
S0(W[t - 15]) + W[t - 16] \
)
#undef P
#define P(a,b,c,d,e,f,g,h,x,K) \
{ \
temp1 = h + S3(e) + F1(e,f,g) + K + x; \
@ -196,7 +197,7 @@ void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char da
else
R( i );
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], W[i], K[i] );
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], W[i], SHA256_K[i] );
temp1 = A[7]; A[7] = A[6]; A[6] = A[5]; A[5] = A[4]; A[4] = A[3];
A[3] = A[2]; A[2] = A[1]; A[1] = A[0]; A[0] = temp1;
@ -207,26 +208,26 @@ void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char da
for( i = 0; i < 16; i += 8 )
{
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], W[i+0], K[i+0] );
P( A[7], A[0], A[1], A[2], A[3], A[4], A[5], A[6], W[i+1], K[i+1] );
P( A[6], A[7], A[0], A[1], A[2], A[3], A[4], A[5], W[i+2], K[i+2] );
P( A[5], A[6], A[7], A[0], A[1], A[2], A[3], A[4], W[i+3], K[i+3] );
P( A[4], A[5], A[6], A[7], A[0], A[1], A[2], A[3], W[i+4], K[i+4] );
P( A[3], A[4], A[5], A[6], A[7], A[0], A[1], A[2], W[i+5], K[i+5] );
P( A[2], A[3], A[4], A[5], A[6], A[7], A[0], A[1], W[i+6], K[i+6] );
P( A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[0], W[i+7], K[i+7] );
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], W[i+0], SHA256_K[i+0] );
P( A[7], A[0], A[1], A[2], A[3], A[4], A[5], A[6], W[i+1], SHA256_K[i+1] );
P( A[6], A[7], A[0], A[1], A[2], A[3], A[4], A[5], W[i+2], SHA256_K[i+2] );
P( A[5], A[6], A[7], A[0], A[1], A[2], A[3], A[4], W[i+3], SHA256_K[i+3] );
P( A[4], A[5], A[6], A[7], A[0], A[1], A[2], A[3], W[i+4], SHA256_K[i+4] );
P( A[3], A[4], A[5], A[6], A[7], A[0], A[1], A[2], W[i+5], SHA256_K[i+5] );
P( A[2], A[3], A[4], A[5], A[6], A[7], A[0], A[1], W[i+6], SHA256_K[i+6] );
P( A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[0], W[i+7], SHA256_K[i+7] );
}
for( i = 16; i < 64; i += 8 )
{
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], R(i+0), K[i+0] );
P( A[7], A[0], A[1], A[2], A[3], A[4], A[5], A[6], R(i+1), K[i+1] );
P( A[6], A[7], A[0], A[1], A[2], A[3], A[4], A[5], R(i+2), K[i+2] );
P( A[5], A[6], A[7], A[0], A[1], A[2], A[3], A[4], R(i+3), K[i+3] );
P( A[4], A[5], A[6], A[7], A[0], A[1], A[2], A[3], R(i+4), K[i+4] );
P( A[3], A[4], A[5], A[6], A[7], A[0], A[1], A[2], R(i+5), K[i+5] );
P( A[2], A[3], A[4], A[5], A[6], A[7], A[0], A[1], R(i+6), K[i+6] );
P( A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[0], R(i+7), K[i+7] );
P( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], R(i+0), SHA256_K[i+0] );
P( A[7], A[0], A[1], A[2], A[3], A[4], A[5], A[6], R(i+1), SHA256_K[i+1] );
P( A[6], A[7], A[0], A[1], A[2], A[3], A[4], A[5], R(i+2), SHA256_K[i+2] );
P( A[5], A[6], A[7], A[0], A[1], A[2], A[3], A[4], R(i+3), SHA256_K[i+3] );
P( A[4], A[5], A[6], A[7], A[0], A[1], A[2], A[3], R(i+4), SHA256_K[i+4] );
P( A[3], A[4], A[5], A[6], A[7], A[0], A[1], A[2], R(i+5), SHA256_K[i+5] );
P( A[2], A[3], A[4], A[5], A[6], A[7], A[0], A[1], R(i+6), SHA256_K[i+6] );
P( A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[0], R(i+7), SHA256_K[i+7] );
}
#endif /* MBEDTLS_SHA256_SMALLER */

14
deps/mbedtls/sha512.c vendored
View File

@ -56,10 +56,7 @@
#if !defined(MBEDTLS_SHA512_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 64-bit integer manipulation macros (big endian)
@ -201,14 +198,17 @@ void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char da
int i;
uint64_t temp1, temp2, W[80];
uint64_t A, B, C, D, E, F, G, H;
#undef SHR
#define SHR(x,n) (x >> n)
#undef ROTR
#define ROTR(x,n) (SHR(x,n) | (x << (64 - n)))
#undef S0
#define S0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7))
#undef S1
#define S1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x, 6))
#undef S2
#define S2(x) (ROTR(x,28) ^ ROTR(x,34) ^ ROTR(x,39))
#undef S3
#define S3(x) (ROTR(x,14) ^ ROTR(x,18) ^ ROTR(x,41))
#define F0(x,y,z) ((x & y) | (z & (x | y)))

View File

@ -1702,7 +1702,7 @@ const int *mbedtls_ssl_list_ciphersuites( void )
#define MAX_CIPHERSUITES sizeof( ciphersuite_definitions ) / \
sizeof( ciphersuite_definitions[0] )
static int supported_ciphersuites[MAX_CIPHERSUITES];
static int supported_init = 0;
static int ssl_ciphersuites_supported_init = 0;
const int *mbedtls_ssl_list_ciphersuites( void )
{
@ -1710,7 +1710,7 @@ const int *mbedtls_ssl_list_ciphersuites( void )
* On initial call filter out all ciphersuites not supported by current
* build based on presence in the ciphersuite_definitions.
*/
if( supported_init == 0 )
if( ssl_ciphersuites_supported_init == 0 )
{
const int *p;
int *q;
@ -1730,7 +1730,7 @@ const int *mbedtls_ssl_list_ciphersuites( void )
}
*q = 0;
supported_init = 1;
ssl_ciphersuites_supported_init = 1;
}
return( supported_ciphersuites );

View File

@ -48,10 +48,7 @@
#endif
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#endif
#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
@ -1053,65 +1050,10 @@ static int ssl_write_client_hello( mbedtls_ssl_context *ssl )
return( 0 );
}
static int ssl_parse_renegotiation_info( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
#if defined(MBEDTLS_SSL_RENEGOTIATION)
if( ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE )
{
/* Check verify-data in constant-time. The length OTOH is no secret */
if( len != 1 + ssl->verify_data_len * 2 ||
buf[0] != ssl->verify_data_len * 2 ||
mbedtls_ssl_safer_memcmp( buf + 1,
ssl->own_verify_data, ssl->verify_data_len ) != 0 ||
mbedtls_ssl_safer_memcmp( buf + 1 + ssl->verify_data_len,
ssl->peer_verify_data, ssl->verify_data_len ) != 0 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
}
}
else
#endif /* MBEDTLS_SSL_RENEGOTIATION */
{
if( len != 1 || buf[0] != 0x00 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-zero length renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
}
ssl->secure_renegotiation = MBEDTLS_SSL_SECURE_RENEGOTIATION;
}
return( 0 );
}
#include "ssl_parse_renegotiation_info.h"
#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
static int ssl_parse_max_fragment_length_ext( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
/*
* server should use the extension only if we did,
* and if so the server's value should match ours (and len is always 1)
*/
if( ssl->conf->mfl_code == MBEDTLS_SSL_MAX_FRAG_LEN_NONE ||
len != 1 ||
buf[0] != ssl->conf->mfl_code )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching max fragment length extension" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
}
return( 0 );
}
#include "ssl_parse_max_fragment_length_ext.h"
#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
#if defined(MBEDTLS_SSL_TRUNCATED_HMAC)

View File

@ -43,10 +43,7 @@
#include <string.h>
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* If DTLS is in use, then at least one of SHA-1, SHA-256, SHA-512 is

View File

@ -0,0 +1,21 @@
#ifndef _SSL_PARSE_MAX_FRAGMENT_LENGTH_EXT_H
#define _SSL_PARSE_MAX_FRAGMENT_LENGTH_EXT_H
static int ssl_parse_max_fragment_length_ext( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client hello message" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
ssl->session_negotiate->mfl_code = buf[0];
return( 0 );
}
#endif

View File

@ -0,0 +1,40 @@
#ifndef _SSL_PARSE_RENEGOTIATION_INFO_H
#define _SSL_PARSE_RENEGOTIATION_INFO_H
static int ssl_parse_renegotiation_info( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
#if defined(MBEDTLS_SSL_RENEGOTIATION)
if( ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE )
{
/* Check verify-data in constant-time. The length OTOH is no secret */
if( len != 1 + ssl->verify_data_len ||
buf[0] != ssl->verify_data_len ||
mbedtls_ssl_safer_memcmp( buf + 1, ssl->peer_verify_data,
ssl->verify_data_len ) != 0 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
}
else
#endif /* MBEDTLS_SSL_RENEGOTIATION */
{
if( len != 1 || buf[0] != 0x0 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-zero length renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
ssl->secure_renegotiation = MBEDTLS_SSL_SECURE_RENEGOTIATION;
}
return( 0 );
}
#endif

View File

@ -50,10 +50,7 @@
#endif
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
#endif
#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
@ -147,42 +144,8 @@ static int ssl_parse_servername_ext( mbedtls_ssl_context *ssl,
return( 0 );
}
#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */
#include "ssl_parse_renegotiation_info.h"
static int ssl_parse_renegotiation_info( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
#if defined(MBEDTLS_SSL_RENEGOTIATION)
if( ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE )
{
/* Check verify-data in constant-time. The length OTOH is no secret */
if( len != 1 + ssl->verify_data_len ||
buf[0] != ssl->verify_data_len ||
mbedtls_ssl_safer_memcmp( buf + 1, ssl->peer_verify_data,
ssl->verify_data_len ) != 0 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
}
else
#endif /* MBEDTLS_SSL_RENEGOTIATION */
{
if( len != 1 || buf[0] != 0x0 )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-zero length renegotiation info" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
ssl->secure_renegotiation = MBEDTLS_SSL_SECURE_RENEGOTIATION;
}
return( 0 );
}
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
@ -402,22 +365,7 @@ static int ssl_parse_ecjpake_kkpp( mbedtls_ssl_context *ssl,
#endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
static int ssl_parse_max_fragment_length_ext( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client hello message" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
ssl->session_negotiate->mfl_code = buf[0];
return( 0 );
}
#include "ssl_parse_max_fragment_length_ext.h"
#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
#if defined(MBEDTLS_SSL_TRUNCATED_HMAC)

View File

@ -39,10 +39,7 @@
#include <string.h>
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Initialze context

View File

@ -53,10 +53,7 @@
#include "mbedtls/oid.h"
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/* Length of the "epoch" field in the record header */
static inline size_t ssl_ep_len( const mbedtls_ssl_context *ssl )

View File

@ -66,10 +66,7 @@
#include <stdio.h>
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Version ::= INTEGER { v1(0), v2(1) }
@ -573,7 +570,9 @@ int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path )
/*
* Return an informational string about the certificate.
*/
#undef BEFORE_COLON
#define BEFORE_COLON 14
#undef BC
#define BC "14"
/*
* Return an informational string about the CRL.

View File

@ -75,10 +75,7 @@
#endif /* !_WIN32 || EFIX64 || EFI32 */
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Default profile
@ -1357,7 +1354,9 @@ static int x509_info_ext_key_usage( char **buf, size_t *size,
/*
* Return an informational string about the certificate.
*/
#undef BEFORE_COLON
#define BEFORE_COLON 18
#undef BC
#define BC "18"
int mbedtls_x509_crt_info( char *buf, size_t size, const char *prefix,
const mbedtls_x509_crt *crt )

View File

@ -60,10 +60,7 @@
#include <stdio.h>
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* Version ::= INTEGER { v1(0) }
@ -331,8 +328,9 @@ int mbedtls_x509_csr_parse_file( mbedtls_x509_csr *csr, const char *path )
return( ret );
}
#endif /* MBEDTLS_FS_IO */
#undef BEFORE_COLON
#define BEFORE_COLON 14
#undef BC
#define BC "14"
/*
* Return an informational string about the CSR.

View File

@ -44,10 +44,7 @@
#include "mbedtls/pem.h"
#endif /* MBEDTLS_PEM_WRITE_C */
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx )
{

View File

@ -43,10 +43,7 @@
#include "mbedtls/pem.h"
#endif
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx )
{

5
deps/mbedtls/xtea.c vendored
View File

@ -42,10 +42,7 @@
#if !defined(MBEDTLS_XTEA_ALT)
/* Implementation that should never be optimized out by the compiler */
static void mbedtls_zeroize( void *v, size_t n ) {
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
}
#include "arc4_alt.h"
/*
* 32-bit integer manipulation macros (big endian)

View File

@ -14,10 +14,15 @@
*/
#include "discord.h"
#include "retroarch.h"
#include "core.h"
#include "core_info.h"
#include "paths.h"
#include <file/file_path.h>
#include "../msg_hash.h"
static const char* APPLICATION_ID = "450822022025576457";
static const char* APPLICATION_ID = "475456035851599874";
static int FrustrationLevel = 0;
static int64_t start_time = 0;
@ -66,6 +71,10 @@ static void handle_discord_join_request(const DiscordUser* request)
void discord_update(enum discord_presence presence)
{
rarch_system_info_t *system = runloop_get_system_info();
core_info_t *core_info = NULL;
core_info_get_current_core(&core_info);
if (!discord_ready)
return;
if (
@ -81,20 +90,28 @@ void discord_update(enum discord_presence presence)
{
case DISCORD_PRESENCE_MENU:
discord_presence.state = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU);
discord_presence.largeImageKey = "icon";
discord_presence.largeImageKey = "base";
discord_presence.instance = 0;
discord_presence.startTimestamp = start_time;
break;
case DISCORD_PRESENCE_GAME:
start_time = time(0);
discord_presence.state = "Link's House";
discord_presence.details = "Legend of Zelda, The - Link's Awakening DX";
discord_presence.largeImageKey = "icon";
#if 0
discord_presence.smallImageKey = "icon";
{
const char *system_name = string_replace_substring(string_to_lower(core_info->core_name), " ", "_");
start_time = time(0);
discord_presence.state = system ? system->info.library_name : "---";
discord_presence.details = path_basename(path_get(RARCH_PATH_BASENAME));
#if 1
RARCH_LOG("[Discord] system name: %s\n", system_name);
#endif
discord_presence.instance = 0;
discord_presence.startTimestamp = start_time;
discord_presence.largeImageKey = system_name;
discord_presence.smallImageKey = "base";
discord_presence.instance = 0;
discord_presence.startTimestamp = start_time;
}
break;
case DISCORD_PRESENCE_NETPLAY_HOSTING:
case DISCORD_PRESENCE_NETPLAY_CLIENT:

View File

@ -1417,3 +1417,82 @@ HTTP SERVER
#if defined(HAVE_DISCORD)
#include "../discord/discord.c"
#endif
/*============================================================
SSL
============================================================ */
#if defined(HAVE_SSL)
#include "../deps/mbedtls/aes.c"
#include "../deps/mbedtls/aesni.c"
#include "../deps/mbedtls/arc4.c"
#include "../deps/mbedtls/asn1parse.c"
#include "../deps/mbedtls/asn1write.c"
#include "../deps/mbedtls/base64.c"
#include "../deps/mbedtls/bignum.c"
#include "../deps/mbedtls/blowfish.c"
#include "../deps/mbedtls/camellia.c"
#include "../deps/mbedtls/ccm.c"
#include "../deps/mbedtls/cipher.c"
#include "../deps/mbedtls/cipher_wrap.c"
#include "../deps/mbedtls/cmac.c"
#include "../deps/mbedtls/ctr_drbg.c"
#include "../deps/mbedtls/des.c"
#include "../deps/mbedtls/dhm.c"
#include "../deps/mbedtls/ecdh.c"
#include "../deps/mbedtls/ecdsa.c"
#include "../deps/mbedtls/ecjpake.c"
#include "../deps/mbedtls/ecp.c"
#include "../deps/mbedtls/ecp_curves.c"
#include "../deps/mbedtls/entropy.c"
#include "../deps/mbedtls/entropy_poll.c"
#include "../deps/mbedtls/error.c"
#include "../deps/mbedtls/gcm.c"
#include "../deps/mbedtls/havege.c"
#include "../deps/mbedtls/hmac_drbg.c"
#include "../deps/mbedtls/md.c"
#include "../deps/mbedtls/md2.c"
#include "../deps/mbedtls/md4.c"
#include "../deps/mbedtls/md5.c"
#include "../deps/mbedtls/md_wrap.c"
#include "../deps/mbedtls/memory_buffer_alloc.c"
#include "../deps/mbedtls/oid.c"
#include "../deps/mbedtls/padlock.c"
#include "../deps/mbedtls/pem.c"
#include "../deps/mbedtls/pk.c"
#include "../deps/mbedtls/pk_wrap.c"
#include "../deps/mbedtls/pkcs12.c"
#include "../deps/mbedtls/pkcs5.c"
#include "../deps/mbedtls/pkparse.c"
#include "../deps/mbedtls/pkwrite.c"
#include "../deps/mbedtls/platform.c"
#include "../deps/mbedtls/ripemd160.c"
#include "../deps/mbedtls/rsa.c"
#include "../deps/mbedtls/sha1.c"
#include "../deps/mbedtls/sha256.c"
#include "../deps/mbedtls/sha512.c"
#include "../deps/mbedtls/threading.c"
#include "../deps/mbedtls/timing.c"
#include "../deps/mbedtls/version.c"
#include "../deps/mbedtls/version_features.c"
#include "../deps/mbedtls/xtea.c"
#include "../deps/mbedtls/certs.c"
#include "../deps/mbedtls/pkcs11.c"
#include "../deps/mbedtls/x509.c"
#include "../deps/mbedtls/x509_create.c"
#include "../deps/mbedtls/x509_crl.c"
#include "../deps/mbedtls/x509_crt.c"
#include "../deps/mbedtls/x509_csr.c"
#include "../deps/mbedtls/x509write_crt.c"
#include "../deps/mbedtls/x509write_csr.c"
#include "../deps/mbedtls/debug.c"
#include "../deps/mbedtls/net_sockets.c"
#include "../deps/mbedtls/ssl_cache.c"
#include "../deps/mbedtls/ssl_ciphersuites.c"
#include "../deps/mbedtls/ssl_cli.c"
#include "../deps/mbedtls/ssl_cookie.c"
#include "../deps/mbedtls/ssl_srv.c"
#include "../deps/mbedtls/ssl_ticket.c"
#include "../deps/mbedtls/ssl_tls.c"
#endif

View File

@ -43,7 +43,7 @@ typedef struct apple_hid
IOHIDManagerRef ptr;
joypad_connection_t *slots;
uint32_t buttons[MAX_USERS];
int16_t axes[MAX_USERS][6];
int16_t axes[MAX_USERS][11];
int8_t hats[MAX_USERS][2]; /* MacOS only supports 1 hat AFAICT */
} iohidmanager_hid_t;
@ -201,7 +201,7 @@ static int16_t iohidmanager_hid_joypad_axis(void *data,
if (joyaxis == AXIS_NONE)
return 0;
if (AXIS_NEG_GET(joyaxis) < 6)
if (AXIS_NEG_GET(joyaxis) < 11)
{
val += hid->axes[port][AXIS_NEG_GET(joyaxis)];
val += pad_connection_get_axis(&hid->slots[port],
@ -210,7 +210,7 @@ static int16_t iohidmanager_hid_joypad_axis(void *data,
if (val >= 0)
val = 0;
}
else if (AXIS_POS_GET(joyaxis) < 6)
else if (AXIS_POS_GET(joyaxis) < 11)
{
val += hid->axes[port][AXIS_POS_GET(joyaxis)];
val += pad_connection_get_axis(&hid->slots[port],
@ -290,12 +290,16 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
if (tmp->cookie == (IOHIDElementCookie)cookie)
{
CFIndex range = IOHIDElementGetLogicalMax(element) - IOHIDElementGetLogicalMin(element);
CFIndex min = IOHIDElementGetLogicalMin(element);
CFIndex range = IOHIDElementGetLogicalMax(element) - min;
CFIndex val = IOHIDValueGetIntegerValue(value);
if (range == 3)
val *= 2;
if(min == 1)
val--;
switch(val)
{
case 0:
@ -383,6 +387,39 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
break;
}
break;
case kHIDPage_Simulation:
switch (type)
{
case kIOHIDElementTypeInput_Misc:
switch (use)
{
default:
tmp = adapter->axes;
while (tmp && tmp->cookie != (IOHIDElementCookie)cookie)
{
tmp = tmp->next;
}
if (tmp)
{
if (tmp->cookie == (IOHIDElementCookie)cookie)
{
CFIndex min = IOHIDElementGetPhysicalMin(element);
CFIndex state = IOHIDValueGetIntegerValue(value) - min;
CFIndex max = IOHIDElementGetPhysicalMax(element) - min;
float val = (float)state / (float)max;
hid->axes[adapter->slot][tmp->id] =
((val * 2.0f) - 1.0f) * 32767.0f;
}
}
else
pushed_button = 1;
break;
}
break;
}
break;
}
if (pushed_button)
@ -530,6 +567,21 @@ static void iohidmanager_hid_device_add_device(IOHIDDeviceRef device, iohidmanag
/* get device unique id */
uint32_t deviceUniqueId = iohidmanager_hid_device_get_unique_id(device);
static const uint32_t axis_use_ids[11] =
{
kHIDUsage_GD_X,
kHIDUsage_GD_Y,
kHIDUsage_GD_Rx,
kHIDUsage_GD_Ry,
kHIDUsage_GD_Z,
kHIDUsage_GD_Rz,
kHIDUsage_Sim_Rudder,
kHIDUsage_Sim_Throttle,
kHIDUsage_Sim_Steering,
kHIDUsage_Sim_Accelerator,
kHIDUsage_Sim_Brake
};
/* check if pad was already registered previously (by deterministic method)
* if so do not re-add the pad */
@ -548,8 +600,8 @@ static void iohidmanager_hid_device_add_device(IOHIDDeviceRef device, iohidmanag
int count;
CFMutableArrayRef elements;
CFRange range;
bool found_axis[6] =
{ false, false, false, false, false, false };
bool found_axis[11] =
{ false, false, false, false, false, false, false, false, false, false, false };
apple_input_rec_t *tmp = NULL;
apple_input_rec_t *tmpButtons = NULL;
apple_input_rec_t *tmpAxes = NULL;
@ -655,13 +707,11 @@ static void iohidmanager_hid_device_add_device(IOHIDDeviceRef device, iohidmanag
default:
{
uint32_t i = 0;
static const uint32_t axis_use_ids[6] =
{ 48, 49, 51, 52, 50, 53 };
while (i < 6 && axis_use_ids[i] != use)
while (i < 11 && axis_use_ids[i] != use)
i++;
if (i < 6)
if (i < 11)
{
apple_input_rec_t *axis = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
@ -711,6 +761,47 @@ static void iohidmanager_hid_device_add_device(IOHIDDeviceRef device, iohidmanag
break;
}
break;
case kHIDPage_Simulation:
switch (use)
{
default:
{
uint32_t i = 0;
while (i < 11 && axis_use_ids[i] != use)
i++;
if (i < 11)
{
apple_input_rec_t *axis = (apple_input_rec_t *)malloc(sizeof(apple_input_rec_t));
axis->id = i;
axis->cookie = (IOHIDElementCookie)cookie;
axis->next = NULL;
if (iohidmanager_check_for_id(adapter->axes,i))
{
/* axis ID already exists, save to tmp for appending later */
if (tmpAxes)
iohidmanager_append_record(tmpAxes, axis);
else
tmpAxes = axis;
}
else
{
found_axis[axis->id] = true;
if (adapter->axes)
iohidmanager_append_record(adapter->axes, axis);
else
adapter->axes = axis;
}
}
else
detected_button = 1;
}
break;
}
break;
}
if (detected_button)
@ -738,7 +829,7 @@ static void iohidmanager_hid_device_add_device(IOHIDDeviceRef device, iohidmanag
}
/* take care of buttons/axes with duplicate 'use' values */
for (i = 0; i < 6; i++)
for (i = 0; i < 11; i++)
{
if (found_axis[i] == false && tmpAxes)
{

View File

@ -6406,6 +6406,7 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_QT_LOG,
"Log"
)
#ifdef HAVE_QT
MSG_HASH(
MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
"Escaneo Terminado.<br><br>\n"
@ -6416,6 +6417,7 @@ MSG_HASH(
"<li>reiniciar RetroArch si actualizaste algo con el \"Actualizador en línea\"</li></ul>\n"
"Por último, el contenido debe coincidir las bases de datos existente de <a href=\"https://docs.libretro.com/guides/roms-playlists-thumbnails/#sources\">aquí</a>. Si aún no funciona, considere <a href=\"https://www.github.com/libretro/RetroArch/issues\">enviar un reporte de error.</a>"
)
#endif
MSG_HASH(
MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
"No mostrar esto de nuevo"
@ -7163,4 +7165,4 @@ MSG_HASH(
MSG_HASH(
MENU_ENUM_LABEL_VALUE_QT_DELETE,
"Borrar"
)
)

View File

@ -3488,6 +3488,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_CUSTOM,
"カスタム...")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_TITLE,
"設定")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_TOOLS,
"ツール(&T)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP,
"ヘルプ(&H)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT,
@ -3534,6 +3536,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_WARNING,
"警告")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ERROR,
"エラー")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR,
"ネットワークエラー")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
"変更はRetroArchを再起動した後に反映されます。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOG,
@ -3564,6 +3568,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
"ファイルは空きです。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
"ファイルを読み込みのために開けません。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_WRITE_OPEN_FAILED,
"ファイルを書き込みのために開けません。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
"ファイルは存在しません。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SUGGEST_LOADED_CORE_FIRST,
@ -3656,6 +3662,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_QUESTION,
"質問")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE,
"ファイル削除に失敗しました。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_RENAME_FILE,
"ファイルの名前変更に失敗しました。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_GATHERING_LIST_OF_FILES,
"ファイルの一覧を構築しています...")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADDING_FILES_TO_PLAYLIST,
@ -3696,3 +3704,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
"プレイリストエントリーを更新するに失敗しました。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
"必須フィールドがすべて入力されていることを確認してください。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY,
"RetroArchをアップデート (nightly)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED,
"更新に成功しました。変更を適用にするには、RetroArchを再起動する必要があります。")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
"更新に失敗しました。")

View File

@ -12,7 +12,7 @@ MSG_HASH(
)
MSG_HASH(
MSG_UNKNOWN_NETPLAY_COMMAND_RECEIVED,
"Otrzymano nieznane polecenie gry internetwoej"
"Otrzymano nieznane polecenie gry sieciowej"
)
MSG_HASH(
MSG_FILE_ALREADY_EXISTS_SAVING_TO_BACKUP_BUFFER,
@ -52,7 +52,7 @@ MSG_HASH(
)
MSG_HASH(
MSG_NETPLAY_YOU_HAVE_JOINED_WITH_INPUT_DEVICES_S,
"Dołączyłeś do urządzeń wejściowych %.*s"
"Dołączyłeś z urządzeniami wejściowymi %.*s"
)
MSG_HASH(
MSG_NETPLAY_PLAYER_S_LEFT,
@ -64,23 +64,23 @@ MSG_HASH(
)
MSG_HASH(
MSG_NETPLAY_S_HAS_JOINED_WITH_INPUT_DEVICES_S,
"%.*s dołączył do urządzeń wejściowych %.*s"
"%.*s dołączył z urządzeniami wejściowymi %.*s"
)
MSG_HASH(
MSG_NETPLAY_NOT_RETROARCH,
"Próba połączenia online nie powiodła się, ponieważ peer nie działa w trybie RetroArch lub działa w starej wersji RetroArch."
"Próba połączenia online nie powiodła się, ponieważ peer nie działa w trybie RetroArch lub używa starej wersji RetroArch."
)
MSG_HASH(
MSG_NETPLAY_OUT_OF_DATE,
"Grający online, peer ma starą wersję RetroArch. Nie można połączyć."
"Grający online korzysta ze starej wersji RetroArch. Nie można połączyć."
)
MSG_HASH(
MSG_NETPLAY_DIFFERENT_VERSIONS,
"OSTRZEŻENIE: Grający w online ma inną wersję RetroArch. Jeśli wystąpią problemy, użyj tej samej wersji."
"OSTRZEŻENIE: Grający online korzysta z innej wersji RetroArch. Jeśli wystąpią problemy, użyjcie tej samej wersji."
)
MSG_HASH(
MSG_NETPLAY_DIFFERENT_CORES,
"Grający w online ma inny rdzeń. Nie można połączyć."
"Grający online korzysta z innego rdzenia. Nie można połączyć."
)
MSG_HASH(
MSG_NETPLAY_DIFFERENT_CORE_VERSIONS,
@ -88,7 +88,7 @@ MSG_HASH(
)
MSG_HASH(
MSG_NETPLAY_ENDIAN_DEPENDENT,
"Ten rdzeń nie obsługuje gry online między architekturami w tych systemach"
"Ten rdzeń nie obsługuje gry online między architekturami tych systemów"
)
MSG_HASH(
MSG_NETPLAY_PLATFORM_DEPENDENT,
@ -120,7 +120,7 @@ MSG_HASH(
)
MSG_HASH(
MSG_NETPLAY_CANNOT_PLAY_NO_SLOTS,
"Nie ma wolnych miejsc dla graczy"
"Brak wolnych miejsc dla graczy"
)
MSG_HASH(
MSG_NETPLAY_CANNOT_PLAY_NOT_AVAILABLE,
@ -132,7 +132,7 @@ MSG_HASH(
)
MSG_HASH(
MSG_NETPLAY_PEER_PAUSED,
"Gre online \"%s\" wstrzymano"
"Gracz \"%s\" wstrzymał grę"
)
MSG_HASH(
MSG_NETPLAY_CHANGED_NICK,
@ -508,7 +508,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT,
"Zamknij treść"
"Zamknij zawartość"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONFIG,
@ -610,7 +610,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER,
MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_SELECTION,
"Wybór bazy danych")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY,
"Usunąć")
"Usuń")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FAVORITES,
"Katalog startowy")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_CONTENT,
@ -622,7 +622,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NONE,
MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND,
"Nie znaleziono katalogu.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS,
"Informacja")
"Szczegóły")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_CYCLE_TRAY_STATUS,
"Status podajnika cyklu dysku")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND,
@ -644,7 +644,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE,
MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE,
"Nadpisz DPI")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
"Sterownik")
"Sterowniki")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN,
"Atrapa rdzenia przy zatrzymaniu rdzenia")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHECK_FOR_MISSING_FIRMWARE,
@ -662,7 +662,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Fałszywy")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
"Maksymalna prędkość")
"Mnożnik prędkości")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FAVORITES_TAB,
"Ulubione")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW,
@ -670,7 +670,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW,
MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE,
"Ogranicz maksymalną prędkość działania")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS,
"Przepustnica klatek")
"Manipulacja klatek")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS,
"Liczniki frontendu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_GAME_SPECIFIC_OPTIONS,
@ -696,7 +696,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP_SCANNING_CONTENT,
MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP_WHAT_IS_A_CORE,
"Co to jest rdzeń?")
MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_LIST_ENABLE,
"Włącz liste historii")
"Włącz listę historii")
MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_TAB,
"Historia")
MSG_HASH(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU,
@ -906,7 +906,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV,
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY,
"Zwolnione tempo")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY,
"Przełącznik opóźnionego ruchu")
"Przełącznik spowolnienia")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS,
"Slot zapisu -")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS,
@ -1092,7 +1092,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES,
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT,
"Odłącz od hosta gry online")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE,
"Włącz gre online")
"Włącz grę online")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT,
"Połącz się z hostem gry online")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST,
@ -1110,7 +1110,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME,
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_PASSWORD,
"Hasło serwera")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_PUBLIC_ANNOUNCE,
"Publicznie ogłosić grę na online")
"Upublicznianie sesji online")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_REQUEST_DEVICE_I,
"Zażądaj urządzenia %u")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_REQUIRE_SLAVES,
@ -1134,7 +1134,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_VOTE,
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NONE,
"Żaden")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NO_PREFERENCE,
"Bez preferencji")
"Brak preferencji")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_START_AS_SPECTATOR,
"Tryb widza gry online")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_STATELESS_MODE,
@ -1218,7 +1218,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_OPTIONAL,
MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY,
"Nakładka")
MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_AUTOLOAD_PREFERRED,
"Automatyczna preferowana nakładka")
"Automatycznie ładuj preferowaną nakładkę")
MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY,
"Nakładka")
MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY,
@ -1236,7 +1236,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_PARENT_DIRECTORY,
MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO,
"Wstrzymaj przy włączonym menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE,
"Nie uruchamiaj się w tle")
"Nie pracuj w tle")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PERFCNT_ENABLE,
"Liczniki wydajności")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB,
@ -1246,7 +1246,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY,
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS,
"Listy odtwarzania")
MSG_HASH(MENU_ENUM_LABEL_VALUE_POINTER_ENABLE,
"Wsparcie dotyku")
"Obsługa dotyku")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PORT,
"Port")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PRESENT,
@ -1256,13 +1256,13 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS,
MSG_HASH(MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH,
"Zamknij RetroArch")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ANALOG,
"Obsługiwany analog")
"Obsługa analog")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_BBFC_RATING,
"Ocena BBFC")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CERO_RATING,
"Ocena CERO")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_COOP,
"Kooperacja wspierana")
"Tryb kooperacji")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CRC32,
"CRC32")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION,
@ -1270,7 +1270,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION,
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DEVELOPER,
"Deweloper")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_EDGE_MAGAZINE_ISSUE,
"Problem z Edge Magazine")
"Problem magazynu Edge")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_EDGE_MAGAZINE_RATING,
"Ocena magazynu Edge")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_EDGE_MAGAZINE_REVIEW,
@ -1284,7 +1284,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ESRB_RATING,
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FAMITSU_MAGAZINE_RATING,
"Ocena magazynu Famitsu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FRANCHISE,
"Franczyzowa")
"Seria")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_GENRE,
"Gatunek muzyczny")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_MD5,
@ -1298,13 +1298,13 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PEGI_RATING,
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PUBLISHER,
"Wydawca")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH,
"Data wydania miesiąca")
"Miesiąc wydania")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR,
"Rok wydania")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RUMBLE,
"Rumble obsługiwane")
"Obsługa wibracji")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SERIAL,
"Seryjny")
"Kod seryjny")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SHA1,
"SHA1")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_START_CONTENT,
@ -1348,11 +1348,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_REQUIRED,
MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_CONTENT,
"Uruchom ponownie")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH,
"Uruchom ponownie RetroArch")
"Uruchom RetroArch ponownie")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME,
"Wznaw")
"Wznów")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME_CONTENT,
"Wznaw zawartość")
"Wznów zawartość")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROKEYBOARD,
"Retro klawiatura")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROPAD,
@ -1370,7 +1370,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS,
MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY,
"Przeglądarka plików")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY,
"Config")
"Konfiguracja")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN,
"Wyświetl ekran startowy")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG,
@ -1380,11 +1380,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES,
MSG_HASH(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES_PLAYLIST,
"Dodaj do ulubionych")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RESET_CORE_ASSOCIATION,
"Resetuj podstawowy rdzeń")
"Zresetuj domyślny rdzeń")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN,
"Idź")
"Uruchom")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_MUSIC,
"Uruchom muzyke")
"Uruchom muzykę")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SAMBA_ENABLE,
"Włącz SAMBA")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY,
@ -1451,8 +1451,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES,
"Pokaż ukryte pliki i foldery")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SHUTDOWN,
"Zamknąć")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO,
"Współczynnik powolnego ruchu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO,
"Współczynnik spowolnienia")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_ENABLED,
"Przejdź do przodu w celu skrócenia czasu oczekiwania")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_FRAMES,
@ -1664,9 +1664,13 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,
"Włącz Companion UI")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT,
"Włącz przy starcie UI Companion")
"Uruchom Companion UI przy włączeniu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE,
"Pasek menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_TOGGLE,
"Uruchom menu okienkowe przy włączeniu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DESKTOP_MENU_ENABLE,
"Włącz menu okienkowe (wymagany restar)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE,
"Nie można odczytać skompresowanego pliku.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UNDO_LOAD_STATE,
@ -1720,7 +1724,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO,
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO,
"Auto. Współczynnik proporcji")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX,
"Współczynnik proporcji")
"Proporcja obrazu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION,
"Wstawianie czarnej klatki")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
@ -1778,7 +1782,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_POLLED,
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ROTATION,
"Obrót")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE,
"Skala okienkowa")
"Skala okna")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER,
"Skala całkowita")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS,
@ -1952,7 +1956,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_RECORDING_SETTINGS,
MSG_HASH(MENU_ENUM_SUBLABEL_ONSCREEN_DISPLAY_SETTINGS,
"Zmień nakładkę ekranu i nakładkę klawiatury oraz ustawienia powiadomień na ekranie.")
MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_THROTTLE_SETTINGS,
"Zmień ustawienia przewijania, przewijania do przodu i spowolnienia.")
"Zmień ustawienia przewijania, przyśpieszania i spowalniania gry.")
MSG_HASH(MENU_ENUM_SUBLABEL_SAVING_SETTINGS,
"Zmień ustawienia zapisu.")
MSG_HASH(MENU_ENUM_SUBLABEL_LOGGING_SETTINGS,
@ -1964,7 +1968,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_USER_SETTINGS,
MSG_HASH(MENU_ENUM_SUBLABEL_PRIVACY_SETTINGS,
"Zmień ustawienia prywatności.")
MSG_HASH(MENU_ENUM_SUBLABEL_MIDI_SETTINGS,
"Zmień ustawienia MIDI.")
"Zmień ustawienia urządzeń MIDI.")
MSG_HASH(MENU_ENUM_SUBLABEL_DIRECTORY_SETTINGS,
"Zmień domyślne katalogi, w których znajdują się pliki.")
MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_SETTINGS,
@ -2258,7 +2262,7 @@ MSG_HASH(MSG_INFLATED_CHECKSUM_DID_NOT_MATCH_CRC32,
MSG_HASH(MSG_INPUT_CHEAT,
"Wejdź w kod")
MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
"Wprowadź nazwe kodu")
"Wprowadź nazwę kodu")
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
"Wprowadź wstępnie ustawioną nazwę pliku")
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
@ -2485,7 +2489,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_AUDIO_SYNC,
"Synchronizuj dźwięk. Zalecana."
"Synchronizuj dźwięk. Zalecane."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_AXIS_THRESHOLD,
@ -2615,9 +2619,9 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PAUSE_NONACTIVE,
MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_DISABLE_COMPOSITION,
"Włącz lub wyłącz kompozycję (tylko system Windows).")
MSG_HASH(MENU_ENUM_SUBLABEL_HISTORY_LIST_ENABLE,
"Włącz lub wyłącz najnowszą listę odtwarzania gier, zdjęć, muzyki i filmów.")
"Włącz lub wyłącz listę najnowszych odtwarzanych, zdjęć, muzyki i filmów.")
MSG_HASH(MENU_ENUM_SUBLABEL_CONTENT_HISTORY_SIZE,
"Ogranicz liczbę wpisów na liście odtwarzania w przypadku gier, zdjęć, muzyki i filmów.")
"Ogranicz liczbę wpisów na liście odtwarzania dla gier, zdjęć, muzyki i filmów.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_UNIFIED_MENU_CONTROLS,
"Zunifikowane sterowanie menu")
MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_UNIFIED_MENU_CONTROLS,
@ -2750,7 +2754,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_FASTFORWARD_RATIO,
"Maksymalna szybkość, z jaką zawartość będzie uruchamiana przy użyciu szybkiego przewijania do przodu (np. 5,0x przy zawartości 60 klatek na sekundę = 300 klatek na sekundę). Jeśli ustawione na 0.0x, współczynnik szybkiego przewijania jest nieograniczony (brak limitu FPS)."
"Maksymalna prędkość odtwarzania zawartości przy użyciu przyśpieszenia (np. 5.0x przy zawartości 60 klatek na sekundę = 300 klatek na sekundę). Ustawienie na 0.0x oznacza brak limitu."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SLOWMOTION_RATIO,
@ -2878,7 +2882,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_AUDIO_DEVICE,
"Zastąp domyślne urządzenie audio używane przez sterownik audio. To zależy od kierowcy."
"Zastąp domyślne urządzenie audio używane przez sterownik. Zależne od sterownika."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_AUDIO_DSP_PLUGIN,
@ -3024,7 +3028,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_ADD_TO_FAVORITES,
MSG_HASH(MENU_ENUM_SUBLABEL_ADD_TO_FAVORITES_PLAYLIST,
"Dodaj wpis do ulubionych.")
MSG_HASH(MENU_ENUM_SUBLABEL_RUN,
"Uruchom zawartość.")
"Uruchom tytuł.")
MSG_HASH(MENU_ENUM_SUBLABEL_MENU_FILE_BROWSER_SETTINGS,
"Dostosowuje ustawienia przeglądarki plików.")
MSG_HASH(
@ -3069,7 +3073,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_ACCOUNTS_LIST,
"Menedżerowie aktualnie skonfigurowali konta."
"Zarządzaj aktualnie skonfigurowanymi kontami."
)
MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_META_REWIND,
"Zarządza ustawieniami przewijania.")
@ -3082,7 +3086,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME,
MSG_HASH(MENU_ENUM_SUBLABEL_CORE_CHEAT_OPTIONS,
"Skonfiguruj kody.")
MSG_HASH(MENU_ENUM_SUBLABEL_SHADER_OPTIONS,
"Skonfiguruj shadery, aby wizualnie powiększyć obraz.")
"Skonfiguruj shadery w celu polepszenia obrazu.")
MSG_HASH(MENU_ENUM_SUBLABEL_CORE_INPUT_REMAPPING_OPTIONS,
"Zmień ustawienia dla aktualnie wyświetlanej treści.")
MSG_HASH(MENU_ENUM_SUBLABEL_CORE_OPTIONS,
@ -3109,9 +3113,9 @@ MSG_HASH(MENU_ENUM_SUBLABEL_THUMBNAILS_DIRECTORY,
MSG_HASH(MENU_ENUM_SUBLABEL_RGUI_CONFIG_DIRECTORY,
"Ustawia katalog początkowy dla przeglądarki konfiguracji menu.")
MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
"Liczba klatek opóźnienia wejściowego dla netplay do wykorzystania do ukrycia opóźnień sieci. Zmniejsza drgania i sprawia, że gra jest mniej intensywna, kosztem zauważalnego opóźnienia wejścia.")
"Liczba klatek opóźnienia wejściowego dla netplay do wykorzystania do ukrycia opóźnień sieci. Zmniejsza drgania i sprawia, że gra jest mniej intensywna, kosztem zauważalnego opóźnienia wejścia.")
MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
"Zakres klatek opóźnień wejściowych, które można wykorzystać do ukrycia opóźnień sieci. Zmniejsza fluktuacje i sprawia, że netplay jest mniej obciążający procesor, kosztem nieprzewidywalnego opóźnienia wejściowego.")
"Zakres klatek opóźnień wejściowych, które można wykorzystać do ukrycia opóźnień sieci. Zmniejsza fluktuacje i sprawia, że netplay jest mniej obciążający procesor, kosztem nieprzewidywalnego opóźnienia wejściowego.")
MSG_HASH(MENU_ENUM_SUBLABEL_DISK_CYCLE_TRAY_STATUS,
"Cykluj bieżący dysk. Jeśli dysk zostanie włożony, wyskoczy. Jeśli dysk nie został włożony, zostanie włożony. ")
MSG_HASH(MENU_ENUM_SUBLABEL_DISK_INDEX,
@ -3271,7 +3275,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_Y,
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_USE_MITM_SERVER,
"Użyj serwera przekaźnikowego")
MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_USE_MITM_SERVER,
"Przekaż połączenia sieciowe przez serwer pośredniczący. Przydatne, jeśli host znajduje sięs za zaporą lub ma problemy z NAT/UPnP.")
"Przekaż połączenia sieciowe przez serwer pośredniczący. Przydatne, jeśli host znajduje się za zaporą lub ma problemy z NAT/UPnP.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_MITM_SERVER,
"Lokalizacja serwera przekaźnikowego")
MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_MITM_SERVER,
@ -3369,7 +3373,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME,
MSG_HASH(MENU_ENUM_SUBLABEL_RENAME_ENTRY,
"Zmień nazwę tytułu.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RENAME_ENTRY,
"Zmień nazwe")
"Zmień nazwę")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
"Pokaż ładowanie rdzenia")
MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,

View File

@ -3642,6 +3642,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
"Por favor, reinicie o programa para que as alterações entrem em vigor.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOG,
"Relatório")
#ifdef HAVE_QT
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
"Verificação Terminada.<br><br>\n"
"Para que o conteúdo seja verificado corretamente, você deve em ordem:\n"
@ -3650,6 +3651,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
"<li>ter a \"Base de Dados\" atualizada via Atualizador Online</li>\n"
"<li>reiniciar o RetroArch caso alguma das situações acima tenha sido feita</li></ul>\n"
"E finalmente, o conteúdo deve corresponder as bases de dados existentes <a href=\"https://docs.libretro.com/guides/roms-playlists-thumbnails/#sources\">aqui</a>. Se ainda não estiver funcionando, considere <a href=\"https://www.github.com/libretro/RetroArch/issues\">enviar um relatório de erro</a>.")
#endif
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
"Não mostrar isto novamente")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_STOP,

View File

@ -3307,7 +3307,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_MIXER_ACTION_VOLUME,
MSG_HASH(MENU_ENUM_SUBLABEL_ADD_TO_MIXER,
"Добавить этот трек в доступный аудио слот. ")
MSG_HASH(MENU_ENUM_SUBLABEL_ADD_TO_MIXER_AND_PLAY,
"Добавить этот трек в доступный аудио слот и воспроизвести его.") // If no slots are currently available, it will be ignored.
"Добавить этот трек в доступный аудио слот и воспроизвести его.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MIXER_ACTION_PLAY,
"Воспроизвести")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MIXER_ACTION_PLAY_LOOPED,
@ -3335,20 +3335,20 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_LATENCY_SETTINGS,
MSG_HASH(MENU_ENUM_SUBLABEL_LATENCY_SETTINGS,
"Изменить настройки относящиеся к задержке видео, аудио и ввода.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_ENABLED,
"Обгон для уменьшения задержки") // Run-Ahead to Reduce Latency
"Обгон для уменьшения задержки")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_FRAMES,
"Количество кадров для обгона")//Number of Frames to Run Ahead
"Количество кадров для обгона")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_SECONDARY_INSTANCE,
"Использовать вторую инстанцию для обгона") //RunAhead Use Second Instance
"Использовать вторую инстанцию для обгона")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN_AHEAD_HIDE_WARNINGS,
"Убрать уведомления об обгоне")//RunAhead Hide Warnings
"Убрать уведомления об обгоне")
MSG_HASH(
MENU_ENUM_SUBLABEL_RUN_AHEAD_ENABLED,
"Обрабатывать логику ядра перед рендером 1 или более кадров для уменьшения задержки ввода." // Run core logic one or more frames ahead then load the state back to reduce perceived input lag.
"Обрабатывать логику ядра перед рендером 1 или более кадров для уменьшения задержки ввода."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_RUN_AHEAD_FRAMES,
"Количество кадров обгона. Может вызвать дрожание при большом значении." // Causes gameplay issues such as jitter if you exceed the number of lag frames internal to the game.
"Количество кадров обгона. Может вызвать дрожание при большом значении."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_RUN_AHEAD_HIDE_WARNINGS,

View File

@ -3770,6 +3770,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_CUSTOM,
"Custom...")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_TITLE,
"Options")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_TOOLS,
"&Tools")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP,
"&Help")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT,
@ -3816,10 +3818,13 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_WARNING,
"Warning")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ERROR,
"Error")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR,
"Network Error")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
"Please restart the program for the changes to take effect.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOG,
"Log")
#ifdef HAVE_QT
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
"Scan Finished.<br><br>\n"
"In order for content to be correctly scanned, you must:\n"
@ -3828,6 +3833,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
"<li>have \"Databases\" updated via Online Updater</li>\n"
"<li>restart RetroArch if any of the above was just done</li></ul>\n"
"Finally, the content must match existing databases from <a href=\"https://docs.libretro.com/guides/roms-playlists-thumbnails/#sources\">here</a>. If it is still not working, consider <a href=\"https://www.github.com/libretro/RetroArch/issues\">submitting a bug report</a>.")
#endif
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
"Don't show this again")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_STOP,
@ -3854,6 +3860,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
"File is empty.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
"Could not open file for reading.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_WRITE_OPEN_FAILED,
"Could not open file for writing.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
"File does not exist.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SUGGEST_LOADED_CORE_FIRST,
@ -4192,6 +4200,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_QUESTION,
"Question")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE,
"Could not delete file.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_RENAME_FILE,
"Could not rename file.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_GATHERING_LIST_OF_FILES,
"Gathering list of files...")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADDING_FILES_TO_PLAYLIST,
@ -4232,3 +4242,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
"Error updating playlist entry.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
"Please fill out all required fields.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY,
"Update RetroArch (nightly)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED,
"RetroArch updated successfully. Please restart the application for the changes to take effect.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
"Update failed.")

View File

@ -348,11 +348,20 @@ end:
if (handle->backend)
{
if (handle->backend->stream_free)
handle->backend->stream_free(handle->stream);
}
{
#ifdef HAVE_7ZIP
if (handle->backend != &sevenzip_backend)
{
handle->backend->stream_free(handle->stream);
if (handle->data)
free(handle->data);
if (handle->data)
free(handle->data);
}
#else
handle->backend->stream_free(handle->stream);
#endif
}
}
}
return ret;
@ -406,7 +415,9 @@ int file_archive_parse_file_iterate(
valid_exts, userdata, file_cb);
if (ret != 1)
{
state->type = ARCHIVE_TRANSFER_DEINIT;
}
if (ret == -1)
state->type = ARCHIVE_TRANSFER_DEINIT_ERROR;

View File

@ -70,7 +70,9 @@ static void *sevenzip_stream_alloc_impl(void *p, size_t size)
static void sevenzip_stream_free_impl(void *p, void *address)
{
(void)p;
free(address);
if (address)
free(address);
}
static void *sevenzip_stream_alloc_tmp_impl(void *p, size_t size)
@ -450,6 +452,8 @@ static int sevenzip_parse_file_iterate_step_internal(
*csize = (uint32_t)compressed_size;
}
}
else
return 0;
*payback = 1;

View File

@ -39,6 +39,8 @@
RETRO_BEGIN_DECLS
struct archive_extract_userdata;
enum file_archive_transfer_type
{
ARCHIVE_TRANSFER_NONE = 0,
@ -96,6 +98,7 @@ typedef struct
char *callback_error;
file_archive_transfer_t archive;
struct archive_extract_userdata *userdata;
} decompress_state_t;
struct archive_extract_userdata

View File

@ -1047,6 +1047,10 @@ typedef int (RETRO_CALLCONV *retro_vfs_close_t)(struct retro_vfs_file_handle *st
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_size_t)(struct retro_vfs_file_handle *stream);
/* Truncate file to specified size. Returns 0 on success or -1 on error
* Introduced in VFS API v2 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_truncate_t)(struct retro_vfs_file_handle *stream, int64_t length);
/* Get the current read / write position for the file. Returns - 1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_tell_t)(struct retro_vfs_file_handle *stream);
@ -1077,6 +1081,7 @@ typedef int (RETRO_CALLCONV *retro_vfs_rename_t)(const char *old_path, const cha
struct retro_vfs_interface
{
/* VFS API v1 */
retro_vfs_get_path_t get_path;
retro_vfs_open_t open;
retro_vfs_close_t close;
@ -1088,6 +1093,8 @@ struct retro_vfs_interface
retro_vfs_flush_t flush;
retro_vfs_remove_t remove;
retro_vfs_rename_t rename;
/* VFS API v2 */
retro_vfs_truncate_t truncate;
};
struct retro_vfs_interface_info
@ -2190,17 +2197,26 @@ struct retro_system_info
* Typically used for a GUI to filter
* out extensions. */
/* If true, retro_load_game() is guaranteed to provide a valid pathname
* in retro_game_info::path.
* ::data and ::size are both invalid.
/* Libretro cores that need to have direct access to their content
* files, including cores which use the path of the content files to
* determine the paths of other files, should set need_fullpath to true.
*
* If false, ::data and ::size are guaranteed to be valid, but ::path
* might not be valid.
* Cores should strive for setting need_fullpath to false,
* as it allows the frontend to perform patching, etc.
*
* This is typically set to true for libretro implementations that must
* load from file.
* Implementations should strive for setting this to false, as it allows
* the frontend to perform patching, etc. */
* If need_fullpath is true and retro_load_game() is called:
* - retro_game_info::path is guaranteed to have a valid path
* - retro_game_info::data and retro_game_info::size are invalid
*
* If need_fullpath is false and retro_load_game() is called:
* - retro_game_info::path may be NULL
* - retro_game_info::data and retro_game_info::size are guaranteed
* to be valid
*
* See also:
* - RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY
* - RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY
*/
bool need_fullpath;
/* If true, the frontend is not allowed to extract any archives before

View File

@ -37,18 +37,20 @@
#include <stdarg.h>
#define FILESTREAM_REQUIRED_VFS_VERSION 1
#define FILESTREAM_REQUIRED_VFS_VERSION 2
RETRO_BEGIN_DECLS
typedef struct RFILE RFILE;
#define FILESTREAM_REQUIRED_VFS_VERSION 1
#define FILESTREAM_REQUIRED_VFS_VERSION 2
void filestream_vfs_init(const struct retro_vfs_interface_info* vfs_info);
int64_t filestream_get_size(RFILE *stream);
int64_t filestream_truncate(RFILE *stream, int64_t length);
/**
* filestream_open:
* @path : path to file

View File

@ -30,6 +30,8 @@
RETRO_BEGIN_DECLS
#ifndef SKIP_STDIO_REDEFINES
#define FILE RFILE
#undef fopen
@ -41,6 +43,7 @@ RETRO_BEGIN_DECLS
#undef fgetc
#undef fwrite
#undef fputc
#undef fflush
#undef fprintf
#undef ferror
#undef feof
@ -54,10 +57,13 @@ RETRO_BEGIN_DECLS
#define fgetc rfgetc
#define fwrite rfwrite
#define fputc rfputc
#define fflush rfflush
#define fprintf rfprintf
#define ferror rferror
#define feof rfeof
#endif
RFILE* rfopen(const char *path, const char *mode);
int rfclose(RFILE* stream);
@ -78,6 +84,8 @@ int64_t rfwrite(void const* buffer,
int rfputc(int character, RFILE * stream);
int64_t rfflush(RFILE * stream);
int rfprintf(RFILE * stream, const char * format, ...);
int rferror(RFILE* stream);

View File

@ -46,6 +46,8 @@ int retro_vfs_file_error_impl(libretro_vfs_implementation_file *stream);
int64_t retro_vfs_file_size_impl(libretro_vfs_implementation_file *stream);
int64_t retro_vfs_file_truncate_impl(libretro_vfs_implementation_file *stream, int64_t length);
int64_t retro_vfs_file_tell_impl(libretro_vfs_implementation_file *stream);
int64_t retro_vfs_file_seek_impl(libretro_vfs_implementation_file *stream, int64_t offset, int seek_position);

View File

@ -69,7 +69,9 @@ void* ssl_socket_init(int fd, const char *domain)
state->domain = domain;
#ifdef DEBUG
mbedtls_debug_set_threshold(DEBUG_LEVEL);
#endif
mbedtls_net_init(&state->net_ctx);
mbedtls_ssl_init(&state->ctx);

View File

@ -41,6 +41,7 @@ static retro_vfs_get_path_t filestream_get_path_cb = NULL;
static retro_vfs_open_t filestream_open_cb = NULL;
static retro_vfs_close_t filestream_close_cb = NULL;
static retro_vfs_size_t filestream_size_cb = NULL;
static retro_vfs_truncate_t filestream_truncate_cb = NULL;
static retro_vfs_tell_t filestream_tell_cb = NULL;
static retro_vfs_seek_t filestream_seek_cb = NULL;
static retro_vfs_read_t filestream_read_cb = NULL;
@ -67,6 +68,7 @@ void filestream_vfs_init(const struct retro_vfs_interface_info* vfs_info)
filestream_close_cb = NULL;
filestream_tell_cb = NULL;
filestream_size_cb = NULL;
filestream_truncate_cb = NULL;
filestream_seek_cb = NULL;
filestream_read_cb = NULL;
filestream_write_cb = NULL;
@ -84,6 +86,7 @@ void filestream_vfs_init(const struct retro_vfs_interface_info* vfs_info)
filestream_open_cb = vfs_iface->open;
filestream_close_cb = vfs_iface->close;
filestream_size_cb = vfs_iface->size;
filestream_truncate_cb = vfs_iface->truncate;
filestream_tell_cb = vfs_iface->tell;
filestream_seek_cb = vfs_iface->seek;
filestream_read_cb = vfs_iface->read;
@ -127,6 +130,21 @@ int64_t filestream_get_size(RFILE *stream)
return output;
}
int64_t filestream_truncate(RFILE *stream, int64_t length)
{
int64_t output;
if (filestream_truncate_cb != NULL)
output = filestream_truncate_cb(stream->hfile, length);
else
output = retro_vfs_file_truncate_impl((libretro_vfs_implementation_file*)stream->hfile, length);
if (output == vfs_error_return_value)
stream->error_flag = true;
return output;
}
/**
* filestream_open:
* @path : path to file

View File

@ -123,6 +123,11 @@ int rfputc(int character, RFILE * stream)
return filestream_putc(stream, character);
}
int64_t rfflush(RFILE * stream)
{
return filestream_flush(stream);
}
int rfprintf(RFILE * stream, const char * format, ...)
{
int result;

View File

@ -380,6 +380,22 @@ int64_t retro_vfs_file_size_impl(libretro_vfs_implementation_file *stream)
return stream->size;
}
int64_t retro_vfs_file_truncate_impl(libretro_vfs_implementation_file *stream, int64_t length)
{
if (!stream)
return -1;
#ifdef _WIN32
if(_chsize(_fileno(stream->fp), length) != 0)
return -1;
#else
if(ftruncate(fileno(stream->fp), length) != 0)
return -1;
#endif
return 0;
}
int64_t retro_vfs_file_tell_impl(libretro_vfs_implementation_file *stream)
{
if (!stream)

View File

@ -197,23 +197,22 @@ bool cheat_manager_save(const char *path, const char *cheat_database, bool overw
for (j = 0; j < 13; j++)
{
unsigned int* data_ptrs[13] = {
&cheat_manager_state.cheats[i].handler,
&cheat_manager_state.cheats[i].memory_search_size,
&cheat_manager_state.cheats[i].cheat_type,
&cheat_manager_state.cheats[i].value,
&cheat_manager_state.cheats[i].address,
&cheat_manager_state.cheats[i].address_mask,
&cheat_manager_state.cheats[i].rumble_type,
&cheat_manager_state.cheats[i].rumble_value ,
&cheat_manager_state.cheats[i].rumble_port,
&cheat_manager_state.cheats[i].rumble_primary_strength,
&cheat_manager_state.cheats[i].rumble_primary_duration,
&cheat_manager_state.cheats[i].rumble_secondary_strength,
&cheat_manager_state.cheats[i].rumble_secondary_duration
} ;
unsigned int* data_ptrs[13] = { NULL};
data_ptrs[0] = &cheat_manager_state.cheats[i].handler;
data_ptrs[1] = &cheat_manager_state.cheats[i].memory_search_size;
data_ptrs[2] = &cheat_manager_state.cheats[i].cheat_type;
data_ptrs[3] = &cheat_manager_state.cheats[i].value;
data_ptrs[4] = &cheat_manager_state.cheats[i].address;
data_ptrs[5] = &cheat_manager_state.cheats[i].address_mask;
data_ptrs[6] = &cheat_manager_state.cheats[i].rumble_type;
data_ptrs[7] = &cheat_manager_state.cheats[i].rumble_value;
data_ptrs[8] = &cheat_manager_state.cheats[i].rumble_port;
data_ptrs[9] = &cheat_manager_state.cheats[i].rumble_primary_strength;
data_ptrs[10] = &cheat_manager_state.cheats[i].rumble_primary_duration;
data_ptrs[11] = &cheat_manager_state.cheats[i].rumble_secondary_strength;
data_ptrs[12] = &cheat_manager_state.cheats[i].rumble_secondary_duration;
key[0] = '\0';
snprintf(key, sizeof(key), keys[j], i);
snprintf(key, sizeof(key), keys[j], i);
config_set_uint(conf, key, *(data_ptrs[j]));
}
@ -330,21 +329,13 @@ bool cheat_manager_load(const char *path, bool append)
for (i = orig_size; i < cheats; i++)
{
unsigned j;
unsigned int* data_ptrs[13] = {
&cheat_manager_state.cheats[i].handler,
&cheat_manager_state.cheats[i].memory_search_size,
&cheat_manager_state.cheats[i].cheat_type,
&cheat_manager_state.cheats[i].value,
&cheat_manager_state.cheats[i].address,
&cheat_manager_state.cheats[i].address_mask,
&cheat_manager_state.cheats[i].rumble_type,
&cheat_manager_state.cheats[i].rumble_value ,
&cheat_manager_state.cheats[i].rumble_port,
&cheat_manager_state.cheats[i].rumble_primary_strength,
&cheat_manager_state.cheats[i].rumble_primary_duration,
&cheat_manager_state.cheats[i].rumble_secondary_strength,
&cheat_manager_state.cheats[i].rumble_secondary_duration
} ;
char desc_key[256];
char code_key[256];
char enable_key[256];
char endian_key[256];
char *tmp = NULL;
bool tmp_bool = false;
unsigned int* data_ptrs[13] = { NULL};
char* keys[13] = {
"cheat%u_handler",
"cheat%u_memory_search_size",
@ -360,12 +351,19 @@ bool cheat_manager_load(const char *path, bool append)
"cheat%u_rumble_secondary_strength",
"cheat%u_rumble_secondary_duration",
};
char desc_key[256];
char code_key[256];
char enable_key[256];
char endian_key[256];
char *tmp = NULL;
bool tmp_bool = false;
data_ptrs[0] = &cheat_manager_state.cheats[i].handler;
data_ptrs[1] = &cheat_manager_state.cheats[i].memory_search_size;
data_ptrs[2] = &cheat_manager_state.cheats[i].cheat_type;
data_ptrs[3] = &cheat_manager_state.cheats[i].value;
data_ptrs[4] = &cheat_manager_state.cheats[i].address;
data_ptrs[5] = &cheat_manager_state.cheats[i].address_mask;
data_ptrs[6] = &cheat_manager_state.cheats[i].rumble_type;
data_ptrs[7] = &cheat_manager_state.cheats[i].rumble_value;
data_ptrs[8] = &cheat_manager_state.cheats[i].rumble_port;
data_ptrs[9] = &cheat_manager_state.cheats[i].rumble_primary_strength;
data_ptrs[10] = &cheat_manager_state.cheats[i].rumble_primary_duration;
data_ptrs[11] = &cheat_manager_state.cheats[i].rumble_secondary_strength;
data_ptrs[12] = &cheat_manager_state.cheats[i].rumble_secondary_duration;
endian_key[0] = desc_key[0] = code_key[0] = enable_key[0] = '\0';
@ -675,14 +673,15 @@ int cheat_manager_initialize_memory(void *data, bool wraparound)
return 0 ;
}
cheat_manager_state.actual_memory_size = meminfo.size ;
cheat_manager_state.curr_memory_buf = meminfo.data ;
cheat_manager_state.total_memory_size = meminfo.size ;
cheat_manager_state.num_matches = (cheat_manager_state.total_memory_size*8)/((int)pow(2,cheat_manager_state.search_bit_size)) ;
//ensure we're aligned on 4-byte boundary
//if ( meminfo.size % 4 > 0 ) {
//cheat_manager_state.total_memory_size = cheat_manager_state.total_memory_size + (4 - (meminfo.size%4)) ;
//}
cheat_manager_state.actual_memory_size = (unsigned)meminfo.size ;
cheat_manager_state.curr_memory_buf = meminfo.data ;
cheat_manager_state.total_memory_size = (unsigned)meminfo.size ;
cheat_manager_state.num_matches = (cheat_manager_state.total_memory_size*8)/((int)pow(2,cheat_manager_state.search_bit_size)) ;
/* Ensure we're aligned on 4-byte boundary */
#if 0
if (meminfo.size % 4 > 0)
cheat_manager_state.total_memory_size = cheat_manager_state.total_memory_size + (4 - (meminfo.size%4)) ;
#endif
if ( is_search_initialization )
{
cheat_manager_state.prev_memory_buf = (uint8_t*) calloc(cheat_manager_state.total_memory_size, sizeof(uint8_t));
@ -810,7 +809,6 @@ int cheat_manager_search(enum cheat_search_type search_type)
unsigned char *curr = cheat_manager_state.curr_memory_buf ;
unsigned char *prev = cheat_manager_state.prev_memory_buf ;
unsigned int idx = 0 ;
unsigned int num_matches = 0 ;
unsigned int curr_val ;
unsigned int prev_val ;
unsigned int mask = 0 ;
@ -827,12 +825,12 @@ int cheat_manager_search(enum cheat_search_type search_type)
cheat_manager_setup_search_meta(cheat_manager_state.search_bit_size, &bytes_per_item, &mask, &bits) ;
//little endian FF000000 = 256
for ( idx = 0 ; idx < cheat_manager_state.total_memory_size ; idx = idx + bytes_per_item)
/* little endian FF000000 = 256 */
for (idx = 0 ; idx < cheat_manager_state.total_memory_size ; idx = idx + bytes_per_item)
{
unsigned byte_part;
switch ( bytes_per_item )
switch (bytes_per_item )
{
case 2 :
{
@ -869,81 +867,53 @@ int cheat_manager_search(enum cheat_search_type search_type)
unsigned int prev_subval = (prev_val >> (byte_part*bits) ) & mask ;
unsigned int prev_match ;
if ( bits < 8 )
{
if (bits < 8 )
prev_match = *(cheat_manager_state.matches+idx) & (mask << (byte_part*bits)) ;
}
else
{
prev_match = *(cheat_manager_state.matches+idx) ;
}
if ( prev_match > 0 )
if (prev_match > 0)
{
bool match = false ;
switch ( search_type )
switch (search_type)
{
case CHEAT_SEARCH_TYPE_EXACT :
{
match = ( curr_subval == cheat_manager_state.search_exact_value) ;
break;
}
case CHEAT_SEARCH_TYPE_LT :
{
match = ( curr_subval < prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_GT :
{
match = ( curr_subval > prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_LTE :
{
match = ( curr_subval <= prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_GTE :
{
match = ( curr_subval >= prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_EQ :
{
match = ( curr_subval == prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_NEQ :
{
match = ( curr_subval != prev_subval) ;
break;
}
case CHEAT_SEARCH_TYPE_EQPLUS :
{
match = ( curr_subval == prev_subval+cheat_manager_state.search_eqplus_value) ;
break;
}
case CHEAT_SEARCH_TYPE_EQMINUS :
{
match = ( curr_subval == prev_subval-cheat_manager_state.search_eqminus_value) ;
break;
}
}
if (!match )
{
if ( bits < 8 )
{
*(cheat_manager_state.matches+idx) = *(cheat_manager_state.matches+idx) &
(( ~(mask << (byte_part*bits))) & 0xFF );
}
else
{
memset(cheat_manager_state.matches+idx,0,bytes_per_item) ;
}
if ( cheat_manager_state.num_matches > 0 )
{
cheat_manager_state.num_matches-- ;
}
}
}
}
@ -1003,36 +973,30 @@ int cheat_manager_add_matches(const char *path,
switch ( bytes_per_item )
{
case 2 :
{
curr_val = cheat_manager_state.big_endian ?
(*(curr+idx)*256) + *(curr+idx+1) :
*(curr+idx) + (*(curr+idx+1)*256) ;
break ;
}
case 4 :
{
curr_val = cheat_manager_state.big_endian ?
(*(curr+idx)*256*256*256) + (*(curr+idx+1)*256*256) + (*(curr+idx+2)*256) + *(curr+idx+3) :
*(curr+idx) + (*(curr+idx+1)*256) + (*(curr+idx+2)*256*256) + (*(curr+idx+3)*256*256*256) ;
break ;
}
case 1 :
default :
{
curr_val = *(curr+idx) ;
break ;
}
}
for (byte_part = 0 ; byte_part < 8/bits ; byte_part++)
{
unsigned int prev_match;
if ( bits < 8 )
if (bits < 8 )
{
prev_match = *(cheat_manager_state.matches+idx) & (mask << (byte_part*bits)) ;
if ( prev_match )
if (prev_match)
{
if ( !cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
cheat_manager_state.big_endian, curr_val) )
{
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true);
@ -1044,10 +1008,10 @@ int cheat_manager_add_matches(const char *path,
else
{
prev_match = *(cheat_manager_state.matches+idx) ;
if ( prev_match )
if (prev_match)
{
if ( !cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, 0xFF,
cheat_manager_state.big_endian, curr_val) )
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, 0xFF,
cheat_manager_state.big_endian, curr_val))
{
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true);
return 0 ;
@ -1074,61 +1038,44 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
{
bool rumble = false ;
switch ( cheat->rumble_type )
switch (cheat->rumble_type)
{
case RUMBLE_TYPE_DISABLED :
{
return ;
}
return;
case RUMBLE_TYPE_CHANGES:
{
rumble = (curr_value != cheat->rumble_prev_value) ;
break ;
}
case RUMBLE_TYPE_DOES_NOT_CHANGE:
{
rumble = (curr_value == cheat->rumble_prev_value) ;
break ;
}
case RUMBLE_TYPE_INCREASE:
{
rumble = (curr_value > cheat->rumble_prev_value) ;
break ;
}
case RUMBLE_TYPE_DECREASE:
{
rumble = (curr_value < cheat->rumble_prev_value) ;
break ;
}
case RUMBLE_TYPE_EQ_VALUE:
{
rumble = (curr_value == cheat->rumble_value) ;
break ;
}
case RUMBLE_TYPE_NEQ_VALUE:
{
rumble = (curr_value != cheat->rumble_value) ;
break ;
}
case RUMBLE_TYPE_LT_VALUE:
{
rumble = (curr_value < cheat->rumble_value) ;
break ;
}
case RUMBLE_TYPE_GT_VALUE:
{
rumble = (curr_value > cheat->rumble_value) ;
break ;
}
}
cheat->rumble_prev_value = curr_value ;
//Give the emulator enough time to initialize, load state, etc
if ( cheat->rumble_initialized > 300)
/* Give the emulator enough time
* to initialize, load state, etc */
if (cheat->rumble_initialized > 300)
{
if ( rumble )
if (rumble)
{
cheat->rumble_primary_end_time = cpu_features_get_time_usec() + (cheat->rumble_primary_duration*1000) ;
cheat->rumble_secondary_end_time = cpu_features_get_time_usec() + (cheat->rumble_secondary_duration*1000) ;
@ -1139,12 +1086,12 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
else
{
cheat->rumble_initialized++ ;
return ;
return;
}
if ( cheat->rumble_primary_end_time <= cpu_features_get_time_usec() )
if (cheat->rumble_primary_end_time <= cpu_features_get_time_usec() )
{
if ( cheat->rumble_primary_end_time != 0 )
if (cheat->rumble_primary_end_time != 0)
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, 0);
cheat->rumble_primary_end_time = 0;
}
@ -1153,9 +1100,9 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
}
if ( cheat->rumble_secondary_end_time <= cpu_features_get_time_usec() )
if (cheat->rumble_secondary_end_time <= cpu_features_get_time_usec())
{
if ( cheat->rumble_secondary_end_time != 0 )
if (cheat->rumble_secondary_end_time != 0)
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, 0);
cheat->rumble_secondary_end_time = 0 ;
}
@ -1172,7 +1119,6 @@ void cheat_manager_apply_retro_cheats(void)
unsigned int bytes_per_item = 1;
unsigned int bits = 8;
unsigned int curr_val = 0;
unsigned int num_added = 0;
bool run_cheat = true;
if ((!cheat_manager_state.cheats))
@ -1187,24 +1133,25 @@ void cheat_manager_apply_retro_cheats(void)
if (cheat_manager_state.cheats[i].handler != CHEAT_HANDLER_TYPE_RETRO || !cheat_manager_state.cheats[i].state)
continue ;
if ( !cheat_manager_state.memory_initialized )
if (!cheat_manager_state.memory_initialized)
cheat_manager_initialize_memory(NULL, false) ;
/* If we're still not initialized, something must have gone wrong - just bail */
if ( !cheat_manager_state.memory_initialized )
/* If we're still not initialized, something
* must have gone wrong - just bail */
if (!cheat_manager_state.memory_initialized)
return;
if ( !run_cheat )
if (!run_cheat)
{
run_cheat = true ;
continue ;
}
cheat_manager_setup_search_meta(cheat_manager_state.cheats[i].memory_search_size, &bytes_per_item, &mask, &bits) ;
curr = cheat_manager_state.curr_memory_buf ;
curr = cheat_manager_state.curr_memory_buf ;
idx = cheat_manager_state.cheats[i].address ;
switch ( bytes_per_item )
switch (bytes_per_item)
{
case 2 :
{
@ -1230,67 +1177,44 @@ void cheat_manager_apply_retro_cheats(void)
cheat_manager_apply_rumble(&cheat_manager_state.cheats[i], curr_val) ;
switch ( cheat_manager_state.cheats[i].cheat_type )
switch (cheat_manager_state.cheats[i].cheat_type )
{
case CHEAT_TYPE_SET_TO_VALUE :
{
set_value = true ;
value_to_set = cheat_manager_state.cheats[i].value ;
break ;
}
case CHEAT_TYPE_INCREASE_VALUE:
{
set_value = true ;
value_to_set = curr_val + cheat_manager_state.cheats[i].value ;
break;
}
case CHEAT_TYPE_DECREASE_VALUE:
{
set_value = true ;
value_to_set = curr_val - cheat_manager_state.cheats[i].value ;
break;
}
case CHEAT_TYPE_RUN_NEXT_IF_EQ:
{
if (!( curr_val == cheat_manager_state.cheats[i].value ))
{
if (!(curr_val == cheat_manager_state.cheats[i].value))
run_cheat = false ;
}
break;
}
case CHEAT_TYPE_RUN_NEXT_IF_NEQ:
{
if (!( curr_val != cheat_manager_state.cheats[i].value ))
{
if (!(curr_val != cheat_manager_state.cheats[i].value ))
run_cheat = false ;
}
break;
}
case CHEAT_TYPE_RUN_NEXT_IF_LT:
{
if (!( cheat_manager_state.cheats[i].value < curr_val))
{
if (!(cheat_manager_state.cheats[i].value < curr_val))
run_cheat = false ;
}
break;
}
case CHEAT_TYPE_RUN_NEXT_IF_GT:
{
if (!( cheat_manager_state.cheats[i].value > curr_val))
{
if (!(cheat_manager_state.cheats[i].value > curr_val))
run_cheat = false ;
}
break;
}
}
if ( set_value )
if (set_value)
{
switch ( bytes_per_item )
switch (bytes_per_item)
{
case 2 :
{
if ( cheat_manager_state.cheats[i].big_endian)
if (cheat_manager_state.cheats[i].big_endian)
{
*(curr+idx) = (value_to_set >> 8) & 0xFF ;
*(curr+idx+1) = value_to_set & 0xFF ;
@ -1302,10 +1226,8 @@ void cheat_manager_apply_retro_cheats(void)
}
break ;
}
case 4 :
{
if ( cheat_manager_state.cheats[i].big_endian)
if (cheat_manager_state.cheats[i].big_endian)
{
*(curr+idx) = (value_to_set >> 24) & 0xFF ;
*(curr+idx+1) = (value_to_set >> 16) & 0xFF ;
@ -1321,12 +1243,10 @@ void cheat_manager_apply_retro_cheats(void)
}
break ;
}
case 1 :
{
if ( bits < 8 )
if (bits < 8)
{
unsigned bitpos;
unsigned bitpos;
unsigned char val = *(curr+idx);
for (bitpos = 0 ; bitpos < 8 ; bitpos++)
@ -1345,12 +1265,9 @@ void cheat_manager_apply_retro_cheats(void)
else
*(curr+idx) = value_to_set & 0xFF;
break ;
}
default :
{
*(curr+idx) = value_to_set & 0xFF ;
break ;
}
}
}
}
@ -1358,7 +1275,6 @@ void cheat_manager_apply_retro_cheats(void)
void cheat_manager_match_action(enum cheat_match_action_type match_action, unsigned int target_match_idx, unsigned int *address, unsigned int *address_mask,
unsigned int *prev_value, unsigned int *curr_value)
{
bool refresh = false;
unsigned int byte_part;
unsigned int idx;
unsigned int start_idx;
@ -1371,111 +1287,99 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
unsigned char *prev = cheat_manager_state.prev_memory_buf ;
unsigned int curr_match_idx = 0;
if ( target_match_idx > cheat_manager_state.num_matches-1)
if (target_match_idx > cheat_manager_state.num_matches-1)
return;
if ( curr == NULL )
if (curr == NULL )
return ;
cheat_manager_setup_search_meta(cheat_manager_state.search_bit_size, &bytes_per_item, &mask, &bits);
if ( match_action == CHEAT_MATCH_ACTION_TYPE_BROWSE)
if (match_action == CHEAT_MATCH_ACTION_TYPE_BROWSE)
start_idx = *address ;
else
start_idx = 0 ;
for (idx = start_idx ; idx < cheat_manager_state.total_memory_size ; idx = idx + bytes_per_item)
{
switch ( bytes_per_item )
switch (bytes_per_item )
{
case 2 :
{
curr_val = cheat_manager_state.big_endian ?
(*(curr+idx)*256) + *(curr+idx+1) :
*(curr+idx) + (*(curr+idx+1)*256) ;
if ( prev != NULL )
if (prev != NULL)
prev_val = cheat_manager_state.big_endian ?
(*(prev+idx)*256) + *(prev+idx+1) :
*(prev+idx) + (*(prev+idx+1)*256) ;
break ;
}
case 4 :
{
curr_val = cheat_manager_state.big_endian ?
(*(curr+idx)*256*256*256) + (*(curr+idx+1)*256*256) + (*(curr+idx+2)*256) + *(curr+idx+3) :
*(curr+idx) + (*(curr+idx+1)*256) + (*(curr+idx+2)*256*256) + (*(curr+idx+3)*256*256*256) ;
if ( prev != NULL )
if (prev != NULL)
prev_val = cheat_manager_state.big_endian ?
(*(prev+idx)*256*256*256) + (*(prev+idx+1)*256*256) + (*(prev+idx+2)*256) + *(prev+idx+3) :
*(prev+idx) + (*(prev+idx+1)*256) + (*(prev+idx+2)*256*256) + (*(prev+idx+3)*256*256*256) ;
break ;
}
case 1 :
default :
{
curr_val = *(curr+idx) ;
if ( prev != NULL )
if (prev != NULL)
prev_val = *(prev+idx) ;
break ;
}
}
if ( match_action == CHEAT_MATCH_ACTION_TYPE_BROWSE)
if (match_action == CHEAT_MATCH_ACTION_TYPE_BROWSE)
{
*curr_value = curr_val ;
*prev_value = prev_val ;
*curr_value = curr_val;
*prev_value = prev_val;
return ;
}
if ( prev == NULL )
return ;
if (!prev)
return;
for (byte_part = 0 ; byte_part < 8/bits ; byte_part++)
{
unsigned int prev_match ;
if ( bits < 8 )
if (bits < 8 )
{
prev_match = *(cheat_manager_state.matches+idx) & (mask << (byte_part*bits)) ;
if ( prev_match )
if (prev_match)
{
if ( target_match_idx == curr_match_idx )
if (target_match_idx == curr_match_idx)
{
switch ( match_action )
switch (match_action)
{
case CHEAT_MATCH_ACTION_TYPE_BROWSE :
return ;
case CHEAT_MATCH_ACTION_TYPE_VIEW :
{
*address = idx ;
*address_mask = (mask << (byte_part*bits)) ;
*curr_value = curr_val ;
*prev_value = prev_val ;
return ;
}
return;
case CHEAT_MATCH_ACTION_TYPE_COPY :
{
if ( !cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
cheat_manager_state.big_endian, curr_val) )
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
cheat_manager_state.big_endian, curr_val) )
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true);
else
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true);
return ;
}
case CHEAT_MATCH_ACTION_TYPE_DELETE :
{
if ( bits < 8 )
if (bits < 8)
*(cheat_manager_state.matches+idx) = *(cheat_manager_state.matches+idx) &
(( ~(mask << (byte_part*bits))) & 0xFF );
(( ~(mask << (byte_part*bits))) & 0xFF );
else
memset(cheat_manager_state.matches+idx,0,bytes_per_item) ;
if ( cheat_manager_state.num_matches > 0 )
cheat_manager_state.num_matches-- ;
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true);
return ;
}
return;
}
return ;
return;
}
curr_match_idx++ ;
}
@ -1483,43 +1387,37 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
else
{
prev_match = *(cheat_manager_state.matches+idx) ;
if ( prev_match )
if (prev_match)
{
if ( target_match_idx == curr_match_idx )
if (target_match_idx == curr_match_idx)
{
switch ( match_action )
switch (match_action)
{
case CHEAT_MATCH_ACTION_TYPE_BROWSE :
return ;
case CHEAT_MATCH_ACTION_TYPE_VIEW :
{
*address = idx ;
*address_mask = 0xFF ;
*curr_value = curr_val ;
*prev_value = prev_val ;
return ;
}
case CHEAT_MATCH_ACTION_TYPE_COPY :
{
if ( !cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, 0xFF,
cheat_manager_state.big_endian, curr_val) )
cheat_manager_state.big_endian, curr_val) )
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true);
else
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true);
return ;
}
case CHEAT_MATCH_ACTION_TYPE_DELETE :
{
if ( bits < 8 )
*(cheat_manager_state.matches+idx) = *(cheat_manager_state.matches+idx) &
(( ~(mask << (byte_part*bits))) & 0xFF );
(( ~(mask << (byte_part*bits))) & 0xFF );
else
memset(cheat_manager_state.matches+idx,0,bytes_per_item) ;
if ( cheat_manager_state.num_matches > 0 )
cheat_manager_state.num_matches-- ;
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true);
return ;
}
}
}
curr_match_idx++ ;

View File

@ -210,9 +210,9 @@ bool cheat_manager_copy_idx_to_working(unsigned idx);
bool cheat_manager_copy_working_to_idx(unsigned idx);
void cheat_manager_load_game_specific_cheats();
void cheat_manager_load_game_specific_cheats(void);
void cheat_manager_save_game_specific_cheats();
void cheat_manager_save_game_specific_cheats(void);
int cheat_manager_initialize_memory(void *data, bool wraparound);
int cheat_manager_search_exact(void *data, bool wraparound);
@ -226,7 +226,7 @@ int cheat_manager_search_eqplus(void *data, bool wraparound);
int cheat_manager_search_eqminus(void *data, bool wraparound);
int cheat_manager_add_matches(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx);
void cheat_manager_apply_retro_cheats() ;
void cheat_manager_apply_retro_cheats(void);
int cheat_manager_search(enum cheat_search_type search_type);
void cheat_manager_match_action(enum cheat_match_action_type match_action, unsigned int target_match_idx, unsigned int *address, unsigned int *address_mask,
unsigned int *prev_value, unsigned int *curr_value);

View File

@ -88,7 +88,7 @@ enum
ACTION_OK_SET_PATH_VIDEO_FILTER,
ACTION_OK_SET_PATH_OVERLAY,
ACTION_OK_SET_DIRECTORY,
ACTION_OK_LOAD_CHEAT_FILE_APPEND,
ACTION_OK_LOAD_CHEAT_FILE_APPEND
};
enum
@ -1409,7 +1409,9 @@ static int generic_action_ok(const char *path,
break;
case ACTION_OK_LOAD_CHEAT_FILE_APPEND:
flush_char = msg_hash_to_str(flush_id);
//cheat_manager_free();
#if 0
cheat_manager_free();
#endif
if (!cheat_manager_load(action_path,true))
goto error;
@ -2886,7 +2888,6 @@ static int action_ok_cheat_delete(const char *path,
{
size_t new_selection_ptr;
char msg[256];
bool refresh = false;
unsigned int new_size = cheat_manager_get_size() - 1;
if( new_size >0 )

View File

@ -5248,7 +5248,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
PARSE_ONLY_UINT, false);
}
//<Inspect Memory At this Address>
/* Inspect Memory At this Address */
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEAT_ADD_NEW_AFTER),
@ -5373,13 +5373,13 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
setting = menu_setting_find(msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_DELETE_MATCH));
if ( setting )
if (setting)
setting->max = cheat_manager_state.num_matches-1;
setting = menu_setting_find(msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_COPY_MATCH));
if ( setting )
if (setting)
setting->max = cheat_manager_state.num_matches-1;
setting = menu_setting_find(msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_BROWSE_MEMORY));
if ( setting )
if (setting)
setting->max = cheat_manager_state.actual_memory_size>0?cheat_manager_state.actual_memory_size-1:0 ;
info->need_refresh = true;
@ -7037,7 +7037,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
if (system)
{
if ( !string_is_empty(system->info.library_name) &&
if (!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
menu_displaylist_parse_settings_enum(menu, info,

View File

@ -8755,14 +8755,14 @@ static bool setting_append_list(
return true;
}
bool menu_setting_free(void *data)
void menu_setting_free(void *data)
{
unsigned values, n;
rarch_setting_t *setting = (rarch_setting_t*)data;
rarch_setting_t **list = &setting;
if (!setting)
return false;
return;
/* Free data which was previously tagged */
for (; setting_get_type(setting) != ST_NONE; (*list = *list + 1))
@ -8771,24 +8771,26 @@ bool menu_setting_free(void *data)
switch (1 << n)
{
case SD_FREE_FLAG_VALUES:
free((void*)setting->values);
if (setting->values)
free((void*)setting->values);
setting->values = NULL;
break;
case SD_FREE_FLAG_NAME:
free((void*)setting->name);
if (setting->name)
free((void*)setting->name);
setting->name = NULL;
break;
case SD_FREE_FLAG_SHORT:
free((void*)setting->short_description);
if (setting->short_description)
free((void*)setting->short_description);
setting->short_description = NULL;
break;
default:
break;
}
free(data);
return true;
if (data)
free(data);
}
static void menu_setting_terminate_last(rarch_setting_t *list, unsigned pos)

View File

@ -162,7 +162,7 @@ void menu_settings_list_current_add_enum_value_idx(
rarch_setting_info_t *list_info,
enum msg_hash_enums enum_idx);
bool menu_setting_free(void *data);
void menu_setting_free(void *data);
bool settings_list_append(rarch_setting_t **list,
rarch_setting_info_t *list_info);

View File

@ -1899,6 +1899,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SHOW_HIDDEN_FILES,
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_ALL_PLAYLISTS_LIST_MAX_COUNT,
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_ALL_PLAYLISTS_GRID_MAX_COUNT,
MENU_ENUM_LABEL_VALUE_QT_MENU_TOOLS,
MENU_ENUM_LABEL_VALUE_QT_MENU_HELP,
MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER,
MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART,
@ -1935,6 +1936,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK,
MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
MENU_ENUM_LABEL_VALUE_QT_FILE_WRITE_OPEN_FAILED,
MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
MENU_ENUM_LABEL_VALUE_QT_ZOOM,
MENU_ENUM_LABEL_VALUE_QT_VIEW,
@ -1948,6 +1950,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST_ITEM,
MENU_ENUM_LABEL_VALUE_QT_QUESTION,
MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE,
MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_RENAME_FILE,
MENU_ENUM_LABEL_VALUE_QT_GATHERING_LIST_OF_FILES,
MENU_ENUM_LABEL_VALUE_QT_ADDING_FILES_TO_PLAYLIST,
MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY,
@ -1969,6 +1972,10 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT,
MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_DOCUMENTATION,
MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR,
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY,
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED,
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
MENU_LABEL(MIDI_INPUT),
MENU_LABEL(MIDI_OUTPUT),
@ -2046,6 +2053,7 @@ enum msg_hash_enums
MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS,
MSG_CHEAT_SEARCH_ADD_MATCH_FAIL,
MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS,
MSG_LAST
};

View File

@ -279,15 +279,17 @@ if [ "$HAVE_QT" != 'no' ] && [ "$MOC_PATH" != 'none' ]; then
check_pkgconf QT5GUI Qt5Gui 5.2
check_pkgconf QT5WIDGETS Qt5Widgets 5.2
check_pkgconf QT5CONCURRENT Qt5Concurrent 5.2
check_pkgconf QT5NETWORK Qt5Network 5.2
#check_pkgconf QT5WEBENGINE Qt5WebEngine 5.4
check_val '' QT5CORE -lQt5Core QT5CORE
check_val '' QT5GUI -lQt5Gui QT5GUI
check_val '' QT5WIDGETS -lQt5Widgets QT5WIDGETS
check_val '' QT5CONCURRENT -lQt5Widgets QT5CONCURRENT
check_val '' QT5CONCURRENT -lQt5Concurrent QT5CONCURRENT
check_val '' QT5NETWORK -lQt5Network QT5NETWORK
#check_val '' QT5WEBENGINE -lQt5WebEngine QT5WEBENGINE
if [ "$HAVE_QT5CORE" = "no" ] || [ "$HAVE_QT5GUI" = "no" ] || [ "$HAVE_QT5WIDGETS" = "no" ] || [ "$HAVE_QT5CONCURRENT" = "no" ]; then
if [ "$HAVE_QT5CORE" = "no" ] || [ "$HAVE_QT5GUI" = "no" ] || [ "$HAVE_QT5WIDGETS" = "no" ] || [ "$HAVE_QT5CONCURRENT" = "no" ] || [ "$HAVE_QT5NETWORK" = "no" ]; then
die : 'Notice: Not building Qt support, required libraries were not found.'
HAVE_QT=no
else

View File

@ -97,7 +97,7 @@ static int file_decompressed(const char *name, const char *valid_exts,
path[0] = '\0';
/* Ignore directories. */
if ( name[strlen(name) - 1] == '/' ||
if ( name[strlen(name) - 1] == '/' ||
name[strlen(name) - 1] == '\\')
goto next_file;
@ -152,6 +152,8 @@ static void task_decompress_handler_finished(retro_task_t *task,
free(dec->subdir);
if (dec->valid_ext)
free(dec->valid_ext);
if (dec->userdata)
free(dec->userdata);
free(dec->target_dir);
free(dec);
}
@ -160,18 +162,17 @@ static void task_decompress_handler(retro_task_t *task)
{
int ret;
bool retdec = false;
struct archive_extract_userdata userdata = {{0}};
decompress_state_t *dec = (decompress_state_t*)
task->state;
userdata.dec = dec;
strlcpy(userdata.archive_path,
dec->source_file, sizeof(userdata.archive_path));
dec->userdata->dec = dec;
strlcpy(dec->userdata->archive_path,
dec->source_file, sizeof(dec->userdata->archive_path));
ret = file_archive_parse_file_iterate(
&dec->archive,
&retdec, dec->source_file,
dec->valid_ext, file_decompressed, &userdata);
dec->valid_ext, file_decompressed, dec->userdata);
task_set_progress(task,
file_archive_parse_file_progress(&dec->archive));
@ -189,16 +190,15 @@ static void task_decompress_handler_target_file(retro_task_t *task)
{
bool retdec;
int ret;
struct archive_extract_userdata userdata = {{0}};
decompress_state_t *dec = (decompress_state_t*)
task->state;
strlcpy(userdata.archive_path,
dec->source_file, sizeof(userdata.archive_path));
strlcpy(dec->userdata->archive_path,
dec->source_file, sizeof(dec->userdata->archive_path));
ret = file_archive_parse_file_iterate(&dec->archive,
&retdec, dec->source_file,
dec->valid_ext, file_decompressed_target_file, &userdata);
dec->valid_ext, file_decompressed_target_file, dec->userdata);
task_set_progress(task,
file_archive_parse_file_progress(&dec->archive));
@ -217,17 +217,16 @@ static void task_decompress_handler_subdir(retro_task_t *task)
int ret;
bool retdec;
decompress_state_t *dec = (decompress_state_t*)task->state;
struct archive_extract_userdata userdata = {{0}};
userdata.dec = dec;
strlcpy(userdata.archive_path,
dec->userdata->dec = dec;
strlcpy(dec->userdata->archive_path,
dec->source_file,
sizeof(userdata.archive_path));
sizeof(dec->userdata->archive_path));
ret = file_archive_parse_file_iterate(
&dec->archive,
&retdec, dec->source_file,
dec->valid_ext, file_decompressed_subdir, &userdata);
dec->valid_ext, file_decompressed_subdir, dec->userdata);
task_set_progress(task,
file_archive_parse_file_progress(&dec->archive));
@ -332,6 +331,7 @@ bool task_push_decompress(
s->valid_ext = valid_ext ? strdup(valid_ext) : NULL;
s->archive.type = ARCHIVE_TRANSFER_INIT;
s->userdata = (struct archive_extract_userdata*)calloc(1, sizeof(*s->userdata));
t = (retro_task_t*)calloc(1, sizeof(*t));
@ -367,6 +367,10 @@ bool task_push_decompress(
error:
if (s)
{
if (s->userdata)
free(s->userdata);
free(s);
}
return false;
}

View File

@ -35,6 +35,7 @@
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QtConcurrentRun>
#include <QtNetwork>
#include "../ui_qt.h"
#include "ui_qt_load_core_window.h"
@ -56,10 +57,12 @@ extern "C" {
#include "../../../content.h"
#include "../../../menu/menu_driver.h"
#include "../../../tasks/tasks_internal.h"
#include "../../../config.def.h"
#include <string/stdstring.h>
#include <encodings/utf.h>
#include <file/file_path.h>
#include <file/archive_file.h>
#include <streams/file_stream.h>
#include <math.h>
}
@ -81,6 +84,10 @@ extern "C" {
#define KATAKANA_START 0x30A1U
#define KATAKANA_END 0x30F6U
#define HIRA_KATA_OFFSET (KATAKANA_START - HIRAGANA_START)
#define USER_AGENT "RetroArch-WIMP/1.0"
#define DOCS_URL "http://docs.libretro.com/"
#define PARTIAL_EXTENSION ".partial"
#define TEMP_EXTENSION ".update_tmp"
static ui_window_qt_t ui_window = {0};
@ -908,6 +915,10 @@ MainWindow::MainWindow(QWidget *parent) :
,m_allPlaylistsGridMaxCount(0)
,m_playlistEntryDialog(NULL)
,m_statusMessageElapsedTimer()
,m_networkManager(new QNetworkAccessManager(this))
,m_updateProgressDialog(new QProgressDialog())
,m_updateFile()
,m_updateReply()
{
settings_t *settings = config_get_ptr();
QDir playlistDir(settings->paths.directory_playlist);
@ -927,6 +938,8 @@ MainWindow::MainWindow(QWidget *parent) :
qRegisterMetaType<QPointer<ThumbnailWidget> >("ThumbnailWidget");
m_updateProgressDialog->cancel();
m_gridProgressWidget = new QWidget();
gridProgressLabel = new QLabel(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PROGRESS), m_gridProgressWidget);
@ -1146,6 +1159,8 @@ MainWindow::MainWindow(QWidget *parent) :
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
resizeDocks(QList<QDockWidget*>() << m_searchDock, QList<int>() << 1, Qt::Vertical);
#endif
removeUpdateTempFiles();
}
MainWindow::~MainWindow()
@ -1160,6 +1175,31 @@ MainWindow::~MainWindow()
removeGridItems();
}
void MainWindow::removeUpdateTempFiles()
{
/* a QDir with no path means the current working directory */
QDir dir;
QStringList dirList = dir.entryList(QStringList(), QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System, QDir::Name);
int i;
for (i = 0; i < dirList.count(); i++)
{
QString path(dir.path() + "/" + dirList.at(i));
QFile file(path);
if (path.endsWith(TEMP_EXTENSION))
{
QByteArray pathArray = path.toUtf8();
const char *pathData = pathArray.constData();
if (file.remove())
RARCH_LOG("[Qt]: removed temporary update file %s\n", pathData);
else
RARCH_LOG("[Qt]: could not remove temporary update file %s\n", pathData);
}
}
}
void MainWindow::onPlaylistFilesDropped(QStringList files)
{
addFilesToPlaylist(files);
@ -1215,7 +1255,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
if (currentPlaylistPath == ALL_PLAYLISTS_TOKEN)
{
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
return;
}
@ -1239,7 +1279,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
if (selectedName.isEmpty() || selectedPath.isEmpty() ||
selectedDatabase.isEmpty())
{
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
return;
}
@ -1269,7 +1309,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
else if (files.count() == 1)
{
/* If adding a single file, tell user that it doesn't exist. */
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
return;
}
}
@ -1469,11 +1509,11 @@ void MainWindow::showWelcomeScreen()
"Documentation for RetroArch, libretro and cores:<br>\n"
"<a href=\"https://docs.libretro.com/\">https://docs.libretro.com/</a>");
if (!ui_window.qtWindow->settings()->value("show_welcome_screen", true).toBool())
if (!m_settings->value("show_welcome_screen", true).toBool())
return;
if (!ui_window.qtWindow->showMessageBox(welcomeText, MainWindow::MSGBOX_TYPE_INFO, Qt::ApplicationModal))
ui_window.qtWindow->settings()->setValue("show_welcome_screen", false);
if (!showMessageBox(welcomeText, MainWindow::MSGBOX_TYPE_INFO, Qt::ApplicationModal))
m_settings->setValue("show_welcome_screen", false);
}
@ -1784,7 +1824,7 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
if (!updateCurrentPlaylistEntry(contentHash))
{
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
return;
}
}
@ -1966,12 +2006,12 @@ void MainWindow::onPlaylistWidgetContextMenuRequested(const QPoint&)
{
if (currentPlaylistFile.exists())
{
if (ui_window.qtWindow->showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST)).arg(selectedItem->text()), MainWindow::MSGBOX_TYPE_QUESTION, Qt::ApplicationModal, false))
if (showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST)).arg(selectedItem->text()), MainWindow::MSGBOX_TYPE_QUESTION, Qt::ApplicationModal, false))
{
if (currentPlaylistFile.remove())
reloadPlaylists();
else
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
}
}
}
@ -2823,7 +2863,7 @@ void MainWindow::deleteCurrentPlaylistItem()
if (!ok)
return;
if (!ui_window.qtWindow->showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST_ITEM)).arg(contentHash["label"]), MainWindow::MSGBOX_TYPE_QUESTION, Qt::ApplicationModal, false))
if (!showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST_ITEM)).arg(contentHash["label"]), MainWindow::MSGBOX_TYPE_QUESTION, Qt::ApplicationModal, false))
return;
playlist = playlist_init(playlistData, COLLECTION_SIZE);
@ -4587,7 +4627,313 @@ void MainWindow::showAbout()
void MainWindow::showDocs()
{
QDesktopServices::openUrl(QUrl("http://docs.libretro.com/"));
QDesktopServices::openUrl(QUrl(DOCS_URL));
}
void MainWindow::onUpdateNetworkError(QNetworkReply::NetworkError code)
{
QNetworkReply *reply = m_updateReply.data();
QByteArray errorStringArray;
const char *errorStringData = NULL;
m_updateProgressDialog->reset();
if (!reply)
return;
errorStringArray = reply->errorString().toUtf8();
errorStringData = errorStringArray.constData();
RARCH_ERR("[Qt]: Network error code %d received: %s\n", code, errorStringData);
/* Deleting the reply here seems to cause a strange heap-use-after-free crash. */
/*
reply->disconnect();
reply->abort();
reply->deleteLater();
*/
}
void MainWindow::onUpdateNetworkSslErrors(const QList<QSslError> &errors)
{
QNetworkReply *reply = m_updateReply.data();
int i;
if (!reply)
return;
for (i = 0; i < errors.count(); i++)
{
const QSslError &error = errors.at(i);
QString string = QString("Ignoring SSL error code ") + QString::number(error.error()) + ": " + error.errorString();
QByteArray stringArray = string.toUtf8();
const char *stringData = stringArray.constData();
RARCH_ERR("[Qt]: %s\n", stringData);
}
/* ignore all SSL errors for now, like self-signed, expired etc. */
reply->ignoreSslErrors();
}
void MainWindow::onUpdateDownloadCanceled()
{
m_updateProgressDialog->reset();
}
void MainWindow::onRetroArchUpdateDownloadFinished()
{
QNetworkReply *reply = m_updateReply.data();
QNetworkReply::NetworkError error;
int code;
m_updateProgressDialog->reset();
if (!reply)
return;
error = reply->error();
code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (m_updateFile.isOpen())
m_updateFile.close();
if (code != 200)
{
showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR)) + ": HTTP Code " + QString::number(code), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
RARCH_ERR("[Qt]: RetroArch update failed with HTTP status code: %d\n", code);
reply->disconnect();
reply->abort();
reply->deleteLater();
return;
}
if (error == QNetworkReply::NoError)
{
int index = m_updateFile.fileName().lastIndexOf(PARTIAL_EXTENSION);
QString newFileName = m_updateFile.fileName().left(index);
QFile newFile(newFileName);
/* rename() requires the old file to be deleted first if it exists */
if (newFile.exists() && !newFile.remove())
RARCH_ERR("[Qt]: RetroArch update finished, but old file could not be deleted.\n");
else
{
if (!m_updateFile.rename(newFileName))
RARCH_ERR("[Qt]: RetroArch update finished, but temp file could not be renamed.\n");
else
{
RARCH_LOG("[Qt]: RetroArch update finished downloading successfully.\n");
extractArchive(newFileName);
}
}
}
else
{
QByteArray errorArray = reply->errorString().toUtf8();
const char *errorData = errorArray.constData();
RARCH_ERR("[Qt]: RetroArch update ended prematurely: %s\n", errorData);
showMessageBox(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR)) + ": Code " + QString::number(code) + ": " + errorData, MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
}
reply->disconnect();
reply->close();
reply->deleteLater();
}
static void extractCB(void *task_data, void *user_data, const char *err)
{
decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
MainWindow *mainwindow = (MainWindow*)user_data;
if (err)
RARCH_ERR("%s", err);
if (dec)
{
if (filestream_exists(dec->source_file))
filestream_delete(dec->source_file);
free(dec->source_file);
free(dec);
}
mainwindow->onUpdateRetroArchFinished(string_is_empty(err));
}
void MainWindow::onUpdateRetroArchFinished(bool success)
{
m_updateProgressDialog->reset();
if (!success)
{
RARCH_ERR("[Qt]: RetroArch update failed.\n");
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
return;
}
RARCH_LOG("[Qt]: RetroArch update finished successfully.\n");
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED), MainWindow::MSGBOX_TYPE_INFO, Qt::ApplicationModal, false);
}
int MainWindow::extractArchive(QString path)
{
QByteArray pathArray = path.toUtf8();
const char *file = pathArray.constData();
file_archive_transfer_t state;
struct archive_extract_userdata userdata;
struct string_list *file_list = file_archive_get_file_list(file, NULL);
bool returnerr = true;
unsigned i;
if (!file_list || file_list->size == 0)
{
showMessageBox("Error: Archive is empty.", MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
RARCH_ERR("[Qt]: Downloaded archive is empty?\n");
return -1;
}
for (i = 0; i < file_list->size; i++)
{
QFile fileObj(file_list->elems[i].data);
if (fileObj.exists())
{
if (!fileObj.remove())
{
/* if we cannot delete the existing file to update it, rename it for now and delete later */
QFile fileTemp(fileObj.fileName() + TEMP_EXTENSION);
if (fileTemp.exists())
{
if (!fileTemp.remove())
{
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
RARCH_ERR("[Qt]: Could not delete file: %s\n", file_list->elems[i].data);
return -1;
}
}
if (!fileObj.rename(fileTemp.fileName()))
{
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_RENAME_FILE), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
RARCH_ERR("[Qt]: Could not rename file: %s\n", file_list->elems[i].data);
return -1;
}
}
}
}
string_list_free(file_list);
memset(&state, 0, sizeof(state));
memset(&userdata, 0, sizeof(userdata));
state.type = ARCHIVE_TRANSFER_INIT;
m_updateProgressDialog->setWindowModality(Qt::NonModal);
m_updateProgressDialog->setMinimumDuration(0);
m_updateProgressDialog->setRange(0, 0);
m_updateProgressDialog->setAutoClose(true);
m_updateProgressDialog->setAutoReset(true);
m_updateProgressDialog->setValue(0);
m_updateProgressDialog->setLabelText(QString(msg_hash_to_str(MSG_EXTRACTING)) + "...");
m_updateProgressDialog->setCancelButtonText(QString());
m_updateProgressDialog->show();
if (!task_push_decompress(file, ".",
NULL, NULL, NULL,
extractCB, this))
{
m_updateProgressDialog->reset();
return -1;
}
return returnerr;
}
void MainWindow::onUpdateDownloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
QNetworkReply *reply = m_updateReply.data();
int progress = (bytesReceived / (float)bytesTotal) * 100.0f;
if (!reply)
return;
m_updateProgressDialog->setValue(progress);
}
void MainWindow::onUpdateDownloadReadyRead()
{
QNetworkReply *reply = m_updateReply.data();
if (!reply)
return;
m_updateFile.write(reply->readAll());
}
void MainWindow::updateRetroArchNightly()
{
QUrl url(QUrl(buildbot_server_url).resolved(QUrl("../RetroArch_update.zip")));
QNetworkRequest request(url);
QNetworkReply *reply = NULL;
QByteArray urlArray = url.toString().toUtf8();
const char *urlData = urlArray.constData();
if (m_updateFile.isOpen())
{
RARCH_ERR("[Qt]: File is already open.\n");
return;
}
else
{
QString fileName = QFileInfo(url.toString()).fileName() + PARTIAL_EXTENSION;
QByteArray fileNameArray = fileName.toUtf8();
const char *fileNameData = fileNameArray.constData();
m_updateFile.setFileName(fileName);
if (!m_updateFile.open(QIODevice::WriteOnly))
{
showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_WRITE_OPEN_FAILED), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
RARCH_ERR("[Qt]: Could not open file for writing: %s\n", fileNameData);
return;
}
}
RARCH_LOG("[Qt]: Starting update of RetroArch...\n");
RARCH_LOG("[Qt]: Downloading URL %s\n", urlData);
request.setHeader(QNetworkRequest::UserAgentHeader, USER_AGENT);
m_updateProgressDialog->setWindowModality(Qt::NonModal);
m_updateProgressDialog->setMinimumDuration(0);
m_updateProgressDialog->setRange(0, 100);
m_updateProgressDialog->setAutoClose(true);
m_updateProgressDialog->setAutoReset(true);
m_updateProgressDialog->setValue(0);
m_updateProgressDialog->setLabelText(QString(msg_hash_to_str(MSG_DOWNLOADING)) + "...");
m_updateProgressDialog->setCancelButtonText(tr("Cancel"));
m_updateProgressDialog->show();
m_updateReply = m_networkManager->get(request);
reply = m_updateReply.data();
/* make sure any previous connection is removed first */
disconnect(m_updateProgressDialog, SIGNAL(canceled()), reply, SLOT(abort()));
disconnect(m_updateProgressDialog, SIGNAL(canceled()), m_updateProgressDialog, SLOT(reset()));
connect(m_updateProgressDialog, SIGNAL(canceled()), reply, SLOT(abort()));
connect(m_updateProgressDialog, SIGNAL(canceled()), m_updateProgressDialog, SLOT(reset()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onUpdateNetworkError(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(sslErrors(const QList<QSslError>&)), this, SLOT(onUpdateNetworkSslErrors(const QList<QSslError>&)));
connect(reply, SIGNAL(finished()), this, SLOT(onRetroArchUpdateDownloadFinished()));
connect(reply, SIGNAL(readyRead()), this, SLOT(onUpdateDownloadReadyRead()));
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(onUpdateDownloadProgress(qint64, qint64)));
}
const QPixmap getInvader()

View File

@ -224,6 +224,8 @@ static void* ui_companion_qt_init(void)
QMenu *editMenu = NULL;
QMenu *viewMenu = NULL;
QMenu *viewClosedDocksMenu = NULL;
QMenu *toolsMenu = NULL;
QMenu *updaterMenu = NULL;
QMenu *helpMenu = NULL;
QRect desktopRect;
QDockWidget *thumbnailDock = NULL;
@ -323,6 +325,11 @@ static void* ui_companion_qt_init(void)
viewMenu->addSeparator();
viewMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS), mainwindow->viewOptionsDialog(), SLOT(showDialog()));
toolsMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_TOOLS));
updaterMenu = toolsMenu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER));
#ifdef Q_OS_WIN
updaterMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_NIGHTLY), mainwindow, SLOT(updateRetroArchNightly()));
#endif
helpMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP));
helpMenu->addAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_DOCUMENTATION)), mainwindow, SLOT(showDocs()));
helpMenu->addAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT)) + "...", mainwindow, SLOT(showAbout()));

View File

@ -35,6 +35,8 @@
#include <QPointer>
#include <QProgressBar>
#include <QElapsedTimer>
#include <QSslError>
#include <QNetworkReply>
extern "C" {
#include <retro_assert.h>
@ -67,6 +69,9 @@ class QScrollArea;
class QSlider;
class QDragEnterEvent;
class QDropEvent;
class QNetworkAccessManager;
class QNetworkReply;
class QProgressDialog;
class LoadCoreWindow;
class MainWindow;
class ThumbnailWidget;
@ -392,6 +397,8 @@ public slots:
void onFileDropWidgetContextMenuRequested(const QPoint &pos);
void showAbout();
void showDocs();
void updateRetroArchNightly();
void onUpdateRetroArchFinished(bool success);
private slots:
void onLoadCoreClicked(const QStringList &extensionFilters = QStringList());
@ -423,6 +430,12 @@ private slots:
void onGridItemDoubleClicked();
void onGridItemClicked();
void onPlaylistFilesDropped(QStringList files);
void onUpdateNetworkError(QNetworkReply::NetworkError code);
void onUpdateNetworkSslErrors(const QList<QSslError> &errors);
void onRetroArchUpdateDownloadFinished();
void onUpdateDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void onUpdateDownloadReadyRead();
void onUpdateDownloadCanceled();
private:
void setCurrentCoreLabel();
@ -433,6 +446,8 @@ private:
void loadImageDeferred(GridItem *item, QString path);
void calcGridItemSize(GridItem *item, int zoomValue);
bool updateCurrentPlaylistEntry(const QHash<QString, QString> &contentHash);
int extractArchive(QString path);
void removeUpdateTempFiles();
QVector<QHash<QString, QString> > getPlaylistItems(QString pathString);
LoadCoreWindow *m_loadCoreWindow;
@ -493,6 +508,10 @@ private:
int m_allPlaylistsGridMaxCount;
PlaylistEntryDialog *m_playlistEntryDialog;
QElapsedTimer m_statusMessageElapsedTimer;
QNetworkAccessManager *m_networkManager;
QProgressDialog *m_updateProgressDialog;
QFile m_updateFile;
QPointer<QNetworkReply> m_updateReply;
protected:
void closeEvent(QCloseEvent *event);