blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
721
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 5
91
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 321
values | visit_date
timestamp[ns]date 2016-08-12 09:31:09
2023-09-06 10:45:07
| revision_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| github_id
int64 426
681M
| star_events_count
int64 101
243k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[ns]date 2012-06-28 18:51:49
2023-09-14 21:59:16
⌀ | gha_created_at
timestamp[ns]date 2008-02-11 22:55:26
2023-08-10 11:14:58
⌀ | gha_language
stringclasses 147
values | src_encoding
stringclasses 26
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 6
10.2M
| extension
stringclasses 115
values | filename
stringlengths 3
113
| content
stringlengths 6
10.2M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8b88bc6e91faed2c588657ca236c8c0fd218e9a5
|
d4810a0952986737223ca91458aa9770e5f2fc38
|
/audio/windows/openal-soft-1.18.2/Alc/nfcfilter.c
|
758863c93208cca0c2e54cbb922b8aa2d244c289
|
[
"LGPL-2.0-only",
"BSD-2-Clause"
] |
permissive
|
g3n/engine
|
8bad54ec41bcffd84995bb141c7c015f37c3f381
|
b5c63e94be77871a78a9062f816b90d3af58b6c1
|
refs/heads/master
| 2023-08-10T17:02:06.427340
| 2022-06-18T15:04:41
| 2022-06-18T15:06:54
| 84,232,188
| 2,590
| 315
|
BSD-2-Clause
| 2023-06-09T12:50:46
| 2017-03-07T18:25:09
|
Go
|
UTF-8
|
C
| false
| false
| 11,200
|
c
|
nfcfilter.c
|
#include "config.h"
#include "nfcfilter.h"
#include "alu.h"
/* Near-field control filters are the basis for handling the near-field effect.
* The near-field effect is a bass-boost present in the directional components
* of a recorded signal, created as a result of the wavefront curvature (itself
* a function of sound distance). Proper reproduction dictates this be
* compensated for using a bass-cut given the playback speaker distance, to
* avoid excessive bass in the playback.
*
* For real-time rendered audio, emulating the near-field effect based on the
* sound source's distance, and subsequently compensating for it at output
* based on the speaker distances, can create a more realistic perception of
* sound distance beyond a simple 1/r attenuation.
*
* These filters do just that. Each one applies a low-shelf filter, created as
* the combination of a bass-boost for a given sound source distance (near-
* field emulation) along with a bass-cut for a given control/speaker distance
* (near-field compensation).
*
* Note that it is necessary to apply a cut along with the boost, since the
* boost alone is unstable in higher-order ambisonics as it causes an infinite
* DC gain (even first-order ambisonics requires there to be no DC offset for
* the boost to work). Consequently, ambisonics requires a control parameter to
* be used to avoid an unstable boost-only filter. NFC-HOA defines this control
* as a reference delay, calculated with:
*
* reference_delay = control_distance / speed_of_sound
*
* This means w0 (for input) or w1 (for output) should be set to:
*
* wN = 1 / (reference_delay * sample_rate)
*
* when dealing with NFC-HOA content. For FOA input content, which does not
* specify a reference_delay variable, w0 should be set to 0 to apply only
* near-field compensation for output. It's important that w1 be a finite,
* positive, non-0 value or else the bass-boost will become unstable again.
* Also, w0 should not be too large compared to w1, to avoid excessively loud
* low frequencies.
*/
static const float B[4][3] = {
{ 0.0f },
{ 1.0f },
{ 3.0f, 3.0f },
{ 3.6778f, 6.4595f, 2.3222f },
/*{ 4.2076f, 11.4877f, 5.7924f, 9.1401f }*/
};
void NfcFilterCreate1(NfcFilter *nfc, const float w0, const float w1)
{
float b_00, g_0;
float r;
memset(nfc, 0, sizeof(*nfc));
nfc->g = 1.0f;
nfc->coeffs[0] = 1.0f;
/* Calculate bass-boost coefficients. */
r = 0.5f * w0;
b_00 = B[1][0] * r;
g_0 = 1.0f + b_00;
nfc->coeffs[0] *= g_0;
nfc->coeffs[1] = (2.0f * b_00) / g_0;
/* Calculate bass-cut coefficients. */
r = 0.5f * w1;
b_00 = B[1][0] * r;
g_0 = 1.0f + b_00;
nfc->g /= g_0;
nfc->coeffs[0] /= g_0;
nfc->coeffs[1+1] = (2.0f * b_00) / g_0;
}
void NfcFilterAdjust1(NfcFilter *nfc, const float w0)
{
float b_00, g_0;
float r;
r = 0.5f * w0;
b_00 = B[1][0] * r;
g_0 = 1.0f + b_00;
nfc->coeffs[0] = nfc->g * g_0;
nfc->coeffs[1] = (2.0f * b_00) / g_0;
}
void NfcFilterUpdate1(NfcFilter *nfc, ALfloat *restrict dst, const float *restrict src, const int count)
{
const float b0 = nfc->coeffs[0];
const float a0 = nfc->coeffs[1];
const float a1 = nfc->coeffs[2];
float z1 = nfc->history[0];
int i;
for(i = 0;i < count;i++)
{
float out = src[i] * b0;
float y;
y = out - (a1*z1);
out = y + (a0*z1);
z1 += y;
dst[i] = out;
}
nfc->history[0] = z1;
}
void NfcFilterCreate2(NfcFilter *nfc, const float w0, const float w1)
{
float b_10, b_11, g_1;
float r;
memset(nfc, 0, sizeof(*nfc));
nfc->g = 1.0f;
nfc->coeffs[0] = 1.0f;
/* Calculate bass-boost coefficients. */
r = 0.5f * w0;
b_10 = B[2][0] * r;
b_11 = B[2][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->coeffs[0] *= g_1;
nfc->coeffs[1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[2] = (4.0f * b_11) / g_1;
/* Calculate bass-cut coefficients. */
r = 0.5f * w1;
b_10 = B[2][0] * r;
b_11 = B[2][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->g /= g_1;
nfc->coeffs[0] /= g_1;
nfc->coeffs[2+1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[2+2] = (4.0f * b_11) / g_1;
}
void NfcFilterAdjust2(NfcFilter *nfc, const float w0)
{
float b_10, b_11, g_1;
float r;
r = 0.5f * w0;
b_10 = B[2][0] * r;
b_11 = B[2][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->coeffs[0] = nfc->g * g_1;
nfc->coeffs[1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[2] = (4.0f * b_11) / g_1;
}
void NfcFilterUpdate2(NfcFilter *nfc, ALfloat *restrict dst, const float *restrict src, const int count)
{
const float b0 = nfc->coeffs[0];
const float a00 = nfc->coeffs[1];
const float a01 = nfc->coeffs[2];
const float a10 = nfc->coeffs[3];
const float a11 = nfc->coeffs[4];
float z1 = nfc->history[0];
float z2 = nfc->history[1];
int i;
for(i = 0;i < count;i++)
{
float out = src[i] * b0;
float y;
y = out - (a10*z1) - (a11*z2);
out = y + (a00*z1) + (a01*z2);
z2 += z1;
z1 += y;
dst[i] = out;
}
nfc->history[0] = z1;
nfc->history[1] = z2;
}
void NfcFilterCreate3(NfcFilter *nfc, const float w0, const float w1)
{
float b_10, b_11, g_1;
float b_00, g_0;
float r;
memset(nfc, 0, sizeof(*nfc));
nfc->g = 1.0f;
nfc->coeffs[0] = 1.0f;
/* Calculate bass-boost coefficients. */
r = 0.5f * w0;
b_10 = B[3][0] * r;
b_11 = B[3][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->coeffs[0] *= g_1;
nfc->coeffs[1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[2] = (4.0f * b_11) / g_1;
b_00 = B[3][2] * r;
g_0 = 1.0f + b_00;
nfc->coeffs[0] *= g_0;
nfc->coeffs[2+1] = (2.0f * b_00) / g_0;
/* Calculate bass-cut coefficients. */
r = 0.5f * w1;
b_10 = B[3][0] * r;
b_11 = B[3][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->g /= g_1;
nfc->coeffs[0] /= g_1;
nfc->coeffs[3+1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[3+2] = (4.0f * b_11) / g_1;
b_00 = B[3][2] * r;
g_0 = 1.0f + b_00;
nfc->g /= g_0;
nfc->coeffs[0] /= g_0;
nfc->coeffs[3+2+1] = (2.0f * b_00) / g_0;
}
void NfcFilterAdjust3(NfcFilter *nfc, const float w0)
{
float b_10, b_11, g_1;
float b_00, g_0;
float r;
r = 0.5f * w0;
b_10 = B[3][0] * r;
b_11 = B[3][1] * r * r;
g_1 = 1.0f + b_10 + b_11;
nfc->coeffs[0] = nfc->g * g_1;
nfc->coeffs[1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[2] = (4.0f * b_11) / g_1;
b_00 = B[3][2] * r;
g_0 = 1.0f + b_00;
nfc->coeffs[0] *= g_0;
nfc->coeffs[2+1] = (2.0f * b_00) / g_0;
}
void NfcFilterUpdate3(NfcFilter *nfc, ALfloat *restrict dst, const float *restrict src, const int count)
{
const float b0 = nfc->coeffs[0];
const float a00 = nfc->coeffs[1];
const float a01 = nfc->coeffs[2];
const float a02 = nfc->coeffs[3];
const float a10 = nfc->coeffs[4];
const float a11 = nfc->coeffs[5];
const float a12 = nfc->coeffs[6];
float z1 = nfc->history[0];
float z2 = nfc->history[1];
float z3 = nfc->history[2];
int i;
for(i = 0;i < count;i++)
{
float out = src[i] * b0;
float y;
y = out - (a10*z1) - (a11*z2);
out = y + (a00*z1) + (a01*z2);
z2 += z1;
z1 += y;
y = out - (a12*z3);
out = y + (a02*z3);
z3 += y;
dst[i] = out;
}
nfc->history[0] = z1;
nfc->history[1] = z2;
nfc->history[2] = z3;
}
#if 0 /* Original methods the above are derived from. */
static void NfcFilterCreate(NfcFilter *nfc, const ALsizei order, const float src_dist, const float ctl_dist, const float rate)
{
static const float B[4][5] = {
{ },
{ 1.0f },
{ 3.0f, 3.0f },
{ 3.6778f, 6.4595f, 2.3222f },
{ 4.2076f, 11.4877f, 5.7924f, 9.1401f }
};
float w0 = SPEEDOFSOUNDMETRESPERSEC / (src_dist * rate);
float w1 = SPEEDOFSOUNDMETRESPERSEC / (ctl_dist * rate);
ALsizei i;
float r;
nfc->g = 1.0f;
nfc->coeffs[0] = 1.0f;
/* NOTE: Slight adjustment from the literature to raise the center
* frequency a bit (0.5 -> 1.0).
*/
r = 1.0f * w0;
for(i = 0; i < (order-1);i += 2)
{
float b_10 = B[order][i ] * r;
float b_11 = B[order][i+1] * r * r;
float g_1 = 1.0f + b_10 + b_11;
nfc->b[i] = b_10;
nfc->b[i + 1] = b_11;
nfc->coeffs[0] *= g_1;
nfc->coeffs[i+1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[i+2] = (4.0f * b_11) / g_1;
}
if(i < order)
{
float b_00 = B[order][i] * r;
float g_0 = 1.0f + b_00;
nfc->b[i] = b_00;
nfc->coeffs[0] *= g_0;
nfc->coeffs[i+1] = (2.0f * b_00) / g_0;
}
r = 1.0f * w1;
for(i = 0;i < (order-1);i += 2)
{
float b_10 = B[order][i ] * r;
float b_11 = B[order][i+1] * r * r;
float g_1 = 1.0f + b_10 + b_11;
nfc->g /= g_1;
nfc->coeffs[0] /= g_1;
nfc->coeffs[order+i+1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[order+i+2] = (4.0f * b_11) / g_1;
}
if(i < order)
{
float b_00 = B[order][i] * r;
float g_0 = 1.0f + b_00;
nfc->g /= g_0;
nfc->coeffs[0] /= g_0;
nfc->coeffs[order+i+1] = (2.0f * b_00) / g_0;
}
for(i = 0; i < MAX_AMBI_ORDER; i++)
nfc->history[i] = 0.0f;
}
static void NfcFilterAdjust(NfcFilter *nfc, const float distance)
{
int i;
nfc->coeffs[0] = nfc->g;
for(i = 0;i < (nfc->order-1);i += 2)
{
float b_10 = nfc->b[i] / distance;
float b_11 = nfc->b[i+1] / (distance * distance);
float g_1 = 1.0f + b_10 + b_11;
nfc->coeffs[0] *= g_1;
nfc->coeffs[i+1] = ((2.0f * b_10) + (4.0f * b_11)) / g_1;
nfc->coeffs[i+2] = (4.0f * b_11) / g_1;
}
if(i < nfc->order)
{
float b_00 = nfc->b[i] / distance;
float g_0 = 1.0f + b_00;
nfc->coeffs[0] *= g_0;
nfc->coeffs[i+1] = (2.0f * b_00) / g_0;
}
}
static float NfcFilterUpdate(const float in, NfcFilter *nfc)
{
int i;
float out = in * nfc->coeffs[0];
for(i = 0;i < (nfc->order-1);i += 2)
{
float y = out - (nfc->coeffs[nfc->order+i+1] * nfc->history[i]) -
(nfc->coeffs[nfc->order+i+2] * nfc->history[i+1]) + 1.0e-30f;
out = y + (nfc->coeffs[i+1]*nfc->history[i]) + (nfc->coeffs[i+2]*nfc->history[i+1]);
nfc->history[i+1] += nfc->history[i];
nfc->history[i] += y;
}
if(i < nfc->order)
{
float y = out - (nfc->coeffs[nfc->order+i+1] * nfc->history[i]) + 1.0e-30f;
out = y + (nfc->coeffs[i+1] * nfc->history[i]);
nfc->history[i] += y;
}
return out;
}
#endif
|
f22fe6c942980571fb2d2b7eae7040ea87c1581f
|
f085956afa0ff005e887a079eab410242865d831
|
/thirdparty/mbedtls/library/psa_crypto_cipher.c
|
fafe68b07772f8934ae2a41c43b4b1319804c4d9
|
[
"MIT",
"Apache-2.0",
"GPL-2.0-or-later"
] |
permissive
|
vlang/v
|
844f108863477626a61bd7580a7fb8f3365ec3e5
|
93d54651b5aae1299239d30b1276439d8c142d88
|
refs/heads/master
| 2023-09-01T05:13:11.841452
| 2023-08-31T23:04:58
| 2023-08-31T23:04:58
| 169,677,297
| 38,639
| 3,871
|
MIT
| 2023-09-14T21:45:03
| 2019-02-08T02:57:06
|
V
|
UTF-8
|
C
| false
| false
| 19,599
|
c
|
psa_crypto_cipher.c
|
/*
* PSA cipher driver entry points
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "common.h"
#if defined(MBEDTLS_PSA_CRYPTO_C)
#include <psa_crypto_cipher.h>
#include "psa_crypto_core.h"
#include "psa_crypto_random_impl.h"
#include "mbedtls/cipher.h"
#include "mbedtls/error.h"
#include <string.h>
const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa(
psa_algorithm_t alg,
psa_key_type_t key_type,
size_t key_bits,
mbedtls_cipher_id_t* cipher_id )
{
mbedtls_cipher_mode_t mode;
mbedtls_cipher_id_t cipher_id_tmp;
if( PSA_ALG_IS_AEAD( alg ) )
alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 );
if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) )
{
switch( alg )
{
#if defined(MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER)
case PSA_ALG_STREAM_CIPHER:
mode = MBEDTLS_MODE_STREAM;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CTR)
case PSA_ALG_CTR:
mode = MBEDTLS_MODE_CTR;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CFB)
case PSA_ALG_CFB:
mode = MBEDTLS_MODE_CFB;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_OFB)
case PSA_ALG_OFB:
mode = MBEDTLS_MODE_OFB;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING)
case PSA_ALG_ECB_NO_PADDING:
mode = MBEDTLS_MODE_ECB;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING)
case PSA_ALG_CBC_NO_PADDING:
mode = MBEDTLS_MODE_CBC;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7)
case PSA_ALG_CBC_PKCS7:
mode = MBEDTLS_MODE_CBC;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM_STAR_NO_TAG)
case PSA_ALG_CCM_STAR_NO_TAG:
mode = MBEDTLS_MODE_CCM_STAR_NO_TAG;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CCM)
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CCM, 0 ):
mode = MBEDTLS_MODE_CCM;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_GCM)
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_GCM, 0 ):
mode = MBEDTLS_MODE_GCM;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305)
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CHACHA20_POLY1305, 0 ):
mode = MBEDTLS_MODE_CHACHAPOLY;
break;
#endif
default:
return( NULL );
}
}
else if( alg == PSA_ALG_CMAC )
mode = MBEDTLS_MODE_ECB;
else
return( NULL );
switch( key_type )
{
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_AES)
case PSA_KEY_TYPE_AES:
cipher_id_tmp = MBEDTLS_CIPHER_ID_AES;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ARIA)
case PSA_KEY_TYPE_ARIA:
cipher_id_tmp = MBEDTLS_CIPHER_ID_ARIA;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES)
case PSA_KEY_TYPE_DES:
/* key_bits is 64 for Single-DES, 128 for two-key Triple-DES,
* and 192 for three-key Triple-DES. */
if( key_bits == 64 )
cipher_id_tmp = MBEDTLS_CIPHER_ID_DES;
else
cipher_id_tmp = MBEDTLS_CIPHER_ID_3DES;
/* mbedtls doesn't recognize two-key Triple-DES as an algorithm,
* but two-key Triple-DES is functionally three-key Triple-DES
* with K1=K3, so that's how we present it to mbedtls. */
if( key_bits == 128 )
key_bits = 192;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_CAMELLIA)
case PSA_KEY_TYPE_CAMELLIA:
cipher_id_tmp = MBEDTLS_CIPHER_ID_CAMELLIA;
break;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_CHACHA20)
case PSA_KEY_TYPE_CHACHA20:
cipher_id_tmp = MBEDTLS_CIPHER_ID_CHACHA20;
break;
#endif
default:
return( NULL );
}
if( cipher_id != NULL )
*cipher_id = cipher_id_tmp;
return( mbedtls_cipher_info_from_values( cipher_id_tmp,
(int) key_bits, mode ) );
}
#if defined(MBEDTLS_PSA_BUILTIN_CIPHER)
static psa_status_t psa_cipher_setup(
mbedtls_psa_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer, size_t key_buffer_size,
psa_algorithm_t alg,
mbedtls_operation_t cipher_operation )
{
int ret = 0;
size_t key_bits;
const mbedtls_cipher_info_t *cipher_info = NULL;
psa_key_type_t key_type = attributes->core.type;
(void)key_buffer_size;
mbedtls_cipher_init( &operation->ctx.cipher );
operation->alg = alg;
key_bits = attributes->core.bits;
cipher_info = mbedtls_cipher_info_from_psa( alg, key_type,
key_bits, NULL );
if( cipher_info == NULL )
return( PSA_ERROR_NOT_SUPPORTED );
ret = mbedtls_cipher_setup( &operation->ctx.cipher, cipher_info );
if( ret != 0 )
goto exit;
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES)
if( key_type == PSA_KEY_TYPE_DES && key_bits == 128 )
{
/* Two-key Triple-DES is 3-key Triple-DES with K1=K3 */
uint8_t keys[24];
memcpy( keys, key_buffer, 16 );
memcpy( keys + 16, key_buffer, 8 );
ret = mbedtls_cipher_setkey( &operation->ctx.cipher,
keys,
192, cipher_operation );
}
else
#endif
{
ret = mbedtls_cipher_setkey( &operation->ctx.cipher, key_buffer,
(int) key_bits, cipher_operation );
}
if( ret != 0 )
goto exit;
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7)
switch( alg )
{
case PSA_ALG_CBC_NO_PADDING:
ret = mbedtls_cipher_set_padding_mode( &operation->ctx.cipher,
MBEDTLS_PADDING_NONE );
break;
case PSA_ALG_CBC_PKCS7:
ret = mbedtls_cipher_set_padding_mode( &operation->ctx.cipher,
MBEDTLS_PADDING_PKCS7 );
break;
default:
/* The algorithm doesn't involve padding. */
ret = 0;
break;
}
if( ret != 0 )
goto exit;
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING ||
MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7 */
operation->block_length = ( PSA_ALG_IS_STREAM_CIPHER( alg ) ? 1 :
PSA_BLOCK_CIPHER_BLOCK_LENGTH( key_type ) );
operation->iv_length = PSA_CIPHER_IV_LENGTH( key_type, alg );
exit:
return( mbedtls_to_psa_error( ret ) );
}
psa_status_t mbedtls_psa_cipher_encrypt_setup(
mbedtls_psa_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer, size_t key_buffer_size,
psa_algorithm_t alg )
{
return( psa_cipher_setup( operation, attributes,
key_buffer, key_buffer_size,
alg, MBEDTLS_ENCRYPT ) );
}
psa_status_t mbedtls_psa_cipher_decrypt_setup(
mbedtls_psa_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer, size_t key_buffer_size,
psa_algorithm_t alg )
{
return( psa_cipher_setup( operation, attributes,
key_buffer, key_buffer_size,
alg, MBEDTLS_DECRYPT ) );
}
psa_status_t mbedtls_psa_cipher_set_iv(
mbedtls_psa_cipher_operation_t *operation,
const uint8_t *iv, size_t iv_length )
{
if( iv_length != operation->iv_length )
return( PSA_ERROR_INVALID_ARGUMENT );
return( mbedtls_to_psa_error(
mbedtls_cipher_set_iv( &operation->ctx.cipher,
iv, iv_length ) ) );
}
#if defined(MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING)
/** Process input for which the algorithm is set to ECB mode.
*
* This requires manual processing, since the PSA API is defined as being
* able to process arbitrary-length calls to psa_cipher_update() with ECB mode,
* but the underlying mbedtls_cipher_update only takes full blocks.
*
* \param ctx The mbedtls cipher context to use. It must have been
* set up for ECB.
* \param[in] input The input plaintext or ciphertext to process.
* \param input_length The number of bytes to process from \p input.
* This does not need to be aligned to a block boundary.
* If there is a partial block at the end of the input,
* it is stored in \p ctx for future processing.
* \param output The buffer where the output is written. It must be
* at least `BS * floor((p + input_length) / BS)` bytes
* long, where `p` is the number of bytes in the
* unprocessed partial block in \p ctx (with
* `0 <= p <= BS - 1`) and `BS` is the block size.
* \param output_length On success, the number of bytes written to \p output.
* \c 0 on error.
*
* \return #PSA_SUCCESS or an error from a hardware accelerator
*/
static psa_status_t psa_cipher_update_ecb(
mbedtls_cipher_context_t *ctx,
const uint8_t *input,
size_t input_length,
uint8_t *output,
size_t *output_length )
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
size_t block_size = ctx->cipher_info->block_size;
size_t internal_output_length = 0;
*output_length = 0;
if( input_length == 0 )
{
status = PSA_SUCCESS;
goto exit;
}
if( ctx->unprocessed_len > 0 )
{
/* Fill up to block size, and run the block if there's a full one. */
size_t bytes_to_copy = block_size - ctx->unprocessed_len;
if( input_length < bytes_to_copy )
bytes_to_copy = input_length;
memcpy( &( ctx->unprocessed_data[ctx->unprocessed_len] ),
input, bytes_to_copy );
input_length -= bytes_to_copy;
input += bytes_to_copy;
ctx->unprocessed_len += bytes_to_copy;
if( ctx->unprocessed_len == block_size )
{
status = mbedtls_to_psa_error(
mbedtls_cipher_update( ctx,
ctx->unprocessed_data,
block_size,
output, &internal_output_length ) );
if( status != PSA_SUCCESS )
goto exit;
output += internal_output_length;
*output_length += internal_output_length;
ctx->unprocessed_len = 0;
}
}
while( input_length >= block_size )
{
/* Run all full blocks we have, one by one */
status = mbedtls_to_psa_error(
mbedtls_cipher_update( ctx, input,
block_size,
output, &internal_output_length ) );
if( status != PSA_SUCCESS )
goto exit;
input_length -= block_size;
input += block_size;
output += internal_output_length;
*output_length += internal_output_length;
}
if( input_length > 0 )
{
/* Save unprocessed bytes for later processing */
memcpy( &( ctx->unprocessed_data[ctx->unprocessed_len] ),
input, input_length );
ctx->unprocessed_len += input_length;
}
status = PSA_SUCCESS;
exit:
return( status );
}
#endif /* MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING */
psa_status_t mbedtls_psa_cipher_update(
mbedtls_psa_cipher_operation_t *operation,
const uint8_t *input, size_t input_length,
uint8_t *output, size_t output_size, size_t *output_length )
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
size_t expected_output_size;
if( ! PSA_ALG_IS_STREAM_CIPHER( operation->alg ) )
{
/* Take the unprocessed partial block left over from previous
* update calls, if any, plus the input to this call. Remove
* the last partial block, if any. You get the data that will be
* output in this call. */
expected_output_size =
( operation->ctx.cipher.unprocessed_len + input_length )
/ operation->block_length * operation->block_length;
}
else
{
expected_output_size = input_length;
}
if( output_size < expected_output_size )
return( PSA_ERROR_BUFFER_TOO_SMALL );
#if defined(MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING)
if( operation->alg == PSA_ALG_ECB_NO_PADDING )
{
/* mbedtls_cipher_update has an API inconsistency: it will only
* process a single block at a time in ECB mode. Abstract away that
* inconsistency here to match the PSA API behaviour. */
status = psa_cipher_update_ecb( &operation->ctx.cipher,
input,
input_length,
output,
output_length );
}
else
#endif /* MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING */
{
status = mbedtls_to_psa_error(
mbedtls_cipher_update( &operation->ctx.cipher, input,
input_length, output, output_length ) );
if( *output_length > output_size )
return( PSA_ERROR_CORRUPTION_DETECTED );
}
return( status );
}
psa_status_t mbedtls_psa_cipher_finish(
mbedtls_psa_cipher_operation_t *operation,
uint8_t *output, size_t output_size, size_t *output_length )
{
psa_status_t status = PSA_ERROR_GENERIC_ERROR;
uint8_t temp_output_buffer[MBEDTLS_MAX_BLOCK_LENGTH];
if( operation->ctx.cipher.unprocessed_len != 0 )
{
if( operation->alg == PSA_ALG_ECB_NO_PADDING ||
operation->alg == PSA_ALG_CBC_NO_PADDING )
{
status = PSA_ERROR_INVALID_ARGUMENT;
goto exit;
}
}
status = mbedtls_to_psa_error(
mbedtls_cipher_finish( &operation->ctx.cipher,
temp_output_buffer,
output_length ) );
if( status != PSA_SUCCESS )
goto exit;
if( *output_length == 0 )
; /* Nothing to copy. Note that output may be NULL in this case. */
else if( output_size >= *output_length )
memcpy( output, temp_output_buffer, *output_length );
else
status = PSA_ERROR_BUFFER_TOO_SMALL;
exit:
mbedtls_platform_zeroize( temp_output_buffer,
sizeof( temp_output_buffer ) );
return( status );
}
psa_status_t mbedtls_psa_cipher_abort(
mbedtls_psa_cipher_operation_t *operation )
{
/* Sanity check (shouldn't happen: operation->alg should
* always have been initialized to a valid value). */
if( ! PSA_ALG_IS_CIPHER( operation->alg ) )
return( PSA_ERROR_BAD_STATE );
mbedtls_cipher_free( &operation->ctx.cipher );
return( PSA_SUCCESS );
}
psa_status_t mbedtls_psa_cipher_encrypt(
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
psa_algorithm_t alg,
const uint8_t *iv,
size_t iv_length,
const uint8_t *input,
size_t input_length,
uint8_t *output,
size_t output_size,
size_t *output_length )
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT;
size_t update_output_length, finish_output_length;
status = mbedtls_psa_cipher_encrypt_setup( &operation, attributes,
key_buffer, key_buffer_size,
alg );
if( status != PSA_SUCCESS )
goto exit;
if( iv_length > 0 )
{
status = mbedtls_psa_cipher_set_iv( &operation, iv, iv_length );
if( status != PSA_SUCCESS )
goto exit;
}
status = mbedtls_psa_cipher_update( &operation, input, input_length,
output, output_size,
&update_output_length );
if( status != PSA_SUCCESS )
goto exit;
status = mbedtls_psa_cipher_finish( &operation,
output + update_output_length,
output_size - update_output_length,
&finish_output_length );
if( status != PSA_SUCCESS )
goto exit;
*output_length = update_output_length + finish_output_length;
exit:
if( status == PSA_SUCCESS )
status = mbedtls_psa_cipher_abort( &operation );
else
mbedtls_psa_cipher_abort( &operation );
return( status );
}
psa_status_t mbedtls_psa_cipher_decrypt(
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
psa_algorithm_t alg,
const uint8_t *input,
size_t input_length,
uint8_t *output,
size_t output_size,
size_t *output_length )
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT;
size_t olength, accumulated_length;
status = mbedtls_psa_cipher_decrypt_setup( &operation, attributes,
key_buffer, key_buffer_size,
alg );
if( status != PSA_SUCCESS )
goto exit;
if( operation.iv_length > 0 )
{
status = mbedtls_psa_cipher_set_iv( &operation,
input, operation.iv_length );
if( status != PSA_SUCCESS )
goto exit;
}
status = mbedtls_psa_cipher_update( &operation, input + operation.iv_length,
input_length - operation.iv_length,
output, output_size, &olength );
if( status != PSA_SUCCESS )
goto exit;
accumulated_length = olength;
status = mbedtls_psa_cipher_finish( &operation, output + accumulated_length,
output_size - accumulated_length,
&olength );
if( status != PSA_SUCCESS )
goto exit;
*output_length = accumulated_length + olength;
exit:
if ( status == PSA_SUCCESS )
status = mbedtls_psa_cipher_abort( &operation );
else
mbedtls_psa_cipher_abort( &operation );
return( status );
}
#endif /* MBEDTLS_PSA_BUILTIN_CIPHER */
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
d2ad3d85a0d34d219b6a090c1c30acc6a71387bb
|
e384f5467d8bcfd70845997bcbd68d950e874a61
|
/example/cpp/_util/include/wxutil/wx_include.h
|
6dd665833d6e8dfd23c45e074a4e1a303b2d8f4e
|
[] |
no_license
|
Rabbid76/graphics-snippets
|
ee642f1ed9ceafc6d320e467d3a084d2446d22c2
|
fa187afeabb9630bc1d988304fb5787e95a91385
|
refs/heads/master
| 2023-08-04T04:32:06.884318
| 2023-07-21T09:15:43
| 2023-07-21T09:15:43
| 109,126,544
| 177
| 12
| null | 2023-04-11T20:05:52
| 2017-11-01T12:05:56
|
C++
|
UTF-8
|
C
| false
| false
| 218
|
h
|
wx_include.h
|
#ifndef __WX_INCLUDE__H__
#define __WX_INCLUDE__H__
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#define _CRT_SECURE_NO_WARNINGS
#include <wx/wx.h>
#undef _CRT_SECURE_NO_WARNINGS
#endif
#include "wx/glcanvas.h"
#endif
|
513613e158a25ecb9bafb06c0a49fc7ed00d80f2
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/media/gpu/ipc/common/media_param_traits_macros.h
|
c2db8625505df6d6ff521d9b70b9198b16647dc2
|
[
"BSD-3-Clause"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 1,206
|
h
|
media_param_traits_macros.h
|
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_GPU_IPC_COMMON_MEDIA_PARAM_TRAITS_MACROS_H_
#define MEDIA_GPU_IPC_COMMON_MEDIA_PARAM_TRAITS_MACROS_H_
#include "gpu/config/gpu_info.h"
#include "ipc/ipc_message_macros.h"
#include "media/base/ipc/media_param_traits.h"
#include "media/video/video_decode_accelerator.h"
#include "ui/gfx/ipc/color/gfx_param_traits.h"
#include "ui/gfx/ipc/geometry/gfx_param_traits.h"
IPC_STRUCT_TRAITS_BEGIN(media::VideoDecodeAccelerator::Config)
IPC_STRUCT_TRAITS_MEMBER(profile)
IPC_STRUCT_TRAITS_MEMBER(encryption_scheme)
IPC_STRUCT_TRAITS_MEMBER(cdm_id)
IPC_STRUCT_TRAITS_MEMBER(is_deferred_initialization_allowed)
IPC_STRUCT_TRAITS_MEMBER(overlay_info)
IPC_STRUCT_TRAITS_MEMBER(initial_expected_coded_size)
IPC_STRUCT_TRAITS_MEMBER(supported_output_formats)
IPC_STRUCT_TRAITS_MEMBER(sps)
IPC_STRUCT_TRAITS_MEMBER(pps)
IPC_STRUCT_TRAITS_MEMBER(container_color_space)
IPC_STRUCT_TRAITS_MEMBER(target_color_space)
IPC_STRUCT_TRAITS_MEMBER(hdr_metadata)
IPC_STRUCT_TRAITS_END()
#endif // MEDIA_GPU_IPC_COMMON_MEDIA_PARAM_TRAITS_MACROS_H_
|
c1d08774341a464684af1e1fe3c8145adb547edf
|
88249081640f5fe095f9d248f384852a3ae8e59a
|
/tests/test_roundtrip.c
|
1f6c12d500937630977f368cb9dd015512ff74ff
|
[
"MIT"
] |
permissive
|
ariya/FastLZ
|
4d34ef159a7d2e4c7e536065d88941178435adb6
|
344eb4025f9ae866ebf7a2ec48850f7113a97a42
|
refs/heads/master
| 2023-09-03T16:42:11.559345
| 2023-02-09T21:09:19
| 2023-02-09T21:09:19
| 3,950,365
| 338
| 93
|
NOASSERTION
| 2023-06-09T08:11:29
| 2012-04-06T14:33:00
|
C
|
UTF-8
|
C
| false
| false
| 13,420
|
c
|
test_roundtrip.c
|
/*
FastLZ - Byte-aligned LZ77 compression library
Copyright (C) 2005-2020 Ariya Hidayat <ariya.hidayat@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fastlz.h"
/*
* Workaround for DJGPP to find uint8_t, uint16_t, etc.
*/
#if defined(__MSDOS__) && defined(__GNUC__)
#include <stdint-gcc.h>
#endif
#define LOG
#undef LOG
int compare(const char* name, const uint8_t* a, const uint8_t* b, int size) {
int bad = 0;
int i;
for (i = 0; i < size; ++i) {
if (a[i] != b[i]) {
bad = 1;
printf("Error on %s!\n", name);
printf("Different at index %d: expecting %02x,actual %02x\n", i, a[i], b[i]);
break;
}
}
return bad;
}
#if !defined(__MSDOS__)
#define MAX_FILE_SIZE (100 * 1024 * 1024)
#else
#define MAX_FILE_SIZE (32 * 1024 * 1024)
#endif
/* prototype, implemented in refimpl.c */
void REF_Level1_decompress(const uint8_t* input, int length, uint8_t* output);
void REF_Level2_decompress(const uint8_t* input, int length, uint8_t* output);
/*
Same as test_roundtrip_level1 EXCEPT that the decompression is carried out
using the highly-simplified, unoptimized vanilla reference decompressor.
*/
void test_ref_decompressor_level1(const char* name, const char* file_name) {
#ifdef LOG
printf("Processing %s...\n", name);
#endif
FILE* f = fopen(file_name, "rb");
if (!f) {
printf("Error: can not open %s!\n", file_name);
exit(1);
}
fseek(f, 0L, SEEK_END);
long file_size = ftell(f);
rewind(f);
#ifdef LOG
printf("Size is %ld bytes.\n", file_size);
#endif
if (file_size > MAX_FILE_SIZE) {
fclose(f);
printf("%25s %10ld [skipped, file too big]\n", name, file_size);
return;
}
uint8_t* file_buffer = malloc(file_size);
long read = fread(file_buffer, 1, file_size, f);
fclose(f);
if (read != file_size) {
free(file_buffer);
printf("Error: only read %ld bytes!\n", read);
exit(1);
}
#ifdef LOG
printf("Compressing. Please wait...\n");
#endif
uint8_t* compressed_buffer = malloc(1.05 * file_size);
int compressed_size = fastlz_compress_level(1, file_buffer, file_size, compressed_buffer);
double ratio = (100.0 * compressed_size) / file_size;
#ifdef LOG
printf("Compressing was completed: %ld -> %ld (%.2f%%)\n", file_size, compressed_size, ratio);
#endif
#ifdef LOG
printf("Decompressing. Please wait...\n");
#endif
uint8_t* uncompressed_buffer = malloc(file_size);
if (uncompressed_buffer == NULL) {
printf("%25s %10ld -> %10d (%.2f%%) skipped, can't decompress\n", name, file_size, compressed_size, ratio);
return;
}
memset(uncompressed_buffer, '-', file_size);
REF_Level1_decompress(compressed_buffer, compressed_size, uncompressed_buffer);
#ifdef LOG
printf("Comparing. Please wait...\n");
#endif
int result = compare(file_name, file_buffer, uncompressed_buffer, file_size);
if (result == 1) {
free(uncompressed_buffer);
exit(1);
}
free(file_buffer);
free(compressed_buffer);
free(uncompressed_buffer);
#ifdef LOG
printf("OK.\n");
#else
printf("%25s %10ld -> %10d (%.2f%%)\n", name, file_size, compressed_size, ratio);
#endif
}
/*
Same as test_roundtrip_level2 EXCEPT that the decompression is carried out
using the highly-simplified, unoptimized vanilla reference decompressor.
*/
void test_ref_decompressor_level2(const char* name, const char* file_name) {
#ifdef LOG
printf("Processing %s...\n", name);
#endif
FILE* f = fopen(file_name, "rb");
if (!f) {
printf("Error: can not open %s!\n", file_name);
exit(1);
}
fseek(f, 0L, SEEK_END);
long file_size = ftell(f);
rewind(f);
#ifdef LOG
printf("Size is %ld bytes.\n", file_size);
#endif
if (file_size > MAX_FILE_SIZE) {
fclose(f);
printf("%25s %10ld [skipped, file too big]\n", name, file_size);
return;
}
uint8_t* file_buffer = malloc(file_size);
long read = fread(file_buffer, 1, file_size, f);
fclose(f);
if (read != file_size) {
free(file_buffer);
printf("Error: only read %ld bytes!\n", read);
exit(1);
}
#ifdef LOG
printf("Compressing. Please wait...\n");
#endif
uint8_t* compressed_buffer = malloc(1.05 * file_size);
int compressed_size = fastlz_compress_level(2, file_buffer, file_size, compressed_buffer);
double ratio = (100.0 * compressed_size) / file_size;
#ifdef LOG
printf("Compressing was completed: %ld -> %ld (%.2f%%)\n", file_size, compressed_size, ratio);
#endif
#ifdef LOG
printf("Decompressing. Please wait...\n");
#endif
uint8_t* uncompressed_buffer = malloc(file_size);
if (uncompressed_buffer == NULL) {
printf("%25s %10ld -> %10d (%.2f%%) skipped, can't decompress\n", name, file_size, compressed_size, ratio);
return;
}
memset(uncompressed_buffer, '-', file_size);
/* intentionally mask out the block tag */
compressed_buffer[0] = compressed_buffer[0] & 31;
REF_Level2_decompress(compressed_buffer, compressed_size, uncompressed_buffer);
#ifdef LOG
printf("Comparing. Please wait...\n");
#endif
int result = compare(file_name, file_buffer, uncompressed_buffer, file_size);
if (result == 1) {
free(uncompressed_buffer);
exit(1);
}
free(file_buffer);
free(compressed_buffer);
free(uncompressed_buffer);
#ifdef LOG
printf("OK.\n");
#else
printf("%25s %10ld -> %10d (%.2f%%)\n", name, file_size, compressed_size, ratio);
#endif
}
/*
Read the content of the file.
Compress it first using the Level 1 compressor.
Decompress the output with Level 1 decompressor.
Compare the result with the original file content.
*/
void test_roundtrip_level1(const char* name, const char* file_name) {
#ifdef LOG
printf("Processing %s...\n", name);
#endif
FILE* f = fopen(file_name, "rb");
if (!f) {
printf("Error: can not open %s!\n", file_name);
exit(1);
}
fseek(f, 0L, SEEK_END);
long file_size = ftell(f);
rewind(f);
#ifdef LOG
printf("Size is %ld bytes.\n", file_size);
#endif
if (file_size > MAX_FILE_SIZE) {
fclose(f);
printf("%25s %10ld [skipped, file too big]\n", name, file_size);
return;
}
uint8_t* file_buffer = malloc(file_size);
long read = fread(file_buffer, 1, file_size, f);
fclose(f);
if (read != file_size) {
free(file_buffer);
printf("Error: only read %ld bytes!\n", read);
exit(1);
}
#ifdef LOG
printf("Compressing. Please wait...\n");
#endif
uint8_t* compressed_buffer = malloc(1.05 * file_size);
int compressed_size = fastlz_compress_level(1, file_buffer, file_size, compressed_buffer);
double ratio = (100.0 * compressed_size) / file_size;
#ifdef LOG
printf("Compressing was completed: %ld -> %ld (%.2f%%)\n", file_size, compressed_size, ratio);
#endif
#ifdef LOG
printf("Decompressing. Please wait...\n");
#endif
uint8_t* uncompressed_buffer = malloc(file_size);
if (uncompressed_buffer == NULL) {
printf("%25s %10ld -> %10d (%.2f%%) skipped, can't decompress\n", name, file_size, compressed_size, ratio);
return;
}
memset(uncompressed_buffer, '-', file_size);
fastlz_decompress(compressed_buffer, compressed_size, uncompressed_buffer, file_size);
#ifdef LOG
printf("Comparing. Please wait...\n");
#endif
int result = compare(file_name, file_buffer, uncompressed_buffer, file_size);
if (result == 1) {
free(uncompressed_buffer);
exit(1);
}
free(file_buffer);
free(compressed_buffer);
free(uncompressed_buffer);
#ifdef LOG
printf("OK.\n");
#else
printf("%25s %10ld -> %10d (%.2f%%)\n", name, file_size, compressed_size, ratio);
#endif
}
/*
Read the content of the file.
Compress it first using the Level 2 compressor.
Decompress the output with Level 2 decompressor.
Compare the result with the original file content.
*/
void test_roundtrip_level2(const char* name, const char* file_name) {
#ifdef LOG
printf("Processing %s...\n", name);
#endif
FILE* f = fopen(file_name, "rb");
if (!f) {
printf("Error: can not open %s!\n", file_name);
exit(1);
}
fseek(f, 0L, SEEK_END);
long file_size = ftell(f);
rewind(f);
#ifdef LOG
printf("Size is %ld bytes.\n", file_size);
#endif
if (file_size > MAX_FILE_SIZE) {
fclose(f);
printf("%25s %10ld [skipped, file too big]\n", name, file_size);
return;
}
uint8_t* file_buffer = malloc(file_size);
long read = fread(file_buffer, 1, file_size, f);
fclose(f);
if (read != file_size) {
free(file_buffer);
printf("Error: only read %ld bytes!\n", read);
exit(1);
}
#ifdef LOG
printf("Compressing. Please wait...\n");
#endif
uint8_t* compressed_buffer = malloc(1.05 * file_size);
int compressed_size = fastlz_compress_level(2, file_buffer, file_size, compressed_buffer);
double ratio = (100.0 * compressed_size) / file_size;
#ifdef LOG
printf("Compressing was completed: %ld -> %ld (%.2f%%)\n", file_size, compressed_size, ratio);
#endif
#ifdef LOG
printf("Decompressing. Please wait...\n");
#endif
uint8_t* uncompressed_buffer = malloc(file_size);
if (uncompressed_buffer == NULL) {
free(file_buffer);
free(compressed_buffer);
printf("%25s %10ld -> %10d (%.2f%%) skipped, can't decompress OOM\n", name, file_size, compressed_size, ratio);
exit(1);
return;
}
memset(uncompressed_buffer, '-', file_size);
fastlz_decompress(compressed_buffer, compressed_size, uncompressed_buffer, file_size);
#ifdef LOG
printf("Comparing. Please wait...\n");
#endif
int result = compare(file_name, file_buffer, uncompressed_buffer, file_size);
if (result == 1) {
free(uncompressed_buffer);
exit(1);
}
free(file_buffer);
free(compressed_buffer);
free(uncompressed_buffer);
#ifdef LOG
printf("OK.\n");
#else
printf("%25s %10ld -> %10d (%.2f%%)\n", name, file_size, compressed_size, ratio);
#endif
}
int main(int argc, char** argv) {
const char* default_prefix = "../compression-corpus/";
const char* names[] = {"canterbury/alice29.txt",
"canterbury/asyoulik.txt",
"canterbury/cp.html",
"canterbury/fields.c",
"canterbury/grammar.lsp",
"canterbury/kennedy.xls",
"canterbury/lcet10.txt",
"canterbury/plrabn12.txt",
"canterbury/ptt5",
"canterbury/sum",
"canterbury/xargs.1",
"silesia/dickens",
"silesia/mozilla",
"silesia/mr",
"silesia/nci",
"silesia/ooffice",
"silesia/osdb",
"silesia/reymont",
"silesia/samba",
"silesia/sao",
"silesia/webster",
"silesia/x-ray",
"silesia/xml",
"enwik/enwik8.txt"};
const char* prefix = (argc == 2) ? argv[1] : default_prefix;
const int count = sizeof(names) / sizeof(names[0]);
int i;
printf("Test reference decompressor for Level 1\n\n");
for (i = 0; i < count; ++i) {
const char* name = names[i];
char* filename = malloc(strlen(prefix) + strlen(name) + 1);
strcpy(filename, prefix);
strcat(filename, name);
test_ref_decompressor_level1(name, filename);
free(filename);
}
printf("\n");
printf("Test reference decompressor for Level 2\n\n");
for (i = 0; i < count; ++i) {
const char* name = names[i];
char* filename = malloc(strlen(prefix) + strlen(name) + 1);
strcpy(filename, prefix);
strcat(filename, name);
test_ref_decompressor_level2(name, filename);
free(filename);
}
printf("\n");
printf("Test round-trip for Level 1\n\n");
for (i = 0; i < count; ++i) {
const char* name = names[i];
char* filename = malloc(strlen(prefix) + strlen(name) + 1);
strcpy(filename, prefix);
strcat(filename, name);
test_roundtrip_level1(name, filename);
free(filename);
}
printf("\n");
printf("Test round-trip for Level 2\n\n");
for (i = 0; i < count; ++i) {
const char* name = names[i];
char* filename = malloc(strlen(prefix) + strlen(name) + 1);
strcpy(filename, prefix);
strcat(filename, name);
test_roundtrip_level2(name, filename);
free(filename);
}
printf("\n");
return 0;
}
|
4f84565bbbe5d9efe43c2dd238939ba53b13eba9
|
d2b10e3573c6a106fb431199537b8eb26ca14b29
|
/tests/unit/test_fuzzfailures.c
|
38b4b237d3d4a02a45c48ffc78d460b02057130d
|
[
"MIT"
] |
permissive
|
getsentry/sentry-native
|
51485a2bad5d53210e95f7be11e1f59d35c52702
|
d9e901951ac5ba068e095e54a7d9c59a9330665d
|
refs/heads/master
| 2023-08-28T08:23:44.357073
| 2023-07-31T09:18:44
| 2023-07-31T09:18:44
| 173,787,329
| 324
| 175
|
MIT
| 2023-09-14T12:02:50
| 2019-03-04T17:08:34
|
C
|
UTF-8
|
C
| false
| false
| 1,889
|
c
|
test_fuzzfailures.c
|
#include "sentry_json.h"
#include "sentry_path.h"
#include "sentry_testsupport.h"
#include "sentry_value.h"
#include <string.h>
static void
parse_json_roundtrip(const sentry_path_t *path)
{
// printf("Running %" SENTRY_PATH_PRI "\n", path->path);
size_t buf_len = 0;
char *buf = sentry__path_read_to_buffer(path, &buf_len);
if (!buf) {
return;
}
// parse the incoming json
sentry_value_t value = sentry__value_from_json(buf, buf_len);
sentry_free(buf);
sentry_jsonwriter_t *jw = sentry__jsonwriter_new(NULL);
sentry__jsonwriter_write_value(jw, value);
size_t serialized1_len = 0;
char *serialized1 = sentry__jsonwriter_into_string(jw, &serialized1_len);
sentry_value_decref(value);
value = sentry__value_from_json(serialized1, serialized1_len);
jw = sentry__jsonwriter_new(NULL);
sentry__jsonwriter_write_value(jw, value);
size_t serialized2_len = 0;
char *serialized2 = sentry__jsonwriter_into_string(jw, &serialized2_len);
sentry_value_decref(value);
TEST_CHECK_STRING_EQUAL(serialized1, serialized2);
sentry_free(serialized1);
sentry_free(serialized2);
}
SENTRY_TEST(fuzz_json)
{
// skipping this on android because it does not have access to the fixtures
#if defined(SENTRY_PLATFORM_ANDROID)
SKIP_TEST();
#else
sentry_path_t *path = sentry__path_from_str(__FILE__);
sentry_path_t *dir = sentry__path_dir(path);
sentry__path_free(path);
path = sentry__path_join_str(dir, "../fuzzing-failures/");
sentry__path_free(dir);
size_t items = 0;
const sentry_path_t *p;
sentry_pathiter_t *piter = sentry__path_iter_directory(path);
while ((p = sentry__pathiter_next(piter)) != NULL) {
parse_json_roundtrip(p);
items += 1;
}
TEST_CHECK(items > 0);
sentry__pathiter_free(piter);
sentry__path_free(path);
#endif
}
|
8ad8ea2b7c66d0455fad885f09e9f66805442042
|
21c8a3598e467713ecc72d2ef3106b4b6f6b14e0
|
/test/helper-expand.c
|
e80d1a241b342434de18fc2d01b12bcbd2e22f9d
|
[
"MIT"
] |
permissive
|
davatorium/rofi
|
b129e7dc5d0656d3c005db491829af664eceade1
|
664f1b929706f39bb402e09e2284c9de50b205af
|
refs/heads/next
| 2023-08-16T17:50:01.303076
| 2023-08-15T17:34:11
| 2023-08-15T17:34:11
| 7,715,820
| 8,308
| 673
|
NOASSERTION
| 2023-08-23T20:19:08
| 2013-01-20T11:54:45
|
C
|
UTF-8
|
C
| false
| false
| 4,802
|
c
|
helper-expand.c
|
/*
* rofi
*
* MIT/X11 License
* Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "config.h"
#include "display.h"
#include "rofi-icon-fetcher.h"
#include "rofi.h"
#include "settings.h"
#include "theme.h"
#include "widgets/textbox.h"
#include "xcb-internal.h"
#include "xcb.h"
#include <assert.h>
#include <glib.h>
#include <helper.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <xcb/xcb_ewmh.h>
static int test = 0;
#define TASSERT(a) \
{ \
assert(a); \
printf("Test %i passed (%s)\n", ++test, #a); \
}
#define TASSERTE(a, b) \
{ \
if ((a) == (b)) { \
printf("Test %i passed (%s == %s) (%u == %u)\n", ++test, #a, #b, a, b); \
} else { \
printf("Test %i failed (%s == %s) (%u != %u)\n", ++test, #a, #b, a, b); \
abort(); \
} \
}
ThemeWidget *rofi_theme = NULL;
void rofi_clear_error_messages(void) {}
void rofi_clear_warning_messages(void) {}
uint32_t rofi_icon_fetcher_query(G_GNUC_UNUSED const char *name,
G_GNUC_UNUSED const int size) {
return 0;
}
uint32_t rofi_icon_fetcher_query_advanced(G_GNUC_UNUSED const char *name,
G_GNUC_UNUSED const int wsize,
G_GNUC_UNUSED const int hsize) {
return 0;
}
cairo_surface_t *rofi_icon_fetcher_get(G_GNUC_UNUSED const uint32_t uid) {
return NULL;
}
double textbox_get_estimated_char_height(void) { return 12.0; }
void rofi_view_get_current_monitor(int *width, int *height) {
*width = 1920;
*height = 1080;
}
double textbox_get_estimated_ch(void) { return 9.0; }
gboolean rofi_theme_parse_string(G_GNUC_UNUSED const char *string) { return 0; }
void rofi_add_error_message(G_GNUC_UNUSED GString *msg) {}
void rofi_add_warning_message(G_GNUC_UNUSED GString *msg) {}
int rofi_view_error_dialog(const char *msg, G_GNUC_UNUSED int markup) {
fputs(msg, stderr);
return TRUE;
}
int monitor_active(G_GNUC_UNUSED workarea *mon) { return 0; }
void display_startup_notification(
G_GNUC_UNUSED RofiHelperExecuteContext *context,
G_GNUC_UNUSED GSpawnChildSetupFunc *child_setup,
G_GNUC_UNUSED gpointer *user_data) {}
int main(int argc, char **argv) {
cmd_set_arguments(argc, argv);
if (setlocale(LC_ALL, "") == NULL) {
fprintf(stderr, "Failed to set locale.\n");
return EXIT_FAILURE;
}
/**
* Test some path functions. Not easy as not sure what is right output on
* travis.
*/
// Test if root is preserved.
char *str = rofi_expand_path("/");
TASSERT(strcmp(str, "/") == 0);
g_free(str);
// Test is relative path is preserved.
str = rofi_expand_path("../AUTHORS");
TASSERT(strcmp(str, "../AUTHORS") == 0);
g_free(str);
// Test another one.
str = rofi_expand_path("/bin/false");
TASSERT(strcmp(str, "/bin/false") == 0);
g_free(str);
// See if user paths get expanded in full path.
str = rofi_expand_path("~/");
const char *hd = g_get_home_dir();
TASSERT(strcmp(str, hd) == 0);
g_free(str);
str = rofi_expand_path("~root/");
TASSERT(str[0] == '/');
g_free(str);
}
|
3d43c86f4c756927a91a18097cc51bf8a6129e06
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/board/rtl8720e/src/component/soc/amebalite/fwlib/include/section_config.h
|
93236f863f8937cca660d99dc2892949ea88ddd5
|
[
"GPL-1.0-or-later",
"BSD-3-Clause",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"Apache-2.0"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 5,866
|
h
|
section_config.h
|
/*
* Routines to access hardware
*
* Copyright (c) 2013 Realtek Semiconductor Corp.
*
* This module is a confidential and proprietary property of RealTek and
* possession or use of this module requires written permission of RealTek.
*/
#ifndef _SECTION_CONFIG_H_
#define _SECTION_CONFIG_H_
#include "basic_types.h"
#include "platform_autoconf.h"
#define RAM_VECTOR_TABLE1_SECTION \
SECTION(".ram_vector_table1")
#define RAM_VECTOR_TABLE2_SECTION \
SECTION(".ram_vector_table2")
#define RAM_VECTOR_TABLE3_SECTION \
SECTION(".ram_vector_table3")
//3 //3 Hal Section
#define HAL_ROM_TEXT_SECTION \
SECTION(".hal.rom.text")
#define HAL_ROM_ENTRY_NS_SECTION \
SECTION(".hal.rom.entryns.rodata")
#define SIM_ROM_DATA_SECTION \
SECTION(".sim.rom.rodata")
#define HAL_ROM_DATA_SECTION \
SECTION(".hal.rom.rodata")
#define HAL_ROM_BSS_SECTION \
SECTION(".hal.rom.bss")
#define HAL_ROM_BSS_SECTION_BANK \
SECTION(".hal.rom.bank.bss")
#define BOOT_RAM_TEXT_SECTION \
SECTION(".boot.ram.text")
#define BOOT_RAM_RODATA_SECTION \
SECTION(".boot.rodata")
#define BOOT_RAM_DATA_SECTION \
SECTION(".boot.ram.data")
#define BOOT_RAM_BSS_SECTION \
SECTION(".boot.ram.bss")
#define BOOT_RAM_END_BSS_SECTION \
SECTION(".boot.ram.end.bss")
//3 Shell
#define SHELL_ROM_TEXT_SECTION HAL_ROM_TEXT_SECTION
#define SHELL_ROM_BSS_SECTION HAL_ROM_BSS_SECTION
#define SHELL_ROM_DATA_SECTION HAL_ROM_DATA_SECTION
#define CMD_TABLE_DATA_SECTION \
SECTION(".cmd.table.data")
#define GIT_VER_TABLE_SECTION \
SECTION(".git.ver.data")
//3 Image 1 data
#define IMAGE1_ENTRY_SECTION \
SECTION(".image1.entry.data")
#define IMAGE1_EXPORT_SYMB_SECTION \
SECTION(".image1.export.symb")
#define IMAGE1_VALID_PATTEN_SECTION \
SECTION(".image1.validate.rodata")
#define IMAGE1_DATA_SECTION \
SECTION(".image1.rodata")
#define IMAGE2_VALID_PATTEN_SECTION \
SECTION(".image2.validate.rodata")
//3 SRAM Config Section
#define SRAM_BD_DATA_SECTION \
SECTION(".bdsram.data")
#define SRAM_NOCACHE_DATA_SECTION \
SECTION(".ncsram.data")
#define SRAM_BF_DATA_SECTION \
SECTION(".bfsram.data")
#define IMAGE2_ENTRY_SECTION \
SECTION(".image2.entry.data")
#define SDRAM_DATA_SECTION
#define PSRAM_TEXT_SECTION
#define PSRAM_DATA_SECTION
#define PSRAM_RODATA_SECTION
#define PSRAM_BSS_SECTION
#define PSRAM_HEAP_SECTION
#define TIMESENSITIVE_TEXT_SECTION SECTION(".timesensitive.text")
#define TIMESENSITIVE_DATA_SECTION SECTION(".timesensitive.data")
/* non.dram can put in Flash(No DeepPowerDown) or SRAM after psram disabled, such as pmc code */
#define NON_DRAM_TEXT_SECTION SECTION(".non.dram.text")
/* .sramdram.only means cannot put in Flash, such as flash api, interrupt isr */
#define SRAMDRAM_ONLY_TEXT_SECTION SECTION(".sramdram.only.text")
/* sram only used in pmc flow, such as deepsleep entry when flash deep down or after psram disabled */
#define SRAM_ONLY_TEXT_SECTION SECTION(".sram.only.text")
#define SRAM_ONLY_DATA_SECTION SECTION(".sram.only.data")
#define SBOOT_HEAP_SECTION SECTION(".sboot.heap")
#define IPC_TABLE_DATA_SECTION \
SECTION(".ipc.table.data")
//3 Wlan Section
#define WLAN_ROM_TEXT_SECTION
#define WLAN_ROM_DATA_SECTION
#define WLAN_RAM_MAP_SECTION
#ifdef AMEBAD2_TODO// move wifi code into flash to reduce ram size, revert this when psram or ddr ready
#undef CONFIG_WIFI_CRITICAL_CODE_SECTION
#define CONFIG_WIFI_CRITICAL_CODE_SECTION SECTION(".image2.net.ram.text")
#endif
#define CONFIG_FW_CRITICAL_CODE_SECTION //IMAGE2_RAM_TEXT_SECTION
//3 Apple Section
#define APPLE_ROM_TEXT_SECTION \
SECTION(".apple.rom.text")
#define APPLE_ROM_DATA_SECTION \
SECTION(".apple.rom.rodata")
//3 Libc Section
#define LIBC_ROM_TEXT_SECTION \
SECTION(".libc.rom.text")
#define LIBC_ROM_DATA_SECTION \
SECTION(".libc.rom.rodata")
#define LIBC_HEAP_SECTION \
SECTION(".heap.stdlib")
//3 SSL Section
#define SSL_ROM_TEXT_SECTION \
SECTION(".ssl.rom.text")
#define SSL_ROM_DATA_SECTION \
SECTION(".ssl.rom.rodata")
#define SSL_RAM_MAP_SECTION \
SECTION(".ssl_ram_map")
//OS Section
#define OS_ROM_TEXT_SECTION \
SECTION(".os.rom.text")
#define OS_ROM_DATA_SECTION \
SECTION(".os.rom.rodata")
//FLASH RUN CODE
#define FLASH_BOOT_TEXT_SECTION SECTION(".flashboot.text")
#define IMAGE2_CUSTOM_SIGNATURE SECTION(".img2_custom_signature") /* 32B: for OTA update */
//RDP (read protect area just text)
#define RDP_TEXT_SECTION SECTION(".rdp.ram.text")
#define RDP_DATA_SECTION SECTION(".rdp.ram.data")
#define RETENTION_TEXT_SECTION SECTION(".retention.ram.text")
#define RETENTION_DATA_SECTION SECTION(".retention.ram.data")
#define RETENTION_ENTRY_SECTION SECTION(".retention.entry.data")
/* rom map */
#define ROM_FUNCTION_MAP SECTION(".rommap.data")
/* image3 secure image */
#define IMAGE3_ENTRY_SECTION \
SECTION(".image3.nsc_entry.text")
/*USB_OTG define*/
#define OTG_ROM_TEXT_SECTION
#define START_OTG_RAM_FUN_SECTION
#define START_OTG_RAM_DATA_SECTION
#define OTG_ROM_DATA_SECTION
#endif //_SECTION_CONFIG_H_
|
bbd20edf84ffe1203db848cf134b9e7f9ca180b0
|
76f7459a09acb9be2d52407132f5ff8955627da2
|
/kernels/power10/3/vector_int_macros.h
|
dbd09b6d9affd042c8ad3f7148427f77cc2f7273
|
[
"BSD-3-Clause"
] |
permissive
|
flame/blis
|
448bc0ad139b726188129c5627c304274b41c3c1
|
6dcf7666eff14348e82fbc2750be4b199321e1b9
|
refs/heads/master
| 2023-09-01T14:56:11.920485
| 2023-08-27T19:18:57
| 2023-08-27T19:18:57
| 16,143,904
| 1,696
| 361
|
NOASSERTION
| 2023-08-27T19:18:58
| 2014-01-22T15:58:24
|
C
|
UTF-8
|
C
| false
| false
| 3,155
|
h
|
vector_int_macros.h
|
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name(s) of the copyright holder(s) nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Common include/defines across microkernels
#include "blis.h"
#define PREFETCH1(x, y) __asm__ volatile ("dcbt %0, %1" : : "r" (x), "b" (y) : "memory");
#define LOAD_VECTORS \
ca = (vec_t *) A0; \
rb = (vec_t *) B0;
typedef __vector float fv4sf_t;
typedef __vector double dv4sf_t;
typedef __vector int32_t iv4sf_t;
typedef __vector unsigned char vec_t;
#define SAVE_ACC(v_t, ACC, rs_c, j) \
__builtin_mma_disassemble_acc ( (void *) result, ACC); \
rowC = (v_t *) &C0[j]; \
rowC[0] = alpha_ * result[0] + beta_ * rowC[0]; \
rowC = (v_t *) &C0[rs_c+j]; \
rowC[0] = alpha_ * result[1] + beta_ * rowC[0]; \
rowC = (v_t *) &C0[2*rs_c+j]; \
rowC[0] = alpha_ * result[2] + beta_ * rowC[0] ; \
rowC = (v_t *) &C0[3*rs_c+j]; \
rowC[0] = alpha_ * result[3] + beta_ * rowC[0] ;
#define SAVE_ACC_bz(v_t, ACC, rs_c, j) \
__builtin_mma_disassemble_acc ( (void *) result, ACC); \
rowC = (v_t *) &C0[j]; \
rowC[0] = alpha_ * result[0]; \
rowC = (v_t *) &C0[rs_c+j]; \
rowC[0] = alpha_ * result[1]; \
rowC = (v_t *) &C0[2*rs_c+j]; \
rowC[0] = alpha_ * result[2]; \
rowC = (v_t *) &C0[3*rs_c+j]; \
rowC[0] = alpha_ * result[3];
|
3b214fd98212ab6c7c31de1060be71df808af18b
|
b1c0a1117a62d5f049e189e041aa19a914be6dbd
|
/extra/hamming_weight/fastpopcnt.c
|
080ec6e7a471f5c8cec1f0be2de305231b14f512
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
lemire/Code-used-on-Daniel-Lemire-s-blog
|
847451d3acbeb28a6a6d50c6686eb537a6fdff41
|
c13fe68cdec26d45f688b5c58245fb428dc2ddb9
|
refs/heads/master
| 2023-08-31T09:55:12.275811
| 2023-08-31T00:33:59
| 2023-08-31T00:33:59
| 3,945,414
| 729
| 194
| null | 2023-09-04T07:50:21
| 2012-04-06T00:13:02
|
C
|
UTF-8
|
C
| false
| false
| 11,309
|
c
|
fastpopcnt.c
|
// gcc -O3 -march=native -o fastpopcnt fastpopcnt.c
// see also https://github.com/WojciechMula/sse-popcount
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <x86intrin.h>
// straight out of wikipedia
static inline uint64_t scalar_hamming_weight(uint64_t x) {
x -= (x >> 1) & 0x5555555555555555;
x = ((x>>2)&0x3333333333333333) + (x&0x3333333333333333);
x += x >> 4;
x &= 0x0f0f0f0f0f0f0f0f;
x *= 0x0101010101010101;
return x >> 56;
}
/**
* Attributed to Cédric Lauradoux
*/
int lauradoux_bitset64_weight(const uint64_t *fp, int size) {
const uint64_t m1 = UINT64_C(0x5555555555555555);
const uint64_t m2 = UINT64_C(0x3333333333333333);
const uint64_t m4 = UINT64_C(0x0F0F0F0F0F0F0F0F);
const uint64_t m8 = UINT64_C(0x00FF00FF00FF00FF);
const uint64_t m16 = UINT64_C(0x0000FFFF0000FFFF);
const uint64_t h01 = UINT64_C(0x0101010101010101);
uint64_t count1, count2, half1, half2, acc;
uint64_t x;
int i, j;
int limit = size - size % 12;
int bit_count = 0;
for (i = 0; i < limit; i += 12, fp += 12) {
acc = 0;
for (j = 0; j < 12; j += 3) {
count1 = fp[j + 0];
count2 = fp[j + 1];
half1 = fp[j + 2];
half2 = fp[j + 2];
half1 &= m1;
half2 = (half2 >> 1) & m1;
count1 -= (count1 >> 1) & m1;
count2 -= (count2 >> 1) & m1;
count1 += half1;
count2 += half2;
count1 = (count1 & m2) + ((count1 >> 2) & m2);
count1 += (count2 & m2) + ((count2 >> 2) & m2);
acc += (count1 & m4) + ((count1 >> 4) & m4);
}
acc = (acc & m8) + ((acc >> 8) & m8);
acc = (acc + (acc >> 16)) & m16;
acc = acc + (acc >> 32);
bit_count += (int) acc;
}
for (i = 0; i < size - limit; i++) {
x = fp[i];
x = x - ((x >> 1) & m1);
x = (x & m2) + ((x >> 2) & m2);
x = (x + (x >> 4)) & m4;
bit_count += (int) ((x * h01) >> 56);
}
return bit_count;
}
// compute the Hamming weight of the an array of 64-bit words using a scalar Hamming weight function
int scalar_bitset64_weight(const uint64_t * input, size_t length) {
int card = 0;
for(size_t k = 0; k < length; k++) {
card += scalar_hamming_weight(input[k]);
}
return card;
}
// compute the Hamming weight of an array of 64-bit words using the popcnt instruction
int popcnt_bitset64_weight(const uint64_t * input, size_t length) {
int card = 0;
for(size_t k = 0; k < length; k++) {
card += _mm_popcnt_u64(input[k]);
}
return card;
}
// weights of the 8-bit values
static uint8_t small_table[] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8};
// compute the Hamming weight of an array of 8-bit words using the small table look-ups
int table_bitset8_weight(const uint8_t * input, size_t length) {
int card = 0;
for(size_t k = 0; k < length; k++) {
card += small_table[input[k]];
}
return card;
}
#include "bigtable.c"
// compute the Hamming weight of an array of 16-bit words using the big table look-ups
int table_bitset16_weight(const uint16_t * input, size_t length) {
int card = 0;
for(size_t k = 0; k < length; k++) {
card += big_table[input[k]];
}
return card;
}
// compute the Hamming weight of an array of 64-bit words using unrolled popcnt instructions
int unrolled_popcnt_bitset64_weight(const uint64_t * input, size_t length) {
int card = 0;
size_t k = 0;
for(; k < length; k+=4) {
card += _mm_popcnt_u64(input[k]);
card += _mm_popcnt_u64(input[k+1]);
card += _mm_popcnt_u64(input[k+2]);
card += _mm_popcnt_u64(input[k+3]);
}
for(; k < length; k++) {
card += _mm_popcnt_u64(input[k]);
}
return card;
}
// compute the Hamming weight of an array of 64-bit words using AVX2 instructions
int avx2_bitset64_weight(const uint64_t * array, size_t length) {
// these are precomputed hamming weights (weight(0), weight(1)...)
const __m256i shuf =
_mm256_setr_epi8(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 0, 1,
1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4);
const __m256i mask = _mm256_set1_epi8(0x0f); // low 4 bits of each byte
__m256i total = _mm256_setzero_si256();
__m256i zero = _mm256_setzero_si256();
const int inner = 4; // length of the inner loop, could go up to 8 safely
const int outer = length * sizeof(uint64_t) /
(sizeof(__m256i) * inner); // length of outer loop
for (int k = 0; k < outer; k++) {
__m256i innertotal = _mm256_setzero_si256();
for (int i = 0; i < inner; ++i) {
__m256i ymm1 =
_mm256_lddqu_si256((const __m256i *)array + k * inner + i);
__m256i ymm2 =
_mm256_srli_epi32(ymm1, 4); // shift right, shiftingin zeroes
ymm1 = _mm256_and_si256(ymm1, mask); // contains even 4 bits
ymm2 = _mm256_and_si256(ymm2, mask); // contains odd 4 bits
ymm1 = _mm256_shuffle_epi8(
shuf, ymm1); // use table look-up to sum the 4 bits
ymm2 = _mm256_shuffle_epi8(shuf, ymm2);
innertotal = _mm256_add_epi8(innertotal, ymm1); // inner total
// values in each
// byte are bounded
// by 8 * inner
innertotal = _mm256_add_epi8(innertotal, ymm2); // inner total
// values in each
// byte are bounded
// by 8 * inner
}
innertotal = _mm256_sad_epu8(zero, innertotal); // produces 4 64-bit
// counters (having
// values in [0,8 *
// inner * 4])
total = _mm256_add_epi64(
total,
innertotal); // add the 4 64-bit counters to previous counter
}
int answer = _mm256_extract_epi64(total, 0) + _mm256_extract_epi64(total, 1) +
_mm256_extract_epi64(total, 2) + _mm256_extract_epi64(total, 3);
const int leftoverwords = length % (inner * sizeof(__m256i) / sizeof(uint64_t));
for(size_t k = length - leftoverwords; k < length; k++) {
answer += _mm_popcnt_u64(array[k]);
}
return answer;
}
#define RDTSC_START(cycles) \
do { \
register unsigned cyc_high, cyc_low; \
__asm volatile( \
"cpuid\n\t" \
"rdtsc\n\t" \
"mov %%edx, %0\n\t" \
"mov %%eax, %1\n\t" \
: "=r"(cyc_high), "=r"(cyc_low)::"%rax", "%rbx", "%rcx", "%rdx"); \
(cycles) = ((uint64_t)cyc_high << 32) | cyc_low; \
} while (0)
#define RDTSC_FINAL(cycles) \
do { \
register unsigned cyc_high, cyc_low; \
__asm volatile( \
"rdtscp\n\t" \
"mov %%edx, %0\n\t" \
"mov %%eax, %1\n\t" \
"cpuid\n\t" \
: "=r"(cyc_high), "=r"(cyc_low)::"%rax", "%rbx", "%rcx", "%rdx"); \
(cycles) = ((uint64_t)cyc_high << 32) | cyc_low; \
} while (0)
/*
* Prints the best number of operations per cycle where
* test is the function call, answer is the expected answer generated by
* test, repeat is the number of times we should repeat and size is the
* number of operations represented by test.
*/
#define BEST_TIME(test, expected, pre, repeat, size) \
do { \
printf("%s: ", #test); \
fflush(NULL); \
uint64_t cycles_start, cycles_final, cycles_diff; \
uint64_t min_diff = (uint64_t)-1; \
for (int i = 0; i < repeat; i++) { \
pre; \
__asm volatile("" ::: /* pretend to clobber */ "memory"); \
RDTSC_START(cycles_start); \
if(test != expected) {printf("not expected (%d , %d )",test,expected);break;} \
RDTSC_FINAL(cycles_final); \
cycles_diff = (cycles_final - cycles_start); \
if (cycles_diff < min_diff) min_diff = cycles_diff; \
} \
uint64_t S = size; \
float cycle_per_op = (min_diff) / (double)S; \
printf(" %.2f cycles per operation", cycle_per_op); \
printf("\n"); \
fflush(NULL); \
} while (0)
void demo(int size) {
printf("size = %d words or %lu bytes \n",size, size*sizeof(uint64_t));
int repeat = 500;
uint64_t * prec = malloc(size * sizeof(uint64_t));
for(int k = 0; k < size; ++k) prec[k] = -k;
int expected = scalar_bitset64_weight(prec,size);
BEST_TIME(lauradoux_bitset64_weight(prec,size),expected,, repeat, size);
BEST_TIME(scalar_bitset64_weight(prec,size),expected,, repeat, size);
BEST_TIME(popcnt_bitset64_weight(prec,size),expected,, repeat, size);
BEST_TIME(table_bitset8_weight((uint8_t*)prec,size*8),expected,, repeat, size);
BEST_TIME(table_bitset16_weight((uint16_t*)prec,size*4),expected,, repeat, size);
BEST_TIME(unrolled_popcnt_bitset64_weight(prec,size),expected,, repeat, size);
BEST_TIME(avx2_bitset64_weight(prec,size),expected,, repeat, size);
free(prec);
printf("\n");
}
int main() {
demo(16);
demo(32);
demo(64);
demo(128);
demo(1024);
return 0;
}
|
2e6d34d08460692ab7e3d0d08ae6222d691882f1
|
649d9e287b6536d67b4075120c19eeceee343fba
|
/weex_core/Source/include/wtf/Compiler.h
|
62883da804f8e12f8f77c9574e07870203a41895
|
[
"LicenseRef-scancode-unicode",
"MIT",
"BSL-1.0",
"Apache-2.0",
"ICU",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
alibaba/weex
|
79c83bb4d002af7b819326ebca35e880e2ea8473
|
8f3f2b7d511d3f966dcd00ea44da8771d955fc13
|
refs/heads/master
| 2023-03-12T20:57:22.129120
| 2022-09-28T06:06:08
| 2022-09-28T06:06:08
| 53,658,802
| 20,773
| 2,915
|
Apache-2.0
| 2023-08-23T10:57:36
| 2016-03-11T10:18:11
|
C++
|
UTF-8
|
C
| false
| false
| 9,840
|
h
|
Compiler.h
|
/*
* Copyright (C) 2011, 2012, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WTF_Compiler_h
#define WTF_Compiler_h
/* COMPILER() - the compiler being used to build the project */
#define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE)
/* COMPILER_SUPPORTS() - whether the compiler being used to build the project supports the given feature. */
#define COMPILER_SUPPORTS(WTF_COMPILER_FEATURE) (defined WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE && WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE)
/* COMPILER_QUIRK() - whether the compiler being used to build the project requires a given quirk. */
#define COMPILER_QUIRK(WTF_COMPILER_QUIRK) (defined WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK && WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK)
/* COMPILER_HAS_CLANG_BUILTIN() - whether the compiler supports a particular clang builtin. */
#ifdef __has_builtin
#define COMPILER_HAS_CLANG_BUILTIN(x) __has_builtin(x)
#else
#define COMPILER_HAS_CLANG_BUILTIN(x) 0
#endif
/* COMPILER_HAS_CLANG_HEATURE() - whether the compiler supports a particular language or library feature. */
/* http://clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension */
#ifdef __has_feature
#define COMPILER_HAS_CLANG_FEATURE(x) __has_feature(x)
#else
#define COMPILER_HAS_CLANG_FEATURE(x) 0
#endif
/* ==== COMPILER() - primary detection of the compiler being used to build the project, in alphabetical order ==== */
/* COMPILER(CLANG) - Clang */
#if defined(__clang__)
#define WTF_COMPILER_CLANG 1
#define WTF_COMPILER_SUPPORTS_BLOCKS COMPILER_HAS_CLANG_FEATURE(blocks)
#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT COMPILER_HAS_CLANG_FEATURE(c_static_assert)
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS COMPILER_HAS_CLANG_FEATURE(cxx_reference_qualified_functions)
#define WTF_COMPILER_SUPPORTS_FALLTHROUGH_WARNINGS COMPILER_HAS_CLANG_FEATURE(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define WTF_COMPILER_SUPPORTS_CXX_EXCEPTIONS COMPILER_HAS_CLANG_FEATURE(cxx_exceptions)
#define WTF_COMPILER_SUPPORTS_BUILTIN_IS_TRIVIALLY_COPYABLE COMPILER_HAS_CLANG_FEATURE(is_trivially_copyable)
#ifdef __cplusplus
#if __cplusplus <= 201103L
#define WTF_CPP_STD_VER 11
#elif __cplusplus <= 201402L
#define WTF_CPP_STD_VER 14
#endif
#endif
#endif // defined(__clang__)
/* COMPILER(GCC_OR_CLANG) - GNU Compiler Collection or Clang */
#if defined(__GNUC__)
#define WTF_COMPILER_GCC_OR_CLANG 1
#endif
/* COMPILER(GCC) - GNU Compiler Collection */
/* Note: This section must come after the Clang section since we check !COMPILER(CLANG) here. */
#if COMPILER(GCC_OR_CLANG) && !COMPILER(CLANG)
#define WTF_COMPILER_GCC 1
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS 1
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
#if !GCC_VERSION_AT_LEAST(4, 9, 0)
#error "Please use a newer version of GCC. WebKit requires GCC 4.9.0 or newer to compile."
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT 1
#endif
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif /* COMPILER(GCC) */
/* COMPILER(MINGW) - MinGW GCC */
#if defined(__MINGW32__)
#define WTF_COMPILER_MINGW 1
#include <_mingw.h>
#endif
/* COMPILER(MINGW64) - mingw-w64 GCC - used as additional check to exclude mingw.org specific functions */
/* Note: This section must come after the MinGW section since we check COMPILER(MINGW) here. */
#if COMPILER(MINGW) && defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */
#define WTF_COMPILER_MINGW64 1
#endif
/* COMPILER(MSVC) - Microsoft Visual C++ */
#if defined(_MSC_VER)
#define WTF_COMPILER_MSVC 1
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS 1
#if _MSC_VER < 1900
#error "Please use a newer version of Visual Studio. WebKit requires VS2015 or newer to compile."
#endif
#endif
/* COMPILER(SUNCC) */
#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
#define WTF_COMPILER_SUNCC 1
#endif
#if !COMPILER(CLANG) && !COMPILER(MSVC)
#define WTF_COMPILER_QUIRK_CONSIDERS_UNREACHABLE_CODE 1
#endif
/* ==== COMPILER_SUPPORTS - additional compiler feature detection, in alphabetical order ==== */
/* COMPILER_SUPPORTS(EABI) */
#if defined(__ARM_EABI__) || defined(__EABI__)
#define WTF_COMPILER_SUPPORTS_EABI 1
#endif
/* RELAXED_CONSTEXPR */
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
#define WTF_COMPILER_SUPPORTS_RELAXED_CONSTEXPR 1
#endif
#if !defined(RELAXED_CONSTEXPR)
#if COMPILER_SUPPORTS(RELAXED_CONSTEXPR)
#define RELAXED_CONSTEXPR constexpr
#else
#define RELAXED_CONSTEXPR
#endif
#endif
#define ASAN_ENABLED COMPILER_HAS_CLANG_FEATURE(address_sanitizer)
#if ASAN_ENABLED
#define SUPPRESS_ASAN __attribute__((no_sanitize_address))
#else
#define SUPPRESS_ASAN
#endif
/* ==== Compiler-independent macros for various compiler features, in alphabetical order ==== */
/* ALWAYS_INLINE */
#if !defined(ALWAYS_INLINE) && COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !COMPILER(MINGW)
#define ALWAYS_INLINE inline __attribute__((__always_inline__))
#endif
#if !defined(ALWAYS_INLINE) && COMPILER(MSVC) && defined(NDEBUG)
#define ALWAYS_INLINE __forceinline
#endif
#if !defined(ALWAYS_INLINE)
#define ALWAYS_INLINE inline
#endif
/* WTF_EXTERN_C_{BEGIN, END} */
#ifdef __cplusplus
#define WTF_EXTERN_C_BEGIN extern "C" {
#define WTF_EXTERN_C_END }
#else
#define WTF_EXTERN_C_BEGIN
#define WTF_EXTERN_C_END
#endif
/* FALLTHROUGH */
#if !defined(FALLTHROUGH) && COMPILER_SUPPORTS(FALLTHROUGH_WARNINGS) && COMPILER(CLANG)
#define FALLTHROUGH [[clang::fallthrough]]
#endif
#if !defined(FALLTHROUGH)
#define FALLTHROUGH
#endif
/* LIKELY */
#if !defined(LIKELY) && COMPILER(GCC_OR_CLANG)
#define LIKELY(x) __builtin_expect(!!(x), 1)
#endif
#if !defined(LIKELY)
#define LIKELY(x) (x)
#endif
/* NEVER_INLINE */
#if !defined(NEVER_INLINE) && COMPILER(GCC_OR_CLANG)
#define NEVER_INLINE __attribute__((__noinline__))
#endif
#if !defined(NEVER_INLINE) && COMPILER(MSVC)
#define NEVER_INLINE __declspec(noinline)
#endif
#if !defined(NEVER_INLINE)
#define NEVER_INLINE
#endif
/* NO_RETURN */
#if !defined(NO_RETURN) && COMPILER(GCC_OR_CLANG)
#define NO_RETURN __attribute((__noreturn__))
#endif
#if !defined(NO_RETURN) && COMPILER(MSVC)
#define NO_RETURN __declspec(noreturn)
#endif
#if !defined(NO_RETURN)
#define NO_RETURN
#endif
/* RETURNS_NONNULL */
#if !defined(RETURNS_NONNULL) && COMPILER(GCC_OR_CLANG)
#define RETURNS_NONNULL __attribute__((returns_nonnull))
#endif
#if !defined(RETURNS_NONNULL)
#define RETURNS_NONNULL
#endif
/* NO_RETURN_WITH_VALUE */
#if !defined(NO_RETURN_WITH_VALUE) && !COMPILER(MSVC)
#define NO_RETURN_WITH_VALUE NO_RETURN
#endif
#if !defined(NO_RETURN_WITH_VALUE)
#define NO_RETURN_WITH_VALUE
#endif
/* OBJC_CLASS */
#if !defined(OBJC_CLASS) && defined(__OBJC__)
#define OBJC_CLASS @class
#endif
#if !defined(OBJC_CLASS)
#define OBJC_CLASS class
#endif
/* PURE_FUNCTION */
#if !defined(PURE_FUNCTION) && COMPILER(GCC_OR_CLANG)
#define PURE_FUNCTION __attribute__((__pure__))
#endif
#if !defined(PURE_FUNCTION)
#define PURE_FUNCTION
#endif
/* REFERENCED_FROM_ASM */
#if !defined(REFERENCED_FROM_ASM) && COMPILER(GCC_OR_CLANG)
#define REFERENCED_FROM_ASM __attribute__((__used__))
#endif
#if !defined(REFERENCED_FROM_ASM)
#define REFERENCED_FROM_ASM
#endif
/* UNLIKELY */
#if !defined(UNLIKELY) && COMPILER(GCC_OR_CLANG)
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#endif
#if !defined(UNLIKELY)
#define UNLIKELY(x) (x)
#endif
/* UNUSED_LABEL */
/* Keep the compiler from complaining for a local label that is defined but not referenced. */
/* Helpful when mixing hand-written and autogenerated code. */
#if !defined(UNUSED_LABEL) && COMPILER(MSVC)
#define UNUSED_LABEL(label) if (false) goto label
#endif
#if !defined(UNUSED_LABEL)
#define UNUSED_LABEL(label) UNUSED_PARAM(&& label)
#endif
/* UNUSED_PARAM */
#if !defined(UNUSED_PARAM) && COMPILER(MSVC)
#define UNUSED_PARAM(variable) (void)&variable
#endif
#if !defined(UNUSED_PARAM)
#define UNUSED_PARAM(variable) (void)variable
#endif
/* WARN_UNUSED_RETURN */
#if !defined(WARN_UNUSED_RETURN) && COMPILER(GCC_OR_CLANG)
#define WARN_UNUSED_RETURN __attribute__((__warn_unused_result__))
#endif
#if !defined(WARN_UNUSED_RETURN)
#define WARN_UNUSED_RETURN
#endif
#if !defined(__has_include) && COMPILER(MSVC)
#define __has_include(path) 0
#endif
#endif /* WTF_Compiler_h */
|
4932689af83df080dd808e17bf29415d37974a8c
|
b41843c7eb48e897d9195bb2b239071b6a42721a
|
/libraries/ghc-prim/cbits/bitrev.c
|
2fcbd192b326461b3917ed86e8d7577b5aecfa91
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
ghc/ghc
|
f19b08125f1f9ecf4df31e55fb90c32d18099071
|
ac29787c92551682ec89fcd71ac939becf69f051
|
refs/heads/master
| 2023-09-03T21:06:18.699382
| 2023-09-01T07:16:20
| 2023-09-01T18:30:02
| 1,560,597
| 2,927
| 791
|
NOASSERTION
| 2023-07-08T14:10:40
| 2011-04-02T19:39:34
|
Haskell
|
UTF-8
|
C
| false
| false
| 2,847
|
c
|
bitrev.c
|
#include "Rts.h"
/*
Note [Bit reversal primop]
~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two main ways of reversing the bit order of a word: bit twiddling
and using a lookup table.
See [this excellent](https://stackoverflow.com/questions/746171/most-efficient-algorithm-for-bit-reversal-from-msb-lsb-to-lsb-msb-in-c this)
Stack Overflow answer about bit order reversal for (much) more detail.
(Link valid as of March 2019.)
To summarize,
* the lookup table is faster, but much more memory-heavy e.g.
doing it for 64-bit words can take 64KB if only 16-bits are reversed at
a time.
* working directly with bits is slower (roughly on the same order of
magnitude as the previous alternative), but uses much less memory as
bit-wise operators aren't space-onerous.
The code below uses the latter option. If in the future the performance of this
primop must be improved, the information provided in this comment should be
useful in making the decision of which changes to make.
For more information on how the below bit-twiddling functions came to be, see
[this](http://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel)
page.
*/
extern StgWord hs_bitrev8(StgWord x);
StgWord
hs_bitrev8(StgWord x)
{
x = ((x >> 1) & 0x55) | ((x & 0x55) << 1 );
x = ((x >> 2) & 0x33) | ((x & 0x33) << 2 );
x = ((x >> 4) & 0x0F) | ((x & 0x0F) << 4 );
return x;
}
extern StgWord16 hs_bitrev16(StgWord16 x);
StgWord16
hs_bitrev16(StgWord16 x)
{
x = ((x >> 1) & 0x5555) | ((x & 0x5555) << 1 );
x = ((x >> 2) & 0x3333) | ((x & 0x3333) << 2 );
x = ((x >> 4) & 0x0F0F) | ((x & 0x0F0F) << 4 );
x = ((x >> 8) & 0x00FF) | ((x & 0x00FF) << 8 );
return x;
}
extern StgWord32 hs_bitrev32(StgWord32 x);
StgWord32
hs_bitrev32(StgWord32 x)
{
x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1 );
x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2 );
x = ((x >> 4) & 0x0F0F0F0F) | ((x & 0x0F0F0F0F) << 4 );
x = ((x >> 8) & 0x00FF00FF) | ((x & 0x00FF00FF) << 8 );
x = ( x >> 16 ) | ( x << 16 );
return x;
}
extern StgWord64 hs_bitrev64(StgWord64 x);
StgWord64
hs_bitrev64(StgWord64 x)
{
// swap odd and even bits
x = ((x >> 1) & 0x5555555555555555) | ((x & 0x5555555555555555) << 1 );
// swap consecutive pairs of bits
x = ((x >> 2) & 0x3333333333333333) | ((x & 0x3333333333333333) << 2 );
// swap consecutive pairs of nibbles (a nibble is 4 bits)
x = ((x >> 4) & 0x0F0F0F0F0F0F0F0F) | ((x & 0x0F0F0F0F0F0F0F0F) << 4 );
// swap consecutive pairs of bytes
x = ((x >> 8) & 0x00FF00FF00FF00FF) | ((x & 0x00FF00FF00FF00FF) << 8 );
// swap consecutive pairs of 16-bit words
x = ((x >> 16) & 0x0000FFFF0000FFFF) | ((x & 0x0000FFFF0000FFFF) << 16);
// swap 32-bit long pairs
x = ( x >> 32 ) | ( x << 32 );
return x;
}
|
086aee24fa903745df18f3c47e1c16b7084c3786
|
5efe877bf5ebc9da1e7edb8efabb66b88a78cee4
|
/DcpmPkg/driver/Core/Btt.c
|
365a042b1167bb6c1b8fee4245a6f8407bc90672
|
[
"BSD-3-Clause"
] |
permissive
|
intel/ipmctl
|
342996a882ea7f4d3abf06fd175ec5d5673829b3
|
c75bd840ea7820c8f93a5488fcff75d08beedd51
|
refs/heads/master
| 2023-08-11T03:49:16.000607
| 2023-05-05T02:26:49
| 2023-05-05T02:26:49
| 133,425,750
| 176
| 64
|
BSD-3-Clause
| 2023-03-20T23:15:23
| 2018-05-14T21:53:46
|
C
|
UTF-8
|
C
| false
| false
| 52,949
|
c
|
Btt.c
|
/*
* Copyright (c) 2018, Intel Corporation.
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <Library/BaseMemoryLib.h>
#include <Debug.h>
#include <NvmTypes.h>
#include "Btt.h"
#include "BttLayout.h"
#include "Namespace.h"
#include <Convert.h>
GUID gBttAbstractionGuid = EFI_BTT_ABSTRACTION_GUID;
/**
Loads up a single flog pair
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] pArena Pointer to the Arena from which the Flog Pair is to be read
@param [in] FlogOffset Offset to the specific Flog entry
@param [out] pFlogRuntime Result of Flog read
@param [in] FlogNum Number of Flog to be read
**/
STATIC
EFI_STATUS
BttReadFlogPair(
IN BTT *pBtt,
IN ARENAS *pArena,
IN UINT64 FlogOffset,
OUT FLOG_RUNTIME *pFlogRuntime,
IN UINT32 FlogNum
);
/**
Loads up all the flog Entries for an arena
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in,out] pArena Pointer to the Arena from which the Flog Pairs are to be read
**/
STATIC
EFI_STATUS
BttReadFlogs(
IN BTT *pBtt,
IN OUT ARENAS *pArena
);
/**
Writes out an updated Flog entry
The Flog Entries are not checksummed. Instead, increasing Sequence
numbers are used to atomically switch the active Flog entry between
the first and second struct btt_Flog in each slot. In order for this
to work, the Sequence number must be updated only after all the other
fields in the Flog are updated. So the writes to the Flog are broken
into two writes, one for the first three fields (lba, OldMap, NewMap)
and, only after those fields are known to be written durably, the
second write for the Seq field is done.
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in,out] pArena Pointer to the Arena from which the Flog Pair is to be read
@param [in] Lba Logical block address to be written
@param [in] OldMap Previous map entry to be written
@param [in] NewMap New map entry to be written
**/
STATIC
EFI_STATUS
BttFlogUpdate(
IN BTT *pBtt,
IN ARENAS *pArena,
IN UINT32 Lba,
IN UINT32 OldMap,
IN UINT32 NewMap
);
/**
Constructs a read tracking table for an arena
The Rtt is big enough to hold an entry for each free block (NFree)
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in,out] pArena Pointer to the Arena with Rtt to be created
**/
STATIC
EFI_STATUS
BttBuildRtt(
IN BTT *pBtt,
IN OUT ARENAS *pArena
);
/**
Loads up an arena and build run-time state
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] ArenaOffset Offset to the Arena to be read
@param [in,out] pArena Pointer to the Arena to be read
**/
STATIC
EFI_STATUS
BttReadArena(
IN BTT *pBtt,
IN UINT64 ArenaOffset,
IN OUT ARENAS *pArena
);
/**
Loads up all Arenas and builds run-time state
On entry, layout must be known to be valid, and the number of Arenas must be known.
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] NArenas Number of arenas to be read
**/
STATIC
EFI_STATUS
BttReadArenas(
IN BTT *pBtt,
IN UINT32 NArenas
);
/**
Loads up layout Info from btt namespace
Called once when the btt namespace is opened for use.
Sets pBtt->Laidout to 0 if no valid layout is found, 1 otherwise.
Any recovery actions required (as indicated by the Flog state) are
performed by this routine.
Any quick checks for layout consistency are performed by this routine
(quick enough to be done each time a BTT area is opened for use, not
like the slow consistency checks done by BttCheck()).
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
**/
STATIC
EFI_STATUS
BttReadLayout(
IN BTT *pBtt
);
/*
Satisfies a read with a block of zeros
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [out] Buffer Output buffer
**/
STATIC
EFI_STATUS
BttZeroBlock(
IN BTT *pBtt,
OUT VOID *pBuffer
);
/**
Calculates the arena & pre-map LBA
This routine takes the external LBA and matches it to the
appropriate arena, adjusting the Lba for use within that arena.
If successful, *pArena is a pointer to the appropriate arena struct in the run-time state,
and *PreMapLba is the LBA adjusted to an arena-internal LBA (also known as the pre-map LBA).
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] Lba External LBA
@param [out] pArena Pointer to the appropriate arena struct in the run-time state
@param [out] PreMapLba LBA adjusted to an arena-internal LBA
**/
STATIC
EFI_STATUS
BttLbaToArenaLba(
IN BTT *pBtt,
IN UINT64 Lba,
OUT ARENAS **ppArena,
OUT UINT32 *PreMapLba
);
/**
Performs a consistency check on an arena
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] pArena Pointer to the Arena to be checked
**/
STATIC
EFI_STATUS
BttCheckArena(
IN BTT *pBtt,
IN ARENAS *pArena
);
/**
Verifies if Lba is invalid
This function is used at the top of the entry points where an external
LBA is provided, like this:
if (!NT_SUCCESS (IsLbaValid(pBtt, Lba)))\n
return STATUS_UNSUCCESSFUL;
@retval EFI_SUCCESS if the routine succeeds
@param [in] pBtt namespace handle
@param [in] Lba Logical block address
**/
STATIC
EFI_STATUS
IsLbaValid(
IN BTT *pBtt,
IN UINT64 Lba
);
BTT *
BttInit(
IN UINT64 RawSize,
IN UINT32 LbaSize,
IN GUID *pParentUuid,
IN VOID *pNamespace
)
{
BTT *pBtt = NULL;
NVDIMM_DBG("RawSize=%x LbaSize=%d", RawSize, LbaSize);
if(RawSize < BTT_NAMESPACE_MIN_SIZE) {
NVDIMM_DBG("RawSize smaller than BTT_MIN_SIZE %d", BTT_NAMESPACE_MIN_SIZE);
return NULL;
}
pBtt = AllocatePool(sizeof(BTT));
if(pBtt == NULL) {
NVDIMM_DBG("Memory allocation for %x bytes failed", sizeof(BTT));
return NULL;
}
ZeroMem(pBtt, sizeof(BTT));
CopyMem_S(&pBtt->ParentUuid, sizeof(pBtt->ParentUuid), pParentUuid, sizeof(GUID));
pBtt->RawSize = RawSize;
pBtt->LbaSize = LbaSize;
pBtt->pNamespace = pNamespace;
if ((((NAMESPACE *) pNamespace)->Major == NSINDEX_MAJOR) &&
(((NAMESPACE *) pNamespace)->Minor == NSINDEX_MINOR_1)) {
pBtt->PrimaryInfoOffset = BTT_PRIMARY_INFO_BLOCK_OFFSET_1_1;
} else {
pBtt->PrimaryInfoOffset = BTT_PRIMARY_INFO_BLOCK_OFFSET;
}
/**
Load up layout, if it exists.
Whether BttReadLayout() finds a valid layout or not, it finishes
updating these layout-related fields:
pBtt->NFree
pBtt->NLbas
pBtt->NArenas
since these fields are used even before a valid layout it written.
**/
if(EFI_ERROR(BttReadLayout(pBtt))) {
BttRelease(pBtt); /* free up any allocations */
return NULL;
}
// Set blockcount to usable size, excluding metadata
((NAMESPACE *) pNamespace)->UsableSize = pBtt->NLbas * pBtt->LbaSize;
NVDIMM_DBG("Success, pBtt=%p", pBtt);
return pBtt;
}
STATIC
EFI_STATUS
IsLbaValid(
IN BTT *pBtt,
IN UINT64 Lba
)
{
if (pBtt == NULL) {
return EFI_INVALID_PARAMETER;
}
if (Lba >= pBtt->NLbas) {
NVDIMM_DBG("lba out of range(NLbas %lu)", pBtt->NLbas);
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
EFI_STATUS
BttReadInfo(
IN BTT_INFO *pInfo,
IN BTT *pBtt OPTIONAL
)
{
if (pInfo == NULL) {
return EFI_INVALID_PARAMETER;
}
if (CompareMem(pInfo->Sig, Sig, BTTINFO_SIG_LEN) != 0) {
NVDIMM_DBG("Invalid BTT signature ");
return EFI_ABORTED;
}
if (pBtt != NULL) {
if (CompareMem(&pInfo->ParentUuid, &pBtt->ParentUuid, sizeof(GUID)) != 0){
NVDIMM_DBG("parent UUID mismatch");
return EFI_ABORTED;
}
}
/* to be valid, the fields must Checksum correctly */
if (!ChecksumOperations((VOID *)pInfo, sizeof(BTT_INFO), &pInfo->Checksum, FALSE)) {
NVDIMM_DBG("Invalid checksum");
return EFI_ABORTED;
}
/* to be valid, Info block must have Major version of at least 1 */
if (pInfo->Major == 0) {
NVDIMM_DBG("Invalid major version(0)");
return EFI_ABORTED;
}
return EFI_SUCCESS;
}
STATIC
INLINE
BOOLEAN
MapEntryIsError(
IN UINT32 MapEntry
)
{
return (MapEntry & ~BTT_MAP_ENTRY_LBA_MASK) == BTT_MAP_ENTRY_ERROR;
}
STATIC
INLINE
BOOLEAN
MapEntryIsZero(
IN UINT32 MapEntry
)
{
return (MapEntry & ~BTT_MAP_ENTRY_LBA_MASK) == BTT_MAP_ENTRY_ZERO;
}
STATIC
INLINE
BOOLEAN
MapEntryIsInitial(
IN UINT32 MapEntry
)
{
return (MapEntry & ~BTT_MAP_ENTRY_LBA_MASK) == BTT_MAP_ENTRY_INITIAL;
}
STATIC
EFI_STATUS
BttReadFlogPair(
IN BTT *pBtt,
IN ARENAS *pArena,
IN UINT64 FlogOffset,
OUT FLOG_RUNTIME *pFlogRuntime,
IN UINT32 FlogNum
)
{
BTT_FLOG_PAIR * pFlogPair = NULL;
UINT8 CurrentFlogIndex = 0;
UINT64 MapEntryOffset = 0;
BTT_MAP_ENTRIES Entry;
UINT8 CurrentMapPos = 0;
UINT32 CurrentMap = 0;
EFI_STATUS ReturnCode = EFI_SUCCESS;
pFlogPair = &(pFlogRuntime->FlogPair);
SetMem(pFlogPair, sizeof(BTT_FLOG_PAIR), 0x0);
SetMem(&Entry, sizeof(Entry), 0x0);
NVDIMM_VERB("pBtt=%p pArena=%p FlogOffset=%x pFlogRuntime=%p FlogNum=%d",
pBtt, pArena, FlogOffset, pFlogRuntime, FlogNum);
if(!pBtt || !pFlogRuntime) {
return EFI_INVALID_PARAMETER;
}
pFlogRuntime->Entry = FlogOffset;
if(FlogOffset == 0) {
NVDIMM_DBG("invalid flog offset %llu", FlogOffset);
return EFI_INVALID_PARAMETER;
}
ReturnCode = ReadNamespaceBytes(
pBtt->pNamespace,
FlogOffset,
pFlogPair,
sizeof(BTT_FLOG_PAIR)
);
if(EFI_ERROR(ReturnCode)) {
return ReturnCode;
}
if(EFI_ERROR(IsLbaValid(pBtt, pFlogPair->Flog[0].Lba)) || EFI_ERROR(IsLbaValid(pBtt, pFlogPair->Flog[1].Lba))) {
return EFI_INVALID_PARAMETER;
}
NVDIMM_VERB("FlogPair[0] FlogOffset=%x OldMap=%d NewMap=%d Seq=%d",
FlogOffset, pFlogPair->Flog[0].OldMap, pFlogPair->Flog[0].NewMap, pFlogPair->Flog[0].Seq);
NVDIMM_VERB("FlogPair[1] OldMap=%d NewMap=%d Seq=%d",
pFlogPair->Flog[1].OldMap, pFlogPair->Flog[1].NewMap, pFlogPair->Flog[1].Seq);
/*
Interesting cases:
- no valid Seq numbers: layout consistency error
- one valid Seq number: that's the current Entry
- two valid Seq numbers: higher number is current Entry
- identical Seq numbers: layout consistency error
*/
if (pFlogPair->Flog[0].Seq == pFlogPair->Flog[1].Seq) {
NVDIMM_DBG("Flog layout error: bad Seq numbers %d %d\n", pFlogPair->Flog[0].Seq, pFlogPair->Flog[1].Seq);
SET_BIT(&pArena->Flags, BTTINFO_FLAG_ERROR);
ReturnCode = EFI_LOAD_ERROR;
goto Finish;
} else if (pFlogPair->Flog[0].Seq == 0) {
/* singleton valid Flog at FlogPair[1] */
CurrentFlogIndex = 1;
pFlogRuntime->Next = 0;
} else if(pFlogPair->Flog[1].Seq == 0) {
/* singleton valid Flog at FlogPair[0] */
CurrentFlogIndex = 0;
pFlogRuntime->Next = 1;
} else if(NSEQ(pFlogPair->Flog[0].Seq) == pFlogPair->Flog[1].Seq) {
/* FlogPair[1] has the later Sequence number */
CurrentFlogIndex = 1;
pFlogRuntime->Next = 0;
} else if (pFlogPair->Flog[0].Seq == NSEQ(pFlogPair->Flog[1].Seq)) {
/* FlogPair[0] has the later Sequence number */
CurrentFlogIndex = 0;
pFlogRuntime->Next = 1;
} else {
NVDIMM_ERR("Flog layout error, not off by 1");
ReturnCode = EFI_LOAD_ERROR;
goto Finish;
}
NVDIMM_VERB("run-time Flog Next is %d", pFlogRuntime->Next);
NVDIMM_VERB("read Flog[%d]: Lba %d old %d%s%s new %d%s%s", FlogNum,
pFlogPair->Flog[CurrentFlogIndex].Lba,
pFlogPair->Flog[CurrentFlogIndex].OldMap & BTT_MAP_ENTRY_LBA_MASK,
(pFlogPair->Flog[CurrentFlogIndex].OldMap & BTT_MAP_ENTRY_ERROR) ? " ERROR" : "",
(pFlogPair->Flog[CurrentFlogIndex].OldMap & BTT_MAP_ENTRY_ZERO) ? " ZERO" : "",
pFlogPair->Flog[CurrentFlogIndex].NewMap & BTT_MAP_ENTRY_LBA_MASK,
(pFlogPair->Flog[CurrentFlogIndex].NewMap & BTT_MAP_ENTRY_ERROR) ? " ERROR" : "",
(pFlogPair->Flog[CurrentFlogIndex].NewMap & BTT_MAP_ENTRY_ZERO) ? " ZERO" : "");
/*
Decide if the current Flog Info represents a completed
operation or an incomplete operation. If completed, the
OldMap field will contain the free block to be used for
the Next write. But if the operation didn't complete(indicated
by the map Entry not being updated), then NewMap is the free
block since it never became active according to the map.
A special case, used by Flog Entries when first created, is
when OldMap == NewMap. This Counts as a complete Entry
and doesn't require reading the map to see if recovery is
required.
*/
if(pFlogPair->Flog[CurrentFlogIndex].OldMap == pFlogPair->Flog[CurrentFlogIndex].NewMap) {
NVDIMM_DBG("Flog[%d] Entry complete(initial state)", FlogNum);
ReturnCode = EFI_SUCCESS;
goto Finish;
}
/* convert pre-map LBA into an offset into the map */
MapEntryOffset = pArena->MapOffset + sizeof(BTT_MAP_ENTRIES) * BttGetMapFromLba(pFlogPair->Flog[CurrentFlogIndex].Lba);
/* read current map Entry */
CHECK_RESULT(ReadNamespaceBytes(
pBtt->pNamespace,
MapEntryOffset,
&Entry,
sizeof(BTT_MAP_ENTRIES)
), Finish);
CurrentMapPos = BttGetPositionInMapFromLba(pFlogPair->Flog[CurrentFlogIndex].Lba);
CurrentMap = Entry.MapEntryLba [CurrentMapPos];
if (MapEntryIsInitial(CurrentMap)) {
Entry.MapEntryLba[CurrentMapPos] = pFlogPair->Flog[CurrentFlogIndex].Lba | BTT_MAP_ENTRY_NORMAL;
CurrentMap = Entry.MapEntryLba[CurrentMapPos];
}
if(pFlogPair->Flog[CurrentFlogIndex].NewMap != CurrentMap && pFlogPair->Flog[CurrentFlogIndex].OldMap == CurrentMap) {
/* last update didn't complete */
NVDIMM_VERB("recover Flog[%d]: map[%d]: %d",
FlogNum, pFlogPair->Flog[CurrentFlogIndex].Lba, pFlogPair->Flog[CurrentFlogIndex].NewMap);
/*
Recovery step is to complete the transaction by
updating the map Entry.
*/
Entry.MapEntryLba [CurrentMapPos] = pFlogPair->Flog[CurrentFlogIndex].NewMap;
EFI_STATUS WriteResult = WriteNamespaceBytes(
pBtt->pNamespace,
MapEntryOffset,
&Entry,
sizeof(BTT_MAP_ENTRIES)
);
if(EFI_ERROR(WriteResult)) {
return WriteResult;
}
}
ReturnCode = EFI_SUCCESS;
Finish:
return ReturnCode;
}
/*
* The flog entries are not checksummed. Instead, increasing sequence
* numbers are used to atomically switch the active flog entry between
* the first and second struct btt_flog in each slot. In order for this
* to work, the sequence number must be updated only after all the other
* fields in the flog are updated. So the writes to the flog are broken
* into two writes, one for the first three fields (lba, old_map, new_map)
* and, only after those fields are known to be written durably, the
* second write for the seq field is done.
*
*
* NOTE: Our code differs from the spec in keeping a copy of the flog
* pair around instead of just the current flog.
*/
STATIC
EFI_STATUS
BttFlogUpdate(
IN BTT *pBtt,
IN ARENAS *pArena,
IN UINT32 Lba,
IN UINT32 OldMap,
IN UINT32 NewMap
)
{
BTT_FLOG * pCurrentFlog = NULL;
BTT_FLOG * pNextFlog = NULL;
BTT_FLOG_PAIR * pFlogPair = NULL;
EFI_STATUS ReturnCode = EFI_INVALID_PARAMETER;
UINT64 NextFlogOffset = 0;
NVDIMM_DBG("pBtt=%p pArena=%p ", pBtt, pArena);
NVDIMM_DBG("LBA=%x OldMap=%d NewMap=%d", Lba, OldMap, NewMap);
if(!pBtt || !pArena) {
return EFI_INVALID_PARAMETER;
}
pFlogPair = &(pArena->pFlogs[FLOG_PAIR_0].FlogPair);
pNextFlog = &(pFlogPair->Flog[pArena->pFlogs[FLOG_PAIR_0].Next]);
if (FLOG_0 == pArena->pFlogs[FLOG_PAIR_0].Next) {
pCurrentFlog = &(pFlogPair->Flog[FLOG_1]);
}
else if (FLOG_1 == pArena->pFlogs[FLOG_PAIR_0].Next) {
pCurrentFlog = &(pFlogPair->Flog[FLOG_0]);
}
else {
NVDIMM_ERR("ERROR: Invalid FLOG[0].Next index value:%d\n", pArena->pFlogs[0].Next);
return EFI_BAD_BUFFER_SIZE;
}
// Update the pNextFlog of our internal flog pair. We currently differ from
// the reference implementation in keeping the flog pair instead of just
// the current flog.
pNextFlog->Lba = Lba;
pNextFlog->OldMap = OldMap;
pNextFlog->NewMap = NewMap;
pNextFlog->Seq = NSEQ(pCurrentFlog->Seq);
// Write out the pNextFlog entry to the dimm
NextFlogOffset = pArena->pFlogs[0].Entry + pArena->pFlogs[0].Next*sizeof(BTT_FLOG);
// write out first two fields first
CHECK_RESULT(WriteNamespaceBytes(pBtt->pNamespace,
NextFlogOffset, pNextFlog, sizeof(UINT32) * 2), Finish);
NextFlogOffset += sizeof(UINT32) * 2;
// write out new_map and seq field to make it active
CHECK_RESULT(WriteNamespaceBytes(pBtt->pNamespace,
NextFlogOffset, &(pNextFlog->NewMap), sizeof(UINT32) * 2), Finish);
// Flog Entry written successfully, update run-time state
pArena->pFlogs[0].Next = 1 - pArena->pFlogs[0].Next;
NVDIMM_VERB("update Flog[0]: Lba=%d old=%d%s%s new %d%s%s", Lba,
OldMap & BTT_MAP_ENTRY_LBA_MASK,(OldMap & BTT_MAP_ENTRY_ERROR) ? " ERROR" : "",
(OldMap & BTT_MAP_ENTRY_ZERO) ? " ZERO" : "", NewMap & BTT_MAP_ENTRY_LBA_MASK,
(NewMap & BTT_MAP_ENTRY_ERROR) ? " ERROR" : "",(NewMap & BTT_MAP_ENTRY_ZERO) ? " ZERO" : "");
ReturnCode = EFI_SUCCESS;
Finish:
return ReturnCode;
}
STATIC
EFI_STATUS
BttReadFlogs(
IN BTT *pBtt,
IN OUT ARENAS *pArena
)
{
EFI_STATUS ReadFlogPairResult;
UINT64 FlogOffset = 0;
FLOG_RUNTIME *pFlogRuntime = NULL;
UINT32 Index = 0;
if(!pBtt || !pArena) {
return EFI_INVALID_PARAMETER;
}
pArena->pFlogs = (FLOG_RUNTIME *)AllocatePool(pBtt->NFree * sizeof(FLOG_RUNTIME));
if(!pArena->pFlogs) {
NVDIMM_VERB("Memory allocation for %d Flog Entries", pBtt->NFree);
return EFI_OUT_OF_RESOURCES;
}
ZeroMem(pArena->pFlogs, pBtt->NFree * sizeof(FLOG_RUNTIME));
/*
Load up the Flog state. BttReadFlogPair() will determine if
any recovery steps are required take them on the in-memory
data structures it creates. Sets error flag when it
determines an invalid state.
*/
FlogOffset = pArena->FlogOffset;
pFlogRuntime = pArena->pFlogs;
for(Index = 0; Index < pBtt->NFree; Index++) {
ReadFlogPairResult = BttReadFlogPair(pBtt, pArena, FlogOffset, pFlogRuntime, Index);
if(EFI_ERROR(ReadFlogPairResult)) {
BttSetArenaError(pBtt, pArena);
return ReadFlogPairResult;
}
/* prepare for Next time around the loop */
FlogOffset += ROUNDUP(sizeof(BTT_FLOG_PAIR), BTT_FLOG_PAIR_ALIGN);
pFlogRuntime++;
}
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
BttBuildRtt(
IN BTT *pBtt,
IN OUT ARENAS *pArena
)
{
UINT32 Lane = 0;
if(!pBtt || !pArena) {
return EFI_INVALID_PARAMETER;
}
pArena->pRtt = AllocatePool(pBtt->NFree * sizeof(UINT32));
if(!pArena->pRtt) {
NVDIMM_DBG("Memory allocation for %d Rtt Entries failed", pBtt->NFree);
return EFI_OUT_OF_RESOURCES;
}
for(Lane = 0; Lane < pBtt->NFree; Lane++) {
pArena->pRtt[Lane] = BTT_MAP_ENTRY_ERROR;
}
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
BttReadArena(
IN BTT *pBtt,
IN UINT64 ArenaOffset,
IN OUT ARENAS *pArena
)
{
EFI_STATUS ReturnCode = EFI_SUCCESS;
BTT_INFO *pBttInfo = NULL;
NVDIMM_VERB("pBtt=%p pArena=%p ArenaOffset=%lld", pBtt, pArena, ArenaOffset);
if (pBtt == NULL || pArena == NULL) {
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
pBttInfo = (BTT_INFO *) AllocateZeroPool(sizeof(*pBttInfo));
if (pBttInfo == NULL) {
NVDIMM_DBG("Memory allocation for BTT Info failed");
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
NVDIMM_DBG("ArenaOffset=%lx", ArenaOffset);
CHECK_RESULT(ReadNamespaceBytes(pBtt->pNamespace, ArenaOffset, pBttInfo, sizeof(BTT_INFO)), Finish);
pArena->Flags = pBttInfo->Flags;
pArena->ExternalNLbas = pBttInfo->ExternalNLbas;
pArena->InternalLbaSize = pBttInfo->InternalLbaSize;
pArena->InternalNLbas = pBttInfo->InternalNLbas;
// pBttInfo offsets are relative to beginning of this arena's info block
// pArena offsets are relative to beginning of encapsulating namespace
pArena->StartOffset = ArenaOffset;
pArena->DataOffset = ArenaOffset + pBttInfo->DataOffset;
pArena->MapOffset = ArenaOffset + pBttInfo->MapOffset;
pArena->FlogOffset = ArenaOffset + pBttInfo->FlogOffset;
pArena->NextOffset = ArenaOffset + pBttInfo->NextOffset;
CHECK_RESULT(BttReadFlogs(pBtt, pArena), Finish);
CHECK_RESULT(BttBuildRtt(pBtt, pArena), Finish);
Finish:
FREE_POOL_SAFE(pBttInfo);
return ReturnCode;
}
STATIC
EFI_STATUS
BttReadArenas(
IN BTT *pBtt,
IN UINT32 NArenas
)
{
UINT32 ArenasSize = 0;
UINT64 ArenaOffset = 0;
ARENAS *pArena = NULL;
UINT32 Index = 0;
if(!pBtt) {
return EFI_INVALID_PARAMETER;
}
EFI_STATUS ErrorValue = EFI_INVALID_PARAMETER;
ArenasSize = NArenas * sizeof(ARENAS);
pBtt->Arenas = AllocatePool(ArenasSize);
if(!pBtt->Arenas) {
NVDIMM_DBG("Memory allocation for %d Arenas failed", NArenas);
ErrorValue = EFI_OUT_OF_RESOURCES;
goto RetVal;
}
ZeroMem(pBtt->Arenas, ArenasSize);
/* Set ArenaOffset to PrimaryInfoOffset */
ArenaOffset = pBtt->PrimaryInfoOffset;
pArena = pBtt->Arenas;
EFI_STATUS ReadArenaResult;
for(Index = 0; Index < NArenas; Index++) {
ReadArenaResult = BttReadArena(pBtt, ArenaOffset, pArena);
if(EFI_ERROR(ReadArenaResult)) {
ErrorValue = ReadArenaResult;
goto RetVal;
}
/* prepare for Next time around the loop */
ArenaOffset = pArena->NextOffset;
pArena++;
}
pBtt->Laidout = TRUE;
return EFI_SUCCESS;
RetVal:
NVDIMM_DBG("Error clean up");
if(pBtt->Arenas) {
for(Index = 0; Index < pBtt->NArenas; Index++) {
if(pBtt->Arenas[Index].pFlogs != NULL) {
FreePool(pBtt->Arenas[Index].pFlogs);
pBtt->Arenas[Index].pFlogs = NULL;
}
if(pBtt->Arenas[Index].pRtt != NULL) {
FreePool((void *)pBtt->Arenas[Index].pRtt);
pBtt->Arenas[Index].pRtt = NULL;
}
}
FreePool(pBtt->Arenas);
pBtt->Arenas = NULL;
}
return ErrorValue;
}
EFI_STATUS
BttWriteLayout(
IN BTT *pBtt,
IN BOOLEAN Write
)
{
EFI_STATUS ReturnCode = EFI_INVALID_PARAMETER;
UINT64 FlogSize = 0;
UINT32 InternalLbaSize = 0;
UINT64 TotalNLbas = 0;
UINT64 RawSize = 0;
UINT8 ArenaNumber = 0;
UINT64 ArenaOffset = 0;
UINT64 ArenaRawSize = 0;
UINT64 ArenaDataSize = 0;
UINT32 InternalNLbas = 0;
UINT32 ExternalNLbas = 0;
UINT64 MapSize = 0;
UINT64 NextOffset = 0;
UINT64 InfoOffset = 0;
UINT64 FlogOffset = 0;
UINT64 MapOffset = 0;
UINT64 DataOffset = 0;
UINT64 MapEntryOffset = 0;
BTT_MAP_ENTRIES *pMap = NULL;
UINT32 MapBlock = 0;
UINT32 Index = 0;
BTT_INFO *pBttInfo = NULL;
UINT64 FlogEntryOffset = 0;
UINT32 NextFreeLba = 0;
BTT_FLOG_PAIR FlogPair;
SetMem(&FlogPair, sizeof(FlogPair), 0x0);
NVDIMM_VERB("pBtt=%p Write=%d", pBtt, Write);
if (pBtt == NULL) {
goto Finish;
}
if (pBtt->RawSize < BTT_NAMESPACE_MIN_SIZE) {
goto Finish;
}
if (pBtt->NFree == 0) {
goto Finish;
}
if (Write) {
GenerateRandomGuid(&pBtt->Uuid);
}
/**
The number of Arenas is the number of full arena of
size BTT_MAX_ARENA that fit into RawSize and then, if
the remainder is at least BTT_MIN_SIZE in size, then
that adds one more arena.
**/
pBtt->NArenas = (UINT8)(pBtt->RawSize / BTT_MAX_ARENA_SIZE);
if(pBtt->RawSize % BTT_MAX_ARENA_SIZE >= BTT_NAMESPACE_MIN_SIZE) {
pBtt->NArenas++;
}
NVDIMM_DBG("NArenas=%d", pBtt->NArenas);
FlogSize = pBtt->NFree * ROUNDUP(sizeof(BTT_FLOG_PAIR), BTT_FLOG_PAIR_ALIGN);
FlogSize = ROUNDUP(FlogSize, BTT_ALIGNMENT);
InternalLbaSize = pBtt->LbaSize;
if(InternalLbaSize < BTT_MIN_LBA_SIZE) {
InternalLbaSize = BTT_MIN_LBA_SIZE;
}
InternalLbaSize = ROUNDUP(InternalLbaSize, CACHE_LINE_SIZE);
/* check for overflow */
if(InternalLbaSize < CACHE_LINE_SIZE) {
NVDIMM_DBG("Invalid LBA size after alignment: %d ", InternalLbaSize);
goto Finish;
}
pBtt->InternalLbaSize = InternalLbaSize;
NVDIMM_VERB("Adjusted InternalLbaSize: %d", InternalLbaSize);
RawSize = pBtt->RawSize;
pBttInfo = (BTT_INFO *) AllocateZeroPool(sizeof(*pBttInfo));
if (pBttInfo == NULL) {
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
pMap = (BTT_MAP_ENTRIES *) AllocateZeroPool(BTT_ALIGNMENT);
if (pMap == NULL) {
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
/** Set ArenaOffset to offset of 1st info block**/
ArenaOffset = pBtt->PrimaryInfoOffset;
// for each arena
while (RawSize >= BTT_NAMESPACE_MIN_SIZE) {
NVDIMM_DBG("Layout arena %d", ArenaNumber);
ArenaRawSize = RawSize;
if(ArenaRawSize > BTT_MAX_ARENA_SIZE) {
ArenaRawSize = BTT_MAX_ARENA_SIZE;
}
RawSize -= ArenaRawSize;
ArenaNumber++;
ArenaDataSize = ArenaRawSize;
ArenaDataSize -= 2 * sizeof(BTT_INFO);
ArenaDataSize -= FlogSize;
/* allow for map alignment padding */
InternalNLbas = (UINT32)((ArenaDataSize - BTT_ALIGNMENT) / (InternalLbaSize + BTT_MAP_ENTRY_SIZE));
/* ensure the number of blocks is at least 2*NFree */
if (InternalNLbas < 2 * pBtt->NFree) {
NVDIMM_DBG("Number of internal blocks: %x, expected at least %d", InternalNLbas, 2 * pBtt->NFree);
goto Finish;
}
ExternalNLbas = InternalNLbas - pBtt->NFree;
NVDIMM_DBG("InternalNLbas=%d ExternalNLbas=%d", InternalNLbas, ExternalNLbas);
TotalNLbas += ExternalNLbas;
MapSize = ROUNDUP(ExternalNLbas * BTT_MAP_ENTRY_SIZE, BTT_ALIGNMENT);
ArenaDataSize -= MapSize;
if (ArenaDataSize / InternalLbaSize < InternalNLbas) {
ReturnCode = EFI_ABORTED;
goto Finish;
}
/**
The rest of the loop body calculates metadata structures
and lays it out for this arena. So only continue if
the write flag is set.
**/
if (!Write) {
continue;
}
InfoOffset = ArenaRawSize - sizeof(BTT_INFO);
FlogOffset = InfoOffset - FlogSize;
MapOffset = FlogOffset - MapSize;
DataOffset = MapOffset - ArenaDataSize;
if(RawSize >= BTT_NAMESPACE_MIN_SIZE) {
NextOffset = BTT_MAX_ARENA_SIZE;
} else {
NextOffset = 0;
}
NVDIMM_DBG("Namespace offsets:");
NVDIMM_DBG("ArenaOffset 0x%012lx", ArenaOffset);
NVDIMM_DBG("DataOffset 0x%012lx", ArenaOffset + DataOffset);
NVDIMM_DBG("MapOffset 0x%012lx", ArenaOffset + MapOffset);
NVDIMM_DBG("FlogOffset 0x%012lx", ArenaOffset + FlogOffset);
NVDIMM_DBG("InfoOffset 0x%012lx", ArenaOffset + InfoOffset);
NVDIMM_DBG("NextOffset 0x%012lx", ArenaOffset + NextOffset);
/* Zero out the initial map, identity style */
MapEntryOffset = ArenaOffset + MapOffset;
// Write map layout in 4k blocks
for(MapBlock = 0; MapBlock <= MapSize / BTT_ALIGNMENT; MapBlock++) {
ReturnCode = WriteNamespaceBytes
(pBtt->pNamespace,
MapEntryOffset + (MapBlock * BTT_ALIGNMENT), pMap, BTT_ALIGNMENT);
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
}
/* write out the initial Flog */
FlogEntryOffset = ArenaOffset + FlogOffset;
NextFreeLba = ExternalNLbas;
ZeroMem(&FlogPair.Flog[1], sizeof(BTT_FLOG));
for (Index = 0; Index < pBtt->NFree; Index++) {
FlogPair.Flog[0].Lba = 0;
FlogPair.Flog[0].OldMap = FlogPair.Flog[0].NewMap = NextFreeLba;
FlogPair.Flog[0].Seq = 1;
/*
Write both btt_Flog structs in the pair, writing
the second one as all zeros.
*/
NVDIMM_VERB("Flog[%d] Entry off=%x initial %d + zero = %d",
Index, FlogEntryOffset, NextFreeLba, NextFreeLba);
ReturnCode = WriteNamespaceBytes
(pBtt->pNamespace,
FlogEntryOffset, &FlogPair, sizeof(BTT_FLOG_PAIR));
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
FlogEntryOffset += sizeof(BTT_FLOG_PAIR);
FlogEntryOffset = ROUNDUP(FlogEntryOffset, BTT_FLOG_PAIR_ALIGN);
NextFreeLba++;
}
// Construct the BTT Info block and write it out at both the beginning and end of the arena.
ZeroMem(pBttInfo, sizeof(*pBttInfo));
CopyMem_S(pBttInfo->Sig, sizeof(pBttInfo->Sig), Sig, BTTINFO_SIG_LEN);
CopyMem_S(&pBttInfo->Uuid, sizeof(pBttInfo->Uuid), &pBtt->Uuid, sizeof(GUID));
CopyMem_S(&pBttInfo->ParentUuid, sizeof(pBttInfo->ParentUuid), &pBtt->ParentUuid, sizeof(GUID));
// Check BTT version. 2.0 offset is 0, 1.1 offset is 4K.
if (pBtt->PrimaryInfoOffset == BTT_PRIMARY_INFO_BLOCK_OFFSET) {
pBttInfo->Major = 2;
pBttInfo->Minor = 0;
} else {
pBttInfo->Major = 1;
pBttInfo->Minor = 1;
}
pBttInfo->ExternalLbaSize = pBtt->LbaSize;
pBttInfo->ExternalNLbas = ExternalNLbas;
pBttInfo->InternalLbaSize = InternalLbaSize;
pBttInfo->InternalNLbas = InternalNLbas;
pBttInfo->NFree = pBtt->NFree;
pBttInfo->InfoSize = sizeof(*pBttInfo);
// Following offsets are relative to the beginning of this arena info block
pBttInfo->NextOffset = NextOffset;
pBttInfo->DataOffset = DataOffset;
pBttInfo->MapOffset = MapOffset;
pBttInfo->FlogOffset = FlogOffset;
pBttInfo->InfoOffset = InfoOffset;
NVDIMM_DBG("BTT info block offsets:");
NVDIMM_DBG("DataOffset 0x%012lx", pBttInfo->DataOffset);
NVDIMM_DBG("MapOffset 0x%012lx", pBttInfo->MapOffset);
NVDIMM_DBG("FlogOffset 0x%012lx", pBttInfo->FlogOffset);
NVDIMM_DBG("Info2Offset 0x%012lx", pBttInfo->InfoOffset);
NVDIMM_DBG("NextOffset 0x%012lx", pBttInfo->NextOffset);
ChecksumOperations((VOID *)pBttInfo, sizeof(BTT_INFO), &pBttInfo->Checksum, TRUE);
ReturnCode = WriteNamespaceBytes(pBtt->pNamespace, ArenaOffset, pBttInfo, sizeof(BTT_INFO));
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
ReturnCode = WriteNamespaceBytes(pBtt->pNamespace, ArenaOffset + InfoOffset, pBttInfo, sizeof(BTT_INFO));
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
ArenaOffset += NextOffset;
}
if (pBtt->NArenas != ArenaNumber) {
ReturnCode = EFI_ABORTED;
goto Finish;
}
pBtt->NLbas = TotalNLbas;
if (Write) {
//The layout is written now, so load up the Arenas, and set laidout flag.
BttReadArenas(pBtt, pBtt->NArenas);
}
ReturnCode = EFI_SUCCESS;
Finish:
FREE_POOL_SAFE(pMap);
FREE_POOL_SAFE(pBttInfo);
return ReturnCode;
}
STATIC
EFI_STATUS
BttReadLayout(
IN BTT *pBtt
)
{
EFI_STATUS ReturnCode = EFI_SUCCESS;
UINT32 NArenas = 0;
UINT32 SmallestNFree = MAX_UINT32_VALUE;
UINT64 RawSize = 0;
UINT64 TotalNLbas = 0;
UINT64 ArenaOffset = 0;
BTT_INFO *pBttInfo = NULL;
NVDIMM_DBG("pBtt=%p", pBtt);
if (pBtt == NULL) {
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
pBttInfo = (BTT_INFO *) AllocateZeroPool(sizeof(*pBttInfo));
if (pBttInfo == NULL) {
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
pBtt->NFree = BTT_DEFAULT_NFREE;
RawSize = pBtt->RawSize;
ArenaOffset = pBtt->PrimaryInfoOffset;
// For each arena, see if there's a valid Info block
while(RawSize >= BTT_NAMESPACE_MIN_SIZE) {
NArenas++;
NVDIMM_DBG("ArenaOffset: %llx", ArenaOffset);
ReturnCode = ReadNamespaceBytes
(pBtt->pNamespace, ArenaOffset, pBttInfo, sizeof(BTT_INFO));
if(EFI_ERROR(ReturnCode)) {
goto Finish;
}
NVDIMM_DBG("BTT info block offsets:");
NVDIMM_DBG("DataOffset 0x%012lx", pBttInfo->DataOffset);
NVDIMM_DBG("MapOffset 0x%012lx", pBttInfo->MapOffset);
NVDIMM_DBG("FlogOffset 0x%012lx", pBttInfo->FlogOffset);
NVDIMM_DBG("Info2Offset 0x%012lx", pBttInfo->InfoOffset);
NVDIMM_DBG("NextOffset 0x%012lx", pBttInfo->NextOffset);
ReturnCode = BttReadInfo(pBttInfo, pBtt);
if (EFI_ERROR(ReturnCode)) {
/**
Failed to find complete BTT metadata. Just
calculate the NArenas and NLbas values that will
result when BttWriteLayout() gets called. This
allows checks against NLbas to work correctly
even before the layout is written.
Need to check for a backup info block.
If valid backup info block found, copy to primary info block.
See UEFI 2.7 6.3.5
**/
ReturnCode = BttWriteLayout(pBtt, FALSE);
goto Finish;
}
if(pBttInfo->ExternalLbaSize != pBtt->LbaSize) {
/* can't read it assuming the wrong block size */
NVDIMM_DBG("inconsistent LbaSize, ns: %d btt:%d", pBttInfo->ExternalLbaSize, pBtt->LbaSize);
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
if(pBttInfo->NFree == 0) {
NVDIMM_DBG("invalid NFree");
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
if(pBttInfo->ExternalNLbas == 0) {
NVDIMM_DBG("invalid ExternalNLbas");
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
if(pBttInfo->NextOffset &&(pBttInfo->NextOffset != BTT_MAX_ARENA_SIZE)) {
NVDIMM_DBG("invalid arena size: %llx", pBttInfo->NextOffset);
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
if(pBttInfo->NFree < SmallestNFree) {
SmallestNFree = pBttInfo->NFree;
}
TotalNLbas += pBttInfo->ExternalNLbas;
ArenaOffset += pBttInfo->NextOffset;
if(pBttInfo->NextOffset == 0) {
break;
}
if(pBttInfo->NextOffset > RawSize) {
NVDIMM_DBG("invalid next arena offset. Next: %llx RawSize: %llx", pBttInfo->NextOffset, RawSize);
ReturnCode = EFI_INVALID_PARAMETER;
goto Finish;
}
RawSize -= pBttInfo->NextOffset;
}
if(!NArenas) {
ReturnCode = EFI_ABORTED;
goto Finish;
}
pBtt->NArenas = NArenas;
pBtt->NLbas = TotalNLbas;
// All Arenas were valid. NFree should be the smallest value found among different arenas.
if(SmallestNFree < pBtt->NFree) {
pBtt->NFree = SmallestNFree;
}
// Load up Arenas.
ReturnCode = BttReadArenas(pBtt, NArenas);
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
Finish:
FREE_POOL_SAFE(pBttInfo);
return ReturnCode;
}
STATIC
EFI_STATUS
BttZeroBlock(
IN BTT *pBtt,
OUT VOID *pBuffer
)
{
if(!pBtt) {
return EFI_INVALID_PARAMETER;
}
ZeroMem(pBuffer, pBtt->LbaSize);
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
BttLbaToArenaLba(
IN BTT *pBtt,
IN UINT64 Lba,
OUT ARENAS **ppArena,
OUT UINT32 *PreMapLba
)
{
UINT8 Arena = 0;
if(!pBtt) {
return EFI_INVALID_PARAMETER;
}
if(!pBtt->Laidout) {
return EFI_ABORTED;
}
for(Arena = 0; Arena < pBtt->NArenas; Arena++) {
if(Lba < pBtt->Arenas [Arena].ExternalNLbas) {
break;
} else {
Lba -= pBtt->Arenas [Arena].ExternalNLbas;
}
}
if(Arena >= pBtt->NArenas) {
return EFI_ABORTED;
}
*ppArena = &pBtt->Arenas [Arena];
*PreMapLba = (UINT32)Lba;
NVDIMM_VERB("pArena=%p PreMapLBA=%x", *ppArena, *PreMapLba);
return EFI_SUCCESS;
}
/**
Read a block from a btt namespace
@param [in] pBtt namespace handle
@param [in] Lba Logical block address to be read
@param [out] pBuffer Read result Buffer pointer
@retval EFI_SUCCESS if the routine succeeds
**/
EFI_STATUS
BttRead(
IN BTT *pBtt,
IN UINT64 Lba,
OUT VOID *pBuffer
)
{
ARENAS *pArena = NULL;
UINT32 PreMapLba = 0;
UINT64 MapEntryOffset = 0;
BTT_MAP_ENTRIES Entry;
UINT8 PosInPreMapLba = 0;
UINT32 CurrentMap = 0;
INT8 MapCheck = 0;
BTT_MAP_ENTRIES LatestEntry;
UINT32 LatestMap = 0;
UINT64 DataBlockOffset = 0;
UINT32 LbaOut = 0;
EFI_STATUS RetVal = EFI_SUCCESS;
SetMem(&Entry, sizeof(Entry), 0x0);
SetMem(&LatestEntry, sizeof(LatestEntry), 0x0);
NVDIMM_VERB("pBtt=%p LBA=%x reading!", pBtt, Lba);
if(!pBtt || !pBuffer) {
return EFI_INVALID_PARAMETER;
}
EFI_STATUS Result = IsLbaValid(pBtt, Lba);
if(EFI_ERROR(Result)) {
return Result;
}
/* if there's no layout written yet, all reads come back as zeros */
if(!pBtt->Laidout) {
return BttZeroBlock(pBtt, pBuffer);
}
/* find which arena LBA lives in, and the offset to the map Entry */
Result = BttLbaToArenaLba(pBtt, Lba, &pArena, &PreMapLba);
if(EFI_ERROR(Result))
return Result;
/* convert pre-map LBA into an offset into the map */
MapEntryOffset = pArena->MapOffset + sizeof(BTT_MAP_ENTRIES) * BttGetMapFromLba(PreMapLba);
/*
Read the current map Entry to get the post-map LBA for the data
block read.
*/
Result = ReadNamespaceBytes
(pBtt->pNamespace, MapEntryOffset, &Entry, sizeof(BTT_MAP_ENTRIES));
if(EFI_ERROR(Result)) {
return Result;
}
PosInPreMapLba = BttGetPositionInMapFromLba(PreMapLba);
CurrentMap = Entry.MapEntryLba[PosInPreMapLba];
/*
Retries come back to the top of this loop(for a rare case where
the map is changed by another thread doing writes to the same LBA).
*/
while(MapCheck == 0) {
if(MapEntryIsError(CurrentMap)) {
NVDIMM_DBG("EIO due to map Entry Error flag");
return EFI_ABORTED;
}
if(MapEntryIsZero(CurrentMap)) {
return BttZeroBlock(pBtt, pBuffer);
}
/*
Record the post-map LBA in the read tracking table during
the read. The write will check Entries in the read tracking
table before allocating a block for a write, waiting for
outstanding reads on that block to complete.
No need to mask off ERROR and ZERO bits since the above
checks make sure they are clear at this point.
*/
pArena->pRtt[0] = CurrentMap;
/*
In case this thread was preempted between reading Entry and
storing it in the Rtt, check to see if the map changed. If
it changed, the block about to be read is at least free now
(in the Flog, but that's okay since the data will still be
undisturbed) and potentially allocated and being used for
another write(data disturbed, so not okay to continue).
*/
Result = ReadNamespaceBytes
(pBtt->pNamespace,
MapEntryOffset, &LatestEntry, sizeof(BTT_MAP_ENTRIES));
if(EFI_ERROR(Result)) {
pArena->pRtt[0] = BTT_MAP_ENTRY_ERROR;
return Result;
}
LatestMap = LatestEntry.MapEntryLba [PosInPreMapLba];
if(CurrentMap == LatestMap) {
MapCheck++; /* map stayed the same */
}
else {
CurrentMap = LatestMap; /* try again */
}
}
/*
It is safe to read the block now, since the Rtt protects the
block from getting re-allocated to something else by a write.
Convert the offset in bytes to block offset
*/
// If map entry is in the initial state (post map lba should be zero as well),
// use the pre map lba
if (MapEntryIsInitial(CurrentMap)) {
// Ignore whatever is in current map variable and set to pre map lba
LbaOut = PreMapLba;
} else {
LbaOut = CurrentMap & BTT_MAP_ENTRY_LBA_MASK;
}
DataBlockOffset = pArena->DataOffset + (UINT64)(LbaOut) * pArena->InternalLbaSize;
NVDIMM_DBG("LBA=%x->LBABtt=%x, Offset[B]=%lx",
Lba, (UINT64) LbaOut, DataBlockOffset);
RetVal = ReadNamespaceBytes
(pBtt->pNamespace, DataBlockOffset, pBuffer, pBtt->LbaSize);
/* done with read, so clear out Rtt Entry */
pArena->pRtt[0] = BTT_MAP_ENTRY_ERROR;
return RetVal;
}
EFI_STATUS
BttCheck(
IN BTT *pBtt
)
{
EFI_STATUS retVal = EFI_SUCCESS;
ARENAS *pArena = NULL;
UINT8 Index = 0;
NVDIMM_DBG("Btt %p", pBtt);
if(!pBtt) {
return EFI_INVALID_PARAMETER;
}
if(!pBtt->Laidout) {
/* consistent by definition */
NVDIMM_DBG("no layout yet");
return retVal;
}
// for each arena
pArena = pBtt->Arenas;
for(Index = 0; Index < pBtt->NArenas; Index++) {
// Perform the consistency checks for the arena.
retVal = BttCheckArena(pBtt, pArena);
if(EFI_ERROR(retVal)) {
return retVal;
}
}
return retVal;
}
STATIC
EFI_STATUS
BttCheckArena(
IN BTT *pBtt,
IN ARENAS *pArena
)
{
EFI_STATUS ReturnCode = EFI_INVALID_PARAMETER;
UINT32 Bitmapsize = 0;
UINT8 *pBitmap = NULL;
UINT32 MapEntry = 0;
UINT32 RemainingMaps = 0;
UINT32 MapsCount = 0;
UINT8 MapEndPosition = 0;
BTT_MAP_ENTRIES *pMap = NULL;
UINT64 MapSize = 0;
UINT32 MapBlock = 0;
UINT32 Index = 0;
UINT8 Position = 0;
UINT8 CurrentFlogIndex = 0;
UINT32 Entry = 0;
NVDIMM_DBG("pBtt %p pArena %p", pBtt, pArena);
if (pBtt == NULL || pArena == NULL) {
goto Finish;
}
pMap = (BTT_MAP_ENTRIES *) AllocateZeroPool(BTT_ALIGNMENT);
if (pMap == NULL) {
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
Bitmapsize = HOW_MANY(pArena->InternalNLbas, 8);
pBitmap = (UINT8 *)AllocatePool(Bitmapsize);
if(!pBitmap) {
NVDIMM_DBG("!Memory allocation for Bitmap");
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
ZeroMem(pBitmap, Bitmapsize);
/**
Go through every post-map LBA mentioned in the map and make sure
there are no duplicates. Bitmap is used to track which LBAs have
been seen so far.
**/
MapsCount = BttGetMapFromLba(pArena->ExternalNLbas);
MapEndPosition = BttGetPositionInMapFromLba(pArena->ExternalNLbas);
MapSize = ROUNDUP(pArena->ExternalNLbas * BTT_MAP_ENTRY_SIZE, BTT_ALIGNMENT);
// Read entire map layout in 4k blocks
for(MapBlock = 0; MapBlock <= MapSize / BTT_ALIGNMENT; MapBlock++) {
ReturnCode = ReadNamespaceBytes
(pBtt->pNamespace, pArena->MapOffset +(MapBlock * BTT_ALIGNMENT), pMap, BTT_ALIGNMENT);
if(EFI_ERROR(ReturnCode)) {
goto Finish;
}
if(MapsCount > MapBlock * BTT_ALIGNMENT / sizeof(BTT_MAP_ENTRIES)) { //protect overturn
RemainingMaps = MapsCount - MapBlock * BTT_ALIGNMENT / sizeof(BTT_MAP_ENTRIES);
}
else {
break;
}
for (Index = 0; Index < BTT_ALIGNMENT / sizeof(BTT_MAP_ENTRIES); Index++) {
if(Index > RemainingMaps) { //last BTT_MAP_ENTRIES within this MapBlock
break;
}
for (Position = 0; Position < BTT_MAP_LOCK_ALIGN / BTT_MAP_ENTRY_SIZE; Position++) {
//End the loop for the last Lba
if(Index == RemainingMaps && Position == MapEndPosition) {
break;
}
MapEntry = pMap [Index].MapEntryLba [Position];
/* for debug, dump zero map Entries */
if((MapEntry & BTT_MAP_ENTRY_ZERO) == 0) {
NVDIMM_VERB("map[%d]: %d%s%s", Index, MapEntry & BTT_MAP_ENTRY_LBA_MASK,
(MapEntry & BTT_MAP_ENTRY_ERROR) ? " ERROR" : "",(MapEntry & BTT_MAP_ENTRY_ZERO) ? " ZERO" : "");
}
if (MapEntryIsInitial(MapEntry)) {
MapEntry = MapBlock * (BTT_ALIGNMENT / BTT_MAP_ENTRY_SIZE) + Index *
(sizeof(BTT_MAP_ENTRIES) / BTT_MAP_ENTRY_SIZE) + Position;
} else {
MapEntry &= BTT_MAP_ENTRY_LBA_MASK;
}
/* check if entry is valid */
if(MapEntry >= pArena->ExternalNLbas) {
NVDIMM_DBG("map[%d] Entry out of bounds: %d", Index, MapEntry);
goto Finish;
}
if (IS_BIT_SET(pBitmap, MapEntry)) {
NVDIMM_DBG("map[%d] duplicate Entry: %d", Index, MapEntry);
ReturnCode = EFI_ABORTED;
goto Finish;
} else {
SET_BIT(pBitmap, MapEntry);
}
}
}
}
/*
Go through the free blocks in the Flog, adding them to Bitmap
and checking for duplications. It is sufficient to read the
run-time Flog here, avoiding more calls to NsRead.
*/
for (Index = 0; Index < pBtt->NFree; Index++) {
CurrentFlogIndex = 1 - pArena->pFlogs[Index].Next;
Entry = pArena->pFlogs[Index].FlogPair.Flog[CurrentFlogIndex].OldMap;
Entry &= BTT_MAP_ENTRY_LBA_MASK;
if (IS_BIT_SET(pBitmap, Entry)) {
NVDIMM_DBG("Flog[%d] duplicate Entry: %d", Index, Entry);
ReturnCode = EFI_ABORTED;
goto Finish;
} else {
SET_BIT(pBitmap, Entry);
}
}
/*
Make sure every possible post-map LBA was accounted for
in the two loops above.
*/
for(Index = 0; Index < pArena->InternalNLbas; Index++) {
if (IS_BIT_CLEARED(pBitmap, Index)) {
NVDIMM_DBG("Unreferenced LBA: %d", Index);
ReturnCode = EFI_ABORTED;
goto Finish;
}
}
ReturnCode = EFI_SUCCESS;
Finish:
FREE_POOL_SAFE(pBitmap);
FREE_POOL_SAFE(pMap);
return ReturnCode;
}
STATIC
EFI_STATUS
BttMapLock(
IN BTT *pBtt,
IN ARENAS *pArena,
OUT BTT_MAP_ENTRIES *Entry,
IN UINT32 PreMapLba
)
{
UINT32 MapNumber = 0;
UINT32 MapPosition = 0;
UINT64 MapEntryOffset = 0;
UINT32 BttMapLockNum = 0;
if(!pBtt || !pArena) {
return EFI_INVALID_PARAMETER;
}
MapNumber = BttGetMapFromLba(PreMapLba);
MapPosition = BttGetPositionInMapFromLba(PreMapLba);
MapEntryOffset = pArena->MapOffset + sizeof(BTT_MAP_ENTRIES) * MapNumber;
/*
BttMapLock[] contains NFree locks which are used to protect the map
from concurrent access to the same cache line. The index into
BttMapLock[] is calculated by looking at the byte offset into the map
(PreMapLba * BTT_MAP_ENTRY_SIZE), figuring out how many cache lines
that is into the map that is(dividing by BTT_MAP_LOCK_ALIGN), and
then selecting one of nfree locks(the modulo at the end).
*/
BttMapLockNum = MapNumber % pBtt->NFree;
/* read the old map Entry */
EFI_STATUS ReadResult = ReadNamespaceBytes
(pBtt->pNamespace, MapEntryOffset, Entry, sizeof(BTT_MAP_ENTRIES));
if(EFI_ERROR(ReadResult)) {
return ReadResult;
}
/* if map entry is in its initial state return pre_map_lba */
if (MapEntryIsInitial(Entry->MapEntryLba[MapPosition])) {
Entry->MapEntryLba[MapPosition] = PreMapLba | BTT_MAP_ENTRY_NORMAL;
}
NVDIMM_VERB("locked maps[%u], LBAs: %u - %u", BttMapLockNum, Entry->MapEntryLba[0] & BTT_MAP_ENTRY_LBA_MASK,
Entry->MapEntryLba[CACHE_LINE_SIZE / sizeof(UINT32) - 1] & BTT_MAP_ENTRY_LBA_MASK);
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
BttMapUnlock(
IN BTT *pBtt,
IN OUT ARENAS *pArena,
IN BTT_MAP_ENTRIES *Entry,
IN UINT32 PreMapLba
)
{
UINT32 MapNumber = 0;
UINT64 MapEntryOffset = 0;
UINT32 BttMapLockNum = 0;
NVDIMM_VERB("pBtt %p pArena %p Entry %p PreMapLba %u", pBtt, pArena, Entry, PreMapLba);
if(!pBtt || !pArena) {
return EFI_INVALID_PARAMETER;
}
MapNumber = BttGetMapFromLba(PreMapLba);
MapEntryOffset = pArena->MapOffset + sizeof(BTT_MAP_ENTRIES) * MapNumber;
BttMapLockNum = MapNumber % pBtt->NFree;
/* write the new map Entry */
EFI_STATUS RetVal = WriteNamespaceBytes
(pBtt->pNamespace,
MapEntryOffset, Entry, sizeof(BTT_MAP_ENTRIES));
//pArena->BttMapLock [BttMapLockNum].IndSpinlockRelease(pMapLockHandle);
NVDIMM_DBG("unlocked maps[%u], LBAs: %u - %u", BttMapLockNum, Entry->MapEntryLba [0] & BTT_MAP_ENTRY_LBA_MASK,
Entry->MapEntryLba [CACHE_LINE_SIZE / sizeof(UINT32) - 1] & BTT_MAP_ENTRY_LBA_MASK);
return RetVal;
}
/**
Writes a block to a btt namespace
@param [in] pBtt namespace handle
@param [in] Lba Logical block address to be written
@param [in] pBuffer Buffer pointer to the block to be written
@retval EFI_SUCCESS if the routine succeeds
**/
EFI_STATUS
BttWrite(
IN BTT *pBtt,
IN UINT64 Lba,
IN VOID *pBuffer
)
{
ARENAS *pArena = NULL;
UINT32 PreMapLba = 0;
UINT8 CurrentFlogIndex = 0;
UINT32 FreeMap = 0;
UINT32 Index = 0;
UINT64 DataBlockOffset = 0;
BTT_MAP_ENTRIES MapEntry;
UINT8 PosInEntry = 0;
UINT32 OldMap = 0;
NVDIMM_VERB("pBtt=%p LBA=%x writing!", pBtt, Lba);
SetMem(&MapEntry, sizeof(MapEntry), 0x0);
if(!pBtt) {
return EFI_INVALID_PARAMETER;
}
EFI_STATUS RetVal = IsLbaValid(pBtt, Lba);
if(EFI_ERROR(RetVal)) {
return RetVal;
}
/* first write through here will initialize the metadata layout */
if(!pBtt->Laidout) {
RetVal = BttWriteLayout(pBtt, TRUE);
if(EFI_ERROR(RetVal)) {
return RetVal;
}
}
/* find which arena LBA lives in, and the offset to the map Entry */
RetVal = BttLbaToArenaLba(pBtt, Lba, &pArena, &PreMapLba);
if(EFI_ERROR(RetVal)) {
return RetVal;
}
/* if the arena is in an Error state, writing is not allowed */
if(pArena->Flags & BTTINFO_FLAG_ERROR_MASK) {
NVDIMM_DBG("EIO due to BttInfo Error Flags 0x%x", pArena->Flags & BTTINFO_FLAG_ERROR_MASK);
return EFI_ABORTED;
}
/*
This routine was passed a unique "Lane" which is an index
into the Flog. That means the free block held by Flog[Lane]
is assigned to this thread and to no other threads(no additional
locking required). So start by performing the write to the
free block. It is only safe to write to a free block if it
doesn't appear in the read tracking table, so scan that first
and if found, wait for the thread reading from it to finish.
*/
CurrentFlogIndex = 1 - pArena->pFlogs[0].Next;
FreeMap = (pArena->pFlogs[0].FlogPair.Flog[CurrentFlogIndex].OldMap & BTT_MAP_ENTRY_LBA_MASK) | BTT_MAP_ENTRY_NORMAL;
NVDIMM_VERB("FreeMap=%x(before mask %x)", FreeMap, pArena->pFlogs[0].FlogPair.Flog[CurrentFlogIndex].OldMap);
/* wait for other threads to finish any reads on free block */
for(Index = 0; Index < pBtt->NLanes; Index++) {
while(pArena->pRtt[Index] == FreeMap) {
;
}
} // to be deleted in UEFI
// it is now safe to perform write to the free block
DataBlockOffset = pArena->DataOffset + (UINT64)(FreeMap & BTT_MAP_ENTRY_LBA_MASK) * pArena->InternalLbaSize;
NVDIMM_DBG("LBA=%x->LBABtt=%x Offset[B]=%lx",
Lba, (UINT64) FreeMap & BTT_MAP_ENTRY_LBA_MASK, DataBlockOffset);
RetVal = WriteNamespaceBytes
(pBtt->pNamespace,
DataBlockOffset, pBuffer, pBtt->LbaSize);
if(EFI_ERROR(RetVal)) {
return RetVal;
}
// Make the new block active atomically by updating the on-media Flog and then updating the map.
RetVal = BttMapLock(pBtt, pArena, &MapEntry, PreMapLba);
if(EFI_ERROR(RetVal)) {
return RetVal;
}
/* update the Flog */
PosInEntry = BttGetPositionInMapFromLba(PreMapLba);
OldMap = MapEntry.MapEntryLba[PosInEntry];
RetVal = BttFlogUpdate(pBtt, pArena, PreMapLba, OldMap, FreeMap);
if(EFI_ERROR(RetVal)) {
NVDIMM_DBG("Could not update the BTT Flog!\npBtt %p pArena %p PreMapLba %u", pBtt, pArena, PreMapLba);
return RetVal;
}
MapEntry.MapEntryLba [PosInEntry] = FreeMap;
RetVal = BttMapUnlock(pBtt, pArena, &MapEntry, PreMapLba);
if(EFI_ERROR(RetVal)) {
BttSetArenaError(pBtt, pArena);
return RetVal;
}
return EFI_SUCCESS;
}
EFI_STATUS
BttArenaSetFlag(
IN BTT *pBtt,
IN OUT ARENAS *pArena,
IN UINT32 SetFlag
)
{
EFI_STATUS ReturnCode = EFI_SUCCESS;
UINT64 ArenaOff = 0;
BTT_INFO *pBttInfo = NULL;
/* update runtime state */
pArena->Flags = SetFlag;
if (!pBtt->Laidout) {
/* no layout yet to update */
ReturnCode = EFI_ABORTED;
goto Finish;
}
pBttInfo = (BTT_INFO *) AllocateZeroPool(sizeof(*pBttInfo));
if (pBttInfo == NULL) {
ReturnCode = EFI_OUT_OF_RESOURCES;
goto Finish;
}
/*
Read, modify and write out the info block
at both the beginning and end of the arena.
*/
ArenaOff = pArena->StartOffset;
/* protect from simultaneous writes to the layout */
ReturnCode = ReadNamespaceBytes
(pBtt->pNamespace, ArenaOff, pBttInfo, sizeof(BTT_INFO));
if (EFI_ERROR(ReturnCode)) {
goto Finish;
}
/* update flags */
pBttInfo->Flags |= SetFlag;
/* update checksum */
ChecksumOperations((VOID *)pBttInfo, sizeof(BTT_INFO), &pBttInfo->Checksum, TRUE);
ReturnCode = WriteNamespaceBytes
(pBtt->pNamespace, ArenaOff, pBttInfo, sizeof(BTT_INFO));
if(EFI_ERROR(ReturnCode)) {
goto Finish;
}
ReturnCode = WriteNamespaceBytes
(pBtt->pNamespace, ArenaOff + pBttInfo->InfoOffset, pBttInfo, sizeof(BTT_INFO));
if(EFI_ERROR(ReturnCode)) {
goto Finish;
}
Finish:
FREE_POOL_SAFE(pBttInfo);
return ReturnCode;
}
EFI_STATUS
BttSetArenaError(
IN BTT *pBtt,
IN OUT ARENAS *pArena
)
{
return BttArenaSetFlag(pBtt, pArena, BTTINFO_FLAG_ERROR);
}
VOID
BttRelease(
IN OUT BTT *pBtt
)
{
UINT8 Index = 0;
NVDIMM_DBG("pBtt %p", pBtt);
ASSERT(pBtt != NULL);
if(pBtt) {
if(pBtt->Arenas) {
for(Index = 0; Index < pBtt->NArenas; Index++) {
if(pBtt->Arenas[Index].pFlogs) {
FreePool(pBtt->Arenas[Index].pFlogs);
}
if(pBtt->Arenas[Index].pRtt) {
FreePool((UINT32 *)pBtt->Arenas[Index].pRtt);
}
//if(pBtt->Arenas[Index].BttMapLock) {
// FreePool(pBtt->Arenas[Index].BttMapLock);
//}
}
FreePool(pBtt->Arenas);
}
FreePool(pBtt);
}
}
UINT32
BttGetMapFromLba(
IN UINT32 Lba
)
{
return Lba / (BTT_MAP_LOCK_ALIGN / BTT_MAP_ENTRY_SIZE);
}
UINT8
BttGetPositionInMapFromLba(
IN UINT32 Lba
)
{
return Lba % (BTT_MAP_LOCK_ALIGN / BTT_MAP_ENTRY_SIZE);
}
|
c09a870a5ffa24ec53635c454d2c6cd04002175e
|
085242ce442d9d4ad0cf6df9464b3b35e54bbe4c
|
/src/libponyc/ast/lexer.c
|
4e95a697e568c76ac02611809e2703b3ddf1fe4a
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] |
permissive
|
ponylang/ponyc
|
4c0a0b4a138b4213b4d67424ed313f322d17a87a
|
c393500e8f8222d648f803f78a705baf452bce05
|
refs/heads/main
| 2023-08-19T03:26:37.611328
| 2023-08-18T13:22:12
| 2023-08-18T14:27:49
| 6,667,084
| 4,901
| 572
|
BSD-2-Clause
| 2023-09-12T18:17:34
| 2012-11-13T07:38:25
|
C
|
UTF-8
|
C
| false
| false
| 31,208
|
c
|
lexer.c
|
#include "error.h"
#include "lexer.h"
#include "lexint.h"
#include "token.h"
#include "stringtab.h"
#include "../../libponyrt/mem/pool.h"
#include "ponyassert.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
struct lexer_t
{
source_t* source;
errors_t* errors;
bool allow_test_symbols;
// Information about next unused character in file
size_t ptr;
size_t len;
size_t line;
size_t pos;
bool newline;
// Position of current token
size_t token_line;
size_t token_pos;
// Buffer containing current token text
char* buffer;
size_t buflen; // Length of buffer currently used
size_t alloc; // Space allocated for buffer
};
typedef struct lextoken_t
{
const char* text;
token_id id;
} lextoken_t;
#define MAX_SYMBOL_LENGTH 3
// Note that for symbols where one symbol starts with another, the longer one
// must appear first in this list.
// For example -> must appear before -
static const lextoken_t symbols[] =
{
{ "...", TK_ELLIPSIS },
{ "->", TK_ARROW },
{ "=>", TK_DBLARROW },
{ "<<~", TK_LSHIFT_TILDE },
{ ">>~", TK_RSHIFT_TILDE },
{ "==~", TK_EQ_TILDE },
{ "!=~", TK_NE_TILDE },
{ "<=~", TK_LE_TILDE },
{ ">=~", TK_GE_TILDE },
{ "<~", TK_LT_TILDE },
{ ">~", TK_GT_TILDE },
{ "+~", TK_PLUS_TILDE },
{ "-~", TK_MINUS_TILDE },
{ "*~", TK_MULTIPLY_TILDE },
{ "/~", TK_DIVIDE_TILDE },
{ "%%~", TK_MOD_TILDE },
{ "%~", TK_REM_TILDE },
{ "<<", TK_LSHIFT },
{ ">>", TK_RSHIFT },
{ "==", TK_EQ },
{ "!=", TK_NE },
{ "<=", TK_LE },
{ ">=", TK_GE },
{ ".>", TK_CHAIN },
{ "<:", TK_SUBTYPE },
{ "\\", TK_BACKSLASH },
{ "@{", TK_AT_LBRACE },
{ "{", TK_LBRACE },
{ "}", TK_RBRACE },
{ "(", TK_LPAREN },
{ ")", TK_RPAREN },
{ "[", TK_LSQUARE },
{ "]", TK_RSQUARE },
{ ",", TK_COMMA },
{ ".", TK_DOT },
{ "~", TK_TILDE },
{ ":", TK_COLON },
{ ";", TK_SEMI },
{ "=", TK_ASSIGN },
{ "+", TK_PLUS },
{ "-", TK_MINUS },
{ "*", TK_MULTIPLY },
{ "/", TK_DIVIDE },
{ "%%", TK_MOD },
{ "%", TK_REM },
{ "@", TK_AT },
{ "<", TK_LT },
{ ">", TK_GT },
{ "|", TK_PIPE },
{ "&", TK_ISECTTYPE },
{ "^", TK_EPHEMERAL },
{ "!", TK_ALIASED },
{ "?", TK_QUESTION },
{ "-", TK_UNARY_MINUS },
{ "#", TK_CONSTANT },
{ "(", TK_LPAREN_NEW },
{ "[", TK_LSQUARE_NEW },
{ "-~", TK_MINUS_TILDE_NEW },
{ "-", TK_MINUS_NEW },
{ NULL, (token_id)0 }
};
static const lextoken_t keywords[] =
{
{ "compile_intrinsic", TK_COMPILE_INTRINSIC },
{ "use", TK_USE },
{ "type", TK_TYPE },
{ "interface", TK_INTERFACE },
{ "trait", TK_TRAIT },
{ "primitive", TK_PRIMITIVE },
{ "struct", TK_STRUCT },
{ "class", TK_CLASS },
{ "actor", TK_ACTOR },
{ "object", TK_OBJECT },
{ "as", TK_AS },
{ "is", TK_IS },
{ "isnt", TK_ISNT },
{ "var", TK_VAR },
{ "let", TK_LET },
{ "embed", TK_EMBED },
{ "new", TK_NEW },
{ "fun", TK_FUN },
{ "be", TK_BE },
{ "iso", TK_ISO },
{ "trn", TK_TRN },
{ "ref", TK_REF },
{ "val", TK_VAL },
{ "box", TK_BOX },
{ "tag", TK_TAG },
{ "this", TK_THIS },
{ "return", TK_RETURN },
{ "break", TK_BREAK },
{ "continue", TK_CONTINUE },
{ "consume", TK_CONSUME },
{ "recover", TK_RECOVER },
{ "if", TK_IF },
{ "ifdef", TK_IFDEF },
{ "iftype", TK_IFTYPE_SET },
{ "then", TK_THEN },
{ "else", TK_ELSE },
{ "elseif", TK_ELSEIF },
{ "end", TK_END },
{ "for", TK_FOR },
{ "in", TK_IN },
{ "while", TK_WHILE },
{ "do", TK_DO },
{ "repeat", TK_REPEAT },
{ "until", TK_UNTIL },
{ "match", TK_MATCH },
{ "where", TK_WHERE },
{ "try", TK_TRY },
{ "with", TK_WITH },
{ "error", TK_ERROR },
{ "compile_error", TK_COMPILE_ERROR },
{ "not", TK_NOT },
{ "and", TK_AND },
{ "or", TK_OR },
{ "xor", TK_XOR },
{ "digestof", TK_DIGESTOF },
{ "addressof", TK_ADDRESS },
{ "__loc", TK_LOCATION },
{ "true", TK_TRUE },
{ "false", TK_FALSE },
// #keywords.
{ "#read", TK_CAP_READ },
{ "#send", TK_CAP_SEND },
{ "#share", TK_CAP_SHARE },
{ "#alias", TK_CAP_ALIAS },
{ "#any", TK_CAP_ANY },
// $keywords, for testing only.
{ "$noseq", TK_TEST_NO_SEQ },
{ "$scope", TK_TEST_SEQ_SCOPE },
{ "$try_no_check", TK_TEST_TRY_NO_CHECK },
{ "$aliased", TK_TEST_ALIASED },
{ "$updatearg", TK_TEST_UPDATEARG },
{ "$extra", TK_TEST_EXTRA },
{ "$ifdefand", TK_IFDEFAND },
{ "$ifdefor", TK_IFDEFOR },
{ "$ifdefnot", TK_IFDEFNOT },
{ "$flag", TK_IFDEFFLAG },
{ "$let", TK_MATCH_CAPTURE },
{ "$dontcare", TK_MATCH_DONTCARE },
{ "$iftype", TK_IFTYPE },
{ NULL, (token_id)0 }
};
static const lextoken_t abstract[] =
{
{ "x", TK_NONE }, // Needed for AST printing
{ "program", TK_PROGRAM },
{ "package", TK_PACKAGE },
{ "module", TK_MODULE },
{ "members", TK_MEMBERS },
{ "fvar", TK_FVAR },
{ "flet", TK_FLET },
{ "dontcare", TK_DONTCARE },
{ "ffidecl", TK_FFIDECL },
{ "fficall", TK_FFICALL },
{ "provides", TK_PROVIDES },
{ "uniontype", TK_UNIONTYPE },
//{ "isecttype", TK_ISECTTYPE }, // Now treated as the symbol '&'
{ "tupletype", TK_TUPLETYPE },
{ "nominal", TK_NOMINAL },
{ "thistype", TK_THISTYPE },
{ "funtype", TK_FUNTYPE },
{ "lambdatype", TK_LAMBDATYPE },
{ "barelambdatype", TK_BARELAMBDATYPE },
{ "dontcaretype", TK_DONTCARETYPE },
{ "infer", TK_INFERTYPE },
{ "errortype", TK_ERRORTYPE },
{ "literal", TK_LITERAL },
{ "branch", TK_LITERALBRANCH },
{ "opliteral", TK_OPERATORLITERAL },
{ "typeparams", TK_TYPEPARAMS },
{ "typeparam", TK_TYPEPARAM },
{ "valueformalparam", TK_VALUEFORMALPARAM },
{ "params", TK_PARAMS },
{ "param", TK_PARAM },
{ "typeargs", TK_TYPEARGS },
{ "valueformalarg", TK_VALUEFORMALARG },
{ "positionalargs", TK_POSITIONALARGS },
{ "namedargs", TK_NAMEDARGS },
{ "namedarg", TK_NAMEDARG },
{ "updatearg", TK_UPDATEARG },
{ "lambdacaptures", TK_LAMBDACAPTURES },
{ "lambdacapture", TK_LAMBDACAPTURE },
{ "lambda", TK_LAMBDA },
{ "barelambda", TK_BARELAMBDA },
{ "seq", TK_SEQ },
{ "qualify", TK_QUALIFY },
{ "call", TK_CALL },
{ "tuple", TK_TUPLE },
{ "array", TK_ARRAY },
{ "cases", TK_CASES },
{ "case", TK_CASE },
{ "try", TK_TRY_NO_CHECK },
{ "reference", TK_REFERENCE },
{ "packageref", TK_PACKAGEREF },
{ "typeref", TK_TYPEREF },
{ "typeparamref", TK_TYPEPARAMREF },
{ "newref", TK_NEWREF },
{ "newberef", TK_NEWBEREF },
{ "beref", TK_BEREF },
{ "funref", TK_FUNREF },
{ "fvarref", TK_FVARREF },
{ "fletref", TK_FLETREF },
{ "tupleelemref", TK_TUPLEELEMREF },
{ "embedref", TK_EMBEDREF },
{ "varref", TK_VARREF },
{ "letref", TK_LETREF },
{ "paramref", TK_PARAMREF },
{ "dontcareref", TK_DONTCAREREF },
{ "newapp", TK_NEWAPP },
{ "beapp", TK_BEAPP },
{ "funapp", TK_FUNAPP },
{ "bechain", TK_BECHAIN },
{ "funchain", TK_FUNCHAIN },
{ "annotation", TK_ANNOTATION },
{ "disposingblock", TK_DISPOSING_BLOCK },
{ "\\n", TK_NEWLINE },
{NULL, (token_id)0}
};
// Report an error at the specified location
static void lex_error_at(lexer_t* lexer, size_t line, size_t pos,
const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
errorv(lexer->errors, lexer->source, line, pos, fmt, ap);
va_end(ap);
}
// Report an error for the current token
static void lex_error(lexer_t* lexer, const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
errorv(lexer->errors, lexer->source, lexer->token_line, lexer->token_pos,
fmt, ap);
va_end(ap);
}
static bool is_eof(lexer_t* lexer)
{
return lexer->len == 0;
}
// Append the given character to the current token text
static void append_to_token(lexer_t* lexer, char c)
{
if(lexer->buflen >= lexer->alloc)
{
size_t new_len = (lexer->alloc > 0) ? lexer->alloc << 1 : 64;
lexer->buffer =
(char*)ponyint_pool_realloc_size(lexer->alloc, new_len, lexer->buffer);
lexer->alloc = new_len;
}
lexer->buffer[lexer->buflen] = c;
lexer->buflen++;
}
// Make a token with the specified ID and no token text
static token_t* make_token(lexer_t* lexer, token_id id)
{
token_t* t = token_new(id);
token_set_pos(t, lexer->source, lexer->token_line, lexer->token_pos);
return t;
}
// Make a token with the specified ID and current token text
static token_t* make_token_with_text(lexer_t* lexer, token_id id)
{
token_t* t = make_token(lexer, id);
if(lexer->buffer == NULL) // No text for token
token_set_string(t, stringtab(""), 0);
else
token_set_string(t, stringtab_len(lexer->buffer, lexer->buflen),
lexer->buflen);
return t;
}
/* Consume the specified number of characters from our source.
* Only the first character may be a newline.
*/
static void consume_chars(lexer_t* lexer, size_t count)
{
pony_assert(lexer->len >= count);
if(count == 0)
return;
if(lexer->source->m[lexer->ptr] == '\n')
{
lexer->line++;
lexer->pos = 0;
}
lexer->ptr += count;
lexer->len -= count;
lexer->pos += count;
}
// Look at the next unused character in our source, without consuming it
static char look(lexer_t* lexer)
{
if(is_eof(lexer))
return '\0';
return lexer->source->m[lexer->ptr];
}
// look(lexer) is equivalent to lookn(lexer, 1)
static char lookn(lexer_t* lexer, size_t chars)
{
if(lexer->len < chars)
return '\0';
return lexer->source->m[lexer->ptr + chars - 1];
}
// Report that the current literal token doesn't terminate
static token_t* literal_doesnt_terminate(lexer_t* lexer)
{
lex_error(lexer, "Literal doesn't terminate");
lexer->ptr += lexer->len;
lexer->len = 0;
return make_token(lexer, TK_LEX_ERROR);
}
// Process a block comment the leading / * for which has been seen, but not
// consumed
static token_t* nested_comment(lexer_t* lexer)
{
consume_chars(lexer, 2); // Leading / *
size_t depth = 1;
while(depth > 0)
{
if(lexer->len <= 1)
{
lex_error(lexer, "Nested comment doesn't terminate");
lexer->ptr += lexer->len;
lexer->len = 0;
return make_token(lexer, TK_LEX_ERROR);
}
if(look(lexer) == '*' && lookn(lexer, 2) == '/')
{
consume_chars(lexer, 2);
depth--;
}
else if(look(lexer) == '/' && lookn(lexer, 2) == '*')
{
consume_chars(lexer, 2);
depth++;
}
else
{
consume_chars(lexer, 1);
}
}
lexer->newline = false;
return NULL;
}
// Process a line comment the leading // for which has been seen, but not
// consumed
static token_t* line_comment(lexer_t* lexer)
{
consume_chars(lexer, 2); // Leading //
// We don't consume the terminating newline here, but it will be handled next
// as whitespace
while(!is_eof(lexer) && (look(lexer) != '\n'))
consume_chars(lexer, 1);
return NULL;
}
// Process a slash, which has been seen, but not consumed
static token_t* slash(lexer_t* lexer)
{
if(lookn(lexer, 2) == '*')
return nested_comment(lexer);
if(lookn(lexer, 2) == '/')
return line_comment(lexer);
if(lookn(lexer, 2) == '~')
{
consume_chars(lexer, 2);
return make_token(lexer, TK_DIVIDE_TILDE);
}
consume_chars(lexer, 1);
return make_token(lexer, TK_DIVIDE);
}
/**
* Removes longest common prefix indentation from every line in a triple
* quoted string. If the string begins with an empty line, that line is removed
* entirely.
* If the last line only consists of whitespace those will also be removed.
*/
static void normalise_string(lexer_t* lexer)
{
if(lexer->buflen == 0)
return;
// If we aren't multiline, do nothing.
if(memchr(lexer->buffer, '\n', lexer->buflen) == NULL)
return;
// Trim a leading newline if there is one.
char* buf = lexer->buffer;
if((buf[0] == '\r') && (buf[1] == '\n'))
{
lexer->buflen -= 2;
memmove(&buf[0], &buf[2], lexer->buflen);
}
else if(buf[0] == '\n')
{
lexer->buflen--;
memmove(&buf[0], &buf[1], lexer->buflen);
}
// Calculate leading whitespace.
size_t ws = lexer->buflen;
size_t ws_this_line = 0;
bool in_leading_ws = true;
bool has_non_ws = false;
for(size_t i = 0; i < lexer->buflen; i++)
{
char c = lexer->buffer[i];
if(in_leading_ws)
{
if(c == ' ' || c == '\t')
{
ws_this_line++;
}
else
{
if(!isspace(c))
has_non_ws = true;
if(has_non_ws && (ws_this_line < ws))
ws = ws_this_line;
in_leading_ws = false;
}
}
if(c == '\n')
{
ws_this_line = 0;
has_non_ws = false;
in_leading_ws = true;
}
}
// Trim leading whitespace on each line.
if(ws > 0)
{
char* line_start = lexer->buffer;
char* compacted = lexer->buffer;
size_t rem = lexer->buflen;
while(rem > 0)
{
char* line_end = (char*)memchr(line_start, '\n', rem);
size_t line_len =
(line_end == NULL) ? rem : (size_t)(line_end - line_start + 1);
if(line_start != line_end)
{
size_t trim = (line_len < ws) ? line_len : ws;
memmove(compacted, line_start + trim, line_len - trim);
compacted += line_len - trim;
}
else
{
memmove(compacted, line_start, line_len);
compacted += line_len;
}
line_start += line_len;
rem -= line_len;
}
lexer->buflen = compacted - lexer->buffer;
}
// Trim trailing empty line
size_t trim = 0;
for (ssize_t i = (lexer->buflen - 1); i>0; i--)
{
char c = lexer->buffer[i];
if (c == '\n')
{
lexer->buflen -= trim;
break;
}
else if (isspace(c))
{
trim++;
}
else
break; // non-empty line
}
}
// Process a triple quoted string, the leading """ of which has been seen, but
// not consumed
static token_t* triple_string(lexer_t* lexer)
{
consume_chars(lexer, 3); // Leading """
size_t start_line = lexer->line;
bool non_space_on_first_line = false;
while(true)
{
if(is_eof(lexer))
return literal_doesnt_terminate(lexer);
char c = look(lexer);
if((c == '\"') && (lookn(lexer, 2) == '\"') && (lookn(lexer, 3) == '\"'))
{
consume_chars(lexer, 3);
// Triple strings can end with 3 or more "s. If there are more than 3
// the extra ones are part of the string contents
while(look(lexer) == '\"')
{
append_to_token(lexer, '\"');
consume_chars(lexer, 1);
}
if (lexer->line > start_line && non_space_on_first_line)
{
lex_error(
lexer,
"multi-line triple-quoted string must be started below the opening triple-quote");
return make_token(lexer, TK_LEX_ERROR);
}
normalise_string(lexer);
return make_token_with_text(lexer, TK_STRING);
}
if (lexer->line == start_line && !isspace(c))
non_space_on_first_line = true;
consume_chars(lexer, 1);
append_to_token(lexer, c);
}
}
// Read a hex or unicode escape sequence, for which the leading \x has been
// consumed.
// The length specified is the number of hex digits expected.
// On success return the unicode value.
// On error return minus the number of characters processed (including the \x)
// and do not report an error.
static int read_hex_escape(lexer_t* lexer, int length)
{
uint32_t value = 0;
int text_len = 2; // start with "\x"
for(int i = 0; i < length; i++)
{
char c = look(lexer);
int digit = 0;
if((c >= '0') && (c <= '9'))
digit = c - '0';
else if((c >= 'a') && (c <= 'f'))
digit = c + 10 - 'a';
else if((c >= 'A') && (c <= 'F'))
digit = c + 10 - 'A';
else
return -text_len;
text_len++;
consume_chars(lexer, 1);
value = (value << 4) + digit;
}
return value;
}
// Process a string or character escape sequence, the leading \ of which has
// been seen but not consumed.
// Errors are reported at the start of the sequence (ie the \ ).
// Returns the escape value or <0 on error.
static int escape(lexer_t* lexer, bool unicode_allowed, bool is_string)
{
// Record the start position of the escape sequence for error reporting
const char* start = &lexer->source->m[lexer->ptr];
size_t line = lexer->line;
size_t pos = lexer->pos;
char c = lookn(lexer, 2);
consume_chars(lexer, 2);
int value = -2; // Default is 2 bad characters, \ and whatever follows it
int hex_digits = 0;
switch(c)
{
case 'a': value = 0x07; break;
case 'b': value = 0x08; break;
case 'e': value = 0x1B; break;
case 'f': value = 0x0C; break;
case 'n': value = 0x0A; break;
case 'r': value = 0x0D; break;
case 't': value = 0x09; break;
case 'v': value = 0x0B; break;
case '\\': value = 0x5C; break;
case '0': value = 0x00; break;
case 'x': hex_digits = 2; break;
case '\"':
if(is_string)
value = 0x22;
break;
case '\'':
if(!is_string)
value = 0x27;
break;
case 'u':
if(unicode_allowed)
hex_digits = 4;
break;
case 'U':
if(unicode_allowed)
hex_digits = 6;
break;
}
if(hex_digits > 0)
{
value = read_hex_escape(lexer, hex_digits);
if(value < 0)
{
lex_error_at(lexer, line, pos,
"Invalid escape sequence \"%.*s\", %d hex digits required",
-value, start, hex_digits);
return -1;
}
if(value > 0x10FFFF)
{
lex_error_at(lexer, line, pos,
"Escape sequence \"%8s\" exceeds unicode range (0x10FFFF)", start);
return -1;
}
}
if(value < 0)
{
lex_error_at(lexer, line, pos, "Invalid escape sequence \"%.*s\"",
-value, start);
return -1;
}
return value;
}
// Append the given value to the current token text, UTF-8 encoded
static void append_utf8(lexer_t* lexer, int value)
{
pony_assert(value >= 0 && value <= 0x10FFFF);
if(value <= 0x7F)
{
append_to_token(lexer, (char)(value & 0x7F));
}
else if(value <= 0x7FF)
{
append_to_token(lexer, (char)(0xC0 | (value >> 6)));
append_to_token(lexer, (char)(0x80 | (value & 0x3F)));
}
else if(value <= 0xFFFF)
{
append_to_token(lexer, (char)(0xE0 | (value >> 12)));
append_to_token(lexer, (char)(0x80 | ((value >> 6) & 0x3F)));
append_to_token(lexer, (char)(0x80 | (value & 0x3F)));
}
else
{
append_to_token(lexer, (char)(0xF0 | (value >> 18)));
append_to_token(lexer, (char)(0x80 | ((value >> 12) & 0x3F)));
append_to_token(lexer, (char)(0x80 | ((value >> 6) & 0x3F)));
append_to_token(lexer, (char)(0x80 | (value & 0x3F)));
}
}
// Process a string literal, the leading " of which has been seen, but not
// consumed
static token_t* string(lexer_t* lexer)
{
if((lookn(lexer, 2) == '\"') && (lookn(lexer, 3) == '\"'))
return triple_string(lexer);
consume_chars(lexer, 1); // Leading "
while(true)
{
if(is_eof(lexer))
return literal_doesnt_terminate(lexer);
char c = look(lexer);
if(c == '"')
{
consume_chars(lexer, 1);
return make_token_with_text(lexer, TK_STRING);
}
if(c == '\\')
{
int value = escape(lexer, true, true);
// Just ignore bad escapes here and carry on. They've already been
// reported and this allows catching later errors.
if(value >= 0)
append_utf8(lexer, value);
}
else
{
append_to_token(lexer, c);
consume_chars(lexer, 1);
}
}
}
// Process a character literal, the leading ' of which has been seen, but not
// consumed
static token_t* character(lexer_t* lexer)
{
consume_chars(lexer, 1); // Leading '
size_t chars_consumed = 0;
lexint_t value;
lexint_zero(&value);
while(true)
{
if(is_eof(lexer))
return literal_doesnt_terminate(lexer);
// ensure lexer char is correctly coerced to int
int c = look(lexer) & 0x000000FF;
if(c == '\'')
{
token_t* t;
consume_chars(lexer, 1);
if (chars_consumed == 0)
{
lex_error(lexer, "Empty character literal");
t = make_token(lexer, TK_LEX_ERROR);
}
else
{
t = make_token(lexer, TK_INT);
token_set_int(t, &value);
}
return t;
}
if(c == '\\')
c = escape(lexer, false, false);
else
consume_chars(lexer, 1);
chars_consumed++;
// Just ignore bad escapes here and carry on. They've already been
// reported and this allows catching later errors.
if(c >= 0)
lexint_char(&value, c);
// TODO: Should we catch overflow and treat as an error?
}
}
/** Process an integral literal or integral part of a real.
* No digits have yet been consumed.
* There must be at least one digit present.
* Single underscores internal to the literal are ignored.
* Return true on success, false on failure.
* The end_on_e flag indicates that we treat e (or E) as a valid terminator
* character, rather than part of the integer being processed.
* The given context is used in error reporting.
* The value read is added onto the end of any existing value in out_value.
*/
static bool lex_integer(lexer_t* lexer, uint32_t base,
lexint_t* out_value, uint32_t* out_digit_count, bool end_on_e,
const char* context)
{
uint32_t digit_count = 0;
bool previous_underscore = false;
while(!is_eof(lexer))
{
char c = look(lexer);
uint32_t digit = 0;
if(c == '_')
{
// Ignore single underscores in numbers
if(previous_underscore)
{
lex_error(lexer, "Invalid duplicate underscore in %s", context);
return false;
}
previous_underscore = true;
consume_chars(lexer, 1);
continue;
}
if(end_on_e && ((c == 'e') || (c == 'E')))
break;
if((c >= '0') && (c <= '9'))
digit = c - '0';
else if((c >= 'a') && (c <= 'z'))
digit = c - 'a' + 10;
else if((c >= 'A') && (c <= 'Z'))
digit = c - 'A' + 10;
else
break;
if(digit >= base)
{
lex_error(lexer, "Invalid character in %s: %c", context, c);
return false;
}
if(!lexint_accum(out_value, digit, base))
{
lex_error(lexer, "overflow in numeric literal");
return false;
}
previous_underscore = false;
consume_chars(lexer, 1);
digit_count++;
}
if(digit_count == 0)
{
lex_error(lexer, "No digits in %s", context);
return false;
}
if(previous_underscore)
{
lex_error(lexer, "Numeric literal cannot end with underscore in %s", context);
return false;
}
if(out_digit_count != NULL)
*out_digit_count = digit_count;
return true;
}
// Process a real literal, the leading integral part has already been read.
// The . or e has been seen but not consumed.
static token_t* real(lexer_t* lexer, lexint_t* integral_value)
{
lexint_t significand = *integral_value;
lexint_t e;
lexint_zero(&e);
bool exp_neg = false;
uint32_t mantissa_digit_count = 0;
char c = look(lexer);
pony_assert(c == '.' || c == 'e' || c == 'E');
if(c == '.')
{
c = lookn(lexer, 2);
if(c < '0' || c > '9')
{
// Treat this as an integer token followed by a dot token
token_t* t = make_token(lexer, TK_INT);
token_set_int(t, integral_value);
return t;
}
consume_chars(lexer, 1); // Consume dot
// Read in rest of the significand
if(!lex_integer(lexer, 10, &significand, &mantissa_digit_count, true,
"real number mantissa"))
return make_token(lexer, TK_LEX_ERROR);
}
if((look(lexer) == 'e') || (look(lexer) == 'E'))
{
consume_chars(lexer, 1); // Consume e
if((look(lexer) == '+') || (look(lexer) == '-'))
{
exp_neg = (look(lexer) == '-');
consume_chars(lexer, 1);
}
if(!lex_integer(lexer, 10, &e, NULL, false,
"real number exponent"))
return make_token(lexer, TK_LEX_ERROR);
}
token_t* t = make_token(lexer, TK_FLOAT);
double ds = lexint_double(&significand);
double de = lexint_double(&e);
// Note that we must negate the exponent (if required) before applying the
// mantissa digit count offset.
if(exp_neg)
de = -de;
de -= mantissa_digit_count;
token_set_float(t, ds * pow(10.0, de));
return t;
}
// Process a non-decimal number literal, the leading base specifier of which
// has already been consumed
static token_t* nondecimal_number(lexer_t* lexer, int base,
const char* context)
{
lexint_t value;
lexint_zero(&value);
if(!lex_integer(lexer, base, &value, NULL, false, context))
return make_token(lexer, TK_LEX_ERROR);
token_t* t = make_token(lexer, TK_INT);
token_set_int(t, &value);
return t;
}
// Process a number literal, the first character of which has been seen but not
// consumed
static token_t* number(lexer_t* lexer)
{
if(look(lexer) == '0')
{
switch(lookn(lexer, 2))
{
case 'x':
case 'X':
consume_chars(lexer, 2); // Consume 0x
return nondecimal_number(lexer, 16, "hexadecimal number");
case 'b':
case 'B':
consume_chars(lexer, 2); // Consume 0b
return nondecimal_number(lexer, 2, "binary number");
default: {}
}
}
// Decimal
lexint_t value;
lexint_zero(&value);
if(!lex_integer(lexer, 10, &value, NULL, true, "decimal number"))
return make_token(lexer, TK_LEX_ERROR);
if((look(lexer) == '.') || (look(lexer) == 'e') || (look(lexer) == 'E'))
return real(lexer, &value);
token_t* t = make_token(lexer, TK_INT);
token_set_int(t, &value);
return t;
}
// Read an identifer into the current token text buffer, but don't consume the
// characters from the source yet.
// Return value is the length of the read id.
static size_t read_id(lexer_t* lexer)
{
size_t len = 0;
char c;
while(true)
{
c = lookn(lexer, len + 1);
if((c != '_') && (c != '\'') && !isalnum(c))
break;
append_to_token(lexer, c);
len++;
}
// Add a nul terminator to our name so we can use strcmp(), but don't count
// it in the text length
append_to_token(lexer, '\0');
lexer->buflen--;
return len;
}
// Process a keyword or identifier, possibly with a special prefix (eg '#').
// Any prefix must have been consumed.
// If no keyword is found the allow_identifiers parameter specifies whether an
// identifier token should be created.
// A lone prefix will not match as an identifier.
// Both keywords and identifiers are greedy, consuming all legal characters.
// Returns NULL if no match found.
static token_t* keyword(lexer_t* lexer, bool allow_identifiers)
{
size_t len = read_id(lexer);
for(const lextoken_t* p = keywords; p->text != NULL; p++)
{
if(!strcmp(lexer->buffer, p->text))
{
consume_chars(lexer, len);
return make_token(lexer, p->id);
}
}
if(allow_identifiers && len > 0)
{
consume_chars(lexer, len);
return make_token_with_text(lexer, TK_ID);
}
return NULL;
}
// Process a hash, which has been seen, but not consumed.
static token_t* hash(lexer_t* lexer)
{
append_to_token(lexer, look(lexer)); // #
consume_chars(lexer, 1);
token_t* t = keyword(lexer, false);
if(t != NULL)
return t;
// No hash keyword found, just return the hash.
return make_token(lexer, TK_CONSTANT);
}
// Process a dollar, which has been seen, but not consumed.
static token_t* dollar(lexer_t* lexer)
{
append_to_token(lexer, look(lexer)); // $
consume_chars(lexer, 1);
if(lexer->allow_test_symbols)
{
// Test mode, allow test keywords and identifiers.
// Note that a lone '$' is always an error to allow tests to force a lexer
// error.
token_t* t = keyword(lexer, true);
if(t != NULL)
return t;
}
// No test keyword or identifier found. Either we have just a lone '$' or
// we're not in test mode so no dollar symbols are allowed.
lex_error(lexer, "Unrecognized character: $");
return make_token(lexer, TK_LEX_ERROR);
}
// Modify the given token to its newline form, if it is on a newline
static token_id newline_symbols(token_id raw_token, bool newline)
{
if(!newline)
return raw_token;
switch(raw_token)
{
case TK_LPAREN: return TK_LPAREN_NEW;
case TK_LSQUARE: return TK_LSQUARE_NEW;
case TK_MINUS: return TK_MINUS_NEW;
case TK_MINUS_TILDE: return TK_MINUS_TILDE_NEW;
default: return raw_token;
}
}
// Process a symbol the leading character of which has been seen, but not
// consumed
static token_t* symbol(lexer_t* lexer)
{
char sym[MAX_SYMBOL_LENGTH];
for(size_t i = 0; i < sizeof(sym); ++i)
sym[i] = lookn(lexer, i + 1);
for(const lextoken_t* p = symbols; p->text != NULL; p++)
{
const char* symbol = p->text;
for(int i = 0; symbol[i] == '\0' || symbol[i] == sym[i]; ++i)
{
if(symbol[i] == '\0')
{
consume_chars(lexer, i);
return make_token(lexer, newline_symbols(p->id, lexer->newline));
}
}
}
lex_error(lexer, "Unrecognized character: %c", sym[0]);
consume_chars(lexer, 1);
return make_token(lexer, TK_LEX_ERROR);
}
lexer_t* lexer_open(source_t* source, errors_t* errors,
bool allow_test_symbols)
{
pony_assert(source != NULL);
lexer_t* lexer = POOL_ALLOC(lexer_t);
memset(lexer, 0, sizeof(lexer_t));
lexer->source = source;
lexer->errors = errors;
lexer->allow_test_symbols = allow_test_symbols;
lexer->len = source->len - 1; // because we don't want the null terminator to be parsed.
lexer->line = 1;
lexer->pos = 1;
lexer->newline = true;
return lexer;
}
void lexer_close(lexer_t* lexer)
{
if(lexer == NULL)
return;
if(lexer->buffer != NULL)
ponyint_pool_free_size(lexer->alloc, lexer->buffer);
POOL_FREE(lexer_t, lexer);
}
token_t* lexer_next(lexer_t* lexer)
{
pony_assert(lexer != NULL);
token_t* t = NULL;
while(t == NULL)
{
lexer->token_line = lexer->line;
lexer->token_pos = lexer->pos;
lexer->buflen = 0;
if(is_eof(lexer))
{
t = make_token(lexer, TK_EOF);
break;
}
char c = look(lexer);
switch(c)
{
case '\n':
lexer->newline = true;
consume_chars(lexer, 1);
break;
case '\r':
case '\t':
case ' ':
consume_chars(lexer, 1);
break;
case '/':
t = slash(lexer);
break;
case '\"':
t = string(lexer);
break;
case '\'':
t = character(lexer);
break;
case '#':
t = hash(lexer);
break;
case '$':
t = dollar(lexer);
break;
default:
if(isdigit(c))
{
t = number(lexer);
}
else if(isalpha(c) || (c == '_'))
{
t = keyword(lexer, true);
pony_assert(t != NULL);
}
else
{
t = symbol(lexer);
}
}
}
lexer->newline = false; // We've found a symbol, so no longer a new line
return t;
}
const char* lexer_print(token_id id)
{
for(const lextoken_t* p = abstract; p->text != NULL; p++)
{
if(id == p->id)
return p->text;
}
for(const lextoken_t* p = keywords; p->text != NULL; p++)
{
if(id == p->id)
return p->text;
}
for(const lextoken_t* p = symbols; p->text != NULL; p++)
{
if(id == p->id)
return p->text;
}
return NULL;
}
|
81a535f0bfdee88058452c0fff2664d98d08a6d8
|
a3d6556180e74af7b555f8d47d3fea55b94bcbda
|
/cc/paint/paint_export.h
|
0b14d855abb2a6fddd9ae76c9a82880af82e8c75
|
[
"BSD-3-Clause"
] |
permissive
|
chromium/chromium
|
aaa9eda10115b50b0616d2f1aed5ef35d1d779d6
|
a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c
|
refs/heads/main
| 2023-08-24T00:35:12.585945
| 2023-08-23T22:01:11
| 2023-08-23T22:01:11
| 120,360,765
| 17,408
| 7,102
|
BSD-3-Clause
| 2023-09-10T23:44:27
| 2018-02-05T20:55:32
| null |
UTF-8
|
C
| false
| false
| 713
|
h
|
paint_export.h
|
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_PAINT_PAINT_EXPORT_H_
#define CC_PAINT_PAINT_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(CC_PAINT_IMPLEMENTATION)
#define CC_PAINT_EXPORT __declspec(dllexport)
#else
#define CC_PAINT_EXPORT __declspec(dllimport)
#endif // defined(CC_PAINT_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(CC_PAINT_IMPLEMENTATION)
#define CC_PAINT_EXPORT __attribute__((visibility("default")))
#else
#define CC_PAINT_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define CC_PAINT_EXPORT
#endif
#endif // CC_PAINT_PAINT_EXPORT_H_
|
dba850e58951026a860006c3d033ea762668c8a8
|
6f247f5400c6a840b6dfcb12388116dc3bb7bd49
|
/include/nvamemtiming.h
|
b4e424b2198abeb4883c690ebc51d0025df17023
|
[
"MIT"
] |
permissive
|
envytools/envytools
|
c062fbc3b8af90d3df9c6e0f57e9abbfc5690d01
|
e11d670a70ae0455261ead53cdd09c321974cc64
|
refs/heads/master
| 2023-08-26T23:44:47.131591
| 2022-04-30T21:15:56
| 2022-04-30T21:15:56
| 11,620,001
| 402
| 103
|
MIT
| 2022-12-07T01:35:18
| 2013-07-23T21:43:43
|
C
|
UTF-8
|
C
| false
| false
| 2,328
|
h
|
nvamemtiming.h
|
/*
* Copyright (C) 2011-2012 Martin Peres <martin.peres@labri.fr>
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef NVAMEMTIMING_H
#define NVAMEMTIMING_H
#include <stdint.h>
#include <stdbool.h>
struct nvamemtiming_conf {
int cnum;
bool mmiotrace;
uint16_t counter;
enum { MODE_AUTO = 0, MODE_BITFIELD = 1, MODE_MANUAL = 2, MODE_DEEP = 3 } mode;
union {
struct {
uint8_t index;
uint8_t value;
} manual;
struct {
uint8_t start;
uint8_t end;
} range;
struct {
uint8_t index;
} bitfield;
struct {
uint8_t entry;
uint16_t timing_entry_offset;
} deep;
};
struct {
const char *file;
uint8_t *data;
size_t length;
uint16_t timing_table_offset;
uint16_t timing_entry_offset;
uint16_t timing_entry_length;
} vbios;
struct {
uint8_t entry;
uint8_t perflvl;
} timing;
};
int vbios_read(const char *filename, uint8_t **vbios, size_t *length);
int deep_dump(struct nvamemtiming_conf *conf);
int shallow_dump(struct nvamemtiming_conf *conf);
int bitfield_check(struct nvamemtiming_conf *conf);
int manual_check(struct nvamemtiming_conf *conf);
#endif
|
ff0f4d4c0b67888fc6954fe6c2ed5079d6eda82f
|
21c92afbd7fd022a206fb31294c523aebb770104
|
/SuiteSparse/CXSparse/SourceWrappers/cs_pinv_dl.o.c
|
c96837815792b5fa9624fdda38f1ee6077caacd5
|
[
"BSD-3-Clause",
"DOC",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-or-later",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
jlblancoc/suitesparse-metis-for-windows
|
70e6bcab2b525afb41758d61f823efa0618f67cf
|
5ee2eb4bc7bfd6d27af2f7fb027b1545cfc0fa3f
|
refs/heads/master
| 2023-08-30T21:15:39.624300
| 2023-03-09T10:16:48
| 2023-03-09T10:16:48
| 16,236,582
| 423
| 251
|
BSD-3-Clause
| 2023-03-09T10:18:08
| 2014-01-25T18:06:21
|
C
|
UTF-8
|
C
| false
| false
| 47
|
c
|
cs_pinv_dl.o.c
|
#define CS_LONG
#include <../Source/cs_pinv.c>
|
6cfc6d029a7063bcba01937db2288220806f5a62
|
d9cb0274eef7367641a5aa4b631c6940626638ec
|
/_13_Internet_Connection/v5/wifi-err_3/main/main.c
|
4b3f33fa86cc997f3ff89936bdf571e149195110
|
[] |
no_license
|
Mair/esp32-course
|
b1392c60c827698685f7b853899746bf33be845e
|
d9b1c92d6c24382a390ce89edfec000990e6832e
|
refs/heads/master
| 2023-08-30T18:40:34.341468
| 2023-08-27T23:40:06
| 2023-08-27T23:40:06
| 208,529,208
| 232
| 122
| null | 2023-08-27T23:40:07
| 2019-09-15T02:06:13
|
C
|
UTF-8
|
C
| false
| false
| 205
|
c
|
main.c
|
#include <stdio.h>
#include "nvs_flash.h"
#include "wifi_connect.h"
void app_main(void)
{
nvs_flash_init();
wifi_connect_init();
esp_err_t err = wifi_connect_sta("POCO", "password", 10000);
}
|
5a89d84251386ce47faac9592981819514e40973
|
ae31542273a142210a1ff30fb76ed9d45d38eba9
|
/src/include/utils/bitstream.h
|
32c96f6f3034d2b8aa24a959e3ec5c8ce00268e4
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"PostgreSQL",
"OpenSSL",
"LicenseRef-scancode-stream-benchmark",
"ISC",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-ssleay-windows",
"BSD-2-Clause",
"Python-2.0"
] |
permissive
|
greenplum-db/gpdb
|
8334837bceb2d5d51a684500793d11b190117c6a
|
2c0f8f0fb24a2d7a7da114dc80f5f5a2712fca50
|
refs/heads/main
| 2023-08-22T02:03:03.806269
| 2023-08-21T22:59:53
| 2023-08-22T01:17:10
| 44,781,140
| 6,417
| 2,082
|
Apache-2.0
| 2023-09-14T20:33:42
| 2015-10-23T00:25:17
|
C
|
UTF-8
|
C
| false
| false
| 1,658
|
h
|
bitstream.h
|
/*------------------------------------------------------------------------------
*
* bitstream
*
* A in-memory bitstream implementation.
* Useful for reading and writing individual bits from a char buffer
*
* Copyright (c) 2013-Present VMware, Inc. or its affiliates.
*
*
* IDENTIFICATION
* src/include/utils/bitstream.h
*
*------------------------------------------------------------------------------
*/
#ifndef CDB_BITSTREAM_H
#define CDB_BITSTREAM_H
/*
* Data structure implementing a bitstream abstraction.
*
* A bitstream is used to read and write individual bits from a data buffer
* conveniently.
*/
typedef struct Bitstream
{
/*
* Offset within the current byte
*/
int bitOffset;
/*
* Offset to the start of the data pointer
*/
int byteOffset;
/*
* Data buffer to read from or write to.
*/
unsigned char* data;
/*
* Size of the data buffer.
* The bitstream should never read or write beyond the data size.
*/
int dataSize;
/*
* Error flag.
*/
bool error;
} Bitstream;
void Bitstream_Init(Bitstream *bitstream, unsigned char* data, int dataSize);
int Bitstream_GetOffset(Bitstream *bitstream);
bool Bitstream_Get(Bitstream *bitstream, int n, uint32 *value);
bool Bitstream_Put(Bitstream *bitstream, uint32_t v, int bitCount);
bool Bitstream_HasError(Bitstream *bitstream);
bool Bitstream_Skip(Bitstream* bitstream, int skipBitCount);
bool Bitstream_Align(Bitstream *bitstream, int alignment);
unsigned char* Bitstream_GetAlignedData(Bitstream *bitstream, int alignment);
int Bitstream_GetRemaining(Bitstream *bitstream);
int Bitstream_GetLength(Bitstream *bitstream);
#endif
|
0d8b18a0ff817de5bfae639f38cb72ce828fe3ab
|
e3acfc4f06840e23ef1185dcf367f40d3e3f59b4
|
/tests/regression/71-doublelocking/03-thread-exit-with-mutex.c
|
d71f3fb616b94a4eb20ac9b17ac7fdc685671914
|
[
"MIT"
] |
permissive
|
goblint/analyzer
|
d62d3c610b86ed288849371b41c330c30678abc7
|
69ee7163eef0bfbfd6a4f3b9fda7cea5ce9ab79f
|
refs/heads/master
| 2023-08-16T21:58:53.013737
| 2023-08-16T08:49:18
| 2023-08-16T08:49:18
| 2,066,905
| 141
| 62
|
MIT
| 2023-09-14T18:48:34
| 2011-07-18T15:10:56
|
OCaml
|
UTF-8
|
C
| false
| false
| 751
|
c
|
03-thread-exit-with-mutex.c
|
// PARAM: --set ana.activated[+] 'maylocks' --set ana.activated[+] 'pthreadMutexType'
#include<pthread.h>
#include<stdio.h>
#include<unistd.h>
#include <assert.h>
#include <stdlib.h>
pthread_mutex_t mut[8];
void* f1(void* ptr) {
int top;
int x = 2;
if(top) {
x = 3;
}
pthread_mutex_lock(&mut[x]);
if(top) {
pthread_exit(NULL); //WARN
}
return NULL; //WARN
}
int main(int argc, char const *argv[])
{
pthread_t t1;
pthread_t t2;
pthread_create(&t1,NULL,f1,NULL);
pthread_join(t1, NULL);
pthread_mutex_lock(&mut[0]); //NOWARN
pthread_mutex_unlock(&mut[0]);
return 0; // We would actually want to not warn here, but the mutex type analysis is currently too imprecise
}
|
93a983f7a0df6046da68e3c83aec8b1e6c3705e2
|
7d7900e1c25b729fc8c208673a449c0520ba466e
|
/lib/kernel/errol/errol.h
|
44d192c7b525ca80407d5994a40772b31e58014c
|
[
"MIT",
"BSD-2-Clause"
] |
permissive
|
pocl/pocl
|
384091e15c8f6abf29fd2c6deace34a7de5a6ac6
|
5a99e12d0bb78427ad948ac368589135507f1b59
|
refs/heads/main
| 2023-09-02T14:16:21.381680
| 2023-08-21T12:13:47
| 2023-08-21T12:13:47
| 12,292,999
| 775
| 250
|
MIT
| 2023-09-14T06:50:34
| 2013-08-22T09:26:12
|
C
|
UTF-8
|
C
| false
| false
| 869
|
h
|
errol.h
|
#ifndef ERROL_H
#define ERROL_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* errol declarations
*/
// TODO include stdbool ?
typedef int bool;
#define true 1
#define false 0
#define ERR_LEN 512
#define ERR_DEPTH 4
int errol0_dtoa(double val, char *buf);
int errol1_dtoa(double val, char *buf, bool *opt);
int errol2_dtoa(double val, char *buf, bool *opt);
int errol3_dtoa(double val, char *buf);
int errol3u_dtoa(double val, char *buf);
int errol4_dtoa(double val, char *buf);
int errol4u_dtoa(double val, char *buf);
int errol_int(double val, char *buf);
int errol_fixed(double val, char *buf);
struct errol_err_t {
double val;
char str[18];
int32_t exp;
};
struct errol_slab_t {
char str[18];
int32_t exp;
};
typedef union {
double d;
int64_t i;
} errol_bits_t;
#ifdef __cplusplus
}
#endif
#endif
|
ca26eb7cf79613c025028c714a1a4823ac4c861a
|
f0cc4fe245a513342ab088414042f69362547f59
|
/mlx_int_param_event.c
|
8756a22586ae9d0b4a89296fc2e779a57484a1ad
|
[
"BSD-2-Clause"
] |
permissive
|
42Paris/minilibx-linux
|
1f1e7d96d34ba51e3b07daa1e586cf2e6ad01339
|
7dc53a411a7d4ae286c60c6229bd1e395b0efb82
|
refs/heads/master
| 2022-12-17T10:13:49.868698
| 2021-10-30T18:54:26
| 2021-10-30T18:54:26
| 253,899,374
| 326
| 113
|
BSD-2-Clause
| 2023-02-05T22:59:26
| 2020-04-07T20:02:53
|
C
|
UTF-8
|
C
| false
| false
| 2,555
|
c
|
mlx_int_param_event.c
|
/*
** mlx_int_param_event.c for MinilibX in
**
** Made by Charlie Root
** Login <ol@epitech.net>
**
** Started on Mon Jul 31 16:37:50 2000 Charlie Root
** Last update Wed Oct 6 13:14:52 2004 Olivier Crouzet
*/
#include "mlx_int.h"
int mlx_int_param_undef()
{
}
int mlx_int_param_KeyPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[KeyPress].hook(XkbKeycodeToKeysym(xvar->display,
ev->xkey.keycode, 0, 0),
win->hooks[KeyPress].param);
}
int mlx_int_param_KeyRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[KeyRelease].hook(XkbKeycodeToKeysym(xvar->display,
ev->xkey.keycode, 0, 0),
win->hooks[KeyRelease].param);
}
int mlx_int_param_ButtonPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[ButtonPress].hook(ev->xbutton.button,ev->xbutton.x,ev->xbutton.y,
win->hooks[ButtonPress].param);
}
int mlx_int_param_ButtonRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[ButtonRelease].hook(ev->xbutton.button,
ev->xbutton.x, ev->xbutton.y,
win->hooks[ButtonRelease].param);
}
int mlx_int_param_MotionNotify(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[MotionNotify].hook(ev->xbutton.x,ev->xbutton.y,
win->hooks[MotionNotify].param);
}
int mlx_int_param_Expose(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
if (!ev->xexpose.count)
win->hooks[Expose].hook(win->hooks[Expose].param);
}
int mlx_int_param_generic(t_xvar *xvar, XEvent *ev, t_win_list *win)
{
win->hooks[ev->type].hook(win->hooks[ev->type].param);
}
int (*(mlx_int_param_event[]))() =
{
mlx_int_param_undef, /* 0 */
mlx_int_param_undef,
mlx_int_param_KeyPress,
mlx_int_param_KeyRelease, /* 3 */
mlx_int_param_ButtonPress,
mlx_int_param_ButtonRelease,
mlx_int_param_MotionNotify, /* 6 */
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_Expose, /* 12 */
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic,
mlx_int_param_generic
};
|
e6710e050857a198e54601afb07951be565a8de4
|
ec34c10de6b7cde45b12fa40e036120633069996
|
/thirdparty/VidCapture/Source/VidCapture/VidCapture.h
|
16fc31db004a267fd367e5ffcddf2421dd682378
|
[
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
OpenPHDGuiding/phd2
|
7640bba3e9a20501ac99d0504fecc5be73d53633
|
9ff645f1fd5861722497221ecc4d000136b66e28
|
refs/heads/master
| 2023-09-01T18:13:37.555796
| 2023-08-27T23:53:18
| 2023-08-27T23:53:18
| 38,025,807
| 239
| 115
|
BSD-3-Clause
| 2023-09-11T02:33:21
| 2015-06-25T03:31:41
|
C++
|
UTF-8
|
C
| false
| false
| 832
|
h
|
VidCapture.h
|
/// \file VidCapture.h
/// \brief Header includes for using the CodeVis VidCapture library.
///
#ifndef _CODEVIS_VIDCAPTURE_H_
#define _CODEVIS_VIDCAPTURE_H
// Result codes
#include "CVResFile.h" // File result codes
#include "CVResImage.h" // Imaging result codes
#include "CVResVidCap.h" // Video capture result codes
// Imaging, Platform, and Video Capture
#include "CVImage.h" // Imaging class interface
#include "CVPlatform.h" // Platform-specific creation of classes
#include "CVVidCapture.h" // Video capture interface
// This one only needs to be #included if you want to do
// DirectShow specific stuff - e.g. CVVidCaptureDSWin32::StartRawCap()
//#ifdef WIN32
// #include "CVVidCaptureDSWin32.h" // Win32 DirectShow implementation
//#endif
#endif _CODEVIS_VIDCAPTURE_H_
|
b5248885c0c4f050280ed40128c1ddfd3dad8831
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/net/bridge/netfilter/ebtable_filter.c
|
3c2e9dced9e0afd8a5ed3522357eb0faf63e8289
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 3,111
|
c
|
ebtable_filter.c
|
/*
* ebtable_filter
*
* Authors:
* Bart De Schuymer <bdschuym@pandora.be>
*
* April, 2002
*
*/
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/module.h>
#define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \
(1 << NF_BR_LOCAL_OUT))
static struct ebt_entries initial_chains[] =
{
{
.name = "INPUT",
.policy = EBT_ACCEPT,
},
{
.name = "FORWARD",
.policy = EBT_ACCEPT,
},
{
.name = "OUTPUT",
.policy = EBT_ACCEPT,
},
};
static struct ebt_replace_kernel initial_table =
{
.name = "filter",
.valid_hooks = FILTER_VALID_HOOKS,
.entries_size = 3 * sizeof(struct ebt_entries),
.hook_entry = {
[NF_BR_LOCAL_IN] = &initial_chains[0],
[NF_BR_FORWARD] = &initial_chains[1],
[NF_BR_LOCAL_OUT] = &initial_chains[2],
},
.entries = (char *)initial_chains,
};
static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
{
if (valid_hooks & ~FILTER_VALID_HOOKS)
return -EINVAL;
return 0;
}
static const struct ebt_table frame_filter =
{
.name = "filter",
.table = &initial_table,
.valid_hooks = FILTER_VALID_HOOKS,
.check = check,
.me = THIS_MODULE,
};
static unsigned int
ebt_in_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, int (*okfn)(struct sk_buff *))
{
return ebt_do_table(hook, skb, in, out, dev_net(in)->xt.frame_filter);
}
static unsigned int
ebt_out_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, int (*okfn)(struct sk_buff *))
{
return ebt_do_table(hook, skb, in, out, dev_net(out)->xt.frame_filter);
}
static struct nf_hook_ops ebt_ops_filter[] __read_mostly = {
{
.hook = ebt_in_hook,
.owner = THIS_MODULE,
.pf = NFPROTO_BRIDGE,
.hooknum = NF_BR_LOCAL_IN,
.priority = NF_BR_PRI_FILTER_BRIDGED,
},
{
.hook = ebt_in_hook,
.owner = THIS_MODULE,
.pf = NFPROTO_BRIDGE,
.hooknum = NF_BR_FORWARD,
.priority = NF_BR_PRI_FILTER_BRIDGED,
},
{
.hook = ebt_out_hook,
.owner = THIS_MODULE,
.pf = NFPROTO_BRIDGE,
.hooknum = NF_BR_LOCAL_OUT,
.priority = NF_BR_PRI_FILTER_OTHER,
},
};
static int __net_init frame_filter_net_init(struct net *net)
{
net->xt.frame_filter = ebt_register_table(net, &frame_filter);
return PTR_RET(net->xt.frame_filter);
}
static void __net_exit frame_filter_net_exit(struct net *net)
{
ebt_unregister_table(net, net->xt.frame_filter);
}
static struct pernet_operations frame_filter_net_ops = {
.init = frame_filter_net_init,
.exit = frame_filter_net_exit,
};
static int __init ebtable_filter_init(void)
{
int ret;
ret = register_pernet_subsys(&frame_filter_net_ops);
if (ret < 0)
return ret;
ret = nf_register_hooks(ebt_ops_filter, ARRAY_SIZE(ebt_ops_filter));
if (ret < 0)
unregister_pernet_subsys(&frame_filter_net_ops);
return ret;
}
static void __exit ebtable_filter_fini(void)
{
nf_unregister_hooks(ebt_ops_filter, ARRAY_SIZE(ebt_ops_filter));
unregister_pernet_subsys(&frame_filter_net_ops);
}
module_init(ebtable_filter_init);
module_exit(ebtable_filter_fini);
MODULE_LICENSE("GPL");
|
6f03de7df208c392ddb16772a1174aa6e52492cc
|
581bdcc078d282e388f1b655d4cfc4e08152d117
|
/SystemInformer/prpgjob.c
|
67ba91140028f99e4dc2019655d6403c7dbf336c
|
[
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"Zlib",
"LGPL-2.1-or-later",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] |
permissive
|
winsiderss/systeminformer
|
774928be871f0055263ac5e62ae0a598b098486b
|
5a6b442acd45d681f699a133d476a3211d072871
|
refs/heads/master
| 2023-08-28T15:43:41.074679
| 2023-08-27T20:59:20
| 2023-08-27T20:59:20
| 50,824,485
| 2,137
| 292
|
MIT
| 2023-09-10T22:35:12
| 2016-02-01T08:10:21
|
C
|
UTF-8
|
C
| false
| false
| 2,747
|
c
|
prpgjob.c
|
/*
* Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved.
*
* This file is part of System Informer.
*
* Authors:
*
* wj32 2009-2016
*
*/
#include <phapp.h>
#include <procprp.h>
#include <kphuser.h>
NTSTATUS NTAPI PhpOpenProcessJobForPage(
_Out_ PHANDLE Handle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ PVOID Context
)
{
NTSTATUS status;
HANDLE processHandle;
HANDLE jobHandle = NULL;
if (!NT_SUCCESS(status = PhOpenProcess(
&processHandle,
PROCESS_QUERY_LIMITED_INFORMATION,
(HANDLE)Context
)))
return status;
status = KphOpenProcessJob(processHandle, DesiredAccess, &jobHandle);
NtClose(processHandle);
if (NT_SUCCESS(status) && status != STATUS_PROCESS_NOT_IN_JOB && jobHandle)
{
*Handle = jobHandle;
}
else if (NT_SUCCESS(status))
{
status = STATUS_UNSUCCESSFUL;
}
return status;
}
INT_PTR CALLBACK PhpProcessJobHookProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
)
{
switch (uMsg)
{
case WM_DESTROY:
{
PhRemoveWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT);
}
break;
case WM_SHOWWINDOW:
{
if (!PhGetWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT)) // LayoutInitialized
{
PPH_LAYOUT_ITEM dialogItem;
// This is a big violation of abstraction...
dialogItem = PhAddPropPageLayoutItem(hwndDlg, hwndDlg,
PH_PROP_PAGE_TAB_CONTROL_PARENT, PH_ANCHOR_ALL);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_NAME),
dialogItem, PH_ANCHOR_LEFT | PH_ANCHOR_TOP | PH_ANCHOR_RIGHT);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_TERMINATE),
dialogItem, PH_ANCHOR_TOP | PH_ANCHOR_RIGHT);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_PROCESSES),
dialogItem, PH_ANCHOR_LEFT | PH_ANCHOR_TOP | PH_ANCHOR_RIGHT);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_ADD),
dialogItem, PH_ANCHOR_TOP | PH_ANCHOR_RIGHT);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_LIMITS),
dialogItem, PH_ANCHOR_ALL);
PhAddPropPageLayoutItem(hwndDlg, GetDlgItem(hwndDlg, IDC_ADVANCED),
dialogItem, PH_ANCHOR_RIGHT | PH_ANCHOR_BOTTOM);
PhDoPropPageLayout(hwndDlg);
PhSetWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT, UlongToPtr(TRUE));
}
}
break;
}
return FALSE;
}
|
e40edca7d218239f0ca87967de2f739e06dc6eb9
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/libc/include/x86-linux-any/asm/shmbuf.h
|
4e172a0408b9d4beebbd7ec1873a0eb4b1977c86
|
[
"MIT"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 1,320
|
h
|
shmbuf.h
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_X86_SHMBUF_H
#define __ASM_X86_SHMBUF_H
#if !defined(__x86_64__) || !defined(__ILP32__)
#include <asm-generic/shmbuf.h>
#else
#include <asm/ipcbuf.h>
#include <asm/posix_types.h>
/*
* The shmid64_ds structure for x86 architecture with x32 ABI.
*
* On x86-32 and x86-64 we can just use the generic definition, but
* x32 uses the same binary layout as x86_64, which is different
* from other 32-bit architectures.
*/
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_long_t shm_atime; /* last attach time */
__kernel_long_t shm_dtime; /* last detach time */
__kernel_long_t shm_ctime; /* last change time */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
__kernel_ulong_t shm_nattch; /* no. of current attaches */
__kernel_ulong_t __unused4;
__kernel_ulong_t __unused5;
};
struct shminfo64 {
__kernel_ulong_t shmmax;
__kernel_ulong_t shmmin;
__kernel_ulong_t shmmni;
__kernel_ulong_t shmseg;
__kernel_ulong_t shmall;
__kernel_ulong_t __unused1;
__kernel_ulong_t __unused2;
__kernel_ulong_t __unused3;
__kernel_ulong_t __unused4;
};
#endif
#endif /* __ASM_X86_SHMBUF_H */
|
44e11a50112dbbcde2f9ed147d07a99344b20e1f
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/fm33lc026/libraries/FM33LC0xx_FL_Driver/Src/fm33lc0xx_fl_rcc.c
|
1167da565b1d187049d9dee9188d03cc5c469bf0
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 9,110
|
c
|
fm33lc0xx_fl_rcc.c
|
/**
****************************************************************************************************
* @file fm33lc0xx_fl_rcc.c
* @author FMSH Application Team
* @brief Src file of RCC FL Module
****************************************************************************************************
* @attention
*
* Copyright (c) [2021] [Fudan Microelectronics]
* THIS SOFTWARE is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*
****************************************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "fm33lc0xx_fl.h"
/** @addtogroup FM33LC0XX_FL_Driver
* @{
*/
/** @addtogroup RCC
* @{
*/
#ifdef FL_RCC_DRIVER_ENABLED
/** @addtogroup RCC_FL_EF_Operation
* @{
*/
/**
* @brief 获取USB提供给系统总线时钟的频率
*
* @retval USB提供给SYSCLK的时钟频率(Hz)
*/
uint32_t FL_RCC_GetUSBClockFreqToSysclk(void)
{
if(FL_RCC_GetUSBClockOutput() == FL_RCC_USB_CLK_OUT_48M)
{
return 48000000;
}
else
{
return 60000000;
}
}
/**
* @brief 获取系统当前工作时钟SYSCLK
*
* @note 函数中用到了 @ref XTHF_VALUE 宏,这个宏应该被定义为外部晶振的输入频率值
*
* @retval 系统时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetSystemClockFreq(void)
{
uint32_t frequency = 0;
/* 获取系统时钟源 */
switch(FL_RCC_GetSystemClockSource())
{
/* 系统时钟源为内部RCHF */
case FL_RCC_SYSTEM_CLK_SOURCE_RCHF:
/* 内部RCHF默认为8MHz ,可以配置为16或24M */
frequency = FL_RCC_GetRCHFClockFreq();
break;
/* 系统时钟源为XTHF */
case FL_RCC_SYSTEM_CLK_SOURCE_XTHF:
frequency = XTHFClock;
break;
/* 系统时钟源为PLL */
case FL_RCC_SYSTEM_CLK_SOURCE_PLL:
frequency = FL_RCC_GetPLLClockFreq();
break;
/* 系统时钟源为内部RCMF */
case FL_RCC_SYSTEM_CLK_SOURCE_RCMF_PSC:
/* 根据RCMF的分频配置得出系统时钟 */
frequency = FL_RCC_GetRCMFClockFreq();
break;
/* 系统时钟源为LSCLK */
case FL_RCC_SYSTEM_CLK_SOURCE_LSCLK:
#ifdef USE_LSCLK_CLOCK_SRC_LPOSC
frequency = 32000;
#else
frequency = XTLFClock;
#endif
break;
/* 系统时钟源为USB BCK */
case FL_RCC_SYSTEM_CLK_SOURCE_USBCLK:
/* USB时钟频率获取 */
frequency = FL_RCC_GetUSBClockFreqToSysclk();
break;
/* 系统时钟源为LPOSC */
case FL_RCC_SYSTEM_CLK_SOURCE_LPOSC:
frequency = 32000;
break;
default:
frequency = FL_RCC_GetRCHFClockFreq();
break;
}
return frequency;
}
/**
* @brief 获取AHB总线时钟频率
*
* @retval AHB总线时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetAHBClockFreq(void)
{
uint32_t frequency = 0;
/* 获取AHB分频系数,AHB源自系统主时钟 */
switch(FL_RCC_GetAHBPrescaler())
{
case FL_RCC_AHBCLK_PSC_DIV1:
frequency = FL_RCC_GetSystemClockFreq();
break;
case FL_RCC_AHBCLK_PSC_DIV2:
frequency = FL_RCC_GetSystemClockFreq() / 2;
break;
case FL_RCC_AHBCLK_PSC_DIV4:
frequency = FL_RCC_GetSystemClockFreq() / 4;
break;
case FL_RCC_AHBCLK_PSC_DIV8:
frequency = FL_RCC_GetSystemClockFreq() / 8;
break;
case FL_RCC_AHBCLK_PSC_DIV16:
frequency = FL_RCC_GetSystemClockFreq() / 16;
break;
default:
frequency = FL_RCC_GetSystemClockFreq();
break;
}
return frequency;
}
/**
* @brief 获取当前系统的APB1总线时钟
*
* @retval APB1总线时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetAPB1ClockFreq(void)
{
uint32_t frequency = 0;
/* 获取APB1分频系数,APB源自AHB */
switch(FL_RCC_GetAPB1Prescaler())
{
case FL_RCC_APB1CLK_PSC_DIV1:
frequency = FL_RCC_GetAHBClockFreq();
break;
case FL_RCC_APB1CLK_PSC_DIV2:
frequency = FL_RCC_GetAHBClockFreq() / 2;
break;
case FL_RCC_APB1CLK_PSC_DIV4:
frequency = FL_RCC_GetAHBClockFreq() / 4;
break;
case FL_RCC_APB1CLK_PSC_DIV8:
frequency = FL_RCC_GetAHBClockFreq() / 8;
break;
case FL_RCC_APB1CLK_PSC_DIV16:
frequency = FL_RCC_GetAHBClockFreq() / 16;
break;
default:
frequency = FL_RCC_GetAHBClockFreq();
break;
}
return frequency;
}
/**
* @brief 获取当前系统的APB2总线时钟
*
* @retval APB2总线时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetAPB2ClockFreq(void)
{
uint32_t frequency = 0;
/* 获取APB2分频系数,APB源自AHB */
switch(FL_RCC_GetAPB2Prescaler())
{
case FL_RCC_APB2CLK_PSC_DIV1:
frequency = FL_RCC_GetAHBClockFreq();
break;
case FL_RCC_APB2CLK_PSC_DIV2:
frequency = FL_RCC_GetAHBClockFreq() / 2;
break;
case FL_RCC_APB2CLK_PSC_DIV4:
frequency = FL_RCC_GetAHBClockFreq() / 4;
break;
case FL_RCC_APB2CLK_PSC_DIV8:
frequency = FL_RCC_GetAHBClockFreq() / 8;
break;
case FL_RCC_APB2CLK_PSC_DIV16:
frequency = FL_RCC_GetAHBClockFreq() / 16;
break;
default:
frequency = FL_RCC_GetAHBClockFreq();
break;
}
return frequency;
}
/**
* @brief 获取RCMF输出时钟频率
*
* @retval RCMF输出时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetRCMFClockFreq(void)
{
uint32_t frequency = 0;
switch(FL_RCC_RCMF_GetPrescaler())
{
case FL_RCC_RCMF_PSC_DIV1:
frequency = 4000000;
break;
case FL_RCC_RCMF_PSC_DIV4:
frequency = 1000000;
break;
case FL_RCC_RCMF_PSC_DIV8:
frequency = 500000;
break;
case FL_RCC_RCMF_PSC_DIV16:
frequency = 250000;
break;
default:
frequency = 4000000;
break;
}
return frequency;
}
/**
* @brief 获取RCHF输出时钟频率
*
* @retval 返回RCHF输出时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetRCHFClockFreq(void)
{
uint32_t frequency = 0;
switch(FL_RCC_RCHF_GetFrequency())
{
case FL_RCC_RCHF_FREQUENCY_8MHZ:
frequency = 8000000;
break;
case FL_RCC_RCHF_FREQUENCY_16MHZ:
frequency = 16000000;
break;
case FL_RCC_RCHF_FREQUENCY_24MHZ:
frequency = 24000000;
break;
default:
frequency = 8000000;
break;
}
return frequency;
}
/**
* @brief 获取PLL输出时钟频率
*
* @retval 返回PLL输出时钟频率(Hz)
*
*/
uint32_t FL_RCC_GetPLLClockFreq(void)
{
uint32_t frequency = 0;
uint32_t multiplier = 0;
/* 获取PLL时钟源 */
switch(FL_RCC_PLL_GetClockSource())
{
case FL_RCC_PLL_CLK_SOURCE_RCHF:
/* 获取RCHF配置主频 */
frequency = FL_RCC_GetRCHFClockFreq();
break;
case FL_RCC_PLL_CLK_SOURCE_XTHF:
frequency = XTHFClock;
break;
default:
frequency = FL_RCC_GetRCHFClockFreq();
break;
}
/* 获取PLL时钟分频系数 */
switch(FL_RCC_PLL_GetPrescaler())
{
case FL_RCC_PLL_PSC_DIV1:
break;
case FL_RCC_PLL_PSC_DIV2:
frequency /= 2;
break;
case FL_RCC_PLL_PSC_DIV4:
frequency /= 4;
break;
case FL_RCC_PLL_PSC_DIV8:
frequency /= 8;
break;
case FL_RCC_PLL_PSC_DIV12:
frequency /= 12;
break;
case FL_RCC_PLL_PSC_DIV16:
frequency /= 16;
break;
case FL_RCC_PLL_PSC_DIV24:
frequency /= 24;
break;
case FL_RCC_PLL_PSC_DIV32:
frequency /= 32;
break;
default:
break;
}
multiplier = FL_RCC_PLL_ReadMultiplier() + 1;
frequency *= multiplier;
return frequency;
}
/**
* @}
*/
#endif /* FL_RCC_DRIVER_ENABLED */
/**
* @}
*/
/**
* @}
*/
/********************** (C) COPYRIGHT Fudan Microelectronics **** END OF FILE ***********************/
|
4f7d6a9dad3be089a6cf4458b24b2edb3c80c213
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/audio/alsa-lib/files/patch-include_pcm.h
|
6dd552dd0db4493f6a2f774dc5abe4c1402b9103
|
[
"BSD-2-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C
| false
| false
| 270
|
h
|
patch-include_pcm.h
|
--- include/pcm.h.orig 2016-03-31 13:10:39 UTC
+++ include/pcm.h
@@ -29,6 +29,13 @@
#ifndef __ALSA_PCM_H
#define __ALSA_PCM_H
+#ifndef ESTRPIPE
+#define ESTRPIPE EPIPE
+#endif
+#ifndef EBADFD
+#define EBADFD EBADF
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
|
04f69e77043941e1c3329652ad5ceddc1b14118a
|
66df4873f0599b86e6baf66bb3a0c87329a71e61
|
/FIFO-queue/array-no-dup-forget-old/Item.h
|
00f4535fa4a48c83caaf8dc790996fc751d45e4d
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
bartobri/data-structures-c
|
1aaaa0f9f36b173b2df6049d9677c70a0d2afbde
|
02d8e6b0aec7d38af5f5d5cab3383bdbc2288a61
|
refs/heads/master
| 2023-02-21T23:00:18.553695
| 2023-02-17T16:58:37
| 2023-02-17T16:58:37
| 82,822,619
| 102
| 48
|
MIT
| 2020-10-01T12:04:34
| 2017-02-22T15:48:12
|
C
|
UTF-8
|
C
| false
| false
| 101
|
h
|
Item.h
|
#ifndef ITEM_H
#define ITEM_H 1
// Use the int typedef when compiling 4.2
typedef int Item;
#endif
|
2f80d3c734eab7d3b8e0c875178533be1158c1f7
|
17227ad12bc0826771ac6ac2b95dddd9517d0117
|
/PVSupport/Sources/retro/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c
|
a85eb64ddbc1ac0b718b312d9ff324c7068718d7
|
[
"BSD-2-Clause"
] |
permissive
|
Provenance-Emu/Provenance
|
e38f7c81e784455d4876f8a2ff999baca0135199
|
c6f49d7921ee27eb8c0c34ca95ec9dc7baf584c1
|
refs/heads/develop
| 2023-08-17T05:04:01.554294
| 2023-07-01T07:58:33
| 2023-07-01T07:58:33
| 12,416,862
| 2,367
| 364
|
NOASSERTION
| 2023-08-01T07:42:35
| 2013-08-27T20:34:36
|
C
|
UTF-8
|
C
| false
| false
| 29,686
|
c
|
render_chain_gl_legacy.c
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
* Copyright (C) 2012-2015 - Michael Lelli
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _MSC_VER
#pragma comment(lib, "opengl32")
#endif
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <compat/strl.h>
#include <gfx/scaler/scaler.h>
#include <gfx/math/matrix_4x4.h>
#include <formats/image.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include <libretro.h>
#include "../../../driver.h"
#include "../../../record/record_driver.h"
#include "../../../performance_counters.h"
#include "../../../general.h"
#include "../../../retroarch.h"
#include "../../../verbosity.h"
#include "../../common/gl_common.h"
#include "render_chain_gl.h"
#ifdef HAVE_THREADS
#include "../../video_thread_wrapper.h"
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../../font_driver.h"
#include "../../video_context_driver.h"
#include "../../video_frame.h"
#ifdef HAVE_GLSL
#include "../../drivers_shader/shader_glsl.h"
#endif
#ifdef GL_DEBUG
#include <lists/string_list.h>
#endif
#ifdef HAVE_MENU
#include "../../../menu/menu_driver.h"
#endif
#if defined(_WIN32) && !defined(_XBOX)
#include "../../common/win32_common.h"
#endif
#include "../../video_shader_driver.h"
#ifndef GL_SYNC_GPU_COMMANDS_COMPLETE
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#endif
#ifndef GL_SYNC_FLUSH_COMMANDS_BIT
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#endif
#define set_texture_coords(coords, xamt, yamt) \
coords[2] = xamt; \
coords[6] = xamt; \
coords[5] = yamt; \
coords[7] = yamt
/* Used when rendering to an FBO.
* Texture coords have to be aligned
* with vertex coordinates. */
static const GLfloat fbo_vertexes[] = {
0, 0,
1, 0,
0, 1,
1, 1
};
#ifdef IOS
/* There is no default frame buffer on iOS. */
void cocoagl_bind_game_view_fbo(void);
#define gl_bind_backbuffer() cocoagl_bind_game_view_fbo()
#else
#define gl_bind_backbuffer() glBindFramebuffer(RARCH_GL_FRAMEBUFFER, 0)
#endif
#ifdef HAVE_FBO
void gl_renderchain_convert_geometry(gl_t *gl,
struct video_fbo_rect *fbo_rect,
struct gfx_fbo_scale *fbo_scale,
unsigned last_width, unsigned last_max_width,
unsigned last_height, unsigned last_max_height,
unsigned vp_width, unsigned vp_height)
{
switch (fbo_scale->type_x)
{
case RARCH_SCALE_INPUT:
fbo_rect->img_width = fbo_scale->scale_x * last_width;
fbo_rect->max_img_width = last_max_width * fbo_scale->scale_x;
break;
case RARCH_SCALE_ABSOLUTE:
fbo_rect->img_width = fbo_rect->max_img_width =
fbo_scale->abs_x;
break;
case RARCH_SCALE_VIEWPORT:
fbo_rect->img_width = fbo_rect->max_img_width =
fbo_scale->scale_x * vp_width;
break;
}
switch (fbo_scale->type_y)
{
case RARCH_SCALE_INPUT:
fbo_rect->img_height = last_height * fbo_scale->scale_y;
fbo_rect->max_img_height = last_max_height * fbo_scale->scale_y;
break;
case RARCH_SCALE_ABSOLUTE:
fbo_rect->img_height = fbo_scale->abs_y;
fbo_rect->max_img_height = fbo_scale->abs_y;
break;
case RARCH_SCALE_VIEWPORT:
fbo_rect->img_height = fbo_rect->max_img_height =
fbo_scale->scale_y * vp_height;
break;
}
}
static bool gl_recreate_fbo(
struct video_fbo_rect *fbo_rect,
GLuint fbo,
GLuint texture
)
{
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, fbo);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D,
0, RARCH_GL_INTERNAL_FORMAT32,
fbo_rect->width,
fbo_rect->height,
0, RARCH_GL_TEXTURE_TYPE32,
RARCH_GL_FORMAT32, NULL);
glFramebufferTexture2D(RARCH_GL_FRAMEBUFFER,
RARCH_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
texture, 0);
if (glCheckFramebufferStatus(RARCH_GL_FRAMEBUFFER) != RARCH_GL_FRAMEBUFFER_COMPLETE)
{
WLOG(@"Failed to reinitialize FBO texture.\n");
return false;
}
return true;
}
static void gl_check_fbo_dimension(gl_t *gl, unsigned i,
GLuint fbo, GLuint texture, bool update_feedback)
{
unsigned img_width, img_height, max, pow2_size;
bool check_dimensions = false;
struct video_fbo_rect *fbo_rect = &gl->fbo_rect[i];
if (!fbo_rect)
return;
check_dimensions =
(fbo_rect->max_img_width > fbo_rect->width) ||
(fbo_rect->max_img_height > fbo_rect->height);
if (!check_dimensions)
return;
/* Check proactively since we might suddently
* get sizes of tex_w width or tex_h height. */
img_width = fbo_rect->max_img_width;
img_height = fbo_rect->max_img_height;
max = img_width > img_height ? img_width : img_height;
pow2_size = next_pow2(max);
fbo_rect->width = fbo_rect->height = pow2_size;
gl_recreate_fbo(fbo_rect, fbo, texture);
/* Update feedback texture in-place so we avoid having to
* juggle two different fbo_rect structs since they get updated here. */
if (update_feedback)
{
if (gl_recreate_fbo(fbo_rect, gl->fbo_feedback,
gl->fbo_feedback_texture))
{
/* Make sure the feedback textures are cleared
* so we don't feedback noise. */
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
}
}
VLOG(@"[GL]: Recreating FBO texture #%d: %ux%u\n",
i, fbo_rect->width, fbo_rect->height);
}
/* On resize, we might have to recreate our FBOs
* due to "Viewport" scale, and set a new viewport. */
void gl_check_fbo_dimensions(gl_t *gl)
{
int i;
/* Check if we have to recreate our FBO textures. */
for (i = 0; i < gl->fbo_pass; i++)
{
bool update_feedback = gl->fbo_feedback_enable
&& (unsigned)i == gl->fbo_feedback_pass;
gl_check_fbo_dimension(gl, i, gl->fbo[i],
gl->fbo_texture[i], update_feedback);
}
}
void gl_renderchain_render(gl_t *gl,
uint64_t frame_count,
const struct video_tex_info *tex_info,
const struct video_tex_info *feedback_info)
{
unsigned mip_level;
video_shader_ctx_mvp_t mvp;
video_shader_ctx_coords_t coords;
video_shader_ctx_params_t params;
video_shader_ctx_info_t shader_info;
unsigned width, height;
const struct video_fbo_rect *prev_rect;
struct video_tex_info *fbo_info;
struct video_tex_info fbo_tex_info[GFX_MAX_SHADERS];
int i;
GLfloat xamt, yamt;
unsigned fbo_tex_info_cnt = 0;
GLfloat fbo_tex_coords[8] = {0.0f};
video_driver_get_size(&width, &height);
/* Render the rest of our passes. */
gl->coords.tex_coord = fbo_tex_coords;
/* Calculate viewports, texture coordinates etc,
* and render all passes from FBOs, to another FBO. */
for (i = 1; i < gl->fbo_pass; i++)
{
video_shader_ctx_mvp_t mvp;
video_shader_ctx_coords_t coords;
video_shader_ctx_params_t params;
const struct video_fbo_rect *rect = &gl->fbo_rect[i];
prev_rect = &gl->fbo_rect[i - 1];
fbo_info = &fbo_tex_info[i - 1];
xamt = (GLfloat)prev_rect->img_width / prev_rect->width;
yamt = (GLfloat)prev_rect->img_height / prev_rect->height;
set_texture_coords(fbo_tex_coords, xamt, yamt);
fbo_info->tex = gl->fbo_texture[i - 1];
fbo_info->input_size[0] = prev_rect->img_width;
fbo_info->input_size[1] = prev_rect->img_height;
fbo_info->tex_size[0] = prev_rect->width;
fbo_info->tex_size[1] = prev_rect->height;
memcpy(fbo_info->coord, fbo_tex_coords, sizeof(fbo_tex_coords));
fbo_tex_info_cnt++;
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[i]);
shader_info.data = gl;
shader_info.idx = i + 1;
shader_info.set_active = true;
video_shader_driver_use(&shader_info);
glBindTexture(GL_TEXTURE_2D, gl->fbo_texture[i - 1]);
mip_level = i + 1;
if (video_shader_driver_mipmap_input(&mip_level)
&& gl_check_capability(GL_CAPS_MIPMAP))
glGenerateMipmap(GL_TEXTURE_2D);
glClear(GL_COLOR_BUFFER_BIT);
/* Render to FBO with certain size. */
gl_set_viewport(gl, rect->img_width, rect->img_height, true, false);
params.data = gl;
params.width = prev_rect->img_width;
params.height = prev_rect->img_height;
params.tex_width = prev_rect->width;
params.tex_height = prev_rect->height;
params.out_width = gl->vp.width;
params.out_height = gl->vp.height;
params.frame_counter = (unsigned int)frame_count;
params.info = tex_info;
params.prev_info = gl->prev_info;
params.feedback_info = feedback_info;
params.fbo_info = fbo_tex_info;
params.fbo_info_cnt = fbo_tex_info_cnt;
video_shader_driver_set_parameters(¶ms);
gl->coords.vertices = 4;
coords.handle_data = NULL;
coords.data = &gl->coords;
video_shader_driver_set_coords(&coords);
mvp.data = gl;
mvp.matrix = &gl->mvp;
video_shader_driver_set_mvp(&mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
#if defined(GL_FRAMEBUFFER_SRGB) && !defined(HAVE_OPENGLES)
if (gl->has_srgb_fbo)
glDisable(GL_FRAMEBUFFER_SRGB);
#endif
/* Render our last FBO texture directly to screen. */
prev_rect = &gl->fbo_rect[gl->fbo_pass - 1];
xamt = (GLfloat)prev_rect->img_width / prev_rect->width;
yamt = (GLfloat)prev_rect->img_height / prev_rect->height;
set_texture_coords(fbo_tex_coords, xamt, yamt);
/* Push final FBO to list. */
fbo_info = &fbo_tex_info[gl->fbo_pass - 1];
fbo_info->tex = gl->fbo_texture[gl->fbo_pass - 1];
fbo_info->input_size[0] = prev_rect->img_width;
fbo_info->input_size[1] = prev_rect->img_height;
fbo_info->tex_size[0] = prev_rect->width;
fbo_info->tex_size[1] = prev_rect->height;
memcpy(fbo_info->coord, fbo_tex_coords, sizeof(fbo_tex_coords));
fbo_tex_info_cnt++;
/* Render our FBO texture to back buffer. */
gl_bind_backbuffer();
shader_info.data = gl;
shader_info.idx = gl->fbo_pass + 1;
shader_info.set_active = true;
video_shader_driver_use(&shader_info);
glBindTexture(GL_TEXTURE_2D, gl->fbo_texture[gl->fbo_pass - 1]);
mip_level = gl->fbo_pass + 1;
if (video_shader_driver_mipmap_input(&mip_level)
&& gl_check_capability(GL_CAPS_MIPMAP))
glGenerateMipmap(GL_TEXTURE_2D);
glClear(GL_COLOR_BUFFER_BIT);
gl_set_viewport(gl, width, height, false, true);
params.data = gl;
params.width = prev_rect->img_width;
params.height = prev_rect->img_height;
params.tex_width = prev_rect->width;
params.tex_height = prev_rect->height;
params.out_width = gl->vp.width;
params.out_height = gl->vp.height;
params.frame_counter = (unsigned int)frame_count;
params.info = tex_info;
params.prev_info = gl->prev_info;
params.feedback_info = feedback_info;
params.fbo_info = fbo_tex_info;
params.fbo_info_cnt = fbo_tex_info_cnt;
video_shader_driver_set_parameters(¶ms);
gl->coords.vertex = gl->vertex_ptr;
gl->coords.vertices = 4;
coords.handle_data = NULL;
coords.data = &gl->coords;
video_shader_driver_set_coords(&coords);
mvp.data = gl;
mvp.matrix = &gl->mvp;
video_shader_driver_set_mvp(&mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
gl->coords.tex_coord = gl->tex_info.coord;
}
void gl_renderchain_free(gl_t *gl)
{
gl_deinit_fbo(gl);
gl_deinit_hw_render(gl);
}
static bool gl_create_fbo_targets(gl_t *gl)
{
int i;
GLenum status;
if (!gl)
return false;
glBindTexture(GL_TEXTURE_2D, 0);
glGenFramebuffers(gl->fbo_pass, gl->fbo);
for (i = 0; i < gl->fbo_pass; i++)
{
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[i]);
glFramebufferTexture2D(RARCH_GL_FRAMEBUFFER,
RARCH_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gl->fbo_texture[i], 0);
status = glCheckFramebufferStatus(RARCH_GL_FRAMEBUFFER);
if (status != RARCH_GL_FRAMEBUFFER_COMPLETE)
goto error;
}
if (gl->fbo_feedback_texture)
{
glGenFramebuffers(1, &gl->fbo_feedback);
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo_feedback);
glFramebufferTexture2D(RARCH_GL_FRAMEBUFFER,
RARCH_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
gl->fbo_feedback_texture, 0);
status = glCheckFramebufferStatus(RARCH_GL_FRAMEBUFFER);
if (status != RARCH_GL_FRAMEBUFFER_COMPLETE)
goto error;
/* Make sure the feedback textures are cleared
* so we don't feedback noise. */
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
}
return true;
error:
glDeleteFramebuffers(gl->fbo_pass, gl->fbo);
if (gl->fbo_feedback)
glDeleteFramebuffers(1, &gl->fbo_feedback);
ELOG(@"Failed to set up frame buffer objects. Multi-pass shading will not work.\n");
return false;
}
static void gl_create_fbo_texture(gl_t *gl, unsigned i, GLuint texture)
{
unsigned mip_level;
bool fp_fbo;
GLenum min_filter, mag_filter, wrap_enum;
video_shader_ctx_filter_t filter_type;
video_shader_ctx_wrap_t wrap = {0};
bool mipmapped = false;
bool smooth = false;
settings_t *settings = config_get_ptr();
GLuint base_filt = settings->video.smooth ? GL_LINEAR : GL_NEAREST;
GLuint base_mip_filt = settings->video.smooth ?
GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST;
glBindTexture(GL_TEXTURE_2D, texture);
mip_level = i + 2;
mipmapped = video_shader_driver_mipmap_input(&mip_level);
min_filter = mipmapped ? base_mip_filt : base_filt;
filter_type.index = i + 2;
filter_type.smooth = &smooth;
if (video_shader_driver_filter_type(&filter_type))
{
min_filter = mipmapped ? (smooth ?
GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST)
: (smooth ? GL_LINEAR : GL_NEAREST);
}
mag_filter = min_filter_to_mag(min_filter);
wrap.idx = i + 2;
video_shader_driver_wrap_type(&wrap);
wrap_enum = gl_wrap_type_to_enum(wrap.type);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_enum);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_enum);
fp_fbo = gl->fbo_scale[i].fp_fbo;
if (fp_fbo)
{
if (!gl->has_fp_fbo)
ELOG(@"[GL]: Floating-point FBO was requested, but is not supported. Falling back to UNORM. Result may band/clip/etc.!\n");
}
#ifndef HAVE_OPENGLES2
if (fp_fbo && gl->has_fp_fbo)
{
VLOG(@"[GL]: FBO pass #%d is floating-point.\n", i);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F,
gl->fbo_rect[i].width, gl->fbo_rect[i].height,
0, GL_RGBA, GL_FLOAT, NULL);
}
else
#endif
{
#ifndef HAVE_OPENGLES
bool srgb_fbo = gl->fbo_scale[i].srgb_fbo;
if (!fp_fbo && srgb_fbo)
{
if (!gl->has_srgb_fbo)
ELOG(@"[GL]: sRGB FBO was requested, but it is not supported. Falling back to UNORM. Result may have banding!\n");
}
if (settings->video.force_srgb_disable)
srgb_fbo = false;
if (srgb_fbo && gl->has_srgb_fbo)
{
VLOG(@"[GL]: FBO pass #%d is sRGB.\n", i);
#ifdef HAVE_OPENGLES2
/* EXT defines are same as core GLES3 defines,
* but GLES3 variant requires different arguments. */
glTexImage2D(GL_TEXTURE_2D,
0, GL_SRGB_ALPHA_EXT,
gl->fbo_rect[i].width, gl->fbo_rect[i].height, 0,
gl->has_srgb_fbo_gles3 ? GL_RGBA : GL_SRGB_ALPHA_EXT,
GL_UNSIGNED_BYTE, NULL);
#else
glTexImage2D(GL_TEXTURE_2D,
0, GL_SRGB8_ALPHA8,
gl->fbo_rect[i].width, gl->fbo_rect[i].height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
#endif
}
else
#endif
{
#ifdef HAVE_OPENGLES2
glTexImage2D(GL_TEXTURE_2D,
0, GL_RGBA,
gl->fbo_rect[i].width, gl->fbo_rect[i].height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
#else
/* Avoid potential performance
* reductions on particular platforms. */
glTexImage2D(GL_TEXTURE_2D,
0, RARCH_GL_INTERNAL_FORMAT32,
gl->fbo_rect[i].width, gl->fbo_rect[i].height, 0,
RARCH_GL_TEXTURE_TYPE32, RARCH_GL_FORMAT32, NULL);
#endif
}
}
}
static void gl_create_fbo_textures(gl_t *gl)
{
int i;
glGenTextures(gl->fbo_pass, gl->fbo_texture);
for (i = 0; i < gl->fbo_pass; i++)
gl_create_fbo_texture(gl, i, gl->fbo_texture[i]);
if (gl->fbo_feedback_enable)
{
glGenTextures(1, &gl->fbo_feedback_texture);
gl_create_fbo_texture(gl,
gl->fbo_feedback_pass, gl->fbo_feedback_texture);
}
glBindTexture(GL_TEXTURE_2D, 0);
}
/* Compute FBO geometry.
* When width/height changes or window sizes change,
* we have to recalculate geometry of our FBO. */
void gl_renderchain_recompute_pass_sizes(gl_t *gl,
unsigned width, unsigned height,
unsigned vp_width, unsigned vp_height)
{
int i;
bool size_modified = false;
GLint max_size = 0;
unsigned last_width = width;
unsigned last_height = height;
unsigned last_max_width = gl->tex_w;
unsigned last_max_height = gl->tex_h;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_size);
/* Calculate viewports for FBOs. */
for (i = 0; i < gl->fbo_pass; i++)
{
struct video_fbo_rect *fbo_rect = &gl->fbo_rect[i];
struct gfx_fbo_scale *fbo_scale = &gl->fbo_scale[i];
gl_renderchain_convert_geometry(gl, fbo_rect, fbo_scale,
last_width, last_max_width,
last_height, last_max_height,
vp_width, vp_height
);
if (fbo_rect->img_width > (unsigned)max_size)
{
size_modified = true;
fbo_rect->img_width = max_size;
}
if (fbo_rect->img_height > (unsigned)max_size)
{
size_modified = true;
fbo_rect->img_height = max_size;
}
if (fbo_rect->max_img_width > (unsigned)max_size)
{
size_modified = true;
fbo_rect->max_img_width = max_size;
}
if (fbo_rect->max_img_height > (unsigned)max_size)
{
size_modified = true;
fbo_rect->max_img_height = max_size;
}
if (size_modified)
WLOG(@"FBO textures exceeded maximum size of GPU (%dx%d). Resizing to fit.\n", max_size, max_size);
last_width = fbo_rect->img_width;
last_height = fbo_rect->img_height;
last_max_width = fbo_rect->max_img_width;
last_max_height = fbo_rect->max_img_height;
}
}
void gl_renderchain_start_render(gl_t *gl)
{
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[0]);
gl_set_viewport(gl, gl->fbo_rect[0].img_width,
gl->fbo_rect[0].img_height, true, false);
/* Need to preserve the "flipped" state when in FBO
* as well to have consistent texture coordinates.
*
* We will "flip" it in place on last pass. */
gl->coords.vertex = fbo_vertexes;
#if defined(GL_FRAMEBUFFER_SRGB) && !defined(HAVE_OPENGLES)
if (gl->has_srgb_fbo)
glEnable(GL_FRAMEBUFFER_SRGB);
#endif
}
void gl_deinit_fbo(gl_t *gl)
{
if (!gl->fbo_inited)
return;
glDeleteTextures(gl->fbo_pass, gl->fbo_texture);
glDeleteFramebuffers(gl->fbo_pass, gl->fbo);
memset(gl->fbo_texture, 0, sizeof(gl->fbo_texture));
memset(gl->fbo, 0, sizeof(gl->fbo));
gl->fbo_inited = false;
gl->fbo_pass = 0;
if (gl->fbo_feedback)
glDeleteFramebuffers(1, &gl->fbo_feedback);
if (gl->fbo_feedback_texture)
glDeleteTextures(1, &gl->fbo_feedback_texture);
gl->fbo_feedback_enable = false;
gl->fbo_feedback_pass = -1;
gl->fbo_feedback_texture = 0;
gl->fbo_feedback = 0;
}
/* Set up render to texture. */
void gl_renderchain_init(gl_t *gl, unsigned fbo_width, unsigned fbo_height)
{
int i;
unsigned width, height;
video_shader_ctx_scale_t scaler;
video_shader_ctx_info_t shader_info;
struct gfx_fbo_scale scale, scale_last;
if (!video_shader_driver_info(&shader_info))
return;
if (!gl || shader_info.num == 0)
return;
video_driver_get_size(&width, &height);
scaler.idx = 1;
scaler.scale = &scale;
video_shader_driver_scale(&scaler);
scaler.idx = shader_info.num;
scaler.scale = &scale_last;
video_shader_driver_scale(&scaler);
/* we always want FBO to be at least initialized on startup for consoles */
if (shader_info.num == 1 && !scale.valid)
return;
if (!gl_check_capability(GL_CAPS_FBO))
{
ELOG(@"Failed to locate FBO functions. Won't be able to use render-to-texture.\n");
return;
}
gl->fbo_pass = shader_info.num - 1;
if (scale_last.valid)
gl->fbo_pass++;
if (!scale.valid)
{
scale.scale_x = 1.0f;
scale.scale_y = 1.0f;
scale.type_x = scale.type_y = RARCH_SCALE_INPUT;
scale.valid = true;
}
gl->fbo_scale[0] = scale;
for (i = 1; i < gl->fbo_pass; i++)
{
scaler.idx = i + 1;
scaler.scale = &gl->fbo_scale[i];
video_shader_driver_scale(&scaler);
if (!gl->fbo_scale[i].valid)
{
gl->fbo_scale[i].scale_x = gl->fbo_scale[i].scale_y = 1.0f;
gl->fbo_scale[i].type_x = gl->fbo_scale[i].type_y =
RARCH_SCALE_INPUT;
gl->fbo_scale[i].valid = true;
}
}
gl_renderchain_recompute_pass_sizes(gl,
fbo_width, fbo_height, width, height);
for (i = 0; i < gl->fbo_pass; i++)
{
gl->fbo_rect[i].width = next_pow2(gl->fbo_rect[i].img_width);
gl->fbo_rect[i].height = next_pow2(gl->fbo_rect[i].img_height);
VLOG(@"[GL]: Creating FBO %d @ %ux%u\n", i,
gl->fbo_rect[i].width, gl->fbo_rect[i].height);
}
gl->fbo_feedback_enable = video_shader_driver_get_feedback_pass(
&gl->fbo_feedback_pass);
if (gl->fbo_feedback_enable && gl->fbo_feedback_pass
< (unsigned)gl->fbo_pass)
{
VLOG(@"[GL]: Creating feedback FBO %d @ %ux%u\n", i,
gl->fbo_rect[gl->fbo_feedback_pass].width,
gl->fbo_rect[gl->fbo_feedback_pass].height);
}
else if (gl->fbo_feedback_enable)
{
WLOG(@"[GL]: Tried to create feedback FBO of pass #%u, but there are only %d FBO passes. Will use input texture as feedback texture.\n",
gl->fbo_feedback_pass, gl->fbo_pass);
gl->fbo_feedback_enable = false;
}
gl_create_fbo_textures(gl);
if (!gl_create_fbo_targets(gl))
{
glDeleteTextures(gl->fbo_pass, gl->fbo_texture);
ELOG(@"Failed to create FBO targets. Will continue without FBO.\n");
return;
}
gl->fbo_inited = true;
}
void gl_deinit_hw_render(gl_t *gl)
{
if (!gl)
return;
context_bind_hw_render(true);
if (gl->hw_render_fbo_init)
glDeleteFramebuffers(gl->textures, gl->hw_render_fbo);
if (gl->hw_render_depth_init)
glDeleteRenderbuffers(gl->textures, gl->hw_render_depth);
gl->hw_render_fbo_init = false;
context_bind_hw_render(false);
}
bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height)
{
GLenum status;
unsigned i;
bool depth = false;
bool stencil = false;
GLint max_fbo_size = 0;
GLint max_renderbuffer_size = 0;
struct retro_hw_render_callback *hwr =
video_driver_get_hw_context();
/* We can only share texture objects through contexts.
* FBOs are "abstract" objects and are not shared. */
context_bind_hw_render(true);
VLOG(@"[GL]: Initializing HW render (%u x %u).\n", width, height);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_fbo_size);
glGetIntegerv(RARCH_GL_MAX_RENDERBUFFER_SIZE, &max_renderbuffer_size);
VLOG(@"[GL]: Max texture size: %d px, renderbuffer size: %d px.\n",
max_fbo_size, max_renderbuffer_size);
if (!gl_check_capability(GL_CAPS_FBO))
return false;
VLOG(@"[GL]: Supports FBO (render-to-texture).\n");
glBindTexture(GL_TEXTURE_2D, 0);
glGenFramebuffers(gl->textures, gl->hw_render_fbo);
depth = hwr->depth;
stencil = hwr->stencil;
#ifdef HAVE_OPENGLES
if (!gl_check_capability(GL_CAPS_PACKED_DEPTH_STENCIL))
return false;
VLOG(@"[GL]: Supports Packed depth stencil.\n");
#endif
if (depth)
{
glGenRenderbuffers(gl->textures, gl->hw_render_depth);
gl->hw_render_depth_init = true;
}
for (i = 0; i < gl->textures; i++)
{
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->hw_render_fbo[i]);
glFramebufferTexture2D(RARCH_GL_FRAMEBUFFER,
RARCH_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gl->texture[i], 0);
if (depth)
{
glBindRenderbuffer(RARCH_GL_RENDERBUFFER, gl->hw_render_depth[i]);
glRenderbufferStorage(RARCH_GL_RENDERBUFFER,
stencil ? RARCH_GL_DEPTH24_STENCIL8 : GL_DEPTH_COMPONENT16,
width, height);
glBindRenderbuffer(RARCH_GL_RENDERBUFFER, 0);
if (stencil)
{
#if defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES1) || defined(OSX_PPC)
/* GLES2 is a bit weird, as always.
* There's no GL_DEPTH_STENCIL_ATTACHMENT like in desktop GL. */
glFramebufferRenderbuffer(RARCH_GL_FRAMEBUFFER,
RARCH_GL_DEPTH_ATTACHMENT,
RARCH_GL_RENDERBUFFER, gl->hw_render_depth[i]);
glFramebufferRenderbuffer(RARCH_GL_FRAMEBUFFER,
RARCH_GL_STENCIL_ATTACHMENT,
RARCH_GL_RENDERBUFFER, gl->hw_render_depth[i]);
#else
/* We use ARB FBO extensions, no need to check. */
glFramebufferRenderbuffer(RARCH_GL_FRAMEBUFFER,
GL_DEPTH_STENCIL_ATTACHMENT,
RARCH_GL_RENDERBUFFER, gl->hw_render_depth[i]);
#endif
}
else
{
glFramebufferRenderbuffer(RARCH_GL_FRAMEBUFFER,
RARCH_GL_DEPTH_ATTACHMENT,
RARCH_GL_RENDERBUFFER, gl->hw_render_depth[i]);
}
}
status = glCheckFramebufferStatus(RARCH_GL_FRAMEBUFFER);
if (status != RARCH_GL_FRAMEBUFFER_COMPLETE)
{
ELOG(@"[GL]: Failed to create HW render FBO #%u, error: 0x%u.\n",
i, (unsigned)status);
return false;
}
}
gl_bind_backbuffer();
gl->hw_render_fbo_init = true;
context_bind_hw_render(false);
return true;
}
#endif
void gl_renderchain_bind_prev_texture(
void *data,
const struct video_tex_info *tex_info)
{
gl_t *gl = (gl_t*)data;
memmove(gl->prev_info + 1, gl->prev_info,
sizeof(*tex_info) * (gl->textures - 1));
memcpy(&gl->prev_info[0], tex_info,
sizeof(*tex_info));
#ifdef HAVE_FBO
/* Implement feedback by swapping out FBO/textures
* for FBO pass #N and feedbacks. */
if (gl->fbo_feedback_enable)
{
GLuint tmp_fbo = gl->fbo_feedback;
GLuint tmp_tex = gl->fbo_feedback_texture;
gl->fbo_feedback = gl->fbo[gl->fbo_feedback_pass];
gl->fbo_feedback_texture = gl->fbo_texture[gl->fbo_feedback_pass];
gl->fbo[gl->fbo_feedback_pass] = tmp_fbo;
gl->fbo_texture[gl->fbo_feedback_pass] = tmp_tex;
}
#endif
}
bool gl_renderchain_add_lut(const struct video_shader *shader,
unsigned i, GLuint *textures_lut)
{
struct texture_image img = {0};
enum texture_filter_type filter_type = TEXTURE_FILTER_LINEAR;
if (!image_texture_load(&img, shader->lut[i].path))
{
ELOG(@"Failed to load texture image from: \"%s\"\n",
shader->lut[i].path);
return false;
}
VLOG(@"Loaded texture image from: \"%s\" ...\n",
shader->lut[i].path);
if (shader->lut[i].filter == RARCH_FILTER_NEAREST)
filter_type = TEXTURE_FILTER_NEAREST;
if (shader->lut[i].mipmap)
{
if (filter_type == TEXTURE_FILTER_NEAREST)
filter_type = TEXTURE_FILTER_MIPMAP_NEAREST;
else
filter_type = TEXTURE_FILTER_MIPMAP_LINEAR;
}
gl_load_texture_data(textures_lut[i],
shader->lut[i].wrap,
filter_type, 4,
img.width, img.height,
img.pixels, sizeof(uint32_t));
image_texture_free(&img);
return true;
}
|
d2aed6fe4c42e9ea8af3bfddb2eab99002a33472
|
cb80ffbfe6b12be3f42322537aff3552fd9239f2
|
/examples/textures/textures_sprite_button.c
|
bd9891826f54ec2741650d8a596a767d5dcf6291
|
[
"Zlib",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
raysan5/raylib
|
afe80387401361d6f35f9831978b0b379d2d9971
|
a86c93ebc0095f6c2ffc14656bfc9e1e37070f72
|
refs/heads/master
| 2023-08-16T20:49:02.921768
| 2023-08-14T22:09:27
| 2023-08-14T22:09:27
| 13,836,499
| 15,971
| 2,825
|
Zlib
| 2023-09-14T21:19:02
| 2013-10-24T15:46:04
|
C
|
UTF-8
|
C
| false
| false
| 3,836
|
c
|
textures_sprite_button.c
|
/*******************************************************************************************
*
* raylib [textures] example - sprite button
*
* Example originally created with raylib 2.5, last time updated with raylib 2.5
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2019-2023 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#define NUM_FRAMES 3 // Number of frames (rectangles) for the button sprite texture
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [textures] example - sprite button");
InitAudioDevice(); // Initialize audio device
Sound fxButton = LoadSound("resources/buttonfx.wav"); // Load button sound
Texture2D button = LoadTexture("resources/button.png"); // Load button texture
// Define frame rectangle for drawing
float frameHeight = (float)button.height/NUM_FRAMES;
Rectangle sourceRec = { 0, 0, (float)button.width, frameHeight };
// Define button bounds on screen
Rectangle btnBounds = { screenWidth/2.0f - button.width/2.0f, screenHeight/2.0f - button.height/NUM_FRAMES/2.0f, (float)button.width, frameHeight };
int btnState = 0; // Button state: 0-NORMAL, 1-MOUSE_HOVER, 2-PRESSED
bool btnAction = false; // Button action should be activated
Vector2 mousePoint = { 0.0f, 0.0f };
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
mousePoint = GetMousePosition();
btnAction = false;
// Check button state
if (CheckCollisionPointRec(mousePoint, btnBounds))
{
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) btnState = 2;
else btnState = 1;
if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) btnAction = true;
}
else btnState = 0;
if (btnAction)
{
PlaySound(fxButton);
// TODO: Any desired action
}
// Calculate button frame rectangle to draw depending on button state
sourceRec.y = btnState*frameHeight;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawTextureRec(button, sourceRec, (Vector2){ btnBounds.x, btnBounds.y }, WHITE); // Draw button frame
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(button); // Unload button texture
UnloadSound(fxButton); // Unload sound
CloseAudioDevice(); // Close audio device
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
|
8e7ab0ac178dd628216041faa8c06e6439c00f68
|
badb70a0b235c98ac034cfe5b4bfafda36647831
|
/Library/OcHeciLib/OcHeciLib.c
|
caf6a3bb6e66b30ed20a7d465c2588cdd8a80a15
|
[
"BSD-3-Clause"
] |
permissive
|
acidanthera/OpenCorePkg
|
f34a7d67b22c74fb5ab559e48519e5f5855b6751
|
1d5b1736fe5a5ef7662b5c076c6d11aac96fd5d6
|
refs/heads/master
| 2023-08-30T21:03:02.993659
| 2023-08-28T23:30:43
| 2023-08-28T23:30:43
| 179,354,282
| 13,212
| 2,999
|
BSD-3-Clause
| 2023-09-10T18:29:53
| 2019-04-03T19:14:29
|
C
|
UTF-8
|
C
| false
| false
| 14,834
|
c
|
OcHeciLib.c
|
/** @file
This file implements interaction with HECI.
Copyright (c) 2019, vit9696. All rights reserved.<BR>
Portions copyright (c) 2019, savvas. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause
**/
#include <PiDxe.h>
#include <Library/BaseMemoryLib.h>
#include <Library/OcHeciLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMiscLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/Heci.h>
#include <Protocol/Heci2.h>
#include <IndustryStandard/AppleProvisioning.h>
#include <IndustryStandard/HeciMsg.h>
#include <IndustryStandard/HeciClientMsg.h>
STATIC UINT8 mCurrentMeClientRequestedReceiveMsg;
STATIC UINT8 mCurrentMeClientCanReceiveMsg;
STATIC UINT8 mCurrentMeClientAddress;
STATIC EFI_HECI_PROTOCOL *mHeci;
STATIC EFI_HECI2_PROTOCOL *mHeci2;
STATIC BOOLEAN mSendingHeciCommand;
STATIC BOOLEAN mSendingHeciCommandPerClient;
EFI_STATUS
HeciReadMessage (
IN UINT32 Blocking,
IN UINT32 *MessageBody,
IN OUT UINT32 *Length
)
{
if (mHeci != NULL) {
return mHeci->ReadMsg (
Blocking,
MessageBody,
Length
);
}
if (mHeci2 != NULL) {
return mHeci2->ReadMsg (
HECI_DEFAULT_DEVICE,
Blocking,
MessageBody,
Length
);
}
DEBUG ((DEBUG_INFO, "OCME: No ME protocol loaded, cannot read message\n"));
return EFI_NOT_FOUND;
}
EFI_STATUS
HeciSendMessage (
IN UINT32 *Message,
IN UINT32 Length,
IN UINT8 HostAddress,
IN UINT8 MEAddress
)
{
if (mHeci != NULL) {
return mHeci->SendMsg (
Message,
Length,
HostAddress,
MEAddress
);
}
if (mHeci2 != NULL) {
return mHeci2->SendMsg (
HECI_DEFAULT_DEVICE,
Message,
Length,
HostAddress,
MEAddress
);
}
DEBUG ((DEBUG_INFO, "OCME: No ME protocol loaded, cannot send message\n"));
return EFI_NOT_FOUND;
}
EFI_STATUS
HeciLocateProtocol (
VOID
)
{
EFI_STATUS Status;
if ((mHeci != NULL) || (mHeci2 != NULL)) {
return EFI_SUCCESS;
}
Status = gBS->LocateProtocol (
&gEfiHeciProtocolGuid,
NULL,
(VOID **)&mHeci
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCME: Falling back to HECI 2 protocol - %r\n", Status));
//
// Ensure we don't have both set
//
mHeci = NULL;
Status = gBS->LocateProtocol (
&gEfiHeci2ProtocolGuid,
NULL,
(VOID **)&mHeci2
);
}
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCME: Failed to find any HECI protocol - %r\n", Status));
}
return Status;
}
VOID
HeciUpdateReceiveMsgStatus (
VOID
)
{
EFI_STATUS Status;
UINT32 Size;
HBM_FLOW_CONTROL Command;
if (mSendingHeciCommandPerClient) {
ZeroMem (&Command, sizeof (Command));
Size = sizeof (Command);
Status = HeciReadMessage (
BLOCKING,
(UINT32 *)&Command,
&Size
);
if (!EFI_ERROR (Status) && (Command.Command.Fields.Command == FLOW_CONTROL)) {
++mCurrentMeClientCanReceiveMsg;
}
}
}
EFI_STATUS
HeciGetResponse (
OUT VOID *MessageData,
IN UINT32 ResponseSize
)
{
EFI_STATUS Status;
HBM_FLOW_CONTROL Command;
Status = EFI_NOT_READY;
STATIC_ASSERT (sizeof (HBM_FLOW_CONTROL) == 8, "Invalid ME command size");
if (mSendingHeciCommandPerClient || mSendingHeciCommand) {
ZeroMem (MessageData, ResponseSize);
//
// Note, this was reworked to make more sense.
// https://github.com/osy86/OpenCorePkg/commit/8f7188d41876109aec2fe3a721f69daf979dd268.diff
//
if (!mCurrentMeClientRequestedReceiveMsg) {
ZeroMem (&Command, sizeof (Command));
Command.Command.Fields.Command = FLOW_CONTROL;
Command.MeAddress = mCurrentMeClientAddress;
Command.HostAddress = HBM_CLIENT_ADDRESS;
Status = HeciSendMessage (
(UINT32 *)&Command,
sizeof (Command),
HBM_HOST_ADDRESS,
HBM_ME_ADDRESS
);
if (!EFI_ERROR (Status)) {
++mCurrentMeClientRequestedReceiveMsg;
}
}
Status = HeciReadMessage (
BLOCKING,
MessageData,
&ResponseSize
);
if (!EFI_ERROR (Status)) {
--mCurrentMeClientRequestedReceiveMsg;
}
}
return Status;
}
EFI_STATUS
HeciSendMessageWithResponse (
IN OUT VOID *MessageData,
IN UINT32 RequestSize,
IN UINT32 ResponseSize
)
{
HECI_BUS_MESSAGE *Message;
HBM_COMMAND Command;
EFI_STATUS Status;
mSendingHeciCommand = TRUE;
Message = (HECI_BUS_MESSAGE *)MessageData;
Command = Message->Command;
Status = HeciSendMessage (
MessageData,
RequestSize,
HBM_HOST_ADDRESS,
HBM_ME_ADDRESS
);
if (!EFI_ERROR (Status)) {
Status = HeciGetResponse (MessageData, ResponseSize);
if ( !EFI_ERROR (Status)
&& (Command.Fields.Command != Message->Command.Fields.Command))
{
Status = EFI_PROTOCOL_ERROR;
}
}
mSendingHeciCommand = FALSE;
return Status;
}
EFI_STATUS
HeciGetClientMap (
OUT UINT8 *ClientMap,
OUT UINT8 *ClientActiveCount
)
{
EFI_STATUS Status;
HBM_HOST_ENUMERATION_BUFFER Command;
UINTN Index;
UINTN Index2;
UINT8 *ValidAddressesPtr;
UINT32 ValidAddresses;
*ClientActiveCount = 0;
Status = HeciLocateProtocol ();
if (EFI_ERROR (Status)) {
return Status;
}
STATIC_ASSERT (sizeof (Command.Request) == 4, "Invalid ME command size");
STATIC_ASSERT (sizeof (Command.Response) == 36, "Invalid ME command size");
ZeroMem (&Command, sizeof (Command));
Command.Request.Command.Fields.Command = HOST_ENUMERATION_REQUEST;
Status = HeciSendMessageWithResponse (
&Command,
sizeof (Command.Request),
sizeof (Command.Response)
);
if (EFI_ERROR (Status)) {
return Status;
}
ValidAddressesPtr = &Command.Response.ValidAddresses[0];
for (Index = 0; Index < HBM_ME_CLIENT_MAX; Index += OC_CHAR_BIT) {
ValidAddresses = *ValidAddressesPtr;
for (Index2 = 0; Index2 < OC_CHAR_BIT; Index2++) {
if ((ValidAddresses & (1U << Index2)) != 0) {
ClientMap[*ClientActiveCount] = (UINT8)(Index + Index2);
++(*ClientActiveCount);
}
}
++ValidAddressesPtr;
}
return Status;
}
EFI_STATUS
HeciGetClientProperties (
IN UINT8 Address,
OUT HECI_CLIENT_PROPERTIES *Properties
)
{
EFI_STATUS Status;
HBM_HOST_CLIENT_PROPERTIES_BUFFER Command;
Status = HeciLocateProtocol ();
if (EFI_ERROR (Status)) {
return Status;
}
STATIC_ASSERT (sizeof (Command.Request) == 4, "Invalid ME command size");
STATIC_ASSERT (sizeof (Command.Response) == 28, "Invalid ME command size");
ZeroMem (&Command, sizeof (Command));
Command.Request.Command.Fields.Command = HOST_CLIENT_PROPERTIES_REQUEST;
Command.Request.Address = Address;
Status = HeciSendMessageWithResponse (
&Command,
sizeof (Command.Request),
sizeof (Command.Response)
);
CopyMem (
Properties,
&Command.Response.ClientProperties,
sizeof (*Properties)
);
return Status;
}
EFI_STATUS
HeciConnectToClient (
IN UINT8 Address
)
{
EFI_STATUS Status;
HBM_CLIENT_CONNECT_BUFFER Command;
Status = HeciLocateProtocol ();
if (EFI_ERROR (Status)) {
return Status;
}
ZeroMem (&Command, sizeof (Command));
STATIC_ASSERT (sizeof (Command.Request) == 4, "Invalid ME command size");
Command.Request.Command.Fields.Command = CLIENT_CONNECT_REQUEST;
Command.Request.MeAddress = Address;
Command.Request.HostAddress = HBM_CLIENT_ADDRESS;
Status = HeciSendMessageWithResponse (
&Command,
sizeof (Command.Request),
sizeof (Command.Response)
);
DEBUG ((DEBUG_INFO, "OCME: Connect to client %X code %d - %r\n", Address, Command.Response.Status, Status));
if (EFI_ERROR (Status)) {
return Status;
}
switch (Command.Response.Status) {
case HBM_CLIENT_CONNECT_NOT_FOUND:
return EFI_NOT_FOUND;
case HBM_CLIENT_CONNECT_ALREADY_CONNECTED:
return EFI_ALREADY_STARTED;
case HBM_CLIENT_CONNECT_OUT_OF_RESOURCES:
return EFI_OUT_OF_RESOURCES;
case HBM_CLIENT_CONNECT_INVALID_PARAMETER:
return EFI_INVALID_PARAMETER;
default:
mSendingHeciCommandPerClient = TRUE;
mCurrentMeClientRequestedReceiveMsg = 0;
mCurrentMeClientCanReceiveMsg = 0;
mCurrentMeClientAddress = Address;
return EFI_SUCCESS;
}
}
EFI_STATUS
HeciSendMessagePerClient (
IN VOID *Message,
IN UINT32 Size
)
{
EFI_STATUS Status;
Status = EFI_SUCCESS;
if (mSendingHeciCommandPerClient) {
if (!mCurrentMeClientCanReceiveMsg) {
HeciUpdateReceiveMsgStatus ();
}
Status = HeciSendMessage (
Message,
Size,
HBM_CLIENT_ADDRESS,
mCurrentMeClientAddress
);
if (!EFI_ERROR (Status)) {
--mCurrentMeClientCanReceiveMsg;
}
}
return Status;
}
EFI_STATUS
HeciDisconnectFromClients (
VOID
)
{
EFI_STATUS Status;
HBM_CLIENT_DISCONNECT_BUFFER Command;
Status = EFI_SUCCESS;
if (mSendingHeciCommandPerClient) {
//
// Note, this is different between HECI 1 and HECI 2.
// HECI 1 has 4 byte response, and it does not require HeciUpdateReceiveMsgStatus.
//
STATIC_ASSERT (sizeof (Command.Request) == 4, "Invalid ME command req size");
STATIC_ASSERT (sizeof (Command.Response) == 8, "Invalid ME command rsp size");
if (!mCurrentMeClientCanReceiveMsg) {
HeciUpdateReceiveMsgStatus ();
}
ZeroMem (&Command, sizeof (Command));
Command.Request.Command.Fields.Command = CLIENT_DISCONNECT_REQUEST;
Command.Request.MeAddress = mCurrentMeClientAddress;
Command.Request.HostAddress = HBM_CLIENT_ADDRESS;
++mCurrentMeClientRequestedReceiveMsg;
Status = HeciSendMessageWithResponse (
&Command,
sizeof (Command.Request),
sizeof (Command.Response)
);
DEBUG ((
DEBUG_INFO,
"OCME: Disconnect from client %X code %d - %r\n",
mCurrentMeClientAddress,
Command.Response.Status,
Status
));
if (!EFI_ERROR (Status)) {
mSendingHeciCommandPerClient = FALSE;
}
}
return Status;
}
EFI_STATUS
HeciPavpRequestProvisioning (
OUT UINT32 *EpidStatus,
OUT UINT32 *EpidGroupId
)
{
EFI_STATUS Status;
ME_PAVP_PROVISION_REQUEST_BUFFER Command;
STATIC_ASSERT (sizeof (Command.Request) == 16, "Invalid ME command size");
STATIC_ASSERT (sizeof (Command.Response) == 24, "Invalid ME command size");
ZeroMem (&Command, sizeof (Command));
Command.Request.Header.Version = ME_PAVP_PROTOCOL_VERSION;
Command.Request.Header.Command = ME_PAVP_PROVISION_REQUEST_COMMAND;
HeciSendMessagePerClient (&Command, sizeof (Command.Request));
ZeroMem (&Command, sizeof (Command));
Status = HeciGetResponse (&Command, sizeof (Command.Response));
if (!EFI_ERROR (Status)) {
*EpidStatus = Command.Response.Status;
*EpidGroupId = Command.Response.GroupId;
}
return Status;
}
EFI_STATUS
HeciPavpPerformProvisioning (
IN EPID_CERTIFICATE *EpidCertificate,
IN EPID_GROUP_PUBLIC_KEY *EpidGroupPublicKey,
OUT BOOLEAN *SetVar OPTIONAL
)
{
EFI_STATUS Status;
ME_PAVP_PROVISION_PERFORM_BUFFER Command;
UINTN Index;
STATIC_ASSERT (sizeof (Command.Request) == 1284, "Invalid ME command size");
STATIC_ASSERT (sizeof (Command.Response) == 16, "Invalid ME command size");
if (SetVar != NULL) {
*SetVar = FALSE;
}
ZeroMem (&Command, sizeof (Command));
Command.Request.Header.Version = ME_PAVP_PROTOCOL_VERSION;
Command.Request.Header.Command = ME_PAVP_PROVISION_PERFORM_COMMAND;
Command.Request.Header.PayloadSize = ME_PAVP_PROVISION_PERFORM_PAYLOAD_SIZE;
CopyMem (&Command.Request.Certificate, EpidCertificate, sizeof (Command.Request.Certificate));
CopyMem (&Command.Request.PublicKey, EpidGroupPublicKey, sizeof (Command.Request.PublicKey));
Status = HeciSendMessagePerClient (&Command, sizeof (Command.Request));
ZeroMem (&Command, sizeof (Command));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCME: Failed to send provisioning command - %r\n", Status));
return EFI_DEVICE_ERROR;
}
for (Index = 0; Index < 3; ++Index) {
Status = HeciGetResponse (&Command, sizeof (Command.Response));
if (Status != EFI_TIMEOUT) {
break;
}
}
DEBUG ((
DEBUG_INFO,
"OCME: Finished provisioning command with status %x - %r\n",
Command.Response.Header.Status,
Status
));
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR;
}
if (Command.Response.Header.Status != EPID_STATUS_PROVISIONED) {
Status = EFI_DEVICE_ERROR;
}
if (Command.Response.Header.Status == EPID_STATUS_FAIL_PROVISION) {
if (SetVar != NULL) {
*SetVar = TRUE;
}
}
return Status;
}
EFI_STATUS
HeciFpfGetStatus (
OUT UINT32 *FpfStatus
)
{
EFI_STATUS Status;
UINT32 Response[11];
UINT32 Request[4];
ZeroMem (Request, sizeof (Request));
Request[0] = 3;
HeciSendMessagePerClient (Request, sizeof (Request));
ZeroMem (Response, sizeof (Response));
Status = HeciGetResponse (Response, sizeof (Response));
if (!EFI_ERROR (Status)) {
*FpfStatus = Response[1];
}
return Status;
}
EFI_STATUS
HeciFpfProvision (
OUT UINT32 *FpfStatus
)
{
EFI_STATUS Status;
UINT32 Response[2];
UINT32 Request[3];
ZeroMem (Request, sizeof (Request));
Request[0] = 5;
Request[1] = 1;
Request[2] = 255;
HeciSendMessagePerClient (Request, sizeof (Request));
ZeroMem (Response, sizeof (Response));
Status = HeciGetResponse (Response, sizeof (Response));
if (!EFI_ERROR (Status)) {
*FpfStatus = Response[1];
}
return Status;
}
|
8c7ab17304a71fc29cd6d53d5b7e95d357e38acd
|
61da6274995cf914291af51bd02e60f408fdfedd
|
/utests/test_tree.c
|
1deeef6ddd037d629cb2ca2a010df2330144a248
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
mrirecon/bart
|
360d518b4c79836d506803aa4a77e8e252ab820b
|
a3c9dc313f79c4c52f1ba3e617d5831ef088ddf7
|
refs/heads/master
| 2023-08-31T11:01:08.932824
| 2023-08-30T12:15:35
| 2023-08-30T13:51:18
| 23,212,230
| 264
| 185
|
BSD-3-Clause
| 2023-08-03T18:43:36
| 2014-08-22T03:57:09
|
C
|
UTF-8
|
C
| false
| false
| 1,603
|
c
|
test_tree.c
|
#include "num/rand.h"
#include "misc/debug.h"
#include "misc/misc.h"
#include "misc/tree.h"
#include "utest.h"
static int cmp(const void* _a, const void* _b)
{
float a = *(float*)_a;
float b = *(float*)_b;
if (a > b)
return 1;
if (a < b)
return -1;
return 0;
}
static int cmp_range(const void* _a, const void* _b)
{
float a = ((float*)_a)[0];
float min = ((float*)_b)[0];
float max = ((float*)_b)[1];
if (a > max)
return 1;
if (a < min)
return -1;
return 0;
}
static bool test_tree_sorted(void)
{
int N = 100;
float vals[N];
tree_t tree = tree_create(cmp);
for (int i = 0; i < (int)ARRAY_SIZE(vals); i++) {
vals[i] = gaussian_rand();
tree_insert(tree, vals + i);
}
float* vals_sorted[N];
long NR = tree_count(tree);
NR = tree_count(tree);
tree_to_array(tree, NR, (void**)vals_sorted);
for (int i = 1; i < NR; i++)
if (*(vals_sorted[i]) < *(vals_sorted[i-1]))
return false;
float b1[] = { -.5, -.1 };
while (NULL != tree_find_min(tree, b1, cmp_range, true));
NR = tree_count(tree);
tree_to_array(tree, NR, (void**)vals_sorted);
for (int i = 1; i < NR; i++)
if (*(vals_sorted[i]) < *(vals_sorted[i-1]))
return false;
float b2[] = { .1, .5 };
while (NULL != tree_find(tree, b2, cmp_range, true));
NR = tree_count(tree);
tree_to_array(tree, NR, (void**)vals_sorted);
//for (int i = 0; i < NR; i++)
// debug_printf(DP_INFO, "%f\n", *(vals_sorted[i]));
for (int i = 1; i < NR; i++)
if (*(vals_sorted[i]) < *(vals_sorted[i-1]))
return false;
tree_free(tree);
return true;
}
UT_REGISTER_TEST(test_tree_sorted);
|
ddadc7a8dc4c3a72d813e898a25d5709618f268d
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/media/firewire/firedtv-rc.c
|
f82d4a93feb3f205080a5bdc85d0dcf1b58f48ac
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 4,075
|
c
|
firedtv-rc.c
|
/*
* FireDTV driver (formerly known as FireSAT)
*
* Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#include <linux/bitops.h>
#include <linux/input.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/workqueue.h>
#include "firedtv.h"
/* fixed table with older keycodes, geared towards MythTV */
static const u16 oldtable[] = {
/* code from device: 0x4501...0x451f */
KEY_ESC,
KEY_F9,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_I,
KEY_0,
KEY_ENTER,
KEY_RED,
KEY_UP,
KEY_GREEN,
KEY_F10,
KEY_SPACE,
KEY_F11,
KEY_YELLOW,
KEY_DOWN,
KEY_BLUE,
KEY_Z,
KEY_P,
KEY_PAGEDOWN,
KEY_LEFT,
KEY_W,
KEY_RIGHT,
KEY_P,
KEY_M,
/* code from device: 0x4540...0x4542 */
KEY_R,
KEY_V,
KEY_C,
};
/* user-modifiable table for a remote as sold in 2008 */
static const u16 keytable[] = {
/* code from device: 0x0300...0x031f */
[0x00] = KEY_POWER,
[0x01] = KEY_SLEEP,
[0x02] = KEY_STOP,
[0x03] = KEY_OK,
[0x04] = KEY_RIGHT,
[0x05] = KEY_1,
[0x06] = KEY_2,
[0x07] = KEY_3,
[0x08] = KEY_LEFT,
[0x09] = KEY_4,
[0x0a] = KEY_5,
[0x0b] = KEY_6,
[0x0c] = KEY_UP,
[0x0d] = KEY_7,
[0x0e] = KEY_8,
[0x0f] = KEY_9,
[0x10] = KEY_DOWN,
[0x11] = KEY_TITLE, /* "OSD" - fixme */
[0x12] = KEY_0,
[0x13] = KEY_F20, /* "16:9" - fixme */
[0x14] = KEY_SCREEN, /* "FULL" - fixme */
[0x15] = KEY_MUTE,
[0x16] = KEY_SUBTITLE,
[0x17] = KEY_RECORD,
[0x18] = KEY_TEXT,
[0x19] = KEY_AUDIO,
[0x1a] = KEY_RED,
[0x1b] = KEY_PREVIOUS,
[0x1c] = KEY_REWIND,
[0x1d] = KEY_PLAYPAUSE,
[0x1e] = KEY_NEXT,
[0x1f] = KEY_VOLUMEUP,
/* code from device: 0x0340...0x0354 */
[0x20] = KEY_CHANNELUP,
[0x21] = KEY_F21, /* "4:3" - fixme */
[0x22] = KEY_TV,
[0x23] = KEY_DVD,
[0x24] = KEY_VCR,
[0x25] = KEY_AUX,
[0x26] = KEY_GREEN,
[0x27] = KEY_YELLOW,
[0x28] = KEY_BLUE,
[0x29] = KEY_CHANNEL, /* "CH.LIST" */
[0x2a] = KEY_VENDOR, /* "CI" - fixme */
[0x2b] = KEY_VOLUMEDOWN,
[0x2c] = KEY_CHANNELDOWN,
[0x2d] = KEY_LAST,
[0x2e] = KEY_INFO,
[0x2f] = KEY_FORWARD,
[0x30] = KEY_LIST,
[0x31] = KEY_FAVORITES,
[0x32] = KEY_MENU,
[0x33] = KEY_EPG,
[0x34] = KEY_EXIT,
};
int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
{
struct input_dev *idev;
int i, err;
idev = input_allocate_device();
if (!idev)
return -ENOMEM;
fdtv->remote_ctrl_dev = idev;
idev->name = "FireDTV remote control";
idev->dev.parent = dev;
idev->evbit[0] = BIT_MASK(EV_KEY);
idev->keycode = kmemdup(keytable, sizeof(keytable), GFP_KERNEL);
if (!idev->keycode) {
err = -ENOMEM;
goto fail;
}
idev->keycodesize = sizeof(keytable[0]);
idev->keycodemax = ARRAY_SIZE(keytable);
for (i = 0; i < ARRAY_SIZE(keytable); i++)
set_bit(keytable[i], idev->keybit);
err = input_register_device(idev);
if (err)
goto fail_free_keymap;
return 0;
fail_free_keymap:
kfree(idev->keycode);
fail:
input_free_device(idev);
return err;
}
void fdtv_unregister_rc(struct firedtv *fdtv)
{
cancel_work_sync(&fdtv->remote_ctrl_work);
kfree(fdtv->remote_ctrl_dev->keycode);
input_unregister_device(fdtv->remote_ctrl_dev);
}
void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
{
struct input_dev *idev = fdtv->remote_ctrl_dev;
u16 *keycode = idev->keycode;
if (code >= 0x0300 && code <= 0x031f)
code = keycode[code - 0x0300];
else if (code >= 0x0340 && code <= 0x0354)
code = keycode[code - 0x0320];
else if (code >= 0x4501 && code <= 0x451f)
code = oldtable[code - 0x4501];
else if (code >= 0x4540 && code <= 0x4542)
code = oldtable[code - 0x4521];
else {
printk(KERN_DEBUG "firedtv: invalid key code 0x%04x "
"from remote control\n", code);
return;
}
input_report_key(idev, code, 1);
input_sync(idev);
input_report_key(idev, code, 0);
input_sync(idev);
}
|
7d8d0cd42e58690149653394de0d2f4a4712238d
|
5eff7a36d9a9917dce9111f0c3074375fe6f7656
|
/lib/mesa/src/freedreno/vulkan/tu_util.c
|
9b0b9a42068ff731a27dcf28666e7c1243fd3a23
|
[] |
no_license
|
openbsd/xenocara
|
cb392d02ebba06f6ff7d826fd8a89aa3b8401779
|
a012b5de33ea0b977095d77316a521195b26cc6b
|
refs/heads/master
| 2023-08-25T12:16:58.862008
| 2023-08-12T16:16:25
| 2023-08-12T16:16:25
| 66,967,384
| 177
| 66
| null | 2023-07-22T18:12:37
| 2016-08-30T18:36:01
|
C
|
UTF-8
|
C
| false
| false
| 10,031
|
c
|
tu_util.c
|
/*
* Copyright © 2015 Intel Corporation
* SPDX-License-Identifier: MIT
*/
#include "tu_util.h"
#include <errno.h>
#include <stdarg.h>
#include "util/u_math.h"
#include "util/timespec.h"
#include "vk_enum_to_str.h"
#include "tu_device.h"
#include "tu_pass.h"
void PRINTFLIKE(3, 4)
__tu_finishme(const char *file, int line, const char *format, ...)
{
va_list ap;
char buffer[256];
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
mesa_loge("%s:%d: FINISHME: %s\n", file, line, buffer);
}
VkResult
__vk_startup_errorf(struct tu_instance *instance,
VkResult error,
bool always_print,
const char *file,
int line,
const char *format,
...)
{
va_list ap;
char buffer[256];
const char *error_str = vk_Result_to_str(error);
#ifndef DEBUG
if (!always_print)
return error;
#endif
if (format) {
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
mesa_loge("%s:%d: %s (%s)\n", file, line, buffer, error_str);
} else {
mesa_loge("%s:%d: %s\n", file, line, error_str);
}
return error;
}
static void
tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
const struct tu_device *dev,
const struct tu_render_pass *pass,
enum tu_gmem_layout gmem_layout)
{
const uint32_t tile_align_w = pass->tile_align_w;
const uint32_t tile_align_h = dev->physical_device->info->tile_align_h;
const uint32_t max_tile_width = dev->physical_device->info->tile_max_w;
const uint32_t max_tile_height = dev->physical_device->info->tile_max_h;
struct tu_tiling_config *tiling = &fb->tiling[gmem_layout];
/* start from 1 tile */
tiling->tile_count = (VkExtent2D) {
.width = 1,
.height = 1,
};
tiling->tile0 = (VkExtent2D) {
.width = util_align_npot(fb->width, tile_align_w),
.height = align(fb->height, tile_align_h),
};
/* will force to sysmem, don't bother trying to have a valid tile config
* TODO: just skip all GMEM stuff when sysmem is forced?
*/
if (!pass->gmem_pixels[gmem_layout])
return;
if (unlikely(dev->physical_device->instance->debug_flags & TU_DEBUG_FORCEBIN)) {
/* start with 2x2 tiles */
tiling->tile_count.width = 2;
tiling->tile_count.height = 2;
tiling->tile0.width = util_align_npot(DIV_ROUND_UP(fb->width, 2), tile_align_w);
tiling->tile0.height = align(DIV_ROUND_UP(fb->height, 2), tile_align_h);
}
/* do not exceed max tile width */
while (tiling->tile0.width > max_tile_width) {
tiling->tile_count.width++;
tiling->tile0.width =
util_align_npot(DIV_ROUND_UP(fb->width, tiling->tile_count.width), tile_align_w);
}
/* do not exceed max tile height */
while (tiling->tile0.height > max_tile_height) {
tiling->tile_count.height++;
tiling->tile0.height =
util_align_npot(DIV_ROUND_UP(fb->height, tiling->tile_count.height), tile_align_h);
}
/* do not exceed gmem size */
while (tiling->tile0.width * tiling->tile0.height > pass->gmem_pixels[gmem_layout]) {
if (tiling->tile0.width > MAX2(tile_align_w, tiling->tile0.height)) {
tiling->tile_count.width++;
tiling->tile0.width =
util_align_npot(DIV_ROUND_UP(fb->width, tiling->tile_count.width), tile_align_w);
} else {
/* if this assert fails then layout is impossible.. */
assert(tiling->tile0.height > tile_align_h);
tiling->tile_count.height++;
tiling->tile0.height =
align(DIV_ROUND_UP(fb->height, tiling->tile_count.height), tile_align_h);
}
}
}
static void
tu_tiling_config_update_pipe_layout(struct tu_tiling_config *tiling,
const struct tu_device *dev)
{
const uint32_t max_pipe_count = 32; /* A6xx */
/* start from 1 tile per pipe */
tiling->pipe0 = (VkExtent2D) {
.width = 1,
.height = 1,
};
tiling->pipe_count = tiling->tile_count;
while (tiling->pipe_count.width * tiling->pipe_count.height > max_pipe_count) {
if (tiling->pipe0.width < tiling->pipe0.height) {
tiling->pipe0.width += 1;
tiling->pipe_count.width =
DIV_ROUND_UP(tiling->tile_count.width, tiling->pipe0.width);
} else {
tiling->pipe0.height += 1;
tiling->pipe_count.height =
DIV_ROUND_UP(tiling->tile_count.height, tiling->pipe0.height);
}
}
}
static void
tu_tiling_config_update_pipes(struct tu_tiling_config *tiling,
const struct tu_device *dev)
{
const uint32_t max_pipe_count = 32; /* A6xx */
const uint32_t used_pipe_count =
tiling->pipe_count.width * tiling->pipe_count.height;
const VkExtent2D last_pipe = {
.width = (tiling->tile_count.width - 1) % tiling->pipe0.width + 1,
.height = (tiling->tile_count.height - 1) % tiling->pipe0.height + 1,
};
assert(used_pipe_count <= max_pipe_count);
assert(max_pipe_count <= ARRAY_SIZE(tiling->pipe_config));
for (uint32_t y = 0; y < tiling->pipe_count.height; y++) {
for (uint32_t x = 0; x < tiling->pipe_count.width; x++) {
const uint32_t pipe_x = tiling->pipe0.width * x;
const uint32_t pipe_y = tiling->pipe0.height * y;
const uint32_t pipe_w = (x == tiling->pipe_count.width - 1)
? last_pipe.width
: tiling->pipe0.width;
const uint32_t pipe_h = (y == tiling->pipe_count.height - 1)
? last_pipe.height
: tiling->pipe0.height;
const uint32_t n = tiling->pipe_count.width * y + x;
tiling->pipe_config[n] = A6XX_VSC_PIPE_CONFIG_REG_X(pipe_x) |
A6XX_VSC_PIPE_CONFIG_REG_Y(pipe_y) |
A6XX_VSC_PIPE_CONFIG_REG_W(pipe_w) |
A6XX_VSC_PIPE_CONFIG_REG_H(pipe_h);
tiling->pipe_sizes[n] = CP_SET_BIN_DATA5_0_VSC_SIZE(pipe_w * pipe_h);
}
}
memset(tiling->pipe_config + used_pipe_count, 0,
sizeof(uint32_t) * (max_pipe_count - used_pipe_count));
}
static bool
is_hw_binning_possible(const struct tu_tiling_config *tiling)
{
/* Similar to older gens, # of tiles per pipe cannot be more than 32.
* But there are no hangs with 16 or more tiles per pipe in either
* X or Y direction, so that limit does not seem to apply.
*/
uint32_t tiles_per_pipe = tiling->pipe0.width * tiling->pipe0.height;
return tiles_per_pipe <= 32;
}
static void
tu_tiling_config_update_binning(struct tu_tiling_config *tiling, const struct tu_device *device)
{
tiling->binning_possible = is_hw_binning_possible(tiling);
if (tiling->binning_possible) {
tiling->binning = (tiling->tile_count.width * tiling->tile_count.height) > 2;
if (unlikely(device->physical_device->instance->debug_flags & TU_DEBUG_FORCEBIN))
tiling->binning = true;
if (unlikely(device->physical_device->instance->debug_flags &
TU_DEBUG_NOBIN))
tiling->binning = false;
} else {
tiling->binning = false;
}
}
void
tu_framebuffer_tiling_config(struct tu_framebuffer *fb,
const struct tu_device *device,
const struct tu_render_pass *pass)
{
for (int gmem_layout = 0; gmem_layout < TU_GMEM_LAYOUT_COUNT; gmem_layout++) {
struct tu_tiling_config *tiling = &fb->tiling[gmem_layout];
tu_tiling_config_update_tile_layout(fb, device, pass, gmem_layout);
tu_tiling_config_update_pipe_layout(tiling, device);
tu_tiling_config_update_pipes(tiling, device);
tu_tiling_config_update_binning(tiling, device);
}
}
void
tu_dbg_log_gmem_load_store_skips(struct tu_device *device)
{
static uint32_t last_skipped_loads = 0;
static uint32_t last_skipped_stores = 0;
static uint32_t last_total_loads = 0;
static uint32_t last_total_stores = 0;
static struct timespec last_time = {};
pthread_mutex_lock(&device->submit_mutex);
struct timespec current_time;
clock_gettime(CLOCK_MONOTONIC, ¤t_time);
if (timespec_sub_to_nsec(¤t_time, &last_time) > 1000 * 1000 * 1000) {
last_time = current_time;
} else {
pthread_mutex_unlock(&device->submit_mutex);
return;
}
struct tu6_global *global = device->global_bo->map;
uint32_t current_taken_loads = global->dbg_gmem_taken_loads;
uint32_t current_taken_stores = global->dbg_gmem_taken_stores;
uint32_t current_total_loads = global->dbg_gmem_total_loads;
uint32_t current_total_stores = global->dbg_gmem_total_stores;
uint32_t skipped_loads = current_total_loads - current_taken_loads;
uint32_t skipped_stores = current_total_stores - current_taken_stores;
uint32_t current_time_frame_skipped_loads = skipped_loads - last_skipped_loads;
uint32_t current_time_frame_skipped_stores = skipped_stores - last_skipped_stores;
uint32_t current_time_frame_total_loads = current_total_loads - last_total_loads;
uint32_t current_time_frame_total_stores = current_total_stores - last_total_stores;
mesa_logi("[GMEM] loads total: %u skipped: %.1f%%\n",
current_time_frame_total_loads,
current_time_frame_skipped_loads / (float) current_time_frame_total_loads * 100.f);
mesa_logi("[GMEM] stores total: %u skipped: %.1f%%\n",
current_time_frame_total_stores,
current_time_frame_skipped_stores / (float) current_time_frame_total_stores * 100.f);
last_skipped_loads = skipped_loads;
last_skipped_stores = skipped_stores;
last_total_loads = current_total_loads;
last_total_stores = current_total_stores;
pthread_mutex_unlock(&device->submit_mutex);
}
|
3684deb250465adca7554f860e1cb1cb35d47531
|
2dfc2beac0ad497f8fc59201921097a412f0df7f
|
/trunk/3rdparty/openssl-1.1-fit/include/openssl/txt_db.h
|
ec981a439fe8bf5d7d52f7b603985ca4eb620a6e
|
[
"Apache-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"MIT",
"MulanPSL-2.0",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL",
"JSON"
] |
permissive
|
ossrs/srs
|
cf9442478fedcd32ef2817f8d53f405a6fa2c7d1
|
7138edd318d30b545e73e80500adda771817f8d1
|
refs/heads/develop
| 2023-09-01T03:38:35.057515
| 2023-08-31T01:45:25
| 2023-08-31T01:49:36
| 34,777,562
| 23,557
| 5,046
|
MIT
| 2023-09-09T00:57:42
| 2015-04-29T06:59:32
|
C++
|
UTF-8
|
C
| false
| false
| 1,666
|
h
|
txt_db.h
|
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_TXT_DB_H
# define HEADER_TXT_DB_H
# include <openssl/opensslconf.h>
# include <openssl/bio.h>
# include <openssl/safestack.h>
# include <openssl/lhash.h>
# define DB_ERROR_OK 0
# define DB_ERROR_MALLOC 1
# define DB_ERROR_INDEX_CLASH 2
# define DB_ERROR_INDEX_OUT_OF_RANGE 3
# define DB_ERROR_NO_INDEX 4
# define DB_ERROR_INSERT_INDEX_CLASH 5
# define DB_ERROR_WRONG_NUM_FIELDS 6
#ifdef __cplusplus
extern "C" {
#endif
typedef OPENSSL_STRING *OPENSSL_PSTRING;
DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
typedef struct txt_db_st {
int num_fields;
STACK_OF(OPENSSL_PSTRING) *data;
LHASH_OF(OPENSSL_STRING) **index;
int (**qual) (OPENSSL_STRING *);
long error;
long arg1;
long arg2;
OPENSSL_STRING *arg_row;
} TXT_DB;
TXT_DB *TXT_DB_read(BIO *in, int num);
long TXT_DB_write(BIO *out, TXT_DB *db);
int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp);
void TXT_DB_free(TXT_DB *db);
OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
OPENSSL_STRING *value);
int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
#ifdef __cplusplus
}
#endif
#endif
|
203976bafffab979423bb378f6ebe5a510e6719b
|
f1ee65fbe1ffc43c2aac45e41515f1987eb534a4
|
/src/third_party/boringssl/src/include/openssl/chacha.h
|
2868c290626fa23b2d0d5761d1943333fb00c631
|
[
"BSD-3-Clause",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"ISC",
"OpenSSL",
"MIT"
] |
permissive
|
klzgrad/naiveproxy
|
6e0d206b6f065b9311d1e12b363109f2d35cc058
|
8ef1cecadfd4e2b5d57e7ea2fa42d05717e51c2e
|
refs/heads/master
| 2023-08-20T22:42:12.511091
| 2023-06-04T03:54:34
| 2023-08-16T23:30:19
| 119,178,893
| 5,710
| 976
|
BSD-3-Clause
| 2023-08-05T10:59:59
| 2018-01-27T16:02:33
|
C++
|
UTF-8
|
C
| false
| false
| 1,917
|
h
|
chacha.h
|
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef OPENSSL_HEADER_CHACHA_H
#define OPENSSL_HEADER_CHACHA_H
#include <openssl/base.h>
#if defined(__cplusplus)
extern "C" {
#endif
// ChaCha20.
//
// ChaCha20 is a stream cipher. See https://tools.ietf.org/html/rfc8439.
// CRYPTO_chacha_20 encrypts |in_len| bytes from |in| with the given key and
// nonce and writes the result to |out|. If |in| and |out| alias, they must be
// equal. The initial block counter is specified by |counter|.
//
// This function implements a 32-bit block counter as in RFC 8439. On overflow,
// the counter wraps. Reusing a key, nonce, and block counter combination is not
// secure, so wrapping is usually a bug in the caller. While it is possible to
// wrap without reuse with a large initial block counter, this is not
// recommended and may not be portable to other ChaCha20 implementations.
OPENSSL_EXPORT void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in,
size_t in_len, const uint8_t key[32],
const uint8_t nonce[12], uint32_t counter);
#if defined(__cplusplus)
} // extern C
#endif
#endif // OPENSSL_HEADER_CHACHA_H
|
84f6a63e0ae59c56ad59bafc7b55b90f19c73416
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/u-boot_new/drivers/net/e1000_spi.c
|
93043a1ade4b7db911c6484314817e1ce28d255e
|
[
"GPL-2.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 14,057
|
c
|
e1000_spi.c
|
#include "e1000.h"
#include <linux/compiler.h>
/*-----------------------------------------------------------------------
* SPI transfer
*
* This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks
* "bitlen" bits in the SPI MISO port. That's just the way SPI works.
*
* The source of the outgoing bits is the "dout" parameter and the
* destination of the input bits is the "din" parameter. Note that "dout"
* and "din" can point to the same memory location, in which case the
* input data overwrites the output data (since both are buffered by
* temporary variables, this is OK).
*
* This may be interrupted with Ctrl-C if "intr" is true, otherwise it will
* never return an error.
*/
static int e1000_spi_xfer(struct e1000_hw *hw, unsigned int bitlen,
const void *dout_mem, void *din_mem, bool intr)
{
const uint8_t *dout = dout_mem;
uint8_t *din = din_mem;
uint8_t mask = 0;
uint32_t eecd;
unsigned long i;
/* Pre-read the control register */
eecd = E1000_READ_REG(hw, EECD);
/* Iterate over each bit */
for (i = 0, mask = 0x80; i < bitlen; i++, mask = (mask >> 1)?:0x80) {
/* Check for interrupt */
if (intr && ctrlc())
return -1;
/* Determine the output bit */
if (dout && dout[i >> 3] & mask)
eecd |= E1000_EECD_DI;
else
eecd &= ~E1000_EECD_DI;
/* Write the output bit and wait 50us */
E1000_WRITE_REG(hw, EECD, eecd);
E1000_WRITE_FLUSH(hw);
udelay(50);
/* Poke the clock (waits 50us) */
e1000_raise_ee_clk(hw, &eecd);
/* Now read the input bit */
eecd = E1000_READ_REG(hw, EECD);
if (din) {
if (eecd & E1000_EECD_DO)
din[i >> 3] |= mask;
else
din[i >> 3] &= ~mask;
}
/* Poke the clock again (waits 50us) */
e1000_lower_ee_clk(hw, &eecd);
}
/* Now clear any remaining bits of the input */
if (din && (i & 7))
din[i >> 3] &= ~((mask << 1) - 1);
return 0;
}
#ifdef CONFIG_E1000_SPI_GENERIC
static inline struct e1000_hw *e1000_hw_from_spi(struct spi_slave *spi)
{
return container_of(spi, struct e1000_hw, spi);
}
/* Not sure why all of these are necessary */
void spi_init_r(void) { /* Nothing to do */ }
void spi_init_f(void) { /* Nothing to do */ }
void spi_init(void) { /* Nothing to do */ }
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
{
/* Find the right PCI device */
struct e1000_hw *hw = e1000_find_card(bus);
if (!hw) {
printf("ERROR: No such e1000 device: e1000#%u\n", bus);
return NULL;
}
/* Make sure it has an SPI chip */
if (hw->eeprom.type != e1000_eeprom_spi) {
E1000_ERR(hw->nic, "No attached SPI EEPROM found!\n");
return NULL;
}
/* Argument sanity checks */
if (cs != 0) {
E1000_ERR(hw->nic, "No such SPI chip: %u\n", cs);
return NULL;
}
if (mode != SPI_MODE_0) {
E1000_ERR(hw->nic, "Only SPI MODE-0 is supported!\n");
return NULL;
}
/* TODO: Use max_hz somehow */
E1000_DBG(hw->nic, "EEPROM SPI access requested\n");
return &hw->spi;
}
void spi_free_slave(struct spi_slave *spi)
{
__maybe_unused struct e1000_hw *hw = e1000_hw_from_spi(spi);
E1000_DBG(hw->nic, "EEPROM SPI access released\n");
}
int spi_claim_bus(struct spi_slave *spi)
{
struct e1000_hw *hw = e1000_hw_from_spi(spi);
if (e1000_acquire_eeprom(hw)) {
E1000_ERR(hw->nic, "EEPROM SPI cannot be acquired!\n");
return -1;
}
return 0;
}
void spi_release_bus(struct spi_slave *spi)
{
struct e1000_hw *hw = e1000_hw_from_spi(spi);
e1000_release_eeprom(hw);
}
/* Skinny wrapper around e1000_spi_xfer */
int spi_xfer(struct spi_slave *spi, unsigned int bitlen,
const void *dout_mem, void *din_mem, unsigned long flags)
{
struct e1000_hw *hw = e1000_hw_from_spi(spi);
int ret;
if (flags & SPI_XFER_BEGIN)
e1000_standby_eeprom(hw);
ret = e1000_spi_xfer(hw, bitlen, dout_mem, din_mem, true);
if (flags & SPI_XFER_END)
e1000_standby_eeprom(hw);
return ret;
}
#endif /* not CONFIG_E1000_SPI_GENERIC */
#ifdef CONFIG_CMD_E1000
/* The EEPROM opcodes */
#define SPI_EEPROM_ENABLE_WR 0x06
#define SPI_EEPROM_DISABLE_WR 0x04
#define SPI_EEPROM_WRITE_STATUS 0x01
#define SPI_EEPROM_READ_STATUS 0x05
#define SPI_EEPROM_WRITE_PAGE 0x02
#define SPI_EEPROM_READ_PAGE 0x03
/* The EEPROM status bits */
#define SPI_EEPROM_STATUS_BUSY 0x01
#define SPI_EEPROM_STATUS_WREN 0x02
static int e1000_spi_eeprom_enable_wr(struct e1000_hw *hw, bool intr)
{
u8 op[] = { SPI_EEPROM_ENABLE_WR };
e1000_standby_eeprom(hw);
return e1000_spi_xfer(hw, 8*sizeof(op), op, NULL, intr);
}
/*
* These have been tested to perform correctly, but they are not used by any
* of the EEPROM commands at this time.
*/
#if 0
static int e1000_spi_eeprom_disable_wr(struct e1000_hw *hw, bool intr)
{
u8 op[] = { SPI_EEPROM_DISABLE_WR };
e1000_standby_eeprom(hw);
return e1000_spi_xfer(hw, 8*sizeof(op), op, NULL, intr);
}
static int e1000_spi_eeprom_write_status(struct e1000_hw *hw,
u8 status, bool intr)
{
u8 op[] = { SPI_EEPROM_WRITE_STATUS, status };
e1000_standby_eeprom(hw);
return e1000_spi_xfer(hw, 8*sizeof(op), op, NULL, intr);
}
#endif
static int e1000_spi_eeprom_read_status(struct e1000_hw *hw, bool intr)
{
u8 op[] = { SPI_EEPROM_READ_STATUS, 0 };
e1000_standby_eeprom(hw);
if (e1000_spi_xfer(hw, 8*sizeof(op), op, op, intr))
return -1;
return op[1];
}
static int e1000_spi_eeprom_write_page(struct e1000_hw *hw,
const void *data, u16 off, u16 len, bool intr)
{
u8 op[] = {
SPI_EEPROM_WRITE_PAGE,
(off >> (hw->eeprom.address_bits - 8)) & 0xff, off & 0xff
};
e1000_standby_eeprom(hw);
if (e1000_spi_xfer(hw, 8 + hw->eeprom.address_bits, op, NULL, intr))
return -1;
if (e1000_spi_xfer(hw, len << 3, data, NULL, intr))
return -1;
return 0;
}
static int e1000_spi_eeprom_read_page(struct e1000_hw *hw,
void *data, u16 off, u16 len, bool intr)
{
u8 op[] = {
SPI_EEPROM_READ_PAGE,
(off >> (hw->eeprom.address_bits - 8)) & 0xff, off & 0xff
};
e1000_standby_eeprom(hw);
if (e1000_spi_xfer(hw, 8 + hw->eeprom.address_bits, op, NULL, intr))
return -1;
if (e1000_spi_xfer(hw, len << 3, NULL, data, intr))
return -1;
return 0;
}
static int e1000_spi_eeprom_poll_ready(struct e1000_hw *hw, bool intr)
{
int status;
while ((status = e1000_spi_eeprom_read_status(hw, intr)) >= 0) {
if (!(status & SPI_EEPROM_STATUS_BUSY))
return 0;
}
return -1;
}
static int e1000_spi_eeprom_dump(struct e1000_hw *hw,
void *data, u16 off, unsigned int len, bool intr)
{
/* Interruptibly wait for the EEPROM to be ready */
if (e1000_spi_eeprom_poll_ready(hw, intr))
return -1;
/* Dump each page in sequence */
while (len) {
/* Calculate the data bytes on this page */
u16 pg_off = off & (hw->eeprom.page_size - 1);
u16 pg_len = hw->eeprom.page_size - pg_off;
if (pg_len > len)
pg_len = len;
/* Now dump the page */
if (e1000_spi_eeprom_read_page(hw, data, off, pg_len, intr))
return -1;
/* Otherwise go on to the next page */
len -= pg_len;
off += pg_len;
data += pg_len;
}
/* We're done! */
return 0;
}
static int e1000_spi_eeprom_program(struct e1000_hw *hw,
const void *data, u16 off, u16 len, bool intr)
{
/* Program each page in sequence */
while (len) {
/* Calculate the data bytes on this page */
u16 pg_off = off & (hw->eeprom.page_size - 1);
u16 pg_len = hw->eeprom.page_size - pg_off;
if (pg_len > len)
pg_len = len;
/* Interruptibly wait for the EEPROM to be ready */
if (e1000_spi_eeprom_poll_ready(hw, intr))
return -1;
/* Enable write access */
if (e1000_spi_eeprom_enable_wr(hw, intr))
return -1;
/* Now program the page */
if (e1000_spi_eeprom_write_page(hw, data, off, pg_len, intr))
return -1;
/* Otherwise go on to the next page */
len -= pg_len;
off += pg_len;
data += pg_len;
}
/* Wait for the last write to complete */
if (e1000_spi_eeprom_poll_ready(hw, intr))
return -1;
/* We're done! */
return 0;
}
static int do_e1000_spi_show(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
unsigned int length = 0;
u16 i, offset = 0;
u8 *buffer;
int err;
if (argc > 2) {
cmd_usage(cmdtp);
return 1;
}
/* Parse the offset and length */
if (argc >= 1)
offset = simple_strtoul(argv[0], NULL, 0);
if (argc == 2)
length = simple_strtoul(argv[1], NULL, 0);
else if (offset < (hw->eeprom.word_size << 1))
length = (hw->eeprom.word_size << 1) - offset;
/* Extra sanity checks */
if (!length) {
E1000_ERR(hw->nic, "Requested zero-sized dump!\n");
return 1;
}
if ((0x10000 < length) || (0x10000 - length < offset)) {
E1000_ERR(hw->nic, "Can't dump past 0xFFFF!\n");
return 1;
}
/* Allocate a buffer to hold stuff */
buffer = malloc(length);
if (!buffer) {
E1000_ERR(hw->nic, "Out of Memory!\n");
return 1;
}
/* Acquire the EEPROM and perform the dump */
if (e1000_acquire_eeprom(hw)) {
E1000_ERR(hw->nic, "EEPROM SPI cannot be acquired!\n");
free(buffer);
return 1;
}
err = e1000_spi_eeprom_dump(hw, buffer, offset, length, true);
e1000_release_eeprom(hw);
if (err) {
E1000_ERR(hw->nic, "Interrupted!\n");
free(buffer);
return 1;
}
/* Now hexdump the result */
printf("%s: ===== Intel e1000 EEPROM (0x%04hX - 0x%04hX) =====",
hw->nic->name, offset, offset + length - 1);
for (i = 0; i < length; i++) {
if ((i & 0xF) == 0)
printf("\n%s: %04hX: ", hw->nic->name, offset + i);
else if ((i & 0xF) == 0x8)
printf(" ");
printf(" %02hx", buffer[i]);
}
printf("\n");
/* Success! */
free(buffer);
return 0;
}
static int do_e1000_spi_dump(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
unsigned int length;
u16 offset;
void *dest;
if (argc != 3) {
cmd_usage(cmdtp);
return 1;
}
/* Parse the arguments */
dest = (void *)simple_strtoul(argv[0], NULL, 16);
offset = simple_strtoul(argv[1], NULL, 0);
length = simple_strtoul(argv[2], NULL, 0);
/* Extra sanity checks */
if (!length) {
E1000_ERR(hw->nic, "Requested zero-sized dump!\n");
return 1;
}
if ((0x10000 < length) || (0x10000 - length < offset)) {
E1000_ERR(hw->nic, "Can't dump past 0xFFFF!\n");
return 1;
}
/* Acquire the EEPROM */
if (e1000_acquire_eeprom(hw)) {
E1000_ERR(hw->nic, "EEPROM SPI cannot be acquired!\n");
return 1;
}
/* Perform the programming operation */
if (e1000_spi_eeprom_dump(hw, dest, offset, length, true) < 0) {
E1000_ERR(hw->nic, "Interrupted!\n");
e1000_release_eeprom(hw);
return 1;
}
e1000_release_eeprom(hw);
printf("%s: ===== EEPROM DUMP COMPLETE =====\n", hw->nic->name);
return 0;
}
static int do_e1000_spi_program(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
unsigned int length;
const void *source;
u16 offset;
if (argc != 3) {
cmd_usage(cmdtp);
return 1;
}
/* Parse the arguments */
source = (const void *)simple_strtoul(argv[0], NULL, 16);
offset = simple_strtoul(argv[1], NULL, 0);
length = simple_strtoul(argv[2], NULL, 0);
/* Acquire the EEPROM */
if (e1000_acquire_eeprom(hw)) {
E1000_ERR(hw->nic, "EEPROM SPI cannot be acquired!\n");
return 1;
}
/* Perform the programming operation */
if (e1000_spi_eeprom_program(hw, source, offset, length, true) < 0) {
E1000_ERR(hw->nic, "Interrupted!\n");
e1000_release_eeprom(hw);
return 1;
}
e1000_release_eeprom(hw);
printf("%s: ===== EEPROM PROGRAMMED =====\n", hw->nic->name);
return 0;
}
static int do_e1000_spi_checksum(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
uint16_t i, length, checksum = 0, checksum_reg;
uint16_t *buffer;
bool upd;
if (argc == 0)
upd = 0;
else if ((argc == 1) && !strcmp(argv[0], "update"))
upd = 1;
else {
cmd_usage(cmdtp);
return 1;
}
/* Allocate a temporary buffer */
length = sizeof(uint16_t) * (EEPROM_CHECKSUM_REG + 1);
buffer = malloc(length);
if (!buffer) {
E1000_ERR(hw->nic, "Unable to allocate EEPROM buffer!\n");
return 1;
}
/* Acquire the EEPROM */
if (e1000_acquire_eeprom(hw)) {
E1000_ERR(hw->nic, "EEPROM SPI cannot be acquired!\n");
return 1;
}
/* Read the EEPROM */
if (e1000_spi_eeprom_dump(hw, buffer, 0, length, true) < 0) {
E1000_ERR(hw->nic, "Interrupted!\n");
e1000_release_eeprom(hw);
return 1;
}
/* Compute the checksum and read the expected value */
for (i = 0; i < EEPROM_CHECKSUM_REG; i++)
checksum += le16_to_cpu(buffer[i]);
checksum = ((uint16_t)EEPROM_SUM) - checksum;
checksum_reg = le16_to_cpu(buffer[i]);
/* Verify it! */
if (checksum_reg == checksum) {
printf("%s: INFO: EEPROM checksum is correct! (0x%04hx)\n",
hw->nic->name, checksum);
e1000_release_eeprom(hw);
return 0;
}
/* Hrm, verification failed, print an error */
E1000_ERR(hw->nic, "EEPROM checksum is incorrect!\n");
E1000_ERR(hw->nic, " ...register was 0x%04hx, calculated 0x%04hx\n",
checksum_reg, checksum);
/* If they didn't ask us to update it, just return an error */
if (!upd) {
e1000_release_eeprom(hw);
return 1;
}
/* Ok, correct it! */
printf("%s: Reprogramming the EEPROM checksum...\n", hw->nic->name);
buffer[i] = cpu_to_le16(checksum);
if (e1000_spi_eeprom_program(hw, &buffer[i], i * sizeof(uint16_t),
sizeof(uint16_t), true)) {
E1000_ERR(hw->nic, "Interrupted!\n");
e1000_release_eeprom(hw);
return 1;
}
e1000_release_eeprom(hw);
return 0;
}
int do_e1000_spi(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
if (argc < 1) {
cmd_usage(cmdtp);
return 1;
}
/* Make sure it has an SPI chip */
if (hw->eeprom.type != e1000_eeprom_spi) {
E1000_ERR(hw->nic, "No attached SPI EEPROM found!\n");
return 1;
}
/* Check the eeprom sub-sub-command arguments */
if (!strcmp(argv[0], "show"))
return do_e1000_spi_show(cmdtp, hw, argc - 1, argv + 1);
if (!strcmp(argv[0], "dump"))
return do_e1000_spi_dump(cmdtp, hw, argc - 1, argv + 1);
if (!strcmp(argv[0], "program"))
return do_e1000_spi_program(cmdtp, hw, argc - 1, argv + 1);
if (!strcmp(argv[0], "checksum"))
return do_e1000_spi_checksum(cmdtp, hw, argc - 1, argv + 1);
cmd_usage(cmdtp);
return 1;
}
#endif /* not CONFIG_CMD_E1000 */
|
7939ea5da38f8de0e336e0d138a3fd2e4fa9422c
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/alpha/stand/standtest/test.c
|
d26c9d9a3bf808bbb0f9e12e9fe907c564c0608d
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 12,261
|
c
|
test.c
|
/* $NetBSD: test.c,v 1.7 2016/06/11 06:26:50 dholland Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <lib/libsa/stand.h>
#include <lib/libkern/libkern.h>
#include <machine/autoconf.h>
#include <machine/rpb.h>
#include "../common/common.h"
struct cmdtab {
const char *cmd;
void (*fn)(const char *buf);
};
int done;
unsigned long arg_pfn, arg_ptb, arg_bim, arg_bip, arg_biv;
const char *advance_past_space(const char *buf);
const char *cvt_number(const char *buf, u_int64_t *nump);
int dispatch_cmd(const char *buf, const struct cmdtab *cmds);
#define DISPATCH_CMD_NOCMD 0
#define DISPATCH_CMD_MATCHED 1
#define DISPATCH_CMD_NOMATCH 2
#define DISPATCH_CMD_AMBIGUOUS 3
void print_cmds(const struct cmdtab *cmds, const char *match,
size_t matchlen);
void print_stringarray(const char *s, size_t maxlen);
void toplevel_dpb(const char *buf);
void toplevel_dpl(const char *buf);
void toplevel_dpq(const char *buf);
void toplevel_dpw(const char *buf);
void toplevel_dvb(const char *buf);
void toplevel_dvl(const char *buf);
void toplevel_dvq(const char *buf);
void toplevel_dvw(const char *buf);
void toplevel_halt(const char *buf);
void toplevel_help(const char *buf);
void toplevel_show(const char *buf);
void show_args(const char *buf);
void show_bootinfo(const char *buf);
void show_pt(const char *buf);
void show_rpb(const char *buf);
void
main(unsigned long pfn, unsigned long ptb, unsigned long bim, unsigned long bip, unsigned long biv)
/* pfn: first free PFN number */
/* ptb: PFN of current level 1 page table */
/* bim: bootinfo magic */
/* bip: bootinfo pointer */
/* biv: bootinfo version */
{
char input_buf[512];
static const struct cmdtab toplevel_cmds[] = {
{ "?", toplevel_help, },
#if 0 /* XXX notyet */
{ "dpb", toplevel_dpb, },
{ "dpl", toplevel_dpl, },
{ "dpq", toplevel_dpq, },
{ "dpw", toplevel_dpw, },
{ "dvb", toplevel_dvb, },
{ "dvl", toplevel_dvl, },
{ "dvq", toplevel_dvq, },
{ "dvw", toplevel_dvw, },
#endif
{ "quit", toplevel_halt, },
{ "show", toplevel_show, },
{ NULL, },
};
printf("\n");
printf("NetBSD/alpha " NETBSD_VERS
" Standalone Test Program, Revision %s\n", bootprog_rev);
printf("\n");
arg_pfn = pfn;
arg_ptb = ptb;
arg_bim = bim;
arg_bip = bip;
arg_biv = biv;
printf("Enter '?' for help.\n");
printf("\n");
do {
printf("test> ");
kgets(input_buf, sizeof(input_buf));
dispatch_cmd(input_buf, toplevel_cmds);
} while (!done);
printf("\n");
printf("halting...\n");
halt();
}
const char *
advance_past_space(const char *buf)
{
/* advance past white space. */
while (isspace(*buf))
buf++;
if (*buf == '\0')
return NULL;
return buf;
}
const char *
cvt_number(const char *buf, u_int64_t *nump)
{
int base;
unsigned char c;
base = 10;
*nump = 0;
c = *buf;
if (c == '0') {
c = *(++buf);
if (c == 'x' || c == 'X') {
base = 16;
buf++;
} else {
base = 8;
}
}
for (c = *buf; c != '\0' && !isspace(c); c = *(++buf)) {
switch (base) {
case 10:
if (c < '0' || c > '9')
goto done;
}
}
done:
}
int
dispatch_cmd(const char *buf, const struct cmdtab *cmds)
{
const struct cmdtab *try, *winner;
size_t nonwhitespace, i;
unsigned int nmatches;
const char *pre, *post;
int rv;
/* advance past white space. */
buf = advance_past_space(buf);
if (buf == NULL)
return (DISPATCH_CMD_NOCMD);
/* find how much non-white space there is. */
nonwhitespace = 0;
while ((buf[nonwhitespace] != '\0') && !isspace(buf[nonwhitespace]))
nonwhitespace++;
/* at this point, nonwhitespace should always be non-zero */
if (nonwhitespace == 0) {
printf("assertion failed: dispatch_cmd: nonwhitespace == 0\n");
halt();
}
/* see how many matches there were. */
for (nmatches = 0, try = cmds;
try != NULL && try->cmd != NULL;
try++) {
if (strncmp(buf, try->cmd, nonwhitespace) == 0) {
winner = try;
nmatches++;
}
}
if (nmatches == 1) {
(*winner->fn)(buf + nonwhitespace);
return (DISPATCH_CMD_MATCHED);
} else if (nmatches == 0) {
pre = "invalid command word";
post = "allowed words";
rv = DISPATCH_CMD_NOMATCH;
} else {
pre = "ambiguous command word";
post = "matches";
rv = DISPATCH_CMD_AMBIGUOUS;
}
printf("%s \"", pre);
print_stringarray(buf, nonwhitespace);
printf("\", %s:\n", post);
/* print commands. if no match, print all commands. */
print_cmds(cmds, buf, rv == DISPATCH_CMD_NOMATCH ? 0 : nonwhitespace);
return (rv);
}
void
print_cmds(const struct cmdtab *cmds, const char *match, size_t matchlen)
{
const struct cmdtab *try;
printf(" ");
for (try = cmds; try != NULL && try->cmd != NULL; try++) {
if (strncmp(match, try->cmd, matchlen) == 0)
printf("%s%s", try != cmds ? ", " : "", try->cmd);
}
printf("\n");
}
void
print_stringarray(const char *s, size_t maxlen)
{
size_t i;
for (i = 0; (i < maxlen) && (*s != '\0'); i++, s++)
putchar(*s);
}
void
warn_ignored_args(const char *buf, const char *cmd)
{
if (advance_past_space(buf) != NULL)
printf("WARNING: extra arguments to \"%s\" command ignored\n",
cmd);
}
/*
* Top-level Commands
*/
void
toplevel_dpb(const char *buf)
{
u_int64_t startaddr, count = 1;
buf = advance_past_space(buf);
if (buf == NULL) {
printf("\"dpb\" must be given starting address\n");
return;
}
buf = cvt_number(buf, &startaddr);
if (*buf != '\0' && !isspace(*buf)) {
printf("bad character '%c' in starting address\n", *buf);
return;
}
buf = advance_past_space(buf);
if (buf != NULL) {
buf = cvt_number(buf, &count);
if (*buf != '\0' && !isspace(*buf)) {
printf("bad character '%c' in count\n", *buf);
return;
}
buf = advance_past_space(buf);
if (buf != NULL) {
printf("extra args at end of \"dpb\" command\n");
return;
}
}
printf("startaddr = 0x%lx, count = 0x%lx\n", startaddr, count);
printf("\"dpb\" not yet implemented\n");
}
void
toplevel_dpl(const char *buf)
{
printf("\"dpl\" not yet implemented\n");
}
void
toplevel_dpq(const char *buf)
{
printf("\"dpq\" not yet implemented\n");
}
void
toplevel_dpw(const char *buf)
{
printf("\"dpw\" not yet implemented\n");
}
void
toplevel_dvb(const char *buf)
{
printf("\"dvb\" not yet implemented\n");
}
void
toplevel_dvl(const char *buf)
{
printf("\"dvl\" not yet implemented\n");
}
void
toplevel_dvq(const char *buf)
{
printf("\"dvq\" not yet implemented\n");
}
void
toplevel_dvw(const char *buf)
{
printf("\"dvw\" not yet implemented\n");
}
void
toplevel_halt(const char *buf)
{
warn_ignored_args(buf, "halt");
done = 1;
}
void
toplevel_help(const char *buf)
{
warn_ignored_args(buf, "?");
printf("Standalone Test Program Commands:\n");
printf(" ? print help\n");
printf(" quit return to console\n");
#if 0 /* XXX notyet */
printf(" dpb startaddr [count] display physical memory "
"(8-bit units)\n");
printf(" dpw startaddr [count] display physical memory "
"(16-bit units)\n");
printf(" dpl startaddr [count] display physical memory "
"(32-bit units)\n");
printf(" dpq startaddr [count] display physical memory "
"(64-bit units)\n");
printf(" dvb startaddr [count] display virtual memory "
"(8-bit units)\n");
printf(" dvw startaddr [count] display virtual memory "
"(16-bit units)\n");
printf(" dvl startaddr [count] display virtual memory "
"(32-bit units)\n");
printf(" dvq startaddr [count] display virtual memory "
"(64-bit units)\n");
#endif
printf(" show args show test program arguments\n");
printf(" show bootinfo show bootstrap bootinfo\n");
#if 0 /* XXX notyet */
printf(" show pt [startaddr [endaddr]]\n");
printf(" show page tables\n");
printf(" show rpb show the HWRPB\n");
printf("\n");
printf("If optional \"count\" argument is omitted, 1 is used.\n");
printf("If optional \"startaddr\" argument is omitted, "
"0x0 is used.\n");
printf("If optional \"endaddr\" argument is omitted, "
"0xffffffffffffffff is used.\n");
#endif
}
void
toplevel_show(const char *buf)
{
static const struct cmdtab show_cmds[] = {
{ "args", show_args, },
{ "bootinfo", show_bootinfo, },
#if 0 /* XXX notyet */
{ "pt", show_pt, },
{ "rpb", show_rpb, },
#endif
{ NULL, },
};
if (dispatch_cmd(buf, show_cmds) == DISPATCH_CMD_NOCMD) {
printf("no subcommand given. allowed subcommands:\n");
print_cmds(show_cmds, NULL, 0);
}
}
/*
* Show Commands
*/
void
show_args(const char *buf)
{
warn_ignored_args(buf, "show args");
printf("first free page frame number: 0x%lx\n", arg_pfn);
printf("page table base page frame number: 0x%lx\n", arg_ptb);
printf("bootinfo magic number: 0x%lx\n", arg_bim);
printf("bootinfo pointer: 0x%lx\n", arg_bip);
printf("bootinfo version: 0x%lx\n", arg_biv);
}
void
show_bootinfo(const char *buf)
{
u_long biv, bip;
warn_ignored_args(buf, "show bootinfo");
if (arg_bim != BOOTINFO_MAGIC) {
printf("bootinfo magic number not present; no bootinfo\n");
return;
}
bip = arg_bip;
biv = arg_biv;
if (biv == 0) {
biv = *(u_long *)bip;
bip += 8;
}
printf("bootinfo version: %d\n", biv);
printf("bootinfo pointer: %p\n", (void *)bip);
printf("bootinfo data:\n");
switch (biv) {
case 1: {
const struct bootinfo_v1 *v1p;
int i;
v1p = (const struct bootinfo_v1 *)bip;
printf(" ssym: 0x%lx\n", v1p->ssym);
printf(" esym: 0x%lx\n", v1p->esym);
printf(" boot flags: \"");
print_stringarray(v1p->boot_flags, sizeof v1p->boot_flags);
printf("\"\n");
printf(" booted kernel: \"", v1p->esym);
print_stringarray(v1p->booted_kernel,
sizeof v1p->booted_kernel);
printf("\"\n");
printf(" hwrpb: %p\n", v1p->hwrpb);
printf(" hwrpbsize: 0x%lx\n", v1p->hwrpbsize);
printf(" cngetc: %p\n", v1p->cngetc);
printf(" cnputc: %p\n", v1p->cnputc);
printf(" cnpollc: %p\n", v1p->cnpollc);
for (i = 0; i < (sizeof v1p->pad / sizeof v1p->pad[0]); i++) {
printf(" pad[%d]: 0x%lx\n", i, v1p->pad[i]);
}
break;
}
default:
printf(" unknown bootinfo version, cannot print data\n");
break;
}
}
void
show_pt(const char *buf)
{
/* has additional args! */
printf("\"show pt\" not yet implemented\n");
}
void
show_rpb(const char *buf)
{
warn_ignored_args(buf, "show pt");
printf("\"show rpb\" not yet implemented\n");
}
|
ebcaa63eb2b4b897474635da38f8cbe05c8a59ab
|
61da6274995cf914291af51bd02e60f408fdfedd
|
/src/simu/shepplogan.c
|
ea50fe5b99c40eca8ab3664c5396f74c1db6f421
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
mrirecon/bart
|
360d518b4c79836d506803aa4a77e8e252ab820b
|
a3c9dc313f79c4c52f1ba3e617d5831ef088ddf7
|
refs/heads/master
| 2023-08-31T11:01:08.932824
| 2023-08-30T12:15:35
| 2023-08-30T13:51:18
| 23,212,230
| 264
| 185
|
BSD-3-Clause
| 2023-08-03T18:43:36
| 2014-08-22T03:57:09
|
C
|
UTF-8
|
C
| false
| false
| 13,729
|
c
|
shepplogan.c
|
/* Copyright 2014. The Regents of the University of California.
* Copyright 2015-2023. Martin Uecker.
* All rights reserved. Use of this source code is governed by
* a BSD-style license which can be found in the LICENSE file.
*/
#define _GNU_SOURCE
#include <complex.h>
#include <math.h>
#include <assert.h>
#include <stdbool.h>
#include "num/specfun.h"
#include "simu/shepplogan.h"
#include "misc/misc.h"
// AK Jain, 439.
// modified Toft 199-200 multiply -0.98 -> 0.8
// multiply the rest by ten
const struct ellipsis_s shepplogan[10] = {
{ 1., { .69, .92 }, { 0., 0. }, 0. },
{ -.98, { .6624, .8740 }, { 0., -.0184 }, 0. },
{ -.02, { .1100, .3100 }, { .22, 0. }, -18. / 360. * 2. * M_PI },
{ -.02, { .1600, .4100 }, { -.22, 0 }, 18. / 360. * 2. * M_PI },
{ .01, { .2100, .2500 }, { 0, .35 }, 0. },
{ .01, { .0460, .0460 }, { 0, .1 }, 0. },
{ .01, { .0460, .0460 }, { 0, -.1 }, 0. },
{ .01, { .0460, .0230 }, { -.08, -.605 }, 0. },
{ .01, { .0230, .0230 }, { 0, -.606 }, 0. },
{ .01, { .0230, .0460 }, { .06, -.605 }, 0. }
};
const struct ellipsis_s shepplogan_mod[10] = {
{ 1., { .69, .92 }, { 0., 0. }, 0. },
{ -.8, { .6624, .8740 }, { 0., -.0184 }, 0. },
{ -.2, { .1100, .3100 }, { .22, 0. }, -18. / 360. * 2. * M_PI },
{ -.2, { .1600, .4100 }, { -.22, 0 }, 18. / 360. * 2. * M_PI },
{ .1, { .2100, .2500 }, { 0, .35 }, 0 },
{ .1, { .0460, .0460 }, { 0, .1 }, 0 },
{ .1, { .0460, .0460 }, { 0, -.1 }, 0 },
{ .1, { .0460, .0230 }, { -.08, -.605 }, 0 },
{ .1, { .0230, .0230 }, { 0, -.606 }, 0 },
{ .1, { .0230, .0460 }, { .06, -.605 }, 0 }
};
const struct ellipsis_s phantom_disc[1] = {
{ 1., { 1., 1. }, { 0., 0. }, 0. }
};
const struct ellipsis3d_s phantom_disc3d[1] = {
{ 1., { 1., 1., 1. }, { 0., 0., 0. }, 0. }
};
// old: imaginary ring outside from 0.5 to 0.49
const struct ellipsis_s phantom_ring[4] = {
{ 1., { 0.75, 0.75 }, { 0., 0. }, 0. },
{ -1. + 1.i, { 0.5, 0.5 }, { 0., 0. }, 0. },
{ -1.i, { 0.48, 0.48 }, { 0., 0. }, 0. },
{ 1., { 0.48, 0.48 }, { 0., 0. }, 0. },
// { 1., { 0.48, 0.48 }, { 0., 0. }, 0. },
};
// Some geometric objects
const struct ellipsis_s phantom_geo1[3] = {
{ .5, { .2, .2 }, { .6, .5 }, 0 },
{ .2, { .2, .4 }, { -.6, -.6 }, M_PI/7. },
{ .6, { .3, .1 }, { .6, -.5 }, M_PI/5. },
};
const struct ellipsis_s phantom_geo2[2] = {
{ 0.5, { .5, -.5 }, { 0., 0. }, M_PI/5 },
{ .7, { .2, .2 }, { -.5, .7 }, -M_PI/4 },
};
const struct ellipsis_s phantom_geo3[7] = {
{ 1., { .2, .2 }, { -.6, .6 }, M_PI/4 },
{ 1., { .2, .2 }, { -.6, -.6 }, M_PI/4 },
{ 0.6, { .07, .07 }, { 0.15, 0 }, 0. },
{ 0.7, { .07, .07 }, { 0, 0 }, 0. },
{ 0.8, { .07, .07 }, { -0.15, 0 }, 0. },
{ 0.9, { .07, .07 }, { 0.15, 0.15}, 0. },
{ 0.9, { .07, .07 }, { 0.15, -0.15}, 0. },
};
const struct ellipsis_s phantom_geo4[1] = {
{ 0.8, { .1, .7 }, { .6, 0 }, 0},
};
const struct ellipsis_s phantom_geo5[1] = {
{ 1., { .5, -.5 }, { 0., 0. }, 0 },
};
const struct ellipsis_bs phantom_tubes[21] = {
{{ 1., { .125, .125 }, { -0.13, -0.19 }, 0., }, false },
{{ 1., { .125, .125 }, { -0.45, -0.32 }, 0., }, false },
{{ 1., { .125, .125 }, { -0.55, 0.05 }, 0., }, false },
{{ 1., { .125, .125 }, { -0.37, 0.37 }, 0., }, false },
{{ 1., { .125, .125 }, { -0.05, 0.55 }, 0., }, false },
{{ 1., { .125, .125 }, { 0.33, 0.40 }, 0., }, false },
{{ 1., { .125, .125 }, { 0.53, 0.12 }, 0., }, false },
{{ 1., { .125, .125 }, { 0.50, -0.24 }, 0., }, false },
{{ 1., { .125, .125 }, { 0.20, -0.05 }, 0., }, false },
{{ 1., { .125, .125 }, { -0.11, 0.16 }, 0., }, false },
{{ 1., { .75, .75 }, { 0.00, 0.00 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.13, -0.19 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.45, -0.32 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.55, 0.05 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.37, 0.37 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.05, 0.55 }, 0., }, true },
{{ -1., { .16, .16 }, { 0.33, 0.40 }, 0., }, true },
{{ -1., { .16, .16 }, { 0.53, 0.12 }, 0., }, true },
{{ -1., { .16, .16 }, { 0.50, -0.24 }, 0., }, true },
{{ -1., { .16, .16 }, { 0.20, -0.05 }, 0., }, true },
{{ -1., { .16, .16 }, { -0.11, 0.16 }, 0., }, true },
};
// NIST Phantom Geometry of T2 Sphere
// Stupic, KF, Ainslie, M, Boss, MA, et al.
// A standard system phantom for magnetic resonance imaging.
// Magn Reson Med. 2021; 86: 1194– 1211. https://doi.org/10.1002/mrm.28779
const struct ellipsis_bs nist_phantom_t2[29] = {
/*01*/ {{ 1., { .074, .074 }, { 0., 0.254*2-0.074 }, 0., }, false },
/*02*/ {{ 1., { .074, .074 }, { 0.096*2+0.074, 0.212*2-0.074 }, 0., }, false },
/*03*/ {{ 1., { .074, .074 }, { 0.176*2+0.074, 0.104*2-0.074 }, 0., }, false },
/*04*/ {{ 1., { .074, .074 }, { 0.176*2+0.074, -0.104*2+0.074 }, 0., }, false },
/*05*/ {{ 1., { .074, .074 }, { 0.096*2+0.074, -0.212*2+0.074 }, 0., }, false },
/*06*/ {{ 1., { .074, .074 }, { 0., -0.254*2+0.074 }, 0., }, false },
/*07*/ {{ 1., { .074, .074 }, { -(0.096*2+0.074), -(0.212*2-0.074) }, 0., }, false },
/*08*/ {{ 1., { .074, .074 }, { -(0.176*2+0.074), -(0.104*2-0.074) }, 0., }, false },
/*09*/ {{ 1., { .074, .074 }, { -(0.176*2+0.074), 0.104*2-0.074 }, 0., }, false },
/*10*/ {{ 1., { .074, .074 }, { -(0.096*2+0.074), 0.212*2-0.074 }, 0., }, false },
/*11*/ {{ 1., { .074, .074 }, { -(0.053*2+0.074), 0.123*2-0.074 }, 0., }, false },
/*12*/ {{ 1., { .074, .074 }, { 0.053*2+0.074, 0.123*2-0.074 }, 0., }, false },
/*13*/ {{ 1., { .074, .074 }, { 0.053*2+0.074, -0.123*2+0.074 }, 0., }, false },
/*14*/ {{ 1., { .074, .074 }, { -(0.053*2+0.074), -(0.123*2-0.074) }, 0., }, false },
/*Back*/ {{ 1., { .81, .81 }, { 0.00, 0.00 }, 0., }, true },
/*01*/ {{ -1., { .088, .088 }, { 0., 0.254*2-0.074 }, 0., }, true },
/*02*/ {{ -1., { .088, .088 }, { 0.096*2+0.074, 0.212*2-0.074 }, 0., }, true },
/*03*/ {{ -1., { .088, .088 }, { 0.176*2+0.074, 0.104*2-0.074 }, 0., }, true },
/*04*/ {{ -1., { .088, .088 }, { 0.176*2+0.074, -0.104*2+0.074 }, 0., }, true },
/*05*/ {{ -1., { .088, .088 }, { 0.096*2+0.074, -0.212*2+0.074 }, 0., }, true },
/*06*/ {{ -1., { .088, .088 }, { 0., -0.254*2+0.074 }, 0., }, true },
/*07*/ {{ -1., { .088, .088 }, { -(0.096*2+0.074), -(0.212*2-0.074) }, 0., }, true },
/*08*/ {{ -1., { .088, .088 }, { -(0.176*2+0.074), -(0.104*2-0.074) }, 0., }, true },
/*09*/ {{ -1., { .088, .088 }, { -(0.176*2+0.074), 0.104*2-0.074 }, 0., }, true },
/*10*/ {{ -1., { .088, .088 }, { -(0.096*2+0.074), 0.212*2-0.074 }, 0., }, true },
/*11*/ {{ -1., { .088, .088 }, { -(0.053*2+0.074), 0.123*2-0.074 }, 0., }, true },
/*12*/ {{ -1., { .088, .088 }, { 0.053*2+0.074, 0.123*2-0.074 }, 0., }, true },
/*13*/ {{ -1., { .088, .088 }, { 0.053*2+0.074, -0.123*2+0.074 }, 0., }, true },
/*14*/ {{ -1., { .088, .088 }, { -(0.053*2+0.074), -(0.123*2-0.074) }, 0., }, true },
};
// T1 T2 Phantom based on reference phantom by Diagnostic Sonar LTD (Scotland, UK)
const struct ellipsis_bs phantom_sonar[15] = {
/*01*/ {{ 1., { .135, .135 }, { 0., 0.45 }, 0., }, false },
/*02*/ {{ 1., { .135, .135 }, { 0.866*0.45, 0.5*0.45 }, 0., }, false },
/*03*/ {{ 1., { .135, .135 }, { 0.866*0.45, -0.5*0.45 }, 0., }, false },
/*04*/ {{ 1., { .135, .135 }, { 0., -0.45 }, 0., }, false },
/*05*/ {{ 1., { .135, .135 }, { -0.866*0.45, -0.5*0.45 }, 0., }, false },
/*06*/ {{ 1., { .135, .135 }, { -0.866*0.45, 0.5*0.45 }, 0., }, false },
/*07 (center)*/ {{ 1., { .16, .16 }, { 0.00, 0.00 }, 0., }, false },
/*Back*/ {{ 1., { .75, .75 }, { 0.00, 0.00 }, 0., }, true },
/*01*/ {{ -1., { .15, .15 }, { 0., 0.45 }, 0., }, true },
/*02*/ {{ -1., { .15, .15 }, { 0.866*0.45, 0.5*0.45 }, 0., }, true },
/*03*/ {{ -1., { .15, .15 }, { 0.866*0.45, -0.5*0.45 }, 0., }, true },
/*04*/ {{ -1., { .15, .15 }, { 0., -0.45 }, 0., }, true },
/*05*/ {{ -1., { .15, .15 }, { -0.866*0.45, -0.5*0.45 }, 0., }, true },
/*06*/ {{ -1., { .15, .15 }, { -0.866*0.45, 0.5*0.45 }, 0., }, true },
/*07 (center)*/ {{ -1., { .175, .175 }, { 0.00, 0.00 }, 0., }, true },
};
/* Magnetic Resonance in Medicine 58:430--436 (2007)
* Three-Dimensional Analytical Magnetic Resonance
* Imaging Phantom in the Fourier Domain
* Cheng Guan Koay, Joelle E. Sarlls, and Evren Özarslan
*/
const struct ellipsis3d_s shepplogan3d[10] = {
{ 2., { .6900, .9200, .9000 }, { .000, .000, .000 }, 0. },
{ -.8, { .6624, .8740, .8800 }, { .000, .000, .000 }, 0. },
{ -.2, { .4100, .1600, .2100 }, { -.220, .000, -.250 }, 3. * M_PI / 5. },
{ -.2, { .3100, .1100, .2200 }, { .220, .000, -.250 }, 2. * M_PI / 5. },
{ .2, { .2100, .2500, .5000 }, { .000, .350, -.250 }, 0. },
{ .2, { .0460, .0460, .0460 }, { .000, .100, -.250 }, 0. },
{ .1, { .0460, .0230, .0200 }, { -.080, -.650, -.250 }, 0. },
{ .1, { .0460, .0230, .0200 }, { .060, -.650, -.250 }, M_PI / 2. },
{ .2, { .0560, .0400, .1000 }, { .060, -.105, .625 }, M_PI / 2. },
{ -.2, { .0560, .0560, .1000 }, { .000, .100, .625 }, 0. }
};
static void rot2d(double x[2], const double in[2], double angle)
{
x[0] = cos(angle) * in[0] + sin(angle) * in[1];
x[1] = sin(angle) * in[0] - cos(angle) * in[1];
}
complex double xellipsis(const double center[2], const double axis[2], double angle, const double p[2])
{
double p90[2];
p90[0] = -p[1];
p90[1] = p[0];
double pshift[2];
pshift[0] = p90[0] + center[0];
pshift[1] = p90[1] + center[1];
double prot[2];
rot2d(prot, pshift, angle);
double radius = pow(prot[0] / axis[0], 2.) + pow(prot[1] / axis[1], 2.);
return (radius <= 1.) ? 1. : 0.;
}
complex double kellipsis(const double center[2], const double axis[2], double angle, const double p[2])
{
double p90[2];
p90[0] = -p[1];
p90[1] = p[0];
double prot[2];
rot2d(prot, p90, angle);
double radius = sqrt(pow(prot[0] * axis[0], 2.) + pow(prot[1] * axis[1], 2.));
complex double res = jinc(2. * M_PI * radius) * (axis[0] * axis[1]);
return res * cexp(2.i * M_PI * (p90[0] * center[0] + p90[1] * center[1])) / sqrtf(2. * M_PI) * 2.;
}
complex double xrectangle(const double center[2], const double axis[2], double angle, const double p[2])
{
double p90[2];
p90[0] = -p[1];
p90[1] = p[0];
double pshift[2];
pshift[0] = p90[0] + center[0];
pshift[1] = p90[1] + center[1];
double prot[2];
rot2d(prot, pshift, M_PI/4 + angle);
double radius = fabs(prot[0] / axis[0] / sqrt(2)) + fabs(prot[1] / axis[1] / sqrt(2));
return (radius <= 1.) ? 1. : 0.;
}
complex double krectangle(const double center[2], const double axis[2], double angle, const double p[2])
{
double p90[2];
p90[0] = -p[1];
p90[1] = p[0];
double prot[2];
rot2d(prot, p90, angle);
complex double res = sinc(2. * M_PI * prot[0] * axis[0]) * sinc(2. * M_PI * prot[1] * axis[1]) * (axis[0] * axis[1]);
return res * cexp(2.i * M_PI * (p90[0] * center[0] + p90[1] * center[1])) / sqrtf(2. * M_PI) * 2.;
}
complex double phantom(unsigned int N, const struct ellipsis_s arr[N], const double pos[2], bool ksp)
{
complex double res = 0.;
for (unsigned int i = 0; i < N; i++)
res += arr[i].intensity * (ksp ? kellipsis : xellipsis)(arr[i].center, arr[i].axis, arr[i].angle, pos);
return res;
}
complex double phantomX(unsigned int N, const struct ellipsis_s arr[N], const double pos[2], bool ksp)
{
complex double res = 0.;
for (unsigned int i = 0; i < N; i++)
res += arr[i].intensity * (ksp ? krectangle : xrectangle)(arr[i].center, arr[i].axis, arr[i].angle, pos);
return res;
}
static double ksphere3(double x)
{
return (0. == x) ? (1. / 3.) : ((sin(x) - x * cos(x)) / pow(x, 3.));
}
complex double xellipsis3d(const double center[3], const double axis[3], double angle, const double p[3])
{
double p90[3];
p90[0] = -p[1];
p90[1] = p[0];
p90[2] = p[2];
double pshift[3];
pshift[0] = p90[0] + center[0];
pshift[1] = p90[1] + center[1];
pshift[2] = p90[2] + center[2];
double prot[3];
rot2d(prot, pshift, angle);
prot[2] = pshift[2];
double radius = pow(prot[0] / axis[0], 2.) + pow(prot[1] / axis[1], 2.) + pow(prot[2] / axis[2], 2.);
return (radius <= 1.) ? 1. : 0.;
}
complex double kellipsis3d(const double center[3], const double axis[3], double angle, const double p[3])
{
double p90[3];
p90[0] = -p[1];
p90[1] = p[0];
p90[2] = p[2];
double pshift[3];
pshift[0] = p90[0] + center[0];
pshift[1] = p90[1] + center[1];
pshift[2] = p90[2] + center[2];
double prot[3];
rot2d(prot, pshift, angle);
prot[2] = pshift[2];
double radius = sqrt(pow(prot[0] * axis[0], 2.) + pow(prot[1] * axis[1], 2.) + pow(prot[2] * axis[2], 2.));
complex double res = ksphere3(2. * M_PI * radius) * (axis[0] * axis[1] * axis[2]);
return res * cexp(2.i * M_PI * (p90[0] * center[0] + p90[1] * center[1] + p90[2] * center[2])) / sqrtf(M_PI) * sqrtf(8.);
}
complex double phantom3d(unsigned int N, const struct ellipsis3d_s arr[N], const double pos[3], bool ksp)
{
complex double res = 0.;
for (unsigned int i = 0; i < N; i++)
res += arr[i].intensity * (ksp ? kellipsis3d : xellipsis3d)(arr[i].center, arr[i].axis, arr[i].angle, pos);
return res;
}
|
18b00b381adcf3464f70826fd381171f28a7b1de
|
9e3cd787de3b38f417e71a2c2d816713e38bf116
|
/sim_console_c.c
|
a2c9d55f6a0dc45ece3bf1e04c56268cfc1891fd
|
[
"CC-BY-4.0"
] |
permissive
|
antonblanchard/microwatt
|
34cd0b8b730c937e9ae95fd7940cc1014845697a
|
83dcfeabf8d37e7ea1adfafcd782f1298a3ddbef
|
refs/heads/master
| 2023-07-25T04:37:31.872162
| 2023-02-20T06:18:35
| 2023-02-20T06:18:35
| 203,724,916
| 606
| 106
|
NOASSERTION
| 2023-09-14T07:55:48
| 2019-08-22T06:02:52
|
Verilog
|
UTF-8
|
C
| false
| false
| 1,636
|
c
|
sim_console_c.c
|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <poll.h>
#include "sim_vhpi_c.h"
/* Should we exit simulation on ctrl-c or pass it through? */
#define EXIT_ON_CTRL_C
static struct termios oldt;
static void disable_raw_mode(void)
{
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
}
static void enable_raw_mode(void)
{
static bool initialized = false;
if (!initialized) {
static struct termios newt;
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
cfmakeraw(&newt);
#ifdef EXIT_ON_CTRL_C
newt.c_lflag |= ISIG;
#endif
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
initialized = true;
atexit(disable_raw_mode);
}
}
void sim_console_read(unsigned char *__rt)
{
int ret;
unsigned long val = 0;
enable_raw_mode();
ret = read(STDIN_FILENO, &val, 1);
if (ret != 1) {
fprintf(stderr, "%s: read of stdin returns %d\n", __func__, ret);
exit(1);
}
//fprintf(stderr, "read returns %c\n", val);
to_std_logic_vector(val, __rt, 64);
}
void sim_console_poll(unsigned char *__rt)
{
int ret;
struct pollfd fdset[1];
uint8_t val = 0;
enable_raw_mode();
memset(fdset, 0, sizeof(fdset));
fdset[0].fd = STDIN_FILENO;
fdset[0].events = POLLIN;
ret = poll(fdset, 1, 0);
//fprintf(stderr, "poll returns %d\n", ret);
if (ret == 1) {
if (fdset[0].revents & POLLIN)
val = 1;
// fprintf(stderr, "poll revents: 0x%x\n", fdset[0].revents);
}
to_std_logic_vector(val, __rt, 64);
}
void sim_console_write(unsigned char *__rs)
{
uint8_t val;
val = from_std_logic_vector(__rs, 64);
fprintf(stderr, "%c", val);
}
|
9a6eb6512e14a4a2eb90c73a6b613c480e16ee72
|
3bf69a0369ac0b8248045f86c646b06655be5adb
|
/app/include/zmk/split/bluetooth/uuid.h
|
c38131dd83e2a94c2f3a5c09e42a7c4ba4f621d0
|
[
"MIT"
] |
permissive
|
zmkfirmware/zmk
|
36dea10219874ce8c81df46eb3b77e02dde7c352
|
3d938033b002c78ce24245e3cf37b7ba55876145
|
refs/heads/main
| 2023-09-03T06:09:24.869559
| 2023-09-02T21:45:25
| 2023-09-03T03:49:19
| 270,692,521
| 1,848
| 2,032
|
MIT
| 2023-09-14T03:42:31
| 2020-06-08T14:08:44
|
C
|
UTF-8
|
C
| false
| false
| 618
|
h
|
uuid.h
|
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zephyr/bluetooth/uuid.h>
#ifndef BT_UUID_NUM_OF_DIGITALS
#define BT_UUID_NUM_OF_DIGITALS BT_UUID_DECLARE_16(0x2909)
#endif
#define ZMK_BT_SPLIT_UUID(num) BT_UUID_128_ENCODE(num, 0x0096, 0x7107, 0xc967, 0xc5cfb1c2482a)
#define ZMK_SPLIT_BT_SERVICE_UUID ZMK_BT_SPLIT_UUID(0x00000000)
#define ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID ZMK_BT_SPLIT_UUID(0x00000001)
#define ZMK_SPLIT_BT_CHAR_RUN_BEHAVIOR_UUID ZMK_BT_SPLIT_UUID(0x00000002)
#define ZMK_SPLIT_BT_CHAR_SENSOR_STATE_UUID ZMK_BT_SPLIT_UUID(0x00000003)
|
45d5c4dda627555f9cd5844ac182961049d9dda8
|
e5f4f37d941ceb8145d65f92028cc54658b1ac01
|
/Code/EnginePlugins/RmlUiPlugin/Components/RmlUiMessages.h
|
76f28083eaa755861db5f9c50498531027c6e968
|
[
"MIT"
] |
permissive
|
ezEngine/ezEngine
|
19983d2733a5409fb2665c6c3a0a575dadcefb50
|
c46e3b4b2cd46798e4abb4938fbca281c054b039
|
refs/heads/dev
| 2023-09-06T02:17:28.152665
| 2023-09-05T18:25:43
| 2023-09-05T18:25:43
| 18,179,848
| 1,050
| 165
|
MIT
| 2023-09-14T21:44:39
| 2014-03-27T15:02:16
|
C++
|
UTF-8
|
C
| false
| false
| 224
|
h
|
RmlUiMessages.h
|
#pragma once
#include <Foundation/Communication/Message.h>
#include <RmlUiPlugin/RmlUiPluginDLL.h>
struct EZ_RMLUIPLUGIN_DLL ezMsgRmlUiReload : public ezMessage
{
EZ_DECLARE_MESSAGE_TYPE(ezMsgRmlUiReload, ezMessage);
};
|
2d240fcec54bf4cc3455c2afa940d5a2623ed9d8
|
94096248c1de2dcf46e69ca913cedfa290e44224
|
/tests/api/test-to-stacktrace.c
|
32d2bd23dfedf6e08dcdeb66f6abaec0fba6f717
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
svaarala/duktape
|
612110d1a6db46226c171cfd222974b1b3651ad5
|
5e169deafbbd12823665f5d30fb4c4c04e3dfa26
|
refs/heads/master
| 2023-08-06T16:43:33.014729
| 2022-11-17T21:02:08
| 2022-11-17T21:02:08
| 15,852,088
| 4,796
| 610
|
MIT
| 2023-09-11T17:13:01
| 2014-01-12T22:16:14
|
JavaScript
|
UTF-8
|
C
| false
| false
| 4,399
|
c
|
test-to-stacktrace.c
|
/*===
*** test_1 (duk_safe_call)
top: 0
duk_to_stacktrace: 'Error: aiee
at err (eval:1)
at eval (eval:1) preventsyield'
final top: 0
==> rc=0, result='undefined'
*** test_2 (duk_safe_call)
top: 0
duk_to_stacktrace: '4'
final top: 0
==> rc=0, result='undefined'
*** test_3 (duk_safe_call)
top: 0
duk_to_stacktrace: '[object Object]'
final top: 0
==> rc=0, result='undefined'
*** test_4 (duk_safe_call)
top: 0
duk_to_stacktrace: 'oops'
final top: 0
==> rc=0, result='undefined'
*** test_5 (duk_safe_call)
top: 0
duk_to_stacktrace: '[object Object]'
final top: 0
==> rc=0, result='undefined'
*** test_6 (duk_safe_call)
get 1
==> rc=1, result='Error: aiee 2'
*** test_7 (duk_safe_call)
get 1
==> rc=1, result='Error: aiee 2'
===*/
static duk_ret_t test_1(duk_context *ctx, void *udata) {
(void) udata;
/* Normal case: normal error throw. */
printf("top: %ld\n", (long) duk_get_top(ctx));
duk_peval_string(ctx, "(function err() { throw new Error('aiee'); })();");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_2(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion argument is not an Error (or even an object). */
printf("top: %ld\n", (long) duk_get_top(ctx));
duk_peval_string(ctx, "2+2");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_3(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion argument is an Object without .stack. */
printf("top: %ld\n", (long) duk_get_top(ctx));
duk_eval_string(ctx, "({ foo: 'bar' })");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_4(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion argument is an Object with .stack, but not
* an Error.
*/
printf("top: %ld\n", (long) duk_get_top(ctx));
duk_eval_string(ctx, "({ stack: 'oops' })");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_5(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion argument is an Object with .stack, but not
* a string.
*/
printf("top: %ld\n", (long) duk_get_top(ctx));
duk_eval_string(ctx, "({ stack: 123 })");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_6(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion fails once. The non-safe variant passes
* the initial error through as is.
*/
duk_peval_string(ctx, "var err = new Error('aiee 1'); Object.defineProperty(err, 'stack', {\n"
" get: function() { print('get 1'); throw new Error('aiee 2'); }\n"
"}); throw err;\n");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
static duk_ret_t test_7(duk_context *ctx, void *udata) {
(void) udata;
/* Uncommon case: coercion fails twice. The non-safe variant passes
* the initial error through as is.
*/
duk_peval_string(ctx, "var err = new Error('aiee 1'); Object.defineProperty(err, 'stack', {\n"
" get: function() {\n"
" print('get 1');\n"
" var e = new Error('aiee 2');\n"
" Object.defineProperty(e, 'stack', {\n"
" get: function() { print('get 2'); throw new Error('aiee 3'); }\n"
" });\n"
" throw e;\n"
" }\n"
"}); throw err;\n");
printf("duk_to_stacktrace: '%s'\n", duk_to_stacktrace(ctx, -1));
duk_pop(ctx);
printf("final top: %ld\n", (long) duk_get_top(ctx));
return 0;
}
void test(duk_context *ctx) {
TEST_SAFE_CALL(test_1);
TEST_SAFE_CALL(test_2);
TEST_SAFE_CALL(test_3);
TEST_SAFE_CALL(test_4);
TEST_SAFE_CALL(test_5);
TEST_SAFE_CALL(test_6);
TEST_SAFE_CALL(test_7);
}
|
317692b92d2604a1cb8f56bfcf60608ed63d44e5
|
9ceacf33fd96913cac7ef15492c126d96cae6911
|
/usr.bin/cu/input.c
|
c004108fc24d21d6c5435dcb65de2bf46768dcf7
|
[] |
no_license
|
openbsd/src
|
ab97ef834fd2d5a7f6729814665e9782b586c130
|
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
|
refs/heads/master
| 2023-09-02T18:54:56.624627
| 2023-09-02T15:16:12
| 2023-09-02T15:16:12
| 66,966,208
| 3,394
| 1,235
| null | 2023-08-08T02:42:25
| 2016-08-30T18:18:25
|
C
|
UTF-8
|
C
| false
| false
| 2,056
|
c
|
input.c
|
/* $OpenBSD: input.c,v 1.2 2012/07/10 10:28:05 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include "cu.h"
/*
* Prompt and read a line of user input from stdin. We want to use the termios
* we were started with so restore and stick in a signal handler for ^C.
*/
volatile sig_atomic_t input_stop;
void input_signal(int);
void
input_signal(int sig)
{
input_stop = 1;
}
const char *
get_input(const char *prompt)
{
static char s[BUFSIZ];
struct sigaction act, oact;
char c, *cp, *out = NULL;
ssize_t n;
memset(&act, 0, sizeof(act));
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = input_signal;
if (sigaction(SIGINT, &act, &oact) != 0)
cu_err(1, "sigaction");
input_stop = 0;
restore_termios();
printf("%s ", prompt);
fflush(stdout);
cp = s;
while (cp != s + sizeof(s) - 1) {
n = read(STDIN_FILENO, &c, 1);
if (n == -1 && errno != EINTR)
cu_err(1, "read");
if (n != 1 || input_stop)
break;
if (c == '\n') {
out = s;
break;
}
if (!iscntrl((u_char)c))
*cp++ = c;
}
*cp = '\0';
set_termios();
sigaction(SIGINT, &oact, NULL);
return (out);
}
|
5cfcb8f29493e59bd183391e92d59c2bdf1d8f85
|
e910318d01528d82040507a49eeeb8dade45b31f
|
/ports/teensy/main.c
|
d4c5f0396faf105355a39eb5ea2b1dbb0d83c261
|
[
"MIT"
] |
permissive
|
pfalcon/pycopy
|
e844480a5e5cd463530328889daed2ba87552b8a
|
3ac90ae9c3c6bbebfba9cada2d37025e35c62796
|
refs/heads/pfalcon
| 2023-08-30T09:39:52.290147
| 2022-09-08T16:42:38
| 2022-09-08T16:42:38
| 15,507,576
| 753
| 71
|
MIT
| 2021-05-08T04:59:21
| 2013-12-29T11:38:47
|
C
|
UTF-8
|
C
| false
| false
| 10,221
|
c
|
main.c
|
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "py/lexer.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
#include "py/gc.h"
#include "py/mphal.h"
#include "gccollect.h"
#include "lib/utils/gchelper.h"
#include "lib/utils/pyexec.h"
#include "lib/mp-readline/readline.h"
#include "lexermemzip.h"
#include "Arduino.h"
#include "servo.h"
#include "led.h"
#include "uart.h"
#include "pin.h"
extern uint32_t _heap_start;
void flash_error(int n) {
for (int i = 0; i < n; i++) {
led_state(PYB_LED_BUILTIN, 1);
delay(250);
led_state(PYB_LED_BUILTIN, 0);
delay(250);
}
}
void NORETURN __fatal_error(const char *msg) {
for (volatile uint delay = 0; delay < 10000000; delay++) {
}
led_state(1, 1);
led_state(2, 1);
led_state(3, 1);
led_state(4, 1);
mp_hal_stdout_tx_strn("\nFATAL ERROR:\n", 14);
mp_hal_stdout_tx_strn(msg, strlen(msg));
for (uint i = 0;;) {
led_toggle(((i++) & 3) + 1);
for (volatile uint delay = 0; delay < 10000000; delay++) {
}
if (i >= 16) {
// to conserve power
__WFI();
}
}
}
void nlr_jump_fail(void *val) {
printf("FATAL: uncaught exception %p\n", val);
__fatal_error("");
}
void __assert_func(const char *file, int line, const char *func, const char *expr) {
printf("Assertion failed: %s, file %s, line %d\n", expr, file, line);
__fatal_error("");
}
mp_obj_t pyb_analog_read(mp_obj_t pin_obj) {
uint pin = mp_obj_get_int(pin_obj);
int val = analogRead(pin);
return MP_OBJ_NEW_SMALL_INT(val);
}
mp_obj_t pyb_analog_write(mp_obj_t pin_obj, mp_obj_t val_obj) {
uint pin = mp_obj_get_int(pin_obj);
int val = mp_obj_get_int(val_obj);
analogWrite(pin, val);
return mp_const_none;
}
mp_obj_t pyb_analog_write_resolution(mp_obj_t res_obj) {
int res = mp_obj_get_int(res_obj);
analogWriteResolution(res);
return mp_const_none;
}
mp_obj_t pyb_analog_write_frequency(mp_obj_t pin_obj, mp_obj_t freq_obj) {
uint pin = mp_obj_get_int(pin_obj);
int freq = mp_obj_get_int(freq_obj);
analogWriteFrequency(pin, freq);
return mp_const_none;
}
#if 0
// get lots of info about the board
static mp_obj_t pyb_info(void) {
// get and print unique id; 96 bits
{
byte *id = (byte *)0x40048058;
printf("ID=%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11]);
}
// get and print clock speeds
printf("CPU=%u\nBUS=%u\nMEM=%u\n", F_CPU, F_BUS, F_MEM);
// to print info about memory
{
printf("_sdata=%p\n", &_sdata);
printf("_edata=%p\n", &_edata);
printf("_sbss=%p\n", &_sbss);
printf("_ebss=%p\n", &_ebss);
printf("_estack=%p\n", &_estack);
printf("_etext=%p\n", &_etext);
printf("_heap_start=%p\n", &_heap_start);
}
// GC info
{
gc_info_t info;
gc_info(&info);
printf("GC:\n");
printf(" %u total\n", info.total);
printf(" %u used %u free\n", info.used, info.free);
printf(" 1=%u 2=%u m=%u\n", info.num_1block, info.num_2block, info.max_block);
}
#if 0
// free space on flash
{
DWORD nclst;
FATFS *fatfs;
f_getfree("0:", &nclst, &fatfs);
printf("LFS free: %u bytes\n", (uint)(nclst * fatfs->csize * 512));
}
#endif
return mp_const_none;
}
#endif
#define RAM_START (0x1FFF8000) // fixed for chip
#define HEAP_END (0x20006000) // tunable
#define RAM_END (0x20008000) // fixed for chip
#if 0
void gc_helper_get_regs_and_clean_stack(mp_uint_t *regs, mp_uint_t heap_end);
mp_obj_t pyb_gc(void) {
gc_collect();
return mp_const_none;
}
mp_obj_t pyb_gpio(int n_args, mp_obj_t *args) {
// assert(1 <= n_args && n_args <= 2);
uint pin = mp_obj_get_int(args[0]);
if (pin > CORE_NUM_DIGITAL) {
goto pin_error;
}
if (n_args == 1) {
// get pin
pinMode(pin, INPUT);
return MP_OBJ_NEW_SMALL_INT(digitalRead(pin));
}
// set pin
pinMode(pin, OUTPUT);
digitalWrite(pin, mp_obj_is_true(args[1]));
return mp_const_none;
pin_error:
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("pin %d does not exist"), pin);
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_gpio_obj, 1, 2, pyb_gpio);
#if 0
mp_obj_t pyb_hid_send_report(mp_obj_t arg) {
mp_obj_t *items = mp_obj_get_array_fixed_n(arg, 4);
uint8_t data[4];
data[0] = mp_obj_get_int(items[0]);
data[1] = mp_obj_get_int(items[1]);
data[2] = mp_obj_get_int(items[2]);
data[3] = mp_obj_get_int(items[3]);
usb_hid_send_report(data);
return mp_const_none;
}
#endif
#endif // 0
STATIC mp_obj_t pyb_config_source_dir = MP_OBJ_NULL;
STATIC mp_obj_t pyb_config_main = MP_OBJ_NULL;
STATIC mp_obj_t pyb_config_usb_mode = MP_OBJ_NULL;
mp_obj_t pyb_source_dir(mp_obj_t source_dir) {
if (mp_obj_is_str(source_dir)) {
pyb_config_source_dir = source_dir;
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(pyb_source_dir_obj, pyb_source_dir);
mp_obj_t pyb_main(mp_obj_t main) {
if (mp_obj_is_str(main)) {
pyb_config_main = main;
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(pyb_main_obj, pyb_main);
STATIC mp_obj_t pyb_usb_mode(mp_obj_t usb_mode) {
if (mp_obj_is_str(usb_mode)) {
pyb_config_usb_mode = usb_mode;
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(pyb_usb_mode_obj, pyb_usb_mode);
#if 0
mp_obj_t pyb_delay(mp_obj_t count) {
delay(mp_obj_get_int(count));
return mp_const_none;
}
mp_obj_t pyb_led(mp_obj_t state) {
led_state(PYB_LED_BUILTIN, mp_obj_is_true(state));
return state;
}
#endif // 0
#if 0
char *strdup(const char *str) {
uint32_t len = strlen(str);
char *s2 = m_new(char, len + 1);
memcpy(s2, str, len);
s2[len] = 0;
return s2;
}
#endif
int main(void) {
// TODO: Put this in a more common initialization function.
// Turn on STKALIGN which keeps the stack 8-byte aligned for interrupts
// (per EABI)
#define SCB_CCR_STKALIGN (1 << 9)
SCB_CCR |= SCB_CCR_STKALIGN;
mp_stack_ctrl_init();
mp_stack_set_limit(10240);
pinMode(LED_BUILTIN, OUTPUT);
led_init();
// int first_soft_reset = true;
soft_reset:
led_state(PYB_LED_BUILTIN, 1);
// GC init
gc_init(&_heap_start, (void *)HEAP_END);
// MicroPython init
mp_init();
mp_obj_list_init(mp_sys_path, 0);
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
mp_obj_list_init(mp_sys_argv, 0);
readline_init0();
pin_init0();
#if 0
// add some functions to the python namespace
{
mp_store_name(MP_QSTR_help, mp_make_function_n(0, pyb_help));
mp_obj_t m = mp_obj_new_module(MP_QSTR_pyb);
mp_store_attr(m, MP_QSTR_info, mp_make_function_n(0, pyb_info));
mp_store_attr(m, MP_QSTR_source_dir, mp_make_function_n(1, pyb_source_dir));
mp_store_attr(m, MP_QSTR_main, mp_make_function_n(1, pyb_main));
mp_store_attr(m, MP_QSTR_gc, mp_make_function_n(0, pyb_gc));
mp_store_attr(m, MP_QSTR_delay, mp_make_function_n(1, pyb_delay));
mp_store_attr(m, MP_QSTR_led, mp_make_function_n(1, pyb_led));
mp_store_attr(m, MP_QSTR_LED, (mp_obj_t)&pyb_led_type);
mp_store_attr(m, MP_QSTR_analogRead, mp_make_function_n(1, pyb_analog_read));
mp_store_attr(m, MP_QSTR_analogWrite, mp_make_function_n(2, pyb_analog_write));
mp_store_attr(m, MP_QSTR_analogWriteResolution, mp_make_function_n(1, pyb_analog_write_resolution));
mp_store_attr(m, MP_QSTR_analogWriteFrequency, mp_make_function_n(2, pyb_analog_write_frequency));
mp_store_attr(m, MP_QSTR_gpio, (mp_obj_t)&pyb_gpio_obj);
mp_store_attr(m, MP_QSTR_Servo, mp_make_function_n(0, pyb_Servo));
mp_store_name(MP_QSTR_pyb, m);
}
#endif
#if MICROPY_MODULE_FROZEN
pyexec_frozen_module("boot.py");
#else
if (!pyexec_file_if_exists("/boot.py")) {
flash_error(4);
}
#endif
// Turn bootup LED off
led_state(PYB_LED_BUILTIN, 0);
// run main script
#if MICROPY_MODULE_FROZEN
pyexec_frozen_module("main.py");
#else
{
vstr_t *vstr = vstr_new(16);
vstr_add_str(vstr, "/");
if (pyb_config_main == MP_OBJ_NULL) {
vstr_add_str(vstr, "main.py");
} else {
vstr_add_str(vstr, mp_obj_str_get_str(pyb_config_main));
}
if (!pyexec_file_if_exists(vstr_null_terminated_str(vstr))) {
flash_error(3);
}
vstr_free(vstr);
}
#endif
// enter REPL
// REPL mode can change, or it can request a soft reset
for (;;) {
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
if (pyexec_raw_repl() != 0) {
break;
}
} else {
if (pyexec_friendly_repl() != 0) {
break;
}
}
}
printf("MPY: soft reboot\n");
// first_soft_reset = false;
goto soft_reset;
}
void gc_collect(void) {
gc_collect_start();
gc_helper_collect_regs_and_stack();
gc_collect_end();
}
// stub out __libc_init_array. It's called by mk20dx128.c and is used to call
// global C++ constructors. Since this is a C-only projects, we don't need to
// call constructors.
void __libc_init_array(void) {
}
// ultoa is used by usb_init_serialnumber. Normally ultoa would be provided
// by nonstd.c from the teensy core, but it conflicts with some of the
// MicroPython functions in string0.c, so we provide ultoa here.
char *ultoa(unsigned long val, char *buf, int radix) {
unsigned digit;
int i = 0, j;
char t;
while (1) {
digit = val % radix;
buf[i] = ((digit < 10) ? '0' + digit : 'A' + digit - 10);
val /= radix;
if (val == 0) {
break;
}
i++;
}
buf[i + 1] = 0;
for (j = 0; j < i; j++, i--) {
t = buf[j];
buf[j] = buf[i];
buf[i] = t;
}
return buf;
}
|
41e5c6b85b2d37bb98efb82ab14802313378a794
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/nvfw/nouveau_nvkm_nvfw_acr.c
|
b9c0d728587b8ea14095f44d6f783e2f92f52dfd
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 6,882
|
c
|
nouveau_nvkm_nvfw_acr.c
|
/* $NetBSD: nouveau_nvkm_nvfw_acr.c,v 1.3 2021/12/19 10:51:57 riastradh Exp $ */
/*
* Copyright 2019 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_nvfw_acr.c,v 1.3 2021/12/19 10:51:57 riastradh Exp $");
#include <core/subdev.h>
#include <nvfw/acr.h>
void
wpr_header_dump(struct nvkm_subdev *subdev, const struct wpr_header *hdr)
{
nvkm_debug(subdev, "wprHeader\n");
nvkm_debug(subdev, "\tfalconID : %d\n", hdr->falcon_id);
nvkm_debug(subdev, "\tlsbOffset : 0x%x\n", hdr->lsb_offset);
nvkm_debug(subdev, "\tbootstrapOwner: %d\n", hdr->bootstrap_owner);
nvkm_debug(subdev, "\tlazyBootstrap : %d\n", hdr->lazy_bootstrap);
nvkm_debug(subdev, "\tstatus : %d\n", hdr->status);
}
void
wpr_header_v1_dump(struct nvkm_subdev *subdev, const struct wpr_header_v1 *hdr)
{
nvkm_debug(subdev, "wprHeader\n");
nvkm_debug(subdev, "\tfalconID : %d\n", hdr->falcon_id);
nvkm_debug(subdev, "\tlsbOffset : 0x%x\n", hdr->lsb_offset);
nvkm_debug(subdev, "\tbootstrapOwner: %d\n", hdr->bootstrap_owner);
nvkm_debug(subdev, "\tlazyBootstrap : %d\n", hdr->lazy_bootstrap);
nvkm_debug(subdev, "\tbinVersion : %d\n", hdr->bin_version);
nvkm_debug(subdev, "\tstatus : %d\n", hdr->status);
}
static void
lsb_header_tail_dump(struct nvkm_subdev *subdev,
struct lsb_header_tail *hdr)
{
nvkm_debug(subdev, "lsbHeader\n");
nvkm_debug(subdev, "\tucodeOff : 0x%x\n", hdr->ucode_off);
nvkm_debug(subdev, "\tucodeSize : 0x%x\n", hdr->ucode_size);
nvkm_debug(subdev, "\tdataSize : 0x%x\n", hdr->data_size);
nvkm_debug(subdev, "\tblCodeSize : 0x%x\n", hdr->bl_code_size);
nvkm_debug(subdev, "\tblImemOff : 0x%x\n", hdr->bl_imem_off);
nvkm_debug(subdev, "\tblDataOff : 0x%x\n", hdr->bl_data_off);
nvkm_debug(subdev, "\tblDataSize : 0x%x\n", hdr->bl_data_size);
nvkm_debug(subdev, "\tappCodeOff : 0x%x\n", hdr->app_code_off);
nvkm_debug(subdev, "\tappCodeSize : 0x%x\n", hdr->app_code_size);
nvkm_debug(subdev, "\tappDataOff : 0x%x\n", hdr->app_data_off);
nvkm_debug(subdev, "\tappDataSize : 0x%x\n", hdr->app_data_size);
nvkm_debug(subdev, "\tflags : 0x%x\n", hdr->flags);
}
void
lsb_header_dump(struct nvkm_subdev *subdev, struct lsb_header *hdr)
{
lsb_header_tail_dump(subdev, &hdr->tail);
}
void
lsb_header_v1_dump(struct nvkm_subdev *subdev, struct lsb_header_v1 *hdr)
{
lsb_header_tail_dump(subdev, &hdr->tail);
}
void
flcn_acr_desc_dump(struct nvkm_subdev *subdev, struct flcn_acr_desc *hdr)
{
int i;
nvkm_debug(subdev, "acrDesc\n");
nvkm_debug(subdev, "\twprRegionId : %d\n", hdr->wpr_region_id);
nvkm_debug(subdev, "\twprOffset : 0x%x\n", hdr->wpr_offset);
nvkm_debug(subdev, "\tmmuMemRange : 0x%x\n",
hdr->mmu_mem_range);
nvkm_debug(subdev, "\tnoRegions : %d\n",
hdr->regions.no_regions);
for (i = 0; i < ARRAY_SIZE(hdr->regions.region_props); i++) {
nvkm_debug(subdev, "\tregion[%d] :\n", i);
nvkm_debug(subdev, "\t startAddr : 0x%x\n",
hdr->regions.region_props[i].start_addr);
nvkm_debug(subdev, "\t endAddr : 0x%x\n",
hdr->regions.region_props[i].end_addr);
nvkm_debug(subdev, "\t regionId : %d\n",
hdr->regions.region_props[i].region_id);
nvkm_debug(subdev, "\t readMask : 0x%x\n",
hdr->regions.region_props[i].read_mask);
nvkm_debug(subdev, "\t writeMask : 0x%x\n",
hdr->regions.region_props[i].write_mask);
nvkm_debug(subdev, "\t clientMask : 0x%x\n",
hdr->regions.region_props[i].client_mask);
}
nvkm_debug(subdev, "\tucodeBlobSize: %d\n",
hdr->ucode_blob_size);
nvkm_debug(subdev, "\tucodeBlobBase: 0x%"PRIx64"\n",
hdr->ucode_blob_base);
nvkm_debug(subdev, "\tvprEnabled : %d\n",
hdr->vpr_desc.vpr_enabled);
nvkm_debug(subdev, "\tvprStart : 0x%x\n",
hdr->vpr_desc.vpr_start);
nvkm_debug(subdev, "\tvprEnd : 0x%x\n",
hdr->vpr_desc.vpr_end);
nvkm_debug(subdev, "\thdcpPolicies : 0x%x\n",
hdr->vpr_desc.hdcp_policies);
}
void
flcn_acr_desc_v1_dump(struct nvkm_subdev *subdev, struct flcn_acr_desc_v1 *hdr)
{
int i;
nvkm_debug(subdev, "acrDesc\n");
nvkm_debug(subdev, "\twprRegionId : %d\n", hdr->wpr_region_id);
nvkm_debug(subdev, "\twprOffset : 0x%x\n", hdr->wpr_offset);
nvkm_debug(subdev, "\tmmuMemoryRange : 0x%x\n",
hdr->mmu_memory_range);
nvkm_debug(subdev, "\tnoRegions : %d\n",
hdr->regions.no_regions);
for (i = 0; i < ARRAY_SIZE(hdr->regions.region_props); i++) {
nvkm_debug(subdev, "\tregion[%d] :\n", i);
nvkm_debug(subdev, "\t startAddr : 0x%x\n",
hdr->regions.region_props[i].start_addr);
nvkm_debug(subdev, "\t endAddr : 0x%x\n",
hdr->regions.region_props[i].end_addr);
nvkm_debug(subdev, "\t regionId : %d\n",
hdr->regions.region_props[i].region_id);
nvkm_debug(subdev, "\t readMask : 0x%x\n",
hdr->regions.region_props[i].read_mask);
nvkm_debug(subdev, "\t writeMask : 0x%x\n",
hdr->regions.region_props[i].write_mask);
nvkm_debug(subdev, "\t clientMask : 0x%x\n",
hdr->regions.region_props[i].client_mask);
nvkm_debug(subdev, "\t shadowMemStartAddr: 0x%x\n",
hdr->regions.region_props[i].shadow_mem_start_addr);
}
nvkm_debug(subdev, "\tucodeBlobSize : %d\n",
hdr->ucode_blob_size);
nvkm_debug(subdev, "\tucodeBlobBase : 0x%"PRIx64"\n",
hdr->ucode_blob_base);
nvkm_debug(subdev, "\tvprEnabled : %d\n",
hdr->vpr_desc.vpr_enabled);
nvkm_debug(subdev, "\tvprStart : 0x%x\n",
hdr->vpr_desc.vpr_start);
nvkm_debug(subdev, "\tvprEnd : 0x%x\n",
hdr->vpr_desc.vpr_end);
nvkm_debug(subdev, "\thdcpPolicies : 0x%x\n",
hdr->vpr_desc.hdcp_policies);
}
|
3ad24c13f0c81155b9c7761e49720efb9d589135
|
67305fcba68fdf469862aed2959ad1dd5b22a536
|
/rt-thread/components/libc/compilers/minilibc/ctype.h
|
5f41376ed8204455634f6e0def9412421848baaa
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
RT-Thread/IoT_Board
|
cdabf100a8d515fbcaa65ab0b72ec67acb0d2c9a
|
2d218a4e06f06dbb356ec00767904f91d00db7cc
|
refs/heads/master
| 2023-09-04T16:51:34.485240
| 2022-01-19T01:26:16
| 2022-01-19T01:26:16
| 161,133,933
| 344
| 238
|
Apache-2.0
| 2023-06-06T04:10:57
| 2018-12-10T07:21:46
|
C
|
UTF-8
|
C
| false
| false
| 454
|
h
|
ctype.h
|
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2008-08-14 Bernard the first version
*/
#ifndef __CTYPE_H__
#define __CTYPE_H__
int isprint(int c) __attribute__ ((__const__));
int isalpha (int c) __attribute__ ((__const__));
int isdigit (int ch) __attribute__ ((__const__));
int isspace(int ch) __attribute__ ((__const__));
#endif
|
188ae30e4b713c6517ab171952ac6eff36228321
|
392801bc4df0a7a34da162e48970b64314912e4f
|
/Exploitation/Writeups/ShellCode/OpCode/opcode.c
|
4113553f912493bd9b871d9becf50555f0df7b56
|
[] |
no_license
|
kablaa/CTF-Workshop
|
14401564cf21dfe4786c98a7eda4e321c0a10dee
|
461f434f7e81dd70c874b72ed3bc0f42e751d422
|
refs/heads/master
| 2022-10-21T08:59:57.033198
| 2022-10-02T21:25:19
| 2022-10-02T21:25:19
| 49,797,873
| 612
| 128
| null | 2022-10-02T21:25:20
| 2016-01-17T01:11:59
|
C
|
UTF-8
|
C
| false
| false
| 281
|
c
|
opcode.c
|
#include <stdio.h>
#include <stdio.h>
int x;
void func()
{
char buf[10];
puts("enter your name: ");
scanf("%s", buf);
printf("welcome %s, you are %d years old\n", buf,x);
}
int main()
{
puts("enter your age: ");
scanf("%d",&x);
func();
return 0;
}
|
4b4d4474f1a73ed517b7845710657dff0d96d118
|
76f9898ff7a555f4a729d725056a317af818375d
|
/assets/objects/object_zl4/object_zl4.c
|
3f84c74da81452c92bc474398777a234843b22b0
|
[] |
no_license
|
z64proto/sw97
|
0b65837ab2f2a4073faca5670761d7fe0e74d29d
|
f571505ade2cefd4a5b5d19da06d33e7c6b02c60
|
refs/heads/master
| 2023-08-01T02:47:42.895871
| 2022-05-15T20:29:08
| 2022-05-15T20:29:08
| 430,216,978
| 208
| 29
| null | 2021-11-22T12:23:50
| 2021-11-20T21:52:59
|
C
|
UTF-8
|
C
| false
| false
| 421,703
|
c
|
object_zl4.c
|
#include "ultra64.h"
#include "z64.h"
#include "macros.h"
#include "object_zl4.h"
static s16 sChildZeldaAnim_000654FrameData[756];
static JointIndex sChildZeldaAnim_000654JointIndices[18];
static Vtx sChildZeldaSkelVtx_0065B0[9];
static Vtx sChildZeldaSkelVtx_006640[23];
static Vtx sChildZeldaSkelVtx_0067B0[1];
static Vtx sChildZeldaSkelVtx_0067C0[10];
static Vtx sChildZeldaSkelVtx_006860[20];
static Vtx sChildZeldaSkelVtx_0069A0[8];
static Vtx sChildZeldaSkelVtx_006A20[10];
static Vtx sChildZeldaSkelVtx_006AC0[20];
static Vtx sChildZeldaSkelVtx_006C00[6];
static Vtx sChildZeldaSkelVtx_006C60[12];
static Vtx sChildZeldaSkelVtx_006D20[25];
static Vtx sChildZeldaSkelVtx_006EB0[3];
static Vtx sChildZeldaSkelVtx_006EE0[25];
static Vtx sChildZeldaSkelVtx_007070[12];
static Vtx sChildZeldaSkelVtx_007130[3];
static Vtx sChildZeldaSkelVtx_007160[30];
static Vtx sChildZeldaSkelVtx_007340[28];
static Vtx sChildZeldaSkelVtx_007500[27];
static Vtx object_zl4Vtx_0076B0[23];
static Vtx object_zl4Vtx_007820[10];
static Vtx object_zl4Vtx_0078C0[24];
static Vtx object_zl4Vtx_007A40[32];
static Vtx object_zl4Vtx_007C40[29];
static Vtx object_zl4Vtx_007E10[10];
static Vtx sChildZeldaSkelVtx_007EB0[10];
static Vtx sChildZeldaSkelVtx_007F50[18];
static Vtx sChildZeldaSkelVtx_008070[28];
static Vtx sChildZeldaSkelVtx_008230[22];
static Vtx sChildZeldaSkelVtx_008390[17];
static Vtx sChildZeldaSkelVtx_0084A0[23];
static Vtx sChildZeldaSkelVtx_008610[28];
static Vtx sChildZeldaSkelVtx_0087D0[26];
static Vtx sChildZeldaSkelVtx_008970[19];
static Vtx sChildZeldaSkelVtx_008AA0[5];
static Vtx sChildZeldaSkelVtx_008AF0[12];
static Vtx sChildZeldaSkelVtx_008BB0[28];
static Vtx sChildZeldaSkelVtx_008D70[8];
static Vtx sChildZeldaSkelVtx_008DF0[20];
static Vtx sChildZeldaSkelVtx_008F30[8];
static Vtx sChildZeldaSkelVtx_008FB0[7];
static Vtx sChildZeldaSkelVtx_009020[20];
static Vtx sChildZeldaSkelVtx_009160[31];
static Vtx sChildZeldaSkelVtx_009350[4];
static Vtx sChildZeldaSkelVtx_009390[5];
static Vtx sChildZeldaSkelVtx_0093E0[12];
static Vtx sChildZeldaSkelVtx_0094A0[28];
static Vtx sChildZeldaSkelVtx_009660[8];
static Vtx sChildZeldaSkelVtx_0096E0[20];
static Vtx sChildZeldaSkelVtx_009820[8];
static Vtx sChildZeldaSkelVtx_0098A0[7];
static Vtx sChildZeldaSkelVtx_009910[21];
static Vtx sChildZeldaSkelVtx_009A60[27];
static Vtx sChildZeldaSkelVtx_009C10[7];
static Vtx sChildZeldaSkelVtx_009C80[27];
static Vtx sChildZeldaSkelVtx_009E30[30];
static Vtx sChildZeldaSkelVtx_00A010[29];
static Vtx sChildZeldaSkelVtx_00A1E0[31];
static Vtx sChildZeldaSkelVtx_00A3D0[28];
static Vtx sChildZeldaSkelVtx_00A590[10];
static Vtx object_zl4Vtx_00DCB8[21];
static void* sChildZeldaSkelLimbs[17];
static s16 sChildZeldaAnim_00E5C8FrameData[646];
static JointIndex sChildZeldaAnim_00E5C8JointIndices[18];
static s16 sChildZeldaAnim_00EBC4FrameData[700];
static JointIndex sChildZeldaAnim_00EBC4JointIndices[18];
static s16 sChildZeldaAnim_00F0A4FrameData[556];
static JointIndex sChildZeldaAnim_00F0A4JointIndices[18];
static s16 sChildZeldaAnim_00F894FrameData[948];
static JointIndex sChildZeldaAnim_00F894JointIndices[18];
static s16 sChildZeldaAnim_010DF8FrameData[2670];
static JointIndex sChildZeldaAnim_010DF8JointIndices[18];
static s16 sChildZeldaAnim_011248FrameData[486];
static JointIndex sChildZeldaAnim_011248JointIndices[18];
static s16 sChildZeldaAnim_011698FrameData[486];
static JointIndex sChildZeldaAnim_011698JointIndices[18];
static s16 sChildZeldaAnim_011B34FrameData[524];
static JointIndex sChildZeldaAnim_011B34JointIndices[18];
static s16 sChildZeldaAnim_0125E4FrameData[1300];
static JointIndex sChildZeldaAnim_0125E4JointIndices[18];
static s16 sChildZeldaAnim_012E58FrameData[1014];
static JointIndex sChildZeldaAnim_012E58JointIndices[18];
static s16 sChildZeldaAnim_013280FrameData[466];
static JointIndex sChildZeldaAnim_013280JointIndices[18];
static s16 sChildZeldaAnim_013628FrameData[406];
static JointIndex sChildZeldaAnim_013628JointIndices[18];
static s16 sChildZeldaAnim_013A50FrameData[466];
static JointIndex sChildZeldaAnim_013A50JointIndices[18];
static s16 sChildZeldaAnim_013EA0FrameData[490];
static JointIndex sChildZeldaAnim_013EA0JointIndices[18];
static s16 sChildZeldaAnim_015F14FrameData[4092];
static JointIndex sChildZeldaAnim_015F14JointIndices[18];
static s16 sChildZeldaAnim_0169B4FrameData[1292];
static JointIndex sChildZeldaAnim_0169B4JointIndices[18];
static s16 sChildZeldaAnim_016D08FrameData[358];
static JointIndex sChildZeldaAnim_016D08JointIndices[18];
static s16 sChildZeldaAnim_01726CFrameData[624];
static JointIndex sChildZeldaAnim_01726CJointIndices[18];
static s16 sChildZeldaAnim_017818FrameData[662];
static JointIndex sChildZeldaAnim_017818JointIndices[18];
static s16 sChildZeldaAnim_01805CFrameData[992];
static JointIndex sChildZeldaAnim_01805CJointIndices[18];
static s16 sChildZeldaAnim_018898FrameData[990];
static JointIndex sChildZeldaAnim_018898JointIndices[18];
static s16 sChildZeldaAnim_01910CFrameData[1016];
static JointIndex sChildZeldaAnim_01910CJointIndices[18];
static s16 sChildZeldaAnim_019600FrameData[570];
static JointIndex sChildZeldaAnim_019600JointIndices[18];
static s16 sChildZeldaAnim_01991CFrameData[336];
static JointIndex sChildZeldaAnim_01991CJointIndices[18];
static s16 sChildZeldaAnim_01A2FCFrameData[1200];
static JointIndex sChildZeldaAnim_01A2FCJointIndices[18];
static s16 sChildZeldaAnim_01AAE0FrameData[946];
static JointIndex sChildZeldaAnim_01AAE0JointIndices[18];
static s16 sChildZeldaAnim_01AE88FrameData[406];
static JointIndex sChildZeldaAnim_01AE88JointIndices[18];
static s16 sChildZeldaAnim_01B874FrameData[1204];
static JointIndex sChildZeldaAnim_01B874JointIndices[18];
static s16 sChildZeldaAnim_01BCF0FrameData[506];
static JointIndex sChildZeldaAnim_01BCF0JointIndices[18];
static s16 sChildZeldaAnim_01C494FrameData[916];
static JointIndex sChildZeldaAnim_01C494JointIndices[18];
static s16 sChildZeldaAnim_01C7B0FrameData[330];
static JointIndex sChildZeldaAnim_01C7B0JointIndices[18];
static s16 sChildZeldaAnim_01CE08FrameData[750];
static JointIndex sChildZeldaAnim_01CE08JointIndices[18];
static s16 sChildZeldaAnim_000654FrameData[756] = {
0x0000, 0x09DB, 0x000E, 0xC000, 0x4000, 0x09DB, 0x09D9, 0x09D6, 0x09D3, 0x09CF, 0x09CC, 0x09C9, 0x09C6, 0x09C5,
0x09C4, 0x09C4, 0x09C5, 0x09C5, 0x09C6, 0x09C7, 0x09C8, 0x09C9, 0x09CB, 0x09CC, 0x09CE, 0x09D0, 0x09D1, 0x09D3,
0x09D5, 0x09D6, 0x09D8, 0x09D9, 0x09DB, 0x09DC, 0x09DD, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014,
0x0015, 0x0016, 0x0017, 0x0017, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0017, 0x0016, 0x0015,
0x0014, 0x0012, 0x0010, 0x000E, 0x000C, 0x000A, 0x0007, 0x0003, 0x0000, 0xBF14, 0xBF14, 0xBF14, 0xBF15, 0xBF15,
0xBF16, 0xBF16, 0xBF16, 0xBF16, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17, 0xBF17,
0xBF16, 0xBF16, 0xBF16, 0xBF15, 0xBF15, 0xBF14, 0xBF13, 0xBF12, 0xBF11, 0xBF10, 0xBF0F, 0x0040, 0x0045, 0x004B,
0x0051, 0x0056, 0x005B, 0x0060, 0x0064, 0x0068, 0x006B, 0x006E, 0x0070, 0x0072, 0x0073, 0x0073, 0x0073, 0x0072,
0x006F, 0x006C, 0x0068, 0x0063, 0x005D, 0x0056, 0x004D, 0x0044, 0x0039, 0x002D, 0x001F, 0x0010, 0x0000, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000,
0x0000, 0xF6D4, 0xF67B, 0xF611, 0xF59F, 0xF52E, 0xF4C5, 0xF46B, 0xF424, 0xF3F5, 0xF3E4, 0xF3E8, 0xF3F2, 0xF403,
0xF41A, 0xF437, 0xF458, 0xF47F, 0xF4A9, 0xF4D7, 0xF508, 0xF53B, 0xF571, 0xF5A8, 0xF5E0, 0xF618, 0xF650, 0xF686,
0xF6B9, 0xF6E9, 0xF714, 0x0C7C, 0x0D17, 0x0DD2, 0x0E9A, 0x0F5F, 0x1015, 0x10B3, 0x112F, 0x1180, 0x119D, 0x1196,
0x1183, 0x1165, 0x113C, 0x110A, 0x10CF, 0x108C, 0x1043, 0x0FF3, 0x0F9D, 0x0F44, 0x0EE7, 0x0E87, 0x0E27, 0x0DC6,
0x0D67, 0x0D0B, 0x0CB4, 0x0C63, 0x0C1B, 0xF6FA, 0xF6A2, 0xF638, 0xF5C7, 0xF557, 0xF4F0, 0xF496, 0xF44F, 0xF421,
0xF410, 0xF413, 0xF41E, 0xF42F, 0xF445, 0xF462, 0xF483, 0xF4A9, 0xF4D3, 0xF501, 0xF531, 0xF565, 0xF59A, 0xF5D1,
0xF608, 0xF640, 0xF677, 0xF6AC, 0xF6DF, 0xF70E, 0xF739, 0x0CA0, 0x0D3A, 0x0DF3, 0x0EB9, 0x0F7D, 0x1032, 0x10CF,
0x114A, 0x119A, 0x11B7, 0x11B0, 0x119D, 0x117F, 0x1156, 0x1124, 0x10EA, 0x10A8, 0x105F, 0x100F, 0x0FBB, 0x0F62,
0x0F06, 0x0EA7, 0x0E47, 0x0DE8, 0x0D8A, 0x0D2F, 0x0CD9, 0x0C89, 0x0C42, 0x000A, 0x0026, 0x004F, 0x0080, 0x00B6,
0x00EC, 0x011D, 0x0146, 0x0162, 0x016C, 0x0169, 0x0162, 0x0156, 0x0146, 0x0133, 0x011D, 0x0106, 0x00EC, 0x00D1,
0x00B6, 0x009B, 0x0080, 0x0067, 0x004F, 0x0039, 0x0026, 0x0016, 0x000A, 0x0003, 0x0000, 0xFF5D, 0xFF3F, 0xFF27,
0xFF12, 0xFF01, 0xFEF2, 0xFEE6, 0xFEDE, 0xFED8, 0xFED6, 0xFED5, 0xFED5, 0xFED5, 0xFED6, 0xFED7, 0xFED8, 0xFEDA,
0xFEDD, 0xFEE1, 0xFEE6, 0xFEEC, 0xFEF3, 0xFEFB, 0xFF06, 0xFF12, 0xFF21, 0xFF34, 0xFF4C, 0xFF6B, 0xFF98, 0xF4E4,
0xF4E4, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2,
0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E2, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E3, 0xF4E4, 0xF4E4, 0xF4E4,
0xF4E4, 0x8131, 0x81B7, 0x8230, 0x829F, 0x8305, 0x835F, 0x83AB, 0x83E8, 0x8412, 0x8426, 0x842B, 0x842C, 0x8428,
0x8420, 0x8413, 0x8401, 0x83EB, 0x83CF, 0x83AE, 0x8388, 0x835C, 0x8329, 0x82F0, 0x82AE, 0x8264, 0x820F, 0x81AD,
0x8138, 0x80A7, 0x7FE1, 0xFB14, 0xFA2E, 0xF971, 0xF8D2, 0xF84C, 0xF7DC, 0xF782, 0xF73F, 0xF713, 0xF701, 0xF6FE,
0xF6FD, 0xF6FE, 0xF702, 0xF709, 0xF715, 0xF726, 0xF73C, 0xF758, 0xF77C, 0xF7A9, 0xF7DF, 0xF821, 0xF871, 0xF8D1,
0xF946, 0xF9D6, 0xFA8C, 0xFB7C, 0xFCDB, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFE9, 0xFFA8, 0xFF43, 0xFEC1, 0xFE28, 0xFD7F, 0xFCCD,
0xFC17, 0xFB64, 0xFABC, 0xFA23, 0xF9A1, 0xF93C, 0xF8FB, 0xF8E4, 0xF8FB, 0xF93C, 0xF9A1, 0xFA23, 0xFABC, 0xFB64,
0xFC17, 0xFCCD, 0xFD7F, 0xFE28, 0xFEC1, 0xFF43, 0xFFA8, 0xFFE9, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF36E, 0xF382, 0xF394,
0xF3A5, 0xF3B4, 0xF3C1, 0xF3CC, 0xF3D5, 0xF3DA, 0xF3DD, 0xF3DD, 0xF3DE, 0xF3DD, 0xF3DD, 0xF3DB, 0xF3DA, 0xF3D7,
0xF3D4, 0xF3D0, 0xF3CC, 0xF3C6, 0xF3BF, 0xF3B7, 0xF3AE, 0xF3A3, 0xF396, 0xF387, 0xF376, 0xF363, 0xF34B, 0x0C79,
0x0C8D, 0x0C9F, 0x0CAF, 0x0CBE, 0x0CCA, 0x0CD4, 0x0CDC, 0x0CE1, 0x0CE3, 0x0CE3, 0x0CE3, 0x0CE3, 0x0CE3, 0x0CE2,
0x0CE1, 0x0CDF, 0x0CDC, 0x0CD9, 0x0CD5, 0x0CD0, 0x0CCA, 0x0CC3, 0x0CBA, 0x0CB0, 0x0CA4, 0x0C96, 0x0C85, 0x0C71,
0x0C58, 0x8304, 0x8359, 0x83AF, 0x8403, 0x8453, 0x849D, 0x84DD, 0x8511, 0x8536, 0x8547, 0x854C, 0x854D, 0x8549,
0x8542, 0x8536, 0x8525, 0x8511, 0x84F8, 0x84DB, 0x84B9, 0x8493, 0x8468, 0x8438, 0x8403, 0x83C7, 0x8386, 0x833E,
0x82ED, 0x8293, 0x822D, 0xF6DC, 0xF659, 0xF5E3, 0xF579, 0xF51C, 0xF4CC, 0xF48A, 0xF458, 0xF437, 0xF42A, 0xF427,
0xF426, 0xF427, 0xF42A, 0xF430, 0xF439, 0xF445, 0xF456, 0xF46B, 0xF486, 0xF4A7, 0xF4CE, 0xF4FE, 0xF536, 0xF578,
0xF5C7, 0xF623, 0xF690, 0xF712, 0xF7AE, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0018, 0x0059, 0x00BE, 0x0140, 0x01D9, 0x0282, 0x0334,
0x03EA, 0x049C, 0x0545, 0x05DE, 0x065F, 0x06C4, 0x0705, 0x071C, 0x0705, 0x06C4, 0x065F, 0x05DD, 0x0544, 0x049C,
0x03E9, 0x0333, 0x0281, 0x01D8, 0x013F, 0x00BD, 0x0058, 0x0017, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0014, 0x004C, 0x009D,
0x0100, 0x016C, 0x01D8, 0x023B, 0x028C, 0x02C4, 0x02D8, 0x02D8, 0x02D8, 0x02D8, 0x02D8, 0x02D8, 0x02D8, 0x02D8,
0x02D8, 0x02D8, 0x02D8, 0x02C4, 0x028C, 0x023B, 0x01D8, 0x016C, 0x0100, 0x009D, 0x004C, 0x0014, 0x0000, 0x0000,
};
static JointIndex sChildZeldaAnim_000654JointIndices[18] = {
{ 0x0000, 0x0005, 0x0023 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0041, 0x005F, 0x0003 },
{ 0x0000, 0x007D, 0x009B },
{ 0x0000, 0x0000, 0x00B9 },
{ 0x0000, 0x0000, 0x00D7 },
{ 0x0000, 0x0000, 0x00F5 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0004, 0x0113, 0x0004 },
{ 0x0131, 0x014F, 0x016D },
{ 0x0000, 0x0000, 0x018B },
{ 0x01A9, 0x01C7, 0x01E5 },
{ 0x0203, 0x0221, 0x023F },
{ 0x0000, 0x0000, 0x025D },
{ 0x027B, 0x0299, 0x02B7 },
{ 0x0000, 0x0000, 0x02D5 },
};
AnimationHeader gChildZeldaAnim_000654 = { { 30 }, sChildZeldaAnim_000654FrameData, sChildZeldaAnim_000654JointIndices, 5 };
static u8 unaccounted_000664[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
u64 sChildZeldaSkelTex_000670[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000670.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_000870[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000870.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_000A70[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000A70.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_000C70[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000C70.ci8.inc.c"
};
u64 sChildZeldaSkelTex_000CB0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000CB0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_000DB0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_000DB0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0015B0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0015B0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_001630[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_001630.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_0016B0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0016B0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0017B0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0017B0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0017F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0017F0.ci8.inc.c"
};
u64 object_zl4Tex_001BF0[] = {
#include "assets/objects/object_zl4//object_zl4Tex_001BF0.rgb5a1.inc.c"
};
u64 object_zl4Tex_001CF0[] = {
#include "assets/objects/object_zl4//object_zl4Tex_001CF0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_001DF0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_001DF0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_001E30[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_001E30.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_002230[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_002230.ci8.inc.c"
};
u64 sChildZeldaSkelTex_002270[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_002270.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0022F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0022F0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0024F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0024F0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_0026F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0026F0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_0028F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0028F0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_002970[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_002970.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_0029F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0029F0.rgb5a1.inc.c"
};
u64 gChildZeldaEyeOpenTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_open.i8.inc.c"
};
u64 gChildZeldaEyeBlinkTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_blink.i8.inc.c"
};
u64 gChildZeldaEyeShutTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_shut.i8.inc.c"
};
u64 gChildZeldaEyeWideTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_wide.i8.inc.c"
};
u64 gChildZeldaEyeSquintTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_squint.i8.inc.c"
};
u64 gChildZeldaEyeOutTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_out.i8.inc.c"
};
u64 gChildZeldaEyeInTex[] = {
#include "assets/objects/object_zl4/child_zelda_eye_in.i8.inc.c"
};
u64 gChildZeldaMouthNeutralTex[] = {
#include "assets/objects/object_zl4/child_zelda_mouth_neutral.i8.inc.c"
};
u64 gChildZeldaMouthHappyTex[] = {
#include "assets/objects/object_zl4/child_zelda_mouth_happy.i8.inc.c"
};
u64 gChildZeldaMouthWorriedTex[] = {
#include "assets/objects/object_zl4/child_zelda_mouth_worried.i8.inc.c"
};
u64 gChildZeldaMouthSurprisedTex[] = {
#include "assets/objects/object_zl4/child_zelda_mouth_surprised.i8.inc.c"
};
u64 sChildZeldaSkelTex_0056F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0056F0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_0058F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0058F0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_0059F0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_0059F0.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_005A70[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_005A70.rgb5a1.inc.c"
};
u64 sChildZeldaSkelTex_005C70[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_005C70.ci8.inc.c"
};
u64 sChildZeldaSkelTex_005CB0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_005CB0.ci8.inc.c"
};
u64 sChildZeldaSkelTex_005DB0[] = {
#include "assets/objects/object_zl4//sChildZeldaSkelTex_005DB0.rgb5a1.inc.c"
};
static Vtx sChildZeldaSkelVtx_0065B0[9] = {
VTX(684, 988, 0, 889, 199, 231, 117, 0, 255),
VTX(684, 838, 425, 749, 199, 229, 84, 81, 255),
VTX(684, 280, 811, 523, 199, 229, 11, 116, 255),
VTX(684, -354, 541, 262, 199, 242, 183, 93, 255),
VTX(684, -354, -544, 1515, 199, 242, 183, 163, 255),
VTX(684, 280, -814, 1256, 199, 229, 11, 140, 255),
VTX(684, 838, -429, 1030, 199, 229, 84, 175, 255),
VTX(684, -595, 0, 0, 199, 2, 137, 0, 255),
VTX(684, -595, 0, 1779, 199, 2, 137, 0, 255),
};
static Vtx sChildZeldaSkelVtx_006640[23] = {
VTX(364, 1252, 0, 889, 245, 194, 102, 0, 255),
VTX(364, 952, 600, 723, 245, 200, 79, 69, 255),
VTX(364, 1252, 0, 889, 245, 194, 102, 0, 255),
VTX(364, 333, 1011, 522, 245, 198, 26, 101, 255),
VTX(364, 333, 1011, 522, 245, 198, 26, 101, 255),
VTX(364, 952, 600, 723, 245, 200, 79, 69, 255),
VTX(364, -357, 696, 294, 245, 217, 188, 90, 255),
VTX(364, -357, 696, 294, 245, 217, 188, 90, 255),
VTX(364, 333, 1011, 522, 245, 198, 26, 101, 255),
VTX(364, -700, 0, 0, 245, 228, 140, 0, 255),
VTX(364, -700, 0, 0, 245, 228, 140, 0, 255),
VTX(364, -357, 696, 294, 245, 217, 188, 90, 255),
VTX(364, -357, -699, 1483, 245, 217, 188, 166, 255),
VTX(364, -700, 0, 1779, 245, 228, 140, 0, 255),
VTX(364, -700, 0, 1779, 245, 228, 140, 0, 255),
VTX(364, 333, -1014, 1257, 245, 198, 26, 155, 255),
VTX(364, -357, -699, 1483, 245, 217, 188, 166, 255),
VTX(364, -357, -699, 1483, 245, 217, 188, 166, 255),
VTX(364, 952, -603, 1056, 245, 201, 79, 187, 255),
VTX(364, 333, -1014, 1257, 245, 198, 26, 155, 255),
VTX(364, 333, -1014, 1257, 245, 198, 26, 155, 255),
VTX(364, 1252, 0, 889, 245, 194, 102, 0, 255),
VTX(364, 952, -603, 1056, 245, 201, 79, 187, 255),
};
static Vtx sChildZeldaSkelVtx_0067B0[1] = {
VTX(364, 1252, 0, 889, 245, 194, 102, 0, 255),
};
static Vtx sChildZeldaSkelVtx_0067C0[10] = {
VTX(869, 847, 0, 889, 112, 222, 114, 0, 255),
VTX(869, 697, -341, 1026, 112, 230, 96, 190, 255),
VTX(869, 697, 337, 753, 112, 231, 91, 73, 255),
VTX(869, 227, 650, 520, 112, 239, 7, 118, 255),
VTX(869, 227, -653, 1259, 112, 239, 7, 138, 255),
VTX(869, -499, 299, 141, 112, 244, 170, 82, 255),
VTX(869, -499, 299, 6, 542, 244, 170, 82, 255),
VTX(869, -599, 0, 660, 1381, 243, 137, 0, 255),
VTX(869, -499, -299, 1637, 112, 243, 170, 174, 255),
VTX(869, -499, -299, 6, 542, 243, 170, 174, 255),
};
static Vtx sChildZeldaSkelVtx_006860[20] = {
VTX(684, 988, 0, 889, 199, 231, 117, 0, 255),
VTX(684, 838, 425, 749, 199, 229, 84, 81, 255),
VTX(684, 988, 0, 889, 199, 231, 117, 0, 255),
VTX(684, 280, 811, 523, 199, 229, 11, 116, 255),
VTX(684, 838, 425, 749, 199, 229, 84, 81, 255),
VTX(684, 838, 425, 749, 199, 229, 84, 81, 255),
VTX(684, -354, 541, 262, 199, 242, 183, 93, 255),
VTX(684, -354, 541, 262, 199, 242, 183, 93, 255),
VTX(684, 280, 811, 523, 199, 229, 11, 116, 255),
VTX(684, -595, 0, 0, 199, 2, 137, 0, 255),
VTX(684, -354, 541, 262, 199, 242, 183, 93, 255),
VTX(181, -593, 0, 0, 137, 0, 137, 0, 255),
VTX(684, -595, 0, 0, 199, 2, 137, 0, 255),
VTX(684, -595, 0, 1779, 199, 2, 137, 0, 255),
VTX(181, -593, 0, 1779, 137, 0, 137, 0, 255),
VTX(684, -354, -544, 1515, 199, 242, 183, 163, 255),
VTX(684, -595, 0, 1779, 199, 2, 137, 0, 255),
VTX(684, 280, -814, 1256, 199, 229, 11, 140, 255),
VTX(684, -354, -544, 1515, 199, 242, 183, 163, 255),
VTX(684, -354, -544, 1515, 199, 242, 183, 163, 255),
};
static Vtx sChildZeldaSkelVtx_0069A0[8] = {
VTX(684, 838, -429, 1030, 199, 229, 84, 175, 255),
VTX(684, 838, -429, 1030, 199, 229, 84, 175, 255),
VTX(684, 280, -814, 1256, 199, 229, 11, 140, 255),
VTX(684, 988, 0, 889, 199, 231, 117, 0, 255),
VTX(684, 838, -429, 1030, 199, 229, 84, 175, 255),
VTX(684, 988, 0, 889, 199, 231, 117, 0, 255),
VTX(181, -593, 0, -20, 1896, 3, 137, 0, 255),
VTX(181, -593, 0, -20, 1896, 3, 137, 0, 255),
};
static Vtx sChildZeldaSkelVtx_006A20[10] = {
VTX(539, 147, 528, 496, 4, 223, 9, 114, 255),
VTX(539, 484, 307, 715, 4, 201, 82, 67, 255),
VTX(539, 484, -307, 1063, 4, 201, 82, 189, 255),
VTX(539, 147, -528, 1283, 4, 223, 9, 142, 255),
VTX(539, -353, 299, 180, 4, 235, 176, 85, 255),
VTX(539, -353, -299, 1598, 4, 235, 176, 171, 255),
VTX(539, -353, 299, -25, 650, 235, 176, 85, 255),
VTX(539, -503, 0, 1046, 696, 223, 141, 0, 255),
VTX(539, 584, 0, 889, 4, 181, 93, 0, 255),
VTX(539, -353, -299, -25, 650, 235, 176, 171, 255),
};
static Vtx sChildZeldaSkelVtx_006AC0[20] = {
VTX(869, -499, 299, 141, 112, 244, 170, 82, 255),
VTX(869, 847, 0, 889, 112, 222, 114, 0, 255),
VTX(869, 697, -341, 1026, 112, 230, 91, 183, 255),
VTX(869, 697, 337, 753, 112, 231, 91, 73, 255),
VTX(869, -499, 299, 141, 112, 244, 170, 82, 255),
VTX(869, 227, 650, 520, 112, 239, 7, 118, 255),
VTX(869, 697, 337, 753, 112, 231, 91, 73, 255),
VTX(869, 227, 650, 520, 112, 239, 7, 118, 255),
VTX(869, 697, 337, 753, 112, 231, 91, 73, 255),
VTX(869, 697, 337, 753, 112, 231, 91, 73, 255),
VTX(869, 847, 0, 889, 112, 222, 114, 0, 255),
VTX(869, 847, 0, 889, 112, 227, 115, 247, 255),
VTX(869, 697, -341, 1026, 112, 230, 96, 190, 255),
VTX(869, 697, -341, 1026, 112, 230, 91, 183, 255),
VTX(869, 227, -653, 1259, 112, 239, 7, 138, 255),
VTX(869, 697, -341, 1026, 112, 230, 91, 183, 255),
VTX(869, 227, -653, 1259, 112, 239, 7, 138, 255),
VTX(869, -499, -299, 1637, 112, 243, 170, 174, 255),
VTX(869, 697, -341, 1026, 112, 230, 91, 183, 255),
VTX(869, -499, -299, 1637, 112, 243, 170, 174, 255),
};
static Vtx sChildZeldaSkelVtx_006C00[6] = {
VTX(869, -599, 0, 969, 2485, 243, 137, 0, 255),
VTX(869, -499, 299, -31, 2456, 244, 170, 82, 255),
VTX(869, -499, 299, -31, 2456, 244, 170, 82, 255),
VTX(869, -499, -299, -31, 2456, 243, 170, 174, 255),
VTX(869, -599, 0, 969, 2485, 243, 137, 0, 255),
VTX(869, -499, -299, -31, 2456, 243, 170, 174, 255),
};
static Vtx sChildZeldaSkelVtx_006C60[12] = {
VTX(769, 90, 137, -159, 282, 228, 17, 115, 255),
VTX(115, -149, 60, 170, -853, 17, 147, 46, 255),
VTX(749, -49, 3, 170, 241, 210, 167, 191, 255),
VTX(117, 113, 221, -341, -821, 13, 66, 98, 255),
VTX(761, 208, -57, 349, 266, 1, 104, 59, 255),
VTX(89, 292, -120, 465, -582, 8, 106, 54, 255),
VTX(117, 113, 221, 182, -587, 13, 66, 98, 255),
VTX(749, -49, 3, 85, 256, 210, 167, 191, 255),
VTX(115, -149, 60, 85, 1351, 17, 147, 46, 255),
VTX(124, 110, -165, 656, 1249, 7, 185, 161, 255),
VTX(771, 96, -87, 370, 175, 234, 196, 155, 255),
VTX(769, 90, 137, 182, 256, 228, 17, 115, 255),
};
static Vtx sChildZeldaSkelVtx_006D20[25] = {
VTX(1094, 107, -118, 591, 237, 84, 172, 255, 255),
VTX(1088, 213, 20, 471, 256, 42, 93, 61, 255),
VTX(1096, 102, 167, 0, 256, 76, 37, 84, 255),
VTX(769, 90, 137, 598, -208, 228, 17, 115, 255),
VTX(1095, -486, 85, 0, 256, 209, 159, 51, 255),
VTX(1093, -75, 248, 565, 256, 65, 52, 85, 255),
VTX(769, 90, 137, 640, 7, 228, 17, 115, 255),
VTX(1093, -75, 248, 0, 256, 65, 52, 85, 255),
VTX(941, 36, 206, 330, 256, 53, 218, 100, 255),
VTX(1092, -72, -209, 177, 918, 44, 0, 145, 255),
VTX(940, 41, -152, 471, 779, 43, 254, 145, 255),
VTX(941, 36, 206, -162, 91, 53, 218, 100, 255),
VTX(940, 41, -152, 578, 68, 43, 254, 145, 255),
VTX(1092, -72, -209, 424, 252, 44, 0, 145, 255),
VTX(1093, -75, 248, 420, 253, 65, 52, 85, 255),
VTX(769, 90, 137, 78, -78, 228, 17, 115, 255),
VTX(769, 90, 137, 305, -154, 228, 17, 115, 255),
VTX(749, -49, 3, 0, -104, 210, 167, 191, 255),
VTX(749, -49, 3, 360, -29, 210, 167, 191, 255),
VTX(940, 41, -152, 253, 256, 43, 254, 145, 255),
VTX(1092, -72, -209, 0, 256, 44, 0, 145, 255),
VTX(761, 208, -57, 660, -80, 1, 104, 59, 255),
VTX(1092, -72, -209, 651, 256, 44, 0, 145, 255),
VTX(749, -49, 3, 394, -244, 210, 167, 191, 255),
VTX(771, 96, -87, 466, 185, 234, 196, 155, 255),
};
static Vtx sChildZeldaSkelVtx_006EB0[3] = {
VTX(266, 0, 49, 0, 0, 245, 103, 59, 255),
VTX(266, 43, -25, 0, 0, 245, 103, 59, 255),
VTX(16, 0, 0, 0, 0, 245, 103, 59, 255),
};
static Vtx sChildZeldaSkelVtx_006EE0[25] = {
VTX(1096, 102, -167, 0, 256, 76, 37, 172, 255),
VTX(1088, 213, -20, 471, 256, 42, 93, 195, 255),
VTX(1094, 107, 118, 591, 237, 84, 172, 1, 255),
VTX(1093, -75, -248, 565, 256, 65, 52, 171, 255),
VTX(1095, -486, -85, 0, 256, 209, 159, 205, 255),
VTX(769, 90, -137, 598, -208, 228, 17, 141, 255),
VTX(941, 36, -206, 330, 256, 53, 218, 156, 255),
VTX(1093, -75, -248, 0, 256, 65, 52, 171, 255),
VTX(769, 90, -137, 640, 7, 228, 17, 141, 255),
VTX(940, 41, 152, 471, 779, 43, 254, 111, 255),
VTX(1092, -72, 209, 177, 918, 44, 0, 111, 255),
VTX(940, 41, 152, 578, 68, 43, 254, 111, 255),
VTX(941, 36, -206, -162, 91, 53, 218, 156, 255),
VTX(1093, -75, -248, 420, 253, 65, 52, 171, 255),
VTX(1092, -72, 209, 424, 252, 44, 0, 111, 255),
VTX(769, 90, -137, 78, -78, 228, 17, 141, 255),
VTX(749, -49, -3, 0, -104, 210, 167, 65, 255),
VTX(769, 90, -137, 305, -154, 228, 17, 141, 255),
VTX(1092, -72, 209, 0, 256, 44, 0, 111, 255),
VTX(940, 41, 152, 253, 256, 43, 254, 111, 255),
VTX(749, -49, -3, 360, -29, 210, 167, 65, 255),
VTX(761, 208, 57, 660, -80, 1, 104, 197, 255),
VTX(749, -49, -3, 394, -244, 210, 167, 65, 255),
VTX(1092, -72, 209, 651, 256, 44, 0, 111, 255),
VTX(771, 96, 87, 466, 185, 234, 196, 101, 255),
};
static Vtx sChildZeldaSkelVtx_007070[12] = {
VTX(749, -49, -3, 170, 241, 210, 167, 65, 255),
VTX(115, -149, -60, 170, -853, 17, 147, 210, 255),
VTX(769, 90, -137, -159, 282, 228, 17, 141, 255),
VTX(117, 113, -221, -341, -821, 13, 66, 158, 255),
VTX(117, 113, -221, 182, -587, 13, 66, 158, 255),
VTX(89, 292, 120, 465, -582, 8, 106, 202, 255),
VTX(761, 208, 57, 349, 266, 1, 104, 197, 255),
VTX(124, 110, 165, 656, 1249, 7, 185, 95, 255),
VTX(115, -149, -60, 85, 1351, 17, 147, 210, 255),
VTX(749, -49, -3, 85, 256, 210, 167, 65, 255),
VTX(771, 96, 87, 370, 175, 234, 196, 101, 255),
VTX(769, 90, -137, 182, 256, 228, 17, 141, 255),
};
static Vtx sChildZeldaSkelVtx_007130[3] = {
VTX(16, 0, 0, 0, 0, 245, 103, 197, 255),
VTX(266, 43, 24, 0, 0, 245, 103, 197, 255),
VTX(266, 0, -50, 0, 0, 245, 103, 197, 255),
};
static Vtx sChildZeldaSkelVtx_007160[30] = {
VTX(539, -353, 299, 180, 4, 235, 176, 85, 255),
VTX(539, 147, 528, 496, 4, 223, 9, 114, 255),
VTX(299, -34, 429, 389, -24, 212, 240, 110, 255),
VTX(539, 484, 307, 715, 4, 201, 82, 67, 255),
VTX(539, 584, 0, 889, 4, 181, 93, 0, 255),
VTX(263, 241, 377, 577, -28, 184, 70, 64, 255),
VTX(263, 241, -377, 1201, -28, 184, 70, 192, 255),
VTX(539, 484, -307, 1063, 4, 201, 82, 189, 255),
VTX(539, 147, -528, 1283, 4, 223, 9, 142, 255),
VTX(299, -34, -429, 1389, -24, 212, 240, 146, 255),
VTX(539, -353, -299, 1598, 4, 235, 176, 171, 255),
VTX(174, -398, 0, 8, 244, 0, 136, 0, 255),
VTX(178, -215, 332, 998, 265, 0, 218, 113, 255),
VTX(36, -215, 332, 999, 4, 0, 177, 89, 255),
VTX(31, -398, 0, 9, -16, 0, 136, 0, 255),
VTX(36, -215, -332, 999, 4, 0, 177, 167, 255),
VTX(178, -215, -332, 998, 265, 0, 218, 143, 255),
VTX(174, -398, 0, 8, 244, 0, 136, 0, 255),
VTX(31, -398, 0, 9, -16, 0, 136, 0, 255),
VTX(178, -215, 332, 0, 256, 0, 218, 113, 255),
VTX(23, 118, 327, 502, 12, 0, 43, 111, 255),
VTX(36, -215, 332, 7, 12, 0, 177, 89, 255),
VTX(166, 118, 327, 494, 255, 0, 84, 84, 255),
VTX(166, 118, 327, 0, 256, 0, 84, 84, 255),
VTX(157, 268, 0, 763, 256, 0, 120, 0, 255),
VTX(14, 268, 0, 770, 12, 0, 120, 0, 255),
VTX(23, 118, 327, 7, 12, 0, 43, 111, 255),
VTX(-163, -135, 0, 608, 773, 137, 247, 0, 255),
VTX(31, -398, 0, -28, 151, 160, 185, 0, 255),
VTX(36, -215, 332, 1096, 15, 155, 220, 52, 255),
};
static Vtx sChildZeldaSkelVtx_007340[28] = {
VTX(-163, -135, 0, 146, 777, 137, 247, 0, 255),
VTX(36, -215, 332, -2, 257, 155, 220, 52, 255),
VTX(23, 118, 327, 502, 260, 147, 22, 44, 255),
VTX(23, 118, 327, -9, 241, 147, 22, 44, 255),
VTX(14, 268, 0, 778, 237, 147, 48, 0, 255),
VTX(-163, -135, 0, 17, -778, 137, 247, 0, 255),
VTX(178, -215, 332, 463, 44, 213, 199, 96, 255),
VTX(539, -353, 299, -18, 401, 235, 176, 85, 255),
VTX(299, -34, 429, 13, -254, 212, 240, 110, 255),
VTX(174, -398, 0, 1137, 784, 221, 142, 0, 255),
VTX(539, -503, 0, 1046, 696, 223, 141, 0, 255),
VTX(539, -353, 299, -25, 650, 235, 176, 85, 255),
VTX(174, -398, 0, 987, -68, 221, 142, 0, 255),
VTX(299, -34, 429, -1, 107, 212, 240, 110, 255),
VTX(263, 241, 377, 0, 507, 192, 10, 100, 255),
VTX(166, 118, 327, 381, 377, 187, 4, 97, 255),
VTX(178, -215, 332, 544, -83, 213, 199, 96, 255),
VTX(263, 241, -377, 1115, 183, 184, 70, 192, 255),
VTX(157, 268, 0, 512, 123, 167, 80, 0, 255),
VTX(539, 584, 0, 512, 761, 181, 93, 0, 255),
VTX(263, 241, 377, -91, 183, 184, 70, 64, 255),
VTX(157, 268, 0, 1369, 280, 167, 80, 0, 255),
VTX(166, 118, 327, 17, -109, 160, 63, 31, 255),
VTX(263, 241, 377, 10, 461, 184, 70, 64, 255),
VTX(14, 268, 0, 770, 12, 0, 120, 0, 255),
VTX(157, 268, 0, 763, 256, 0, 120, 0, 255),
VTX(166, 118, -327, 0, 256, 0, 84, 172, 255),
VTX(23, 118, -327, 7, 12, 0, 43, 145, 255),
};
static Vtx sChildZeldaSkelVtx_007500[27] = {
VTX(36, -215, -332, 7, 12, 0, 177, 167, 255),
VTX(23, 118, -327, 502, 12, 0, 43, 145, 255),
VTX(178, -215, -332, 0, 256, 0, 218, 143, 255),
VTX(166, 118, -327, 494, 255, 0, 84, 172, 255),
VTX(-163, -135, 0, 17, -778, 137, 247, 0, 255),
VTX(14, 268, 0, 778, 237, 147, 48, 0, 255),
VTX(23, 118, -327, -9, 241, 147, 22, 212, 255),
VTX(23, 118, -327, 502, 260, 147, 22, 212, 255),
VTX(36, -215, -332, -2, 257, 155, 220, 204, 255),
VTX(-163, -135, 0, 146, 777, 137, 247, 0, 255),
VTX(36, -215, -332, 1096, 15, 155, 220, 204, 255),
VTX(31, -398, 0, -28, 151, 160, 185, 0, 255),
VTX(-163, -135, 0, 608, 773, 137, 247, 0, 255),
VTX(174, -398, 0, 987, -68, 221, 142, 0, 255),
VTX(539, -353, -299, -25, 650, 235, 176, 171, 255),
VTX(539, -503, 0, 1046, 696, 223, 141, 0, 255),
VTX(174, -398, 0, 1137, 784, 221, 142, 0, 255),
VTX(178, -215, -332, 463, 44, 213, 199, 160, 255),
VTX(539, -353, -299, -18, 401, 235, 176, 171, 255),
VTX(299, -34, -429, 13, -254, 212, 240, 146, 255),
VTX(299, -34, -429, -1, 107, 212, 240, 146, 255),
VTX(178, -215, -332, 544, -83, 213, 199, 160, 255),
VTX(166, 118, -327, 381, 377, 187, 4, 159, 255),
VTX(263, 241, -377, 0, 507, 192, 10, 156, 255),
VTX(263, 241, -377, 10, 461, 184, 70, 192, 255),
VTX(166, 118, -327, 17, -109, 160, 63, 225, 255),
VTX(157, 268, 0, 1369, 280, 167, 80, 0, 255),
};
static Vtx object_zl4Vtx_0076B0[23] = {
VTX(23, 118, -327, 502, 12, 201, 41, 158, 255),
VTX(166, 118, -327, 494, 255, 197, 54, 167, 255),
VTX(178, -215, -332, 0, 256, 192, 210, 166, 255),
VTX(23, 118, -327, 7, 12, 201, 41, 158, 255),
VTX(14, 268, 0, 770, 12, 211, 111, 0, 255),
VTX(166, 118, -327, 0, 256, 197, 54, 167, 255),
VTX(157, 268, 0, 763, 256, 179, 91, 0, 255),
VTX(166, 118, 327, 0, 256, 197, 54, 89, 255),
VTX(23, 118, 327, 7, 12, 201, 41, 98, 255),
VTX(178, -215, 332, 0, 256, 192, 210, 90, 255),
VTX(166, 118, 327, 494, 255, 197, 54, 89, 255),
VTX(23, 118, 327, 502, 12, 201, 41, 98, 255),
VTX(23, 118, -327, 502, 260, 201, 41, 158, 255),
VTX(36, -215, -332, -2, 257, 208, 186, 172, 255),
VTX(-163, -135, 0, 146, 777, 137, 247, 0, 255),
VTX(-163, -135, 0, 17, -778, 137, 247, 0, 255),
VTX(14, 268, 0, 778, 237, 211, 111, 0, 255),
VTX(23, 118, -327, -9, 241, 201, 41, 158, 255),
VTX(36, -215, -332, 7, 12, 208, 186, 172, 255),
VTX(23, 118, 327, -9, 241, 201, 41, 98, 255),
VTX(36, -215, 332, -2, 257, 208, 186, 84, 255),
VTX(23, 118, 327, 502, 260, 201, 41, 98, 255),
VTX(36, -215, 332, 7, 12, 208, 186, 84, 255),
};
static Vtx object_zl4Vtx_007820[10] = {
VTX(-163, -135, 0, 608, 773, 137, 247, 0, 255),
VTX(31, -398, 0, -28, 151, 200, 150, 0, 255),
VTX(36, -215, 332, 1096, 15, 208, 186, 84, 255),
VTX(36, -215, -332, 1096, 15, 208, 186, 172, 255),
VTX(174, -398, 0, 8, 244, 216, 144, 0, 255),
VTX(178, -215, 332, 998, 265, 192, 210, 90, 255),
VTX(36, -215, 332, 999, 4, 208, 186, 84, 255),
VTX(31, -398, 0, 9, -16, 200, 150, 0, 255),
VTX(36, -215, -332, 999, 4, 208, 186, 172, 255),
VTX(178, -215, -332, 998, 265, 192, 210, 166, 255),
};
static Vtx object_zl4Vtx_0078C0[24] = {
VTX(1421, 294, -897, 698, 512, 191, 28, 160, 255),
VTX(1827, 137, -1221, 0, 512, 191, 24, 159, 255),
VTX(636, -348, -551, 1437, -1425, 172, 228, 176, 255),
VTX(1827, 137, -1221, 1356, 512, 191, 24, 159, 255),
VTX(1553, -835, -1249, 0, 512, 177, 227, 172, 255),
VTX(636, -348, -551, 320, -1997, 172, 228, 176, 255),
VTX(636, -348, -551, 1301, -979, 172, 228, 176, 255),
VTX(1067, -918, -407, 1248, 512, 175, 173, 226, 255),
VTX(636, -348, -551, 1559, -888, 172, 228, 176, 255),
VTX(1067, -918, -407, 1665, 512, 175, 173, 226, 255),
VTX(583, -550, -11, 2522, -331, 172, 172, 0, 255),
VTX(1067, -918, -407, -694, 507, 175, 173, 226, 255),
VTX(1067, -918, 384, 675, 507, 175, 173, 30, 255),
VTX(583, -550, -11, 0, -512, 172, 172, 0, 255),
VTX(1067, -918, 384, 1665, 512, 175, 173, 30, 255),
VTX(636, -348, 529, 1559, -888, 172, 228, 80, 255),
VTX(1067, -918, 384, 1248, 512, 175, 173, 30, 255),
VTX(1553, -835, 1226, 0, 512, 177, 227, 84, 255),
VTX(636, -348, 529, 1301, -979, 172, 228, 80, 255),
VTX(636, -348, 529, 320, -1997, 172, 228, 80, 255),
VTX(1827, 137, 1199, 1356, 512, 191, 24, 97, 255),
VTX(636, -348, 529, 1437, -1425, 172, 228, 80, 255),
VTX(1827, 137, 1199, 0, 512, 191, 24, 97, 255),
VTX(1421, 294, 874, 698, 512, 191, 28, 96, 255),
};
static Vtx object_zl4Vtx_007A40[32] = {
VTX(283, 409, 438, 137, 124, 178, 79, 44, 255),
VTX(157, 268, 0, 736, -64, 179, 91, 0, 255),
VTX(166, 118, 327, 333, -121, 197, 54, 89, 255),
VTX(283, 409, -438, 1292, 97, 178, 79, 212, 255),
VTX(166, 118, -327, 1161, -141, 197, 54, 167, 255),
VTX(1075, 495, 832, -472, 1612, 214, 73, 84, 255),
VTX(966, 590, -1, 961, 912, 232, 117, 0, 255),
VTX(283, 409, 438, 593, 119, 178, 79, 44, 255),
VTX(283, 409, -438, 656, -564, 178, 79, 212, 255),
VTX(283, 409, 438, -412, -557, 178, 79, 44, 255),
VTX(966, 590, -1, 119, 2444, 232, 117, 0, 255),
VTX(283, 409, -438, 593, 119, 178, 79, 212, 255),
VTX(1075, 495, -832, -472, 1612, 214, 73, 172, 255),
VTX(712, 57, -835, -340, 986, 195, 24, 156, 255),
VTX(712, 57, 835, -340, 986, 195, 24, 100, 255),
VTX(178, -215, -332, 865, -490, 192, 210, 166, 255),
VTX(796, -789, -336, 55, 1179, 189, 162, 225, 255),
VTX(274, -557, -2, 269, -470, 172, 172, 0, 255),
VTX(796, -789, -336, 166, 1179, 189, 162, 225, 255),
VTX(796, -789, 336, 447, 1061, 189, 162, 31, 255),
VTX(274, -557, -2, 385, -578, 172, 172, 0, 255),
VTX(796, -789, 336, 55, 1179, 189, 162, 31, 255),
VTX(178, -215, 332, 865, -490, 192, 210, 90, 255),
VTX(713, -477, 1017, 7, 1171, 184, 231, 92, 255),
VTX(178, -215, 332, 426, 28, 192, 210, 90, 255),
VTX(796, -789, 336, -371, 765, 189, 162, 31, 255),
VTX(796, -789, -336, -371, 765, 189, 162, 225, 255),
VTX(178, -215, -332, 426, 28, 192, 210, 166, 255),
VTX(713, -477, -1017, 7, 1171, 184, 231, 164, 255),
VTX(713, -477, -1017, 87, 1104, 184, 231, 164, 255),
VTX(178, -215, -332, 477, 22, 192, 210, 166, 255),
VTX(712, 57, -835, 287, 1105, 195, 24, 156, 255),
};
static Vtx object_zl4Vtx_007C40[29] = {
VTX(178, -215, -332, 477, 22, 192, 210, 166, 255),
VTX(166, 118, -327, 574, 107, 197, 54, 167, 255),
VTX(712, 57, -835, 287, 1105, 195, 24, 156, 255),
VTX(712, 57, 835, 287, 1105, 195, 24, 100, 255),
VTX(166, 118, 327, 574, 107, 197, 54, 89, 255),
VTX(178, -215, 332, 477, 22, 192, 210, 90, 255),
VTX(713, -477, 1017, 87, 1104, 184, 231, 92, 255),
VTX(712, 57, 835, -111, -38, 195, 24, 100, 255),
VTX(1567, 342, 1051, 103, 138, 219, 28, 110, 255),
VTX(1075, 495, 832, 54, 31, 214, 73, 84, 255),
VTX(1720, -21, 1184, 44, 174, 224, 26, 112, 255),
VTX(713, -477, 1017, 298, -193, 184, 231, 92, 255),
VTX(1358, -815, 1222, 140, 103, 201, 208, 94, 255),
VTX(1720, -21, 1184, 209, 179, 224, 26, 112, 255),
VTX(712, 57, 835, 392, -254, 195, 24, 100, 255),
VTX(796, -789, 336, 46, 70, 189, 162, 31, 255),
VTX(1358, -815, 1222, 213, 111, 201, 208, 94, 255),
VTX(713, -477, 1017, 55, -215, 184, 231, 92, 255),
VTX(712, 57, -835, -111, -38, 195, 24, 156, 255),
VTX(1567, 342, -1051, 103, 138, 219, 28, 146, 255),
VTX(1720, -21, -1184, 44, 174, 224, 26, 144, 255),
VTX(713, -477, -1017, 298, -193, 184, 231, 164, 255),
VTX(712, 57, -835, 392, -254, 195, 24, 156, 255),
VTX(1720, -21, -1184, 209, 179, 224, 26, 144, 255),
VTX(1358, -815, -1222, 140, 103, 201, 208, 162, 255),
VTX(713, -477, -1017, 55, -215, 184, 231, 164, 255),
VTX(1358, -815, -1222, 213, 111, 201, 208, 162, 255),
VTX(796, -789, -336, 46, 70, 189, 162, 225, 255),
VTX(1075, 495, -832, 54, 31, 214, 73, 172, 255),
};
static Vtx object_zl4Vtx_007E10[10] = {
VTX(178, -215, 332, 117, 269, 192, 210, 90, 255),
VTX(174, -398, 0, 2, 253, 216, 144, 0, 255),
VTX(274, -557, -2, 7, 119, 172, 172, 0, 255),
VTX(178, -215, -332, 117, 269, 192, 210, 166, 255),
VTX(166, 118, 327, 285, -174, 197, 54, 89, 255),
VTX(712, 57, 835, 463, 1984, 195, 24, 100, 255),
VTX(283, 409, 438, 431, -37, 178, 79, 44, 255),
VTX(283, 409, -438, 431, -37, 178, 79, 212, 255),
VTX(712, 57, -835, 463, 1984, 195, 24, 156, 255),
VTX(166, 118, -327, 285, -174, 197, 54, 167, 255),
};
static Vtx sChildZeldaSkelVtx_007EB0[10] = {
VTX(810, 110, 0, 465, -206, 97, 70, 0, 255),
VTX(830, 39, 99, -138, 26, 100, 54, 36, 255),
VTX(830, 39, 99, 175, -192, 100, 54, 36, 255),
VTX(855, -62, 149, -114, -177, 109, 21, 44, 255),
VTX(855, -62, 149, -138, 26, 109, 21, 44, 255),
VTX(830, 39, -99, 175, -192, 100, 54, 220, 255),
VTX(830, 39, -99, 465, -206, 100, 54, 220, 255),
VTX(855, -62, -149, -114, -177, 109, 21, 212, 255),
VTX(855, -62, -149, -138, 26, 109, 21, 212, 255),
VTX(864, -254, 0, -204, -243, 96, 186, 0, 255),
};
static Vtx sChildZeldaSkelVtx_007F50[18] = {
VTX(-195, 98, 0, 427, -56, 175, 88, 0, 255),
VTX(-195, 98, 0, 465, -206, 175, 88, 0, 255),
VTX(-125, -64, 149, -138, 26, 183, 0, 94, 255),
VTX(-125, -64, 149, -138, 26, 183, 0, 94, 255),
VTX(-125, -64, 149, -138, 26, 183, 0, 94, 255),
VTX(-125, -252, 0, -204, -243, 177, 166, 0, 255),
VTX(-125, -252, 0, -235, 26, 177, 166, 0, 255),
VTX(-195, 98, 0, -138, 26, 175, 88, 0, 255),
VTX(-125, -64, -149, -138, 26, 183, 0, 162, 255),
VTX(-195, 98, 0, 427, -56, 175, 88, 0, 255),
VTX(-125, -64, -149, -138, 26, 183, 0, 162, 255),
VTX(-125, -252, 0, -204, -243, 177, 166, 0, 255),
VTX(-125, -64, -149, -138, 26, 183, 0, 162, 255),
VTX(-125, -252, 0, -235, 26, 177, 166, 0, 255),
VTX(651, 495, 121, 1024, 1024, 37, 114, 0, 255),
VTX(879, 420, 121, 1023, 0, 37, 114, 0, 255),
VTX(879, 420, -118, 0, 0, 37, 114, 0, 255),
VTX(651, 495, -118, 0, 1024, 37, 114, 0, 255),
};
static Vtx sChildZeldaSkelVtx_008070[28] = {
VTX(555, 504, 0, 217, 206, 37, 114, 0, 255),
VTX(555, 420, 221, 180, 181, 32, 95, 64, 255),
VTX(883, 396, 0, 233, 84, 62, 102, 0, 255),
VTX(721, 334, 255, 164, 120, 46, 70, 84, 255),
VTX(808, 168, 289, 147, 58, 52, 49, 95, 255),
VTX(458, 234, 377, 112, 176, 17, 47, 108, 255),
VTX(603, -87, 478, 47, 75, 240, 15, 117, 255),
VTX(342, -16, 418, 36, 173, 222, 0, 115, 255),
VTX(263, -150, 349, -14, 204, 230, 219, 110, 255),
VTX(24, -324, 280, -64, 235, 171, 229, 79, 255),
VTX(555, 420, -221, 180, 181, 32, 95, 192, 255),
VTX(721, 334, -255, 164, 120, 46, 70, 172, 255),
VTX(808, 168, -289, 147, 58, 52, 49, 161, 255),
VTX(458, 234, -377, 112, 176, 17, 47, 148, 255),
VTX(603, -87, -478, 47, 75, 240, 15, 139, 255),
VTX(342, -16, -418, 36, 173, 222, 0, 141, 255),
VTX(263, -150, -349, -14, 204, 230, 219, 146, 255),
VTX(24, -324, -280, -64, 235, 171, 229, 177, 255),
VTX(883, 396, 0, 119, 506, 101, 64, 0, 255),
VTX(1076, -6, 0, -20, 247, 119, 10, 0, 255),
VTX(962, 81, -203, 152, 309, 98, 33, 197, 255),
VTX(962, 81, 203, 152, 309, 98, 33, 59, 255),
VTX(862, -295, 392, 219, 123, 100, 222, 55, 255),
VTX(987, -438, 0, -80, 38, 107, 203, 0, 255),
VTX(862, -295, -392, 219, 123, 100, 222, 201, 255),
VTX(784, -668, 0, -64, -35, 73, 162, 0, 255),
VTX(701, -511, -458, 264, 42, 29, 153, 203, 255),
VTX(701, -511, 458, 264, 42, 29, 153, 53, 255),
};
static Vtx sChildZeldaSkelVtx_008230[22] = {
VTX(701, -511, 458, 180, -46, 29, 153, 53, 255),
VTX(-215, -768, 0, 1255, 1025, 10, 137, 0, 255),
VTX(784, -668, 0, 1110, -95, 73, 162, 0, 255),
VTX(-265, -518, 598, 4, 1019, 7, 146, 46, 255),
VTX(701, -511, -458, 180, -46, 29, 153, 203, 255),
VTX(-265, -518, -598, 4, 1019, 7, 146, 210, 255),
VTX(356, -96, -737, 676, -95, 51, 2, 148, 255),
VTX(-15, -10, -295, 223, 666, 185, 248, 161, 255),
VTX(273, 43, -391, -96, 129, 241, 29, 141, 255),
VTX(273, 43, 391, -96, 129, 241, 29, 115, 255),
VTX(-15, -10, 295, 223, 666, 185, 248, 95, 255),
VTX(356, -96, 737, 676, -95, 51, 2, 108, 255),
VTX(458, 234, -377, -55, 136, 243, 45, 146, 255),
VTX(342, -16, -418, 397, 106, 222, 0, 141, 255),
VTX(273, 43, -391, 307, 227, 241, 29, 141, 255),
VTX(38, 349, -280, -169, 699, 227, 74, 167, 255),
VTX(-14, 144, -310, 189, 629, 188, 7, 158, 255),
VTX(273, 43, 391, 307, 227, 241, 29, 115, 255),
VTX(342, -16, 418, 397, 106, 222, 0, 115, 255),
VTX(458, 234, 377, -55, 136, 243, 45, 110, 255),
VTX(38, 349, 280, -169, 699, 227, 74, 89, 255),
VTX(-14, 144, 310, 189, 629, 188, 7, 98, 255),
};
static Vtx sChildZeldaSkelVtx_008390[17] = {
VTX(263, -150, 349, -271, -352, 230, 219, 110, 255),
VTX(273, 43, 391, 192, -25, 241, 29, 115, 255),
VTX(356, -96, 737, -87, -134, 51, 2, 108, 255),
VTX(-15, -10, 295, 403, 90, 185, 248, 95, 255),
VTX(263, -150, 349, 139, 164, 230, 219, 110, 255),
VTX(356, -96, 737, -20, -40, 51, 2, 108, 255),
VTX(356, -96, -737, -20, -40, 51, 2, 148, 255),
VTX(263, -150, -349, 139, 164, 230, 219, 146, 255),
VTX(-15, -10, -295, 403, 90, 185, 248, 161, 255),
VTX(356, -96, -737, -254, -320, 51, 2, 148, 255),
VTX(273, 43, -391, 25, -210, 241, 29, 141, 255),
VTX(263, -150, -349, -439, -537, 230, 219, 146, 255),
VTX(82, 584, 0, -46, 128, 36, 48, 103, 255),
VTX(46, 484, 60, 98, 126, 224, 100, 56, 255),
VTX(233, 470, 0, -27, -61, 13, 119, 0, 255),
VTX(46, 484, -60, 98, 126, 224, 100, 200, 255),
VTX(82, 584, 0, -46, 128, 36, 48, 153, 255),
};
static Vtx sChildZeldaSkelVtx_0084A0[23] = {
VTX(263, -150, 349, 859, 94, 230, 219, 110, 255),
VTX(342, -16, 418, 162, 115, 222, 0, 115, 255),
VTX(273, 43, 391, 223, 264, 241, 29, 115, 255),
VTX(24, -324, 280, 60, 12, 171, 229, 79, 255),
VTX(263, -150, 349, 1184, 107, 230, 219, 110, 255),
VTX(-15, -10, 295, 726, 385, 185, 248, 95, 255),
VTX(-125, -64, 149, 170, 372, 183, 0, 94, 255),
VTX(-125, -64, 149, 649, 329, 183, 0, 94, 255),
VTX(-125, -252, 0, -53, 313, 177, 166, 0, 255),
VTX(24, -324, 280, 768, 28, 171, 229, 79, 255),
VTX(-59, -389, 0, -249, 63, 163, 181, 0, 255),
VTX(24, -324, -280, 768, 28, 171, 229, 177, 255),
VTX(-125, -64, -149, 649, 329, 183, 0, 162, 255),
VTX(24, -324, -280, 60, 12, 171, 229, 177, 255),
VTX(-125, -64, -149, 170, 372, 183, 0, 162, 255),
VTX(-15, -10, -295, 726, 385, 185, 248, 161, 255),
VTX(263, -150, -349, 1184, 107, 230, 219, 146, 255),
VTX(273, 43, -391, 223, 264, 241, 29, 141, 255),
VTX(342, -16, -418, 162, 115, 222, 0, 141, 255),
VTX(263, -150, -349, 859, 94, 230, 219, 146, 255),
VTX(46, 484, -60, 1, 139, 224, 100, 200, 255),
VTX(46, 484, 60, 257, 136, 224, 100, 56, 255),
VTX(82, 584, 0, 129, -21, 144, 41, 0, 255),
};
static Vtx sChildZeldaSkelVtx_008610[28] = {
VTX(-192, 409, 0, 107, -215, 169, 81, 0, 255),
VTX(-114, 308, -174, 166, -329, 161, 21, 187, 255),
VTX(-195, 98, 0, 81, -529, 175, 88, 0, 255),
VTX(-14, 144, -310, 237, -511, 188, 7, 158, 255),
VTX(38, 349, -280, 297, -312, 227, 74, 167, 255),
VTX(-125, -64, -149, 127, -706, 183, 0, 162, 255),
VTX(38, 349, 280, 297, -312, 227, 74, 89, 255),
VTX(-114, 308, 174, 166, -329, 161, 21, 69, 255),
VTX(-14, 144, 310, 237, -511, 188, 7, 98, 255),
VTX(-15, -10, -295, 224, -668, 185, 248, 161, 255),
VTX(273, 43, -391, 471, -660, 241, 29, 141, 255),
VTX(-15, -10, 295, 224, -668, 185, 248, 95, 255),
VTX(273, 43, 391, 471, -660, 241, 29, 115, 255),
VTX(-125, -64, 149, 127, -706, 183, 0, 94, 255),
VTX(808, 168, 289, -18, 84, 44, 66, 89, 255),
VTX(603, -87, 478, 109, 88, 226, 78, 85, 255),
VTX(619, -353, 661, 169, 18, 20, 239, 117, 255),
VTX(171, -339, 470, 266, 168, 184, 241, 94, 255),
VTX(24, -324, 280, 363, 318, 171, 229, 79, 255),
VTX(619, -353, -661, 169, 18, 20, 239, 139, 255),
VTX(603, -87, -478, 109, 88, 226, 78, 171, 255),
VTX(808, 168, -289, -18, 84, 44, 66, 167, 255),
VTX(171, -339, -470, 266, 168, 184, 241, 162, 255),
VTX(24, -324, -280, 363, 318, 171, 229, 177, 255),
VTX(701, -511, -458, 175, 92, 29, 153, 203, 255),
VTX(734, -618, 0, 30, 154, 246, 137, 0, 255),
VTX(170, -567, 0, 100, 254, 210, 146, 0, 255),
VTX(701, -511, 458, 175, 92, 29, 153, 53, 255),
};
static Vtx sChildZeldaSkelVtx_0087D0[26] = {
VTX(170, -567, 0, 79, 334, 210, 146, 0, 255),
VTX(619, -353, -661, 237, 150, 20, 239, 139, 255),
VTX(701, -511, -458, 154, 172, 29, 153, 203, 255),
VTX(171, -339, -470, 220, 229, 184, 241, 162, 255),
VTX(170, -567, 0, 92, -40, 210, 146, 0, 255),
VTX(-59, -389, 0, 113, 98, 163, 181, 0, 255),
VTX(24, -324, -280, 235, 118, 171, 229, 177, 255),
VTX(962, 81, 203, 181, 204, 98, 33, 59, 255),
VTX(840, -136, 483, 206, 163, 83, 23, 83, 255),
VTX(862, -295, 392, 166, 161, 100, 222, 55, 255),
VTX(619, -353, 661, 231, 121, 20, 239, 117, 255),
VTX(808, 168, 289, 229, 193, 44, 66, 89, 255),
VTX(701, -511, 458, 168, 133, 29, 153, 53, 255),
VTX(701, -511, 458, 154, 172, 29, 153, 53, 255),
VTX(619, -353, 661, 237, 150, 20, 239, 117, 255),
VTX(883, 396, 0, 213, 234, 101, 64, 0, 255),
VTX(24, -324, 280, 235, 118, 171, 229, 79, 255),
VTX(24, -324, -280, 202, 309, 171, 229, 177, 255),
VTX(701, -511, -458, 168, 133, 29, 153, 203, 255),
VTX(619, -353, -661, 231, 121, 20, 239, 139, 255),
VTX(862, -295, -392, 166, 161, 100, 222, 201, 255),
VTX(808, 168, -289, 229, 193, 44, 66, 167, 255),
VTX(962, 81, -203, 181, 204, 98, 33, 197, 255),
VTX(840, -136, -483, 206, 163, 83, 23, 173, 255),
VTX(171, -339, 470, 220, 229, 184, 241, 94, 255),
VTX(24, -324, 280, 202, 309, 171, 229, 79, 255),
};
static Vtx sChildZeldaSkelVtx_008970[19] = {
VTX(233, 470, 0, -144, 629, 13, 119, 0, 255),
VTX(555, 504, 0, -174, -299, 244, 119, 0, 255),
VTX(555, 420, -221, 584, -333, 249, 103, 196, 255),
VTX(38, 349, -280, 829, 1146, 227, 74, 167, 255),
VTX(458, 234, -377, 1258, -54, 243, 45, 146, 255),
VTX(46, 484, -60, 18, 1147, 224, 100, 200, 255),
VTX(38, 349, 280, 829, 1146, 227, 74, 89, 255),
VTX(555, 420, 221, 584, -333, 249, 103, 60, 255),
VTX(233, 470, 0, -144, 629, 13, 119, 0, 255),
VTX(46, 484, 60, 18, 1147, 224, 100, 56, 255),
VTX(458, 234, 377, 1258, -54, 243, 45, 110, 255),
VTX(555, 504, 0, -174, -299, 244, 119, 0, 255),
VTX(46, 484, 60, 821, 261, 224, 100, 56, 255),
VTX(-192, 409, 0, 512, 1279, 169, 81, 0, 255),
VTX(38, 349, 280, 1946, 295, 227, 74, 89, 255),
VTX(-114, 308, 174, 1430, 945, 161, 21, 69, 255),
VTX(46, 484, -60, 202, 261, 224, 100, 200, 255),
VTX(38, 349, -280, -922, 295, 227, 74, 167, 255),
VTX(-114, 308, -174, -383, 945, 161, 21, 187, 255),
};
static Vtx sChildZeldaSkelVtx_008AA0[5] = {
VTX(523, 125, 23, 666, -31, 19, 118, 4, 255),
VTX(523, 29, 92, 374, -31, 11, 4, 119, 255),
VTX(523, 29, -77, 1064, -31, 6, 1, 137, 255),
VTX(523, -77, 28, 1508, -31, 0, 137, 1, 255),
VTX(523, -77, 28, 65, -31, 0, 137, 1, 255),
};
static Vtx sChildZeldaSkelVtx_008AF0[12] = {
VTX(32, 127, 31, 651, 586, 254, 106, 54, 255),
VTX(41, 21, -75, 1089, 638, 3, 39, 143, 255),
VTX(41, 21, -75, 1089, 638, 3, 39, 143, 255),
VTX(32, 127, 31, 651, 586, 254, 106, 54, 255),
VTX(39, 24, 98, 360, 625, 255, 229, 116, 255),
VTX(32, 127, 31, 651, 586, 254, 106, 54, 255),
VTX(41, 21, -75, 1089, 638, 3, 39, 143, 255),
VTX(32, -75, 22, 1497, 585, 0, 142, 221, 255),
VTX(32, -75, 22, 1497, 585, 0, 142, 221, 255),
VTX(39, 24, 98, 360, 625, 255, 229, 116, 255),
VTX(32, -75, 22, 54, 585, 0, 142, 221, 255),
VTX(39, 24, 98, 360, 625, 255, 229, 116, 255),
};
static Vtx sChildZeldaSkelVtx_008BB0[28] = {
VTX(172, -120, -143, -29, 289, 11, 37, 143, 255),
VTX(298, -204, -171, -238, 132, 65, 0, 156, 255),
VTX(290, -244, -144, -328, 172, 6, 141, 223, 255),
VTX(258, -83, 170, 16, 474, 18, 178, 89, 255),
VTX(39, 24, 98, 302, 642, 198, 252, 104, 255),
VTX(32, -75, 22, 83, 595, 188, 170, 46, 255),
VTX(494, -74, -99, 18, -42, 49, 194, 167, 255),
VTX(511, 43, -42, 280, -27, 105, 9, 55, 255),
VTX(328, -202, -101, -242, 162, 115, 30, 6, 255),
VTX(201, -154, 8, -123, 400, 49, 148, 13, 255),
VTX(234, 146, 167, 542, 466, 10, 72, 94, 255),
VTX(163, 188, 2, 662, 389, 7, 98, 189, 255),
VTX(32, 127, 31, 542, 573, 191, 97, 22, 255),
VTX(304, 207, 28, 679, 249, 236, 63, 157, 255),
VTX(474, 142, -69, 512, -24, 92, 75, 242, 255),
VTX(158, -212, -89, -238, 367, 182, 167, 228, 255),
VTX(335, -102, -10, -23, 223, 0, 164, 180, 255),
VTX(32, -75, 22, 81, 749, 188, 170, 46, 255),
VTX(41, 21, -75, 307, 634, 187, 13, 160, 255),
VTX(158, -212, -89, -241, 521, 182, 167, 228, 255),
VTX(172, -120, -143, -32, 443, 11, 37, 143, 255),
VTX(163, 188, 2, 659, 543, 7, 98, 189, 255),
VTX(32, 127, 31, 540, 727, 191, 97, 22, 255),
VTX(201, -154, 8, -125, 554, 49, 148, 13, 255),
VTX(304, 207, 28, 677, 403, 236, 63, 157, 255),
VTX(335, -102, -10, -26, 377, 0, 164, 180, 255),
VTX(494, -74, -99, 16, 111, 49, 194, 167, 255),
VTX(474, 142, -69, 509, 129, 92, 75, 242, 255),
};
static Vtx sChildZeldaSkelVtx_008D70[8] = {
VTX(702, 61, -180, 555, 440, 13, 54, 150, 255),
VTX(702, 61, -180, 533, 434, 13, 54, 150, 255),
VTX(693, 178, 14, 90, 441, 102, 62, 5, 255),
VTX(693, 178, 14, 98, 438, 102, 62, 5, 255),
VTX(618, -207, -13, -37, 392, 216, 144, 249, 255),
VTX(618, -207, -13, 0, 416, 216, 144, 249, 255),
VTX(666, 76, 230, 541, 454, 1, 60, 103, 255),
VTX(666, 76, 230, 508, 427, 1, 60, 103, 255),
};
static Vtx sChildZeldaSkelVtx_008DF0[20] = {
VTX(-4, -83, -12, 177, 453, 106, 202, 5, 255),
VTX(31, 89, -104, 539, 463, 108, 16, 208, 255),
VTX(-4, -83, -12, 177, 453, 106, 202, 5, 255),
VTX(36, 185, 16, 73, 486, 44, 111, 252, 255),
VTX(31, 89, -104, 385, 466, 108, 16, 208, 255),
VTX(36, 185, 16, 73, 486, 44, 111, 252, 255),
VTX(36, 185, 16, 93, 478, 44, 111, 252, 255),
VTX(14, 92, 140, 389, 478, 105, 3, 56, 255),
VTX(36, 185, 16, 93, 478, 44, 111, 252, 255),
VTX(-4, -83, -12, 138, 464, 106, 202, 5, 255),
VTX(14, 92, 140, 453, 460, 105, 3, 56, 255),
VTX(-4, -83, -12, 138, 464, 106, 202, 5, 255),
VTX(523, 125, 23, -5, 321, 19, 118, 4, 255),
VTX(36, 185, 16, 40, 9, 14, 119, 0, 255),
VTX(14, 92, 140, 225, 13, 7, 7, 119, 255),
VTX(523, 29, 92, 126, 336, 11, 4, 119, 255),
VTX(31, 89, -104, 206, 0, 10, 13, 138, 255),
VTX(36, 185, 16, -7, 0, 14, 119, 0, 255),
VTX(523, 125, 23, -19, 401, 19, 118, 4, 255),
VTX(523, 29, -77, 171, 404, 6, 1, 137, 255),
};
static Vtx sChildZeldaSkelVtx_008F30[8] = {
VTX(31, 89, -104, -13, 2, 10, 13, 138, 255),
VTX(523, 29, -77, 83, 310, 6, 1, 137, 255),
VTX(523, -77, 28, 282, 324, 0, 137, 1, 255),
VTX(-4, -83, -12, 258, -4, 2, 137, 244, 255),
VTX(14, 92, 140, 265, 26, 7, 7, 119, 255),
VTX(-4, -83, -12, -33, 19, 2, 137, 244, 255),
VTX(523, -77, 28, 54, 372, 0, 137, 1, 255),
VTX(523, 29, 92, 210, 368, 11, 4, 119, 255),
};
static Vtx sChildZeldaSkelVtx_008FB0[7] = {
VTX(637, -206, 373, 139, 90, 53, 169, 61, 255),
VTX(500, -250, 387, 137, 75, 13, 165, 76, 255),
VTX(500, -250, 387, -365, 321, 13, 165, 76, 255),
VTX(510, 185, 429, 139, 219, 239, 181, 91, 255),
VTX(510, 185, 429, 64, 369, 239, 181, 91, 255),
VTX(724, -8, 344, 118, 153, 148, 224, 38, 255),
VTX(302, -43, 400, -162, 308, 33, 226, 111, 255),
};
static Vtx sChildZeldaSkelVtx_009020[20] = {
VTX(208, -251, -43, 278, 237, 247, 137, 10, 255),
VTX(208, -251, -43, 278, 237, 247, 137, 10, 255),
VTX(41, 26, 158, 213, 140, 224, 17, 114, 255),
VTX(41, 26, 158, 213, 140, 224, 17, 114, 255),
VTX(195, 247, -14, 301, 75, 238, 118, 252, 255),
VTX(41, 26, 158, 213, 140, 224, 17, 114, 255),
VTX(195, 247, -14, 301, 75, 238, 118, 252, 255),
VTX(284, 6, -191, -179, 649, 17, 6, 138, 255),
VTX(284, 6, -191, -179, 649, 17, 6, 138, 255),
VTX(208, -251, -43, 77, 600, 247, 137, 10, 255),
VTX(195, 247, -14, -415, 585, 238, 118, 252, 255),
VTX(284, 6, -191, -179, 649, 17, 6, 138, 255),
VTX(284, 6, -191, -179, 649, 17, 6, 138, 255),
VTX(702, 61, -180, 533, 434, 13, 54, 150, 255),
VTX(646, 256, 5, -14, 412, 54, 107, 255, 255),
VTX(693, 178, 14, 90, 441, 102, 62, 5, 255),
VTX(446, 197, 5, 89, 195, 230, 116, 250, 255),
VTX(448, 50, -131, 498, 171, 247, 13, 138, 255),
VTX(154, 173, -10, 165, -105, 247, 119, 254, 255),
VTX(200, 24, -158, 590, -84, 8, 233, 139, 255),
};
static Vtx sChildZeldaSkelVtx_009160[31] = {
VTX(618, -207, -13, 0, 416, 216, 144, 249, 255),
VTX(666, 76, 230, 508, 427, 1, 60, 103, 255),
VTX(420, 70, 139, 383, 146, 231, 11, 116, 255),
VTX(438, -145, -10, 37, 203, 246, 137, 0, 255),
VTX(117, 51, 106, 288, -182, 246, 236, 117, 255),
VTX(177, -145, -19, -11, -81, 0, 137, 6, 255),
VTX(618, -207, -13, -37, 392, 216, 144, 249, 255),
VTX(438, -145, -10, -17, 164, 246, 137, 0, 255),
VTX(448, 50, -131, 394, 139, 247, 13, 138, 255),
VTX(200, 24, -158, 283, -145, 8, 233, 139, 255),
VTX(702, 61, -180, 555, 440, 13, 54, 150, 255),
VTX(177, -145, -19, -111, -143, 0, 137, 6, 255),
VTX(666, 76, 230, 541, 454, 1, 60, 103, 255),
VTX(646, 256, 5, -11, 398, 54, 107, 255, 255),
VTX(446, 197, 5, 56, 206, 230, 116, 250, 255),
VTX(420, 70, 139, 408, 202, 231, 11, 116, 255),
VTX(154, 173, -10, 54, -71, 247, 119, 254, 255),
VTX(117, 51, 106, 375, -88, 246, 236, 117, 255),
VTX(693, 178, 14, 98, 438, 102, 62, 5, 255),
VTX(208, -251, -43, 285, 58, 247, 137, 10, 255),
VTX(313, -261, 9, 298, 264, 247, 137, 252, 255),
VTX(252, 62, 267, -21, 257, 198, 8, 104, 255),
VTX(41, 26, 158, -25, -152, 224, 17, 114, 255),
VTX(195, 247, -14, 274, 53, 238, 118, 252, 255),
VTX(41, 26, 158, -34, -159, 224, 17, 114, 255),
VTX(252, 62, 267, -13, 260, 198, 8, 104, 255),
VTX(293, 265, 19, 302, 242, 240, 117, 241, 255),
VTX(365, 4, -192, 375, 225, 16, 5, 138, 255),
VTX(284, 6, -191, 344, 77, 17, 6, 138, 255),
VTX(195, 247, -14, -15, 48, 238, 118, 252, 255),
VTX(293, 265, 19, -20, 251, 240, 117, 241, 255),
};
static Vtx sChildZeldaSkelVtx_009350[4] = {
VTX(208, -251, -43, 39, 65, 247, 137, 10, 255),
VTX(284, 6, -191, 288, 83, 17, 6, 138, 255),
VTX(365, 4, -192, 296, 212, 16, 5, 138, 255),
VTX(313, -261, 9, 21, 263, 247, 137, 252, 255),
};
static Vtx sChildZeldaSkelVtx_009390[5] = {
VTX(522, 125, -23, 666, -31, 19, 118, 252, 255),
VTX(522, 29, -92, 374, -31, 11, 4, 137, 255),
VTX(522, 29, 77, 1064, -31, 6, 1, 119, 255),
VTX(522, -77, -28, 1508, -31, 0, 137, 255, 255),
VTX(522, -77, -28, 65, -31, 0, 137, 255, 255),
};
static Vtx sChildZeldaSkelVtx_0093E0[12] = {
VTX(35, 21, 75, 1089, 638, 3, 39, 113, 255),
VTX(26, 127, -31, 651, 586, 254, 106, 202, 255),
VTX(35, 21, 75, 1089, 638, 3, 39, 113, 255),
VTX(26, 127, -31, 651, 586, 254, 106, 202, 255),
VTX(26, 127, -31, 651, 586, 254, 106, 202, 255),
VTX(33, 24, -98, 360, 625, 255, 229, 140, 255),
VTX(26, -75, -22, 1497, 585, 0, 142, 35, 255),
VTX(35, 21, 75, 1089, 638, 3, 39, 113, 255),
VTX(26, -75, -22, 1497, 585, 0, 142, 35, 255),
VTX(33, 24, -98, 360, 625, 255, 229, 140, 255),
VTX(33, 24, -98, 360, 625, 255, 229, 140, 255),
VTX(26, -75, -22, 54, 585, 0, 142, 35, 255),
};
static Vtx sChildZeldaSkelVtx_0094A0[28] = {
VTX(284, -244, 144, -328, 172, 6, 141, 33, 255),
VTX(292, -204, 171, -238, 132, 65, 0, 100, 255),
VTX(166, -120, 143, -29, 289, 11, 37, 113, 255),
VTX(26, -75, -22, 83, 595, 188, 170, 210, 255),
VTX(33, 24, -98, 302, 642, 198, 252, 152, 255),
VTX(252, -83, -170, 16, 474, 18, 178, 167, 255),
VTX(505, 43, 42, 280, -27, 105, 9, 201, 255),
VTX(488, -74, 99, 18, -42, 49, 194, 89, 255),
VTX(195, -154, -8, -123, 400, 49, 148, 243, 255),
VTX(322, -202, 101, -242, 162, 115, 30, 250, 255),
VTX(26, 127, -31, 542, 573, 191, 97, 234, 255),
VTX(157, 188, -2, 662, 389, 7, 98, 67, 255),
VTX(228, 146, -167, 542, 466, 10, 72, 162, 255),
VTX(299, 207, -28, 679, 249, 236, 63, 99, 255),
VTX(468, 142, 69, 512, -24, 92, 75, 14, 255),
VTX(152, -212, 89, -238, 367, 182, 167, 28, 255),
VTX(329, -102, 10, -23, 223, 0, 164, 76, 255),
VTX(152, -212, 89, -241, 521, 182, 167, 28, 255),
VTX(35, 21, 75, 307, 634, 187, 13, 96, 255),
VTX(26, -75, -22, 81, 749, 188, 170, 210, 255),
VTX(166, -120, 143, -32, 443, 11, 37, 113, 255),
VTX(157, 188, -2, 659, 543, 7, 98, 67, 255),
VTX(26, 127, -31, 540, 727, 191, 97, 234, 255),
VTX(195, -154, -8, -125, 554, 49, 148, 243, 255),
VTX(299, 207, -28, 677, 403, 236, 63, 99, 255),
VTX(329, -102, 10, -26, 377, 0, 164, 76, 255),
VTX(488, -74, 99, 16, 111, 49, 194, 89, 255),
VTX(468, 142, 69, 509, 129, 92, 75, 14, 255),
};
static Vtx sChildZeldaSkelVtx_009660[8] = {
VTX(693, 178, -14, 90, 441, 102, 62, 251, 255),
VTX(693, 178, -14, 98, 438, 102, 62, 251, 255),
VTX(666, 76, -230, 541, 454, 1, 60, 153, 255),
VTX(666, 76, -230, 508, 427, 1, 60, 153, 255),
VTX(618, -207, 13, -37, 392, 216, 144, 7, 255),
VTX(618, -207, 13, 0, 416, 216, 144, 7, 255),
VTX(702, 61, 180, 555, 440, 13, 54, 106, 255),
VTX(702, 61, 180, 533, 434, 13, 54, 106, 255),
};
static Vtx sChildZeldaSkelVtx_0096E0[20] = {
VTX(-6, -83, 12, 177, 453, 106, 202, 251, 255),
VTX(-6, -83, 12, 177, 453, 106, 202, 251, 255),
VTX(30, 89, 104, 539, 463, 108, 16, 48, 255),
VTX(30, 89, 104, 385, 466, 108, 16, 48, 255),
VTX(34, 185, -16, 73, 486, 44, 111, 4, 255),
VTX(34, 185, -16, 73, 486, 44, 111, 4, 255),
VTX(34, 185, -16, 93, 478, 44, 111, 4, 255),
VTX(34, 185, -16, 93, 478, 44, 111, 4, 255),
VTX(12, 92, -140, 389, 478, 105, 3, 200, 255),
VTX(12, 92, -140, 453, 460, 105, 3, 200, 255),
VTX(-6, -83, 12, 138, 464, 106, 202, 251, 255),
VTX(-6, -83, 12, 138, 464, 106, 202, 251, 255),
VTX(12, 92, -140, 225, 13, 7, 7, 137, 255),
VTX(34, 185, -16, 40, 9, 14, 119, 0, 255),
VTX(522, 125, -23, -5, 321, 19, 118, 252, 255),
VTX(522, 29, -92, 126, 336, 11, 4, 137, 255),
VTX(522, 125, -23, -19, 401, 19, 118, 252, 255),
VTX(34, 185, -16, -7, 0, 14, 119, 0, 255),
VTX(30, 89, 104, 206, 0, 10, 13, 118, 255),
VTX(522, 29, 77, 171, 404, 6, 1, 119, 255),
};
static Vtx sChildZeldaSkelVtx_009820[8] = {
VTX(522, -77, -28, 282, 324, 0, 137, 255, 255),
VTX(522, 29, 77, 83, 310, 6, 1, 119, 255),
VTX(30, 89, 104, -13, 2, 10, 13, 118, 255),
VTX(-6, -83, 12, 258, -4, 2, 137, 12, 255),
VTX(522, -77, -28, 54, 372, 0, 137, 255, 255),
VTX(-6, -83, 12, -33, 19, 2, 137, 12, 255),
VTX(12, 92, -140, 265, 26, 7, 7, 137, 255),
VTX(522, 29, -92, 210, 368, 11, 4, 137, 255),
};
static Vtx sChildZeldaSkelVtx_0098A0[7] = {
VTX(637, -206, -373, 139, 90, 53, 169, 195, 255),
VTX(500, -250, -387, -365, 321, 13, 165, 180, 255),
VTX(500, -250, -387, 137, 75, 13, 165, 180, 255),
VTX(510, 185, -429, 64, 369, 239, 181, 165, 255),
VTX(510, 185, -429, 139, 219, 239, 181, 165, 255),
VTX(302, -43, -400, -162, 308, 33, 226, 145, 255),
VTX(724, -8, -344, 118, 153, 148, 224, 218, 255),
};
static Vtx sChildZeldaSkelVtx_009910[21] = {
VTX(284, 6, 191, -179, 649, 17, 6, 118, 255),
VTX(208, -251, 43, 77, 600, 247, 137, 246, 255),
VTX(284, 6, 191, -179, 649, 17, 6, 118, 255),
VTX(284, 6, 191, -179, 649, 17, 6, 118, 255),
VTX(195, 247, 14, -415, 585, 238, 118, 4, 255),
VTX(284, 6, 191, -179, 649, 17, 6, 118, 255),
VTX(208, -251, 43, 278, 237, 247, 137, 246, 255),
VTX(41, 26, -158, 213, 140, 224, 17, 142, 255),
VTX(208, -251, 43, 278, 237, 247, 137, 246, 255),
VTX(195, 247, 14, 301, 75, 238, 118, 4, 255),
VTX(41, 26, -158, 213, 140, 224, 17, 142, 255),
VTX(41, 26, -158, 213, 140, 224, 17, 142, 255),
VTX(195, 247, 14, 301, 75, 238, 118, 4, 255),
VTX(365, 4, 192, 296, 212, 16, 5, 118, 255),
VTX(284, 6, 191, 288, 83, 17, 6, 118, 255),
VTX(208, -251, 43, 39, 65, 247, 137, 246, 255),
VTX(313, -261, -9, 21, 263, 247, 137, 4, 255),
VTX(195, 247, 14, -15, 48, 238, 118, 4, 255),
VTX(284, 6, 191, 344, 77, 17, 6, 118, 255),
VTX(365, 4, 192, 375, 225, 16, 5, 118, 255),
VTX(293, 265, -19, -20, 251, 240, 117, 15, 255),
};
static Vtx sChildZeldaSkelVtx_009A60[27] = {
VTX(252, 62, -267, -13, 260, 198, 8, 152, 255),
VTX(41, 26, -158, -34, -159, 224, 17, 142, 255),
VTX(195, 247, 14, 274, 53, 238, 118, 4, 255),
VTX(293, 265, -19, 302, 242, 240, 117, 15, 255),
VTX(252, 62, -267, -21, 257, 198, 8, 152, 255),
VTX(313, -261, -9, 298, 264, 247, 137, 4, 255),
VTX(208, -251, 43, 285, 58, 247, 137, 246, 255),
VTX(41, 26, -158, -25, -152, 224, 17, 142, 255),
VTX(446, 197, -5, 56, 206, 230, 116, 6, 255),
VTX(646, 256, -5, -11, 398, 54, 107, 1, 255),
VTX(666, 76, -230, 541, 454, 1, 60, 153, 255),
VTX(420, 70, -139, 408, 202, 231, 11, 140, 255),
VTX(154, 173, 10, 54, -71, 247, 119, 2, 255),
VTX(117, 51, -106, 375, -88, 246, 236, 139, 255),
VTX(693, 178, -14, 98, 438, 102, 62, 251, 255),
VTX(448, 50, 131, 394, 139, 247, 13, 118, 255),
VTX(438, -145, 10, -17, 164, 246, 137, 0, 255),
VTX(618, -207, 13, -37, 392, 216, 144, 7, 255),
VTX(200, 24, 158, 283, -145, 8, 233, 117, 255),
VTX(702, 61, 180, 555, 440, 13, 54, 106, 255),
VTX(177, -145, 19, -111, -143, 0, 137, 250, 255),
VTX(420, 70, -139, 383, 146, 231, 11, 140, 255),
VTX(666, 76, -230, 508, 427, 1, 60, 153, 255),
VTX(618, -207, 13, 0, 416, 216, 144, 7, 255),
VTX(438, -145, 10, 37, 203, 246, 137, 0, 255),
VTX(117, 51, -106, 288, -182, 246, 236, 139, 255),
VTX(177, -145, 19, -11, -81, 0, 137, 250, 255),
};
static Vtx sChildZeldaSkelVtx_009C10[7] = {
VTX(693, 178, -14, 90, 441, 102, 62, 251, 255),
VTX(646, 256, -5, -14, 412, 54, 107, 1, 255),
VTX(702, 61, 180, 533, 434, 13, 54, 106, 255),
VTX(446, 197, -5, 89, 195, 230, 116, 6, 255),
VTX(448, 50, 131, 498, 171, 247, 13, 118, 255),
VTX(154, 173, 10, 165, -105, 247, 119, 2, 255),
VTX(200, 24, 158, 590, -84, 8, 233, 117, 255),
};
static Vtx sChildZeldaSkelVtx_009C80[27] = {
VTX(719, 216, 0, -56, 12, 95, 72, 0, 255),
VTX(810, 110, 0, 21, 48, 97, 70, 0, 255),
VTX(803, 79, -115, 44, 26, 94, 64, 221, 255),
VTX(830, 39, -99, 83, 44, 100, 54, 220, 255),
VTX(855, -62, -149, 145, 40, 109, 21, 212, 255),
VTX(855, -62, 149, 145, 40, 109, 21, 44, 255),
VTX(830, 39, 99, 83, 44, 100, 54, 36, 255),
VTX(803, 79, 115, 44, 26, 94, 64, 35, 255),
VTX(-215, 70, 0, 512, 732, 137, 246, 0, 255),
VTX(27, -79, -484, 16, 455, 216, 232, 146, 255),
VTX(78, -405, -303, 201, 363, 222, 149, 216, 255),
VTX(257, 294, -495, 4, 250, 0, 251, 137, 255),
VTX(320, 534, -325, 178, 210, 34, 95, 193, 255),
VTX(648, 157, -458, 42, -184, 37, 1, 143, 255),
VTX(19, 525, -303, 201, 531, 198, 76, 185, 255),
VTX(733, 249, -235, 274, -265, 94, 70, 235, 255),
VTX(257, 294, 495, 1019, 250, 0, 251, 119, 255),
VTX(320, 534, 325, 845, 210, 34, 95, 63, 255),
VTX(19, 525, 303, 823, 531, 198, 76, 71, 255),
VTX(320, 584, 0, 512, 215, 41, 112, 0, 255),
VTX(78, -405, 303, 822, 363, 202, 162, 50, 255),
VTX(27, -79, 484, 1008, 455, 216, 232, 110, 255),
VTX(648, 157, 458, 981, -184, 37, 1, 113, 255),
VTX(733, 249, 235, 753, -265, 94, 70, 21, 255),
VTX(300, -340, -305, 120, 551, 21, 169, 177, 255),
VTX(78, -405, -303, 123, 843, 222, 149, 216, 255),
VTX(27, -79, -484, -108, 959, 216, 232, 146, 255),
};
static Vtx sChildZeldaSkelVtx_009E30[30] = {
VTX(798, -20, 297, 202, 35, 111, 13, 41, 255),
VTX(726, -13, 520, 264, 226, 215, 237, 110, 255),
VTX(637, -206, 373, 404, 21, 53, 169, 61, 255),
VTX(733, 249, 235, -26, 16, 94, 70, 21, 255),
VTX(648, 157, 458, 120, 182, 37, 1, 113, 255),
VTX(-215, 70, 0, 511, 1310, 137, 246, 0, 255),
VTX(78, -405, -303, 900, 843, 222, 149, 216, 255),
VTX(78, -405, 303, 123, 843, 202, 162, 50, 255),
VTX(300, -340, 305, 120, 551, 24, 162, 69, 255),
VTX(300, -340, -305, 902, 551, 21, 169, 177, 255),
VTX(652, -376, 0, 512, 68, 36, 142, 0, 255),
VTX(500, -250, 387, 15, 292, 13, 165, 76, 255),
VTX(637, -206, 373, 33, 112, 53, 169, 61, 255),
VTX(500, -250, -387, 1007, 292, 13, 165, 180, 255),
VTX(637, -206, -373, 990, 112, 53, 169, 195, 255),
VTX(27, -79, 484, -108, 959, 216, 232, 110, 255),
VTX(19, 525, 303, 372, 579, 198, 76, 71, 255),
VTX(227, -50, 452, 724, 527, 22, 241, 116, 255),
VTX(257, 294, 495, 658, 434, 0, 251, 119, 255),
VTX(19, 525, 303, -97, 1026, 198, 76, 71, 255),
VTX(27, -79, 484, 728, 1062, 216, 232, 110, 255),
VTX(227, -50, 452, 588, 855, 22, 241, 116, 255),
VTX(300, -340, 305, 943, 849, 24, 162, 69, 255),
VTX(227, -50, 452, 412, 845, 22, 241, 116, 255),
VTX(27, -79, 484, 417, 1111, 216, 232, 110, 255),
VTX(719, 216, 0, -22, 443, 95, 72, 0, 255),
VTX(798, -20, 297, 464, 238, 111, 13, 41, 255),
VTX(803, 79, 115, 73, 308, 94, 64, 35, 255),
VTX(855, -62, 149, 169, 173, 109, 21, 44, 255),
VTX(733, 249, 235, 443, 494, 94, 70, 21, 255),
};
static Vtx sChildZeldaSkelVtx_00A010[29] = {
VTX(733, 249, 235, 230, 34, 94, 70, 21, 255),
VTX(719, 216, 0, 77, 54, 95, 72, 0, 255),
VTX(320, 584, 0, 146, 390, 41, 112, 0, 255),
VTX(855, -62, 149, 154, 290, 109, 21, 44, 255),
VTX(798, -20, 297, 476, 238, 111, 13, 41, 255),
VTX(864, -254, 0, 254, 2, 96, 186, 0, 255),
VTX(510, 185, 429, 690, 472, 239, 181, 91, 255),
VTX(648, 157, 458, 856, 280, 37, 1, 113, 255),
VTX(257, 294, 495, 354, 610, 0, 251, 119, 255),
VTX(-215, 70, 0, 361, 830, 137, 246, 0, 255),
VTX(27, -79, 484, 765, 1002, 216, 232, 110, 255),
VTX(19, 525, 303, 927, 732, 198, 76, 71, 255),
VTX(733, 249, 235, 811, 934, 94, 70, 21, 255),
VTX(320, 584, 0, 168, 772, 41, 112, 0, 255),
VTX(320, 534, 325, 219, 1184, 34, 95, 63, 255),
VTX(724, -8, 344, 85, 0, 148, 224, 38, 255),
VTX(637, -206, 373, 294, 39, 53, 169, 61, 255),
VTX(726, -13, 520, 32, 146, 215, 237, 110, 255),
VTX(648, 157, 458, -120, -27, 37, 1, 113, 255),
VTX(493, 439, -238, 3, 1123, 67, 96, 234, 255),
VTX(791, 285, 0, 1024, -96, 68, 98, 0, 255),
VTX(763, 232, -238, -26, -115, 70, 92, 227, 255),
VTX(499, 472, 0, 1024, 1170, 64, 101, 0, 255),
VTX(227, -50, -452, 588, 855, 22, 241, 140, 255),
VTX(27, -79, -484, 728, 1062, 216, 232, 146, 255),
VTX(19, 525, -303, -97, 1026, 198, 76, 185, 255),
VTX(27, -79, -484, 417, 1111, 216, 232, 146, 255),
VTX(227, -50, -452, 412, 845, 22, 241, 140, 255),
VTX(300, -340, -305, 943, 849, 21, 169, 177, 255),
};
static Vtx sChildZeldaSkelVtx_00A1E0[31] = {
VTX(320, 534, -325, 219, 1184, 34, 95, 193, 255),
VTX(320, 584, 0, 168, 772, 41, 112, 0, 255),
VTX(733, 249, -235, 811, 934, 94, 70, 235, 255),
VTX(227, -50, -452, 313, 248, 22, 241, 140, 255),
VTX(257, 294, -495, 393, 651, 0, 251, 137, 255),
VTX(302, -43, -400, 174, 213, 33, 226, 145, 255),
VTX(510, 185, -429, -79, 422, 239, 181, 165, 255),
VTX(302, -43, -400, 169, 128, 33, 226, 145, 255),
VTX(300, -340, -305, 433, 563, 21, 169, 177, 255),
VTX(227, -50, -452, 279, 108, 22, 241, 140, 255),
VTX(500, -250, -387, -64, 430, 13, 165, 180, 255),
VTX(-215, 70, 0, 547, 124, 137, 246, 0, 255),
VTX(19, 525, 303, 1408, 539, 198, 76, 71, 255),
VTX(19, 525, -303, -334, 542, 198, 76, 185, 255),
VTX(257, 294, -495, 354, 610, 0, 251, 137, 255),
VTX(648, 157, -458, 856, 280, 37, 1, 143, 255),
VTX(510, 185, -429, 690, 472, 239, 181, 165, 255),
VTX(257, 294, -495, 658, 434, 0, 251, 137, 255),
VTX(227, -50, -452, 724, 527, 22, 241, 140, 255),
VTX(19, 525, -303, 372, 579, 198, 76, 185, 255),
VTX(19, 525, -303, 927, 732, 198, 76, 185, 255),
VTX(27, -79, -484, 765, 1002, 216, 232, 146, 255),
VTX(-215, 70, 0, 361, 830, 137, 246, 0, 255),
VTX(864, -254, 0, 254, 2, 96, 186, 0, 255),
VTX(798, -20, -297, 476, 238, 111, 13, 215, 255),
VTX(855, -62, -149, 154, 290, 109, 21, 212, 255),
VTX(855, -62, -149, 169, 173, 109, 21, 212, 255),
VTX(798, -20, -297, 464, 238, 111, 13, 215, 255),
VTX(803, 79, -115, 73, 308, 94, 64, 221, 255),
VTX(719, 216, 0, -22, 443, 95, 72, 0, 255),
VTX(733, 249, -235, 443, 494, 94, 70, 235, 255),
};
static Vtx sChildZeldaSkelVtx_00A3D0[28] = {
VTX(320, 584, 0, 146, 390, 41, 112, 0, 255),
VTX(719, 216, 0, 77, 54, 95, 72, 0, 255),
VTX(733, 249, -235, 230, 34, 94, 70, 235, 255),
VTX(302, -43, 400, 174, 213, 33, 226, 111, 255),
VTX(257, 294, 495, 393, 651, 0, 251, 119, 255),
VTX(227, -50, 452, 313, 248, 22, 241, 116, 255),
VTX(510, 185, 429, -79, 422, 239, 181, 91, 255),
VTX(227, -50, 452, 279, 108, 22, 241, 116, 255),
VTX(300, -340, 305, 433, 563, 24, 162, 69, 255),
VTX(302, -43, 400, 169, 128, 33, 226, 111, 255),
VTX(500, -250, 387, -64, 430, 13, 165, 76, 255),
VTX(763, 232, 238, -26, -115, 70, 92, 29, 255),
VTX(791, 285, 0, 1024, -96, 68, 98, 0, 255),
VTX(493, 439, 238, 3, 1123, 67, 96, 22, 255),
VTX(499, 472, 0, 1024, 1170, 64, 101, 0, 255),
VTX(864, -254, 0, 386, 467, 96, 186, 0, 255),
VTX(798, -20, 297, 435, 83, 111, 13, 41, 255),
VTX(637, -206, 373, 35, 61, 53, 169, 61, 255),
VTX(652, -376, 0, 39, 499, 36, 142, 0, 255),
VTX(637, -206, -373, 404, 21, 53, 169, 195, 255),
VTX(726, -13, -520, 264, 226, 215, 237, 146, 255),
VTX(798, -20, -297, 202, 35, 111, 13, 215, 255),
VTX(648, 157, -458, 120, 182, 37, 1, 143, 255),
VTX(733, 249, -235, -26, 16, 94, 70, 235, 255),
VTX(726, -13, -520, 32, 146, 215, 237, 146, 255),
VTX(637, -206, -373, 294, 39, 53, 169, 195, 255),
VTX(724, -8, -344, 85, 0, 148, 224, 218, 255),
VTX(648, 157, -458, -120, -27, 37, 1, 143, 255),
};
static Vtx sChildZeldaSkelVtx_00A590[10] = {
VTX(637, -206, -373, 35, 61, 53, 169, 195, 255),
VTX(798, -20, -297, 435, 83, 111, 13, 215, 255),
VTX(864, -254, 0, 386, 467, 96, 186, 0, 255),
VTX(652, -376, 0, 39, 499, 36, 142, 0, 255),
VTX(510, 185, 429, 139, 219, 239, 181, 91, 255),
VTX(724, -8, 344, 118, 153, 148, 224, 38, 255),
VTX(648, 157, 458, 170, 213, 37, 1, 113, 255),
VTX(648, 157, -458, 170, 213, 37, 1, 143, 255),
VTX(724, -8, -344, 118, 153, 148, 224, 218, 255),
VTX(510, 185, -429, 139, 219, 239, 181, 165, 255),
};
Gfx sChildZeldaSkelLimbDL_00A630[] = {
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0028F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_009C80[0], 27, 0),
gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
gsSP2Triangles(3, 4, 2, 0, 5, 6, 7, 0),
gsSP2Triangles(6, 1, 7, 0, 1, 0, 7, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP2Triangles(8, 9, 10, 0, 11, 12, 13, 0),
gsSP2Triangles(14, 12, 11, 0, 15, 13, 12, 0),
gsSP2Triangles(16, 17, 18, 0, 12, 14, 19, 0),
gsSP2Triangles(20, 21, 8, 0, 18, 19, 14, 0),
gsSP2Triangles(18, 17, 19, 0, 17, 22, 23, 0),
gsSP2Triangles(22, 17, 16, 0, 24, 25, 26, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0059F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_009E30[0], 30, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 3, 4, 0),
gsSP1Triangle(4, 1, 0, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP2Triangles(5, 6, 7, 0, 8, 7, 6, 0),
gsSP2Triangles(6, 9, 8, 0, 10, 8, 9, 0),
gsSP2Triangles(11, 8, 10, 0, 10, 12, 11, 0),
gsSP2Triangles(13, 14, 10, 0, 10, 9, 13, 0),
gsSP1Triangle(15, 7, 8, 0),
gsSP1Triangle(16, 17, 18, 0),
gsSP2Triangles(19, 20, 21, 0, 22, 23, 24, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(25, 26, 27, 0, 26, 28, 27, 0),
gsSP1Triangle(25, 29, 26, 0),
gsSPVertex(&sChildZeldaSkelVtx_00A010[0], 29, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(3, 4, 5, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP1Triangle(6, 7, 8, 0),
gsSP1Triangle(9, 10, 11, 0),
gsSP1Triangle(12, 13, 14, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0059F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(15, 16, 17, 0, 17, 18, 15, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005DB0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 1023, 256),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(19, 20, 21, 0, 19, 22, 20, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP1Triangle(23, 24, 25, 0),
gsSP1Triangle(26, 27, 28, 0),
gsSPVertex(&sChildZeldaSkelVtx_00A1E0[0], 31, 0),
gsSP1Triangle(0, 1, 2, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(3, 4, 5, 0, 6, 5, 4, 0),
gsSP2Triangles(7, 8, 9, 0, 8, 7, 10, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP1Triangle(11, 12, 13, 0),
gsSP1Triangle(14, 15, 16, 0),
gsSP1Triangle(17, 18, 19, 0),
gsSP1Triangle(20, 21, 22, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP1Triangle(23, 24, 25, 0),
gsSP2Triangles(26, 27, 28, 0, 27, 29, 28, 0),
gsSP1Triangle(27, 30, 29, 0),
gsSPVertex(&sChildZeldaSkelVtx_00A3D0[0], 28, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP2Triangles(3, 4, 5, 0, 4, 3, 6, 0),
gsSP2Triangles(7, 8, 9, 0, 10, 9, 8, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005DB0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 1023, 256),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(11, 12, 13, 0, 12, 14, 13, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(15, 16, 17, 0, 17, 18, 15, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0059F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(19, 20, 21, 0, 22, 23, 21, 0),
gsSP1Triangle(21, 20, 22, 0),
gsSP2Triangles(24, 25, 26, 0, 26, 27, 24, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPVertex(&sChildZeldaSkelVtx_00A590[0], 10, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001DF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP1Triangle(4, 5, 6, 0),
gsSP1Triangle(7, 8, 9, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00AFC8[] = {
gsSPMatrix(0x0D000200, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_007EB0[0], 10, 0),
gsSPMatrix(0x0D0003C0, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0028F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_007F50[0], 18, 10),
gsSP2Triangles(1, 10, 0, 0, 11, 2, 12, 0),
gsSP2Triangles(2, 3, 13, 0, 14, 3, 15, 0),
gsSP2Triangles(9, 16, 4, 0, 17, 5, 0, 0),
gsSP2Triangles(18, 7, 5, 0, 6, 19, 20, 0),
gsSP2Triangles(21, 7, 22, 0, 8, 23, 9, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001E30),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 1, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 5, 0, 1, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 124),
gsDPSetTileSize(0, 0, 0, 60, 124),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(24, 25, 26, 0, 27, 24, 26, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_002230),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_008070[0], 28, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 1, 3, 0),
gsSP2Triangles(4, 2, 3, 0, 5, 6, 4, 0),
gsSP2Triangles(4, 3, 5, 0, 3, 1, 5, 0),
gsSP2Triangles(5, 7, 6, 0, 6, 7, 8, 0),
gsSP2Triangles(6, 8, 9, 0, 2, 10, 0, 0),
gsSP2Triangles(10, 2, 11, 0, 2, 12, 11, 0),
gsSP2Triangles(13, 11, 12, 0, 13, 10, 11, 0),
gsSP2Triangles(12, 14, 13, 0, 14, 15, 13, 0),
gsSP2Triangles(16, 15, 14, 0, 17, 16, 14, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_002270),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 4, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 60),
gsDPSetTileSize(0, 0, 0, 28, 60),
gsSP2Triangles(18, 19, 20, 0, 21, 19, 18, 0),
gsSP2Triangles(21, 22, 19, 0, 23, 19, 22, 0),
gsSP2Triangles(24, 19, 23, 0, 19, 24, 20, 0),
gsSP2Triangles(24, 23, 25, 0, 24, 25, 26, 0),
gsSP2Triangles(27, 25, 22, 0, 25, 23, 22, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0022F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 5, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 124),
gsDPSetTileSize(0, 0, 0, 60, 124),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_008230[0], 22, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0),
gsSP2Triangles(2, 1, 4, 0, 1, 5, 4, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0024F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0026F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(12, 13, 14, 0, 15, 12, 14, 0),
gsSP2Triangles(14, 16, 15, 0, 17, 18, 19, 0),
gsSP2Triangles(17, 19, 20, 0, 17, 20, 21, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0028F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_008390[0], 17, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_002970),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(12, 13, 14, 0, 14, 15, 16, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0029F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 3, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 28),
gsDPSetTileSize(0, 0, 0, 60, 28),
gsSPVertex(&sChildZeldaSkelVtx_0084A0[0], 23, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(5, 6, 3, 0, 7, 8, 9, 0),
gsSP2Triangles(8, 10, 9, 0, 11, 10, 8, 0),
gsSP2Triangles(11, 8, 12, 0, 13, 14, 15, 0),
gsSP2Triangles(15, 16, 13, 0, 17, 18, 19, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_002970),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP1Triangle(20, 21, 22, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0028F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_008610[0], 28, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 1, 4, 0),
gsSP2Triangles(3, 5, 1, 0, 5, 2, 1, 0),
gsSP2Triangles(6, 7, 8, 0, 7, 0, 2, 0),
gsSP2Triangles(3, 9, 5, 0, 3, 10, 9, 0),
gsSP2Triangles(11, 12, 8, 0, 7, 13, 8, 0),
gsSP2Triangles(13, 11, 8, 0, 7, 2, 13, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001DF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(14, 15, 16, 0, 17, 16, 15, 0),
gsSP2Triangles(18, 17, 15, 0, 19, 20, 21, 0),
gsSP2Triangles(20, 22, 23, 0, 20, 19, 22, 0),
gsSP2Triangles(24, 25, 26, 0, 26, 25, 27, 0),
gsSPVertex(&sChildZeldaSkelVtx_0087D0[0], 26, 0),
gsSP2Triangles(0, 1, 2, 0, 1, 0, 3, 0),
gsSP2Triangles(4, 5, 6, 0, 7, 8, 9, 0),
gsSP2Triangles(8, 10, 9, 0, 11, 8, 7, 0),
gsSP2Triangles(11, 10, 8, 0, 9, 10, 12, 0),
gsSP2Triangles(13, 14, 0, 0, 7, 15, 11, 0),
gsSP2Triangles(16, 5, 4, 0, 0, 17, 3, 0),
gsSP2Triangles(18, 19, 20, 0, 21, 15, 22, 0),
gsSP2Triangles(20, 23, 22, 0, 20, 19, 23, 0),
gsSP2Triangles(22, 23, 21, 0, 23, 19, 21, 0),
gsSP2Triangles(24, 25, 0, 0, 24, 0, 14, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000870),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, 0x08000000),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSPVertex(&sChildZeldaSkelVtx_008970[0], 19, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 2, 4, 0),
gsSP2Triangles(3, 5, 0, 0, 0, 2, 3, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000870),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, 0x09000000),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP2Triangles(6, 7, 8, 0, 8, 9, 6, 0),
gsSP2Triangles(10, 7, 6, 0, 7, 11, 8, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000A70),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, 0x0A000000),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP2Triangles(12, 13, 14, 0, 14, 13, 15, 0),
gsSP2Triangles(12, 16, 13, 0, 17, 18, 13, 0),
gsSP1Triangle(13, 16, 17, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00B8D8[] = {
gsSPMatrix(0x0D000200, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_0098A0[0], 7, 0),
gsSPMatrix(0x0D000300, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001DF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_009910[0], 21, 7),
gsSP2Triangles(7, 5, 3, 0, 3, 8, 9, 0),
gsSP2Triangles(10, 11, 1, 0, 1, 5, 12, 0),
gsSP2Triangles(4, 6, 13, 0, 6, 14, 15, 0),
gsSP2Triangles(0, 16, 17, 0, 6, 0, 18, 0),
gsSP1Triangle(19, 0, 2, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(20, 21, 22, 0, 22, 23, 20, 0),
gsSP2Triangles(24, 25, 26, 0, 26, 27, 24, 0),
gsSPVertex(&sChildZeldaSkelVtx_009A60[0], 27, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsSP2Triangles(4, 5, 6, 0, 6, 7, 4, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005A70),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(8, 9, 10, 0, 10, 11, 8, 0),
gsSP2Triangles(12, 8, 11, 0, 11, 13, 12, 0),
gsSP1Triangle(10, 9, 14, 0),
gsSP2Triangles(15, 16, 17, 0, 16, 15, 18, 0),
gsSP2Triangles(17, 19, 15, 0, 18, 20, 16, 0),
gsSP2Triangles(21, 22, 23, 0, 23, 24, 21, 0),
gsSP2Triangles(25, 21, 24, 0, 24, 26, 25, 0),
gsSPVertex(&sChildZeldaSkelVtx_009C10[0], 7, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 1, 3, 0),
gsSP2Triangles(3, 4, 2, 0, 4, 3, 5, 0),
gsSP1Triangle(5, 6, 4, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00BB40[] = {
gsSPMatrix(0x0D000300, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_009660[0], 8, 0),
gsSPMatrix(0x0D000340, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005A70),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_0096E0[0], 20, 8),
gsSP2Triangles(6, 4, 8, 0, 9, 10, 6, 0),
gsSP2Triangles(7, 11, 12, 0, 13, 0, 7, 0),
gsSP2Triangles(2, 1, 14, 0, 15, 16, 2, 0),
gsSP2Triangles(3, 17, 18, 0, 19, 5, 3, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0059F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(20, 21, 22, 0, 22, 23, 20, 0),
gsSP2Triangles(24, 25, 26, 0, 26, 27, 24, 0),
gsSPVertex(&sChildZeldaSkelVtx_009820[0], 8, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsSP2Triangles(4, 5, 6, 0, 6, 7, 4, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00BC90[] = {
gsSPMatrix(0x0D000340, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_009390[0], 5, 0),
gsSPMatrix(0x0D000380, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0058F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_0093E0[0], 12, 5),
gsSP2Triangles(5, 6, 0, 0, 0, 2, 7, 0),
gsSP2Triangles(1, 0, 8, 0, 9, 10, 1, 0),
gsSP2Triangles(11, 12, 2, 0, 2, 3, 13, 0),
gsSP2Triangles(4, 1, 14, 0, 15, 16, 4, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0056F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPVertex(&sChildZeldaSkelVtx_0094A0[0], 28, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 7, 5, 0, 8, 2, 9, 0),
gsSP2Triangles(2, 1, 9, 0, 10, 11, 12, 0),
gsSP2Triangles(12, 4, 10, 0, 5, 8, 3, 0),
gsSP2Triangles(11, 13, 12, 0, 8, 9, 0, 0),
gsSP2Triangles(12, 13, 14, 0, 1, 0, 9, 0),
gsSP2Triangles(2, 15, 0, 0, 5, 7, 16, 0),
gsSP2Triangles(3, 8, 15, 0, 14, 7, 6, 0),
gsSP2Triangles(4, 12, 5, 0, 0, 15, 8, 0),
gsSP2Triangles(14, 6, 12, 0, 16, 8, 5, 0),
gsSP1Triangle(5, 12, 6, 0),
gsSP2Triangles(17, 18, 19, 0, 18, 17, 20, 0),
gsSP2Triangles(18, 20, 21, 0, 22, 18, 21, 0),
gsSP2Triangles(21, 20, 23, 0, 21, 23, 24, 0),
gsSP2Triangles(25, 24, 23, 0, 25, 26, 24, 0),
gsSP1Triangle(26, 27, 24, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00BE70[] = {
gsSPMatrix(0x0D000200, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_008FB0[0], 7, 0),
gsSPMatrix(0x0D000240, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001DF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_009020[0], 20, 7),
gsSP2Triangles(7, 5, 3, 0, 8, 9, 5, 0),
gsSP2Triangles(10, 11, 0, 0, 12, 0, 5, 0),
gsSP1Triangle(1, 0, 13, 0),
gsSP2Triangles(4, 6, 14, 0, 15, 16, 4, 0),
gsSP2Triangles(2, 17, 18, 0, 19, 6, 2, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005A70),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(20, 21, 22, 0, 23, 21, 20, 0),
gsSP2Triangles(20, 24, 23, 0, 25, 23, 24, 0),
gsSP1Triangle(24, 26, 25, 0),
gsSPVertex(&sChildZeldaSkelVtx_009160[0], 31, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsSP2Triangles(3, 2, 4, 0, 4, 5, 3, 0),
gsSP2Triangles(6, 7, 8, 0, 9, 8, 7, 0),
gsSP2Triangles(8, 10, 6, 0, 7, 11, 9, 0),
gsSP2Triangles(12, 13, 14, 0, 14, 15, 12, 0),
gsSP2Triangles(15, 14, 16, 0, 16, 17, 15, 0),
gsSP1Triangle(18, 13, 12, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSP2Triangles(19, 20, 21, 0, 21, 22, 19, 0),
gsSP2Triangles(23, 24, 25, 0, 25, 26, 23, 0),
gsSP2Triangles(27, 28, 29, 0, 29, 30, 27, 0),
gsSPVertex(&sChildZeldaSkelVtx_009350[0], 4, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00C0E0[] = {
gsSPMatrix(0x0D000240, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_008D70[0], 8, 0),
gsSPMatrix(0x0D000280, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_005A70),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_008DF0[0], 20, 8),
gsSP2Triangles(8, 4, 0, 0, 0, 9, 10, 0),
gsSP2Triangles(11, 12, 1, 0, 1, 2, 13, 0),
gsSP2Triangles(14, 3, 6, 0, 6, 15, 16, 0),
gsSP2Triangles(17, 18, 7, 0, 7, 5, 19, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0059F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(20, 21, 22, 0, 22, 23, 20, 0),
gsSP2Triangles(24, 25, 26, 0, 26, 27, 24, 0),
gsSPVertex(&sChildZeldaSkelVtx_008F30[0], 8, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
gsSP2Triangles(4, 5, 6, 0, 6, 7, 4, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00C230[] = {
gsSPMatrix(0x0D000280, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_008AA0[0], 5, 0),
gsSPMatrix(0x0D0002C0, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0058F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_008AF0[0], 12, 5),
gsSP2Triangles(0, 5, 6, 0, 7, 2, 0, 0),
gsSP2Triangles(8, 0, 1, 0, 1, 9, 10, 0),
gsSP2Triangles(2, 11, 12, 0, 13, 3, 2, 0),
gsSP2Triangles(14, 1, 4, 0, 4, 15, 16, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0056F0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 255, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPVertex(&sChildZeldaSkelVtx_008BB0[0], 28, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(3, 6, 7, 0, 8, 0, 9, 0),
gsSP2Triangles(8, 1, 0, 0, 10, 11, 12, 0),
gsSP2Triangles(12, 4, 10, 0, 5, 9, 3, 0),
gsSP2Triangles(10, 13, 11, 0, 2, 8, 9, 0),
gsSP2Triangles(14, 13, 10, 0, 8, 2, 1, 0),
gsSP2Triangles(2, 15, 0, 0, 16, 6, 3, 0),
gsSP2Triangles(15, 9, 5, 0, 7, 6, 14, 0),
gsSP2Triangles(3, 10, 4, 0, 9, 15, 2, 0),
gsSP2Triangles(10, 7, 14, 0, 3, 9, 16, 0),
gsSP1Triangle(7, 10, 3, 0),
gsSP2Triangles(17, 18, 19, 0, 20, 19, 18, 0),
gsSP2Triangles(21, 20, 18, 0, 21, 18, 22, 0),
gsSP2Triangles(23, 20, 21, 0, 24, 23, 21, 0),
gsSP2Triangles(23, 24, 25, 0, 24, 26, 25, 0),
gsSP1Triangle(24, 27, 26, 0),
gsSPEndDisplayList(),
};
Gfx gChildZeldaCutsceneDressDL[] = {
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 1, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 1, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&object_zl4Vtx_0076B0[0], 23, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(4, 6, 5, 0, 7, 6, 4, 0),
gsSP2Triangles(7, 4, 8, 0, 9, 10, 11, 0),
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
gsSP2Triangles(18, 0, 2, 0, 19, 16, 15, 0),
gsSP2Triangles(14, 20, 21, 0, 9, 11, 22, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0016B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 3, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsSPVertex(&object_zl4Vtx_007820[0], 10, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 1, 0, 0),
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
gsSP2Triangles(7, 8, 4, 0, 8, 9, 4, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, object_zl4Tex_001BF0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 4, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 60),
gsDPSetTileSize(0, 0, 0, 28, 60),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&object_zl4Vtx_0078C0[0], 24, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 4, 7, 0, 8, 9, 10, 0),
gsSP2Triangles(11, 12, 13, 0, 10, 14, 15, 0),
gsSP2Triangles(16, 17, 18, 0, 19, 17, 20, 0),
gsSP1Triangle(21, 22, 23, 0),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, object_zl4Tex_001CF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSPVertex(&object_zl4Vtx_007A40[0], 32, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 1, 0, 0),
gsSP2Triangles(4, 1, 3, 0, 5, 6, 7, 0),
gsSP2Triangles(8, 9, 10, 0, 11, 6, 12, 0),
gsSP2Triangles(12, 13, 11, 0, 7, 14, 5, 0),
gsSP2Triangles(15, 16, 17, 0, 18, 19, 20, 0),
gsSP2Triangles(17, 21, 22, 0, 23, 24, 25, 0),
gsSP2Triangles(26, 27, 28, 0, 29, 30, 31, 0),
gsSPVertex(&object_zl4Vtx_007C40[0], 29, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP1Triangle(3, 5, 6, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001DF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(7, 8, 9, 0, 10, 8, 7, 0),
gsSP2Triangles(11, 12, 13, 0, 13, 14, 11, 0),
gsSP2Triangles(15, 16, 17, 0, 18, 19, 20, 0),
gsSP2Triangles(21, 22, 23, 0, 23, 24, 21, 0),
gsSP2Triangles(25, 26, 27, 0, 28, 19, 18, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 1, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 1, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&object_zl4Vtx_007E10[0], 10, 0),
gsSP2Triangles(0, 1, 2, 0, 2, 1, 3, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, object_zl4Tex_001CF0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 0, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 0, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(4, 5, 6, 0, 7, 8, 9, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00C8D0[] = {
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_007160[0], 30, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(1, 5, 2, 0, 5, 1, 3, 0),
gsSP2Triangles(6, 4, 7, 0, 6, 7, 8, 0),
gsSP2Triangles(9, 6, 8, 0, 9, 8, 10, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0016B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 3, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsSP2Triangles(11, 12, 13, 0, 11, 13, 14, 0),
gsSP2Triangles(15, 16, 17, 0, 18, 15, 17, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 1, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 1, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(19, 20, 21, 0, 19, 22, 20, 0),
gsSP2Triangles(23, 24, 25, 0, 23, 25, 26, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0016B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 3, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsSP1Triangle(27, 28, 29, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 1, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 1, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_007340[0], 28, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(3, 4, 5, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(6, 7, 8, 0, 7, 6, 9, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000DB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 6, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 1023, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 6, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsSP1Triangle(10, 11, 12, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(13, 14, 15, 0, 15, 16, 13, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017F0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 5, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 5, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsDPSetTileSize(0, 0, 0, 124, 124),
gsSP2Triangles(17, 18, 19, 0, 19, 18, 20, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP1Triangle(21, 22, 23, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0017B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 1, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 1, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSP2Triangles(24, 25, 26, 0, 27, 24, 26, 0),
gsSPVertex(&sChildZeldaSkelVtx_007500[0], 27, 0),
gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
gsSP1Triangle(4, 5, 6, 0),
gsSP1Triangle(7, 8, 9, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0016B0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 3, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsDPSetTileSize(0, 0, 0, 124, 28),
gsSP1Triangle(10, 11, 12, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000DB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 6, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 1023, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 6, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsSP1Triangle(13, 14, 15, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP2Triangles(16, 17, 18, 0, 19, 18, 17, 0),
gsSP2Triangles(20, 21, 22, 0, 22, 23, 20, 0),
gsSP1Triangle(24, 25, 26, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D0E8[] = {
gsSPMatrix(0x0D000000, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_006A20[0], 10, 0),
gsSPMatrix(0x0D000140, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_006AC0[0], 20, 10),
gsSP2Triangles(0, 4, 10, 0, 11, 12, 8, 0),
gsSP2Triangles(8, 1, 13, 0, 14, 15, 0, 0),
gsSP2Triangles(16, 0, 17, 0, 18, 1, 0, 0),
gsSP2Triangles(8, 19, 20, 0, 21, 22, 8, 0),
gsSP2Triangles(3, 2, 23, 0, 24, 3, 25, 0),
gsSP2Triangles(3, 26, 27, 0, 28, 2, 8, 0),
gsSP1Triangle(29, 5, 3, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000DB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 6, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 1023, 512),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 4, 0, 0, 0, 2, 6, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsDPSetTileSize(0, 0, 0, 124, 252),
gsSPVertex(&sChildZeldaSkelVtx_006C00[0], 6, 10),
gsSP2Triangles(10, 11, 7, 0, 12, 6, 7, 0),
gsSP2Triangles(7, 13, 14, 0, 7, 9, 15, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D2A0[] = {
gsSPMatrix(0x0D000140, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_0067C0[0], 10, 0),
gsSPMatrix(0x0D000180, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_006860[0], 20, 10),
gsSP2Triangles(2, 10, 0, 0, 2, 11, 12, 0),
gsSP2Triangles(3, 13, 14, 0, 2, 3, 15, 0),
gsSP2Triangles(5, 16, 3, 0, 3, 17, 18, 0),
gsSP2Triangles(5, 19, 20, 0, 5, 21, 22, 0),
gsSP2Triangles(23, 24, 8, 0, 25, 26, 8, 0),
gsSP2Triangles(27, 28, 4, 0, 4, 29, 8, 0),
gsSPVertex(&sChildZeldaSkelVtx_0069A0[0], 8, 10),
gsSP2Triangles(10, 4, 1, 0, 11, 12, 4, 0),
gsSP2Triangles(13, 14, 1, 0, 0, 15, 1, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000CB0),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 4, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 127, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0, 0, 0, 2, 4, 0, 2, 4, 0),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsDPSetTileSize(0, 0, 0, 60, 60),
gsSP1Triangle(16, 6, 7, 0),
gsSP1Triangle(7, 9, 17, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D460[] = {
gsSPMatrix(0x0D000180, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_0065B0[0], 9, 0),
gsSPMatrix(0x0D0001C0, 0x02),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000670),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 256, 7, 0, 0, 0, 0, 0, 0, 0),
gsDPLoadSync(),
gsDPLoadTLUTCmd(7, 255),
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_CI, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_000C70),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 31, 2048),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK),
gsSPVertex(&sChildZeldaSkelVtx_006640[0], 23, 9),
gsSP2Triangles(1, 9, 0, 0, 1, 10, 11, 0),
gsSP2Triangles(2, 12, 1, 0, 13, 14, 1, 0),
gsSP2Triangles(15, 2, 3, 0, 16, 17, 2, 0),
gsSP2Triangles(7, 18, 3, 0, 19, 20, 3, 0),
gsSP2Triangles(4, 21, 22, 0, 4, 23, 8, 0),
gsSP2Triangles(5, 24, 25, 0, 4, 5, 26, 0),
gsSP2Triangles(6, 27, 28, 0, 6, 29, 5, 0),
gsSP1Triangle(30, 31, 6, 0),
gsSPVertex(&sChildZeldaSkelVtx_0067B0[0], 1, 9),
gsSP1Triangle(0, 9, 6, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D598[] = {
gsSPTexture(65535, 65535, 0, 0, G_OFF),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(PRIMITIVE, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, 1,
K5, K5, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_007130[0], 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D5E8[] = {
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001630),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_006EE0[0], 25, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 7, 8, 0, 9, 10, 7, 0),
gsSP2Triangles(6, 9, 7, 0, 2, 11, 12, 0),
gsSP2Triangles(0, 2, 12, 0, 13, 14, 4, 0),
gsSP2Triangles(15, 0, 12, 0, 4, 16, 17, 0),
gsSP2Triangles(15, 1, 0, 0, 18, 19, 20, 0),
gsSP2Triangles(15, 21, 1, 0, 22, 4, 23, 0),
gsSP1Triangle(19, 24, 20, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0015B0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 0, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 0, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_007070[0], 12, 0),
gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
gsSP2Triangles(4, 5, 6, 0, 7, 8, 9, 0),
gsSP2Triangles(10, 7, 9, 0, 11, 4, 6, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D728[] = {
gsSPTexture(65535, 65535, 0, 0, G_OFF),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(PRIMITIVE, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, 1,
K5, K5, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_006EB0[0], 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
};
Gfx sChildZeldaSkelLimbDL_00D778[] = {
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, TEXEL0,
PRIMITIVE, K5, COMBINED, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_0015B0),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 0, 3, 0, 2, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 0, 3, 0, 2, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(&sChildZeldaSkelVtx_006C60[0], 12, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0),
gsSP2Triangles(4, 5, 6, 0, 7, 8, 9, 0),
gsSP2Triangles(7, 9, 10, 0, 4, 6, 11, 0),
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sChildZeldaSkelTex_001630),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 3, 0, 0, 3, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 63, 1024),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsDPSetTileSize(0, 0, 0, 28, 28),
gsSPVertex(&sChildZeldaSkelVtx_006D20[0], 25, 0),
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
gsSP2Triangles(6, 7, 8, 0, 7, 9, 10, 0),
gsSP2Triangles(7, 10, 8, 0, 11, 12, 0, 0),
gsSP2Triangles(11, 0, 2, 0, 4, 13, 14, 0),
gsSP2Triangles(11, 2, 15, 0, 16, 17, 4, 0),
gsSP2Triangles(2, 1, 15, 0, 18, 19, 20, 0),
gsSP2Triangles(1, 21, 15, 0, 22, 4, 23, 0),
gsSP1Triangle(18, 24, 19, 0),
gsSPEndDisplayList(),
};
u64 object_zl4Tex_00D8B8[] = {
#include "assets/objects/object_zl4//object_zl4Tex_00D8B8.rgb5a1.inc.c"
};
static Vtx object_zl4Vtx_00DCB8[21] = {
VTX(402, 336, 159, 249, 172, 34, 76, 170, 255),
VTX(487, 168, 139, 489, 344, 107, 26, 209, 255),
VTX(381, 204, 47, 501, 85, 40, 50, 155, 255),
VTX(248, 199, 57, 502, -41, 193, 52, 168, 255),
VTX(371, -37, -20, 871, 139, 50, 2, 147, 255),
VTX(462, 406, 367, 19, 470, 108, 10, 49, 255),
VTX(360, 511, 443, -171, 396, 255, 84, 85, 255),
VTX(379, 404, 434, -20, 473, 252, 230, 116, 255),
VTX(441, 435, 301, 23, 342, 78, 82, 218, 255),
VTX(419, 400, 236, 112, 254, 46, 83, 184, 255),
VTX(325, 484, 333, -64, 229, 203, 101, 222, 255),
VTX(284, 387, 213, 147, 86, 188, 81, 200, 255),
VTX(467, -42, 100, 798, 405, 107, 216, 222, 255),
VTX(465, 38, 206, 622, 493, 113, 20, 34, 255),
VTX(275, 112, 235, 504, 281, 151, 236, 54, 255),
VTX(394, -2, 293, 621, 558, 241, 241, 118, 255),
VTX(547, -111, 440, 671, 988, 87, 250, 82, 255),
VTX(391, -115, 239, 808, 556, 223, 168, 74, 255),
VTX(354, -242, 132, 1049, 453, 6, 152, 58, 255),
VTX(249, -71, -26, 921, 21, 165, 241, 180, 255),
VTX(308, -240, 39, 1107, 278, 246, 159, 187, 255),
};
Gfx gChildZeldaOcarinaOfTimeDL[] = {
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(65535, 65535, 0, 0, G_ON),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, object_zl4Tex_00D8B8),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, 7, 0, 2, 4, 0, 2, 5, 0),
gsDPLoadSync(),
gsDPLoadBlock(7, 0, 0, 511, 256),
gsDPPipeSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, 2, 4, 0, 2, 5, 0),
gsDPSetTileSize(0, 0, 0, 124, 60),
gsDPSetCombineLERP(TEXEL0, K5, SHADE, COMBINED_ALPHA, 0, 0, 0, 1,
COMBINED, K5, PRIMITIVE, COMBINED_ALPHA, 0, 0, 0, COMBINED),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsSPClearGeometryMode(G_TEXTURE_ENABLE | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPSetGeometryMode(G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING),
gsDPSetPrimColor(0, 0, 255, 255, 255, 255),
gsSPVertex(&object_zl4Vtx_00DCB8[0], 21, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(4, 3, 2, 0, 4, 2, 1, 0),
gsSP2Triangles(5, 6, 7, 0, 8, 9, 10, 0),
gsSP2Triangles(10, 6, 8, 0, 5, 8, 6, 0),
gsSP2Triangles(11, 9, 0, 0, 10, 9, 11, 0),
gsSP2Triangles(12, 1, 13, 0, 11, 3, 14, 0),
gsSP2Triangles(11, 0, 3, 0, 0, 9, 1, 0),
gsSP2Triangles(12, 4, 1, 0, 1, 9, 8, 0),
gsSP2Triangles(1, 8, 5, 0, 14, 10, 11, 0),
gsSP2Triangles(1, 5, 13, 0, 15, 13, 5, 0),
gsSP2Triangles(15, 5, 7, 0, 7, 14, 15, 0),
gsSP2Triangles(10, 14, 6, 0, 6, 14, 7, 0),
gsSP2Triangles(12, 13, 16, 0, 12, 16, 17, 0),
gsSP2Triangles(17, 16, 15, 0, 15, 16, 13, 0),
gsSP2Triangles(17, 15, 14, 0, 17, 14, 18, 0),
gsSP2Triangles(14, 19, 20, 0, 14, 20, 18, 0),
gsSP2Triangles(4, 19, 3, 0, 3, 19, 14, 0),
gsSP2Triangles(12, 17, 18, 0, 12, 18, 20, 0),
gsSP2Triangles(12, 20, 4, 0, 20, 19, 4, 0),
gsSPEndDisplayList(),
};
StandardLimb sChildZeldaSkelLimb_00DF28 = { { 0, 2523, 0 }, 1, 255, NULL };
StandardLimb sChildZeldaSkelLimb_00DF34 = { { 0, 0, 0 }, 2, 9, sChildZeldaSkelLimbDL_00C8D0 };
StandardLimb sChildZeldaSkelLimb_00DF40 = { { 500, 100, 250 }, 3, 4, sChildZeldaSkelLimbDL_00D728 };
StandardLimb sChildZeldaSkelLimb_00DF4C = { { 900, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00D778 };
StandardLimb sChildZeldaSkelLimb_00DF58 = { { 500, 100, -250 }, 5, 6, sChildZeldaSkelLimbDL_00D598 };
StandardLimb sChildZeldaSkelLimb_00DF64 = { { 900, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00D5E8 };
StandardLimb sChildZeldaSkelLimb_00DF70 = { { 550, 0, 0 }, 7, 255, sChildZeldaSkelLimbDL_00D0E8 };
StandardLimb sChildZeldaSkelLimb_00DF7C = { { 900, 0, 0 }, 8, 255, sChildZeldaSkelLimbDL_00D2A0 };
StandardLimb sChildZeldaSkelLimb_00DF88 = { { 700, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00D460 };
StandardLimb sChildZeldaSkelLimb_00DF94 = { { 0, 0, 0 }, 10, 255, sChildZeldaSkelLimbDL_00A630 };
StandardLimb sChildZeldaSkelLimb_00DFA0 = { { 600, -50, 450 }, 11, 13, sChildZeldaSkelLimbDL_00BE70 };
StandardLimb sChildZeldaSkelLimb_00DFAC = { { 700, 0, 0 }, 12, 255, sChildZeldaSkelLimbDL_00C0E0 };
StandardLimb sChildZeldaSkelLimb_00DFB8 = { { 600, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00C230 };
StandardLimb sChildZeldaSkelLimb_00DFC4 = { { 600, -50, -450 }, 14, 16, sChildZeldaSkelLimbDL_00B8D8 };
StandardLimb sChildZeldaSkelLimb_00DFD0 = { { 702, 0, 0 }, 15, 255, sChildZeldaSkelLimbDL_00BB40 };
StandardLimb sChildZeldaSkelLimb_00DFDC = { { 604, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00BC90 };
StandardLimb sChildZeldaSkelLimb_00DFE8 = { { 1100, 0, 0 }, 255, 255, sChildZeldaSkelLimbDL_00AFC8 };
static void* sChildZeldaSkelLimbs[17] = {
&sChildZeldaSkelLimb_00DF28,
&sChildZeldaSkelLimb_00DF34,
&sChildZeldaSkelLimb_00DF40,
&sChildZeldaSkelLimb_00DF4C,
&sChildZeldaSkelLimb_00DF58,
&sChildZeldaSkelLimb_00DF64,
&sChildZeldaSkelLimb_00DF70,
&sChildZeldaSkelLimb_00DF7C,
&sChildZeldaSkelLimb_00DF88,
&sChildZeldaSkelLimb_00DF94,
&sChildZeldaSkelLimb_00DFA0,
&sChildZeldaSkelLimb_00DFAC,
&sChildZeldaSkelLimb_00DFB8,
&sChildZeldaSkelLimb_00DFC4,
&sChildZeldaSkelLimb_00DFD0,
&sChildZeldaSkelLimb_00DFDC,
&sChildZeldaSkelLimb_00DFE8,
};
FlexSkeletonHeader gChildZeldaSkel = { sChildZeldaSkelLimbs, 17, 16 };
static u8 unaccounted_00E044[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_00E5C8FrameData[646] = {
0x0000, 0x09D8, 0x0006, 0x4000, 0xFFC3, 0x09D8, 0x09D3, 0x09CD, 0x09C7, 0x09C0, 0x09B9, 0x09B2, 0x09AA, 0x09A2,
0x099B, 0x0993, 0x098C, 0x0985, 0x097E, 0x0978, 0x0972, 0x096C, 0x0967, 0x0963, 0x0960, 0x0006, 0x000B, 0x000E,
0x0011, 0x0013, 0x0014, 0x0014, 0x0013, 0x0012, 0x0011, 0x000F, 0x000D, 0x000B, 0x0008, 0x0006, 0x0004, 0x0003,
0x0001, 0x0000, 0x0000, 0xBF13, 0xBF16, 0xBF19, 0xBF1B, 0xBF1D, 0xBF1F, 0xBF20, 0xBF21, 0xBF22, 0xBF23, 0xBF24,
0xBF23, 0xBF22, 0xBF22, 0xBF22, 0xBF21, 0xBF21, 0xBF21, 0xBF22, 0xBF22, 0x001C, 0x0033, 0x0044, 0x0051, 0x0059,
0x005D, 0x005E, 0x005C, 0x0057, 0x0051, 0x0048, 0x0475, 0x05C9, 0x069E, 0x0719, 0x078B, 0x07F1, 0x084C, 0x0878,
0x08AB, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xBFE9, 0xBFE2,
0xBFDD, 0xBFDA, 0xBFD7, 0xBFD5, 0xBFD3, 0xBFD2, 0xBFD1, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF66B,
0xF5B2, 0xF4F6, 0xF43B, 0xF382, 0xF2CC, 0xF21B, 0xF170, 0xF0CB, 0xF02E, 0xEF99, 0xEB08, 0xE94C, 0xE80A, 0xE71D,
0xE645, 0xE583, 0xE4DB, 0xE467, 0xE401, 0x0D3C, 0x0E7C, 0x0FC3, 0x1109, 0x124D, 0x138B, 0x14C0, 0x15EC, 0x170C,
0x1820, 0x1926, 0x17EA, 0x17FA, 0x1849, 0x18C5, 0x1933, 0x1994, 0x19E7, 0x1A47, 0x1A88, 0xF689, 0xF5D2, 0xF518,
0xF45E, 0xF3A6, 0xF2F1, 0xF241, 0xF197, 0xF0F3, 0xF057, 0xEFC2, 0xEB2B, 0xE96D, 0xE829, 0xE73C, 0xE664, 0xE5A3,
0xE4FA, 0xE487, 0xE420, 0x0D72, 0x0EAE, 0x0FF0, 0x1133, 0x1274, 0x13AF, 0x14E3, 0x160D, 0x172C, 0x183E, 0x1943,
0x1813, 0x1826, 0x1876, 0x18F2, 0x1961, 0x19C2, 0x1A15, 0x1A75, 0x1AB6, 0x0000, 0x0001, 0x0002, 0x0003, 0x0003,
0x0004, 0x0005, 0x0005, 0x0006, 0x0006, 0x0007, 0x0007, 0x0008, 0x0008, 0x0009, 0x0009, 0x000A, 0x000A, 0x000A,
0x000B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF818, 0xF511,
0xF2F4, 0xF18D, 0xF043, 0xEF1A, 0xEE15, 0xED81, 0xECEF, 0xFFFF, 0xFFFE, 0xFFFD, 0xFFFC, 0xFFFB, 0xFFFA, 0xFFF9,
0xFFF8, 0xFFF7, 0xFFF6, 0xFFF5, 0xFFF4, 0xFFF4, 0xFFF3, 0xFFF3, 0xFFF2, 0xFFF2, 0xFFF1, 0xFFF1, 0xFFF0, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0002, 0x0002,
0x0003, 0x0003, 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0521, 0x07D8, 0x09FB, 0x0B91, 0x0D07, 0x0E57, 0x0F7E, 0x1039, 0x10E4, 0xFFFF, 0xFFFF, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFD, 0xFFFD, 0xFFFC, 0xFFFC, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFF9, 0xFFF9,
0xFFF9, 0xFFF9, 0xFFF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x002A, 0xFF54, 0xFEBE, 0xFE6F,
0xFE42, 0xFE2C, 0xFE27, 0xFE2F, 0xFE3E, 0xFE53, 0xFE6A, 0xFE83, 0xFE9A, 0xFEAF, 0xFEBF, 0xFECB, 0xFED0, 0xFECE,
0xFEC4, 0xF510, 0xF50A, 0xF50A, 0xF510, 0xF512, 0xF50D, 0xF4FF, 0xF4E9, 0xF4CA, 0xF4A4, 0xF477, 0xF446, 0xF412,
0xF3DD, 0xF3A9, 0xF379, 0xF34F, 0xF32D, 0xF315, 0xF309, 0x7E9E, 0x7EC3, 0x82ED, 0x8662, 0x8905, 0x8B4D, 0x8D59,
0x8F36, 0x90E9, 0x9277, 0x93E0, 0x9526, 0x9649, 0x974A, 0x9828, 0x98E5, 0x997F, 0x99F7, 0x9A4C, 0x9A7D, 0xFFAE,
0xFFAD, 0xF733, 0xF01E, 0xEAAD, 0xE5E8, 0xE190, 0xDD8C, 0xD9D1, 0xD65A, 0xD323, 0xD02E, 0xCD7B, 0xCB0D, 0xC8E7,
0xC70C, 0xC581, 0xC44C, 0xC373, 0xC2FD, 0x0021, 0x007F, 0x0114, 0x01D9, 0x02C7, 0x03D7, 0x0502, 0x0642, 0x078F,
0x08E4, 0x0A38, 0x0B85, 0x0CC5, 0x0DF0, 0x0F00, 0x0FEE, 0x10B3, 0x1148, 0x11A6, 0x11C7, 0xFFCF, 0xFF43, 0xFE67,
0xFD43, 0xFBE4, 0xFA51, 0xF896, 0xF6BD, 0xF4D0, 0xF2D8, 0xF0E1, 0xEEF3, 0xED1A, 0xEB5F, 0xE9CD, 0xE86D, 0xE74A,
0xE66D, 0xE5E1, 0xE5B0, 0x0028, 0x0099, 0x014C, 0x0238, 0x0355, 0x049C, 0x0603, 0x0782, 0x0912, 0x0AAB, 0x0C43,
0x0DD3, 0x0F53, 0x10BA, 0x1200, 0x131D, 0x140A, 0x14BC, 0x152E, 0x1555, 0xE57E, 0xE5F0, 0xE6C7, 0xE81B, 0xEA02,
0xEC87, 0xEF8D, 0xF2D3, 0xF5FE, 0xF8C7, 0xFB10, 0xFCDA, 0xFE3B, 0xFF4A, 0x0019, 0x00B8, 0x012F, 0x0186, 0x01BF,
0x01DC, 0x0F28, 0x0F7D, 0x0FF9, 0x1087, 0x1112, 0x1183, 0x11C3, 0x11C3, 0x117C, 0x10FA, 0x1052, 0x0F9A, 0x0EE6,
0x0E41, 0x0DB3, 0x0D40, 0x0CE9, 0x0CAD, 0x0C8B, 0x0C83, 0x608C, 0x6247, 0x654B, 0x699B, 0x6F30, 0x75DE, 0x7D3C,
0x84A9, 0x8B75, 0x911E, 0x956E, 0x9870, 0x9A54, 0x9B56, 0x9BB3, 0x9BA2, 0x9B56, 0x9AFE, 0x9AC0, 0x9ABB, 0xA373,
0xA259, 0xA0FE, 0x9F93, 0x9E5A, 0x9D97, 0x9D8B, 0x9E64, 0xA02E, 0xA2D5, 0xA62F, 0xAA0A, 0xAE33, 0xB278, 0xB6A7,
0xBA8B, 0xBDED, 0xC08E, 0xC231, 0xC29C, 0xFFDF, 0xFF81, 0xFEEC, 0xFE27, 0xFD39, 0xFC29, 0xFAFE, 0xF9BE, 0xF871,
0xF71C, 0xF5C8, 0xF47B, 0xF33B, 0xF210, 0xF100, 0xF012, 0xEF4D, 0xEEB8, 0xEE5A, 0xEE39, 0x0031, 0x00BD, 0x0199,
0x02BD, 0x041C, 0x05AF, 0x076A, 0x0943, 0x0B30, 0x0D28, 0x0F1F, 0x110D, 0x12E6, 0x14A1, 0x1633, 0x1793, 0x18B6,
0x1993, 0x1A1F, 0x1A50, 0x0028, 0x0099, 0x014C, 0x0238, 0x0355, 0x049C, 0x0603, 0x0782, 0x0912, 0x0AAB, 0x0C43,
0x0DD3, 0x0F53, 0x10BA, 0x1200, 0x131D, 0x140A, 0x14BC, 0x152E, 0x1555, 0x072A, 0x074F, 0x078B, 0x07DA, 0x0839,
0x08A6, 0x091D, 0x099D, 0x0A23, 0x0AAB, 0x0B33, 0x0BB8, 0x0C38, 0x0CB0, 0x0D1C, 0x0D7C, 0x0DCA, 0x0E06, 0x0E2C,
0x0E39, 0x0000,
};
static JointIndex sChildZeldaAnim_00E5C8JointIndices[18] = {
{ 0x0000, 0x0005, 0x0019 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x002D, 0x0041, 0x0055 },
{ 0x0000, 0x0069, 0x007D },
{ 0x0000, 0x0000, 0x0091 },
{ 0x0000, 0x0000, 0x00A5 },
{ 0x0000, 0x0000, 0x00B9 },
{ 0x00CD, 0x0000, 0x00E1 },
{ 0x00F5, 0x0109, 0x011D },
{ 0x0131, 0x0000, 0x0145 },
{ 0x0003, 0x0004, 0x0003 },
{ 0x0159, 0x016D, 0x0181 },
{ 0x0000, 0x0000, 0x0195 },
{ 0x01A9, 0x01BD, 0x01D1 },
{ 0x01E5, 0x01F9, 0x020D },
{ 0x0000, 0x0000, 0x0221 },
{ 0x0235, 0x0249, 0x025D },
{ 0x0000, 0x0000, 0x0271 },
};
AnimationHeader gChildZeldaAnim_00E5C8 = { { 20 }, sChildZeldaAnim_00E5C8FrameData, sChildZeldaAnim_00E5C8JointIndices, 5 };
static u8 unaccounted_00E5D8[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_00EBC4FrameData[700] = {
0x0000, 0x095E, 0x0002, 0x4000, 0xFFC3, 0x11C7, 0xE5B0, 0x1555, 0xEE39, 0x1A50, 0x095E, 0x095D, 0x095D, 0x095E,
0x0960, 0x0963, 0x0966, 0x0969, 0x096C, 0x096F, 0x0972, 0x0975, 0x0977, 0x0979, 0x0979, 0x0979, 0x0977, 0x0975,
0x0973, 0x0970, 0x096D, 0x096A, 0x0967, 0x0964, 0x0962, 0x0960, 0x095E, 0x095E, 0x095E, 0x0960, 0xBF23, 0xBF23,
0xBF24, 0xBF25, 0xBF25, 0xBF26, 0xBF27, 0xBF28, 0xBF28, 0xBF29, 0xBF2A, 0xBF2A, 0xBF2B, 0xBF2B, 0xBF2B, 0xBF2B,
0xBF2C, 0xBF2C, 0xBF2C, 0xBF2B, 0xBF2B, 0xBF2B, 0xBF2B, 0xBF2B, 0xBF2A, 0xBF2A, 0xBF2A, 0xBF2A, 0xBF2A, 0xBF2A,
0x08CD, 0x08DC, 0x08DB, 0x08CC, 0x08B2, 0x08AC, 0x0873, 0x0834, 0x07F4, 0x07B6, 0x077B, 0x0748, 0x0720, 0x0706,
0x06FE, 0x0707, 0x0720, 0x0746, 0x0775, 0x07AC, 0x07E6, 0x0822, 0x085D, 0x0893, 0x08C3, 0x08C3, 0x08D6, 0x08DD,
0x08D6, 0x08BF, 0xBFD1, 0xBFD0, 0xBFD1, 0xBFD1, 0xBFD2, 0xBFD2, 0xBFD3, 0xBFD5, 0xBFD6, 0xBFD8, 0xBFD9, 0xBFDA,
0xBFDB, 0xBFDB, 0xBFDC, 0xBFDC, 0xBFDB, 0xBFDA, 0xBFD9, 0xBFD8, 0xBFD7, 0xBFD6, 0xBFD5, 0xBFD3, 0xBFD2, 0xBFD2,
0xBFD2, 0xBFD2, 0xBFD2, 0xBFD2, 0xE3BD, 0xE3A1, 0xE3A5, 0xE3C6, 0xE3FE, 0xE432, 0xE497, 0xE505, 0xE578, 0xE5E9,
0xE653, 0xE6B0, 0xE6FA, 0xE72B, 0xE73C, 0xE72B, 0xE6FE, 0xE6BA, 0xE664, 0xE601, 0xE598, 0xE52C, 0xE4C4, 0xE463,
0xE40F, 0xE3EA, 0xE3C3, 0xE3B4, 0xE3C3, 0xE3F2, 0x1AB3, 0x1AC4, 0x1ABE, 0x1AA6, 0x1A7E, 0x1A32, 0x19FF, 0x19C7,
0x198B, 0x194E, 0x1915, 0x18E2, 0x18B8, 0x189D, 0x1892, 0x189B, 0x18B3, 0x18D8, 0x1907, 0x193B, 0x1973, 0x19AC,
0x19E2, 0x1A13, 0x1A3D, 0x1A7C, 0x1A96, 0x1AA0, 0x1A97, 0x1A78, 0xE3DC, 0xE3C0, 0xE3C4, 0xE3E4, 0xE41D, 0xE450,
0xE4B5, 0xE523, 0xE596, 0xE607, 0xE671, 0xE6CE, 0xE718, 0xE748, 0xE759, 0xE749, 0xE71C, 0xE6D7, 0xE681, 0xE61E,
0xE5B5, 0xE549, 0xE4E1, 0xE480, 0xE42C, 0xE408, 0xE3E0, 0xE3D2, 0xE3E0, 0xE40F, 0x1AE1, 0x1AF2, 0x1AEC, 0x1AD4,
0x1AAC, 0x1A60, 0x1A2D, 0x19F4, 0x19B8, 0x197C, 0x1942, 0x190F, 0x18E6, 0x18CA, 0x18C0, 0x18C8, 0x18E0, 0x1905,
0x1934, 0x1969, 0x19A1, 0x19D9, 0x1A0F, 0x1A41, 0x1A6B, 0x1AA9, 0x1AC4, 0x1ACE, 0x1AC5, 0x1AA6, 0x000B, 0x000B,
0x000C, 0x000C, 0x000C, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000E, 0x000E, 0x000E, 0x000E, 0x000E, 0x000E,
0x000E, 0x000E, 0x000E, 0x000E, 0x000E, 0x000F, 0x000F, 0x000F, 0x000F, 0x000E, 0x000E, 0x000E, 0x000E, 0x000E,
0xEC90, 0xEC69, 0xEC6F, 0xEC9D, 0xECED, 0xED19, 0xEDB5, 0xEE60, 0xEF10, 0xEFBC, 0xF05C, 0xF0E7, 0xF155, 0xF19D,
0xF1B6, 0xF19D, 0xF15A, 0xF0F5, 0xF075, 0xEFE1, 0xEF42, 0xEE9F, 0xEE00, 0xED6C, 0xECEB, 0xECD4, 0xEC9D, 0xEC88,
0xEC9C, 0xECDF, 0xFFF0, 0xFFEF, 0xFFEF, 0xFFEE, 0xFFEE, 0xFFEE, 0xFFED, 0xFFED, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEB,
0xFFEB, 0xFFEB, 0xFFEB, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEB, 0xFFEB, 0xFFEB,
0xFFEB, 0xFFEB, 0xFFEB, 0xFFEB, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0004,
0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, 0x0005, 0x0005, 0x0005, 0x0006,
0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x1152, 0x117F, 0x1173, 0x1137, 0x10D3, 0x1085, 0x0FCF, 0x0F09,
0x0E3E, 0x0D77, 0x0CBE, 0x0C1D, 0x0B9E, 0x0B4A, 0x0B2C, 0x0B47, 0x0B93, 0x0C06, 0x0C98, 0x0D41, 0x0DF7, 0x0EB1,
0x0F67, 0x1011, 0x10A4, 0x10D6, 0x1119, 0x1133, 0x111C, 0x10CC, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF7, 0xFFF7, 0xFFF7,
0xFFF7, 0xFFF7, 0xFFF7, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6,
0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFEB9, 0xFEB4, 0xFEB5, 0xFEBB,
0xFEC4, 0xFED1, 0xFEE0, 0xFEF0, 0xFF01, 0xFF11, 0xFF21, 0xFF2E, 0xFF38, 0xFF3F, 0xFF42, 0xFF3F, 0xFF39, 0xFF30,
0xFF23, 0xFF15, 0xFF06, 0xFEF6, 0xFEE7, 0xFED9, 0xFECC, 0xFEC3, 0xFEBC, 0xFEBA, 0xFEBC, 0xFEC4, 0xF305, 0xF303,
0xF303, 0xF306, 0xF309, 0xF30E, 0xF314, 0xF31A, 0xF321, 0xF327, 0xF32D, 0xF333, 0xF337, 0xF33A, 0xF33B, 0xF33A,
0xF337, 0xF333, 0xF32E, 0xF329, 0xF323, 0xF31D, 0xF317, 0xF311, 0xF30C, 0xF309, 0xF306, 0xF305, 0xF306, 0xF309,
0x9A93, 0x9A9C, 0x9A9A, 0x9A8F, 0x9A7B, 0x9A61, 0x9A43, 0x9A21, 0x99FE, 0x99DC, 0x99BB, 0x999F, 0x9988, 0x997A,
0x9974, 0x9979, 0x9987, 0x999B, 0x99B5, 0x99D3, 0x99F3, 0x9A14, 0x9A34, 0x9A51, 0x9A6B, 0x9A7F, 0x9A8C, 0x9A91,
0x9A8D, 0x9A7D, 0xC2CC, 0xC2B7, 0xC2BB, 0xC2D5, 0xC300, 0xC33A, 0xC37D, 0xC3C7, 0xC414, 0xC460, 0xC4A7, 0xC4E6,
0xC517, 0xC538, 0xC544, 0xC539, 0xC51B, 0xC4EE, 0xC4B5, 0xC473, 0xC42C, 0xC3E4, 0xC39E, 0xC35D, 0xC325, 0xC2F8,
0xC2DB, 0xC2CF, 0xC2DA, 0xC2FD, 0x01E7, 0x01EC, 0x01EB, 0x01E5, 0x01DB, 0x01CE, 0x01BF, 0x01AE, 0x019D, 0x018C,
0x017C, 0x016F, 0x0164, 0x015D, 0x015A, 0x015C, 0x0163, 0x016D, 0x0179, 0x0188, 0x0198, 0x01A8, 0x01B7, 0x01C6,
0x01D3, 0x01DD, 0x01E4, 0x01E6, 0x01E4, 0x01DC, 0x0C86, 0x0C88, 0x0C87, 0x0C86, 0x0C83, 0x0C7F, 0x0C7A, 0x0C75,
0x0C70, 0x0C6B, 0x0C66, 0x0C62, 0x0C5E, 0x0C5C, 0x0C5B, 0x0C5C, 0x0C5E, 0x0C61, 0x0C65, 0x0C69, 0x0C6E, 0x0C73,
0x0C78, 0x0C7C, 0x0C80, 0x0C83, 0x0C85, 0x0C86, 0x0C85, 0x0C83, 0x9AD1, 0x9ADA, 0x9AD8, 0x9ACD, 0x9AB9, 0x9AA0,
0x9A81, 0x9A60, 0x9A3E, 0x9A1C, 0x99FC, 0x99E0, 0x99CA, 0x99BB, 0x99B6, 0x99BB, 0x99C8, 0x99DC, 0x99F6, 0x9A13,
0x9A33, 0x9A53, 0x9A73, 0x9A90, 0x9AA9, 0x9ABD, 0x9ACA, 0x9ACF, 0x9ACA, 0x9ABB, 0xC26B, 0xC256, 0xC25B, 0xC274,
0xC29F, 0xC2D8, 0xC31B, 0xC364, 0xC3B0, 0xC3FC, 0xC442, 0xC480, 0xC4B0, 0xC4D1, 0xC4DC, 0xC4D2, 0xC4B4, 0xC488,
0xC44F, 0xC40E, 0xC3C8, 0xC381, 0xC33B, 0xC2FB, 0xC2C3, 0xC297, 0xC27A, 0xC26F, 0xC279, 0xC29C, 0x0E3F, 0x0E4F,
0x0E68, 0x0E89, 0x0EAF, 0x0ED9, 0x0F06, 0x0F33, 0x0F60, 0x0F8A, 0x0FB0, 0x0FD1, 0x0FEA, 0x0FFA, 0x1000, 0x0FFA,
0x0FEA, 0x0FD1, 0x0FB0, 0x0F8A, 0x0F60, 0x0F33, 0x0F06, 0x0ED9, 0x0EAF, 0x0E89, 0x0E68, 0x0E4F, 0x0E3F, 0x0E39,
};
static JointIndex sChildZeldaAnim_00EBC4JointIndices[18] = {
{ 0x0000, 0x000A, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0028, 0x0046, 0x0064 },
{ 0x0000, 0x0000, 0x0082 },
{ 0x0000, 0x0000, 0x00A0 },
{ 0x0000, 0x0000, 0x00BE },
{ 0x0000, 0x0000, 0x00DC },
{ 0x00FA, 0x0000, 0x0118 },
{ 0x0136, 0x0154, 0x0172 },
{ 0x0190, 0x0000, 0x0002 },
{ 0x0003, 0x0004, 0x0003 },
{ 0x01AE, 0x01CC, 0x01EA },
{ 0x0000, 0x0000, 0x0208 },
{ 0x0005, 0x0006, 0x0007 },
{ 0x0226, 0x0244, 0x0262 },
{ 0x0000, 0x0000, 0x0280 },
{ 0x0008, 0x0009, 0x0007 },
{ 0x0000, 0x0000, 0x029E },
};
AnimationHeader gChildZeldaAnim_00EBC4 = { { 30 }, sChildZeldaAnim_00EBC4FrameData, sChildZeldaAnim_00EBC4JointIndices, 10 };
static u8 unaccounted_00EBD4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_00F0A4FrameData[556] = {
0x06D5, 0x099B, 0x0000, 0xC000, 0x099B, 0x098E, 0x0976, 0x0969, 0x0989, 0x09C5, 0x09E5, 0x09DC, 0x09C6, 0x09A8,
0x098B, 0x0974, 0x0000, 0xFFFE, 0xFFFA, 0xFFF8, 0xFFF1, 0xFFE6, 0xFFE0, 0xFFDB, 0xFFCF, 0xFFBF, 0xFFB0, 0xFFA4,
0xBF0F, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0D, 0xBF0B, 0xBF0A, 0xBF09, 0xBF08, 0xBF07, 0xBF06, 0xBF06, 0xFF06, 0xFF06,
0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0E, 0xFF0F, 0xC006, 0xC00E, 0xC023, 0xC044,
0xC06D, 0xC09B, 0xC0CC, 0xC0FD, 0xC12B, 0xC154, 0xC175, 0xC18A, 0x0023, 0x0026, 0x0028, 0x001F, 0x0014, 0x000C,
0x0002, 0xFFFD, 0xFFFE, 0x0008, 0x0019, 0x002C, 0xFF9E, 0xFF9C, 0xFFA1, 0xFFBC, 0xFFCD, 0xFFCE, 0xFFED, 0x0010,
0x0009, 0xFFE7, 0xFFBB, 0xFF95, 0xF4D5, 0xF3E2, 0xF245, 0xF17E, 0xF3B0, 0xF8E2, 0xFD9F, 0xFC33, 0xF95E, 0xF69C,
0xF45A, 0xF2D3, 0x1896, 0x1A47, 0x1D26, 0x1E88, 0x1A9C, 0x1153, 0x08D9, 0x0B62, 0x106F, 0x155A, 0x195D, 0x1C12,
0xFFEA, 0xFFE9, 0xFFE4, 0xFFD6, 0xFFD5, 0xFFE3, 0xFFE8, 0xFFDC, 0xFFD2, 0xFFD2, 0xFFDC, 0xFFE9, 0x003F, 0x003D,
0x0042, 0x005C, 0x006E, 0x0070, 0x008F, 0x00B2, 0x00AA, 0x0087, 0x005A, 0x0033, 0xF509, 0xF40F, 0xF261, 0xF182,
0xF38A, 0xF854, 0xFC1B, 0xFAAD, 0xF80F, 0xF56F, 0xF340, 0xF1C3, 0x188B, 0x1A49, 0x1D48, 0x1ED4, 0x1B34, 0x12A3,
0x0BE1, 0x0E6F, 0x131A, 0x17C9, 0x1BAC, 0x1E51, 0x0000, 0x0003, 0x0008, 0x000B, 0x0008, 0x0003, 0xFFFD, 0xFFFB,
0x0000, 0x0015, 0x0035, 0x0054, 0xFFFB, 0xFFEB, 0xFFCD, 0xFFB0, 0xFF9B, 0xFF88, 0xFF75, 0xFF61, 0xFF48, 0xFF25,
0xFEFA, 0xFED3, 0xFFC1, 0xFE2D, 0xFBAB, 0xFA32, 0xFA73, 0xFB71, 0xFC9F, 0xFD71, 0xFD59, 0xFB79, 0xF843, 0xF52A,
0xFFFD, 0x000A, 0x001E, 0x0023, 0x000F, 0xFFEC, 0xFFC8, 0xFFB1, 0xFFB2, 0xFFE6, 0x0042, 0x009B, 0xFFF9, 0x0013,
0x0044, 0x007D, 0x00BB, 0x00FF, 0x0144, 0x0185, 0x01BC, 0x01E8, 0x020B, 0x0224, 0x0CE0, 0x10A5, 0x1675, 0x1943,
0x1761, 0x1374, 0x0EEC, 0x0B3A, 0x09CD, 0x0C83, 0x1243, 0x1815, 0xFFFC, 0xFFFB, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFFB,
0xFFFC, 0xFFFD, 0xFFFE, 0xFFFE, 0xFFFD, 0xFFFC, 0x0011, 0x0010, 0x000F, 0x000F, 0x000F, 0x000F, 0x0010, 0x0010,
0x0011, 0x0011, 0x0011, 0x0011, 0xF459, 0xF234, 0xEEF4, 0xED99, 0xEF15, 0xF1CC, 0xF4EC, 0xF7A2, 0xF91A, 0xF877,
0xF64C, 0xF3F5, 0x4000, 0x400B, 0x4021, 0x402E, 0x4039, 0x404D, 0x405B, 0x4060, 0x405E, 0x4061, 0x4070, 0x4086,
0xF444, 0xF3D2, 0xF2FF, 0xF28D, 0xF35E, 0xF52A, 0xF6F6, 0xF7C7, 0xF72C, 0xF5BA, 0xF402, 0xF293, 0x4000, 0x3FDD,
0x3F9B, 0x3F76, 0x3F57, 0x3F12, 0x3ECE, 0x3EB0, 0x3E7F, 0x3E08, 0x3D76, 0x3CF8, 0x0B50, 0x0B54, 0x0B5C, 0x0B61,
0x0B6E, 0x0B86, 0x0B93, 0x0B8E, 0x0B82, 0x0B72, 0x0B62, 0x0B55, 0x000F, 0x0089, 0x016C, 0x01E6, 0xFF30, 0xFA27,
0xF771, 0xF815, 0xF9AD, 0xFBC0, 0xFDD3, 0xFF6B, 0x5569, 0x558C, 0x55CC, 0x55EE, 0x5526, 0x53B3, 0x52EB, 0x531A,
0x5390, 0x542A, 0x54C4, 0x553A, 0x4C56, 0x4E32, 0x52D6, 0x58E0, 0x5EE9, 0x638E, 0x6569, 0x676C, 0x6C71, 0x72F9,
0x7980, 0x7E86, 0x6F82, 0x6F41, 0x6E9E, 0x6DCA, 0x6CF6, 0x6C53, 0x6C12, 0x6C3B, 0x6CA3, 0x6D29, 0x6DB0, 0x6E17,
0x45DB, 0x4520, 0x434B, 0x40E9, 0x3E88, 0x3CB3, 0x3BF7, 0x3B94, 0x3A9C, 0x3959, 0x3816, 0x371E, 0x005E, 0x006C,
0x0092, 0x00CB, 0x0113, 0x0164, 0x01BB, 0x0211, 0x0263, 0x02AB, 0x02E4, 0x030A, 0x1622, 0x13D5, 0x0E14, 0x069A,
0xFF20, 0xF960, 0xF713, 0xFBBD, 0x0468, 0x0913, 0x076C, 0x045A, 0xF71F, 0xF71E, 0xF723, 0xF73B, 0xF772, 0xF7D5,
0xF870, 0xF95A, 0xFA64, 0xFB37, 0xFB9F, 0xFBBE, 0xFDD5, 0xFDD5, 0xFDD5, 0xFDD4, 0xFDD0, 0xFDC8, 0xFDC4, 0xFDC5,
0xFDC8, 0xFDCC, 0xFDD0, 0xFDD4, 0x02E2, 0x023C, 0x0106, 0x005F, 0x02FC, 0x07D7, 0x0A74, 0x09E4, 0x087D, 0x06AB,
0x04D9, 0x0372, 0x5AC9, 0x5AD2, 0x5AE2, 0x5AEB, 0x5AC7, 0x5A83, 0x5A5F, 0x5A67, 0x5A7A, 0x5A94, 0x5AAD, 0x5AC1,
0x31A8, 0x3083, 0x2DA6, 0x29EE, 0x2636, 0x2359, 0x2234, 0x20AB, 0x1CD6, 0x17D9, 0x12DD, 0x0F07, 0xEE84, 0xEDF0,
0xEC7C, 0xEA9A, 0xE8B7, 0xE743, 0xE6AF, 0xE6AE, 0xE6AC, 0xE6A9, 0xE6A6, 0xE6A3, 0xB9BC, 0xB917, 0xB779, 0xB55F,
0xB345, 0xB1A8, 0xB102, 0xB114, 0xB141, 0xB17B, 0xB1B5, 0xB1E2, 0xEAA0, 0xEA8B, 0xEA56, 0xEA10, 0xE9CB, 0xE996,
0xE981, 0xEA4D, 0xEBCA, 0xEC97, 0xEC6F, 0xEC25, 0xE31A, 0xE341, 0xE3E4, 0xE541, 0xE79B, 0xEB32, 0xF047, 0xF89F,
0x0370, 0x0D20, 0x13F1, 0x184B, 0xF515, 0xF50F, 0xF4E6, 0xF473, 0xF391, 0xF21B, 0xEFEB, 0xED1A, 0xE9CF, 0xE600,
0xE10C, 0xDC21, 0x0000, 0xFFF2, 0xFFCF, 0xFFA6, 0xFF82, 0xFF52, 0xFF11, 0xFED7, 0xFE90, 0xFE3A, 0xFE11, 0xFE11,
0x01A1, 0x0185, 0x013C, 0x00DC, 0x0079, 0x0014, 0xFF8B, 0xFEC1, 0xFD49, 0xFB8E, 0xFAB9, 0xFAB9, 0xFD64, 0xFE23,
0xFFC5, 0x0167, 0x0226, 0x0210, 0x01BE, 0x011A, 0xFF64, 0xFD16, 0xFBEE, 0xFBEE,
};
static JointIndex sChildZeldaAnim_00F0A4JointIndices[18] = {
{ 0x0000, 0x0004, 0x0010 },
{ 0x0002, 0x0003, 0x0002 },
{ 0x001C, 0x0028, 0x0034 },
{ 0x0040, 0x004C, 0x0058 },
{ 0x0002, 0x0002, 0x0064 },
{ 0x0070, 0x007C, 0x0088 },
{ 0x0002, 0x0002, 0x0094 },
{ 0x00A0, 0x00AC, 0x00B8 },
{ 0x00C4, 0x00D0, 0x00DC },
{ 0x00E8, 0x00F4, 0x0100 },
{ 0x010C, 0x0118, 0x0124 },
{ 0x0130, 0x013C, 0x0148 },
{ 0x0154, 0x0160, 0x016C },
{ 0x0178, 0x0184, 0x0190 },
{ 0x019C, 0x01A8, 0x01B4 },
{ 0x01C0, 0x01CC, 0x01D8 },
{ 0x01E4, 0x01F0, 0x01FC },
{ 0x0208, 0x0214, 0x0220 },
};
AnimationHeader gChildZeldaAnim_00F0A4 = { { 12 }, sChildZeldaAnim_00F0A4FrameData, sChildZeldaAnim_00F0A4JointIndices, 4 };
static u8 unaccounted_00F0B4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_00F894FrameData[948] = {
0x06D5, 0x096B, 0xFF9F, 0x0000, 0xC000, 0xBF06, 0xFF0F, 0xC192, 0xFFF0, 0x0011, 0x4092, 0x096B, 0x096C, 0x096E,
0x0972, 0x0977, 0x097C, 0x0982, 0x0988, 0x098D, 0x0992, 0x0996, 0x0998, 0x0999, 0x0998, 0x0996, 0x0992, 0x098D,
0x0988, 0x0982, 0x097C, 0x0977, 0x0972, 0x096E, 0x096C, 0x0035, 0x0034, 0x0034, 0x0032, 0x0031, 0x002F, 0x002E,
0x002C, 0x002A, 0x0029, 0x0028, 0x0027, 0x0026, 0x0027, 0x0027, 0x0029, 0x002A, 0x002C, 0x002E, 0x002F, 0x0031,
0x0032, 0x0034, 0x0034, 0xFF84, 0xFF84, 0xFF85, 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8B,
0xFF8C, 0xFF8C, 0xFF8C, 0xFF8B, 0xFF8B, 0xFF8A, 0xFF89, 0xFF88, 0xFF87, 0xFF86, 0xFF85, 0xFF85, 0xFF84, 0xF241,
0xF250, 0xF27A, 0xF2BA, 0xF30C, 0xF36B, 0xF3D2, 0xF43C, 0xF4A3, 0xF4FF, 0xF54B, 0xF57E, 0xF591, 0xF57E, 0xF54B,
0xF4FF, 0xF4A3, 0xF43C, 0xF3D2, 0xF36B, 0xF30C, 0xF2BA, 0xF27A, 0xF250, 0x1D16, 0x1CFB, 0x1CB0, 0x1C3E, 0x1BAC,
0x1B03, 0x1A4B, 0x198E, 0x18D7, 0x1832, 0x17AB, 0x174F, 0x172E, 0x174F, 0x17AB, 0x1832, 0x18D7, 0x198E, 0x1A4B,
0x1B03, 0x1BAC, 0x1C3E, 0x1CB0, 0x1CFB, 0x0023, 0x0023, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
0x002A, 0x002B, 0x002B, 0x002C, 0x002B, 0x002B, 0x002A, 0x0029, 0x0028, 0x0027, 0x0026, 0x0025, 0x0024, 0x0023,
0x0023, 0xF133, 0xF141, 0xF168, 0xF1A4, 0xF1F0, 0xF248, 0xF2A7, 0xF308, 0xF365, 0xF3BA, 0xF3FE, 0xF42C, 0xF43D,
0xF42C, 0xF3FE, 0xF3BA, 0xF365, 0xF308, 0xF2A7, 0xF248, 0xF1F0, 0xF1A4, 0xF168, 0xF141, 0x1F4F, 0x1F36, 0x1EF1,
0x1E86, 0x1DFF, 0x1D62, 0x1CB9, 0x1C0C, 0x1B65, 0x1ACF, 0x1A54, 0x1A02, 0x19E4, 0x1A02, 0x1A54, 0x1ACF, 0x1B65,
0x1C0C, 0x1CB9, 0x1D62, 0x1DFF, 0x1E86, 0x1EF1, 0x1F36, 0x0064, 0x0066, 0x0066, 0x0064, 0x0060, 0x005B, 0x0056,
0x0050, 0x004A, 0x0045, 0x0040, 0x003E, 0x003C, 0x003D, 0x003F, 0x0043, 0x0047, 0x004B, 0x0050, 0x0055, 0x0059,
0x005E, 0x0061, 0x0063, 0xFEBC, 0xFEB3, 0xFEAC, 0xFEA7, 0xFEA3, 0xFEA1, 0xFE9F, 0xFE9F, 0xFE9F, 0xFEA0, 0xFEA0,
0xFEA1, 0xFEA1, 0xFEA2, 0xFEA3, 0xFEA6, 0xFEA8, 0xFEAC, 0xFEAF, 0xFEB2, 0xFEB5, 0xFEB8, 0xFEBA, 0xFEBC, 0xF39C,
0xF373, 0xF38D, 0xF3DE, 0xF458, 0xF4F1, 0xF59C, 0xF64E, 0xF6FA, 0xF795, 0xF812, 0xF866, 0xF885, 0xF86C, 0xF828,
0xF7C0, 0xF73F, 0xF6AC, 0xF610, 0xF574, 0xF4E1, 0xF460, 0xF3F9, 0xF3B4, 0x00C8, 0x00CD, 0x00CA, 0x00C1, 0x00B3,
0x00A2, 0x008F, 0x007B, 0x0068, 0x0057, 0x0049, 0x0040, 0x003C, 0x003F, 0x0047, 0x0052, 0x0061, 0x0071, 0x0082,
0x0094, 0x00A4, 0x00B2, 0x00BE, 0x00C5, 0x0233, 0x023D, 0x0246, 0x024E, 0x0254, 0x0259, 0x025D, 0x0261, 0x0263,
0x0265, 0x0266, 0x0267, 0x0267, 0x0266, 0x0263, 0x025F, 0x025A, 0x0254, 0x024D, 0x0247, 0x0241, 0x023B, 0x0237,
0x0234, 0x1AFE, 0x1B30, 0x1AE8, 0x1A3C, 0x1944, 0x1815, 0x16C6, 0x156D, 0x1421, 0x12F7, 0x1207, 0x1167, 0x112C,
0x115E, 0x11E6, 0x12B5, 0x13B8, 0x14DE, 0x1615, 0x174D, 0x1872, 0x1975, 0x1A44, 0x1ACD, 0xFFFB, 0xFFFB, 0xFFFC,
0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
0xFFFD, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xF2CD, 0xF2CC, 0xF2FB, 0xF352, 0xF3C7, 0xF450, 0xF4E6,
0xF57D, 0xF60E, 0xF68F, 0xF6F6, 0xF73B, 0xF754, 0xF73D, 0xF6FE, 0xF69F, 0xF627, 0xF5A0, 0xF510, 0xF481, 0xF3F9,
0xF382, 0xF323, 0xF2E4, 0xF1F9, 0xF1FC, 0xF205, 0xF213, 0xF224, 0xF238, 0xF24C, 0xF261, 0xF274, 0xF286, 0xF293,
0xF29C, 0xF2A0, 0xF29C, 0xF293, 0xF286, 0xF274, 0xF261, 0xF24C, 0xF238, 0xF224, 0xF213, 0xF205, 0xF1FC, 0x3CC2,
0x3CC2, 0x3CC2, 0x3CC2, 0x3CC3, 0x3CC3, 0x3CC3, 0x3CC4, 0x3CC4, 0x3CC4, 0x3CC4, 0x3CC4, 0x3CC4, 0x3CC4, 0x3CC4,
0x3CC4, 0x3CC4, 0x3CC4, 0x3CC3, 0x3CC3, 0x3CC3, 0x3CC2, 0x3CC2, 0x3CC2, 0x0B50, 0x0B50, 0x0B50, 0x0B51, 0x0B51,
0x0B52, 0x0B52, 0x0B52, 0x0B53, 0x0B53, 0x0B53, 0x0B54, 0x0B54, 0x0B54, 0x0B53, 0x0B53, 0x0B53, 0x0B52, 0x0B52,
0x0B52, 0x0B51, 0x0B51, 0x0B50, 0x0B50, 0x000F, 0x0005, 0xFFE8, 0xFFBD, 0xFF88, 0xFF4B, 0xFF0A, 0xFEC9, 0xFE8C,
0xFE57, 0xFE2C, 0xFE0F, 0xFE05, 0xFE0F, 0xFE2C, 0xFE57, 0xFE8C, 0xFEC9, 0xFF0A, 0xFF4B, 0xFF88, 0xFFBD, 0xFFE8,
0x0005, 0x5569, 0x5566, 0x555E, 0x5552, 0x5542, 0x5531, 0x551F, 0x550C, 0x54FB, 0x54EB, 0x54DF, 0x54D7, 0x54D4,
0x54D7, 0x54DF, 0x54EB, 0x54FB, 0x550C, 0x551F, 0x5531, 0x5542, 0x5552, 0x555E, 0x5566, 0x8088, 0x8088, 0x8089,
0x8089, 0x8089, 0x8089, 0x808A, 0x808A, 0x808A, 0x808B, 0x808B, 0x808B, 0x808B, 0x808B, 0x808B, 0x808B, 0x808A,
0x808A, 0x808A, 0x8089, 0x8089, 0x8089, 0x8089, 0x8088, 0x6E41, 0x6E38, 0x6E20, 0x6DFC, 0x6DCF, 0x6D9C, 0x6D66,
0x6D30, 0x6CFC, 0x6CCF, 0x6CAB, 0x6C93, 0x6C8B, 0x6C93, 0x6CAB, 0x6CCF, 0x6CFC, 0x6D30, 0x6D66, 0x6D9C, 0x6DCF,
0x6DFC, 0x6E20, 0x6E38, 0x36BB, 0x36BB, 0x36BC, 0x36BC, 0x36BD, 0x36BD, 0x36BE, 0x36BF, 0x36C0, 0x36C1, 0x36C1,
0x36C1, 0x36C2, 0x36C1, 0x36C1, 0x36C1, 0x36C0, 0x36BF, 0x36BE, 0x36BD, 0x36BD, 0x36BC, 0x36BC, 0x36BB, 0x0318,
0x0318, 0x0318, 0x0318, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0316, 0x0316, 0x0316, 0x0317,
0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0318, 0x0318, 0x0318, 0x02B3, 0x02AC, 0x0298, 0x0279, 0x0252,
0x0226, 0x01F8, 0x01CA, 0x019E, 0x0177, 0x0159, 0x0144, 0x013D, 0x0144, 0x0159, 0x0177, 0x019E, 0x01CA, 0x01F8,
0x0226, 0x0252, 0x0279, 0x0298, 0x02AC, 0xFBC0, 0xFBBF, 0xFBBE, 0xFBBB, 0xFBB8, 0xFBB5, 0xFBB1, 0xFBAE, 0xFBAB,
0xFBA8, 0xFBA5, 0xFBA4, 0xFBA3, 0xFBA4, 0xFBA5, 0xFBA8, 0xFBAB, 0xFBAE, 0xFBB1, 0xFBB5, 0xFBB8, 0xFBBB, 0xFBBE,
0xFBBF, 0xFDD5, 0xFDD5, 0xFDD5, 0xFDD5, 0xFDD4, 0xFDD4, 0xFDD4, 0xFDD4, 0xFDD3, 0xFDD3, 0xFDD3, 0xFDD3, 0xFDD3,
0xFDD3, 0xFDD3, 0xFDD3, 0xFDD3, 0xFDD4, 0xFDD4, 0xFDD4, 0xFDD4, 0xFDD5, 0xFDD5, 0xFDD5, 0x02E2, 0x02EB, 0x0301,
0x0323, 0x034E, 0x037F, 0x03B3, 0x03E6, 0x0417, 0x0442, 0x0464, 0x047B, 0x0483, 0x047B, 0x0464, 0x0442, 0x0417,
0x03E6, 0x03B3, 0x037F, 0x034E, 0x0323, 0x0301, 0x02EB, 0x5AC9, 0x5AC9, 0x5AC7, 0x5AC5, 0x5AC3, 0x5AC1, 0x5ABE,
0x5ABB, 0x5AB8, 0x5AB6, 0x5AB4, 0x5AB3, 0x5AB3, 0x5AB3, 0x5AB4, 0x5AB6, 0x5AB8, 0x5ABB, 0x5ABE, 0x5AC1, 0x5AC3,
0x5AC5, 0x5AC7, 0x5AC9, 0x0D7F, 0x0D80, 0x0D83, 0x0D87, 0x0D8D, 0x0D94, 0x0D9A, 0x0DA1, 0x0DA8, 0x0DAD, 0x0DB2,
0x0DB5, 0x0DB6, 0x0DB5, 0x0DB2, 0x0DAD, 0x0DA8, 0x0DA1, 0x0D9A, 0x0D94, 0x0D8D, 0x0D87, 0x0D83, 0x0D80, 0xE6A3,
0xE69E, 0xE693, 0xE681, 0xE66A, 0xE651, 0xE636, 0xE61B, 0xE602, 0xE5EC, 0xE5DA, 0xE5CE, 0xE5CA, 0xE5CE, 0xE5DA,
0xE5EC, 0xE602, 0xE61B, 0xE636, 0xE651, 0xE66A, 0xE681, 0xE693, 0xE69E, 0xB1F4, 0xB1F2, 0xB1ED, 0xB1E6, 0xB1DC,
0xB1D1, 0xB1C5, 0xB1BA, 0xB1AF, 0xB1A5, 0xB19E, 0xB199, 0xB197, 0xB199, 0xB19E, 0xB1A5, 0xB1AF, 0xB1BA, 0xB1C5,
0xB1D1, 0xB1DC, 0xB1E6, 0xB1ED, 0xB1F2, 0xEBFD, 0xEBFF, 0xEC04, 0xEC0C, 0xEC16, 0xEC22, 0xEC2E, 0xEC3A, 0xEC45,
0xEC4F, 0xEC57, 0xEC5D, 0xEC5F, 0xEC5D, 0xEC57, 0xEC4F, 0xEC45, 0xEC3A, 0xEC2E, 0xEC22, 0xEC16, 0xEC0C, 0xEC04,
0xEBFF, 0x19D2, 0x19CD, 0x19BF, 0x19AA, 0x1990, 0x1971, 0x1951, 0x1931, 0x1913, 0x18F9, 0x18E3, 0x18D5, 0x18D0,
0x18D5, 0x18E3, 0x18F9, 0x1913, 0x1931, 0x1951, 0x1971, 0x1990, 0x19AA, 0x19BF, 0x19CD, 0xD9E6, 0xD9E9, 0xD9F3,
0xDA00, 0xDA12, 0xDA25, 0xDA3A, 0xDA4F, 0xDA63, 0xDA74, 0xDA82, 0xDA8B, 0xDA8E, 0xDA8B, 0xDA82, 0xDA74, 0xDA63,
0xDA4F, 0xDA3A, 0xDA25, 0xDA12, 0xDA00, 0xD9F3, 0xD9E9, 0xFE11, 0xFE10, 0xFE0F, 0xFE0D, 0xFE0B, 0xFE09, 0xFE07,
0xFE04, 0xFE02, 0xFE00, 0xFDFE, 0xFDFD, 0xFDFD, 0xFDFD, 0xFDFE, 0xFE00, 0xFE02, 0xFE04, 0xFE07, 0xFE09, 0xFE0B,
0xFE0D, 0xFE0F, 0xFE10, 0xFAB9, 0xFAC0, 0xFAD2, 0xFAEE, 0xFB11, 0xFB39, 0xFB64, 0xFB8E, 0xFBB6, 0xFBD9, 0xFBF5,
0xFC08, 0xFC0E, 0xFC08, 0xFBF5, 0xFBD9, 0xFBB6, 0xFB8E, 0xFB64, 0xFB39, 0xFB11, 0xFAEE, 0xFAD2, 0xFAC0, 0xFBEE,
0xFBF1, 0xFBF9, 0xFC06, 0xFC15, 0xFC27, 0xFC3A, 0xFC4C, 0xFC5E, 0xFC6E, 0xFC7A, 0xFC82, 0xFC85, 0xFC82, 0xFC7A,
0xFC6E, 0xFC5E, 0xFC4C, 0xFC3A, 0xFC27, 0xFC15, 0xFC06, 0xFBF9, 0xFBF1, 0x0000,
};
static JointIndex sChildZeldaAnim_00F894JointIndices[18] = {
{ 0x0000, 0x000B, 0x0002 },
{ 0x0003, 0x0004, 0x0003 },
{ 0x0005, 0x0006, 0x0007 },
{ 0x0023, 0x003B, 0x0053 },
{ 0x0003, 0x0003, 0x006B },
{ 0x0008, 0x0083, 0x009B },
{ 0x0003, 0x0003, 0x00B3 },
{ 0x00CB, 0x00E3, 0x00FB },
{ 0x0113, 0x012B, 0x0143 },
{ 0x015B, 0x0009, 0x0173 },
{ 0x000A, 0x018B, 0x01A3 },
{ 0x01BB, 0x01D3, 0x01EB },
{ 0x0203, 0x021B, 0x0233 },
{ 0x024B, 0x0263, 0x027B },
{ 0x0293, 0x02AB, 0x02C3 },
{ 0x02DB, 0x02F3, 0x030B },
{ 0x0323, 0x033B, 0x0353 },
{ 0x036B, 0x0383, 0x039B },
};
AnimationHeader gChildZeldaAnim_00F894 = { { 24 }, sChildZeldaAnim_00F894FrameData, sChildZeldaAnim_00F894JointIndices, 11 };
static u8 unaccounted_00F8A4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_010DF8FrameData[2670] = {
0x0000, 0x0992, 0xFFCE, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0003, 0x0004, 0x0005, 0x0006, 0x0006, 0x0005, 0x0003,
0x0000, 0xFFFC, 0xFFF8, 0xFFF3, 0xFFEF, 0xFFEB, 0xFFE7, 0xFFE3, 0xFFE0, 0xFFDE, 0xFFDD, 0xFFDC, 0xFFDD, 0xFFDE,
0xFFDF, 0xFFE2, 0xFFE5, 0xFFE8, 0xFFEB, 0xFFEE, 0xFFF1, 0xFFF4, 0xFFF7, 0xFFF9, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0992,
0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992, 0x0992,
0x0992, 0x0991, 0x0991, 0x0990, 0x0990, 0x0990, 0x0990, 0x0990, 0x0991, 0x0992, 0x0993, 0x0995, 0x0997, 0x0998,
0x099A, 0x099C, 0x099E, 0x09A0, 0x09A2, 0x09A4, 0x09A6, 0x09A8, 0x09AB, 0x09AD, 0x09AF, 0x09B1, 0x09B3, 0x09B6,
0x09B8, 0x09BA, 0x09BC, 0x09BE, 0x09C0, 0x09C3, 0x09C5, 0x09C7, 0x09C9, 0x09CB, 0x09CD, 0x09CE, 0x09D0, 0x09D2,
0x09D4, 0x09D5, 0x09D7, 0x09D8, 0x09DA, 0x09DB, 0x09DC, 0x09DD, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE,
0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCE, 0xFFCD, 0xFFCD, 0xFFCD,
0xFFCD, 0xFFCD, 0xFFCD, 0xFFCD, 0xFFCE, 0xFFCF, 0xFFD1, 0xFFD3, 0xFFD6, 0xFFD9, 0xFFDD, 0xFFE1, 0xFFE6, 0xFFEB,
0xFFF1, 0xFFF6, 0xFFFB, 0x0001, 0x0005, 0x0009, 0x000D, 0x0010, 0x0012, 0x0013, 0x0014, 0x0015, 0x0014, 0x0014,
0x0013, 0x0012, 0x0011, 0x0010, 0x000E, 0x000D, 0x000C, 0x000B, 0x0009, 0x0008, 0x0007, 0x0006, 0x0004, 0x0003,
0x0002, 0x0001, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0x806B, 0x81A1, 0x8396, 0x8638, 0x897B, 0x8D50, 0x91A8, 0x9674, 0x9BA6, 0xA12F, 0xA702, 0xAD0E, 0xB347, 0xB99C,
0xC000, 0xC664, 0xCCB9, 0xD2F2, 0xD8FE, 0xDED1, 0xE45A, 0xE98C, 0xEE58, 0xF2B0, 0xF685, 0xF9C8, 0xFC6A, 0xFE5F,
0xFF95, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xBFFB, 0xBFF0,
0xBFE1, 0xBFCF, 0xBFB9, 0xBFA1, 0xBF87, 0xBF6C, 0xBF51, 0xBF35, 0xBF1B, 0xBF02, 0xBEEB, 0xBED8, 0xBEC7, 0xBEBD,
0xBEBA, 0xBEBD, 0xBEC5, 0xBED0, 0xBEDE, 0xBEEC, 0xBEFA, 0xBF07, 0xBF10, 0xBF24, 0xBF4D, 0xBF8A, 0xBFD7, 0xC032,
0xC097, 0xC105, 0xC179, 0xC1EE, 0xC264, 0xC2DB, 0xC348, 0xC3AC, 0xC404, 0xC44F, 0xC48F, 0xC4C7, 0xC4F6, 0xC51C,
0xC537, 0xC546, 0xC547, 0xC53A, 0xC51E, 0xC4F1, 0xC4AF, 0xC456, 0xC3EB, 0xC372, 0xC2EF, 0xC265, 0xC1D9, 0xC150,
0xC0CC, 0xC051, 0xBFE5, 0xBF8B, 0xBF47, 0xBF1C, 0xBF0F, 0x0031, 0x002F, 0x002E, 0x002C, 0x002B, 0x002A, 0x0029,
0x0028, 0x0027, 0x0026, 0x0025, 0x0024, 0x0023, 0x0022, 0x0021, 0x0026, 0x0034, 0x0048, 0x005F, 0x0074, 0x0082,
0x0084, 0x0074, 0x0050, 0x0018, 0xFFE0, 0xFFB6, 0xFF96, 0xFF7D, 0xFF68, 0xFF0D, 0xFEDE, 0xFE5C, 0xFDFB, 0xFD83,
0xFA93, 0xFABA, 0xFAE1, 0xFB0A, 0xFB34, 0xFB60, 0xFB8E, 0xFBBF, 0xFBF1, 0xFC26, 0xFC5C, 0xFC94, 0xFCCD, 0xFD07,
0xFD42, 0xFD7C, 0xFDB6, 0xFDEF, 0xFE27, 0xFE5D, 0xFE92, 0xFEC5, 0xFEF6, 0xFF25, 0xFF51, 0xFF7A, 0xFFA1, 0xFFC4,
0xFFE4, 0x0000, 0xBFFF, 0xBFFD, 0xBFFB, 0xBFF8, 0xBFF4, 0xBFF0, 0xBFEB, 0xBFE7, 0xBFE2, 0xBFDD, 0xBFD9, 0xBFD5,
0xBFD1, 0xBFCD, 0xBFCB, 0xBFBC, 0xBF9C, 0xBF72, 0xBF46, 0xBF20, 0xBF08, 0xBF07, 0xBF23, 0xBF66, 0xBFD7, 0xC05C,
0xC0D1, 0xC136, 0xC18A, 0xC1CE, 0xC202, 0xC227, 0xC23B, 0xC241, 0xC239, 0xC1F8, 0xC1DF, 0xC1C0, 0xC19C, 0xC176,
0xC14D, 0xC124, 0xC0FB, 0xC0D4, 0xC0AE, 0xC08B, 0xC06C, 0xC051, 0xC039, 0xC026, 0xC017, 0xC00C, 0xC005, 0xC001,
0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0x0000, 0x0000, 0x0001,
0x0001, 0x0002, 0x0002, 0x0003, 0x0003, 0x0004, 0x0005, 0x0005, 0x0006, 0x0006, 0x0007, 0x0007, 0x0009, 0x000D,
0x0012, 0x0017, 0x001B, 0x001E, 0x001E, 0x001B, 0x0014, 0x0005, 0xFFF3, 0xFFE0, 0xFFCF, 0xFFBE, 0xFFAE, 0xFFA0,
0xFF93, 0xFF88, 0xFF7F, 0xFF77, 0xFF6D, 0xFF6C, 0xFF6D, 0xFF70, 0xFF75, 0xFF7C, 0xFF84, 0xFF8D, 0xFF97, 0xFFA1,
0xFFAC, 0xFFB7, 0xFFC2, 0xFFCC, 0xFFD5, 0xFFDE, 0xFFE6, 0xFFEC, 0xFFF2, 0xFFF6, 0xFFF9, 0xFFFB, 0xFFFD, 0xFFFF,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFE, 0xFFFC, 0xFFFB, 0xFFF9, 0xFFF7, 0xFFF5,
0xFFF3, 0xFFF1, 0xFFEF, 0xFFED, 0xFFEB, 0xFFEA, 0xFFE8, 0xFFE2, 0xFFD5, 0xFFC4, 0xFFB2, 0xFFA4, 0xFF9C, 0xFF9B,
0xFFA5, 0xFFBF, 0xFFEE, 0x002C, 0x006A, 0x00A7, 0x00E0, 0x0116, 0x0147, 0x0173, 0x0198, 0x01B6, 0x01CE, 0x01DE,
0x01E7, 0x01E8, 0x01E3, 0x01D7, 0x01C4, 0x01AD, 0x0192, 0x0174, 0x0153, 0x0130, 0x010C, 0x00E9, 0x00C6, 0x00A5,
0x0086, 0x0069, 0x0051, 0x003C, 0x002C, 0x0020, 0x0015, 0x000C, 0x0006, 0x0002, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF,
0x0000, 0xECAF, 0xECB0, 0xECB0, 0xECB0, 0xECAE, 0xECAD, 0xECAA, 0xECA8, 0xECA5, 0xECA2, 0xECA0, 0xEC9D, 0xEC9B,
0xEC99, 0xEC98, 0xEC87, 0xEC5C, 0xEC24, 0xEBEA, 0xEBB7, 0xEB97, 0xEB93, 0xEBB8, 0xEC0F, 0xECA5, 0xED5A, 0xEE07,
0xEEAA, 0xEF43, 0xEFD4, 0xF09F, 0xF13D, 0xF224, 0xF2E8, 0xF3BF, 0xF745, 0xF771, 0xF797, 0xF7B7, 0xF7D1, 0xF7E5,
0xF7F4, 0xF7FF, 0xF805, 0xF806, 0xF804, 0xF7FD, 0xF7F2, 0xF7E3, 0xF7D1, 0xF7BC, 0xF7A3, 0xF788, 0xF76D, 0xF751,
0xF738, 0xF722, 0xF711, 0xF704, 0xF6FC, 0xF6F9, 0xF6FC, 0xF703, 0xF70F, 0xF71E, 0x150E, 0x150E, 0x150D, 0x150D,
0x150D, 0x150D, 0x150D, 0x150D, 0x150E, 0x150E, 0x150F, 0x1510, 0x1511, 0x1511, 0x1512, 0x1514, 0x1515, 0x1516,
0x1515, 0x1514, 0x1513, 0x1515, 0x151A, 0x1520, 0x1521, 0x1517, 0x1505, 0x14ED, 0x14D1, 0x14B2, 0x14BD, 0x14AC,
0x14C5, 0x14C8, 0x14D3, 0x1594, 0x155E, 0x1529, 0x14F6, 0x14C5, 0x1494, 0x1462, 0x142E, 0x13F8, 0x13C0, 0x1384,
0x1344, 0x1300, 0x12B7, 0x1269, 0x1216, 0x11BD, 0x115D, 0x10F8, 0x108B, 0x101A, 0x0FA6, 0x0F30, 0x0EB8, 0x0E3F,
0x0DC6, 0x0D4F, 0x0CDC, 0x0C6E, 0x0C08, 0x0000, 0x0000, 0x0001, 0x0001, 0x0002, 0x0002, 0x0003, 0x0003, 0x0004,
0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0007, 0x000A, 0x000E, 0x0015, 0x001C, 0x0022, 0x0026, 0x0027, 0x0022,
0x0017, 0x0006, 0xFFF4, 0xFFE6, 0xFFDB, 0xFFD2, 0xFFCB, 0xFFC5, 0xFFC0, 0xFFBB, 0xFFB7, 0xFFB3, 0xFFAC, 0xFFAA,
0xFFAA, 0xFFAA, 0xFFAB, 0xFFAD, 0xFFB0, 0xFFB4, 0xFFB9, 0xFFBE, 0xFFC4, 0xFFCA, 0xFFD1, 0xFFD8, 0xFFDE, 0xFFE5,
0xFFEA, 0xFFF0, 0xFFF4, 0xFFF7, 0xFFFA, 0xFFFC, 0xFFFE, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0xFFFF, 0xFFFE, 0xFFFC, 0xFFFA, 0xFFF9, 0xFFF7, 0xFFF4, 0xFFF2, 0xFFF0, 0xFFEE, 0xFFEC, 0xFFEA, 0xFFE9,
0xFFE7, 0xFFE0, 0xFFD1, 0xFFBB, 0xFFA4, 0xFF8F, 0xFF82, 0xFF81, 0xFF91, 0xFFB5, 0xFFED, 0x0028, 0x0057, 0x007D,
0x009B, 0x00B3, 0x00C7, 0x00D7, 0x00E5, 0x00F0, 0x00FA, 0x0102, 0x0108, 0x010C, 0x010D, 0x010C, 0x0108, 0x0102,
0x00F9, 0x00ED, 0x00DF, 0x00CE, 0x00BC, 0x00A8, 0x0093, 0x007E, 0x0069, 0x0055, 0x0042, 0x0033, 0x0026, 0x001B,
0x0012, 0x000B, 0x0006, 0x0002, 0x0000, 0xFFFF, 0xFFFE, 0xFFFF, 0x0000, 0xEC98, 0xEC9B, 0xEC9E, 0xECA2, 0xECA5,
0xECA9, 0xECAD, 0xECB1, 0xECB5, 0xECB8, 0xECBC, 0xECC0, 0xECC3, 0xECC6, 0xECC9, 0xECCC, 0xECD0, 0xECD4, 0xECD8,
0xECDB, 0xECDD, 0xECDC, 0xECD9, 0xECD2, 0xECC7, 0xECBF, 0xECBF, 0xECC7, 0xECD7, 0xECEF, 0xED4B, 0xED8C, 0xEE1C,
0xEE9B, 0xEF38, 0xF250, 0xF26E, 0xF295, 0xF2C4, 0xF2FA, 0xF337, 0xF378, 0xF3BE, 0xF406, 0xF450, 0xF49B, 0xF4E6,
0xF52E, 0xF574, 0xF5B4, 0xF5EF, 0xF624, 0xF64F, 0xF671, 0xF686, 0xF696, 0xF6A8, 0xF6BB, 0xF6CE, 0xF6E1, 0xF6F5,
0xF707, 0xF719, 0xF729, 0xF738, 0x153A, 0x153B, 0x153B, 0x153C, 0x153D, 0x153E, 0x1540, 0x1541, 0x1542, 0x1544,
0x1545, 0x1546, 0x1547, 0x1548, 0x1549, 0x154C, 0x1552, 0x155A, 0x1560, 0x1565, 0x1568, 0x1569, 0x1568, 0x1561,
0x154F, 0x1532, 0x1514, 0x14F7, 0x14DD, 0x14C6, 0x14E8, 0x14EE, 0x152F, 0x1559, 0x158E, 0x16E9, 0x16C0, 0x1695,
0x1666, 0x1634, 0x15FD, 0x15C0, 0x157E, 0x1535, 0x14E6, 0x1490, 0x1434, 0x13D1, 0x136A, 0x12FD, 0x128C, 0x1217,
0x11A0, 0x1126, 0x10A9, 0x102B, 0x0FAF, 0x0F35, 0x0EBE, 0x0E4A, 0x0DDA, 0x0D6E, 0x0D05, 0x0CA1, 0x0C42, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFE, 0xFFFE, 0xFFFD, 0xFFFC, 0xFFFC, 0xFFFD, 0xFFFE, 0x0000, 0x0011, 0x003D, 0x0080, 0x00D7,
0x013F, 0x01B2, 0x022F, 0x02B1, 0x0336, 0x03B8, 0x0436, 0x04AA, 0x0513, 0x056B, 0x05B0, 0x05E5, 0x060E, 0x062B,
0x063C, 0x0642, 0x063C, 0x062B, 0x060E, 0x05E5, 0x05B0, 0x056B, 0x0512, 0x04A9, 0x0433, 0x03B4, 0x0331, 0x02AC,
0x0228, 0x01AB, 0x0137, 0x00D0, 0x007A, 0x0038, 0x000E, 0x0000, 0xF185, 0xF187, 0xF189, 0xF18A, 0xF18B, 0xF18C,
0xF18D, 0xF18D, 0xF18E, 0xF18E, 0xF18E, 0xF18F, 0xF18F, 0xF190, 0xF191, 0xF183, 0xF15D, 0xF12B, 0xF0F5, 0xF0C6,
0xF0A7, 0xF0A3, 0xF0C3, 0xF112, 0xF198, 0xF23C, 0xF2DC, 0xF379, 0xF412, 0xF4A9, 0xF5CB, 0xF697, 0xF7FC, 0xF91F,
0xFA67, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0xFFFA, 0xFFF9, 0xFFF9, 0xFFF9, 0xFFF9, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8,
0xFFF8, 0xFFF8, 0xFFF8, 0xFFF9, 0xFFF9, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF, 0x0000,
0x0011, 0x003F, 0x0087, 0x00E2, 0x014F, 0x01C8, 0x024A, 0x02D1, 0x035A, 0x03E1, 0x0461, 0x04DB, 0x0548, 0x05A4,
0x05EC, 0x0623, 0x064D, 0x066C, 0x067E, 0x0684, 0x067E, 0x066C, 0x064D, 0x0623, 0x05EC, 0x05A4, 0x0548, 0x04DB,
0x0461, 0x03DE, 0x0355, 0x02CB, 0x0243, 0x01C1, 0x0148, 0x00DD, 0x0083, 0x003D, 0x0011, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0005, 0x000F, 0x001E, 0x002F, 0x0041,
0x004D, 0x0059, 0x005A, 0x0057, 0x004D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0BC5, 0x0BC5, 0x0BC5, 0x0BC6, 0x0BC7, 0x0BC9, 0x0BCA,
0x0BCC, 0x0BCE, 0x0BD0, 0x0BD2, 0x0BD3, 0x0BD5, 0x0BD7, 0x0BD8, 0x0BEA, 0x0C17, 0x0C52, 0x0C92, 0x0CCA, 0x0CEF,
0x0CF5, 0x0CD2, 0x0C7A, 0x0BE1, 0x0B26, 0x0A6F, 0x09BB, 0x090A, 0x085D, 0x074C, 0x067E, 0x0550, 0x0454, 0x034A,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0xFFFB, 0xFFED, 0xFFDB, 0xFFC8, 0xFFB7, 0xFFAC, 0xFFAA, 0xFFB5, 0xFFD1, 0x0000, 0x0042,
0x0091, 0x00EB, 0x014F, 0x01BA, 0x022B, 0x029E, 0x0312, 0x0386, 0x03F6, 0x0461, 0x04C5, 0x0520, 0x056F, 0x05B0,
0x05E2, 0x0604, 0x0619, 0x0621, 0x061E, 0x0613, 0x0600, 0x05E9, 0x05CD, 0x05B0, 0x057F, 0x052E, 0x04C9, 0x045D,
0x03F6, 0x038B, 0x0310, 0x028D, 0x0206, 0x0182, 0x0109, 0x009F, 0x004B, 0x0014, 0x0000, 0x02FE, 0x031A, 0x032C,
0x0336, 0x0339, 0x0337, 0x032F, 0x0324, 0x0317, 0x0309, 0x02FA, 0x02ED, 0x02E2, 0x02DB, 0x02D8, 0x02D8, 0x02D7,
0x02D6, 0x02D5, 0x02D5, 0x02D4, 0x02D4, 0x02D4, 0x02D6, 0x02D8, 0x02DB, 0x02DF, 0x02E4, 0x02E9, 0x02EE, 0x02F4,
0x02FA, 0x02FF, 0x0305, 0x030B, 0x0310, 0x0315, 0x031A, 0x031E, 0x0321, 0x0322, 0x031E, 0x0318, 0x0312, 0x030B,
0x0306, 0x0305, 0x0308, 0x0311, 0x0321, 0x0356, 0x03B5, 0x0417, 0x0459, 0x0453, 0x0409, 0x039B, 0x0315, 0x0280,
0x01E7, 0x0152, 0x00CD, 0x0062, 0x001A, 0x0000, 0x4060, 0x40E1, 0x417D, 0x4231, 0x42F8, 0x43CC, 0x44AA, 0x458C,
0x466E, 0x474B, 0x481E, 0x48E2, 0x4994, 0x4A2E, 0x4AAB, 0x4B08, 0x4B46, 0x4B6A, 0x4B77, 0x4B70, 0x4B59, 0x4B37,
0x4B0C, 0x4ADC, 0x4AAB, 0x4A5D, 0x49DF, 0x493F, 0x488B, 0x47D2, 0x4713, 0x4644, 0x456A, 0x448C, 0x43AD, 0x42D2,
0x4202, 0x4141, 0x4094, 0x4000, 0x3FAB, 0x3FA0, 0x3FC0, 0x3FEB, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C,
0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE71C, 0xE77B, 0xE85D,
0xE96A, 0xEA4C, 0xEAAB, 0xEB4E, 0xED09, 0xEF95, 0xF2AD, 0xF60B, 0xF96A, 0xFC82, 0xFF0E, 0x00C9, 0x016C, 0x0192,
0x01EC, 0x0258, 0x02B2, 0x02D8, 0x02C4, 0x028C, 0x023B, 0x01D8, 0x016C, 0x0100, 0x009D, 0x004C, 0x0014, 0x0000,
0xFFFE, 0xFFFA, 0xFFF3, 0xFFEB, 0xFFE2, 0xFFD9, 0xFFD0, 0xFFCA, 0xFFC5, 0xFFC3, 0x172A, 0x17F2, 0x18C6, 0x199E,
0x1A71, 0x1B37, 0x1BE7, 0x1C79, 0x1CE4, 0x1D22, 0x1D2E, 0x1D04, 0x1CA1, 0x1C07, 0x1B38, 0x1B06, 0x1BE2, 0x1D54,
0x1EE4, 0x2001, 0x2009, 0x1E68, 0x1AD8, 0x1595, 0x0F3E, 0x0211, 0xF1AB, 0xE592, 0xDEE4, 0xDCD8, 0xD9F6, 0xD4C1,
0xD08A, 0xCF04, 0xCF17, 0xCF91, 0xD082, 0xD1F2, 0xD3DD, 0xD62F, 0xD8A8, 0xDB1D, 0xDD97, 0xE01B, 0xE2AC, 0xE545,
0xE7E2, 0xEA88, 0xED53, 0xF098, 0xF269, 0xF40B, 0xF5A1, 0xF728, 0xF881, 0xF9D6, 0xFAFE, 0xFC1F, 0xFD0E, 0xFDE8,
0xFEA9, 0xFF3C, 0xFF9D, 0xFFDF, 0xFFF6, 0xF0E8, 0xF165, 0xF20B, 0xF2D8, 0xF3C7, 0xF4D4, 0xF5FD, 0xF73A, 0xF889,
0xF9E1, 0xFB3C, 0xFC91, 0xFDD7, 0xFF03, 0x0009, 0x0109, 0x0218, 0x0309, 0x03AF, 0x03E9, 0x03A5, 0x02EC, 0x01D4,
0x006E, 0xFE9E, 0xFE37, 0xFF87, 0xFDD7, 0xF905, 0xF505, 0xF526, 0xF521, 0xF3E3, 0xF346, 0xF432, 0xF537, 0xF62C,
0xF6F2, 0xF772, 0xF79C, 0xF78B, 0xF765, 0xF72D, 0xF6E5, 0xF691, 0xF62E, 0xF5BB, 0xF530, 0xF46D, 0xF335, 0xF3E5,
0xF48C, 0xF500, 0xF542, 0xF566, 0xF560, 0xF560, 0xF554, 0xF54C, 0xF540, 0xF532, 0xF527, 0xF51E, 0xF519, 0xF518,
0x470A, 0x4696, 0x4612, 0x457F, 0x44E3, 0x4441, 0x439C, 0x42F7, 0x4255, 0x41B7, 0x411F, 0x408D, 0x4003, 0x3F85,
0x3F19, 0x3EAE, 0x3E51, 0x3E24, 0x3E3E, 0x3EB1, 0x3F96, 0x4112, 0x4340, 0x4619, 0x4969, 0x51BE, 0x5C7D, 0x64C7,
0x6996, 0x6B73, 0x71DF, 0x7C71, 0x862E, 0x8C09, 0x8EF9, 0x91AF, 0x9408, 0x95DE, 0x9705, 0x9745, 0x96C7, 0x95ED,
0x94C8, 0x935E, 0x91B2, 0x8FB6, 0x8D5B, 0x8A89, 0x86E0, 0x815E, 0x8070, 0x7FEF, 0x7F70, 0x7EF4, 0x7EF7, 0x7EC6,
0x7EE0, 0x7EAB, 0x7EC3, 0x7EB4, 0x7E7D, 0x7E6F, 0x7E89, 0x7E7D, 0x7E74, 0xD9E6, 0xDAAD, 0xDBA5, 0xDCC8, 0xDE15,
0xDF86, 0xE118, 0xE2C6, 0xE48B, 0xE662, 0xE844, 0xEA28, 0xEC01, 0xEDBF, 0xEF4B, 0xF079, 0xF113, 0xF0F3, 0xF005,
0xEE4C, 0xEBDC, 0xE8CF, 0xE542, 0xE157, 0xDD3A, 0xD664, 0xD171, 0xD4FD, 0xE066, 0xE942, 0xE46C, 0xE06F, 0xE277,
0xE3FA, 0xE179, 0xDEFA, 0xDCDA, 0xDB63, 0xDACD, 0xDB46, 0xDC47, 0xDD5C, 0xDEBA, 0xE08D, 0xE2FC, 0xE614, 0xE9E0,
0xEE9D, 0xF52C, 0xFFAD, 0x0000, 0xFFAD, 0xFFAD, 0x0000, 0xFFAE, 0x0000, 0xFFAE, 0x0000, 0xFFAE, 0xFFAD, 0x0000,
0x0000, 0xFFAD, 0xFFAD, 0xFFAE, 0x31BE, 0x31A4, 0x3178, 0x313C, 0x30F1, 0x3095, 0x302C, 0x2FB4, 0x2F2E, 0x2E9B,
0x2DFC, 0x2D51, 0x2C9A, 0x2BD8, 0x2B0C, 0x2A37, 0x2958, 0x2871, 0x2781, 0x268A, 0x258C, 0x2488, 0x237E, 0x226E,
0x215A, 0x2042, 0x1F26, 0x1E06, 0x1CE5, 0x1BC1, 0x1A9C, 0x1977, 0x1851, 0x172B, 0x1606, 0x14E2, 0x13C1, 0x12A2,
0x1186, 0x106D, 0x0F59, 0x0E49, 0x0D3F, 0x0C3B, 0x0B3D, 0x0A46, 0x0956, 0x086F, 0x0790, 0x06BB, 0x05EF, 0x052D,
0x0477, 0x03CB, 0x032C, 0x0299, 0x0214, 0x019C, 0x0132, 0x00D7, 0x008B, 0x004F, 0x0023, 0x0009, 0x0000, 0xF1CA,
0xF1D1, 0xF1DE, 0xF1EF, 0xF204, 0xF21E, 0xF23D, 0xF25F, 0xF285, 0xF2AF, 0xF2DD, 0xF30E, 0xF342, 0xF379, 0xF3B3,
0xF3F0, 0xF430, 0xF472, 0xF4B7, 0xF4FD, 0xF546, 0xF590, 0xF5DC, 0xF62A, 0xF679, 0xF6C9, 0xF71A, 0xF76C, 0xF7BF,
0xF812, 0xF866, 0xF8BA, 0xF90E, 0xF961, 0xF9B5, 0xFA08, 0xFA5B, 0xFAAD, 0xFAFE, 0xFB4F, 0xFB9D, 0xFBEB, 0xFC37,
0xFC81, 0xFCCA, 0xFD11, 0xFD55, 0xFD97, 0xFDD7, 0xFE14, 0xFE4E, 0xFE85, 0xFEBA, 0xFEEA, 0xFF18, 0xFF42, 0xFF68,
0xFF8A, 0xFFA9, 0xFFC3, 0xFFD8, 0xFFE9, 0xFFF6, 0xFFFD, 0x0000, 0xC399, 0xC3B9, 0xC3EE, 0xC437, 0xC493, 0xC501,
0xC582, 0xC614, 0xC6B6, 0xC768, 0xC82A, 0xC8FA, 0xC9D7, 0xCAC3, 0xCBBA, 0xCCBD, 0xCDCC, 0xCEE5, 0xD008, 0xD134,
0xD268, 0xD3A4, 0xD4E7, 0xD631, 0xD780, 0xD8D5, 0xDA2E, 0xDB8A, 0xDCEA, 0xDE4C, 0xDFB0, 0xE115, 0xE27A, 0xE3DE,
0xE542, 0xE6A4, 0xE804, 0xE960, 0xEAB9, 0xEC0E, 0xED5D, 0xEEA7, 0xEFEA, 0xF126, 0xF25B, 0xF387, 0xF4A9, 0xF5C2,
0xF6D1, 0xF7D4, 0xF8CC, 0xF9B7, 0xFA95, 0xFB65, 0xFC26, 0xFCD8, 0xFD7B, 0xFE0C, 0xFE8D, 0xFEFB, 0xFF57, 0xFFA0,
0xFFD5, 0xFFF5, 0x0000, 0xE7C7, 0xE81A, 0xE883, 0xE901, 0xE992, 0xEA35, 0xEAE9, 0xEBAB, 0xEC77, 0xED49, 0xEE1E,
0xEEED, 0xEFB1, 0xF061, 0xF0F6, 0xF15D, 0xF1B9, 0xF1DF, 0xF1E4, 0xF1E0, 0xF1AB, 0xF18D, 0xF161, 0xF122, 0xF0F6,
0xED20, 0xEA7F, 0xE8BA, 0xE795, 0xE6ED, 0xE664, 0xE5B4, 0xE4E6, 0xE40D, 0xE38E, 0xE38D, 0xE38D, 0xE38E, 0xE387,
0xE3FD, 0xE499, 0xE546, 0xE5F8, 0xE6A8, 0xE750, 0xE7E6, 0xE867, 0xE8BD, 0xE8CD, 0xE885, 0xE7E4, 0xE705, 0xE61C,
0xE56D, 0xE539, 0xE550, 0xE55E, 0xE566, 0xE569, 0xE568, 0xE566, 0xE562, 0xE55F, 0xE55E, 0xE55F, 0x10D8, 0x117E,
0x1246, 0x132A, 0x1422, 0x1528, 0x1636, 0x1745, 0x1850, 0x1952, 0x1A44, 0x1B22, 0x1BE7, 0x1C8F, 0x1D17, 0x1D75,
0x1DBA, 0x1DD6, 0x1DDA, 0x1DCE, 0x1DA0, 0x1D89, 0x1D66, 0x1D34, 0x1D17, 0x18F8, 0x155E, 0x1268, 0x1028, 0x0EAF,
0x0D75, 0x0BC8, 0x0968, 0x05C7, 0xFF97, 0xFEDC, 0xFE25, 0xFD60, 0x02F5, 0x06A7, 0x095F, 0x0B77, 0x0D1F, 0x0E71,
0x0F7A, 0x1057, 0x1116, 0x119E, 0x11D8, 0x11BB, 0x1149, 0x1099, 0x0FDA, 0x0F46, 0x0F1B, 0x0F30, 0x0F3B, 0x0F3E,
0x0F3B, 0x0F33, 0x0F28, 0x0F1B, 0x0F10, 0x0F07, 0x0F02, 0x4771, 0x47C6, 0x482E, 0x48A6, 0x492D, 0x49C1, 0x4A5F,
0x4B04, 0x4BAF, 0x4C5B, 0x4D06, 0x4DAA, 0x4E43, 0x4ECC, 0x4F3E, 0x4F82, 0x4FD8, 0x4FF1, 0x4FF3, 0x4FFD, 0x4FCC,
0x4FBB, 0x4F92, 0x4F60, 0x4F3F, 0x4C78, 0x4C20, 0x4D37, 0x4F0D, 0x5126, 0x535D, 0x556C, 0x56BA, 0x5662, 0x52B4,
0x5509, 0x56BC, 0x5783, 0x5ED2, 0x62D5, 0x650A, 0x6657, 0x6716, 0x6798, 0x682E, 0x68CE, 0x6939, 0x6945, 0x68CA,
0x67AC, 0x65EF, 0x63C7, 0x6198, 0x5FEA, 0x5F4A, 0x5F5A, 0x5F6E, 0x5F83, 0x5F99, 0x5FB0, 0x5FC7, 0x5FDE, 0x5FF4,
0x6008, 0x6019, 0xD815, 0xD75C, 0xD67E, 0xD584, 0xD477, 0xD35E, 0xD240, 0xD124, 0xD00F, 0xCF06, 0xCE0F, 0xCD2D,
0xCC66, 0xCBBC, 0xCB34, 0xCAE9, 0xCA6E, 0xCA3D, 0xCA3B, 0xCA19, 0xCA3F, 0xCA64, 0xCA95, 0xCAE4, 0xCB34, 0xCE79,
0xD195, 0xD434, 0xD601, 0xD699, 0xD7CB, 0xDB9E, 0xE23C, 0xECF5, 0xFFAE, 0xFFAE, 0xFFAD, 0x0000, 0xEB18, 0xDC69,
0xD148, 0xC8FF, 0xC2F5, 0xBEFD, 0xBD1D, 0xBB8D, 0xB8B8, 0xB51E, 0xB135, 0xAD62, 0xA9F8, 0xA72F, 0xA529, 0xA3F2,
0xA38D, 0xA398, 0xA3A4, 0xA3B2, 0xA3C0, 0xA3D0, 0xA3E1, 0xA3F3, 0xA405, 0xA418, 0xA42C, 0xCE39, 0xCE39, 0xCE39,
0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39,
0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE39, 0xCE50, 0xCE95, 0xCF05, 0xCF9E, 0xD05C, 0xD13F,
0xD243, 0xD366, 0xD4A6, 0xD600, 0xD772, 0xD8F9, 0xDA94, 0xDC3F, 0xDDF9, 0xDFBE, 0xE18E, 0xE364, 0xE53F, 0xE71C,
0xE8FA, 0xEAD5, 0xECAB, 0xEE7A, 0xF040, 0xF1FA, 0xF3A5, 0xF53F, 0xF6C7, 0xF839, 0xF993, 0xFAD3, 0xFBF6, 0xFCFA,
0xFDDC, 0xFE9B, 0xFF34, 0xFFA4, 0xFFE9, 0x0000, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39,
0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39, 0x0E39,
0x0E39, 0x0E39, 0x0E39, 0x0E32, 0x0E1E, 0x0DFF, 0x0DD3, 0x0D9C, 0x0D5C, 0x0D11, 0x0CBE, 0x0C63, 0x0C00, 0x0B96,
0x0B26, 0x0AB1, 0x0A37, 0x09B9, 0x0937, 0x08B3, 0x082D, 0x07A5, 0x071C, 0x0694, 0x060C, 0x0586, 0x0502, 0x0480,
0x0402, 0x0388, 0x0312, 0x02A3, 0x0239, 0x01D6, 0x017B, 0x0127, 0x00DD, 0x009C, 0x0066, 0x003A, 0x001A, 0x0007,
0x0000, 0xC399, 0xC3B9, 0xC3EE, 0xC437, 0xC493, 0xC501, 0xC582, 0xC614, 0xC6B6, 0xC768, 0xC82A, 0xC8FA, 0xC9D7,
0xCAC3, 0xCBBA, 0xCCBD, 0xCDCC, 0xCEE5, 0xD008, 0xD134, 0xD268, 0xD3A4, 0xD4E7, 0xD631, 0xD780, 0xD8D5, 0xDA2E,
0xDB8A, 0xDCEA, 0xDE4C, 0xDFB0, 0xE115, 0xE27A, 0xE3DE, 0xE542, 0xE6A4, 0xE804, 0xE960, 0xEAB9, 0xEC0E, 0xED5D,
0xEEA7, 0xEFEA, 0xF126, 0xF25B, 0xF387, 0xF4A9, 0xF5C2, 0xF6D1, 0xF7D4, 0xF8CC, 0xF9B7, 0xFA95, 0xFB65, 0xFC26,
0xFCD8, 0xFD7B, 0xFE0C, 0xFE8D, 0xFEFB, 0xFF57, 0xFFA0, 0xFFD5, 0xFFF5, 0x0000, 0x007A, 0x01F7, 0x044E, 0x0759,
0x0AEF, 0x0EE8, 0x131E, 0x1768, 0x1B9F, 0x1F9B, 0x2335, 0x2645, 0x28A3, 0x2A27, 0x2AAB, 0x2A79, 0x2A0C, 0x297D,
0x28E7, 0x2865, 0x2811, 0x2807, 0x2861, 0x2939, 0x2AAB, 0x2D22, 0x30C1, 0x352F, 0x3A15, 0x3F1C, 0x43ED, 0x482F,
0x4B8C, 0x4DAD, 0x4E39, 0x4D17, 0x4A95, 0x46F3, 0x4272, 0x3D55, 0x37DD, 0x324C, 0x2CE3, 0x27E3, 0x238E, 0x1F8D,
0x1B6C, 0x173F, 0x131D, 0x0F1C, 0x0B52, 0x07D4, 0x04B9, 0x0215, 0x0000, 0xFE8F, 0xFDB9, 0xFD63, 0xFD71, 0xFDC7,
0xFE4B, 0xFEE1, 0xFF6E, 0xFFD7, 0x0000, 0xFFD1, 0xFF4C, 0xFE81, 0xFD7A, 0xFC47, 0xFAF3, 0xF98C, 0xF81F, 0xF6B9,
0xF567, 0xF437, 0xF334, 0xF26E, 0xF1F0, 0xF1C7, 0xF1CD, 0xF1D0, 0xF1D1, 0xF1D1, 0xF1D0, 0xF1CE, 0xF1CB, 0xF1C9,
0xF1C8, 0xF1C7, 0xF1FA, 0xF284, 0xF350, 0xF448, 0xF555, 0xF663, 0xF75A, 0xF826, 0xF8B1, 0xF8E4, 0xF900, 0xF94F,
0xF9C2, 0xFA4F, 0xFAE7, 0xFB80, 0xFC0C, 0xFC80, 0xFCCE, 0xFCEB, 0xFD01, 0xFD3D, 0xFD96, 0xFE01, 0xFE76, 0xFEEA,
0xFF56, 0xFFAE, 0xFFEA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0xEAB1, 0xEACD, 0xEAFC, 0xEB3C, 0xEB87, 0xEBDB, 0xEC35, 0xEC91, 0xECEC, 0xED43, 0xED91, 0xEDD5, 0xEE09, 0xEE2C,
0xEE39, 0xEE3A, 0xEE3B, 0xEE3B, 0xEE3B, 0xEE3B, 0xEE3A, 0xEE3A, 0xEE39, 0xEE39, 0xEE39, 0xEE6C, 0xEEF6, 0xEFC2,
0xF0BA, 0xF1C7, 0xF2D5, 0xF3CC, 0xF498, 0xF522, 0xF555, 0xF564, 0xF58F, 0xF5D5, 0xF632, 0xF6A6, 0xF72F, 0xF7C9,
0xF874, 0xF92C, 0xF9F1, 0xFAC0, 0xFB97, 0xFC74, 0xFD56, 0xFE39, 0xFF1C, 0xFFFD, 0x00DA, 0x01B2, 0x0281, 0x0345,
0x03FE, 0x04A9, 0x0543, 0x05CB, 0x063F, 0x069D, 0x06E2, 0x070E, 0x071C, 0x0000,
};
static JointIndex sChildZeldaAnim_010DF8JointIndices[18] = {
{ 0x0004, 0x0045, 0x0086 },
{ 0x0000, 0x00C7, 0x0000 },
{ 0x0108, 0x0149, 0x018A },
{ 0x01CB, 0x020C, 0x024D },
{ 0x0000, 0x0000, 0x028E },
{ 0x02CF, 0x0310, 0x0351 },
{ 0x0000, 0x0000, 0x0392 },
{ 0x03D3, 0x0000, 0x0414 },
{ 0x0455, 0x0496, 0x04D7 },
{ 0x0518, 0x0000, 0x0559 },
{ 0x059A, 0x05DB, 0x0003 },
{ 0x061C, 0x065D, 0x069E },
{ 0x0000, 0x0000, 0x06DF },
{ 0x0720, 0x0761, 0x07A2 },
{ 0x07E3, 0x0824, 0x0865 },
{ 0x0000, 0x0000, 0x08A6 },
{ 0x08E7, 0x0928, 0x0969 },
{ 0x09AA, 0x09EB, 0x0A2C },
};
AnimationHeader gChildZeldaAnim_010DF8 = { { 65 }, sChildZeldaAnim_010DF8FrameData, sChildZeldaAnim_010DF8JointIndices, 4 };
static u8 unaccounted_010E08[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_011248FrameData[486] = {
0x0000, 0x09DD, 0xFFFF, 0xC000, 0x4000, 0xFFC3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x09DD, 0x09DC,
0x09D9, 0x09D6, 0x09D2, 0x09CE, 0x09CA, 0x09C7, 0x09C5, 0x09C4, 0x09C5, 0x09C6, 0x09C9, 0x09CC, 0x09CF, 0x09D3,
0x09D6, 0x09D9, 0x09DB, 0x09DD, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0xBF12, 0xBF15, 0xBF17, 0xBF18,
0xBF19, 0xBF1A, 0xBF1A, 0xBF1A, 0xBF19, 0xBF18, 0xBF17, 0xBF16, 0xBF15, 0xBF14, 0xBF12, 0xBF11, 0xBF10, 0xBF10,
0xBF0F, 0xBF0F, 0x0018, 0x002B, 0x003B, 0x0046, 0x004D, 0x0051, 0x0052, 0x0050, 0x004C, 0x0045, 0x003D, 0x0034,
0x002A, 0x0021, 0x0018, 0x0010, 0x0009, 0x0004, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x0003, 0x0003, 0x0003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001,
0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0xF70E, 0xF6C6, 0xF655, 0xF5D0, 0xF545, 0xF4C1, 0xF44F, 0xF3F6,
0xF3BD, 0xF3AD, 0xF3C5, 0xF3FC, 0xF44C, 0xF4AF, 0xF520, 0xF598, 0xF610, 0xF67F, 0xF6DA, 0xF716, 0x0BE8, 0x0C38,
0x0CDA, 0x0DAB, 0x0E8F, 0x0F6E, 0x1036, 0x10D7, 0x1145, 0x1171, 0x115A, 0x110F, 0x1099, 0x1001, 0x0F51, 0x0E92,
0x0DD0, 0x0D1A, 0x0C82, 0x0C1D, 0x0000, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF726, 0xF6DD, 0xF66D, 0xF5E9,
0xF560, 0xF4DE, 0xF46D, 0xF415, 0xF3DE, 0xF3CF, 0xF3E7, 0xF41F, 0xF46F, 0xF4D2, 0xF543, 0xF5BB, 0xF633, 0xF6A1,
0xF6FC, 0xF737, 0x0C24, 0x0C74, 0x0D13, 0x0DE1, 0x0EC1, 0x0F9D, 0x1062, 0x1101, 0x116C, 0x1197, 0x117E, 0x1132,
0x10BC, 0x1024, 0x0F73, 0x0EB4, 0x0DF3, 0x0D3E, 0x0CA6, 0x0C41, 0x0000, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0xFFFF, 0xFFFE, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFE, 0xFFFE, 0xFFFF,
0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFF6, 0xFFF6,
0x0000, 0x0000, 0xFFF6, 0x0000, 0xFFF5, 0x0000, 0x0000, 0xFFF5, 0xFFF5, 0x0000, 0xFFF5, 0x0000, 0xFFF5, 0x0000,
0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xF519, 0xF516, 0xF512, 0xF50C, 0xF506, 0xF4FF, 0xF4F8, 0xF4F3, 0xF4EF, 0xF4EE,
0xF4EF, 0xF4F1, 0xF4F6, 0xF4FB, 0xF500, 0xF506, 0xF50C, 0xF511, 0xF515, 0xF518, 0x7E6E, 0x7E68, 0x7E3D, 0x7E3B,
0x7E61, 0x7E39, 0x7E60, 0x7E39, 0x7E3A, 0x7E61, 0x7E62, 0x7E3D, 0x7E67, 0x7E43, 0x7E6E, 0x7E4A, 0x7E75, 0x7E78,
0x7E7B, 0x7E7C, 0xFFAD, 0xFFAD, 0x0000, 0x0000, 0xFFAE, 0x0000, 0xFFAD, 0x0000, 0x0000, 0xFFAE, 0xFFAE, 0x0000,
0xFFAD, 0x0000, 0xFFAE, 0x0000, 0xFFAE, 0xFFAE, 0xFFAE, 0xFFAD, 0xE560, 0xE55E, 0xE558, 0xE550, 0xE544, 0xE536,
0xE525, 0xE514, 0xE503, 0xE4F6, 0xE4F1, 0xE4F3, 0xE4FE, 0xE511, 0xE52D, 0xE550, 0xE577, 0xE59F, 0xE5C4, 0xE5E0,
0x0F02, 0x0F05, 0x0F09, 0x0F10, 0x0F19, 0x0F25, 0x0F32, 0x0F40, 0x0F4E, 0x0F58, 0x0F5C, 0x0F59, 0x0F4E, 0x0F3C,
0x0F23, 0x0F04, 0x0EE1, 0x0EBD, 0x0E9C, 0x0E83, 0x6009, 0x5FC6, 0x5F59, 0x5ED1, 0x5E39, 0x5D9C, 0x5D09, 0x5C8C,
0x5C33, 0x5C0E, 0x5C23, 0x5C6A, 0x5CD7, 0x5D62, 0x5DFE, 0x5EA1, 0x5F3F, 0x5FCA, 0x6036, 0x6074, 0xA43B, 0xA445,
0xA44A, 0xA44C, 0xA44D, 0xA44E, 0xA450, 0xA452, 0xA454, 0xA455, 0xA453, 0xA44F, 0xA449, 0xA442, 0xA43D, 0xA439,
0xA436, 0xA435, 0xA435, 0xA435, 0x070D, 0x06E4, 0x06A6, 0x065C, 0x060B, 0x05BB, 0x0570, 0x0533, 0x050A, 0x04FA,
0x050A, 0x0533, 0x0570, 0x05BB, 0x060B, 0x065C, 0x06A6, 0x06E4, 0x070D, 0x071C,
};
static JointIndex sChildZeldaAnim_011248JointIndices[18] = {
{ 0x0006, 0x001A, 0x002E },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0042, 0x0056, 0x0003 },
{ 0x006A, 0x007E, 0x0092 },
{ 0x0000, 0x0000, 0x00A6 },
{ 0x0000, 0x00BA, 0x00CE },
{ 0x0000, 0x0000, 0x00E2 },
{ 0x00F6, 0x0000, 0x0000 },
{ 0x010A, 0x0000, 0x0000 },
{ 0x011E, 0x0000, 0x0000 },
{ 0x0004, 0x0005, 0x0004 },
{ 0x0132, 0x0146, 0x015A },
{ 0x0000, 0x0000, 0x016E },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0182, 0x0196, 0x01AA },
{ 0x0000, 0x0000, 0x01BE },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x01D2 },
};
AnimationHeader gChildZeldaAnim_011248 = { { 20 }, sChildZeldaAnim_011248FrameData, sChildZeldaAnim_011248JointIndices, 6 };
static u8 unaccounted_011258[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_011698FrameData[486] = {
0x0000, 0x09DE, 0xFFF7, 0xC000, 0x4000, 0x09DE, 0x09DF, 0x09DF, 0x09E0, 0x09E0, 0x09E1, 0x09E1, 0x09E1, 0x09E1,
0x09E1, 0x09E1, 0x09E1, 0x09E1, 0x09E1, 0x09E1, 0x09E1, 0x09E0, 0x09DF, 0x09DE, 0x09DD, 0xFFF7, 0xFFE7, 0xFFCF,
0xFFB4, 0xFF97, 0xFF7B, 0xFF61, 0xFF4C, 0xFF3D, 0xFF38, 0xFF3D, 0xFF4B, 0xFF5F, 0xFF78, 0xFF94, 0xFFB0, 0xFFCB,
0xFFE3, 0xFFF5, 0x0000, 0xBF0C, 0xBF07, 0xBEFF, 0xBEF5, 0xBEEB, 0xBEE2, 0xBED9, 0xBED1, 0xBECC, 0xBECA, 0xBECB,
0xBECF, 0xBED6, 0xBEDE, 0xBEE7, 0xBEF1, 0xBEFA, 0xBF03, 0xBF0A, 0xBF0F, 0xFFD8, 0xFF89, 0xFF1D, 0xFE9E, 0xFE17,
0xFD92, 0xFD19, 0xFCB6, 0xFC73, 0xFC5B, 0xFC72, 0xFCB1, 0xFD10, 0xFD84, 0xFE05, 0xFE8A, 0xFF08, 0xFF77, 0xFFCC,
0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
0xFFFE, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xF73D, 0xF769, 0xF79C, 0xF7DB, 0xF828, 0xF881, 0xF8E0,
0xF93A, 0xF97E, 0xF999, 0xF983, 0xF948, 0xF8F9, 0xF8A2, 0xF84F, 0xF805, 0xF7C4, 0xF78B, 0xF755, 0xF71E, 0x0BDD,
0x0BA2, 0x0B62, 0x0B11, 0x0AAA, 0x0A2D, 0x09A2, 0x091B, 0x08B3, 0x0888, 0x08A9, 0x0901, 0x0977, 0x09F3, 0x0A66,
0x0ACA, 0x0B1D, 0x0B67, 0x0BB1, 0x0C07, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF,
0xFFFE, 0xFFFE, 0xFFFD, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFB, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFE, 0xFFFF,
0xFFFF, 0xFFFF, 0x0000, 0xF762, 0xF78E, 0xF7C3, 0xF803, 0xF851, 0xF8AA, 0xF909, 0xF963, 0xF9A5, 0xF9BF, 0xF9A9,
0xF96D, 0xF91D, 0xF8C6, 0xF871, 0xF825, 0xF7E2, 0xF7A8, 0xF771, 0xF739, 0x0C05, 0x0BCD, 0x0B8E, 0x0B3F, 0x0ADB,
0x0A61, 0x09DA, 0x0958, 0x08F4, 0x08CC, 0x08EE, 0x0946, 0x09BB, 0x0A35, 0x0AA8, 0x0B0A, 0x0B5D, 0x0BA5, 0x0BEE,
0x0C42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0002,
0x0002, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0002, 0x0001, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002,
0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0033, 0x00BD, 0x0189, 0x0281, 0x038E, 0x049C, 0x0593, 0x065F, 0x06E9,
0x071C, 0x06E8, 0x0659, 0x0586, 0x0486, 0x0370, 0x0259, 0x015A, 0x0087, 0xFFF8, 0xFFC3, 0xFEAE, 0xFD6C, 0xFC3A,
0xFB55, 0xFB16, 0xFB5E, 0xFBCA, 0xFC51, 0xFCE4, 0xFD78, 0xFE00, 0xFE82, 0xFF13, 0xFFF4, 0xFFF5, 0xFFF5, 0xFFF5,
0xFFF5, 0x0000, 0x0000, 0xF48B, 0xF3B3, 0xF2AF, 0xF1D2, 0xF177, 0xF186, 0xF1A9, 0xF1DE, 0xF221, 0xF26C, 0xF2BE,
0xF314, 0xF36A, 0xF3C2, 0xF41C, 0xF46E, 0xF4B4, 0xF4EB, 0xF50E, 0xF518, 0x82EB, 0x8661, 0x88CC, 0x89FA, 0x89C0,
0x8894, 0x872D, 0x85A4, 0x8415, 0x82A1, 0x8161, 0x8037, 0x7ED8, 0x7C5B, 0x7CC4, 0x7D2A, 0x7D8C, 0x7DE4, 0x7E09,
0x7E47, 0xF622, 0xEE4D, 0xE872, 0xE4F9, 0xE455, 0xE5B9, 0xE7C5, 0xEA58, 0xED45, 0xF04E, 0xF33C, 0xF631, 0xF9BA,
0xFFAE, 0xFFAE, 0xFFAE, 0xFFAD, 0xFFAE, 0x0000, 0x0000, 0xF4F6, 0xF73E, 0xF8EC, 0xF944, 0xF785, 0xF38D, 0xEE9B,
0xEA6E, 0xE7D5, 0xE6E1, 0xE6BB, 0xE699, 0xE67C, 0xE660, 0xE641, 0xE61B, 0xE5EA, 0xE5B4, 0xE582, 0xE565, 0x0DDB,
0x0F64, 0x1041, 0x1093, 0x1082, 0x1014, 0x0F2D, 0x0DD9, 0x0C89, 0x0C00, 0x0C38, 0x0CA2, 0x0D26, 0x0DB1, 0x0E2F,
0x0E94, 0x0ED8, 0x0EFC, 0x0F08, 0x0F08, 0x8739, 0x8D34, 0x90CB, 0x9092, 0x8B41, 0x8103, 0x74B5, 0x6A09, 0x630B,
0x6086, 0x607E, 0x6086, 0x6096, 0x60A3, 0x60A4, 0x6096, 0x6078, 0x6050, 0x602C, 0x601C, 0xEB4F, 0xDA72, 0xCAF1,
0xBDE1, 0xB47C, 0xB00B, 0xB0B7, 0xB4A9, 0xB8F8, 0xBAE0, 0xBA39, 0xB877, 0xB5E9, 0xB2DD, 0xAF9B, 0xAC61, 0xA96B,
0xA6ED, 0xA51A, 0xA425, 0xFF69, 0xFDFF, 0xFC50, 0xFAE7, 0xFA50, 0xFA50, 0xFA50, 0xFA50, 0xFA50, 0xFA50, 0xFAAB,
0xFBA4, 0xFD13, 0xFED1, 0x00B6, 0x029B, 0x0459, 0x05C8, 0x06C1, 0x071C, 0x0000,
};
static JointIndex sChildZeldaAnim_011698JointIndices[18] = {
{ 0x0000, 0x0005, 0x0019 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x002D, 0x0041, 0x0003 },
{ 0x0000, 0x0055, 0x0069 },
{ 0x0000, 0x0000, 0x007D },
{ 0x0091, 0x00A5, 0x00B9 },
{ 0x0000, 0x0000, 0x00CD },
{ 0x00E1, 0x0000, 0x0000 },
{ 0x00F5, 0x0000, 0x0000 },
{ 0x0109, 0x0000, 0x0000 },
{ 0x0004, 0x011D, 0x0004 },
{ 0x0131, 0x0145, 0x0159 },
{ 0x0000, 0x0000, 0x016D },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0181, 0x0195, 0x01A9 },
{ 0x0000, 0x0000, 0x01BD },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x01D1 },
};
AnimationHeader gChildZeldaAnim_011698 = { { 20 }, sChildZeldaAnim_011698FrameData, sChildZeldaAnim_011698JointIndices, 5 };
static u8 unaccounted_0116A8[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_011B34FrameData[524] = {
0x0000, 0x09DE, 0xC000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x09DE, 0x09DE, 0x09DF, 0x09DF,
0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DE, 0x09DE, 0x09DE, 0x09DE, 0x09DD, 0x09DD,
0x09DD, 0x09DD, 0xBF13, 0xBF13, 0xBF12, 0xBF12, 0xBF12, 0xBF11, 0xBF11, 0xBF11, 0xBF11, 0xBF10, 0xBF10, 0xBF10,
0xBF10, 0xBF10, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xF731, 0xF749, 0xF75B, 0xF769, 0xF771, 0xF776,
0xF776, 0xF774, 0xF76E, 0xF767, 0xF75E, 0xF753, 0xF748, 0xF73D, 0xF733, 0xF729, 0xF720, 0xF71A, 0xF715, 0xF714,
0x0BE9, 0x0BBF, 0x0B9E, 0x0B87, 0x0B77, 0x0B6F, 0x0B6E, 0x0B72, 0x0B7C, 0x0B89, 0x0B99, 0x0BAB, 0x0BBF, 0x0BD2,
0x0BE5, 0x0BF6, 0x0C05, 0x0C11, 0x0C18, 0x0C1B, 0xF756, 0xF76E, 0xF781, 0xF78E, 0xF797, 0xF79B, 0xF79C, 0xF799,
0xF794, 0xF78C, 0xF783, 0xF778, 0xF76D, 0xF762, 0xF758, 0xF74E, 0xF745, 0xF73F, 0xF73B, 0xF739, 0x0C0E, 0x0BE4,
0x0BC3, 0x0BAC, 0x0B9C, 0x0B95, 0x0B94, 0x0B98, 0x0BA2, 0x0BAF, 0x0BC0, 0x0BD2, 0x0BE6, 0x0BF9, 0x0C0C, 0x0C1D,
0x0C2C, 0x0C38, 0x0C40, 0x0C42, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFD, 0xFFFD, 0xFFFE, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFD8, 0xFF67, 0xFEB4, 0xFDC8, 0xFCAB, 0xFB64,
0xF9FD, 0xF87E, 0xF6EE, 0xF555, 0xF3BD, 0xF22D, 0xF0AD, 0xEF46, 0xEE00, 0xECE3, 0xEBF6, 0xEB44, 0xEAD2, 0xEAAB,
0xFFBE, 0x0102, 0x0357, 0x065B, 0x09AE, 0x0CF4, 0x0FD3, 0x11EB, 0x12DD, 0x1269, 0x13E0, 0x1858, 0x1DA4, 0x2183,
0x1E10, 0x2003, 0x1DBB, 0x1C58, 0x1D6B, 0x1C89, 0xF4F9, 0xF4F1, 0xF486, 0xF3A1, 0xF255, 0xF0E2, 0xEFA2, 0xEF03,
0xEF77, 0xF15D, 0xF282, 0xF1F0, 0xF13C, 0xF1A9, 0xF61E, 0xF731, 0xFA76, 0xFCC6, 0xFCF4, 0xFDD5, 0x821A, 0x84DC,
0x86E9, 0x881C, 0x8859, 0x8791, 0x85CF, 0x833E, 0x802C, 0x7CE5, 0x785D, 0x71FC, 0x6A8B, 0x638E, 0x6113, 0x5BD4,
0x59AF, 0x57C3, 0x556A, 0x554C, 0xF787, 0xEFC4, 0xE825, 0xE0D8, 0xD9F0, 0xD37D, 0xCD91, 0xC842, 0xC3A7, 0xBFD8,
0xBCEB, 0xBAEA, 0xB9D3, 0xB992, 0xB9FF, 0xBAE4, 0xBC00, 0xBD12, 0xBDD9, 0xBE23, 0x0021, 0x0080, 0x0115, 0x01DA,
0x02C8, 0x03D8, 0x0503, 0x0643, 0x0790, 0x08E5, 0x0A39, 0x0B86, 0x0CC5, 0x0DF1, 0x0F00, 0x0FEE, 0x10B3, 0x1148,
0x11A6, 0x11C7, 0xFFDF, 0xFF81, 0xFEEC, 0xFE27, 0xFD39, 0xFC29, 0xFAFE, 0xF9BE, 0xF871, 0xF71C, 0xF5C8, 0xF47B,
0xF33B, 0xF210, 0xF100, 0xF012, 0xEF4D, 0xEEB8, 0xEE5A, 0xEE39, 0xFFB0, 0xFECD, 0xFD68, 0xFB8F, 0xF954, 0xF6C8,
0xF3F9, 0xF0FA, 0xEDDA, 0xEAAA, 0xE779, 0xE459, 0xE15A, 0xDE8C, 0xDC00, 0xD9C5, 0xD7ED, 0xD687, 0xD5A4, 0xD555,
0xF394, 0xF411, 0xF45D, 0xF45C, 0xF400, 0xF341, 0xF219, 0xF087, 0xEE91, 0xEC49, 0xE9CF, 0xE755, 0xE512, 0xE337,
0xE1E1, 0xE111, 0xE0B4, 0xE0A9, 0xE0CA, 0xE0EF, 0x0CAF, 0x0D52, 0x0DE6, 0x0E64, 0x0ECF, 0x0F2D, 0x0F7C, 0x0FB7,
0x0FCD, 0x0FAC, 0x0F3F, 0x0E74, 0x0D49, 0x0BCB, 0x0A19, 0x0858, 0x06B2, 0x0550, 0x0458, 0x03F2, 0x8349, 0x8554,
0x870A, 0x881C, 0x886C, 0x87E8, 0x8681, 0x8429, 0x80DA, 0x7C9E, 0x7797, 0x7200, 0x6C2B, 0x6675, 0x6131, 0x5C9F,
0x58EA, 0x5631, 0x5489, 0x5403, 0xF48F, 0xEE0E, 0xE6F8, 0xDFF5, 0xD93A, 0xD2E6, 0xCD11, 0xC7D2, 0xC344, 0xBF7F,
0xBC98, 0xBA9B, 0xB987, 0xB946, 0xB9B2, 0xBA95, 0xBBAF, 0xBCBE, 0xBD84, 0xBDCD, 0xFFEC, 0xFFB4, 0xFF5B, 0xFEE5,
0xFE56, 0xFDB3, 0xFD00, 0xFC40, 0xFB78, 0xFAAB, 0xF9DF, 0xF917, 0xF857, 0xF7A4, 0xF700, 0xF672, 0xF5FB, 0xF5A2,
0xF569, 0xF555, 0x0021, 0x0080, 0x0116, 0x01DB, 0x02C8, 0x03D8, 0x0504, 0x0643, 0x0791, 0x08E5, 0x0A39, 0x0B86,
0x0CC6, 0x0DF1, 0x0F00, 0x0FEE, 0x10B3, 0x1148, 0x11A6, 0x11C7, 0xFFB0, 0xFECE, 0xFD68, 0xFB8F, 0xF954, 0xF6C8,
0xF3F9, 0xF0FA, 0xEDDA, 0xEAAA, 0xE779, 0xE459, 0xE15A, 0xDE8C, 0xDC00, 0xD9C5, 0xD7ED, 0xD687, 0xD5A5, 0xD555,
0xFFD8, 0xFF67, 0xFEB4, 0xFDC8, 0xFCAB, 0xFB64, 0xF9FD, 0xF87E, 0xF6EE, 0xF555, 0xF3BD, 0xF22D, 0xF0AD, 0xEF46,
0xEE00, 0xECE3, 0xEBF6, 0xEB44, 0xEAD2, 0xEAAB,
};
static JointIndex sChildZeldaAnim_011B34JointIndices[18] = {
{ 0x0004, 0x0018, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x002C, 0x0000, 0x0002 },
{ 0x0000, 0x0000, 0x0040 },
{ 0x0000, 0x0000, 0x0054 },
{ 0x0000, 0x0000, 0x0068 },
{ 0x0000, 0x0000, 0x007C },
{ 0x0090, 0x0000, 0x0000 },
{ 0x00A4, 0x0000, 0x0000 },
{ 0x00B8, 0x0000, 0x0000 },
{ 0x0003, 0x00CC, 0x0003 },
{ 0x00E0, 0x00F4, 0x0108 },
{ 0x0000, 0x0000, 0x011C },
{ 0x0130, 0x0144, 0x0158 },
{ 0x016C, 0x0180, 0x0194 },
{ 0x0000, 0x0000, 0x01A8 },
{ 0x01BC, 0x01D0, 0x01E4 },
{ 0x0000, 0x0000, 0x01F8 },
};
AnimationHeader gChildZeldaAnim_011B34 = { { 20 }, sChildZeldaAnim_011B34FrameData, sChildZeldaAnim_011B34JointIndices, 4 };
static u8 unaccounted_011B44[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_0125E4FrameData[1300] = {
0x0622, 0x0990, 0x0000, 0x0622, 0x0625, 0x062C, 0x0637, 0x0645, 0x0657, 0x066D, 0x0685, 0x069F, 0x06BB, 0x06D9,
0x06F8, 0x0718, 0x0738, 0x0759, 0x0779, 0x0799, 0x07B8, 0x07D6, 0x07F2, 0x080D, 0x0824, 0x083A, 0x084C, 0x085A,
0x0865, 0x086C, 0x0990, 0x098B, 0x0981, 0x0977, 0x0973, 0x0979, 0x098A, 0x09A1, 0x09BA, 0x09D1, 0x09E1, 0x09E8,
0x09E7, 0x09E5, 0x09E3, 0x09DF, 0x09DA, 0x09D6, 0x09D0, 0x09CB, 0x09C5, 0x09C0, 0x09BB, 0x09B7, 0x09B3, 0x09B0,
0x09AF, 0x0000, 0x0004, 0x000D, 0x0016, 0x001A, 0x0019, 0x0019, 0x0018, 0x0017, 0x0017, 0x0016, 0x0016, 0x0016,
0x0015, 0x0014, 0x0012, 0x0011, 0x000F, 0x000D, 0x000B, 0x0009, 0x0007, 0x0005, 0x0003, 0x0002, 0x0001, 0x0000,
0xC000, 0xC077, 0xC1CB, 0xC3E3, 0xC6A8, 0xCA00, 0xCDD3, 0xD208, 0xD687, 0xDB37, 0xE000, 0xE4C9, 0xE979, 0xEDF8,
0xF22D, 0xF600, 0xF958, 0xFC1D, 0xFE35, 0xFF89, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xC002,
0xC008, 0xC019, 0xC035, 0xC059, 0xC086, 0xC0BB, 0xC0F6, 0xC137, 0xC17D, 0xC1C6, 0xC213, 0xC262, 0xC2B1, 0xC301,
0xC351, 0xC39F, 0xC3EB, 0xC433, 0xC478, 0xC4B7, 0xC4F1, 0xC524, 0xC550, 0xC574, 0xC58E, 0xC59F, 0x0317, 0x0312,
0x0305, 0x02F0, 0x02D4, 0x02B2, 0x0289, 0x025C, 0x022A, 0x01F4, 0x01BC, 0x0181, 0x0144, 0x0106, 0x00C8, 0x008A,
0x004D, 0x0012, 0xFFDA, 0xFFA4, 0xFF72, 0xFF45, 0xFF1D, 0xFEFA, 0xFEDE, 0xFEC9, 0xFEBC, 0xBE15, 0xBE16, 0xBE19,
0xBE1D, 0xBE23, 0xBE2A, 0xBE32, 0xBE3B, 0xBE46, 0xBE51, 0xBE5C, 0xBE68, 0xBE75, 0xBE82, 0xBE8E, 0xBE9B, 0xBEA8,
0xBEB4, 0xBEBF, 0xBECA, 0xBED5, 0xBEDE, 0xBEE6, 0xBEEE, 0xBEF3, 0xBEF8, 0xBEFA, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFDF,
0xFFE1, 0x000F, 0x0040, 0x0053, 0x0000, 0x0004, 0x0000, 0x0000, 0x0006, 0x0020, 0x00A7, 0x00DE, 0x00F9, 0x0103,
0x00FE, 0x00EF, 0x00D9, 0x00BF, 0x00A4, 0x0089, 0x0072, 0x0060, 0x0054, 0x02A5, 0x028F, 0x0243, 0x01AE, 0x00C8,
0xFFA7, 0xFE72, 0xFD3D, 0xFC1C, 0xFB28, 0xFA69, 0xF9E1, 0xF993, 0xF97F, 0xF9A9, 0xF9FE, 0xFA75, 0xFB02, 0xFB9B,
0xFC36, 0xFCCD, 0xFD5A, 0xFDD6, 0xFE41, 0xFE98, 0xFED8, 0xFF00, 0x0ACB, 0x0ACE, 0x0AD0, 0x07D5, 0x0493, 0x0359,
0x034D, 0x0441, 0x080E, 0x06DD, 0x05E7, 0x04CD, 0x0394, 0x01E9, 0xFD98, 0xFB2A, 0xF94E, 0xF7D8, 0xF6B4, 0xF5D9,
0xF53D, 0xF4C8, 0xF466, 0xF415, 0xF3D5, 0xF3A6, 0xF388, 0x0043, 0x0043, 0x0043, 0x057C, 0x0AFD, 0x0C81, 0x0B88,
0x086E, 0x0000, 0x0042, 0x0000, 0x0000, 0x0042, 0x0165, 0x0763, 0x0A52, 0x0C8E, 0x0E6C, 0x100C, 0x117C, 0x12C2,
0x13DD, 0x14CB, 0x158E, 0x1628, 0x1699, 0x16DF, 0x01EA, 0x0200, 0x0230, 0x0264, 0x028C, 0x028C, 0x0253, 0x01DA,
0x0103, 0x0000, 0x0000, 0x0008, 0x0008, 0x0007, 0x0007, 0x0006, 0x0065, 0x00A8, 0x00BF, 0x00C3, 0x00B9, 0x00A9,
0x0095, 0x0080, 0x006D, 0x005D, 0x0053, 0xF8C2, 0xF8C7, 0xF8C7, 0xF8AF, 0xF86C, 0xF80A, 0xF7A6, 0xF750, 0xF713,
0xF70B, 0xF731, 0xF773, 0xF7D1, 0xF84A, 0xF8D8, 0xF975, 0xFA1F, 0xFACF, 0xFB7B, 0xFC20, 0xFCB9, 0xFD45, 0xFDC0,
0xFE2A, 0xFE80, 0xFEBF, 0xFEE7, 0xF67F, 0xF600, 0xF4F9, 0xF3FC, 0xF378, 0xF3CE, 0xF508, 0xF727, 0xFAB7, 0xFEEC,
0xFE88, 0xFE0F, 0xFDCF, 0xFDA7, 0xFD99, 0xFDA2, 0xFB27, 0xF8F4, 0xF799, 0xF697, 0xF5C5, 0xF515, 0xF483, 0xF40D,
0xF3B0, 0xF36C, 0xF342, 0x1288, 0x135E, 0x1513, 0x169F, 0x1736, 0x1625, 0x1365, 0x0EFF, 0x080D, 0x0000, 0x0000,
0x0042, 0x0042, 0x0042, 0x0042, 0x0043, 0x04D9, 0x0912, 0x0BDB, 0x0E04, 0x0FC0, 0x112A, 0x1254, 0x1345, 0x1401,
0x1489, 0x14DE, 0xFC13, 0xFC2C, 0xFC89, 0xFD42, 0xFE71, 0x00B9, 0x03D8, 0x0690, 0x07A3, 0x0743, 0x0687, 0x0581,
0x0445, 0x02E6, 0x0177, 0x000B, 0xFEB7, 0xFD8C, 0xFC9F, 0xFC03, 0xFBCA, 0xFBCA, 0xFBCA, 0xFBCA, 0xFBCA, 0xFBCA,
0xFBCA, 0xFCC4, 0xFCBF, 0xFCB4, 0xFCAA, 0xFCA8, 0xFCB1, 0xFCC1, 0xFCD3, 0xFCDF, 0xFCE7, 0xFCEF, 0xFCF7, 0xFCFF,
0xFD07, 0xFD0E, 0xFD15, 0xFD1A, 0xFD1F, 0xFD23, 0xFD25, 0xFD26, 0xFD26, 0xFD26, 0xFD26, 0xFD26, 0xFD26, 0xFD26,
0xF8E4, 0xF836, 0xF6B0, 0xF51B, 0xF43E, 0xF46D, 0xF534, 0xF62C, 0xF6F0, 0xF77F, 0xF81A, 0xF8BC, 0xF960, 0xFA03,
0xFA9E, 0xFB2F, 0xFBAF, 0xFC1B, 0xFC6E, 0xFCA3, 0xFCB6, 0xFCB6, 0xFCB6, 0xFCB6, 0xFCB6, 0xFCB6, 0xFCB6, 0x0091,
0x00F1, 0x01DC, 0x0305, 0x0420, 0x0535, 0x0663, 0x0780, 0x0861, 0x091F, 0x09D7, 0x0A67, 0x0AAA, 0x0A7D, 0x09FB,
0x095A, 0x08A1, 0x07D3, 0x06F6, 0x0610, 0x0525, 0x043C, 0x0359, 0x0281, 0x01BA, 0x010A, 0x0075, 0x01B3, 0x019C,
0x0168, 0x0130, 0x010F, 0x010B, 0x0118, 0x012D, 0x0143, 0x015B, 0x0179, 0x0197, 0x01B0, 0x01BF, 0x01C5, 0x01CA,
0x01CE, 0x01D0, 0x01D1, 0x01D2, 0x01D2, 0x01D1, 0x01D0, 0x01CF, 0x01CD, 0x01CC, 0x01CB, 0x0F2B, 0x0FEB, 0x118D,
0x1327, 0x13CF, 0x1314, 0x1185, 0x0FB2, 0x0E29, 0x0CF6, 0x0BCC, 0x0AB8, 0x09C7, 0x0906, 0x085D, 0x07A9, 0x06F0,
0x0635, 0x057D, 0x04CB, 0x0423, 0x038A, 0x0304, 0x0294, 0x023F, 0x0209, 0x01F6, 0x0027, 0x0045, 0x0098, 0x011A,
0x01C3, 0x028D, 0x0370, 0x0464, 0x0564, 0x0666, 0x0766, 0x085A, 0x093C, 0x0A05, 0x0AAE, 0x0B2E, 0x0B80, 0x0B9C,
0x0B48, 0x0A65, 0x0918, 0x0784, 0x05CC, 0x0415, 0x0281, 0x0135, 0x0053, 0xFF33, 0xFF34, 0xFF37, 0xFF3C, 0xFF43,
0xFF4B, 0xFF54, 0xFF5E, 0xFF69, 0xFF75, 0xFF81, 0xFF8C, 0xFF98, 0xFFA4, 0xFFAF, 0xFFB9, 0xFFC3, 0xFFCB, 0xFFD3,
0xFFDA, 0xFFE2, 0xFFE9, 0xFFEF, 0xFFF5, 0xFFF9, 0xFFFD, 0xFFFF, 0xF53E, 0xF550, 0xF585, 0xF5D9, 0xF647, 0xF6CE,
0xF768, 0xF813, 0xF8CA, 0xF98B, 0xFA52, 0xFB1B, 0xFBE2, 0xFCA5, 0xFD5E, 0xFE0C, 0xFEAA, 0xFF34, 0xFFB4, 0x0034,
0x00B0, 0x0126, 0x0192, 0x01F1, 0x0240, 0x027C, 0x02A3, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x4169,
0x42AE, 0x4484, 0x46B1, 0x48FB, 0x4B28, 0x4CFE, 0x4E42, 0x4EBB, 0x4DA9, 0x4AFB, 0x477E, 0x4400, 0x4150, 0x403C,
0x403C, 0x403C, 0x403C, 0x403C, 0x403C, 0x403C, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E7, 0xF5F3,
0xF603, 0xF617, 0xF62C, 0xF640, 0xF651, 0xF65D, 0xF661, 0xF657, 0xF63C, 0xF61B, 0xF5FA, 0xF5E2, 0xF5D8, 0xF5D8,
0xF5D8, 0xF5D8, 0xF5D8, 0xF5D8, 0xF5D8, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2A, 0x3F1F, 0x3F0F,
0x3EFD, 0x3EEA, 0x3ED7, 0x3EC8, 0x3EBD, 0x3EB9, 0x3EF8, 0x3F95, 0x4061, 0x412D, 0x41CA, 0x4209, 0x4209, 0x4209,
0x4209, 0x4209, 0x4209, 0x4209, 0x03F8, 0x03F8, 0x03F9, 0x03FA, 0x03FC, 0x03FE, 0x0400, 0x0403, 0x0406, 0x040A,
0x040D, 0x0411, 0x0414, 0x0418, 0x041C, 0x0420, 0x0424, 0x0427, 0x042B, 0x042E, 0x0431, 0x0434, 0x0437, 0x0439,
0x043A, 0x043C, 0x043D, 0xFAFA, 0xFAEF, 0xFAD0, 0xFA9F, 0xFA5C, 0xFA0A, 0xF9AB, 0xF93F, 0xF8C8, 0xF849, 0xF7C3,
0xF736, 0xF6A6, 0xF613, 0xF580, 0xF4ED, 0xF45D, 0xF3D1, 0xF34A, 0xF2CB, 0xF254, 0xF1E8, 0xF189, 0xF137, 0xF0F4,
0xF0C3, 0xF0A4, 0x67B2, 0x67B1, 0x67AE, 0x67A8, 0x67A1, 0x6799, 0x678F, 0x6784, 0x6777, 0x676A, 0x675C, 0x674E,
0x673F, 0x672F, 0x6720, 0x6711, 0x6702, 0x66F3, 0x66E5, 0x66D8, 0x66CC, 0x66C0, 0x66B6, 0x66AE, 0x66A7, 0x66A2,
0x669F, 0x9AED, 0x9A9D, 0x99B6, 0x9843, 0x9652, 0x93ED, 0x9121, 0x8DFA, 0x8A85, 0x86CD, 0x82DE, 0x7EC5, 0x7A8E,
0x7644, 0x71F5, 0x6DAB, 0x6974, 0x655B, 0x616C, 0x5DB4, 0x5A3F, 0x5718, 0x544C, 0x51E7, 0x4FF5, 0x4E83, 0x4D9C,
0x6224, 0x6224, 0x6224, 0x6223, 0x6223, 0x6222, 0x6221, 0x6220, 0x621E, 0x621D, 0x621C, 0x621A, 0x6219, 0x6217,
0x6216, 0x6214, 0x6213, 0x6211, 0x6210, 0x620F, 0x620D, 0x620C, 0x620B, 0x620B, 0x620A, 0x6209, 0x6209, 0x3503,
0x351B, 0x355E, 0x35CB, 0x365E, 0x3712, 0x37E4, 0x38D1, 0x39D5, 0x3AEC, 0x3C14, 0x3D48, 0x3E85, 0x3FC7, 0x410C,
0x424E, 0x438B, 0x44BF, 0x45E7, 0x46FE, 0x4802, 0x48EF, 0x49C1, 0x4A75, 0x4B08, 0x4B74, 0x4BB8, 0x0178, 0x0168,
0x013B, 0x00F2, 0x0090, 0x0018, 0xFF8B, 0xFEED, 0xFE3F, 0xFD84, 0xFCBF, 0xFBF1, 0xFB1D, 0xFA45, 0xF96D, 0xF895,
0xF7C1, 0xF6F3, 0xF62E, 0xF573, 0xF4C5, 0xF427, 0xF39A, 0xF322, 0xF2C0, 0xF277, 0xF24A, 0xE5AD, 0xE5C9, 0xE61B,
0xE69F, 0xE750, 0xE82A, 0xE928, 0xEA46, 0xEB81, 0xECD3, 0xEE39, 0xEFAE, 0xF12D, 0xF2B3, 0xF43B, 0xF5C1, 0xF740,
0xF8B5, 0xFA1A, 0xFB6D, 0xFCA7, 0xFDC6, 0xFEC4, 0xFF9E, 0x004F, 0x00D2, 0x0124, 0xEF16, 0xEF1C, 0xEF2E, 0xEF49,
0xEF6F, 0xEF9D, 0xEFD3, 0xF010, 0xF053, 0xF09B, 0xF0E7, 0xF136, 0xF187, 0xF1DA, 0xF22D, 0xF280, 0xF2D1, 0xF320,
0xF36C, 0xF3B4, 0xF3F7, 0xF434, 0xF46A, 0xF498, 0xF4BD, 0xF4D9, 0xF4EB, 0xFCCC, 0xFCCB, 0xFCC6, 0xFCBF, 0xFCB6,
0xFCAB, 0xFC9D, 0xFC8E, 0xFC7E, 0xFC6C, 0xFC59, 0xFC45, 0xFC31, 0xFC1D, 0xFC08, 0xFBF3, 0xFBDF, 0xFBCC, 0xFBB9,
0xFBA7, 0xFB96, 0xFB87, 0xFB7A, 0xFB6E, 0xFB65, 0xFB5E, 0xFB5A, 0x0527, 0x0531, 0x054D, 0x057A, 0x05B7, 0x0601,
0x0658, 0x06BA, 0x0726, 0x079A, 0x0814, 0x0893, 0x0917, 0x099C, 0x0A22, 0x0AA8, 0x0B2B, 0x0BAA, 0x0C25, 0x0C99,
0x0D04, 0x0D66, 0x0DBD, 0x0E08, 0x0E44, 0x0E71, 0x0E8D, 0x61B4, 0x61B1, 0x61A9, 0x619C, 0x618A, 0x6174, 0x615A,
0x613D, 0x611E, 0x60FC, 0x60D8, 0x60B2, 0x608C, 0x6064, 0x603D, 0x6016, 0x5FEF, 0x5FC9, 0x5FA5, 0x5F83, 0x5F64,
0x5F47, 0x5F2D, 0x5F17, 0x5F06, 0x5EF8, 0x5EF0, 0x68D8, 0x68F1, 0x693A, 0x69B0, 0x6A4E, 0x6B11, 0x6BF5, 0x6CF5,
0x6E0E, 0x6F3D, 0x707D, 0x71CA, 0x7321, 0x747E, 0x75DD, 0x773A, 0x7891, 0x79DE, 0x7B1E, 0x7C4D, 0x7D66, 0x7E66,
0x7F4A, 0x800D, 0x80AB, 0x8121, 0x816A, 0xA0A4, 0xA098, 0xA076, 0xA03E, 0x9FF3, 0x9F97, 0x9F2C, 0x9EB3, 0x9E2E,
0x9D9F, 0x9D08, 0x9C6B, 0x9BC9, 0x9B24, 0x9A7F, 0x99DA, 0x9938, 0x989B, 0x9804, 0x9775, 0x96F0, 0x9677, 0x960B,
0x95B0, 0x9565, 0x952D, 0x950B, 0x3DDA, 0x3DE6, 0x3E0A, 0x3E43, 0x3E90, 0x3EEE, 0x3F5C, 0x3FD9, 0x4061, 0x40F4,
0x418F, 0x4230, 0x42D7, 0x4380, 0x442A, 0x44D3, 0x4579, 0x461B, 0x46B6, 0x4748, 0x47D1, 0x484D, 0x48BB, 0x491A,
0x4966, 0x49A0, 0x49C3, 0x33A6, 0x336E, 0x32CB, 0x31C6, 0x3068, 0x2EB9, 0x2CC2, 0x2A8A, 0x281C, 0x257E, 0x22BA,
0x1FD8, 0x1CE1, 0x19DD, 0x16D5, 0x13D1, 0x10DA, 0x0DF8, 0x0B34, 0x0896, 0x0628, 0x03F0, 0x01F9, 0x004A, 0xFEEC,
0xFDE7, 0xFD44, 0x3550, 0x3511, 0x345B, 0x3337, 0x31AF, 0x2FCD, 0x2D99, 0x2B1E, 0x2865, 0x2578, 0x2260, 0x1F26,
0x1BD4, 0x1874, 0x1510, 0x11B0, 0x0E5E, 0x0B25, 0x080C, 0x051F, 0x0266, 0xFFEB, 0xFDB7, 0xFBD5, 0xFA4D, 0xF92A,
0xF874, 0x07D2, 0x07C6, 0x07A4, 0x076E, 0x0725, 0x06CB, 0x0663, 0x05EC, 0x056B, 0x04DF, 0x044C, 0x03B2, 0x0314,
0x0274, 0x01D2, 0x0131, 0x0093, 0xFFFA, 0xFF66, 0xFEDB, 0xFE59, 0xFDE3, 0xFD7A, 0xFD21, 0xFCD8, 0xFCA1, 0xFC80,
0xFED7, 0xFF8F, 0x017C, 0x0445, 0x0792, 0x0B0B, 0x0E58, 0x1121, 0x130E, 0x13C6, 0x1353, 0x1218, 0x103B, 0x0DE8,
0x0B46, 0x087F, 0x05BC, 0x0325, 0x00E5, 0xFF23, 0xFDD2, 0xFCC7, 0xFBF9, 0xFB61, 0xFAF7, 0xFAB5, 0xFA92, 0xFF98,
0xFF83, 0xFF4B, 0xFEFB, 0xFEA0, 0xFE45, 0xFDF6, 0xFDBE, 0xFDA8, 0xFDB0, 0xFDC7, 0xFDEA, 0xFE19, 0xFE51, 0xFE91,
0xFED8, 0xFF22, 0xFF6F, 0xFFBD, 0x000A, 0x0054, 0x009A, 0x00DB, 0x0113, 0x0142, 0x0165, 0x017C, 0xF88E, 0xF8F1,
0xF9F7, 0xFB69, 0xFD12, 0xFEBA, 0x002C, 0x0132, 0x0196, 0x01A3, 0x01CA, 0x0206, 0x0256, 0x02B7, 0x0324, 0x039C,
0x041B, 0x049F, 0x0524, 0x05A8, 0x0627, 0x069F, 0x070C, 0x076D, 0x07BD, 0x07F9, 0x0820, 0x0000,
};
static JointIndex sChildZeldaAnim_0125E4JointIndices[18] = {
{ 0x0003, 0x001E, 0x0039 },
{ 0x0002, 0x0054, 0x0002 },
{ 0x006F, 0x008A, 0x00A5 },
{ 0x00C0, 0x00DB, 0x00F6 },
{ 0x0002, 0x0002, 0x0111 },
{ 0x012C, 0x0147, 0x0162 },
{ 0x0002, 0x0002, 0x017D },
{ 0x0198, 0x01B3, 0x01CE },
{ 0x01E9, 0x0204, 0x021F },
{ 0x023A, 0x0255, 0x0270 },
{ 0x028B, 0x02A6, 0x02C1 },
{ 0x02DC, 0x02F7, 0x0312 },
{ 0x032D, 0x0348, 0x0363 },
{ 0x037E, 0x0399, 0x03B4 },
{ 0x03CF, 0x03EA, 0x0405 },
{ 0x0420, 0x043B, 0x0456 },
{ 0x0471, 0x048C, 0x04A7 },
{ 0x04C2, 0x04DD, 0x04F8 },
};
AnimationHeader gChildZeldaAnim_0125E4 = { { 27 }, sChildZeldaAnim_0125E4FrameData, sChildZeldaAnim_0125E4JointIndices, 3 };
static u8 unaccounted_0125F4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_012E58FrameData[1014] = {
0x086F, 0x09AE, 0x0000, 0xC5A4, 0xF5D8, 0x4209, 0x09AE, 0x09AD, 0x09AC, 0x09A9, 0x09A6, 0x09A2, 0x099E, 0x099B,
0x0997, 0x0994, 0x0991, 0x0990, 0x098F, 0x0990, 0x0991, 0x0994, 0x0997, 0x099B, 0x099E, 0x09A2, 0x09A6, 0x09A9,
0x09AC, 0x09AD, 0xFEB8, 0xFEBA, 0xFEBF, 0xFEC8, 0xFED2, 0xFEDF, 0xFEEB, 0xFEF8, 0xFF04, 0xFF0F, 0xFF17, 0xFF1D,
0xFF1F, 0xFF1D, 0xFF17, 0xFF0F, 0xFF04, 0xFEF8, 0xFEEB, 0xFEDF, 0xFED2, 0xFEC8, 0xFEBF, 0xFEBA, 0xBEFB, 0xBEFC,
0xBEFC, 0xBEFE, 0xBEFF, 0xBF01, 0xBF03, 0xBF04, 0xBF06, 0xBF08, 0xBF09, 0xBF09, 0xBF0A, 0xBF09, 0xBF09, 0xBF08,
0xBF06, 0xBF04, 0xBF03, 0xBF01, 0xBEFF, 0xBEFE, 0xBEFC, 0xBEFC, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0055,
0x0056, 0x0058, 0x005A, 0x005B, 0x005C, 0x005D, 0x005D, 0x005D, 0x005C, 0x005B, 0x005A, 0x0058, 0x0056, 0x0055,
0x0053, 0x0052, 0x0051, 0x0050, 0xFF0E, 0xFF0E, 0xFF0E, 0xFF0F, 0xFF0F, 0xFF10, 0xFF10, 0xFF11, 0xFF11, 0xFF12,
0xFF12, 0xFF12, 0xFF12, 0xFF12, 0xFF12, 0xFF12, 0xFF11, 0xFF11, 0xFF10, 0xFF10, 0xFF0F, 0xFF0F, 0xFF0E, 0xFF0E,
0xF37E, 0xF36F, 0xF345, 0xF308, 0xF2BB, 0xF266, 0xF20D, 0xF1B5, 0xF164, 0xF11D, 0xF0E5, 0xF0C0, 0xF0B2, 0xF0C0,
0xF0E5, 0xF11D, 0xF164, 0xF1B5, 0xF20D, 0xF266, 0xF2BB, 0xF308, 0xF345, 0xF36F, 0x16F7, 0x170D, 0x1749, 0x17A2,
0x1810, 0x188B, 0x190A, 0x1987, 0x19FB, 0x1A60, 0x1AAF, 0x1AE3, 0x1AF6, 0x1AE3, 0x1AAF, 0x1A60, 0x19FB, 0x1987,
0x190A, 0x188B, 0x1810, 0x17A2, 0x1749, 0x170D, 0x0050, 0x0050, 0x0051, 0x0052, 0x0054, 0x0056, 0x0058, 0x005A,
0x005C, 0x005D, 0x005F, 0x005F, 0x0060, 0x005F, 0x005F, 0x005D, 0x005C, 0x005A, 0x0058, 0x0056, 0x0054, 0x0052,
0x0051, 0x0050, 0xFEF5, 0xFEF5, 0xFEF5, 0xFEF6, 0xFEF6, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF8, 0xFEF9, 0xFEF9, 0xFEF9,
0xFEF9, 0xFEF9, 0xFEF9, 0xFEF9, 0xFEF8, 0xFEF8, 0xFEF7, 0xFEF6, 0xFEF6, 0xFEF6, 0xFEF5, 0xFEF5, 0xF333, 0xF323,
0xF2F7, 0xF2B5, 0xF263, 0xF208, 0xF1AA, 0xF14D, 0xF0F7, 0xF0AC, 0xF070, 0xF04A, 0xF03C, 0xF04A, 0xF070, 0xF0AC,
0xF0F7, 0xF14D, 0xF1AA, 0xF208, 0xF263, 0xF2B5, 0xF2F7, 0xF323, 0x14FB, 0x1512, 0x1553, 0x15B4, 0x162A, 0x16AE,
0x1736, 0x17BC, 0x1837, 0x18A2, 0x18F6, 0x192D, 0x1940, 0x192D, 0x18F6, 0x18A2, 0x1837, 0x17BC, 0x1736, 0x16AE,
0x162A, 0x15B4, 0x1553, 0x1512, 0xFBCA, 0xFBCC, 0xFBD3, 0xFBDC, 0xFBE8, 0xFBF6, 0xFC05, 0xFC13, 0xFC21, 0xFC2D,
0xFC37, 0xFC3D, 0xFC3F, 0xFC3D, 0xFC37, 0xFC2D, 0xFC21, 0xFC13, 0xFC05, 0xFBF6, 0xFBE8, 0xFBDC, 0xFBD3, 0xFBCC,
0xFD26, 0xFD24, 0xFD21, 0xFD1B, 0xFD14, 0xFD0C, 0xFD04, 0xFCFB, 0xFCF3, 0xFCED, 0xFCE7, 0xFCE3, 0xFCE2, 0xFCE3,
0xFCE7, 0xFCED, 0xFCF3, 0xFCFB, 0xFD04, 0xFD0C, 0xFD14, 0xFD1B, 0xFD21, 0xFD24, 0xFCB6, 0xFC98, 0xFC43, 0xFBC4,
0xFB24, 0xFA6F, 0xF9B0, 0xF8F0, 0xF83B, 0xF79B, 0xF71C, 0xF6C8, 0xF6A9, 0xF6C8, 0xF71C, 0xF79B, 0xF83B, 0xF8F0,
0xF9B0, 0xFA6F, 0xFB24, 0xFBC4, 0xFC43, 0xFC98, 0x0000, 0xFFB0, 0xFF80, 0xFF6D, 0xFF71, 0xFF87, 0xFFAA, 0xFFD5,
0x0004, 0x0031, 0x0057, 0x0071, 0x007B, 0x0079, 0x0072, 0x0068, 0x005B, 0x004D, 0x003E, 0x002E, 0x0020, 0x0013,
0x0009, 0x0002, 0x01CB, 0x01CA, 0x01C9, 0x01C8, 0x01C6, 0x01C4, 0x01C2, 0x01C0, 0x01BE, 0x01BD, 0x01BB, 0x01BA,
0x01BA, 0x01BA, 0x01BB, 0x01BD, 0x01BE, 0x01C0, 0x01C2, 0x01C5, 0x01C7, 0x01C8, 0x01CA, 0x01CB, 0x020A, 0x0263,
0x0314, 0x0409, 0x0532, 0x067A, 0x07D2, 0x0926, 0x0A65, 0x0B7C, 0x0C5A, 0x0CEC, 0x0D21, 0x0CE9, 0x0C4F, 0x0B65,
0x0A41, 0x08F5, 0x0795, 0x0636, 0x04EA, 0x03C5, 0x02DC, 0x0241, 0x0000, 0x0001, 0x0003, 0x0005, 0x0009, 0x000D,
0x0012, 0x0016, 0x001A, 0x001E, 0x0021, 0x0022, 0x0023, 0x0022, 0x0021, 0x001E, 0x001A, 0x0016, 0x0012, 0x000D,
0x0009, 0x0005, 0x0003, 0x0001, 0x0000, 0xFFFF, 0xFFFD, 0xFFFA, 0xFFF6, 0xFFF1, 0xFFEC, 0xFFE7, 0xFFE3, 0xFFDF,
0xFFDB, 0xFFD9, 0xFFD9, 0xFFD9, 0xFFDB, 0xFFDF, 0xFFE3, 0xFFE7, 0xFFEC, 0xFFF1, 0xFFF6, 0xFFFA, 0xFFFD, 0xFFFF,
0x02B0, 0x0296, 0x024C, 0x01DD, 0x0151, 0x00B2, 0x000B, 0xFF63, 0xFEC4, 0xFE39, 0xFDC9, 0xFD7F, 0xFD65, 0xFD7F,
0xFDC9, 0xFE39, 0xFEC4, 0xFF63, 0x000B, 0x00B2, 0x0151, 0x01DD, 0x024C, 0x0296, 0x403C, 0x4048, 0x4069, 0x409A,
0x40D9, 0x411F, 0x416A, 0x41B5, 0x41FC, 0x423A, 0x426C, 0x428D, 0x4299, 0x428D, 0x426C, 0x423A, 0x41FC, 0x41B5,
0x416A, 0x411F, 0x40D9, 0x409A, 0x4069, 0x4048, 0x043D, 0x043D, 0x043E, 0x043E, 0x0440, 0x0441, 0x0442, 0x0443,
0x0445, 0x0446, 0x0447, 0x0447, 0x0448, 0x0447, 0x0447, 0x0446, 0x0445, 0x0443, 0x0442, 0x0441, 0x0440, 0x043E,
0x043E, 0x043D, 0xF099, 0xF094, 0xF087, 0xF072, 0xF059, 0xF03C, 0xF01D, 0xEFFE, 0xEFE1, 0xEFC7, 0xEFB3, 0xEFA5,
0xEFA0, 0xEFA5, 0xEFB3, 0xEFC7, 0xEFE1, 0xEFFE, 0xF01D, 0xF03C, 0xF059, 0xF072, 0xF087, 0xF094, 0x669E, 0x669D,
0x669B, 0x6699, 0x6696, 0x6693, 0x668F, 0x668C, 0x6689, 0x6686, 0x6683, 0x6682, 0x6681, 0x6682, 0x6683, 0x6686,
0x6689, 0x668C, 0x668F, 0x6693, 0x6696, 0x6699, 0x669B, 0x669D, 0x4D4C, 0x4D4F, 0x4D59, 0x4D68, 0x4D7B, 0x4D90,
0x4DA7, 0x4DBD, 0x4DD3, 0x4DE5, 0x4DF4, 0x4DFE, 0x4E02, 0x4DFE, 0x4DF4, 0x4DE5, 0x4DD3, 0x4DBD, 0x4DA7, 0x4D90,
0x4D7B, 0x4D68, 0x4D59, 0x4D4F, 0x6209, 0x6209, 0x6209, 0x6209, 0x6209, 0x6208, 0x6208, 0x6208, 0x6208, 0x6208,
0x6208, 0x6207, 0x6207, 0x6207, 0x6208, 0x6208, 0x6208, 0x6208, 0x6208, 0x6208, 0x6209, 0x6209, 0x6209, 0x6209,
0x4BD0, 0x4BD3, 0x4BDD, 0x4BED, 0x4C00, 0x4C15, 0x4C2C, 0x4C43, 0x4C59, 0x4C6C, 0x4C7B, 0x4C85, 0x4C89, 0x4C85,
0x4C7B, 0x4C6C, 0x4C59, 0x4C43, 0x4C2C, 0x4C15, 0x4C00, 0x4BED, 0x4BDD, 0x4BD3, 0xF23A, 0xF223, 0xF1E3, 0xF182,
0xF106, 0xF078, 0xEFDF, 0xEF42, 0xEEA9, 0xEE1B, 0xEDA0, 0xED3E, 0xECFE, 0xECE7, 0xED07, 0xED5E, 0xEDE0, 0xEE81,
0xEF34, 0xEFED, 0xF0A1, 0xF141, 0xF1C3, 0xF21A, 0x0141, 0x0162, 0x01BD, 0x0249, 0x02FB, 0x03C7, 0x04A3, 0x0584,
0x0660, 0x072C, 0x07DE, 0x0869, 0x08C5, 0x08E6, 0x08B9, 0x083C, 0x0781, 0x069A, 0x0599, 0x048E, 0x038D, 0x02A6,
0x01EB, 0x016E, 0xF4F1, 0xF4F9, 0xF50E, 0xF52F, 0xF559, 0xF589, 0xF5BD, 0xF5F2, 0xF626, 0xF657, 0xF680, 0xF6A1,
0xF6B7, 0xF6BF, 0xF6B4, 0xF697, 0xF66B, 0xF634, 0xF5F7, 0xF5B8, 0xF57C, 0xF545, 0xF519, 0xF4FC, 0xFB58, 0xFAD2,
0xF9AA, 0xF883, 0xF7FC, 0xF7DD, 0xF797, 0xF752, 0xF732, 0xF7DD, 0xF954, 0xFACB, 0xFB75, 0xFABC, 0xF923, 0xF78A,
0xF6D0, 0xF66D, 0xF594, 0xF4BA, 0xF457, 0xF56F, 0xF7D8, 0xFA40, 0x0E97, 0x0E32, 0x0D53, 0x0C74, 0x0C0E, 0x0C0E,
0x0C0C, 0x0C0B, 0x0C0A, 0x0BF8, 0x0BD1, 0x0BAA, 0x0B98, 0x0B46, 0x0A92, 0x09DE, 0x098C, 0x0A34, 0x0BA7, 0x0D19,
0x0DC1, 0x0DE3, 0x0E2C, 0x0E76, 0x5EED, 0x5F00, 0x5F29, 0x5F51, 0x5F64, 0x5F4B, 0x5F14, 0x5EDD, 0x5EC4, 0x5ED9,
0x5F06, 0x5F34, 0x5F49, 0x5F62, 0x5F99, 0x5FD1, 0x5FEA, 0x5FCA, 0x5F84, 0x5F3D, 0x5F1D, 0x5F16, 0x5F05, 0x5EF5,
0x8183, 0x8171, 0x8148, 0x811F, 0x810D, 0x819B, 0x82D3, 0x840C, 0x849A, 0x8453, 0x83B8, 0x831E, 0x82D7, 0x8354,
0x8467, 0x8579, 0x85F6, 0x8535, 0x838C, 0x81E4, 0x8123, 0x8132, 0x8153, 0x8174, 0x94FF, 0x94DC, 0x9491, 0x9445,
0x9423, 0x95C6, 0x9961, 0x9CFC, 0x9EA0, 0x9E0F, 0x9CD0, 0x9B91, 0x9B00, 0x9A96, 0x99AE, 0x98C5, 0x985C, 0x9774,
0x9576, 0x9377, 0x9290, 0x92F1, 0x93C7, 0x949D, 0x49CF, 0x49B4, 0x4978, 0x493B, 0x4920, 0x4789, 0x440A, 0x408B,
0x3EF5, 0x403D, 0x4311, 0x45E4, 0x472C, 0x4659, 0x4488, 0x42B7, 0x41E4, 0x42B4, 0x447E, 0x4647, 0x4717, 0x4784,
0x4873, 0x4963, 0xFD0C, 0xFD60, 0xFE19, 0xFED2, 0xFF26, 0xFED2, 0xFE19, 0xFD60, 0xFD0C, 0xFD60, 0xFE19, 0xFED2,
0xFF26, 0xFED2, 0xFE19, 0xFD60, 0xFD0C, 0xFD60, 0xFE19, 0xFED2, 0xFF26, 0xFED2, 0xFE19, 0xFD60, 0xF835, 0xF6AC,
0xF34C, 0xEFED, 0xEE64, 0xEFED, 0xF34C, 0xF6AC, 0xF835, 0xF6AC, 0xF34C, 0xEFED, 0xEE64, 0xEFED, 0xF34C, 0xF6AC,
0xF835, 0xF6AC, 0xF34C, 0xEFED, 0xEE64, 0xEFED, 0xF34C, 0xF6AC, 0xFC74, 0xFA0A, 0xF4BC, 0xEF6D, 0xED03, 0xEF6D,
0xF4BC, 0xFA0A, 0xFC74, 0xFA0A, 0xF4BC, 0xEF6D, 0xED03, 0xEF6D, 0xF4BC, 0xFA0A, 0xFC74, 0xFA0A, 0xF4BC, 0xEF6D,
0xED03, 0xEF6D, 0xF4BC, 0xFA0A, 0xFA88, 0xFAC0, 0xFB5B, 0xFC45, 0xFD6B, 0xFEB8, 0x0018, 0x0179, 0x02C6, 0x03EB,
0x04D5, 0x0570, 0x05A8, 0x0570, 0x04D5, 0x03EB, 0x02C6, 0x0179, 0x0018, 0xFEB8, 0xFD6B, 0xFC45, 0xFB5B, 0xFAC0,
0x0184, 0x0182, 0x017C, 0x0173, 0x0168, 0x015C, 0x014F, 0x0142, 0x0136, 0x012B, 0x0123, 0x011D, 0x011B, 0x011D,
0x0123, 0x012B, 0x0136, 0x0142, 0x014F, 0x015C, 0x0168, 0x0173, 0x017C, 0x0182, 0x082E, 0x0837, 0x0850, 0x0877,
0x08A7, 0x08DE, 0x0918, 0x0953, 0x098A, 0x09BA, 0x09E1, 0x09FA, 0x0A03, 0x09FA, 0x09E1, 0x09BA, 0x098A, 0x0953,
0x0918, 0x08DE, 0x08A7, 0x0877, 0x0850, 0x0837,
};
static JointIndex sChildZeldaAnim_012E58JointIndices[18] = {
{ 0x0000, 0x0006, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x001E, 0x0036 },
{ 0x004E, 0x0066, 0x007E },
{ 0x0002, 0x0002, 0x0096 },
{ 0x00AE, 0x00C6, 0x00DE },
{ 0x0002, 0x0002, 0x00F6 },
{ 0x010E, 0x0126, 0x013E },
{ 0x0156, 0x016E, 0x0186 },
{ 0x019E, 0x01B6, 0x01CE },
{ 0x01E6, 0x0004, 0x0005 },
{ 0x01FE, 0x0216, 0x022E },
{ 0x0246, 0x025E, 0x0276 },
{ 0x028E, 0x02A6, 0x02BE },
{ 0x02D6, 0x02EE, 0x0306 },
{ 0x031E, 0x0336, 0x034E },
{ 0x0366, 0x037E, 0x0396 },
{ 0x03AE, 0x03C6, 0x03DE },
};
AnimationHeader gChildZeldaAnim_012E58 = { { 24 }, sChildZeldaAnim_012E58FrameData, sChildZeldaAnim_012E58JointIndices, 6 };
static u8 unaccounted_012E68[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_013280FrameData[466] = {
0x0001, 0x09DD, 0x0000, 0xBF0F, 0xC000, 0x4000, 0x09DD, 0x09DD, 0x09DE, 0x09DE, 0x09DE, 0x09DF, 0x09DF, 0x09E0,
0x09E0, 0x09E1, 0x09E1, 0x09E1, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E1, 0x09E1, 0x09E0, 0x09E0, 0x0000, 0x0000,
0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0001, 0x0001, 0xF71B, 0xF723, 0xF72F, 0xF73E, 0xF74E, 0xF760, 0xF773, 0xF786, 0xF799, 0xF7AB,
0xF7BB, 0xF7C8, 0xF7D2, 0xF7D9, 0xF7DA, 0xF7D6, 0xF7CC, 0xF7BC, 0xF7A4, 0xF785, 0x0C15, 0x0C06, 0x0BF1, 0x0BD8,
0x0BBB, 0x0B9B, 0x0B79, 0x0B57, 0x0B36, 0x0B17, 0x0AFA, 0x0AE2, 0x0AD0, 0x0AC5, 0x0AC2, 0x0AC9, 0x0ADB, 0x0AF8,
0x0B22, 0x0B5A, 0xF73B, 0xF744, 0xF74F, 0xF75E, 0xF76E, 0xF780, 0xF792, 0xF7A5, 0xF7B8, 0xF7C9, 0xF7D9, 0xF7E6,
0xF7F1, 0xF7F7, 0xF7F8, 0xF7F4, 0xF7EB, 0xF7DA, 0xF7C3, 0xF7A4, 0x0C38, 0x0C29, 0x0C14, 0x0BFB, 0x0BDE, 0x0BBF,
0x0B9E, 0x0B7C, 0x0B5B, 0x0B3C, 0x0B20, 0x0B09, 0x0AF7, 0x0AEC, 0x0AE9, 0x0AF0, 0x0B01, 0x0B1E, 0x0B48, 0x0B7F,
0xEAD2, 0xEB44, 0xEBF6, 0xECE3, 0xEE00, 0xEF46, 0xF0AD, 0xF22D, 0xF3BD, 0xF555, 0xF6EE, 0xF87E, 0xF9FD, 0xFB64,
0xFCAB, 0xFDC8, 0xFEB4, 0xFF67, 0xFFD8, 0x0000, 0x20AD, 0x1E17, 0x1DA1, 0x1966, 0x16E2, 0x13C2, 0x0F9C, 0x0D52,
0x132A, 0x1693, 0x1C3E, 0x1FE2, 0x21F1, 0x234E, 0x2490, 0x25F5, 0x2775, 0x28DB, 0x29E1, 0x2A42, 0xFAA5, 0xFAF7,
0xF997, 0xFA49, 0xFA09, 0xFA61, 0xFB97, 0xFC0C, 0xF934, 0xF879, 0xF76B, 0xF6E1, 0xF6BD, 0xF712, 0xF7E4, 0xF91A,
0xFA7F, 0xFBD2, 0xFCCD, 0xFD2D, 0x52BF, 0x53CB, 0x5370, 0x54C7, 0x5507, 0x5549, 0x558A, 0x552B, 0x536C, 0x5290,
0x527D, 0x5484, 0x57F0, 0x5C09, 0x6048, 0x644C, 0x67CD, 0x6A92, 0x6C63, 0x6D0B, 0xBE54, 0xBF44, 0xC0E0, 0xC337,
0xC64A, 0xCA0B, 0xCE53, 0xD2E4, 0xD75F, 0xDB41, 0xDCBD, 0xDAF3, 0xD73F, 0xD2FC, 0xCF12, 0xCC02, 0xC9F5, 0xC8D2,
0xC852, 0xC82A, 0x1310, 0x12AA, 0x1209, 0x1134, 0x1033, 0x0F0E, 0x0DCA, 0x0C71, 0x0B09, 0x099A, 0x082A, 0x06C2,
0x0569, 0x0426, 0x0300, 0x01FF, 0x012B, 0x008A, 0x0024, 0x0000, 0xE8B4, 0xE931, 0xE9F5, 0xEAF9, 0xEC33, 0xED9A,
0xEF25, 0xF0CB, 0xF283, 0xF444, 0xF605, 0xF7BD, 0xF963, 0xFAEE, 0xFC55, 0xFD8F, 0xFE93, 0xFF58, 0xFFD4, 0x0000,
0xD2D2, 0xD3C3, 0xD541, 0xD739, 0xD99A, 0xDC52, 0xDF50, 0xE282, 0xE5D8, 0xE93F, 0xECA5, 0xEFFB, 0xF32D, 0xF62B,
0xF8E4, 0xFB44, 0xFD3C, 0xFEBA, 0xFFAC, 0x0000, 0xDCF5, 0xDD90, 0xDE4E, 0xDF1C, 0xDFE9, 0xE0A8, 0xE151, 0xE1DF,
0xE24E, 0xE29E, 0xE2D2, 0xE2ED, 0xE2F2, 0xE2E8, 0xE2D2, 0xE2B6, 0xE29A, 0xE27F, 0xE26C, 0xE261, 0x0610, 0x05C3,
0x0561, 0x04F4, 0x0481, 0x040E, 0x03A0, 0x033C, 0x02E5, 0x029C, 0x0261, 0x0235, 0x0216, 0x0203, 0x01F8, 0x01F5,
0x01F6, 0x01FA, 0x0200, 0x0205, 0x51BD, 0x528E, 0x53B3, 0x5517, 0x56A3, 0x5847, 0x59F0, 0x5B90, 0x5D1C, 0x5E8A,
0x5FD2, 0x60EF, 0x61DF, 0x62A1, 0x6337, 0x63A4, 0x63ED, 0x6418, 0x6429, 0x6424, 0xBDD3, 0xBD8A, 0xBD16, 0xBC7F,
0xBBCA, 0xBAFD, 0xBA1E, 0xB933, 0xB842, 0xB750, 0xB662, 0xB57D, 0xB4A7, 0xB3E4, 0xB337, 0xB2A3, 0xB22C, 0xB1D4,
0xB19D, 0xB188, 0xF400, 0xF440, 0xF4A5, 0xF52B, 0xF5CD, 0xF686, 0xF751, 0xF82B, 0xF90D, 0xF9F5, 0xFADC, 0xFBBF,
0xFC98, 0xFD64, 0xFE1C, 0xFEBE, 0xFF44, 0xFFA9, 0xFFEA, 0x0000, 0x1A79, 0x19EC, 0x190C, 0x17E5, 0x1680, 0x14E8,
0x1327, 0x1148, 0x0F54, 0x0D55, 0x0B57, 0x0963, 0x0783, 0x05C3, 0x042B, 0x02C6, 0x019F, 0x00BF, 0x0031, 0x0000,
0xD2D2, 0xD3C3, 0xD541, 0xD739, 0xD99A, 0xDC52, 0xDF50, 0xE282, 0xE5D8, 0xE93F, 0xECA5, 0xEFFB, 0xF32D, 0xF62B,
0xF8E4, 0xFB44, 0xFD3C, 0xFEBA, 0xFFAC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFE88, 0xFB06, 0xF6D5, 0xF34C, 0xF1C7, 0xEAE5, 0xEB8B,
0xEC8A, 0xEDD3, 0xEF55, 0xF101, 0xF2C5, 0xF491, 0xF655, 0xF800, 0xF982, 0xFACB, 0xFBCB, 0xFC70, 0xFCAB, 0xFD03,
0xFDD7, 0xFED4, 0xFFA7, 0x0000,
};
static JointIndex sChildZeldaAnim_013280JointIndices[18] = {
{ 0x0000, 0x0006, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x001A, 0x0004 },
{ 0x0002, 0x0002, 0x002E },
{ 0x0002, 0x0002, 0x0042 },
{ 0x0002, 0x0002, 0x0056 },
{ 0x0002, 0x0002, 0x006A },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0005, 0x007E, 0x0005 },
{ 0x0092, 0x00A6, 0x00BA },
{ 0x0002, 0x0002, 0x00CE },
{ 0x00E2, 0x00F6, 0x010A },
{ 0x011E, 0x0132, 0x0146 },
{ 0x0002, 0x0002, 0x015A },
{ 0x016E, 0x0182, 0x0196 },
{ 0x0002, 0x01AA, 0x01BE },
};
AnimationHeader gChildZeldaAnim_013280 = { { 20 }, sChildZeldaAnim_013280FrameData, sChildZeldaAnim_013280JointIndices, 6 };
static s16 sChildZeldaAnim_013628FrameData[406] = {
0x0001, 0x09DE, 0x0000, 0xC000, 0x4000, 0x09DE, 0x09DC, 0x09D9, 0x09D5, 0x09D1, 0x09CD, 0x09C9, 0x09C7, 0x09C5,
0x09C4, 0x09C5, 0x09C7, 0x09C9, 0x09CD, 0x09D1, 0x09D5, 0x09D9, 0x09DC, 0x09DE, 0x09E0, 0x0000, 0x0000, 0x0000,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000,
0x0000, 0x0000, 0x0000, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0E,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0x0000, 0x0000, 0xFFFE, 0xFFFD, 0xFFFB,
0xFFFA, 0xFFF8, 0xFFF7, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF7, 0xFFF8, 0xFFFA, 0xFFFB, 0xFFFD, 0xFFFE, 0x0000, 0x0000,
0x0001, 0xF749, 0xF6E6, 0xF66D, 0xF5EB, 0xF569, 0xF4F2, 0xF48A, 0xF439, 0xF404, 0xF3F1, 0xF404, 0xF439, 0xF48A,
0xF4F1, 0xF569, 0xF5EA, 0xF66D, 0xF6E6, 0xF749, 0xF785, 0x0BC4, 0x0C72, 0x0D48, 0x0E2F, 0x0F13, 0x0FE6, 0x109C,
0x112B, 0x1188, 0x11AA, 0x1188, 0x112B, 0x109C, 0x0FE6, 0x0F12, 0x0E2E, 0x0D48, 0x0C72, 0x0BC3, 0x0B59, 0xF769,
0xF707, 0xF68F, 0xF60E, 0xF58E, 0xF517, 0xF4B1, 0xF460, 0xF42B, 0xF418, 0xF42B, 0xF460, 0xF4B1, 0xF517, 0xF58E,
0xF60E, 0xF690, 0xF708, 0xF769, 0xF7A4, 0x0BE7, 0x0C94, 0x0D68, 0x0E4D, 0x0F2F, 0x1001, 0x10B6, 0x1144, 0x11A1,
0x11C2, 0x11A1, 0x1144, 0x10B6, 0x1001, 0x0F2F, 0x0E4D, 0x0D68, 0x0C94, 0x0BE8, 0x0B7F, 0x000A, 0x0026, 0x004F,
0x0080, 0x00B6, 0x00EC, 0x011D, 0x0146, 0x0162, 0x016C, 0x0161, 0x0144, 0x011A, 0x00E6, 0x00AE, 0x0077, 0x0045,
0x001E, 0x0005, 0x0000, 0x2A3C, 0x2A35, 0x2A2D, 0x2A26, 0x2A1E, 0x2A16, 0x2A10, 0x2A0A, 0x2A06, 0x2A04, 0x2A03,
0x2A05, 0x2A08, 0x2A0D, 0x2A12, 0x2A1A, 0x2A22, 0x2A2B, 0x2A36, 0x2A42, 0xFD2D, 0xFD2D, 0xFD2D, 0xFD2D, 0xFD2D,
0xFD2D, 0xFD2E, 0xFD2E, 0xFD2D, 0xFD2D, 0xFD2C, 0xFD2B, 0xFD2A, 0xFD2A, 0xFD29, 0xFD29, 0xFD2A, 0xFD2B, 0xFD2E,
0xFD31, 0x6D0A, 0x6D08, 0x6D05, 0x6D01, 0x6CFD, 0x6CF9, 0x6CF5, 0x6CF2, 0x6CEF, 0x6CEE, 0x6CEE, 0x6CEF, 0x6CF2,
0x6CF5, 0x6CF8, 0x6CFC, 0x6D00, 0x6D03, 0x6D07, 0x6D0B, 0xC81E, 0xC811, 0xC804, 0xC7F7, 0xC7EC, 0xC7E3, 0xC7DB,
0xC7D4, 0xC7D0, 0xC7CD, 0xC7CC, 0xC7CC, 0xC7CD, 0xC7D1, 0xC7D7, 0xC7E1, 0xC7EF, 0xC800, 0xC814, 0xC82D, 0xE25B,
0xE257, 0xE254, 0xE252, 0xE251, 0xE250, 0xE251, 0xE251, 0xE252, 0xE252, 0xE252, 0xE251, 0xE24F, 0xE24E, 0xE24D,
0xE24E, 0xE250, 0xE254, 0xE25A, 0xE262, 0x020B, 0x0213, 0x021D, 0x0228, 0x0232, 0x023C, 0x0244, 0x024B, 0x024F,
0x0251, 0x024F, 0x024C, 0x0246, 0x023E, 0x0235, 0x022B, 0x0221, 0x0217, 0x020F, 0x0208, 0x640D, 0x63EE, 0x63C9,
0x63A0, 0x6377, 0x634F, 0x632C, 0x6310, 0x62FE, 0x62F7, 0x62FD, 0x630F, 0x632A, 0x634B, 0x6371, 0x639A, 0x63C3,
0x63E9, 0x640B, 0x6425, 0xB18F, 0xB1A6, 0xB1C7, 0xB1F1, 0xB21F, 0xB24E, 0xB27A, 0xB29E, 0xB2B7, 0xB2C1, 0xB2B7,
0xB29C, 0xB275, 0xB247, 0xB216, 0xB1E6, 0xB1BC, 0xB19C, 0xB188, 0xB186, 0xFFEC, 0xFFB4, 0xFF63, 0xFF00, 0xFE94,
0xFE28, 0xFDC5, 0xFD74, 0xFD3C, 0xFD28, 0xFD3C, 0xFD74, 0xFDC5, 0xFE28, 0xFE94, 0xFF00, 0xFF63, 0xFFB4, 0xFFEC,
0x0000, 0xF1BA, 0xF1B2, 0xF1AF, 0xF1AF, 0xF1B2, 0xF1B7, 0xF1BD, 0xF1C2, 0xF1C6, 0xF1C7, 0xF1C8, 0xF1CA, 0xF1CD,
0xF1D0, 0xF1D2, 0xF1D4, 0xF1D4, 0xF1D2, 0xF1CE, 0xF1C7, 0x000A, 0x0026, 0x004F, 0x0080, 0x00B6, 0x00EC, 0x011D,
0x0146, 0x0162, 0x016C, 0x0162, 0x0146, 0x011E, 0x00ED, 0x00B7, 0x0081, 0x0050, 0x0027, 0x000B, 0x0000, 0x0000,
};
static JointIndex sChildZeldaAnim_013628JointIndices[18] = {
{ 0x0000, 0x0005, 0x0019 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x002D, 0x0041, 0x0003 },
{ 0x0002, 0x0002, 0x0055 },
{ 0x0002, 0x0002, 0x0069 },
{ 0x0002, 0x0002, 0x007D },
{ 0x0002, 0x0002, 0x0091 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0004, 0x00A5, 0x0004 },
{ 0x00B9, 0x00CD, 0x00E1 },
{ 0x0002, 0x0002, 0x00F5 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0109, 0x011D, 0x0131 },
{ 0x0002, 0x0002, 0x0145 },
{ 0x0002, 0x0002, 0x0159 },
{ 0x0002, 0x016D, 0x0181 },
};
AnimationHeader gChildZeldaAnim_013628 = { { 20 }, sChildZeldaAnim_013628FrameData, sChildZeldaAnim_013628JointIndices, 5 };
static u8 unaccounted_013638[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_013A50FrameData[466] = {
0x0001, 0x09DD, 0x0000, 0xBF0F, 0xC000, 0x4000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x09DD, 0x09DD,
0x09DD, 0x09DD, 0x09DE, 0x09DE, 0x09DE, 0x09DE, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF,
0x09DF, 0x09DE, 0x09DE, 0x09DD, 0xF715, 0xF719, 0xF71F, 0xF726, 0xF72E, 0xF738, 0xF741, 0xF74B, 0xF753, 0xF75B,
0xF762, 0xF766, 0xF769, 0xF768, 0xF764, 0xF75D, 0xF751, 0xF741, 0xF72D, 0xF713, 0x0C18, 0x0C12, 0x0C08, 0x0BFB,
0x0BEC, 0x0BDC, 0x0BCB, 0x0BBA, 0x0BAB, 0x0B9D, 0x0B91, 0x0B89, 0x0B85, 0x0B87, 0x0B8D, 0x0B9B, 0x0BAF, 0x0BCB,
0x0BF0, 0x0C1D, 0xF73A, 0xF73E, 0xF744, 0xF74B, 0xF753, 0xF75C, 0xF766, 0xF76F, 0xF778, 0xF780, 0xF786, 0xF78B,
0xF78D, 0xF78D, 0xF789, 0xF782, 0xF776, 0xF767, 0xF752, 0xF739, 0x0C40, 0x0C39, 0x0C2F, 0x0C23, 0x0C14, 0x0C04,
0x0BF3, 0x0BE2, 0x0BD3, 0x0BC5, 0x0BB9, 0x0BB1, 0x0BAD, 0x0BAE, 0x0BB5, 0x0BC2, 0x0BD6, 0x0BF2, 0x0C16, 0x0C42,
0xEAD2, 0xEB44, 0xEBF6, 0xECE3, 0xEE00, 0xEF46, 0xF0AD, 0xF22D, 0xF3BD, 0xF555, 0xF6EE, 0xF87E, 0xF9FD, 0xFB64,
0xFCAB, 0xFDC8, 0xFEB4, 0xFF67, 0xFFD8, 0x0000, 0x1CE8, 0x1CA1, 0x1A0B, 0x1C53, 0x2731, 0x2C10, 0x2F33, 0x3190,
0x337F, 0x3527, 0x3698, 0x37DF, 0x38FE, 0x39FA, 0x3AD2, 0x3B86, 0x3C14, 0x3C7C, 0x3CBA, 0x3CC9, 0xFDB8, 0xFE44,
0x00A6, 0xFFD6, 0xFA86, 0xF97D, 0xF980, 0xF9F7, 0xFAAF, 0xFB8E, 0xFC86, 0xFD89, 0xFE8E, 0xFF8C, 0x007A, 0x014F,
0x0203, 0x028D, 0x02E6, 0x0306, 0x555A, 0x5643, 0x58DF, 0x592D, 0x543B, 0x52E7, 0x52D6, 0x5360, 0x5440, 0x5551,
0x567B, 0x57AC, 0x58D8, 0x59F4, 0x5AF6, 0x5BD7, 0x5C91, 0x5D1D, 0x5D74, 0x5D92, 0xBE23, 0xBE22, 0xBE25, 0xBE2E,
0xBE41, 0xBE62, 0xBE91, 0xBED0, 0xBF1F, 0xBF7B, 0xBFE1, 0xC04F, 0xC0C0, 0xC130, 0xC19A, 0xC1FA, 0xC24A, 0xC287,
0xC2AB, 0xC2B3, 0x11A6, 0x1148, 0x10B2, 0x0FEE, 0x0F00, 0x0DF0, 0x0CC4, 0x0B84, 0x0A37, 0x08E3, 0x078E, 0x0641,
0x0501, 0x03D6, 0x02C6, 0x01D8, 0x0114, 0x007F, 0x0021, 0x0000, 0xEE5A, 0xEEB8, 0xEF4D, 0xF012, 0xF100, 0xF210,
0xF33B, 0xF47B, 0xF5C8, 0xF71C, 0xF871, 0xF9BE, 0xFAFE, 0xFC29, 0xFD39, 0xFE27, 0xFEEC, 0xFF81, 0xFFDF, 0x0000,
0xD5A5, 0xD687, 0xD7ED, 0xD9C6, 0xDC00, 0xDE8D, 0xE15B, 0xE45B, 0xE77B, 0xEAAC, 0xEDDC, 0xF0FC, 0xF3FC, 0xF6CA,
0xF956, 0xFB91, 0xFD69, 0xFECF, 0xFFB1, 0x0000, 0xE11E, 0xE162, 0xE1A0, 0xE1B7, 0xE17B, 0xE075, 0xDE98, 0xDC46,
0xD9FC, 0xD83E, 0xD6A1, 0xD48A, 0xD228, 0xCFAA, 0xCD37, 0xCAF3, 0xC8FE, 0xC776, 0xC676, 0xC61D, 0x036D, 0x022B,
0x0079, 0xFEC4, 0xFDCC, 0xFDE0, 0xFE6D, 0xFF1F, 0xFFAA, 0xFFCC, 0xFFC2, 0xFFF9, 0x005F, 0x00D4, 0x0139, 0x017A,
0x0193, 0x018F, 0x0180, 0x0178, 0x535D, 0x51B3, 0x4F98, 0x4DAF, 0x4CEF, 0x4E26, 0x509B, 0x5342, 0x554F, 0x5624,
0x5690, 0x57A0, 0x5916, 0x5ABD, 0x5C6C, 0x5E05, 0x5F70, 0x6096, 0x615C, 0x61A3, 0xBFD0, 0xC4F0, 0xCBDC, 0xD2EA,
0xD781, 0xD7EB, 0xD602, 0xD3AC, 0xD262, 0xD350, 0xD4F5, 0xD514, 0xD405, 0xD23C, 0xD026, 0xCE17, 0xCC4A, 0xCAE3,
0xC9F9, 0xC99F, 0xF71C, 0xF8E4, 0x0307, 0x15DC, 0x2000, 0x2031, 0x20BA, 0x218E, 0x229F, 0x23DF, 0x2542, 0x26B9,
0x2836, 0x29AD, 0x2B10, 0x2C50, 0x2D61, 0x2E35, 0x2EBE, 0x2EEF, 0x1555, 0x18E4, 0x0EC0, 0xFBEB, 0xF1C7, 0xF1E6,
0xF23F, 0xF2C7, 0xF376, 0xF444, 0xF528, 0xF619, 0xF70F, 0xF800, 0xF8E4, 0xF9B2, 0xFA61, 0xFAE9, 0xFB41, 0xFB61,
0xD74A, 0xD93F, 0xD9B5, 0xDA90, 0xDB06, 0xDB4C, 0xDC13, 0xDD47, 0xDED4, 0xE0A5, 0xE2A8, 0xE4C9, 0xE6F3, 0xE914,
0xEB17, 0xECE8, 0xEE75, 0xEFA8, 0xF06F, 0xF0B6, 0xFFE6, 0xFF9A, 0xFF23, 0xFE85, 0xFDC7, 0xFCEE, 0xFBFE, 0xFAFE,
0xF9F4, 0xF8E4, 0xF7D3, 0xF6C9, 0xF5C9, 0xF4DA, 0xF400, 0xF342, 0xF2A4, 0xF22D, 0xF1E2, 0xF1C7, 0xEAED, 0xEBAA,
0xECD4, 0xEE5D, 0xF039, 0xF259, 0xF4AF, 0xF72F, 0xF9C9, 0xFC72, 0xFF1A, 0x01B5, 0x0434, 0x068B, 0x08AB, 0x0A86,
0x0C10, 0x0D3A, 0x0DF7, 0x0E39,
};
static JointIndex sChildZeldaAnim_013A50JointIndices[18] = {
{ 0x0006, 0x001A, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x0002, 0x0004 },
{ 0x0002, 0x0002, 0x002E },
{ 0x0002, 0x0002, 0x0042 },
{ 0x0002, 0x0002, 0x0056 },
{ 0x0002, 0x0002, 0x006A },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0005, 0x007E, 0x0005 },
{ 0x0092, 0x00A6, 0x00BA },
{ 0x0002, 0x0002, 0x00CE },
{ 0x00E2, 0x00F6, 0x010A },
{ 0x011E, 0x0132, 0x0146 },
{ 0x0002, 0x0002, 0x015A },
{ 0x016E, 0x0182, 0x0196 },
{ 0x0002, 0x01AA, 0x01BE },
};
AnimationHeader gChildZeldaAnim_013A50 = { { 20 }, sChildZeldaAnim_013A50FrameData, sChildZeldaAnim_013A50JointIndices, 6 };
static s16 sChildZeldaAnim_013EA0FrameData[490] = {
0x0000, 0x09DC, 0xBF0F, 0xC000, 0x4000, 0x2EEF, 0xFB61, 0xF0B6, 0xF1C7, 0x09DC, 0x09DB, 0x09D9, 0x09D7, 0x09D5,
0x09D3, 0x09D0, 0x09CE, 0x09CC, 0x09CA, 0x09C8, 0x09C6, 0x09C5, 0x09C4, 0x09C4, 0x09C4, 0x09C5, 0x09C6, 0x09C8,
0x09C9, 0x09CB, 0x09CE, 0x09D0, 0x09D2, 0x09D4, 0x09D6, 0x09D8, 0x09DA, 0x09DC, 0x09DD, 0xF6EE, 0xF6BB, 0xF67C,
0xF637, 0xF5ED, 0xF5A1, 0xF556, 0xF50E, 0xF4CA, 0xF48D, 0xF457, 0xF42B, 0xF409, 0xF3F4, 0xF3EC, 0xF3F3, 0xF407,
0xF427, 0xF451, 0xF484, 0xF4BE, 0xF4FE, 0xF544, 0xF58D, 0xF5D7, 0xF621, 0xF669, 0xF6AB, 0xF6E5, 0xF713, 0x0C5E,
0x0CB9, 0x0D27, 0x0DA2, 0x0E24, 0x0EAA, 0x0F2E, 0x0FAD, 0x1024, 0x1090, 0x10EE, 0x113C, 0x1177, 0x119C, 0x11A9,
0x119D, 0x117A, 0x1142, 0x10F9, 0x10A0, 0x1039, 0x0FC8, 0x0F4D, 0x0ECD, 0x0E4A, 0x0DC7, 0x0D49, 0x0CD5, 0x0C6F,
0x0C1D, 0xF715, 0xF6E2, 0xF6A4, 0xF65F, 0xF616, 0xF5CB, 0xF581, 0xF539, 0xF4F6, 0xF4B9, 0xF484, 0xF458, 0xF436,
0xF421, 0xF41A, 0xF421, 0xF434, 0xF454, 0xF47D, 0xF4B0, 0xF4EA, 0xF52A, 0xF56F, 0xF5B7, 0xF601, 0xF64A, 0xF691,
0xF6D2, 0xF70B, 0xF739, 0x0C82, 0x0CDC, 0x0D49, 0x0DC3, 0x0E44, 0x0EC9, 0x0F4C, 0x0FCA, 0x1040, 0x10AB, 0x1109,
0x1156, 0x1191, 0x11B6, 0x11C3, 0x11B7, 0x1194, 0x115D, 0x1114, 0x10BB, 0x1056, 0x0FE5, 0x0F6B, 0x0EEC, 0x0E6A,
0x0DE8, 0x0D6C, 0x0CF8, 0x0C93, 0x0C42, 0x3CBE, 0x3CAD, 0x3C99, 0x3C80, 0x3C66, 0x3C49, 0x3C2C, 0x3C0F, 0x3BF2,
0x3BD8, 0x3BC0, 0x3BAB, 0x3B9C, 0x3B92, 0x3B8E, 0x3B92, 0x3B9B, 0x3BAA, 0x3BBD, 0x3BD4, 0x3BED, 0x3C08, 0x3C25,
0x3C42, 0x3C5E, 0x3C79, 0x3C92, 0x3CA8, 0x3CBB, 0x3CC9, 0x0307, 0x0308, 0x0309, 0x030B, 0x030E, 0x0310, 0x0313,
0x0316, 0x0319, 0x031C, 0x031F, 0x0321, 0x0323, 0x0324, 0x0324, 0x0324, 0x0323, 0x0321, 0x031F, 0x031C, 0x031A,
0x0317, 0x0314, 0x0311, 0x030E, 0x030C, 0x030A, 0x0308, 0x0307, 0x0306, 0x5D92, 0x5D91, 0x5D90, 0x5D8F, 0x5D8E,
0x5D8D, 0x5D8C, 0x5D8B, 0x5D8A, 0x5D8A, 0x5D8A, 0x5D89, 0x5D89, 0x5D89, 0x5D89, 0x5D89, 0x5D89, 0x5D89, 0x5D89,
0x5D8A, 0x5D8A, 0x5D8B, 0x5D8C, 0x5D8C, 0x5D8D, 0x5D8E, 0x5D90, 0x5D91, 0x5D92, 0x5D92, 0xC2A9, 0xC29B, 0xC289,
0xC275, 0xC25F, 0xC247, 0xC22F, 0xC217, 0xC201, 0xC1EC, 0xC1D9, 0xC1C9, 0xC1BD, 0xC1B5, 0xC1B3, 0xC1B5, 0xC1BD,
0xC1C8, 0xC1D7, 0xC1E8, 0xC1FD, 0xC212, 0xC229, 0xC241, 0xC258, 0xC26F, 0xC284, 0xC297, 0xC2A7, 0xC2B3, 0x0000,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0000, 0x0000, 0xC623, 0xC62B, 0xC636, 0xC642, 0xC64F, 0xC65E, 0xC66D, 0xC67C, 0xC68A, 0xC697, 0xC6A3,
0xC6AD, 0xC6B5, 0xC6BA, 0xC6BC, 0xC6BA, 0xC6B6, 0xC6AE, 0xC6A5, 0xC699, 0xC68D, 0xC67F, 0xC670, 0xC662, 0xC654,
0xC646, 0xC639, 0xC62E, 0xC624, 0xC61D, 0x017A, 0x017D, 0x0180, 0x0184, 0x0188, 0x018D, 0x0191, 0x0195, 0x0199,
0x019D, 0x01A0, 0x01A2, 0x01A4, 0x01A6, 0x01A6, 0x01A6, 0x01A5, 0x01A3, 0x01A0, 0x019D, 0x019A, 0x0196, 0x0192,
0x018E, 0x018A, 0x0185, 0x0181, 0x017E, 0x017B, 0x0178, 0x61A0, 0x619B, 0x6195, 0x618E, 0x6186, 0x617E, 0x6175,
0x616D, 0x6165, 0x615D, 0x6156, 0x6151, 0x614C, 0x6149, 0x6148, 0x6149, 0x614C, 0x6150, 0x6155, 0x615C, 0x6163,
0x616B, 0x6173, 0x617B, 0x6184, 0x618B, 0x6193, 0x6199, 0x619F, 0x61A3, 0xC991, 0xC97D, 0xC965, 0xC949, 0xC92A,
0xC90A, 0xC8E9, 0xC8C8, 0xC8A8, 0xC88B, 0xC871, 0xC85B, 0xC84B, 0xC840, 0xC83C, 0xC840, 0xC84A, 0xC859, 0xC86E,
0xC887, 0xC8A3, 0xC8C1, 0xC8E0, 0xC901, 0xC921, 0xC940, 0xC95D, 0xC977, 0xC98D, 0xC99F, 0x0E44, 0x0E65, 0x0E98,
0x0ED9, 0x0F25, 0x0F79, 0x0FD3, 0x102D, 0x1087, 0x10DB, 0x1127, 0x1168, 0x119B, 0x11BC, 0x11C7, 0x11BC, 0x119B,
0x1168, 0x1127, 0x10DB, 0x1087, 0x102D, 0x0FD3, 0x0F79, 0x0F25, 0x0ED9, 0x0E98, 0x0E65, 0x0E44, 0x0E39, 0x0000,
};
static JointIndex sChildZeldaAnim_013EA0JointIndices[18] = {
{ 0x0000, 0x0009, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0002, 0x0000, 0x0003 },
{ 0x0000, 0x0000, 0x0027 },
{ 0x0000, 0x0000, 0x0045 },
{ 0x0000, 0x0000, 0x0063 },
{ 0x0000, 0x0000, 0x0081 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0004, 0x0000, 0x0004 },
{ 0x009F, 0x00BD, 0x00DB },
{ 0x0000, 0x0000, 0x00F9 },
{ 0x0117, 0x0000, 0x0135 },
{ 0x0153, 0x0171, 0x018F },
{ 0x0000, 0x0000, 0x01AD },
{ 0x0005, 0x0006, 0x0007 },
{ 0x0000, 0x0008, 0x01CB },
};
AnimationHeader gChildZeldaAnim_013EA0 = { { 30 }, sChildZeldaAnim_013EA0FrameData, sChildZeldaAnim_013EA0JointIndices, 9 };
static s16 sChildZeldaAnim_015F14FrameData[4092] = {
0x06D5, 0x099B, 0x0000, 0x06D5, 0x06D6, 0x06D9, 0x06DE, 0x06E4, 0x06EA, 0x06F2, 0x06FA, 0x0701, 0x0709, 0x0710,
0x0716, 0x071A, 0x071D, 0x071E, 0x071F, 0x0721, 0x0724, 0x0728, 0x072E, 0x0735, 0x073E, 0x0748, 0x0753, 0x075F,
0x076B, 0x0778, 0x0785, 0x0793, 0x07A0, 0x07AE, 0x07BC, 0x07CA, 0x07D8, 0x07E7, 0x07F5, 0x0803, 0x0811, 0x081E,
0x082A, 0x0835, 0x083F, 0x0849, 0x0851, 0x0859, 0x085F, 0x0865, 0x0869, 0x086C, 0x086E, 0x086F, 0x086F, 0x086F,
0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F,
0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F,
0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x099B, 0x099A, 0x0998, 0x0994, 0x098F, 0x0988, 0x0982, 0x097B,
0x0974, 0x096E, 0x0968, 0x0962, 0x095E, 0x095C, 0x095B, 0x095A, 0x0956, 0x0952, 0x094D, 0x0948, 0x0945, 0x0944,
0x0945, 0x0949, 0x094F, 0x0957, 0x0960, 0x096A, 0x0975, 0x0981, 0x098C, 0x0997, 0x09A1, 0x09AA, 0x09B2, 0x09B8,
0x09BC, 0x09BD, 0x09BD, 0x09BC, 0x09BB, 0x09BA, 0x09B8, 0x09B6, 0x09B5, 0x09B3, 0x09B1, 0x09B0, 0x09AF, 0x09AE,
0x09AE, 0x09AD, 0x09AC, 0x09A9, 0x09A6, 0x09A2, 0x099F, 0x099B, 0x0997, 0x0994, 0x0991, 0x0990, 0x098F, 0x0990,
0x0991, 0x0994, 0x0997, 0x099B, 0x099F, 0x09A2, 0x09A6, 0x09A9, 0x09AC, 0x09AD, 0x09AE, 0x09AD, 0x09AC, 0x09A9,
0x09A6, 0x09A2, 0x099E, 0x099A, 0x0995, 0x0992, 0x098E, 0x098C, 0x098A, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000,
0xC000, 0xC000, 0xC000, 0xC01A, 0xC067, 0xC0E4, 0xC18F, 0xC265, 0xC364, 0xC489, 0xC5D2, 0xC73D, 0xC8C6, 0xCA6C,
0xCC2C, 0xCE03, 0xCFEF, 0xD1EE, 0xD3FD, 0xD61A, 0xD841, 0xDA72, 0xDCA8, 0xDEE2, 0xE11E, 0xE358, 0xE58E, 0xE7BF,
0xE9E6, 0xEC03, 0xEE12, 0xF011, 0xF1FD, 0xF3D4, 0xF594, 0xF73A, 0xF8C3, 0xFA2E, 0xFB77, 0xFC9C, 0xFD9B, 0xFE71,
0xFF1C, 0xFF99, 0xFFE6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0E, 0xBF0E,
0xBF0D, 0xBF0D, 0xBF0D, 0xBF0D, 0xBF0C, 0xBF0C, 0xBF0C, 0xBF0C, 0xBF0B, 0xBF0B, 0xBF0B, 0xBF0A, 0xBF0A, 0xBF0A,
0xBF0A, 0xBF0A, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF08, 0xBF08, 0xBF07, 0xBF07,
0xBF06, 0xBF06, 0xBF05, 0xBF05, 0xBF05, 0xBF05, 0xBF05, 0xBF06, 0xBF06, 0xBF07, 0xBF07, 0xBF08, 0xBF08, 0xBF09,
0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF08, 0xBF08, 0xBF08, 0xBF07, 0xBF07, 0xBF06, 0xBF06,
0xBF06, 0xFF06, 0xFF03, 0xFEFC, 0xFEF0, 0xFEE0, 0xFECC, 0xFEB4, 0xFE98, 0xFE78, 0xFE55, 0xFE2F, 0xFE06, 0xFDDA,
0xFDAC, 0xFD7B, 0xFD48, 0xFD13, 0xFCDC, 0xFCA4, 0xFC6A, 0xFC2F, 0xFBF3, 0xFBB6, 0xFB79, 0xFB3B, 0xFAFD, 0xFABF,
0xFA82, 0xFA44, 0xFA08, 0xF9CC, 0xF991, 0xF957, 0xF91F, 0xF8E8, 0xF8B3, 0xF880, 0xF84F, 0xF821, 0xF7F5, 0xF7CC,
0xF7A6, 0xF783, 0xF763, 0xF747, 0xF72F, 0xF71B, 0xF70A, 0xF6FF, 0xF6F8, 0xF6F5, 0xF6E8, 0xF6C2, 0xF68A, 0xF643,
0xF5F2, 0xF59D, 0xF548, 0xF4F7, 0xF4B0, 0xF478, 0xF452, 0xF445, 0xF452, 0xF478, 0xF4B0, 0xF4F7, 0xF548, 0xF59D,
0xF5F2, 0xF643, 0xF68A, 0xF6C2, 0xF6E8, 0xF6F5, 0xF6EC, 0xF6D4, 0xF6AF, 0xF67F, 0xF649, 0xF60E, 0xF5D2, 0xF598,
0xF561, 0xF532, 0xF50D, 0xF4F4, 0xC006, 0xC006, 0xC006, 0xC006, 0xC006, 0xC007, 0xC007, 0xC008, 0xC008, 0xC009,
0xC009, 0xC00A, 0xC00B, 0xC00C, 0xC00D, 0xC00E, 0xC00F, 0xC010, 0xC011, 0xC012, 0xC013, 0xC015, 0xC016, 0xC017,
0xC019, 0xC01A, 0xC01C, 0xC01D, 0xC01F, 0xC020, 0xC022, 0xC023, 0xC025, 0xC026, 0xC028, 0xC029, 0xC02B, 0xC02C,
0xC02D, 0xC02F, 0xC030, 0xC031, 0xC032, 0xC033, 0xC034, 0xC035, 0xC035, 0xC036, 0xC036, 0xC036, 0xC036, 0xC037,
0xC037, 0xC039, 0xC03A, 0xC03C, 0xC03E, 0xC040, 0xC043, 0xC044, 0xC046, 0xC047, 0xC047, 0xC047, 0xC046, 0xC044,
0xC043, 0xC040, 0xC03E, 0xC03C, 0xC03A, 0xC039, 0xC037, 0xC037, 0xC036, 0xC037, 0xC037, 0xC038, 0xC039, 0xC03A,
0xC03C, 0xC03D, 0xC03F, 0xC040, 0xC041, 0xC042, 0xC043, 0x0023, 0x0022, 0x0021, 0x001F, 0x001C, 0x0018, 0x0012,
0x000B, 0x0004, 0xFFFD, 0xFFF6, 0xFFF0, 0xFFEB, 0xFFE8, 0xFFE7, 0xFFE8, 0xFFEB, 0xFFEF, 0xFFF4, 0xFFFB, 0x0003,
0x000A, 0x0012, 0x0018, 0x001E, 0x0022, 0x0026, 0x0029, 0x002B, 0x002B, 0x002A, 0x0029, 0x0027, 0x0023, 0x0020,
0x001C, 0x0018, 0x0015, 0x0012, 0x000F, 0x000D, 0x000B, 0x0008, 0x0007, 0x0005, 0x0003, 0x0002, 0x0001, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF9E, 0xFF9F, 0xFFA4, 0xFFAC,
0xFFB6, 0xFFC4, 0xFFD3, 0xFFE5, 0xFFF7, 0x0008, 0x0016, 0x0022, 0x002C, 0x0032, 0x0034, 0x0032, 0x002C, 0x0023,
0x0017, 0x000A, 0xFFFB, 0xFFEC, 0xFFDE, 0xFFD1, 0xFFC6, 0xFFBB, 0xFFB0, 0xFFA7, 0xFFA0, 0xFF9A, 0xFF96, 0xFF94,
0xFF95, 0xFF98, 0xFF9E, 0xFFA6, 0xFFB0, 0xFFBA, 0xFFC4, 0xFFCD, 0xFFD6, 0xFFDE, 0xFFE5, 0xFFEB, 0xFFF1, 0xFFF5,
0xFFF9, 0xFFFC, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF4D5,
0xF4C2, 0xF490, 0xF446, 0xF3EC, 0xF38A, 0xF329, 0xF2CD, 0xF27B, 0xF234, 0xF1FE, 0xF1DF, 0xF1DC, 0xF1FC, 0xF244,
0xF28C, 0xF2B0, 0xF2BE, 0xF2C0, 0xF2C1, 0xF2CD, 0xF2ED, 0xF32B, 0xF384, 0xF3F7, 0xF484, 0xF527, 0xF5DD, 0xF6A2,
0xF773, 0xF84A, 0xF924, 0xF9F8, 0xFAC1, 0xFB75, 0xFC09, 0xFC72, 0xFCA5, 0xFCB4, 0xFCB9, 0xFCB6, 0xFCAB, 0xFC9C,
0xFC88, 0xFC73, 0xFC5D, 0xFC47, 0xFC34, 0xFC24, 0xFC1A, 0xFC16, 0xFC1B, 0xFC29, 0xFC3F, 0xFC5C, 0xFC7E, 0xFCA5,
0xFCCE, 0xFCF7, 0xFD1C, 0xFD3B, 0xFD4F, 0xFD57, 0xFD4F, 0xFD3B, 0xFD1C, 0xFCF7, 0xFCCE, 0xFCA5, 0xFC7E, 0xFC5C,
0xFC3F, 0xFC29, 0xFC1B, 0xFC16, 0xFC15, 0xFC11, 0xFC0C, 0xFC07, 0xFC04, 0xFC01, 0xFC01, 0xFC03, 0xFC06, 0xFC0A,
0xFC0D, 0xFC10, 0x1896, 0x18B8, 0x1916, 0x19A4, 0x1A54, 0x1B1C, 0x1BF1, 0x1CC7, 0x1D98, 0x1E5C, 0x1F0C, 0x1FA0,
0x2012, 0x205B, 0x2074, 0x2095, 0x20EC, 0x2163, 0x21E4, 0x225B, 0x22B4, 0x22DD, 0x22C5, 0x2270, 0x21E5, 0x212A,
0x2044, 0x1F3A, 0x1E12, 0x1CD3, 0x1B86, 0x1A34, 0x18E7, 0x17AE, 0x1699, 0x15BC, 0x152A, 0x14F8, 0x1506, 0x1526,
0x1553, 0x158B, 0x15C9, 0x160C, 0x164F, 0x168F, 0x16CA, 0x16FD, 0x1724, 0x173E, 0x1748, 0x175D, 0x1798, 0x17EF,
0x185A, 0x18D0, 0x1949, 0x19BF, 0x1A2B, 0x1A87, 0x1AD0, 0x1AFF, 0x1B10, 0x1AFF, 0x1AD0, 0x1A87, 0x1A2B, 0x19BF,
0x1949, 0x18D0, 0x185A, 0x17EF, 0x1798, 0x175D, 0x1748, 0x175E, 0x179B, 0x17F6, 0x1868, 0x18E8, 0x196E, 0x19F4,
0x1A74, 0x1AE8, 0x1B4B, 0x1B98, 0x1BCA, 0xFFEA, 0xFFEA, 0xFFEB, 0xFFEE, 0xFFF1, 0xFFF5, 0xFFFB, 0x0002, 0x000B,
0x0018, 0x0026, 0x0037, 0x004B, 0x0060, 0x0078, 0x0091, 0x00AD, 0x00CC, 0x00EB, 0x010A, 0x0128, 0x0143, 0x0157,
0x0166, 0x016D, 0x016F, 0x016A, 0x0160, 0x0151, 0x013E, 0x0128, 0x010F, 0x00F5, 0x00DC, 0x00C3, 0x00AC, 0x0097,
0x0086, 0x0076, 0x0066, 0x0058, 0x0049, 0x003C, 0x002F, 0x0024, 0x001A, 0x0011, 0x000A, 0x0004, 0x0001, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003F, 0x003E, 0x0039, 0x0032, 0x0028, 0x001B,
0x000D, 0xFFFB, 0xFFE6, 0xFFCC, 0xFFAD, 0xFF8A, 0xFF63, 0xFF38, 0xFF09, 0xFED5, 0xFE9F, 0xFE68, 0xFE31, 0xFDFA,
0xFDC6, 0xFD96, 0xFD6B, 0xFD46, 0xFD28, 0xFD11, 0xFD01, 0xFCF8, 0xFCF7, 0xFCFE, 0xFD0E, 0xFD25, 0xFD44, 0xFD6B,
0xFD98, 0xFDCB, 0xFE01, 0xFE39, 0xFE71, 0xFEA8, 0xFEDD, 0xFF10, 0xFF3E, 0xFF69, 0xFF8F, 0xFFB1, 0xFFCC, 0xFFE2,
0xFFF3, 0xFFFC, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0xF509, 0xF4F3, 0xF4B6,
0xF45A, 0xF3E8, 0xF369, 0xF2E3, 0xF25F, 0xF1E6, 0xF181, 0xF135, 0xF107, 0xF0FA, 0xF114, 0xF159, 0xF1A0, 0xF1C6,
0xF1D5, 0xF1DA, 0xF1DE, 0xF1EB, 0xF20C, 0xF249, 0xF2A0, 0xF311, 0xF39A, 0xF439, 0xF4EB, 0xF5AD, 0xF67B, 0xF751,
0xF82B, 0xF902, 0xF9CE, 0xFA88, 0xFB23, 0xFB96, 0xFBD5, 0xFBF4, 0xFC0D, 0xFC20, 0xFC30, 0xFC3C, 0xFC45, 0xFC4C,
0xFC51, 0xFC54, 0xFC55, 0xFC56, 0xFC55, 0xFC55, 0xFC5A, 0xFC68, 0xFC7E, 0xFC9C, 0xFCBF, 0xFCE7, 0xFD10, 0xFD39,
0xFD5F, 0xFD7D, 0xFD92, 0xFD9A, 0xFD92, 0xFD7D, 0xFD5F, 0xFD39, 0xFD10, 0xFCE7, 0xFCBF, 0xFC9C, 0xFC7E, 0xFC68,
0xFC5A, 0xFC55, 0xFC54, 0xFC50, 0xFC4C, 0xFC47, 0xFC44, 0xFC42, 0xFC42, 0xFC44, 0xFC47, 0xFC4B, 0xFC4F, 0xFC52,
0x188B, 0x18AE, 0x190E, 0x19A0, 0x1A56, 0x1B24, 0x1BFD, 0x1CDA, 0x1DAF, 0x1E76, 0x1F26, 0x1FBB, 0x202C, 0x2074,
0x208C, 0x20A8, 0x20F8, 0x2166, 0x21DB, 0x2245, 0x2290, 0x22AA, 0x2283, 0x2220, 0x2188, 0x20C0, 0x1FCF, 0x1EBC,
0x1D8D, 0x1C4A, 0x1AFA, 0x19A9, 0x1860, 0x172E, 0x1623, 0x1552, 0x14D0, 0x14AF, 0x14CE, 0x14FC, 0x1535, 0x1577,
0x15BD, 0x1604, 0x164A, 0x168C, 0x16C8, 0x16FB, 0x1722, 0x173C, 0x1745, 0x175A, 0x1795, 0x17EB, 0x1855, 0x18CA,
0x1943, 0x19B8, 0x1A23, 0x1A7F, 0x1AC7, 0x1AF6, 0x1B07, 0x1AF6, 0x1AC7, 0x1A7F, 0x1A23, 0x19B8, 0x1943, 0x18CA,
0x1855, 0x17EB, 0x1795, 0x175A, 0x1745, 0x175B, 0x1797, 0x17F3, 0x1864, 0x18E3, 0x1969, 0x19EF, 0x1A6E, 0x1AE2,
0x1B45, 0x1B91, 0x1BC3, 0x0000, 0xFFF9, 0xFFE6, 0xFFC9, 0xFFA8, 0xFF84, 0xFF61, 0xFF42, 0xFF2C, 0xFF20, 0xFF23,
0xFF37, 0xFF61, 0xFFA3, 0x0001, 0x0091, 0x015F, 0x025D, 0x037E, 0x04B3, 0x05EE, 0x0723, 0x0843, 0x0941, 0x0A0F,
0x0A9E, 0x0AE0, 0x0AD8, 0x0A96, 0x0A2A, 0x09A2, 0x090F, 0x0880, 0x0804, 0x0793, 0x071B, 0x069C, 0x0619, 0x0592,
0x0509, 0x047F, 0x03F6, 0x036D, 0x02E8, 0x0267, 0x01EB, 0x0177, 0x010A, 0x00A6, 0x004D, 0x0000, 0xFFC5, 0xFF9E,
0xFF89, 0xFF82, 0xFF88, 0xFF96, 0xFFAA, 0xFFC1, 0xFFD8, 0xFFEC, 0xFFFB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFB, 0xFFF9, 0xFFF5, 0xFFEE, 0xFFE6, 0xFFDD, 0xFFD5, 0xFFCD,
0xFFC8, 0xFFC5, 0xFFC6, 0xFFCB, 0xFFD5, 0xFFE5, 0xFFFC, 0x001E, 0x004B, 0x0083, 0x00C2, 0x0106, 0x014D, 0x0196,
0x01DD, 0x0221, 0x0260, 0x0297, 0x02CC, 0x0306, 0x033F, 0x0373, 0x039D, 0x03B9, 0x03C3, 0x03B5, 0x0396, 0x036E,
0x033F, 0x030A, 0x02CF, 0x0290, 0x024E, 0x020A, 0x01C5, 0x0181, 0x013D, 0x00FC, 0x00BE, 0x0085, 0x0052, 0x0025,
0x0000, 0xFFE4, 0xFFD3, 0xFFC9, 0xFFC6, 0xFFC8, 0xFFCF, 0xFFD8, 0xFFE3, 0xFFEE, 0xFFF7, 0xFFFD, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFC1, 0xFF66, 0xFEF7, 0xFE77, 0xFDEB,
0xFD56, 0xFCBD, 0xFC22, 0xFB8A, 0xFAF9, 0xFA72, 0xF9F9, 0xF992, 0xF941, 0xF909, 0xF8F0, 0xF8F4, 0xF911, 0xF944,
0xF988, 0xF9DA, 0xFA35, 0xFA95, 0xFAF7, 0xFB56, 0xFBAE, 0xFC0C, 0xFC7C, 0xFCF6, 0xFD76, 0xFDF7, 0xFE71, 0xFEE0,
0xFF3E, 0xFF94, 0xFFED, 0x0049, 0x00A6, 0x0103, 0x015F, 0x01BA, 0x0211, 0x0263, 0x02B1, 0x02F7, 0x0336, 0x036C,
0x0398, 0x03B9, 0x03CD, 0x03D4, 0x03D2, 0x03CB, 0x03C1, 0x03B4, 0x03A5, 0x0396, 0x0386, 0x0378, 0x036B, 0x0361,
0x035A, 0x0357, 0x035A, 0x0361, 0x036B, 0x0378, 0x0386, 0x0396, 0x03A5, 0x03B4, 0x03C1, 0x03CB, 0x03D2, 0x03D4,
0x03CE, 0x03BB, 0x039F, 0x037B, 0x0352, 0x0325, 0x02F7, 0x02CB, 0x02A2, 0x027E, 0x0261, 0x024F, 0xFFFD, 0x003B,
0x0088, 0x00E2, 0x0145, 0x01B1, 0x0223, 0x0298, 0x0310, 0x0386, 0x03FB, 0x046A, 0x04D2, 0x0532, 0x0586, 0x05BF,
0x05D5, 0x05D3, 0x05C5, 0x05B5, 0x05AE, 0x05BB, 0x05E8, 0x0640, 0x06CC, 0x0799, 0x0927, 0x0BA2, 0x0E99, 0x119C,
0x1438, 0x15FD, 0x1679, 0x160A, 0x155F, 0x147D, 0x136B, 0x1231, 0x10D6, 0x0F5F, 0x0DD5, 0x0C3D, 0x0A9F, 0x0901,
0x076B, 0x05E3, 0x0470, 0x0319, 0x01E5, 0x00DA, 0x0000, 0xFF5F, 0xFEF6, 0xFEBC, 0xFEAB, 0xFEBA, 0xFEE0, 0xFF17,
0xFF56, 0xFF94, 0xFFCB, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0xFFF9, 0xFFFA, 0xFFFD, 0x0001, 0x0006, 0x000B, 0x0010, 0x0014, 0x0017, 0x0019, 0x0019, 0x0017, 0x0011,
0x0009, 0xFFFC, 0xFFEB, 0xFFD6, 0xFFBC, 0xFF9E, 0xFF7E, 0xFF5A, 0xFF35, 0xFF0D, 0xFEE4, 0xFEBB, 0xFE91, 0xFE5B,
0xFE12, 0xFDC3, 0xFD76, 0xFD37, 0xFD0F, 0xFD09, 0xFD1C, 0xFD35, 0xFD55, 0xFD7B, 0xFDA5, 0xFDD3, 0xFE05, 0xFE38,
0xFE6D, 0xFEA2, 0xFED7, 0xFF0B, 0xFF3E, 0xFF6D, 0xFF99, 0xFFC1, 0xFFE3, 0x0000, 0x0015, 0x0023, 0x002B, 0x002D,
0x002B, 0x0026, 0x001F, 0x0016, 0x000E, 0x0007, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0CE0, 0x0DB9, 0x0EBF, 0x0FEA, 0x1131, 0x128C, 0x13F3, 0x155C, 0x16C0, 0x1817,
0x1957, 0x1A78, 0x1B72, 0x1C3C, 0x1CCF, 0x1D21, 0x1D36, 0x1D16, 0x1CC8, 0x1C54, 0x1BC1, 0x1B18, 0x1A5F, 0x199E,
0x18DE, 0x1825, 0x174D, 0x1639, 0x14FF, 0x13B3, 0x126C, 0x113F, 0x1042, 0x0F5E, 0x0E72, 0x0D7F, 0x0C87, 0x0B8E,
0x0A95, 0x09A0, 0x08AF, 0x07C6, 0x06E7, 0x0614, 0x0550, 0x049D, 0x03FE, 0x0374, 0x0303, 0x02AC, 0x0272, 0x027A,
0x02DD, 0x038A, 0x046E, 0x0579, 0x0698, 0x07BB, 0x08D1, 0x09C7, 0x0A8C, 0x0B0F, 0x0B3F, 0x0B12, 0x0A98, 0x09DF,
0x08F7, 0x07EF, 0x06D8, 0x05C1, 0x04BA, 0x03D2, 0x0319, 0x029E, 0x0272, 0x0295, 0x02F7, 0x038C, 0x0449, 0x0522,
0x060D, 0x06FD, 0x07E8, 0x08C1, 0x097E, 0x0A13, 0x0A75, 0xFFFC, 0xFFFD, 0xFFFF, 0x0002, 0x0005, 0x0009, 0x000D,
0x0010, 0x0012, 0x0014, 0x0013, 0x0011, 0x000C, 0x0005, 0xFFFA, 0xFFE2, 0xFFB6, 0xFF7C, 0xFF3C, 0xFEFB, 0xFEBF,
0xFE90, 0xFE74, 0xFE70, 0xFE8C, 0xFECE, 0xFF3C, 0xFFD4, 0x008D, 0x0160, 0x0245, 0x0334, 0x0426, 0x0512, 0x05F1,
0x06BC, 0x0769, 0x07F2, 0x084F, 0x0878, 0x0858, 0x07E8, 0x0738, 0x0658, 0x0557, 0x0444, 0x0330, 0x0229, 0x013F,
0x0081, 0x0000, 0xFFB1, 0xFF7D, 0xFF61, 0xFF58, 0xFF60, 0xFF73, 0xFF8D, 0xFFAC, 0xFFCB, 0xFFE6, 0xFFF9, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0011, 0x0010, 0x000F, 0x000E,
0x000E, 0x000D, 0x000D, 0x000C, 0x000C, 0x000B, 0x000B, 0x000B, 0x000A, 0x000A, 0x000A, 0x0009, 0x0009, 0x0009,
0x0008, 0x0008, 0x0008, 0x0008, 0x0007, 0x0007, 0x0007, 0x0006, 0x0006, 0x0006, 0x0006, 0x0005, 0x0005, 0x0004,
0x0004, 0x0004, 0x0003, 0x0003, 0x0003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF459,
0xF3F1, 0xF372, 0xF2E2, 0xF245, 0xF19F, 0xF0F5, 0xF04B, 0xEFA6, 0xEF0A, 0xEE7B, 0xEDFF, 0xED99, 0xED4E, 0xED22,
0xED1A, 0xED33, 0xED69, 0xEDBB, 0xEE23, 0xEEA0, 0xEF2D, 0xEFC8, 0xF06C, 0xF117, 0xF1C5, 0xF27E, 0xF34B, 0xF428,
0xF511, 0xF605, 0xF6FF, 0xF7FC, 0xF8F8, 0xF9F2, 0xFAE5, 0xFBCE, 0xFCAA, 0xFD76, 0xFE2E, 0xFED9, 0xFF80, 0x001E,
0x00B2, 0x0138, 0x01AF, 0x0213, 0x0261, 0x0297, 0x02B3, 0x02B0, 0x0283, 0x0224, 0x019E, 0x00FB, 0x0046, 0xFF87,
0xFECB, 0xFE1A, 0xFD7E, 0xFD03, 0xFCB1, 0xFC94, 0xFCB3, 0xFD08, 0xFD88, 0xFE29, 0xFEE0, 0xFFA2, 0x0064, 0x011B,
0x01BC, 0x023D, 0x0292, 0x02B0, 0x029D, 0x0266, 0x0212, 0x01A9, 0x012F, 0x00AC, 0x0025, 0xFFA2, 0xFF28, 0xFEBE,
0xFE6B, 0xFE34, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4029, 0x409C, 0x414F, 0x4235, 0x4343, 0x446D, 0x45A9,
0x46EB, 0x4828, 0x4953, 0x4A62, 0x4B49, 0x4BFD, 0x4C72, 0x4C9D, 0x4C95, 0x4C7A, 0x4C4E, 0x4C12, 0x4BC6, 0x4B6D,
0x4B07, 0x4A96, 0x4A1B, 0x4997, 0x490C, 0x487B, 0x47E5, 0x474B, 0x46B0, 0x4613, 0x4576, 0x44DC, 0x4444, 0x43B1,
0x4323, 0x429D, 0x421F, 0x41AB, 0x4142, 0x40E5, 0x4096, 0x4056, 0x4027, 0x400A, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0xF444, 0xF444, 0xF444, 0xF444, 0xF444, 0xF444, 0xF445, 0xF446, 0xF448,
0xF44C, 0xF451, 0xF458, 0xF461, 0xF46D, 0xF47B, 0xF48D, 0xF4A1, 0xF4B9, 0xF4D5, 0xF4F4, 0xF517, 0xF53B, 0xF562,
0xF58B, 0xF5B5, 0xF5E1, 0xF60E, 0xF63C, 0xF66A, 0xF699, 0xF6C8, 0xF6F7, 0xF726, 0xF754, 0xF782, 0xF7AF, 0xF7DA,
0xF804, 0xF82D, 0xF854, 0xF878, 0xF89A, 0xF8BA, 0xF8D6, 0xF8F0, 0xF907, 0xF919, 0xF928, 0xF933, 0xF93A, 0xF93D,
0xF938, 0xF92D, 0xF91C, 0xF906, 0xF8EE, 0xF8D4, 0xF8BA, 0xF8A2, 0xF88D, 0xF87B, 0xF870, 0xF86C, 0xF86F, 0xF877,
0xF887, 0xF89E, 0xF8BD, 0xF8E6, 0xF919, 0xF957, 0xF9A0, 0xF9F6, 0xFA5A, 0xFACC, 0xFB4B, 0xFBD4, 0xFC62, 0xFCF4,
0xFD84, 0xFE10, 0xFE95, 0xFF0E, 0xFF7A, 0xFFD3, 0x0017, 0x0042, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4007,
0x401B, 0x403B, 0x4063, 0x4092, 0x40C6, 0x40FE, 0x4136, 0x416D, 0x41A1, 0x41D0, 0x41F8, 0x4216, 0x422A, 0x4231,
0x422F, 0x4229, 0x4221, 0x4215, 0x4207, 0x41F7, 0x41E5, 0x41D0, 0x41BA, 0x41A3, 0x418B, 0x4171, 0x4157, 0x413C,
0x4122, 0x4107, 0x40EC, 0x40D1, 0x40B8, 0x409F, 0x4087, 0x4070, 0x405B, 0x4047, 0x4036, 0x4026, 0x4019, 0x400E,
0x4007, 0x4002, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x0B50, 0x0B53, 0x0B5C,
0x0B66, 0x0B6F, 0x0B75, 0x0B75, 0x0B6D, 0x0B59, 0x0B37, 0x0B05, 0x0ABF, 0x0A63, 0x09EE, 0x095E, 0x08CD, 0x0857,
0x07F9, 0x07B1, 0x077C, 0x0758, 0x0741, 0x0737, 0x0736, 0x073C, 0x0747, 0x0753, 0x075F, 0x0768, 0x076C, 0x076F,
0x077A, 0x078B, 0x07A1, 0x07BC, 0x07DB, 0x07FD, 0x0822, 0x0848, 0x0870, 0x0898, 0x08BF, 0x08E6, 0x090A, 0x092D,
0x094B, 0x0966, 0x097D, 0x098D, 0x0998, 0x099C, 0x099C, 0x099D, 0x099F, 0x09A1, 0x09A4, 0x09A7, 0x09A9, 0x09AC,
0x09AE, 0x09B0, 0x09B1, 0x09B2, 0x09B1, 0x09B0, 0x09AE, 0x09AC, 0x09A9, 0x09A7, 0x09A4, 0x09A1, 0x099F, 0x099D,
0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C, 0x099C,
0x000F, 0x000F, 0x000D, 0x0003, 0xFFEC, 0xFFC3, 0xFF84, 0xFF28, 0xFEAC, 0xFE09, 0xFD3B, 0xFC3E, 0xFB0A, 0xF99D,
0xF7F0, 0xF643, 0xF4D5, 0xF3A1, 0xF2A2, 0xF1D3, 0xF12F, 0xF0B1, 0xF054, 0xF014, 0xEFEB, 0xEFD5, 0xEFCC, 0xEFCC,
0xEFD0, 0xEFD2, 0xEFE0, 0xF009, 0xF049, 0xF09E, 0xF105, 0xF17B, 0xF1FE, 0xF28A, 0xF31E, 0xF3B5, 0xF44E, 0xF4E6,
0xF579, 0xF606, 0xF689, 0xF6FF, 0xF766, 0xF7BB, 0xF7FB, 0xF824, 0xF832, 0xF829, 0xF812, 0xF7EF, 0xF7C3, 0xF792,
0xF75D, 0xF728, 0xF6F6, 0xF6CA, 0xF6A7, 0xF690, 0xF688, 0xF690, 0xF6A7, 0xF6CA, 0xF6F6, 0xF728, 0xF75D, 0xF792,
0xF7C3, 0xF7EF, 0xF812, 0xF829, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832, 0xF832,
0xF832, 0xF832, 0xF832, 0x5569, 0x5544, 0x54E4, 0x545F, 0x53CC, 0x5340, 0x52D4, 0x529C, 0x52B0, 0x5325, 0x5413,
0x5590, 0x57B1, 0x5A8E, 0x5E3E, 0x6239, 0x65F1, 0x6969, 0x6CA7, 0x6FAF, 0x7288, 0x7534, 0x77BB, 0x7A20, 0x7C69,
0x7E9B, 0x80BA, 0x82CC, 0x84D5, 0x86DB, 0x88B9, 0x8A4C, 0x8B97, 0x8CA2, 0x8D71, 0x8E09, 0x8E70, 0x8EAC, 0x8EC2,
0x8EB7, 0x8E90, 0x8E54, 0x8E07, 0x8DAE, 0x8D50, 0x8CF2, 0x8C99, 0x8C4A, 0x8C0B, 0x8BE1, 0x8BD2, 0x8BD0, 0x8BCA,
0x8BC2, 0x8BB7, 0x8BAB, 0x8B9D, 0x8B90, 0x8B84, 0x8B79, 0x8B71, 0x8B6B, 0x8B69, 0x8B6B, 0x8B71, 0x8B79, 0x8B84,
0x8B90, 0x8B9D, 0x8BAB, 0x8BB7, 0x8BC2, 0x8BCA, 0x8BD0, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2,
0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x8BD2, 0x4C56, 0x4C2F, 0x4BC9, 0x4B38, 0x4A93, 0x49EF, 0x4961, 0x4900,
0x48E1, 0x491A, 0x49C0, 0x4AE9, 0x4CAA, 0x4F19, 0x524B, 0x55BA, 0x58D9, 0x5BB2, 0x5E54, 0x60CA, 0x6320, 0x6563,
0x679F, 0x69E1, 0x6C34, 0x6EA6, 0x7142, 0x7415, 0x772B, 0x7A91, 0x7D8A, 0x7F74, 0x807F, 0x80DB, 0x80B9, 0x804A,
0x7FBF, 0x7F48, 0x7F15, 0x7E80, 0x7CE5, 0x7A77, 0x776C, 0x73F8, 0x704F, 0x6CA7, 0x6933, 0x6627, 0x63BA, 0x621E,
0x618A, 0x6163, 0x60F9, 0x6059, 0x5F90, 0x5EAB, 0x5DBA, 0x5CC8, 0x5BE4, 0x5B1A, 0x5A7A, 0x5A10, 0x59E9, 0x5A10,
0x5A7A, 0x5B1A, 0x5BE4, 0x5CC8, 0x5DBA, 0x5EAB, 0x5F90, 0x6059, 0x60F9, 0x6163, 0x618A, 0x618A, 0x618A, 0x618A,
0x618A, 0x618A, 0x618A, 0x618A, 0x618A, 0x618A, 0x618A, 0x618A, 0x618A, 0x6F82, 0x6F77, 0x6F5D, 0x6F3A, 0x6F18,
0x6EFF, 0x6EF5, 0x6F05, 0x6F35, 0x6F8E, 0x7017, 0x70DA, 0x71DD, 0x732A, 0x74C7, 0x7699, 0x7873, 0x7A46, 0x7C05,
0x7DA1, 0x7F0C, 0x8036, 0x8113, 0x8194, 0x81AA, 0x8147, 0x805C, 0x7EDC, 0x7CB8, 0x79E1, 0x7642, 0x71EE, 0x6D14,
0x67E5, 0x628F, 0x5D43, 0x5830, 0x5385, 0x4F73, 0x4C20, 0x4984, 0x478B, 0x461F, 0x452D, 0x449E, 0x445E, 0x4459,
0x4479, 0x44AA, 0x44D6, 0x44EA, 0x44E6, 0x44DB, 0x44CB, 0x44B7, 0x44A0, 0x4488, 0x4470, 0x4459, 0x4445, 0x4435,
0x442A, 0x4426, 0x442A, 0x4435, 0x4445, 0x4459, 0x4470, 0x4488, 0x44A0, 0x44B7, 0x44CB, 0x44DB, 0x44E6, 0x44EA,
0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x44EA, 0x45DB, 0x45C7,
0x4590, 0x453B, 0x44CF, 0x4451, 0x43C8, 0x433B, 0x42AF, 0x422A, 0x41B3, 0x414F, 0x4105, 0x40DB, 0x40D8, 0x4179,
0x4322, 0x45B0, 0x4902, 0x4CF5, 0x5166, 0x5633, 0x5B3B, 0x6059, 0x656D, 0x6A53, 0x6EE9, 0x730D, 0x769D, 0x7976,
0x7BAB, 0x7D6E, 0x7ECB, 0x7FD0, 0x8089, 0x8103, 0x814A, 0x816B, 0x8174, 0x80A3, 0x7E62, 0x7AFB, 0x76B7, 0x71DF,
0x6CBE, 0x679D, 0x62C5, 0x5E81, 0x5B19, 0x58D8, 0x5808, 0x57E1, 0x5776, 0x56D5, 0x560B, 0x5525, 0x5432, 0x533E,
0x5259, 0x518E, 0x50ED, 0x5082, 0x505B, 0x5082, 0x50ED, 0x518E, 0x5259, 0x533E, 0x5432, 0x5525, 0x560B, 0x56D5,
0x5776, 0x57E1, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808, 0x5808,
0x5808, 0x005E, 0x005E, 0x005D, 0x005C, 0x005B, 0x0059, 0x0057, 0x0055, 0x0053, 0x0050, 0x004E, 0x004B, 0x0049,
0x0047, 0x0044, 0x0042, 0x0040, 0x003F, 0x003D, 0x003C, 0x003C, 0x003B, 0x003B, 0x003B, 0x003A, 0x0038, 0x0037,
0x0035, 0x0033, 0x0030, 0x002E, 0x002B, 0x0028, 0x0025, 0x0022, 0x001F, 0x001C, 0x0019, 0x0016, 0x0013, 0x0010,
0x000E, 0x000B, 0x0009, 0x0007, 0x0005, 0x0003, 0x0002, 0x0001, 0x0000, 0x0000, 0x0027, 0x0093, 0x0136, 0x0202,
0x02E9, 0x03DF, 0x04D4, 0x05BC, 0x0688, 0x072B, 0x0797, 0x07BE, 0x0797, 0x072B, 0x0688, 0x05BC, 0x04D4, 0x03DF,
0x02E9, 0x0202, 0x0136, 0x0093, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x1622, 0x15F2, 0x156B, 0x1496, 0x137A, 0x1223, 0x1099, 0x0EE5, 0x0D10, 0x0B24,
0x092B, 0x072D, 0x0533, 0x0348, 0x0173, 0xFFBF, 0xFE35, 0xFCDD, 0xFBC2, 0xFAEC, 0xFA65, 0xFA36, 0xFA3B, 0xFA4A,
0xFA63, 0xFA83, 0xFAAB, 0xFADA, 0xFB10, 0xFB4A, 0xFB8A, 0xFBCD, 0xFC14, 0xFC5D, 0xFCA9, 0xFCF5, 0xFD41, 0xFD8E,
0xFDD9, 0xFE22, 0xFE69, 0xFEAC, 0xFEEC, 0xFF27, 0xFF5C, 0xFF8B, 0xFFB3, 0xFFD4, 0xFFEC, 0xFFFB, 0x0000, 0x0015,
0x004D, 0x00A3, 0x010E, 0x0188, 0x020A, 0x028B, 0x0305, 0x0370, 0x03C6, 0x03FF, 0x0413, 0x03FF, 0x03C6, 0x0370,
0x0305, 0x028B, 0x020A, 0x0188, 0x010E, 0x00A3, 0x004D, 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF71F, 0xF71E, 0xF71E, 0xF71D, 0xF71B, 0xF719, 0xF717,
0xF715, 0xF712, 0xF710, 0xF70D, 0xF70A, 0xF708, 0xF705, 0xF703, 0xF700, 0xF6FE, 0xF6FC, 0xF6FB, 0xF6FA, 0xF6F9,
0xF6F9, 0xF6F9, 0xF6F9, 0xF6F9, 0xF6FA, 0xF6FA, 0xF6FB, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FD, 0xF6FE, 0xF6FF, 0xF700,
0xF701, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705, 0xF706, 0xF706, 0xF707, 0xF707, 0xF708, 0xF708, 0xF709, 0xF709,
0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709,
0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709,
0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xFDD5, 0xFDD4, 0xFDD2, 0xFDCD,
0xFDC4, 0xFDB7, 0xFDA5, 0xFD8D, 0xFD6E, 0xFD47, 0xFD17, 0xFCDE, 0xFC9B, 0xFC4C, 0xFBF1, 0xFB98, 0xFB4F, 0xFB11,
0xFADF, 0xFAB4, 0xFA8F, 0xFA6E, 0xFA4D, 0xFA2B, 0xFA06, 0xF9DB, 0xF9A8, 0xF96B, 0xF921, 0xF8C7, 0xF86B, 0xF81B,
0xF7D6, 0xF79B, 0xF769, 0xF740, 0xF71E, 0xF704, 0xF6F0, 0xF6E2, 0xF6D9, 0xF6D5, 0xF6D4, 0xF6D5, 0xF6D9, 0xF6DE,
0xF6E4, 0xF6EA, 0xF6EF, 0xF6F3, 0xF6F4, 0xF6F2, 0xF6EE, 0xF6E6, 0xF6DD, 0xF6D3, 0xF6C8, 0xF6BD, 0xF6B2, 0xF6A9,
0xF6A2, 0xF69D, 0xF69B, 0xF69D, 0xF6A2, 0xF6A9, 0xF6B2, 0xF6BD, 0xF6C8, 0xF6D3, 0xF6DD, 0xF6E6, 0xF6EE, 0xF6F2,
0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0xF6F4, 0x02E2,
0x02E3, 0x02E4, 0x02E7, 0x02EC, 0x02F4, 0x0300, 0x0310, 0x0326, 0x0341, 0x0362, 0x038B, 0x03BB, 0x03F4, 0x0436,
0x0477, 0x04AE, 0x04DA, 0x0500, 0x051E, 0x0538, 0x054F, 0x0564, 0x0579, 0x058F, 0x05A7, 0x05C4, 0x05E7, 0x0610,
0x0643, 0x0680, 0x06C0, 0x06FA, 0x0730, 0x0760, 0x078C, 0x07B4, 0x07D7, 0x07F7, 0x0812, 0x082B, 0x083F, 0x0851,
0x0860, 0x086C, 0x0876, 0x087D, 0x0883, 0x0886, 0x0888, 0x0889, 0x088E, 0x089B, 0x08AF, 0x08C8, 0x08E5, 0x0904,
0x0922, 0x093F, 0x0958, 0x096C, 0x097A, 0x097E, 0x097A, 0x096C, 0x0958, 0x093F, 0x0922, 0x0904, 0x08E5, 0x08C8,
0x08AF, 0x089B, 0x088E, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889, 0x0889,
0x0889, 0x0889, 0x5AC9, 0x5AA1, 0x5A3A, 0x59A9, 0x5908, 0x586C, 0x57EE, 0x57A4, 0x57A6, 0x580C, 0x58EB, 0x5A5D,
0x5C77, 0x5F52, 0x6305, 0x673C, 0x6B8C, 0x6FE6, 0x743B, 0x787E, 0x7C9E, 0x808D, 0x843D, 0x879E, 0x8AA3, 0x8D3C,
0x8F5B, 0x90F1, 0x91F0, 0x9248, 0x9238, 0x9209, 0x91C0, 0x915E, 0x90E8, 0x9060, 0x8FCA, 0x8F28, 0x8E7F, 0x8DD1,
0x8D21, 0x8C73, 0x8BC9, 0x8B28, 0x8A92, 0x8A0A, 0x8993, 0x8932, 0x88E8, 0x88B9, 0x88A9, 0x88A1, 0x8889, 0x8866,
0x883A, 0x8807, 0x87D2, 0x879C, 0x876A, 0x873E, 0x871A, 0x8703, 0x86FA, 0x8703, 0x871A, 0x873E, 0x876A, 0x879C,
0x87D2, 0x8807, 0x883A, 0x8866, 0x8889, 0x88A1, 0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x88A9,
0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x88A9, 0x31A8, 0x31CF, 0x3234, 0x32BB, 0x334A, 0x33C6, 0x3414, 0x341B, 0x33BE,
0x32E4, 0x3171, 0x2F4C, 0x2C59, 0x287D, 0x239F, 0x1E87, 0x1A0A, 0x161E, 0x12BA, 0x0FD4, 0x0D63, 0x0B5D, 0x09B8,
0x086A, 0x076A, 0x06AE, 0x062D, 0x05DD, 0x05B3, 0x05A8, 0x0672, 0x08B9, 0x0C5C, 0x1139, 0x1730, 0x1E1E, 0x25E2,
0x2E5B, 0x3768, 0x40AE, 0x49D4, 0x52B8, 0x5B3A, 0x6338, 0x6A92, 0x7125, 0x76D0, 0x7B73, 0x7EEC, 0x8119, 0x81DB,
0x8194, 0x80CF, 0x7FA6, 0x7E32, 0x7C8B, 0x7ACB, 0x790C, 0x7765, 0x75F1, 0x74C8, 0x7403, 0x73BC, 0x7403, 0x74C8,
0x75F1, 0x7765, 0x790C, 0x7ACB, 0x7C8B, 0x7E32, 0x7FA6, 0x80CF, 0x8194, 0x81DB, 0x81DB, 0x81DB, 0x81DB, 0x81DB,
0x81DB, 0x81DB, 0x81DB, 0x81DB, 0x81DB, 0x81DB, 0x81DB, 0x81DB, 0xEE84, 0xEE58, 0xEDE3, 0xED3C, 0xEC7C, 0xEBBB,
0xEB10, 0xEA93, 0xEA5B, 0xEA82, 0xEB1D, 0xEC46, 0xEE14, 0xF09E, 0xF3FD, 0xF79E, 0xFAE2, 0xFDCC, 0x0061, 0x02A6,
0x049E, 0x064F, 0x07BC, 0x08EB, 0x09DF, 0x0A9D, 0x0B29, 0x0B87, 0x0BBD, 0x0BCD, 0x09D7, 0x047A, 0xFC82, 0xF2B8,
0xE7E7, 0xDCD9, 0xD259, 0xC930, 0xC229, 0xBD22, 0xB955, 0xB69D, 0xB4D3, 0xB3CF, 0xB36C, 0xB382, 0xB3EB, 0xB480,
0xB51B, 0xB594, 0xB5C5, 0xB5BD, 0xB5A8, 0xB588, 0xB561, 0xB534, 0xB504, 0xB4D5, 0xB4A8, 0xB480, 0xB460, 0xB44B,
0xB444, 0xB44B, 0xB460, 0xB480, 0xB4A8, 0xB4D5, 0xB504, 0xB534, 0xB561, 0xB588, 0xB5A8, 0xB5BD, 0xB5C5, 0xB5C5,
0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB5C5, 0xB9BC, 0xB9A7, 0xB96E,
0xB916, 0xB8A5, 0xB822, 0xB792, 0xB6FD, 0xB667, 0xB5D7, 0xB554, 0xB4E3, 0xB48B, 0xB452, 0xB43D, 0xB50C, 0xB753,
0xBAD7, 0xBF5F, 0xC4B1, 0xCA94, 0xD0CD, 0xD723, 0xDD5D, 0xE33F, 0xE892, 0xED1A, 0xF09E, 0xF2E4, 0xF3B3, 0xF36A,
0xF27D, 0xF0D5, 0xEE5A, 0xEAF3, 0xE68A, 0xE105, 0xDA4C, 0xD248, 0xC9E3, 0xC21B, 0xBAF5, 0xB477, 0xAEA7, 0xA98B,
0xA529, 0xA185, 0x9EA7, 0x9C93, 0x9B50, 0x9AE3, 0x9B2B, 0x9BF4, 0x9D24, 0x9EA1, 0xA051, 0xA21B, 0xA3E5, 0xA595,
0xA712, 0xA842, 0xA90B, 0xA954, 0xA90B, 0xA842, 0xA712, 0xA595, 0xA3E5, 0xA21B, 0xA051, 0x9EA1, 0x9D24, 0x9BF4,
0x9B2B, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3, 0x9AE3,
0xEAA0, 0xEAB7, 0xEAF9, 0xEB61, 0xEBEB, 0xEC93, 0xED53, 0xEE28, 0xEF0C, 0xEFFC, 0xF0F2, 0xF1EB, 0xF2E2, 0xF3D1,
0xF4B6, 0xF58A, 0xF64B, 0xF6F2, 0xF77C, 0xF7E4, 0xF826, 0xF83D, 0xF851, 0xF88B, 0xF8E7, 0xF964, 0xF9FE, 0xFAB2,
0xFB7F, 0xFC60, 0xFD53, 0xFE56, 0xFF66, 0x007F, 0x019F, 0x02C4, 0x03E9, 0x050E, 0x062E, 0x0747, 0x0857, 0x095A,
0x0A4D, 0x0B2E, 0x0BFB, 0x0CAF, 0x0D49, 0x0DC6, 0x0E22, 0x0E5C, 0x0E70, 0x0E53, 0x0E03, 0x0D8A, 0x0CF2, 0x0C46,
0x0B90, 0x0AD9, 0x0A2D, 0x0995, 0x091C, 0x08CC, 0x08AF, 0x08CC, 0x091C, 0x0995, 0x0A2D, 0x0AD9, 0x0B90, 0x0C46,
0x0CF2, 0x0D8A, 0x0E03, 0x0E53, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70, 0x0E70,
0x0E70, 0x0E70, 0x0E70, 0xE31A, 0xE33E, 0xE3A5, 0xE448, 0xE520, 0xE626, 0xE753, 0xE89F, 0xEA04, 0xEB7B, 0xECFD,
0xEE82, 0xF004, 0xF17B, 0xF2E0, 0xF42D, 0xF559, 0xF65F, 0xF737, 0xF7DA, 0xF841, 0xF865, 0xF85A, 0xF838, 0xF801,
0xF7B8, 0xF75D, 0xF6F3, 0xF67B, 0xF5F6, 0xF567, 0xF4CF, 0xF42F, 0xF389, 0xF2E0, 0xF234, 0xF187, 0xF0DB, 0xF031,
0xEF8C, 0xEEEC, 0xEE54, 0xEDC4, 0xED40, 0xECC8, 0xEC5D, 0xEC03, 0xEBB9, 0xEB83, 0xEB61, 0xEB55, 0xEB58, 0xEB61,
0xEB6E, 0xEB7D, 0xEB90, 0xEBA3, 0xEBB6, 0xEBC8, 0xEBD8, 0xEBE5, 0xEBED, 0xEBF0, 0xEBED, 0xEBE5, 0xEBD8, 0xEBC8,
0xEBB6, 0xEBA3, 0xEB90, 0xEB7D, 0xEB6E, 0xEB61, 0xEB58, 0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xEB55,
0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xEB55, 0xF515, 0xF513, 0xF50F, 0xF507, 0xF4FE, 0xF4F2, 0xF4E4, 0xF4D5,
0xF4C5, 0xF4B4, 0xF4A3, 0xF491, 0xF480, 0xF46F, 0xF45E, 0xF44F, 0xF442, 0xF436, 0xF42C, 0xF425, 0xF420, 0xF41F,
0xF429, 0xF446, 0xF474, 0xF4B3, 0xF501, 0xF55C, 0xF5C3, 0xF634, 0xF6AF, 0xF732, 0xF7BA, 0xF848, 0xF8DA, 0xF96D,
0xFA01, 0xFA94, 0xFB26, 0xFBB4, 0xFC3C, 0xFCBF, 0xFD3A, 0xFDAB, 0xFE12, 0xFE6D, 0xFEBB, 0xFEFA, 0xFF28, 0xFF45,
0xFF4F, 0xFF23, 0xFEA8, 0xFDEF, 0xFD07, 0xFBFF, 0xFAE8, 0xF9D0, 0xF8C9, 0xF7E0, 0xF727, 0xF6AC, 0xF680, 0xF6AC,
0xF727, 0xF7E0, 0xF8C9, 0xF9D0, 0xFAE8, 0xFBFF, 0xFD07, 0xFDEF, 0xFEA8, 0xFF23, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F,
0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0xFF4F, 0x0000, 0x000E, 0x001D, 0x0002, 0xFF95,
0xFEAA, 0xFD1A, 0xFB74, 0xFA55, 0xF9A1, 0xF93C, 0xF90C, 0xF8F6, 0xF8DE, 0xF8A9, 0xF83C, 0xF77C, 0xF64E, 0xF496,
0xF23A, 0xEFAF, 0xED7B, 0xEB9A, 0xEA04, 0xE8B6, 0xE7AA, 0xE6DA, 0xE642, 0xE5DB, 0xE5A2, 0xE590, 0xE5AE, 0xE60F,
0xE6BC, 0xE7BE, 0xE920, 0xEAEA, 0xED27, 0xEFDE, 0xF2AF, 0xF531, 0xF768, 0xF956, 0xFAFE, 0xFC64, 0xFD8B, 0xFE76,
0xFF27, 0xFFA1, 0xFFE9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01A1, 0x01AF,
0x01D7, 0x0215, 0x0268, 0x02CB, 0x033B, 0x03B7, 0x0439, 0x04C1, 0x054A, 0x05D1, 0x0654, 0x06CF, 0x0740, 0x07A3,
0x07F5, 0x0834, 0x085B, 0x0869, 0x0867, 0x0860, 0x0852, 0x083B, 0x081A, 0x07ED, 0x07B1, 0x0766, 0x070A, 0x069A,
0x0616, 0x0589, 0x0502, 0x0480, 0x0404, 0x038F, 0x031F, 0x02B7, 0x0254, 0x01F9, 0x01A4, 0x0157, 0x0111, 0x00D2,
0x009C, 0x006D, 0x0046, 0x0028, 0x0012, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x001D, 0x006D, 0x00E6, 0x017C, 0x0229, 0x02E5, 0x03A7, 0x0465, 0x0515, 0x05AF, 0x0629,
0x0678, 0xFD64, 0xFD66, 0xFD6A, 0xFD73, 0xFD81, 0xFD97, 0xFDB6, 0xFDDE, 0xFE12, 0xFE53, 0xFEA2, 0xFF00, 0xFF70,
0xFFF1, 0x0086, 0x0131, 0x01DE, 0x027B, 0x0309, 0x0388, 0x03F9, 0x045D, 0x04B4, 0x04FE, 0x053D, 0x0570, 0x0598,
0x05B7, 0x05CC, 0x05D8, 0x05DC, 0x05E2, 0x05F4, 0x060F, 0x0633, 0x065F, 0x0691, 0x06C8, 0x0703, 0x0740, 0x077E,
0x07BD, 0x07FA, 0x0835, 0x086C, 0x089E, 0x08C9, 0x08EE, 0x0909, 0x091A, 0x0920, 0x0914, 0x08F2, 0x08BF, 0x087E,
0x0835, 0x07E7, 0x079A, 0x0751, 0x0710, 0x06DD, 0x06BB, 0x06AF, 0x06C9, 0x0708, 0x0750, 0x0786, 0x078F, 0x074E,
0x06BD, 0x05E5, 0x04CF, 0x0385, 0x020E, 0x0075, 0xFEC1, 0xFCFD, 0xFB31, 0xF966, 0xF7A5, 0xF5F7, 0xF466, 0xF2F9,
0xF1BB, 0xF0B3, 0xEFEC, 0xEF6E,
};
static JointIndex sChildZeldaAnim_015F14JointIndices[18] = {
{ 0x0003, 0x005A, 0x0002 },
{ 0x0002, 0x00B1, 0x0002 },
{ 0x0108, 0x015F, 0x01B6 },
{ 0x020D, 0x0264, 0x02BB },
{ 0x0002, 0x0002, 0x0312 },
{ 0x0369, 0x03C0, 0x0417 },
{ 0x0002, 0x0002, 0x046E },
{ 0x04C5, 0x051C, 0x0573 },
{ 0x05CA, 0x0621, 0x0678 },
{ 0x06CF, 0x0726, 0x077D },
{ 0x07D4, 0x082B, 0x0882 },
{ 0x08D9, 0x0930, 0x0987 },
{ 0x09DE, 0x0A35, 0x0A8C },
{ 0x0AE3, 0x0B3A, 0x0B91 },
{ 0x0BE8, 0x0C3F, 0x0C96 },
{ 0x0CED, 0x0D44, 0x0D9B },
{ 0x0DF2, 0x0E49, 0x0EA0 },
{ 0x0EF7, 0x0F4E, 0x0FA5 },
};
AnimationHeader gChildZeldaAnim_015F14 = { { 87 }, sChildZeldaAnim_015F14FrameData, sChildZeldaAnim_015F14JointIndices, 3 };
static u8 unaccounted_015F24[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_0169B4FrameData[1292] = {
0x086F, 0x0989, 0x0000, 0x4000, 0x086F, 0x086E, 0x086B, 0x0868, 0x0864, 0x0862, 0x0861, 0x085E, 0x0857, 0x084E,
0x0843, 0x083A, 0x0833, 0x0830, 0x0826, 0x080C, 0x07E8, 0x07C1, 0x079D, 0x0782, 0x0778, 0x0771, 0x075F, 0x0745,
0x0727, 0x0709, 0x06EF, 0x06DC, 0x0989, 0x0987, 0x0980, 0x0977, 0x096F, 0x0968, 0x0965, 0x0967, 0x096C, 0x0972,
0x097B, 0x0984, 0x098C, 0x0994, 0x099D, 0x09A7, 0x09B3, 0x09BE, 0x09C8, 0x09CE, 0x09D1, 0x09CE, 0x09C8, 0x09C0,
0x09B6, 0x09AC, 0x09A4, 0x099E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFE35, 0xF958, 0xF22D,
0xE979, 0xE000, 0xD687, 0xCDD3, 0xC6A8, 0xC1CB, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000,
0xC000, 0xC000, 0xC000, 0xC000, 0xBF06, 0xBF06, 0xBF06, 0xBF06, 0xBF07, 0xBF07, 0xBF07, 0xBF07, 0xBF08, 0xBF08,
0xBF08, 0xBF08, 0xBF09, 0xBF0A, 0xBF0B, 0xBF0D, 0xBF0E, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF10, 0xBF0F, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xF4EC, 0xF4F1, 0xF500, 0xF515, 0xF52F, 0xF54B, 0xF568, 0xF582, 0xF597, 0xF5A6,
0xF5AB, 0xF5CE, 0xF630, 0xF6C6, 0xF786, 0xF865, 0xF959, 0xFA58, 0xFB57, 0xFC4B, 0xFD2B, 0xFDEB, 0xFE81, 0xFEE3,
0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xC043, 0xC043, 0xC042, 0xC042, 0xC041, 0xC040, 0xC03F, 0xC03E, 0xC03D, 0xC03D,
0xC03D, 0xC03C, 0xC039, 0xC034, 0xC02E, 0xC028, 0xC022, 0xC01C, 0xC016, 0xC011, 0xC00D, 0xC00A, 0xC008, 0xC006,
0xC006, 0xC006, 0xC006, 0xC006, 0x0000, 0xFFFE, 0xFFF9, 0xFFED, 0xFFDA, 0xFFBE, 0xFF99, 0xFF79, 0xFF68, 0xFF5E,
0xFF56, 0xFF4B, 0xFF40, 0xFF3A, 0xFF43, 0xFF5B, 0xFF78, 0xFF98, 0xFFB3, 0xFFC8, 0xFFD8, 0xFFE4, 0xFFEF, 0xFFFA,
0x0005, 0x0010, 0x001A, 0x0020, 0x0000, 0x0004, 0x0012, 0x002B, 0x0053, 0x008C, 0x00D9, 0x011F, 0x014A, 0x0169,
0x018B, 0x01B5, 0x01E4, 0x020A, 0x0208, 0x01E6, 0x01AF, 0x0168, 0x0125, 0x00E5, 0x00AB, 0x0075, 0x0044, 0x0016,
0xFFEE, 0xFFCC, 0xFFB3, 0xFFA3, 0xFC11, 0xFBD6, 0xFB40, 0xFA79, 0xF9A9, 0xF8F2, 0xF878, 0xF86E, 0xF8D6, 0xF993,
0xFA8A, 0xFB66, 0xFBD6, 0xFBC1, 0xFB8D, 0xFB99, 0xFBAD, 0xFBB2, 0xFB9F, 0xFB37, 0xFA34, 0xF8D4, 0xF78E, 0xF67E,
0xF5C6, 0xF556, 0xF50B, 0xF4E2, 0x1BDB, 0x1C2F, 0x1CFC, 0x1E00, 0x1EFA, 0x1FB3, 0x1FF7, 0x1FC0, 0x1F3A, 0x1E73,
0x1D76, 0x1C59, 0x1B3B, 0x1A3E, 0x192A, 0x17BB, 0x1612, 0x1451, 0x12A2, 0x1153, 0x10BF, 0x1108, 0x11FC, 0x135D,
0x14E9, 0x165C, 0x1787, 0x184D, 0x0000, 0x0002, 0x0008, 0x0011, 0x001A, 0x0022, 0x0027, 0x002A, 0x0031, 0x003C,
0x004E, 0x0064, 0x007B, 0x008E, 0x009E, 0x009D, 0x0088, 0x006B, 0x0052, 0x003D, 0x002C, 0x001F, 0x0014, 0x000A,
0x0000, 0xFFF8, 0xFFF0, 0xFFEC, 0x0000, 0xFFFA, 0xFFEC, 0xFFD9, 0xFFC6, 0xFFB6, 0xFFAE, 0xFFA6, 0xFF96, 0xFF7A,
0xFF4D, 0xFF10, 0xFECC, 0xFE88, 0xFE45, 0xFE26, 0xFE49, 0xFE89, 0xFEC8, 0xFF06, 0xFF43, 0xFF7D, 0xFFAF, 0xFFDB,
0xFFFE, 0x001A, 0x002F, 0x003B, 0xFC53, 0xFC23, 0xFBAE, 0xFB1B, 0xFA91, 0xFA30, 0xFA17, 0xFA0E, 0xF9DC, 0xF9A1,
0xF979, 0xF940, 0xF8CD, 0xF825, 0xF7AD, 0xF7A9, 0xF7F6, 0xF86B, 0xF8CC, 0xF8E1, 0xF865, 0xF77B, 0xF690, 0xF5CE,
0xF55C, 0xF52A, 0xF512, 0xF50A, 0x1BD4, 0x1C27, 0x1CF1, 0x1DF0, 0x1EE6, 0x1F9C, 0x1FE0, 0x1FB4, 0x1F43, 0x1E91,
0x1DA5, 0x1C8D, 0x1B59, 0x1A1C, 0x18B8, 0x172E, 0x15A8, 0x141E, 0x1296, 0x1150, 0x10A3, 0x10DE, 0x11E3, 0x1359,
0x14F0, 0x1663, 0x1787, 0x1846, 0x0000, 0x0025, 0x0077, 0x00C8, 0x00ED, 0x00BA, 0x0000, 0xFE96, 0xFC66, 0xF968,
0xF592, 0xEF47, 0xE715, 0xE031, 0xDDD0, 0xE01B, 0xE490, 0xEA68, 0xF0DA, 0xF71E, 0xFC6E, 0x0000, 0x01CB, 0x027E,
0x0265, 0x01CB, 0x00FF, 0x004D, 0x0000, 0x0025, 0x0076, 0x00C7, 0x00EC, 0x00B8, 0xFFFF, 0xFDFB, 0xFACB, 0xF79D,
0xF59E, 0xF539, 0xF5C5, 0xF6CE, 0xF7E1, 0xF8F3, 0xFA36, 0xFB91, 0xFCEB, 0xFE2B, 0xFF39, 0xFFFB, 0x0068, 0x0092,
0x008C, 0x0068, 0x0038, 0x000D, 0x0248, 0x01F4, 0x0121, 0x000E, 0xFEF7, 0xFE1A, 0xFDB7, 0xFE2D, 0xFF58, 0x00A7,
0x018B, 0x01E0, 0x01F3, 0x01DA, 0x01B1, 0x017B, 0x0133, 0x00DF, 0x0089, 0x0037, 0xFFF2, 0xFFC1, 0xFFA7, 0xFF9D,
0xFF9F, 0xFFA7, 0xFFB3, 0xFFBD, 0x0000, 0xFFFE, 0xFFFB, 0xFFF7, 0xFFF5, 0xFFF7, 0xFFFF, 0x0085, 0x0163, 0x01AD,
0x0077, 0xFCEF, 0xF7C5, 0xF24E, 0xEDE2, 0xEA48, 0xE6FC, 0xE4E0, 0xE4D6, 0xE6A5, 0xE951, 0xEC9A, 0xF041, 0xF407,
0xF7AC, 0xFAF0, 0xFD94, 0xFF58, 0x0000, 0xFFEB, 0xFFBD, 0xFF8F, 0xFF7A, 0xFF97, 0xFFFF, 0x0154, 0x0374, 0x0551,
0x05DE, 0x0441, 0x013A, 0xFE24, 0xFC57, 0xFC81, 0xFDCF, 0xFF5B, 0x003E, 0x0072, 0x008C, 0x0091, 0x0085, 0x006E,
0x0051, 0x0032, 0x0015, 0x0001, 0x0A98, 0x0B31, 0x0CB3, 0x0EB2, 0x10C3, 0x127B, 0x136C, 0x130B, 0x119B, 0x0FE9,
0x0EBF, 0x0E6C, 0x0E7C, 0x0E96, 0x0E63, 0x0D9F, 0x0C88, 0x0B87, 0x0B08, 0x0AFE, 0x0B15, 0x0B45, 0x0B86, 0x0BD1,
0x0C1F, 0x0C68, 0x0CA6, 0x0CD0, 0x0000, 0x001F, 0x0065, 0x00AA, 0x00C9, 0x009D, 0xFFFF, 0xFE40, 0xFB7D, 0xF8C4,
0xF722, 0xF73D, 0xF867, 0xF9AD, 0xFA1B, 0xF99F, 0xF8D4, 0xF7D5, 0xF6B7, 0xF595, 0xF484, 0xF39F, 0xF2FC, 0xF2B3,
0xF2DE, 0xF527, 0xF9A3, 0xFE03, 0x0000, 0xFFFB, 0xFFF0, 0xFFE5, 0xFFE0, 0xFFE8, 0x0002, 0x0029, 0x0064, 0x00CA,
0x0177, 0x02C7, 0x0490, 0x061E, 0x06B9, 0x0680, 0x060E, 0x0570, 0x04B1, 0x03DD, 0x0300, 0x0224, 0x0156, 0x00A1,
0x0011, 0xFFCC, 0xFFD3, 0xFFF9, 0xFE20, 0xFDC6, 0xFCE2, 0xFBB3, 0xFA79, 0xF974, 0xF8E4, 0xF912, 0xF9D9, 0xFAD2,
0xFB94, 0xFC30, 0xFCCF, 0xFD2C, 0xFD02, 0xFC59, 0xFB73, 0xFA61, 0xF938, 0xF809, 0xF6E7, 0xF5E5, 0xF515, 0xF48B,
0xF459, 0xF459, 0xF459, 0xF459, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4046, 0x40FE,
0x4203, 0x432E, 0x4458, 0x455D, 0x4615, 0x465B, 0x4615, 0x455D, 0x4458, 0x432E, 0x4203, 0x40FE, 0x4046, 0x4000,
0x4000, 0x4000, 0x4000, 0x4000, 0x0051, 0x002C, 0xFFCB, 0xFF41, 0xFEA4, 0xFE06, 0xFD7C, 0xFD1B, 0xFCF6, 0xFD0F,
0xFD4B, 0xFD91, 0xFDCB, 0xFDE1, 0xFDBB, 0xFD41, 0xFC5C, 0xFB1A, 0xF9A1, 0xF818, 0xF6A4, 0xF56C, 0xF494, 0xF444,
0xF444, 0xF444, 0xF444, 0xF444, 0x099C, 0x099F, 0x09A8, 0x09B0, 0x09B4, 0x0999, 0x0955, 0x08FC, 0x08A4, 0x0860,
0x0845, 0x084C, 0x0860, 0x087F, 0x08A7, 0x08D8, 0x090F, 0x094B, 0x098A, 0x09CB, 0x0A0B, 0x0A4A, 0x0A86, 0x0ABD,
0x0AEE, 0x0B16, 0x0B35, 0x0B49, 0xF832, 0xF843, 0xF86A, 0xF890, 0xF8A1, 0xF88F, 0xF861, 0xF826, 0xF7EB, 0xF7BD,
0xF7AB, 0xF7BE, 0xF7F4, 0xF84A, 0xF8BA, 0xF940, 0xF9D8, 0xFA7D, 0xFB2A, 0xFBDD, 0xFC8F, 0xFD3D, 0xFDE2, 0xFE7A,
0xFF00, 0xFF70, 0xFFC5, 0xFFFC, 0x8BD2, 0x8B5A, 0x8A50, 0x8947, 0x88CE, 0x8942, 0x8A62, 0x8BD8, 0x8D4E, 0x8E6E,
0x8EE1, 0x8E5E, 0x8CE9, 0x8AA0, 0x87A1, 0x840A, 0x7FFB, 0x7B91, 0x76EA, 0x7225, 0x6D60, 0x68BA, 0x644F, 0x6040,
0x5CAA, 0x59AB, 0x5762, 0x55EC, 0x618A, 0x615B, 0x60F3, 0x608C, 0x605D, 0x6531, 0x71A6, 0x82AE, 0x953C, 0xA644,
0xB2B9, 0xB78D, 0xB099, 0x9F8B, 0x8A17, 0x75F2, 0x68D1, 0x61C5, 0x5BFC, 0x5757, 0x53B6, 0x50F8, 0x4F00, 0x4DAB,
0x4CDC, 0x4C72, 0x4C4D, 0x4C4F, 0x44EA, 0x4548, 0x4618, 0x46E7, 0x4746, 0x4727, 0x46F6, 0x46F5, 0x4767, 0x488E,
0x4AAC, 0x4E04, 0x5752, 0x67A9, 0x79CE, 0x8886, 0x8E98, 0x8DFB, 0x8C4A, 0x89BD, 0x8689, 0x82E6, 0x7F0D, 0x7B33,
0x7791, 0x745D, 0x71CF, 0x701E, 0x5808, 0x57E0, 0x5787, 0x572E, 0x5706, 0x5964, 0x5FA0, 0x6871, 0x728D, 0x7CA8,
0x857A, 0x8BB6, 0x8E14, 0x8B48, 0x8478, 0x7BFF, 0x73D4, 0x6C5A, 0x6590, 0x5F73, 0x5A02, 0x553B, 0x511D, 0x4DA5,
0x4AD3, 0x48A4, 0x4717, 0x462A, 0x0000, 0x0001, 0x0003, 0x0004, 0x0005, 0x0006, 0x0008, 0x000C, 0x0010, 0x0016,
0x001C, 0x0023, 0x002B, 0x0033, 0x003B, 0x0043, 0x004B, 0x0052, 0x0059, 0x0060, 0x0065, 0x006A, 0x006D, 0x0070,
0x0070, 0x006D, 0x0067, 0x0061, 0x0000, 0x0031, 0x009D, 0x0109, 0x013A, 0x010A, 0x0082, 0xFFAD, 0xFE96, 0xFD47,
0xFBCC, 0xFA31, 0xF87F, 0xF6C2, 0xF505, 0xF354, 0xF1B8, 0xF03D, 0xEEEF, 0xEDD8, 0xED02, 0xEC7A, 0xEC4B, 0xEF64,
0xF724, 0x0136, 0x0B49, 0x1308, 0xF709, 0xF70A, 0xF70A, 0xF70A, 0xF70A, 0xF70A, 0xF708, 0xF704, 0xF700, 0xF6FA,
0xF6F4, 0xF6ED, 0xF6E5, 0xF6DE, 0xF6D6, 0xF6CE, 0xF6C6, 0xF6BF, 0xF6B8, 0xF6B2, 0xF6AC, 0xF6A8, 0xF6A4, 0xF6A2,
0xF6A1, 0xF6B5, 0xF6E0, 0xF70B, 0xF6F4, 0xF703, 0xF725, 0xF746, 0xF756, 0xF79B, 0xF84A, 0xF92C, 0xFA0F, 0xFABD,
0xFB03, 0xFB0F, 0xFB31, 0xFB64, 0xFBA6, 0xFBF1, 0xFC42, 0xFC95, 0xFCE7, 0xFD32, 0xFD73, 0xFDA7, 0xFDC9, 0xFDD5,
0xFDD5, 0xFDD5, 0xFDD5, 0xFDD5, 0x0889, 0x087C, 0x0861, 0x0845, 0x0839, 0x084F, 0x0886, 0x08CD, 0x0915, 0x094C,
0x0962, 0x0946, 0x08F8, 0x0881, 0x07EA, 0x073D, 0x0682, 0x05C2, 0x0507, 0x045A, 0x03C3, 0x034C, 0x02FE, 0x02E2,
0x02E2, 0x02E2, 0x02E2, 0x02E2, 0x88A9, 0x8844, 0x8764, 0x8684, 0x861F, 0x8693, 0x87B6, 0x8931, 0x8AAB, 0x8BCF,
0x8C43, 0x8B6E, 0x891C, 0x8593, 0x8118, 0x7BEF, 0x765F, 0x70AD, 0x6B1D, 0x65F5, 0x6179, 0x5DF0, 0x5B9E, 0x5AC9,
0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x81DB, 0x8129, 0x7FA2, 0x7E1B, 0x7D69, 0x75D7, 0x624F, 0x479A, 0x2A81, 0x0FCC,
0xFC44, 0xF4B2, 0xF4AD, 0xF4E4, 0xF5BC, 0xF79A, 0xFAE4, 0x0000, 0x063D, 0x0C90, 0x12D3, 0x18E2, 0x1E9A, 0x23D4,
0x286D, 0x2C40, 0x2F28, 0x3102, 0xB5C5, 0xB642, 0xB757, 0xB86C, 0xB8E9, 0xB8DE, 0xB90B, 0xB9EB, 0xBBF4, 0xBFA1,
0xC568, 0xCDC4, 0xDA66, 0xEA5B, 0xFA1D, 0x0626, 0x0AF1, 0x0A62, 0x08D6, 0x0680, 0x0392, 0x0040, 0xFCBB, 0xF936,
0xF5E3, 0xF2F5, 0xF09F, 0xEF14, 0x9AE3, 0x9B27, 0x9BBD, 0x9C54, 0x9C98, 0xA3E9, 0xB6C8, 0xD095, 0xECB1, 0x067E,
0x195D, 0x20AE, 0x1E1E, 0x1774, 0x0E3C, 0x0401, 0xFA4D, 0xF187, 0xE91F, 0xE126, 0xD9B1, 0xD2D4, 0xCCA1, 0xC72C,
0xC28A, 0xBECD, 0xBC0A, 0xBA53, 0x0E70, 0x0E20, 0x0D72, 0x0CC3, 0x0C74, 0x0C48, 0x0BCA, 0x0B00, 0x09F3, 0x08A9,
0x072B, 0x0580, 0x03AF, 0x01C0, 0xFFBB, 0xFDA6, 0xFB8A, 0xF96E, 0xF75A, 0xF554, 0xF365, 0xF195, 0xEFE9, 0xEE6B,
0xED22, 0xEC14, 0xEB4B, 0xEACC, 0xEB55, 0xEB43, 0xEB1B, 0xEAF3, 0xEAE1, 0xEB25, 0xEBE6, 0xED12, 0xEE97, 0xF063,
0xF265, 0xF48A, 0xF6C1, 0xF8F8, 0xFB1E, 0xFD1F, 0xFEEC, 0x0071, 0x019D, 0x025E, 0x02A2, 0x0147, 0xFDB5, 0xF8A8,
0xF2DE, 0xED14, 0xE807, 0xE475, 0xFF4F, 0xFF39, 0xFF07, 0xFED5, 0xFEBE, 0xFE95, 0xFE1E, 0xFD65, 0xFC71, 0xFB4E,
0xFA04, 0xF89E, 0xF724, 0xF5A0, 0xF41D, 0xF2A3, 0xF13D, 0xEFF3, 0xEED0, 0xEDDC, 0xED23, 0xECAC, 0xEC83, 0xED25,
0xEEBC, 0xF0CC, 0xF2DC, 0xF473, 0x0000, 0xFF29, 0xFCEA, 0xF9AA, 0xF5CF, 0xF1C0, 0xEDE5, 0xEAA5, 0xE866, 0xE78F,
0xE869, 0xEAA0, 0xEDB3, 0xF123, 0xF46E, 0xF714, 0xF895, 0xF98E, 0xFAD5, 0xFC40, 0xFDA4, 0xFED7, 0xFFAF, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0695, 0x068E, 0x067A, 0x065A, 0x062F, 0x05FB, 0x05BF, 0x057C, 0x0534, 0x04E7,
0x0496, 0x0444, 0x03F2, 0x03A0, 0x0350, 0x0303, 0x02BA, 0x0277, 0x023B, 0x0207, 0x01DC, 0x01BC, 0x01A8, 0x01A1,
0x01A1, 0x01A1, 0x01A1, 0x01A1, 0xEF42, 0xF024, 0xF279, 0xF5C5, 0xF98D, 0xFD54, 0x00A0, 0x02F5, 0x03D7, 0x03D7,
0x03D7, 0x03D7, 0x03B7, 0x035D, 0x02D5, 0x022B, 0x016A, 0x009E, 0xFFD1, 0xFF10, 0xFE66, 0xFDDF, 0xFD85, 0xFD64,
0xFD64, 0xFD64, 0xFD64, 0xFD64,
};
static JointIndex sChildZeldaAnim_0169B4JointIndices[18] = {
{ 0x0004, 0x0020, 0x0002 },
{ 0x0002, 0x003C, 0x0002 },
{ 0x0058, 0x0074, 0x0090 },
{ 0x00AC, 0x00C8, 0x00E4 },
{ 0x0002, 0x0002, 0x0100 },
{ 0x011C, 0x0138, 0x0154 },
{ 0x0002, 0x0002, 0x0170 },
{ 0x018C, 0x01A8, 0x01C4 },
{ 0x01E0, 0x01FC, 0x0218 },
{ 0x0234, 0x0250, 0x026C },
{ 0x0288, 0x02A4, 0x0003 },
{ 0x02C0, 0x02DC, 0x02F8 },
{ 0x0314, 0x0330, 0x034C },
{ 0x0368, 0x0384, 0x03A0 },
{ 0x03BC, 0x03D8, 0x03F4 },
{ 0x0410, 0x042C, 0x0448 },
{ 0x0464, 0x0480, 0x049C },
{ 0x04B8, 0x04D4, 0x04F0 },
};
AnimationHeader gChildZeldaAnim_0169B4 = { { 28 }, sChildZeldaAnim_0169B4FrameData, sChildZeldaAnim_0169B4JointIndices, 4 };
static u8 unaccounted_0169C4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_016D08FrameData[358] = {
0x086F, 0x0989, 0x0000, 0xBF06, 0xF4EC, 0xC043, 0x4000, 0x099C, 0x8BD2, 0x618A, 0x44EA, 0x5808, 0xF709, 0xF6F4,
0x88A9, 0x81DB, 0xB5C5, 0x9AE3, 0x0E70, 0xEB55, 0xFF4F, 0x0989, 0x098A, 0x098B, 0x098E, 0x0991, 0x0994, 0x0997,
0x099B, 0x099E, 0x09A1, 0x09A3, 0x09A4, 0x09A5, 0x09A4, 0x09A3, 0x09A1, 0x099E, 0x099B, 0x0997, 0x0994, 0x0991,
0x098E, 0x098B, 0x098A, 0xFC11, 0xFC1A, 0xFC35, 0xFC5D, 0xFC90, 0xFCCA, 0xFD09, 0xFD48, 0xFD86, 0xFDBC, 0xFDE9,
0xFE06, 0xFE11, 0xFE06, 0xFDE9, 0xFDBC, 0xFD86, 0xFD48, 0xFD09, 0xFCCA, 0xFC90, 0xFC5D, 0xFC35, 0xFC1A, 0x1BDB,
0x1BCB, 0x1B9C, 0x1B55, 0x1AFB, 0x1A94, 0x1A25, 0x19B4, 0x1948, 0x18E7, 0x1899, 0x1864, 0x1851, 0x1864, 0x1899,
0x18E7, 0x1948, 0x19B4, 0x1A25, 0x1A94, 0x1AFB, 0x1B55, 0x1B9C, 0x1BCB, 0xFC53, 0xFC5D, 0xFC77, 0xFC9F, 0xFCD2,
0xFD0C, 0xFD4B, 0xFD8A, 0xFDC8, 0xFDFE, 0xFE2A, 0xFE48, 0xFE53, 0xFE48, 0xFE2A, 0xFDFE, 0xFDC8, 0xFD8A, 0xFD4B,
0xFD0C, 0xFCD2, 0xFC9F, 0xFC77, 0xFC5D, 0x1BD4, 0x1BC4, 0x1B95, 0x1B4E, 0x1AF4, 0x1A8D, 0x1A1E, 0x19AD, 0x1940,
0x18DF, 0x1891, 0x185C, 0x1849, 0x185C, 0x1891, 0x18DF, 0x1940, 0x19AD, 0x1A1E, 0x1A8D, 0x1AF4, 0x1B4E, 0x1B95,
0x1BC4, 0x0248, 0x025B, 0x0290, 0x02E0, 0x0345, 0x03B6, 0x042F, 0x04A8, 0x0519, 0x057E, 0x05CE, 0x0603, 0x0616,
0x0603, 0x05CE, 0x057E, 0x0519, 0x04A8, 0x042F, 0x03B6, 0x0345, 0x02E0, 0x0290, 0x025B, 0x0A98, 0x0A6A, 0x09EC,
0x092D, 0x083D, 0x072D, 0x060D, 0x04EE, 0x03DE, 0x02EE, 0x022F, 0x01B1, 0x0183, 0x01B1, 0x022F, 0x02EE, 0x03DE,
0x04EE, 0x060D, 0x072D, 0x083D, 0x092D, 0x09EC, 0x0A6A, 0xFE20, 0xFE43, 0xFEA3, 0xFF32, 0xFFE4, 0x00A9, 0x0175,
0x023B, 0x02EC, 0x037B, 0x03DB, 0x03FE, 0x03E5, 0x039E, 0x0333, 0x02AB, 0x020F, 0x0166, 0x00B9, 0x0010, 0xFF73,
0xFEEB, 0xFE80, 0xFE39, 0x0051, 0x004D, 0x0041, 0x0030, 0x001A, 0x0001, 0xFFE7, 0xFFCD, 0xFFB4, 0xFF9E, 0xFF8C,
0xFF81, 0xFF7D, 0xFF81, 0xFF8C, 0xFF9E, 0xFFB4, 0xFFCD, 0xFFE7, 0x0001, 0x001A, 0x0030, 0x0041, 0x004D, 0xF832,
0xF838, 0xF848, 0xF860, 0xF87F, 0xF8A3, 0xF8CA, 0xF8F1, 0xF918, 0xF93B, 0xF95A, 0xF973, 0xF983, 0xF989, 0xF981,
0xF96B, 0xF94A, 0xF922, 0xF8F5, 0xF8C6, 0xF899, 0xF870, 0xF850, 0xF83A, 0x0889, 0x0880, 0x0869, 0x0847, 0x081B,
0x07EA, 0x07B5, 0x0781, 0x074F, 0x0724, 0x0701, 0x06EA, 0x06E1, 0x06EA, 0x0701, 0x0724, 0x074F, 0x0781, 0x07B5,
0x07EA, 0x081B, 0x0847, 0x0869, 0x0880, 0x0000, 0x0003, 0x000C, 0x001A, 0x002B, 0x003F, 0x0053, 0x0068, 0x007B,
0x008C, 0x009A, 0x00A3, 0x00A6, 0x00A3, 0x009A, 0x008C, 0x007B, 0x0068, 0x0053, 0x003F, 0x002B, 0x001A, 0x000C,
0x0003, 0x0695, 0x0695, 0x0694, 0x0694, 0x0693, 0x0692, 0x0691, 0x0690, 0x068F, 0x068E, 0x068E, 0x068D, 0x068D,
0x068D, 0x068E, 0x068E, 0x068F, 0x0690, 0x0691, 0x0692, 0x0693, 0x0694, 0x0694, 0x0695, 0xEF42, 0xEF3D, 0xEF2F,
0xEF19, 0xEEFE, 0xEEDF, 0xEEBE, 0xEE9E, 0xEE7F, 0xEE64, 0xEE4E, 0xEE40, 0xEE3B, 0xEE40, 0xEE4E, 0xEE64, 0xEE7F,
0xEE9E, 0xEEBE, 0xEEDF, 0xEEFE, 0xEF19, 0xEF2F, 0xEF3D, 0x0000,
};
static JointIndex sChildZeldaAnim_016D08JointIndices[18] = {
{ 0x0000, 0x0015, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x0004, 0x0005 },
{ 0x0002, 0x0002, 0x002D },
{ 0x0002, 0x0002, 0x0045 },
{ 0x0002, 0x0002, 0x005D },
{ 0x0002, 0x0002, 0x0075 },
{ 0x0002, 0x0002, 0x008D },
{ 0x0002, 0x0002, 0x00A5 },
{ 0x0002, 0x0002, 0x00BD },
{ 0x0006, 0x00D5, 0x0006 },
{ 0x0007, 0x00ED, 0x0008 },
{ 0x0009, 0x000A, 0x000B },
{ 0x0002, 0x0002, 0x000C },
{ 0x000D, 0x0105, 0x000E },
{ 0x000F, 0x0010, 0x0011 },
{ 0x0012, 0x0013, 0x0014 },
{ 0x011D, 0x0135, 0x014D },
};
AnimationHeader gChildZeldaAnim_016D08 = { { 24 }, sChildZeldaAnim_016D08FrameData, sChildZeldaAnim_016D08JointIndices, 21 };
static u8 unaccounted_016D18[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01726CFrameData[624] = {
0x0000, 0x0963, 0x0002, 0x4000, 0x0963, 0x0966, 0x096A, 0x096F, 0x0974, 0x0979, 0x097F, 0x0985, 0x098C, 0x0992,
0x0998, 0x099F, 0x09A5, 0x09AB, 0x09B0, 0x09B5, 0x09BA, 0x09BE, 0x09C1, 0x09C4, 0xBF2A, 0xBF2A, 0xBF2A, 0xBF2A,
0xBF2A, 0xBF2A, 0xBF2B, 0xBF2B, 0xBF2B, 0xBF2C, 0xBF2C, 0xBF2C, 0xBF2B, 0xBF2B, 0xBF2A, 0xBF2A, 0xBF29, 0xBF29,
0xBF29, 0xBF28, 0x08B2, 0x0871, 0x0823, 0x07C8, 0x0764, 0x06F7, 0x0654, 0x05A4, 0x0461, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xBFD3, 0xBFD4, 0xBFD6, 0xBFD7, 0xBFD9, 0xBFDC,
0xBFDF, 0xBFE3, 0xBFE9, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000,
0xE42D, 0xE49F, 0xE52A, 0xE5CA, 0xE67F, 0xE745, 0xE840, 0xE94F, 0xEAE4, 0xEF88, 0xF007, 0xF088, 0xF10A, 0xF18B,
0xF20A, 0xF283, 0xF2F4, 0xF35A, 0xF3B2, 0xF3F7, 0x1A2F, 0x19F6, 0x19AF, 0x195B, 0x18FC, 0x1890, 0x183D, 0x17E4,
0x17E1, 0x1957, 0x187B, 0x179A, 0x16B8, 0x15D6, 0x14F9, 0x1425, 0x135F, 0x12AC, 0x1212, 0x1199, 0xE44A, 0xE4BC,
0xE547, 0xE5E8, 0xE69D, 0xE763, 0xE85E, 0xE96E, 0xEB04, 0xEFB0, 0xF02E, 0xF0AE, 0xF130, 0xF1B0, 0xF22E, 0xF2A6,
0xF316, 0xF37C, 0xF3D3, 0xF417, 0x1A5E, 0x1A24, 0x19DD, 0x1989, 0x1929, 0x18BE, 0x186A, 0x1810, 0x180A, 0x1974,
0x1899, 0x17BA, 0x16D8, 0x15F8, 0x151C, 0x144A, 0x1385, 0x12D3, 0x123A, 0x11C2, 0x000E, 0x000E, 0x000E, 0x000E,
0x000E, 0x000E, 0x000E, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
0x000B, 0x000B, 0xED17, 0xEDC6, 0xEE9A, 0xEF8E, 0xF09D, 0xF1C4, 0xF35A, 0xF50A, 0xF7CB, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFEB, 0xFFEB, 0xFFEB, 0xFFEB, 0xFFEB, 0xFFEB,
0xFFEB, 0xFFEB, 0xFFEB, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFED, 0xFFED, 0xFFED, 0xFFEE, 0xFFEE, 0xFFEE, 0xFFEF,
0x0006, 0x0005, 0x0005, 0x0005, 0x0004, 0x0004, 0x0003, 0x0003, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1075, 0x0FAD, 0x0EBC, 0x0DA6, 0x0C70, 0x0B20, 0x0976, 0x07B8,
0x054D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFF6, 0xFFF6,
0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF7, 0xFFF7, 0xFFF7, 0xFFF7, 0xFFF7, 0xFFF7, 0xFFF7, 0xFFF7,
0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFF3B, 0xFDCA, 0xFBAB, 0xF917, 0xF648, 0xF37A, 0xF0E5, 0xEEC6, 0xED55, 0xECCD,
0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xECCD, 0xFF18, 0xFFF3, 0x013E, 0x02E0,
0x04C2, 0x06CF, 0x08F6, 0x0B2C, 0x0D6D, 0x0FBD, 0x1209, 0x142D, 0x161D, 0x17D3, 0x1949, 0x1A7D, 0x1B6D, 0x1C17,
0x1C7D, 0x1CA0, 0xF307, 0xF2FA, 0xF2E6, 0xF2CF, 0xF2BB, 0xF2B2, 0xF2BF, 0xF2EC, 0xF346, 0xF3DB, 0xF4AD, 0xF5B2,
0xF6E6, 0xF842, 0xF9BA, 0xFB41, 0xFCC5, 0xFE29, 0xFF40, 0xFFCA, 0x99EE, 0x9889, 0x9675, 0x93D7, 0x90D6, 0x8D91,
0x8A24, 0x86A5, 0x8328, 0x7FBE, 0x7C62, 0x790E, 0x75D1, 0x72BA, 0x6FD2, 0x6D26, 0x6AC4, 0x68C2, 0x6749, 0x6699,
0xC355, 0xC3ED, 0xC4AA, 0xC570, 0xC62D, 0xC6DE, 0xC795, 0xC87F, 0xC9DC, 0xCC03, 0xCEE5, 0xD229, 0xD5C6, 0xD9B1,
0xDDD7, 0xE21D, 0xE65A, 0xEA49, 0xED70, 0xEF14, 0x11B2, 0x1175, 0x1115, 0x1096, 0x0FFD, 0x0F4D, 0x0E8C, 0x0DBE,
0x0CE7, 0x0C0C, 0x0B30, 0x0A59, 0x098B, 0x08CA, 0x081B, 0x0782, 0x0703, 0x06A3, 0x0666, 0x0650, 0xE5D9, 0xE64F,
0xE708, 0xE7FD, 0xE924, 0xEA76, 0xEBEA, 0xED78, 0xEF16, 0xF0BD, 0xF264, 0xF402, 0xF58F, 0xF703, 0xF855, 0xF97D,
0xFA72, 0xFB2B, 0xFBA0, 0xFBC9, 0x151D, 0x147C, 0x137E, 0x122F, 0x109A, 0x0ECB, 0x0CCD, 0x0AAD, 0x0875, 0x0631,
0x03EE, 0x01B6, 0xFF96, 0xFD98, 0xFBC9, 0xFA34, 0xF8E4, 0xF7E6, 0xF746, 0xF70D, 0x017C, 0x0082, 0xFF04, 0xFD1B,
0xFADD, 0xF85B, 0xF5A6, 0xF2CE, 0xEFE1, 0xECEB, 0xEA05, 0xE74D, 0xE4D3, 0xE2A4, 0xE0C7, 0xDF42, 0xDE14, 0xDD3E,
0xDCBD, 0xDC90, 0x0C90, 0x0CB9, 0x0CFA, 0x0D4A, 0x0DA4, 0x0DFF, 0x0E4F, 0x0E81, 0x0E7D, 0x0E26, 0x0D78, 0x0C86,
0x0B53, 0x09EA, 0x0857, 0x06AD, 0x0504, 0x037F, 0x0251, 0x01BD, 0x9A2E, 0x98CC, 0x96BA, 0x941A, 0x9110, 0x8DB7,
0x8A29, 0x867A, 0x82C1, 0x7F1A, 0x7B87, 0x7804, 0x74A6, 0x717F, 0x6E9D, 0x6C09, 0x69D0, 0x6801, 0x66BB, 0x662A,
0xC2F3, 0xC38A, 0xC445, 0xC509, 0xC5C3, 0xC672, 0xC727, 0xC80E, 0xC968, 0xCB88, 0xCE60, 0xD197, 0xD526, 0xD8FD,
0xDD09, 0xE12F, 0xE543, 0xE8FE, 0xEBEE, 0xED6E, 0xEE5A, 0xEEB8, 0xEF4D, 0xF012, 0xF100, 0xF210, 0xF33B, 0xF47A,
0xF5C8, 0xF71C, 0xF870, 0xF9BD, 0xFAFD, 0xFC28, 0xFD38, 0xFE25, 0xFEEA, 0xFF7F, 0xFFDE, 0xFFFF, 0x1A1F, 0x1993,
0x18B6, 0x1793, 0x1633, 0x14A0, 0x12E5, 0x110C, 0x0F1E, 0x0D27, 0x0B2F, 0x0942, 0x0768, 0x05AD, 0x041B, 0x02BB,
0x0197, 0x00BB, 0x002F, 0xFFFE, 0x1515, 0x145E, 0x133D, 0x11BF, 0x0FF2, 0x0DE2, 0x0B9D, 0x0931, 0x06AA, 0x0416,
0x0182, 0xFEFB, 0xFC8F, 0xFA4A, 0xF83A, 0xF66D, 0xF4EF, 0xF3CE, 0xF316, 0xF2D6, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0xFFFF, 0xFFFE, 0xFFFB, 0xFFF8, 0xFFF4, 0xFFF1, 0xFFEE, 0xFFEB, 0xFFEA, 0xFFE9, 0xFFEA, 0xFFEC, 0xFFF0,
0xFFF7, 0x0000, 0x0EF6, 0x10BA, 0x12D5, 0x1498, 0x1555, 0x14E1, 0x139B, 0x11A3, 0x0F19, 0x0C1D, 0x08D1, 0x0555,
0x01C8, 0xFE4B, 0xFAFF, 0xF804, 0xF57A, 0xF381, 0xF23B, 0xF1C7,
};
static JointIndex sChildZeldaAnim_01726CJointIndices[18] = {
{ 0x0000, 0x0004, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0018, 0x002C, 0x0040 },
{ 0x0000, 0x0000, 0x0054 },
{ 0x0000, 0x0000, 0x0068 },
{ 0x0000, 0x0000, 0x007C },
{ 0x0000, 0x0000, 0x0090 },
{ 0x00A4, 0x0000, 0x00B8 },
{ 0x00CC, 0x00E0, 0x00F4 },
{ 0x0108, 0x0000, 0x0002 },
{ 0x0003, 0x011C, 0x0003 },
{ 0x0130, 0x0144, 0x0158 },
{ 0x0000, 0x0000, 0x016C },
{ 0x0180, 0x0194, 0x01A8 },
{ 0x01BC, 0x01D0, 0x01E4 },
{ 0x0000, 0x0000, 0x01F8 },
{ 0x020C, 0x0220, 0x0234 },
{ 0x0248, 0x0000, 0x025C },
};
AnimationHeader gChildZeldaAnim_01726C = { { 20 }, sChildZeldaAnim_01726CFrameData, sChildZeldaAnim_01726CJointIndices, 4 };
static u8 unaccounted_01727C[4] = {
0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_017818FrameData[662] = {
0x0000, 0x09C4, 0xC000, 0x4000, 0xECCD, 0x0650, 0xFBC9, 0xF70D, 0xFFFF, 0xFFFE, 0xF2D6, 0x09C4, 0x09C3, 0x09C2,
0x09C1, 0x09BF, 0x09BD, 0x09BA, 0x09B8, 0x09B6, 0x09B3, 0x09B1, 0x09AF, 0x09AD, 0x09AC, 0x09AB, 0x09AB, 0x09AB,
0x09AC, 0x09AD, 0x09AE, 0x09AF, 0x09B1, 0x09B3, 0x09B5, 0x09B7, 0x09B9, 0x09BB, 0x09BE, 0x09C0, 0x09C2, 0x09C4,
0xBF28, 0xBF28, 0xBF27, 0xBF27, 0xBF26, 0xBF26, 0xBF25, 0xBF25, 0xBF24, 0xBF23, 0xBF23, 0xBF22, 0xBF22, 0xBF21,
0xBF21, 0xBF20, 0xBF20, 0xBF1F, 0xBF1F, 0xBF1E, 0xBF1D, 0xBF1D, 0xBF1C, 0xBF1C, 0xBF1B, 0xBF1B, 0xBF1A, 0xBF1A,
0xBF19, 0xBF19, 0xBF18, 0xF3F7, 0xF3E5, 0xF3C7, 0xF39E, 0xF36D, 0xF336, 0xF2FC, 0xF2C0, 0xF285, 0xF24D, 0xF219,
0xF1EC, 0xF1C5, 0xF1A8, 0xF195, 0xF18E, 0xF192, 0xF19F, 0xF1B3, 0xF1CD, 0xF1EE, 0xF215, 0xF240, 0xF26F, 0xF2A2,
0xF2D8, 0xF310, 0xF349, 0xF383, 0xF3BC, 0xF3F4, 0x1199, 0x11B7, 0x11EC, 0x1234, 0x128B, 0x12EB, 0x1351, 0x13B9,
0x141F, 0x1482, 0x14DC, 0x152C, 0x156F, 0x15A2, 0x15C3, 0x15CF, 0x15C7, 0x15B2, 0x158F, 0x1560, 0x1526, 0x14E3,
0x1498, 0x1445, 0x13EB, 0x138D, 0x132B, 0x12C6, 0x1261, 0x11FD, 0x119B, 0xF417, 0xF406, 0xF3E8, 0xF3C0, 0xF38F,
0xF359, 0xF31F, 0xF2E4, 0xF2AA, 0xF272, 0xF23F, 0xF212, 0xF1EC, 0xF1CF, 0xF1BC, 0xF1B5, 0xF1BA, 0xF1C6, 0xF1DA,
0xF1F5, 0xF216, 0xF23C, 0xF267, 0xF296, 0xF2C9, 0xF2FE, 0xF336, 0xF36F, 0xF3A8, 0xF3E1, 0xF419, 0x11C2, 0x11E0,
0x1215, 0x125C, 0x12B2, 0x1311, 0x1376, 0x13DE, 0x1444, 0x14A5, 0x14FF, 0x154F, 0x1591, 0x15C4, 0x15E5, 0x15F0,
0x15E9, 0x15D3, 0x15B1, 0x1582, 0x1549, 0x1506, 0x14BB, 0x1468, 0x1410, 0x13B2, 0x1350, 0x12ED, 0x1288, 0x1224,
0x11C3, 0x000B, 0x000B, 0x000B, 0x000B, 0x000A, 0x000A, 0x000A, 0x000A, 0x0009, 0x0009, 0x0009, 0x0009, 0x0008,
0x0008, 0x0008, 0x0008, 0x0007, 0x0007, 0x0007, 0x0007, 0x0006, 0x0006, 0x0006, 0x0006, 0x0005, 0x0005, 0x0005,
0x0005, 0x0004, 0x0004, 0x0004, 0xFFEF, 0xFFEF, 0xFFEF, 0xFFF0, 0xFFF0, 0xFFF0, 0xFFF1, 0xFFF1, 0xFFF1, 0xFFF2,
0xFFF2, 0xFFF3, 0xFFF3, 0xFFF3, 0xFFF4, 0xFFF4, 0xFFF4, 0xFFF5, 0xFFF5, 0xFFF6, 0xFFF6, 0xFFF6, 0xFFF7, 0xFFF7,
0xFFF8, 0xFFF8, 0xFFF8, 0xFFF9, 0xFFF9, 0xFFF9, 0xFFFA, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF9, 0xFFF9, 0xFFF9,
0xFFF9, 0xFFF9, 0xFFF9, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFFA, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB,
0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x1CA0,
0x1C9F, 0x1C9E, 0x1C9B, 0x1C98, 0x1C94, 0x1C8F, 0x1C8B, 0x1C86, 0x1C81, 0x1C7C, 0x1C78, 0x1C74, 0x1C71, 0x1C6F,
0x1C6E, 0x1C6F, 0x1C70, 0x1C72, 0x1C75, 0x1C78, 0x1C7C, 0x1C80, 0x1C84, 0x1C88, 0x1C8D, 0x1C91, 0x1C95, 0x1C99,
0x1C9D, 0x1CA0, 0xFFCA, 0xFFBD, 0xFFA6, 0xFF87, 0xFF63, 0xFF3B, 0xFF11, 0xFEE7, 0xFEBE, 0xFE97, 0xFE74, 0xFE55,
0xFE3B, 0xFE27, 0xFE1B, 0xFE16, 0xFE19, 0xFE21, 0xFE2F, 0xFE41, 0xFE57, 0xFE71, 0xFE8F, 0xFEAF, 0xFED3, 0xFEF9,
0xFF21, 0xFF4B, 0xFF75, 0xFFA0, 0xFFCA, 0x6699, 0x66A8, 0x66C2, 0x66E5, 0x670E, 0x673C, 0x676C, 0x679C, 0x67CA,
0x67F7, 0x681F, 0x6843, 0x6860, 0x6877, 0x6885, 0x688A, 0x6887, 0x687D, 0x686E, 0x6859, 0x6840, 0x6822, 0x6800,
0x67DB, 0x67B2, 0x6787, 0x6759, 0x672A, 0x66FA, 0x66C9, 0x6699, 0xEF14, 0xEEE5, 0xEE94, 0xEE26, 0xEDA4, 0xED15,
0xEC7E, 0xEBE6, 0xEB52, 0xEAC5, 0xEA43, 0xE9D2, 0xE973, 0xE92B, 0xE8FD, 0xE8ED, 0xE8F7, 0xE916, 0xE947, 0xE989,
0xE9DA, 0xEA3A, 0xEAA6, 0xEB1D, 0xEB9E, 0xEC28, 0xECB8, 0xED4D, 0xEDE5, 0xEE7D, 0xEF14, 0xDC90, 0xDC91, 0xDC92,
0xDC94, 0xDC96, 0xDC99, 0xDC9C, 0xDC9F, 0xDCA3, 0xDCA6, 0xDCAA, 0xDCAD, 0xDCAF, 0xDCB2, 0xDCB3, 0xDCB3, 0xDCB3,
0xDCB2, 0xDCB1, 0xDCAF, 0xDCAD, 0xDCAA, 0xDCA7, 0xDCA4, 0xDCA1, 0xDC9E, 0xDC9B, 0xDC98, 0xDC95, 0xDC93, 0xDC90,
0x01BD, 0x01CB, 0x01E4, 0x0206, 0x022E, 0x025A, 0x0289, 0x02B8, 0x02E7, 0x0313, 0x033B, 0x035E, 0x037C, 0x0393,
0x03A1, 0x03A6, 0x03A3, 0x0399, 0x038A, 0x0375, 0x035C, 0x033E, 0x031C, 0x02F7, 0x02CF, 0x02A4, 0x0277, 0x0249,
0x021A, 0x01EB, 0x01BD, 0x662A, 0x6636, 0x6649, 0x6663, 0x6682, 0x66A4, 0x66C8, 0x66ED, 0x6710, 0x6732, 0x6751,
0x676C, 0x6783, 0x6794, 0x679F, 0x67A3, 0x67A0, 0x6799, 0x678D, 0x677D, 0x676A, 0x6753, 0x6739, 0x671D, 0x66FE,
0x66DD, 0x66BB, 0x6697, 0x6673, 0x664E, 0x662A, 0xED6E, 0xED44, 0xECF9, 0xEC95, 0xEC1E, 0xEB9A, 0xEB0F, 0xEA81,
0xE9F6, 0xE972, 0xE8F9, 0xE88E, 0xE834, 0xE7F0, 0xE7C5, 0xE7B5, 0xE7BF, 0xE7DC, 0xE80B, 0xE849, 0xE896, 0xE8F0,
0xE955, 0xE9C5, 0xEA3E, 0xEABE, 0xEB44, 0xEBCE, 0xEC59, 0xECE5, 0xED6E, 0x0000, 0x000E, 0x0024, 0x003F, 0x005E,
0x007E, 0x009F, 0x00BF, 0x00DB, 0x00F2, 0x0103, 0x010F, 0x0118, 0x011E, 0x0122, 0x0123, 0x0122, 0x011E, 0x0118,
0x010F, 0x0103, 0x00F2, 0x00DC, 0x00C0, 0x00A2, 0x0081, 0x0061, 0x0043, 0x0027, 0x0011, 0x0000, 0x0AAB, 0x0AB0,
0x0ABF, 0x0AD4, 0x0AEF, 0x0B0B, 0x0B28, 0x0B42, 0x0B58, 0x0B67, 0x0B6C, 0x0B6C, 0x0B6C, 0x0B6C, 0x0B6C, 0x0B6C,
0x0B6C, 0x0B6C, 0x0B6C, 0x0B6C, 0x0B6C, 0x0B67, 0x0B58, 0x0B42, 0x0B28, 0x0B0B, 0x0AEF, 0x0AD4, 0x0ABF, 0x0AB0,
0x0AAB, 0xF1C7, 0xF1E1, 0xF226, 0xF28C, 0xF308, 0xF38E, 0xF415, 0xF491, 0xF4F7, 0xF53C, 0xF555, 0xF555, 0xF555,
0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF53C, 0xF4F7, 0xF491, 0xF415, 0xF38E, 0xF308,
0xF28C, 0xF226, 0xF1E1, 0xF1C7,
};
static JointIndex sChildZeldaAnim_017818JointIndices[18] = {
{ 0x0000, 0x000B, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x002A, 0x0000, 0x0002 },
{ 0x0000, 0x0000, 0x0049 },
{ 0x0000, 0x0000, 0x0068 },
{ 0x0000, 0x0000, 0x0087 },
{ 0x0000, 0x0000, 0x00A6 },
{ 0x00C5, 0x0000, 0x0000 },
{ 0x00E4, 0x0000, 0x0000 },
{ 0x0103, 0x0000, 0x0122 },
{ 0x0003, 0x0004, 0x0003 },
{ 0x0141, 0x0160, 0x017F },
{ 0x0000, 0x0000, 0x019E },
{ 0x0005, 0x0006, 0x0007 },
{ 0x01BD, 0x01DC, 0x01FB },
{ 0x0000, 0x0000, 0x021A },
{ 0x0008, 0x0009, 0x000A },
{ 0x0239, 0x0258, 0x0277 },
};
AnimationHeader gChildZeldaAnim_017818 = { { 31 }, sChildZeldaAnim_017818FrameData, sChildZeldaAnim_017818JointIndices, 11 };
static u8 unaccounted_017828[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01805CFrameData[992] = {
0x086F, 0x09AE, 0x0000, 0xE6D3, 0xC5A4, 0xFFC4, 0xBF21, 0xFFEE, 0x09AE, 0x09AD, 0x09AC, 0x09A9, 0x09A6, 0x09A2,
0x099E, 0x099B, 0x0997, 0x0994, 0x0991, 0x0990, 0x098F, 0x0990, 0x0991, 0x0994, 0x0997, 0x099B, 0x099E, 0x09A2,
0x09A6, 0x09A9, 0x09AC, 0x09AD, 0xFFE4, 0xFFE4, 0xFFE3, 0xFFE3, 0xFFE2, 0xFFE1, 0xFFE0, 0xFFDF, 0xFFDF, 0xFFDE,
0xFFDD, 0xFFDD, 0xFFDD, 0xFFDD, 0xFFDD, 0xFFDE, 0xFFDF, 0xFFDF, 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE3, 0xFFE4,
0x0059, 0x0059, 0x0059, 0x0059, 0x005A, 0x005A, 0x005A, 0x005B, 0x005B, 0x005B, 0x005B, 0x005B, 0x005C, 0x005B,
0x005B, 0x005B, 0x005B, 0x005B, 0x005A, 0x005A, 0x005A, 0x0059, 0x0059, 0x0059, 0xF555, 0xF548, 0xF525, 0xF4F0,
0xF4AF, 0xF466, 0xF41B, 0xF3D1, 0xF38D, 0xF352, 0xF323, 0xF305, 0xF2FA, 0xF305, 0xF323, 0xF352, 0xF38D, 0xF3D1,
0xF41B, 0xF466, 0xF4AF, 0xF4F0, 0xF525, 0xF548, 0x1660, 0x1677, 0x16B6, 0x1714, 0x1788, 0x180A, 0x1890, 0x1913,
0x198D, 0x19F6, 0x1A49, 0x1A80, 0x1A93, 0x1A80, 0x1A49, 0x19F6, 0x198D, 0x1913, 0x1890, 0x180A, 0x1788, 0x1714,
0x16B6, 0x1677, 0x0097, 0x0098, 0x009B, 0x009F, 0x00A3, 0x00A8, 0x00AE, 0x00B3, 0x00B8, 0x00BC, 0x00BF, 0x00C1,
0x00C2, 0x00C1, 0x00BF, 0x00BC, 0x00B8, 0x00B3, 0x00AE, 0x00A8, 0x00A3, 0x009F, 0x009B, 0x0098, 0xFDA7, 0xFDA8,
0xFDA8, 0xFDA8, 0xFDA9, 0xFDAA, 0xFDAA, 0xFDAB, 0xFDAC, 0xFDAC, 0xFDAD, 0xFDAD, 0xFDAD, 0xFDAD, 0xFDAD, 0xFDAC,
0xFDAC, 0xFDAB, 0xFDAA, 0xFDAA, 0xFDA9, 0xFDA8, 0xFDA8, 0xFDA8, 0xF0D6, 0xF0C6, 0xF099, 0xF056, 0xF004, 0xEFAA,
0xEF4D, 0xEEF3, 0xEEA0, 0xEE58, 0xEE20, 0xEDFB, 0xEDEE, 0xEDFB, 0xEE20, 0xEE58, 0xEEA0, 0xEEF3, 0xEF4D, 0xEFAA,
0xF004, 0xF056, 0xF099, 0xF0C6, 0x11DA, 0x11F7, 0x1244, 0x12B8, 0x1344, 0x13DF, 0x147F, 0x1519, 0x15A7, 0x1622,
0x1682, 0x16C0, 0x16D7, 0x16C0, 0x1682, 0x1622, 0x15A7, 0x1519, 0x147F, 0x13DF, 0x1344, 0x12B8, 0x1244, 0x11F7,
0xFBCA, 0xFBCC, 0xFBD3, 0xFBDC, 0xFBE8, 0xFBF6, 0xFC05, 0xFC13, 0xFC21, 0xFC2D, 0xFC37, 0xFC3D, 0xFC3F, 0xFC3D,
0xFC37, 0xFC2D, 0xFC21, 0xFC13, 0xFC05, 0xFBF6, 0xFBE8, 0xFBDC, 0xFBD3, 0xFBCC, 0xFD26, 0xFD24, 0xFD21, 0xFD1B,
0xFD14, 0xFD0C, 0xFD04, 0xFCFB, 0xFCF3, 0xFCED, 0xFCE7, 0xFCE3, 0xFCE2, 0xFCE3, 0xFCE7, 0xFCED, 0xFCF3, 0xFCFB,
0xFD04, 0xFD0C, 0xFD14, 0xFD1B, 0xFD21, 0xFD24, 0xFCB6, 0xFC98, 0xFC43, 0xFBC4, 0xFB24, 0xFA6F, 0xF9B0, 0xF8F0,
0xF83B, 0xF79B, 0xF71C, 0xF6C8, 0xF6A9, 0xF6C8, 0xF71C, 0xF79B, 0xF83B, 0xF8F0, 0xF9B0, 0xFA6F, 0xFB24, 0xFBC4,
0xFC43, 0xFC98, 0x0000, 0x0002, 0x0009, 0x0013, 0x0020, 0x002E, 0x003E, 0x004D, 0x005B, 0x0068, 0x0072, 0x0079,
0x007B, 0x0079, 0x0072, 0x0068, 0x005B, 0x004D, 0x003E, 0x002E, 0x0020, 0x0013, 0x0009, 0x0002, 0x01CB, 0x01CB,
0x01CA, 0x01C8, 0x01C7, 0x01C5, 0x01C2, 0x01C0, 0x01BE, 0x01BD, 0x01BB, 0x01BA, 0x01BA, 0x01BA, 0x01BB, 0x01BD,
0x01BE, 0x01C0, 0x01C2, 0x01C5, 0x01C7, 0x01C8, 0x01CA, 0x01CB, 0x020A, 0x0241, 0x02DC, 0x03C5, 0x04EA, 0x0636,
0x0795, 0x08F5, 0x0A41, 0x0B65, 0x0C4F, 0x0CE9, 0x0D21, 0x0CE9, 0x0C4F, 0x0B65, 0x0A41, 0x08F5, 0x0795, 0x0636,
0x04EA, 0x03C5, 0x02DC, 0x0241, 0x0000, 0x0001, 0x0003, 0x0005, 0x0009, 0x000D, 0x0012, 0x0016, 0x001A, 0x001E,
0x0021, 0x0022, 0x0023, 0x0022, 0x0021, 0x001E, 0x001A, 0x0016, 0x0012, 0x000D, 0x0009, 0x0005, 0x0003, 0x0001,
0x0000, 0xFFFF, 0xFFFD, 0xFFFA, 0xFFF6, 0xFFF1, 0xFFEC, 0xFFE7, 0xFFE3, 0xFFDF, 0xFFDB, 0xFFD9, 0xFFD9, 0xFFD9,
0xFFDB, 0xFFDF, 0xFFE3, 0xFFE7, 0xFFEC, 0xFFF1, 0xFFF6, 0xFFFA, 0xFFFD, 0xFFFF, 0x02B0, 0x0296, 0x024C, 0x01DD,
0x0151, 0x00B2, 0x000B, 0xFF63, 0xFEC4, 0xFE39, 0xFDC9, 0xFD7F, 0xFD65, 0xFD7F, 0xFDC9, 0xFE39, 0xFEC4, 0xFF63,
0x000B, 0x00B2, 0x0151, 0x01DD, 0x024C, 0x0296, 0x3593, 0x3593, 0x3594, 0x3594, 0x3595, 0x3596, 0x3596, 0x3597,
0x3597, 0x3598, 0x3598, 0x3598, 0x3598, 0x3598, 0x3598, 0x3598, 0x3597, 0x3597, 0x3596, 0x3596, 0x3595, 0x3594,
0x3594, 0x3593, 0x008F, 0x008B, 0x0081, 0x0071, 0x005E, 0x0048, 0x0031, 0x001A, 0x0004, 0xFFF1, 0xFFE1, 0xFFD7,
0xFFD3, 0xFFD7, 0xFFE1, 0xFFF1, 0x0004, 0x001A, 0x0031, 0x0048, 0x005E, 0x0071, 0x0081, 0x008B, 0x3F6C, 0x3F6F,
0x3F79, 0x3F88, 0x3F9B, 0x3FB0, 0x3FC6, 0x3FDD, 0x3FF2, 0x4005, 0x4013, 0x401D, 0x4021, 0x401D, 0x4013, 0x4005,
0x3FF2, 0x3FDD, 0x3FC6, 0x3FB0, 0x3F9B, 0x3F88, 0x3F79, 0x3F6F, 0xFA75, 0xFA69, 0xFA45, 0xFA10, 0xF9CE, 0xF982,
0xF932, 0xF8E2, 0xF896, 0xF854, 0xF81F, 0xF7FB, 0xF7EF, 0xF7FB, 0xF81F, 0xF854, 0xF896, 0xF8E2, 0xF932, 0xF982,
0xF9CE, 0xFA10, 0xFA45, 0xFA69, 0x88C2, 0x88C2, 0x88C2, 0x88C2, 0x88C2, 0x88C2, 0x88C3, 0x88C3, 0x88C3, 0x88C3,
0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C3, 0x88C2, 0x88C2, 0x88C2, 0x88C2, 0x88C2,
0x8928, 0x8927, 0x8925, 0x8923, 0x8920, 0x891C, 0x8918, 0x8914, 0x8910, 0x890D, 0x890A, 0x8909, 0x8908, 0x8909,
0x890A, 0x890D, 0x8910, 0x8914, 0x8918, 0x891C, 0x8920, 0x8923, 0x8925, 0x8927, 0x8250, 0x823C, 0x8204, 0x81B0,
0x8147, 0x80D0, 0x8051, 0x7FD3, 0x7F5B, 0x7EF2, 0x7E9E, 0x7E67, 0x7E52, 0x7E67, 0x7E9E, 0x7EF2, 0x7F5B, 0x7FD3,
0x8051, 0x80D0, 0x8147, 0x81B0, 0x8204, 0x823C, 0x7270, 0x7262, 0x723A, 0x71FE, 0x71B3, 0x715D, 0x7103, 0x70A8,
0x7053, 0x7008, 0x6FCC, 0x6FA4, 0x6F96, 0x6FA4, 0x6FCC, 0x7008, 0x7053, 0x70A8, 0x7103, 0x715D, 0x71B3, 0x71FE,
0x723A, 0x7262, 0xF3D2, 0xF3D3, 0xF3D6, 0xF3DB, 0xF3E1, 0xF3E8, 0xF3EF, 0xF3F7, 0xF3FE, 0xF404, 0xF409, 0xF40C,
0xF40D, 0xF40C, 0xF409, 0xF404, 0xF3FE, 0xF3F7, 0xF3EF, 0xF3E8, 0xF3E1, 0xF3DB, 0xF3D6, 0xF3D3, 0xF6B4, 0xF6CA,
0xF706, 0xF760, 0xF7D1, 0xF851, 0xF8D9, 0xF961, 0xF9E1, 0xFA52, 0xFAAC, 0xFAE8, 0xFAFE, 0xFAE8, 0xFAAC, 0xFA52,
0xF9E1, 0xF961, 0xF8D9, 0xF851, 0xF7D1, 0xF760, 0xF706, 0xF6CA, 0xFDBA, 0xFDB3, 0xFDA1, 0xFD85, 0xFD62, 0xFD3A,
0xFD10, 0xFCE6, 0xFCBE, 0xFC9B, 0xFC7F, 0xFC6D, 0xFC66, 0xFC6D, 0xFC7F, 0xFC9B, 0xFCBE, 0xFCE6, 0xFD10, 0xFD3A,
0xFD62, 0xFD85, 0xFDA1, 0xFDB3, 0x0432, 0x0432, 0x0433, 0x0434, 0x0436, 0x0438, 0x043A, 0x043D, 0x043F, 0x0441,
0x0442, 0x0443, 0x0443, 0x0443, 0x0442, 0x0441, 0x043F, 0x043D, 0x043A, 0x0438, 0x0436, 0x0434, 0x0433, 0x0432,
0x095A, 0x0966, 0x0989, 0x09BE, 0x0A00, 0x0A4C, 0x0A9B, 0x0AEB, 0x0B36, 0x0B78, 0x0BAD, 0x0BD0, 0x0BDD, 0x0BD0,
0x0BAD, 0x0B78, 0x0B36, 0x0AEB, 0x0A9B, 0x0A4C, 0x0A00, 0x09BE, 0x0989, 0x0966, 0x8808, 0x880A, 0x880D, 0x8813,
0x881A, 0x8822, 0x882B, 0x8833, 0x883C, 0x8843, 0x8848, 0x884C, 0x884E, 0x884C, 0x8848, 0x8843, 0x883C, 0x8833,
0x882B, 0x8822, 0x881A, 0x8813, 0x880D, 0x880A, 0x9B14, 0x9B16, 0x9B1B, 0x9B23, 0x9B2D, 0x9B38, 0x9B44, 0x9B50,
0x9B5B, 0x9B64, 0x9B6C, 0x9B71, 0x9B73, 0x9B71, 0x9B6C, 0x9B64, 0x9B5B, 0x9B50, 0x9B44, 0x9B38, 0x9B2D, 0x9B23,
0x9B1B, 0x9B16, 0x8167, 0x8180, 0x81C4, 0x822C, 0x82AE, 0x8341, 0x83DD, 0x8479, 0x850D, 0x858F, 0x85F6, 0x863B,
0x8654, 0x863B, 0x85F6, 0x858F, 0x850D, 0x8479, 0x83DD, 0x8341, 0x82AE, 0x822C, 0x81C4, 0x8180, 0x6D6F, 0x6D5B,
0x6D25, 0x6CD3, 0x6C6C, 0x6BF7, 0x6B7B, 0x6AFF, 0x6A8A, 0x6A23, 0x69D1, 0x699A, 0x6987, 0x699A, 0x69D1, 0x6A23,
0x6A8A, 0x6AFF, 0x6B7B, 0x6BF7, 0x6C6C, 0x6CD3, 0x6D25, 0x6D5B, 0xF654, 0xF654, 0xF655, 0xF656, 0xF657, 0xF659,
0xF65B, 0xF65D, 0xF65E, 0xF660, 0xF661, 0xF662, 0xF662, 0xF662, 0xF661, 0xF660, 0xF65E, 0xF65D, 0xF65B, 0xF659,
0xF657, 0xF656, 0xF655, 0xF654, 0xF91C, 0xF924, 0xF938, 0xF958, 0xF980, 0xF9AD, 0xF9DD, 0xFA0C, 0xFA39, 0xFA61,
0xFA81, 0xFA96, 0xFA9D, 0xFA96, 0xFA81, 0xFA61, 0xFA39, 0xFA0C, 0xF9DD, 0xF9AD, 0xF980, 0xF958, 0xF938, 0xF924,
0xFDA5, 0xFDA3, 0xFD9E, 0xFD96, 0xFD8C, 0xFD81, 0xFD76, 0xFD6A, 0xFD5F, 0xFD55, 0xFD4D, 0xFD48, 0xFD47, 0xFD48,
0xFD4D, 0xFD55, 0xFD5F, 0xFD6A, 0xFD76, 0xFD81, 0xFD8C, 0xFD96, 0xFD9E, 0xFDA3, 0xEA4B, 0xEA4C, 0xEA4C, 0xEA4C,
0xEA4D, 0xEA4D, 0xEA4E, 0xEA4E, 0xEA4F, 0xEA4F, 0xEA50, 0xEA50, 0xEA50, 0xEA50, 0xEA50, 0xEA4F, 0xEA4F, 0xEA4E,
0xEA4E, 0xEA4D, 0xEA4D, 0xEA4C, 0xEA4C, 0xEA4C, 0x0010, 0x000F, 0x000C, 0x0007, 0x0001, 0xFFFA, 0xFFF3, 0xFFEC,
0xFFE5, 0xFFDF, 0xFFDB, 0xFFD7, 0xFFD6, 0xFFD7, 0xFFDB, 0xFFDF, 0xFFE5, 0xFFEC, 0xFFF3, 0xFFFA, 0x0001, 0x0007,
0x000C, 0x000F, 0x085B, 0x084F, 0x082F, 0x07FE, 0x07C1, 0x077C, 0x0733, 0x06E9, 0x06A4, 0x0667, 0x0636, 0x0616,
0x060A, 0x0616, 0x0636, 0x0667, 0x06A4, 0x06E9, 0x0733, 0x077C, 0x07C1, 0x07FE, 0x082F, 0x084F,
};
static JointIndex sChildZeldaAnim_01805CJointIndices[18] = {
{ 0x0000, 0x0008, 0x0002 },
{ 0x0002, 0x0003, 0x0002 },
{ 0x0004, 0x0005, 0x0006 },
{ 0x0020, 0x0038, 0x0050 },
{ 0x0002, 0x0002, 0x0068 },
{ 0x0080, 0x0098, 0x00B0 },
{ 0x0002, 0x0002, 0x00C8 },
{ 0x00E0, 0x00F8, 0x0110 },
{ 0x0128, 0x0140, 0x0158 },
{ 0x0170, 0x0188, 0x01A0 },
{ 0x01B8, 0x01D0, 0x01E8 },
{ 0x0007, 0x0200, 0x0218 },
{ 0x0230, 0x0248, 0x0260 },
{ 0x0278, 0x0290, 0x02A8 },
{ 0x02C0, 0x02D8, 0x02F0 },
{ 0x0308, 0x0320, 0x0338 },
{ 0x0350, 0x0368, 0x0380 },
{ 0x0398, 0x03B0, 0x03C8 },
};
AnimationHeader gChildZeldaAnim_01805C = { { 24 }, sChildZeldaAnim_01805CFrameData, sChildZeldaAnim_01805CJointIndices, 8 };
static u8 unaccounted_01806C[4] = {
0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_018898FrameData[990] = {
0x086F, 0x09AE, 0x0000, 0x086F, 0x086F, 0x086F, 0x086F, 0x084E, 0x07FA, 0x0787, 0x070A, 0x0697, 0x0643, 0x0622,
0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x0622, 0x09AE, 0x09A6, 0x0997, 0x098E,
0x0990, 0x0994, 0x099A, 0x09A0, 0x09A5, 0x09A9, 0x09AB, 0x09AA, 0x09A8, 0x09A6, 0x09A3, 0x099F, 0x099B, 0x0998,
0x0995, 0x0992, 0x0990, 0xE6D3, 0xE5BC, 0xE2C9, 0xDE70, 0xD928, 0xD369, 0xCDAA, 0xC863, 0xC40A, 0xC116, 0xC000,
0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC5A4, 0xC57C, 0xC510, 0xC470,
0xC3AD, 0xC2D8, 0xC203, 0xC13D, 0xC09A, 0xC02B, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002,
0xC002, 0xC002, 0xC002, 0xFFC4, 0xFFDC, 0x001D, 0x007C, 0x00EF, 0x016D, 0x01EB, 0x025F, 0x02BE, 0x02FF, 0x0317,
0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0x0317, 0xBF21, 0xBF19, 0xBF05, 0xBEE7,
0xBEC2, 0xBE9B, 0xBE73, 0xBE4F, 0xBE31, 0xBE1D, 0xBE15, 0xBE15, 0xBE15, 0xBE15, 0xBE15, 0xBE15, 0xBE15, 0xBE15,
0xBE15, 0xBE15, 0xBE15, 0xFFE4, 0xFFDF, 0xFFD4, 0xFFC2, 0xFFCA, 0xFFE5, 0xFFE9, 0xFFDA, 0x0000, 0xFFFE, 0x0000,
0xFFFE, 0x0000, 0xFFFE, 0x0000, 0x0000, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0059, 0x0060, 0x0078, 0x00A3,
0x0090, 0x004D, 0x004D, 0x00BF, 0x0188, 0x0246, 0x0297, 0x0297, 0x0298, 0x029A, 0x029B, 0x029D, 0x029F, 0x02A1,
0x02A3, 0x02A4, 0x02A5, 0xF555, 0xF4A7, 0xF373, 0xF2C7, 0xF36A, 0xF59A, 0xF973, 0xFF2E, 0x090E, 0x0A28, 0x0AC4,
0x0A9F, 0x0AC7, 0x0AA6, 0x0AD1, 0x0AD7, 0x0AB8, 0x0ABE, 0x0AC2, 0x0AC8, 0x0ACA, 0x1660, 0x1788, 0x1984, 0x1A6C,
0x19E2, 0x1847, 0x14D5, 0x0E5A, 0x0000, 0x0042, 0x0000, 0x0043, 0x0000, 0x0043, 0x0000, 0x0000, 0x0042, 0x0042,
0x0043, 0x0042, 0x0043, 0x0097, 0x00AA, 0x00D6, 0x0104, 0x0142, 0x0198, 0x01D7, 0x01E1, 0x01B5, 0x0175, 0x0155,
0x0159, 0x0164, 0x0174, 0x0187, 0x019C, 0x01AF, 0x01C2, 0x01D2, 0x01DF, 0x01E7, 0xFDA7, 0xFD88, 0xFD2F, 0xFCA7,
0xFBA9, 0xFA53, 0xF930, 0xF88D, 0xF86F, 0xF898, 0xF8B5, 0xF8B5, 0xF8B6, 0xF8B7, 0xF8B9, 0xF8BA, 0xF8BC, 0xF8BE,
0xF8C0, 0xF8C1, 0xF8C2, 0xF0D6, 0xEFEF, 0xEE4D, 0xED4E, 0xED7B, 0xEE86, 0xF071, 0xF314, 0xF602, 0xF887, 0xF9A0,
0xF989, 0xF94D, 0xF8F6, 0xF88F, 0xF823, 0xF7B7, 0xF754, 0xF6FE, 0xF6BB, 0xF68F, 0x11DA, 0x130F, 0x14EC, 0x1547,
0x1463, 0x13BB, 0x12F5, 0x11B5, 0x0FE4, 0x0DF0, 0x0CF8, 0x0D20, 0x0D8B, 0x0E25, 0x0EDC, 0x0F9D, 0x105C, 0x110D,
0x11A5, 0x121D, 0x126C, 0xFBCA, 0xFB83, 0xFAD4, 0xF9F2, 0xF916, 0xF7FB, 0xF6CA, 0xF659, 0xF6AF, 0xF73B, 0xF7ED,
0xF8B4, 0xF982, 0xFA46, 0xFAF1, 0xFB74, 0xFBC8, 0xFBFA, 0xFC12, 0xFC18, 0xFC16, 0xFD26, 0xFCFC, 0xFC98, 0xFC1D,
0xFBAE, 0xFB33, 0xFAB8, 0xFA9A, 0xFADD, 0xFB3E, 0xFBB3, 0xFC32, 0xFCB0, 0xFD22, 0xFD7E, 0xFDBA, 0xFDC3, 0xFD9D,
0xFD5C, 0xFD15, 0xFCDC, 0xFCB6, 0xFB7D, 0xF8D6, 0xF64D, 0xF569, 0xF80F, 0xFCBB, 0xFFD8, 0x00E0, 0x01AC, 0x023F,
0x029B, 0x02C2, 0x02B6, 0x027B, 0x0212, 0x010B, 0xFF3F, 0xFD1B, 0xFB0C, 0xF980, 0x0000, 0x0012, 0x001F, 0xFFF0,
0xFF48, 0xFDA3, 0xFB46, 0xF92B, 0xF849, 0xF8A9, 0xF993, 0xFAD7, 0xFC48, 0xFDB7, 0xFEF6, 0xFFD8, 0x0057, 0x0099,
0x00AF, 0x00AA, 0x009A, 0x01CB, 0x00DC, 0xFECF, 0xFCC1, 0xFBD2, 0xFCA7, 0xFE89, 0x008E, 0x01CB, 0x0231, 0x0259,
0x0253, 0x0232, 0x0204, 0x01DC, 0x01C9, 0x01C6, 0x01C2, 0x01BD, 0x01B8, 0x01B5, 0x020A, 0x0488, 0x09FA, 0x0F53,
0x1185, 0x0EB6, 0x08DF, 0x02B2, 0xFEE1, 0xFD6E, 0xFC84, 0xFC17, 0xFC1E, 0xFC8C, 0xFD57, 0xFE73, 0x008F, 0x03E6,
0x07C0, 0x0B64, 0x0E1B, 0x0000, 0xFFAE, 0xFEE7, 0xFDED, 0xFD05, 0xFC27, 0xFB38, 0xFA5C, 0xF9B8, 0xF954, 0xF93E,
0xF9A4, 0xFA81, 0xFB9F, 0xFCDB, 0xFE15, 0xFF2C, 0x0000, 0x0064, 0x0067, 0x0041, 0x0000, 0x00C6, 0x0281, 0x044F,
0x054E, 0x052B, 0x0466, 0x0358, 0x0258, 0x013F, 0x000B, 0xFF49, 0xFF09, 0xFEF3, 0xFEFA, 0xFF10, 0xFF26, 0xFF2F,
0xFF2F, 0xFF30, 0xFF32, 0x02B0, 0x0159, 0xFE5C, 0xFB43, 0xF99C, 0xFA29, 0xFBFA, 0xFE0C, 0xFF5C, 0xFF47, 0xFE72,
0xFDCA, 0xFDAA, 0xFDBA, 0xFDD5, 0xFDD6, 0xFD9A, 0xFCFC, 0xFB4B, 0xF8B0, 0xF64B, 0x3593, 0x35C7, 0x3670, 0x37C1,
0x3A47, 0x3D1E, 0x3F07, 0x402E, 0x40C0, 0x40EE, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0,
0x40F0, 0x40F0, 0x40F0, 0x008F, 0xFF2A, 0xFBF9, 0xF877, 0xF619, 0xF52B, 0xF4DE, 0xF4FF, 0xF559, 0xF5B7, 0xF5E3,
0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0xF5E3, 0x3F6C, 0x3FF6, 0x4129, 0x4263,
0x42F9, 0x42B5, 0x4202, 0x4116, 0x402A, 0x3F76, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E, 0x3F2E,
0x3F2E, 0x3F2E, 0x3F2E, 0xFFEE, 0x000B, 0x005A, 0x00CE, 0x015A, 0x01F3, 0x028C, 0x0318, 0x038C, 0x03DB, 0x03F8,
0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0x03F8, 0xFA75, 0xFA79, 0xFA83, 0xFA92,
0xFAA4, 0xFAB8, 0xFACB, 0xFADD, 0xFAEC, 0xFAF6, 0xFAFA, 0xFAFA, 0xFAFA, 0xFAFA, 0xFAFA, 0xFAFA, 0xFAFA, 0xFAFA,
0xFAFA, 0xFAFA, 0xFAFA, 0x88C2, 0x87D5, 0x8552, 0x819E, 0x7D1F, 0x783A, 0x7355, 0x6ED6, 0x6B22, 0x689F, 0x67B2,
0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x67B2, 0x8928, 0x8974, 0x8A4A, 0x8B8F,
0x8D2B, 0x8F05, 0x9104, 0x9310, 0x9510, 0x96EA, 0x9886, 0x99CB, 0x9AA0, 0x9AED, 0x9AED, 0x9AED, 0x9AED, 0x9AED,
0x9AED, 0x9AED, 0x9AED, 0x8250, 0x81C5, 0x8043, 0x7DF6, 0x7B0C, 0x77B2, 0x7414, 0x7060, 0x6CC2, 0x6967, 0x667E,
0x6431, 0x62AF, 0x6224, 0x6224, 0x6224, 0x6224, 0x6224, 0x6224, 0x6224, 0x6224, 0x7270, 0x7167, 0x6E86, 0x6A22,
0x6492, 0x5E2B, 0x5743, 0x5030, 0x4948, 0x42E1, 0x3D51, 0x38ED, 0x360C, 0x3503, 0x3503, 0x3503, 0x3503, 0x3503,
0x3503, 0x3503, 0x3503, 0xF3D2, 0xF3FE, 0xF47B, 0xF53D, 0xF636, 0xF75B, 0xF89F, 0xF9F6, 0xFB53, 0xFCAA, 0xFDEE,
0xFF13, 0x000C, 0x00CE, 0x014B, 0x0178, 0x0178, 0x0178, 0x0178, 0x0178, 0x0178, 0xF6B4, 0xF67D, 0xF5E0, 0xF4EF,
0xF3B8, 0xF24A, 0xF0B6, 0xEF0A, 0xED57, 0xEBAB, 0xEA17, 0xE8AA, 0xE772, 0xE681, 0xE5E4, 0xE5AD, 0xE5AD, 0xE5AD,
0xE5AD, 0xE5AD, 0xE5AD, 0xFDBA, 0xFD8A, 0xFD04, 0xFC34, 0xFB28, 0xF9EE, 0xF893, 0xF723, 0xF5AD, 0xF43D, 0xF2E2,
0xF1A7, 0xF09C, 0xEFCC, 0xEF46, 0xEF16, 0xEF16, 0xEF16, 0xEF16, 0xEF16, 0xEF16, 0x0432, 0x03FD, 0x036D, 0x0299,
0x0197, 0x007F, 0xFF67, 0xFE65, 0xFD91, 0xFD01, 0xFCCC, 0xFCCC, 0xFCCC, 0xFCCC, 0xFCCC, 0xFCCC, 0xFCCC, 0xFCCC,
0xFCCC, 0xFCCC, 0xFCCC, 0x095A, 0x093C, 0x08EA, 0x0872, 0x07DF, 0x0740, 0x06A1, 0x060F, 0x0597, 0x0545, 0x0527,
0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x0527, 0x8808, 0x86F5, 0x840C, 0x7FC1,
0x7A8A, 0x74DE, 0x6F32, 0x69FB, 0x65B0, 0x62C7, 0x61B4, 0x61B4, 0x61B4, 0x61B4, 0x61B4, 0x61B4, 0x61B4, 0x61B4,
0x61B4, 0x61B4, 0x61B4, 0x9B14, 0x9A3C, 0x97E1, 0x944A, 0x8FBD, 0x8A80, 0x84DA, 0x7F11, 0x796C, 0x742F, 0x6FA2,
0x6C0B, 0x69B0, 0x68D8, 0x68D8, 0x68D8, 0x68D8, 0x68D8, 0x68D8, 0x68D8, 0x68D8, 0x8167, 0x81EE, 0x8365, 0x85A0,
0x8874, 0x8BB6, 0x8F39, 0x92D2, 0x9655, 0x9997, 0x9C6B, 0x9EA7, 0xA01E, 0xA0A4, 0xA0A4, 0xA0A4, 0xA0A4, 0xA0A4,
0xA0A4, 0xA0A4, 0xA0A4, 0x6D6F, 0x6CA2, 0x6A67, 0x6700, 0x62B1, 0x5DBB, 0x5862, 0x52E7, 0x4D8E, 0x4898, 0x4449,
0x40E2, 0x3EA7, 0x3DDA, 0x3DDA, 0x3DDA, 0x3DDA, 0x3DDA, 0x3DDA, 0x3DDA, 0x3DDA, 0xF654, 0xF71C, 0xF94F, 0xFCB4,
0x0115, 0x063A, 0x0BE9, 0x11ED, 0x180D, 0x1E10, 0x23C0, 0x28E4, 0x2D45, 0x30AB, 0x32DE, 0x33A6, 0x33A6, 0x33A6,
0x33A6, 0x33A6, 0x33A6, 0xF91C, 0xF9E0, 0xFC09, 0xFF5F, 0x03AB, 0x08B8, 0x0E4D, 0x1434, 0x1A37, 0x201F, 0x25B4,
0x2AC0, 0x2F0D, 0x3263, 0x348B, 0x3550, 0x3550, 0x3550, 0x3550, 0x3550, 0x3550, 0xFDA5, 0xFDC6, 0xFE23, 0xFEB3,
0xFF6E, 0x0048, 0x013A, 0x0239, 0x033D, 0x043D, 0x052E, 0x0609, 0x06C3, 0x0753, 0x07B1, 0x07D2, 0x07D2, 0x07D2,
0x07D2, 0x07D2, 0x07D2, 0xEA4B, 0xEA4F, 0xEA79, 0xEAF6, 0xEBF3, 0xED9E, 0xF0BC, 0xF52B, 0xF9C5, 0xFD61, 0xFED7,
0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0x0010, 0x002F, 0x0078, 0x00CC,
0x010E, 0x011F, 0x00EC, 0x0089, 0x001A, 0xFFBE, 0xFF98, 0xFF98, 0xFF98, 0xFF98, 0xFF98, 0xFF98, 0xFF98, 0xFF98,
0xFF98, 0xFF98, 0xFF98, 0x085B, 0x086B, 0x0865, 0x07F6, 0x06C9, 0x048D, 0x0177, 0xFE42, 0xFB66, 0xF957, 0xF88E,
0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E, 0xF88E,
};
static JointIndex sChildZeldaAnim_018898JointIndices[18] = {
{ 0x0003, 0x0018, 0x0002 },
{ 0x0002, 0x002D, 0x0002 },
{ 0x0042, 0x0057, 0x006C },
{ 0x0081, 0x0096, 0x00AB },
{ 0x0002, 0x0002, 0x00C0 },
{ 0x00D5, 0x00EA, 0x00FF },
{ 0x0002, 0x0002, 0x0114 },
{ 0x0129, 0x013E, 0x0153 },
{ 0x0168, 0x017D, 0x0192 },
{ 0x01A7, 0x01BC, 0x01D1 },
{ 0x01E6, 0x01FB, 0x0210 },
{ 0x0225, 0x023A, 0x024F },
{ 0x0264, 0x0279, 0x028E },
{ 0x02A3, 0x02B8, 0x02CD },
{ 0x02E2, 0x02F7, 0x030C },
{ 0x0321, 0x0336, 0x034B },
{ 0x0360, 0x0375, 0x038A },
{ 0x039F, 0x03B4, 0x03C9 },
};
AnimationHeader gChildZeldaAnim_018898 = { { 21 }, sChildZeldaAnim_018898FrameData, sChildZeldaAnim_018898JointIndices, 3 };
static u8 unaccounted_0188A8[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01910CFrameData[1016] = {
0x0622, 0x0990, 0x0000, 0xC000, 0xC002, 0x0317, 0xBE15, 0x0990, 0x0990, 0x0992, 0x0994, 0x0997, 0x099A, 0x099D,
0x09A1, 0x09A4, 0x09A7, 0x09A9, 0x09AA, 0x09AB, 0x09AA, 0x09A9, 0x09A7, 0x09A4, 0x09A1, 0x099D, 0x099A, 0x0997,
0x0994, 0x0992, 0x0990, 0xFFFE, 0x0000, 0x0000, 0xFFFE, 0x0000, 0x0000, 0xFFFE, 0x0000, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x0000, 0xFFFE, 0xFFFE, 0x0000, 0x0000, 0x02A5,
0x02A5, 0x02A4, 0x02A3, 0x02A2, 0x02A0, 0x029E, 0x029C, 0x029B, 0x0299, 0x0298, 0x0297, 0x0297, 0x0297, 0x0298,
0x0299, 0x029B, 0x029C, 0x029E, 0x02A0, 0x02A2, 0x02A3, 0x02A4, 0x02A5, 0x0ACB, 0x0AF0, 0x0AED, 0x0AC4, 0x0AE5,
0x0ADF, 0x0AB5, 0x0AD4, 0x0AA9, 0x0AA5, 0x0AA1, 0x0A9F, 0x0A9E, 0x0A9F, 0x0AA2, 0x0AA5, 0x0AAA, 0x0AAF, 0x0AB5,
0x0ADF, 0x0AC0, 0x0AC3, 0x0AED, 0x0AF0, 0x0042, 0x0000, 0x0000, 0x0043, 0x0000, 0x0000, 0x0042, 0x0000, 0x0043,
0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0000, 0x0042, 0x0043, 0x0000,
0x0000, 0x01EA, 0x01E7, 0x01E0, 0x01D5, 0x01C7, 0x01B7, 0x01A5, 0x0192, 0x0180, 0x016F, 0x0161, 0x0157, 0x0154,
0x0157, 0x0161, 0x016F, 0x0180, 0x0192, 0x01A5, 0x01B7, 0x01C7, 0x01D5, 0x01E0, 0x01E7, 0xF8C2, 0xF8C2, 0xF8C1,
0xF8C0, 0xF8BF, 0xF8BD, 0xF8BB, 0xF8BA, 0xF8B8, 0xF8B7, 0xF8B5, 0xF8B5, 0xF8B4, 0xF8B5, 0xF8B5, 0xF8B7, 0xF8B8,
0xF8BA, 0xF8BB, 0xF8BD, 0xF8BF, 0xF8C0, 0xF8C1, 0xF8C2, 0xF67F, 0xF68C, 0xF6B2, 0xF6EC, 0xF737, 0xF78F, 0xF7EF,
0xF854, 0xF8B7, 0xF913, 0xF95F, 0xF994, 0xF9A7, 0xF994, 0xF95F, 0xF913, 0xF8B7, 0xF854, 0xF7EF, 0xF78F, 0xF737,
0xF6EC, 0xF6B2, 0xF68C, 0x1288, 0x1270, 0x122D, 0x11C5, 0x1140, 0x10A4, 0x0FF9, 0x0F45, 0x0E95, 0x0DF2, 0x0D6A,
0x0D0D, 0x0CEB, 0x0D0D, 0x0D6A, 0x0DF2, 0x0E95, 0x0F45, 0x0FF9, 0x10A4, 0x1140, 0x11C5, 0x122D, 0x1270, 0xFC13,
0xFC11, 0xFC09, 0xFBFE, 0xFBF1, 0xFBE1, 0xFBD1, 0xFBC0, 0xFBB1, 0xFBA3, 0xFB98, 0xFB91, 0xFB8E, 0xFB91, 0xFB98,
0xFBA3, 0xFBB1, 0xFBC0, 0xFBD1, 0xFBE1, 0xFBF1, 0xFBFE, 0xFC09, 0xFC11, 0xFCC4, 0xFCC8, 0xFCD2, 0xFCE2, 0xFCF6,
0xFD0D, 0xFD25, 0xFD3D, 0xFD54, 0xFD68, 0xFD77, 0xFD82, 0xFD86, 0xFD82, 0xFD77, 0xFD68, 0xFD54, 0xFD3D, 0xFD25,
0xFD0D, 0xFCF6, 0xFCE2, 0xFCD2, 0xFCC8, 0xF8E4, 0xF909, 0xF96F, 0xFA0A, 0xFACC, 0xFBA9, 0xFC92, 0xFD7B, 0xFE58,
0xFF1A, 0xFFB5, 0x001B, 0x0040, 0x001B, 0xFFB5, 0xFF1A, 0xFE58, 0xFD7B, 0xFC92, 0xFBA9, 0xFACC, 0xFA0A, 0xF96F,
0xF909, 0x0091, 0x008E, 0x0084, 0x0074, 0x0061, 0x004B, 0x0034, 0x001D, 0x0008, 0xFFF5, 0xFFE5, 0xFFDB, 0xFFD8,
0xFFDB, 0xFFE5, 0xFFF5, 0x0008, 0x001D, 0x0034, 0x004B, 0x0061, 0x0074, 0x0084, 0x008E, 0x01B3, 0x01B4, 0x01B5,
0x01B7, 0x01B9, 0x01BC, 0x01BE, 0x01C1, 0x01C4, 0x01C6, 0x01C8, 0x01C9, 0x01C9, 0x01C9, 0x01C8, 0x01C6, 0x01C4,
0x01C1, 0x01BE, 0x01BC, 0x01B9, 0x01B7, 0x01B5, 0x01B4, 0x0F2B, 0x0ED7, 0x0DEE, 0x0C8E, 0x0AD5, 0x08E1, 0x06CF,
0x04BD, 0x02C8, 0x0110, 0xFFB0, 0xFEC7, 0xFE73, 0xFEC7, 0xFFB0, 0x0110, 0x02C8, 0x04BD, 0x06CF, 0x08E1, 0x0AD5,
0x0C8E, 0x0DEE, 0x0ED7, 0x0027, 0x0027, 0x0024, 0x0020, 0x001C, 0x0016, 0x0011, 0x000B, 0x0006, 0x0001, 0xFFFD,
0xFFFB, 0xFFFA, 0xFFFB, 0xFFFD, 0x0001, 0x0006, 0x000B, 0x0011, 0x0016, 0x001C, 0x0020, 0x0024, 0x0027, 0xFF33,
0xFF33, 0xFF33, 0xFF33, 0xFF32, 0xFF32, 0xFF31, 0xFF31, 0xFF30, 0xFF30, 0xFF30, 0xFF30, 0xFF2F, 0xFF30, 0xFF30,
0xFF30, 0xFF30, 0xFF31, 0xFF31, 0xFF32, 0xFF32, 0xFF33, 0xFF33, 0xFF33, 0xF53E, 0xF56B, 0xF5E8, 0xF6A5, 0xF791,
0xF89D, 0xF9BA, 0xFAD6, 0xFBE2, 0xFCCF, 0xFD8B, 0xFE08, 0xFE35, 0xFE08, 0xFD8B, 0xFCCF, 0xFBE2, 0xFAD6, 0xF9BA,
0xF89D, 0xF791, 0xF6A5, 0xF5E8, 0xF56B, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40F0, 0x40EF, 0x40EF, 0x40EF,
0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40EF, 0x40F0, 0x40F0, 0x40F0, 0x40F0,
0x40F0, 0xF5E3, 0xF5E7, 0xF5F4, 0xF607, 0xF61E, 0xF639, 0xF655, 0xF672, 0xF68D, 0xF6A4, 0xF6B7, 0xF6C4, 0xF6C8,
0xF6C4, 0xF6B7, 0xF6A4, 0xF68D, 0xF672, 0xF655, 0xF639, 0xF61E, 0xF607, 0xF5F4, 0xF5E7, 0x3F2E, 0x3F2E, 0x3F2E,
0x3F2E, 0x3F2F, 0x3F30, 0x3F30, 0x3F31, 0x3F32, 0x3F32, 0x3F33, 0x3F33, 0x3F33, 0x3F33, 0x3F33, 0x3F32, 0x3F32,
0x3F31, 0x3F30, 0x3F30, 0x3F2F, 0x3F2E, 0x3F2E, 0x3F2E, 0x03F8, 0x03F8, 0x03F8, 0x03F9, 0x03FA, 0x03FB, 0x03FB,
0x03FC, 0x03FD, 0x03FE, 0x03FF, 0x03FF, 0x03FF, 0x03FF, 0x03FF, 0x03FE, 0x03FD, 0x03FC, 0x03FB, 0x03FB, 0x03FA,
0x03F9, 0x03F8, 0x03F8, 0xFAFA, 0xFAF0, 0xFAD4, 0xFAA9, 0xFA73, 0xFA37, 0xF9F6, 0xF9B6, 0xF97A, 0xF944, 0xF919,
0xF8FD, 0xF8F3, 0xF8FD, 0xF919, 0xF944, 0xF97A, 0xF9B6, 0xF9F6, 0xFA37, 0xFA73, 0xFAA9, 0xFAD4, 0xFAF0, 0x67B2,
0x67B1, 0x67AE, 0x67AA, 0x67A5, 0x679F, 0x6798, 0x6792, 0x678C, 0x6786, 0x6782, 0x677F, 0x677E, 0x677F, 0x6782,
0x6786, 0x678C, 0x6792, 0x6798, 0x679F, 0x67A5, 0x67AA, 0x67AE, 0x67B1, 0x9AED, 0x9AF6, 0x9B0D, 0x9B31, 0x9B5E,
0x9B92, 0x9BC8, 0x9BFE, 0x9C31, 0x9C5E, 0x9C82, 0x9C9A, 0x9CA2, 0x9C9A, 0x9C82, 0x9C5E, 0x9C31, 0x9BFE, 0x9BC8,
0x9B92, 0x9B5E, 0x9B31, 0x9B0D, 0x9AF6, 0x6224, 0x6219, 0x61FA, 0x61CC, 0x6191, 0x614F, 0x6109, 0x60C2, 0x6080,
0x6046, 0x6017, 0x5FF8, 0x5FED, 0x5FF8, 0x6017, 0x6046, 0x6080, 0x60C2, 0x6109, 0x614F, 0x6191, 0x61CC, 0x61FA,
0x6219, 0x3503, 0x3510, 0x3532, 0x3566, 0x35A8, 0x35F2, 0x3641, 0x368F, 0x36D9, 0x371B, 0x374F, 0x3771, 0x377E,
0x3771, 0x374F, 0x371B, 0x36D9, 0x368F, 0x3641, 0x35F2, 0x35A8, 0x3566, 0x3532, 0x3510, 0x0178, 0x0178, 0x0177,
0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0178, 0xE5AD, 0xE5AE, 0xE5B2, 0xE5B7, 0xE5BD, 0xE5C4, 0xE5CC,
0xE5D4, 0xE5DB, 0xE5E2, 0xE5E7, 0xE5EA, 0xE5EB, 0xE5EA, 0xE5E7, 0xE5E2, 0xE5DB, 0xE5D4, 0xE5CC, 0xE5C4, 0xE5BD,
0xE5B7, 0xE5B2, 0xE5AE, 0xEF16, 0xEF16, 0xEF16, 0xEF16, 0xEF17, 0xEF17, 0xEF17, 0xEF18, 0xEF18, 0xEF18, 0xEF19,
0xEF19, 0xEF19, 0xEF19, 0xEF19, 0xEF18, 0xEF18, 0xEF18, 0xEF17, 0xEF17, 0xEF17, 0xEF16, 0xEF16, 0xEF16, 0xFCCC,
0xFCCC, 0xFCCC, 0xFCCB, 0xFCCA, 0xFCCA, 0xFCC9, 0xFCC8, 0xFCC7, 0xFCC7, 0xFCC6, 0xFCC6, 0xFCC6, 0xFCC6, 0xFCC6,
0xFCC7, 0xFCC7, 0xFCC8, 0xFCC9, 0xFCCA, 0xFCCA, 0xFCCB, 0xFCCC, 0xFCCC, 0x0527, 0x0531, 0x054E, 0x0578, 0x05AE,
0x05EB, 0x062B, 0x066C, 0x06A8, 0x06DE, 0x0709, 0x0725, 0x072F, 0x0725, 0x0709, 0x06DE, 0x06A8, 0x066C, 0x062B,
0x05EB, 0x05AE, 0x0578, 0x054E, 0x0531, 0x61B4, 0x61B3, 0x61B1, 0x61AD, 0x61A9, 0x61A4, 0x619F, 0x619A, 0x6195,
0x6191, 0x618D, 0x618B, 0x618A, 0x618B, 0x618D, 0x6191, 0x6195, 0x619A, 0x619F, 0x61A4, 0x61A9, 0x61AD, 0x61B1,
0x61B3, 0x68D8, 0x68CE, 0x68B5, 0x688E, 0x685D, 0x6826, 0x67EB, 0x67B1, 0x677A, 0x6749, 0x6722, 0x6709, 0x66FF,
0x6709, 0x6722, 0x6749, 0x677A, 0x67B1, 0x67EB, 0x6826, 0x685D, 0x688E, 0x68B5, 0x68CE, 0xA0A4, 0xA0B1, 0xA0D4,
0xA109, 0xA14B, 0xA196, 0xA1E5, 0xA234, 0xA27F, 0xA2C1, 0xA2F6, 0xA319, 0xA326, 0xA319, 0xA2F6, 0xA2C1, 0xA27F,
0xA234, 0xA1E5, 0xA196, 0xA14B, 0xA109, 0xA0D4, 0xA0B1, 0x3DDA, 0x3DE6, 0x3E09, 0x3E3E, 0x3E7F, 0x3ECA, 0x3F19,
0x3F68, 0x3FB3, 0x3FF5, 0x4029, 0x404C, 0x4058, 0x404C, 0x4029, 0x3FF5, 0x3FB3, 0x3F68, 0x3F19, 0x3ECA, 0x3E7F,
0x3E3E, 0x3E09, 0x3DE6, 0x33A6, 0x33D7, 0x3460, 0x352E, 0x3631, 0x3756, 0x388D, 0x39C4, 0x3AE9, 0x3BEB, 0x3CBA,
0x3D42, 0x3D74, 0x3D42, 0x3CBA, 0x3BEB, 0x3AE9, 0x39C4, 0x388D, 0x3756, 0x3631, 0x352E, 0x3460, 0x33D7, 0x3550,
0x3552, 0x3559, 0x3563, 0x356F, 0x357E, 0x358D, 0x359C, 0x35AA, 0x35B7, 0x35C1, 0x35C7, 0x35CA, 0x35C7, 0x35C1,
0x35B7, 0x35AA, 0x359C, 0x358D, 0x357E, 0x356F, 0x3563, 0x3559, 0x3552, 0x07D2, 0x0805, 0x0892, 0x0967, 0x0A72,
0x0BA1, 0x0CE3, 0x0E24, 0x0F53, 0x105E, 0x1133, 0x11C0, 0x11F3, 0x11C0, 0x1133, 0x105E, 0x0F53, 0x0E24, 0x0CE3,
0x0BA1, 0x0A72, 0x0967, 0x0892, 0x0805, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED7, 0xFED6, 0xFED6, 0xFED6, 0xFED5,
0xFED5, 0xFED5, 0xFED5, 0xFED5, 0xFED5, 0xFED5, 0xFED5, 0xFED5, 0xFED6, 0xFED6, 0xFED6, 0xFED7, 0xFED7, 0xFED7,
0xFED7, 0xFF98, 0xFF98, 0xFF99, 0xFF9A, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9E, 0xFF9E, 0xFF9F, 0xFFA0, 0xFFA0, 0xFFA1,
0xFFA0, 0xFFA0, 0xFF9F, 0xFF9E, 0xFF9E, 0xFF9C, 0xFF9B, 0xFF9A, 0xFF9A, 0xFF99, 0xFF98, 0xF88E, 0xF893, 0xF8A3,
0xF8BB, 0xF8D9, 0xF8FB, 0xF920, 0xF944, 0xF966, 0xF984, 0xF99C, 0xF9AC, 0xF9B2, 0xF9AC, 0xF99C, 0xF984, 0xF966,
0xF944, 0xF920, 0xF8FB, 0xF8D9, 0xF8BB, 0xF8A3, 0xF893, 0x0000,
};
static JointIndex sChildZeldaAnim_01910CJointIndices[18] = {
{ 0x0000, 0x0007, 0x0002 },
{ 0x0002, 0x0003, 0x0002 },
{ 0x0004, 0x0005, 0x0006 },
{ 0x001F, 0x0037, 0x004F },
{ 0x0002, 0x0002, 0x0067 },
{ 0x007F, 0x0097, 0x00AF },
{ 0x0002, 0x0002, 0x00C7 },
{ 0x00DF, 0x00F7, 0x010F },
{ 0x0127, 0x013F, 0x0157 },
{ 0x016F, 0x0187, 0x019F },
{ 0x01B7, 0x01CF, 0x01E7 },
{ 0x01FF, 0x0217, 0x022F },
{ 0x0247, 0x025F, 0x0277 },
{ 0x028F, 0x02A7, 0x02BF },
{ 0x02D7, 0x02EF, 0x0307 },
{ 0x031F, 0x0337, 0x034F },
{ 0x0367, 0x037F, 0x0397 },
{ 0x03AF, 0x03C7, 0x03DF },
};
AnimationHeader gChildZeldaAnim_01910C = { { 24 }, sChildZeldaAnim_01910CFrameData, sChildZeldaAnim_01910CJointIndices, 7 };
static u8 unaccounted_01911C[4] = {
0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_019600FrameData[570] = {
0x0000, 0x0990, 0xFFCE, 0x8000, 0xE71C, 0x4000, 0x31C7, 0xF1C7, 0xC38E, 0x0990, 0x098D, 0x0987, 0x0980, 0x0979,
0x0971, 0x096B, 0x0965, 0x0961, 0x0960, 0x0961, 0x0965, 0x096B, 0x0971, 0x0979, 0x0980, 0x0987, 0x098D, 0x0990,
0x0992, 0xC000, 0xC000, 0xC000, 0xC002, 0xC003, 0xC003, 0xC004, 0xC005, 0xC006, 0xC007, 0xC007, 0xC008, 0xC008,
0xC008, 0xC008, 0xC007, 0xC006, 0xC004, 0xC002, 0xC000, 0x005F, 0x00B6, 0x0136, 0x0188, 0x01F7, 0x025D, 0x0277,
0x02AD, 0x02CE, 0x02D9, 0x02CB, 0x02A6, 0x026E, 0x0252, 0x01EC, 0x017C, 0x0129, 0x00AA, 0x0053, 0x0032, 0xC000,
0xC000, 0xC000, 0xC000, 0xC001, 0xC001, 0xC001, 0xC001, 0xC001, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002, 0xC002,
0xC001, 0xC001, 0xC001, 0xC000, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0xEC52, 0xEBB5, 0xEAD0,
0xE9F9, 0xE901, 0xE816, 0xE778, 0xE6DE, 0xE679, 0xE656, 0xE67E, 0xE6E7, 0xE785, 0xE827, 0xE915, 0xEA10, 0xEAEA,
0xEBD1, 0xEC71, 0xECAD, 0x154D, 0x159E, 0x1612, 0x16CF, 0x1784, 0x183A, 0x190C, 0x199C, 0x19FE, 0x1A21, 0x19FD,
0x199A, 0x1908, 0x1834, 0x177C, 0x16C2, 0x1600, 0x1587, 0x1530, 0x150F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000,
0x0000, 0xEC50, 0xEBB1, 0xEACA, 0xE9F2, 0xE8F8, 0xE80C, 0xE76C, 0xE6D1, 0xE66B, 0xE647, 0xE66E, 0xE6D6, 0xE773,
0xE813, 0xE901, 0xE9FA, 0xEAD3, 0xEBB9, 0xEC59, 0xEC95, 0x1550, 0x15A4, 0x161B, 0x16DB, 0x1792, 0x184A, 0x191D,
0x19AF, 0x1A12, 0x1A37, 0x1A15, 0x19B4, 0x1924, 0x1853, 0x179C, 0x16E5, 0x1626, 0x15AF, 0x155A, 0x153A, 0xF121,
0xF038, 0xEEE1, 0xEDDC, 0xEC94, 0xEB66, 0xEAB2, 0xE9F6, 0xE97B, 0xE950, 0xE97E, 0xE9FC, 0xEABA, 0xEB6F, 0xEC9E,
0xEDE6, 0xEEEC, 0xF042, 0xF12B, 0xF182, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFE,
0xFFFE, 0xFFFE, 0xFFFD, 0xFFFD, 0xFFFC, 0xFFFC, 0xFFFC, 0xFFFB, 0xFFFB, 0xFFFA, 0xFFFA, 0x0C16, 0x0D14, 0x0E8B,
0x0FD0, 0x1150, 0x12B4, 0x13E8, 0x14DF, 0x1583, 0x15BF, 0x1586, 0x14E5, 0x13F1, 0x12C0, 0x115D, 0x0FDE, 0x0E9A,
0x0D23, 0x0C24, 0x0BC6, 0x02BA, 0x0267, 0x01EC, 0x0158, 0x00B6, 0x0014, 0xFF80, 0xFF06, 0xFEB2, 0xFE94, 0xFEAF,
0xFEF8, 0xFF64, 0xFFEA, 0x007F, 0x0119, 0x01AC, 0x022F, 0x0296, 0x02D8, 0x3FFC, 0x3FF2, 0x3FE2, 0x3FCE, 0x3FB7,
0x3F9E, 0x3F84, 0x3F6A, 0x3F52, 0x3F3D, 0x3F2C, 0x3F1F, 0x3F19, 0x3F1B, 0x3F25, 0x3F38, 0x3F57, 0x3F82, 0x3FBA,
0x4000, 0x1685, 0x16B2, 0x16F1, 0x173B, 0x1786, 0x17CB, 0x1803, 0x1826, 0x1830, 0x1819, 0x17DE, 0x1787, 0x1721,
0x16B5, 0x164F, 0x15FD, 0x15C9, 0x15C1, 0x15F5, 0x1674, 0xF087, 0xF055, 0xF00C, 0xEFB4, 0xEF54, 0xEEF4, 0xEE9A,
0xEE4E, 0xEE16, 0xEDF8, 0xEDFB, 0xEE19, 0xEE4F, 0xEE97, 0xEEEC, 0xEF4A, 0xEFA9, 0xF005, 0xF057, 0xF099, 0x4761,
0x4750, 0x4737, 0x4718, 0x46F6, 0x46D4, 0x46B7, 0x46A1, 0x4699, 0x46A3, 0x46C1, 0x46EE, 0x4724, 0x475B, 0x478C,
0x47B2, 0x47C6, 0x47C4, 0x47A6, 0x4767, 0xD93A, 0xD8F5, 0xD88F, 0xD815, 0xD791, 0xD70D, 0xD692, 0xD629, 0xD5DA,
0xD5AC, 0xD5A5, 0xD5C1, 0xD5FD, 0xD654, 0xD6C0, 0xD73C, 0xD7C3, 0xD84E, 0xD8D6, 0xD954, 0xE78D, 0xE78F, 0xE793,
0xE796, 0xE799, 0xE79A, 0xE799, 0xE796, 0xE78F, 0xE785, 0xE777, 0xE768, 0xE758, 0xE74B, 0xE740, 0xE73B, 0xE73E,
0xE74B, 0xE764, 0xE78B, 0x105D, 0x105F, 0x1060, 0x1061, 0x105F, 0x105B, 0x1053, 0x1047, 0x1037, 0x1021, 0x1006,
0x0FE8, 0x0FCB, 0x0FB3, 0x0FA3, 0x0F9F, 0x0FAC, 0x0FCD, 0x1006, 0x105C, 0x472D, 0x471C, 0x4703, 0x46E3, 0x46BF,
0x4699, 0x4673, 0x4651, 0x4635, 0x4624, 0x461E, 0x4623, 0x4631, 0x4647, 0x4663, 0x4684, 0x46AA, 0x46D4, 0x4702,
0x4733, 0xD893, 0xD86E, 0xD838, 0xD7F9, 0xD7B8, 0xD77C, 0xD74A, 0xD727, 0xD71A, 0xD727, 0xD751, 0xD792, 0xD7E2,
0xD838, 0xD88C, 0xD8D4, 0xD904, 0xD913, 0xD8F6, 0xD8A2, 0xCE3F, 0xCE51, 0xCE6B, 0xCE8A, 0xCEAC, 0xCECE, 0xCEED,
0xCF07, 0xCF19, 0xCF1F, 0xCF19, 0xCF07, 0xCEED, 0xCECE, 0xCEAC, 0xCE8A, 0xCE6B, 0xCE51, 0xCE3F, 0xCE39, 0x0E32,
0x0E1F, 0x0E04, 0x0DE3, 0x0DBF, 0x0D9A, 0x0D79, 0x0D5E, 0x0D4B, 0x0D44, 0x0D4B, 0x0D5E, 0x0D79, 0x0D9A, 0x0DBF,
0x0DE3, 0x0E04, 0x0E1F, 0x0E32, 0x0E39, 0x0001, 0x0004, 0x0008, 0x000D, 0x0013, 0x0019, 0x0020, 0x0027, 0x002D,
0x0032, 0x0037, 0x003A, 0x003B, 0x003B, 0x0038, 0x0033, 0x002C, 0x0021, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0001, 0x0001, 0x0000, 0xEAAB, 0xEAAC, 0xEAAD, 0xEAAF, 0xEAB1, 0xEAB3, 0xEAB5, 0xEAB7, 0xEAB9, 0xEABB, 0xEABC,
0xEABD, 0xEABE, 0xEABD, 0xEABD, 0xEABB, 0xEAB8, 0xEAB5, 0xEAB0, 0xEAAB, 0x0000,
};
static JointIndex sChildZeldaAnim_019600JointIndices[18] = {
{ 0x0000, 0x0009, 0x0002 },
{ 0x0000, 0x0003, 0x0000 },
{ 0x001D, 0x0031, 0x0045 },
{ 0x0000, 0x0059, 0x006D },
{ 0x0000, 0x0000, 0x0081 },
{ 0x0000, 0x0095, 0x00A9 },
{ 0x0000, 0x0000, 0x00BD },
{ 0x0000, 0x0000, 0x00D1 },
{ 0x00E5, 0x0000, 0x00F9 },
{ 0x0000, 0x0000, 0x010D },
{ 0x0121, 0x0004, 0x0005 },
{ 0x0135, 0x0149, 0x015D },
{ 0x0000, 0x0000, 0x0171 },
{ 0x0006, 0x0007, 0x0008 },
{ 0x0185, 0x0199, 0x01AD },
{ 0x0000, 0x0000, 0x01C1 },
{ 0x01D5, 0x01E9, 0x0008 },
{ 0x01FD, 0x0211, 0x0225 },
};
AnimationHeader gChildZeldaAnim_019600 = { { 20 }, sChildZeldaAnim_019600FrameData, sChildZeldaAnim_019600JointIndices, 9 };
static s16 sChildZeldaAnim_01991CFrameData[336] = {
0x0001, 0x09DE, 0x0000, 0xBF0F, 0xC000, 0x4000, 0x09DE, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF, 0x09DF,
0x09DE, 0x09DE, 0x09DE, 0x09DD, 0x09DD, 0x09DD, 0x09DD, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF738, 0xF751, 0xF762, 0xF76C, 0xF76F, 0xF76C,
0xF765, 0xF75B, 0xF74F, 0xF742, 0xF735, 0xF729, 0xF71F, 0xF718, 0xF716, 0x0BE0, 0x0BB3, 0x0B95, 0x0B84, 0x0B7F,
0x0B84, 0x0B90, 0x0BA2, 0x0BB8, 0x0BCF, 0x0BE7, 0x0BFC, 0x0C0D, 0x0C19, 0x0C1D, 0xF759, 0xF773, 0xF784, 0xF78D,
0xF790, 0xF78D, 0xF786, 0xF77C, 0xF770, 0xF763, 0xF756, 0xF74A, 0xF740, 0xF739, 0xF737, 0x0C04, 0x0BD7, 0x0BB9,
0x0BA9, 0x0BA3, 0x0BA8, 0x0BB4, 0x0BC6, 0x0BDB, 0x0BF3, 0x0C0A, 0x0C1F, 0x0C30, 0x0C3C, 0x0C40, 0xFF7F, 0xFEBD,
0xFD92, 0xFC10, 0xFA4B, 0xF856, 0xF645, 0xF429, 0xF218, 0xF023, 0xEE5E, 0xECDC, 0xEBB1, 0xEAEF, 0xEAAB, 0x0181,
0x03E8, 0x086F, 0x0E56, 0x14D9, 0x1B5C, 0x2101, 0x245B, 0x23A9, 0x1DF2, 0x1CA5, 0x208E, 0x21D5, 0x23FF, 0x24C9,
0xF547, 0xF504, 0xF399, 0xF105, 0xEDC6, 0xEAC0, 0xE8EF, 0xE919, 0xEBCE, 0xF1DF, 0xF615, 0xF6BE, 0xF864, 0xF8C5,
0xF8EB, 0x7DED, 0x8333, 0x863F, 0x869D, 0x8465, 0x7F9F, 0x78EA, 0x71BA, 0x6BFB, 0x68E8, 0x6374, 0x5B93, 0x5647,
0x51F0, 0x505E, 0xFFAE, 0xF128, 0xE4A4, 0xDA5C, 0xD164, 0xC9AC, 0xC351, 0xBE81, 0xBB5E, 0xB9E7, 0xB9E3, 0xBAE2,
0xBC4F, 0xBD89, 0xBE07, 0x003F, 0x00EF, 0x01FF, 0x035E, 0x04FA, 0x06C2, 0x08A4, 0x0A8F, 0x0C71, 0x0E39, 0x0FD5,
0x1134, 0x1244, 0x12F5, 0x1333, 0xFFB3, 0xFEDC, 0xFD8F, 0xFBE2, 0xF9EB, 0xF7BD, 0xF570, 0xF318, 0xF0CB, 0xEE9E,
0xECA6, 0xEAF9, 0xE9AC, 0xE8D5, 0xE889, 0xFF6C, 0xFDCA, 0xFB44, 0xF804, 0xF433, 0xEFFB, 0xEB84, 0xE6F9, 0xE282,
0xDE4A, 0xDA79, 0xD739, 0xD4B3, 0xD312, 0xD27D, 0xE5E4, 0xE5D0, 0xE5A9, 0xE570, 0xE524, 0xE4BE, 0xE435, 0xE382,
0xE2A0, 0xE190, 0xE05D, 0xDF1A, 0xDDE9, 0xDCF4, 0xDC6F, 0x0E43, 0x0DB0, 0x0CDD, 0x0BDE, 0x0ACD, 0x09BF, 0x08C8,
0x07F4, 0x074C, 0x06CF, 0x067D, 0x064E, 0x063C, 0x0641, 0x0659, 0x60A3, 0x60E5, 0x611E, 0x612C, 0x60ED, 0x6047,
0x5F2E, 0x5DA6, 0x5BBD, 0x5992, 0x574C, 0x551C, 0x5338, 0x51DB, 0x5141, 0xA470, 0xA51B, 0xA633, 0xA7B2, 0xA990,
0xABC2, 0xAE33, 0xB0CE, 0xB378, 0xB616, 0xB888, 0xBAAD, 0xBC61, 0xBD81, 0xBDE9, 0xFFD9, 0xFF6A, 0xFEBE, 0xFDE1,
0xFCDE, 0xFBBF, 0xFA8F, 0xF95A, 0xF82B, 0xF70C, 0xF608, 0xF52B, 0xF480, 0xF411, 0xF3E9, 0x0057, 0x014C, 0x02C6,
0x04AD, 0x06EA, 0x0963, 0x0C01, 0x0EAA, 0x1148, 0x13C1, 0x15FD, 0x17E5, 0x195F, 0x1A54, 0x1AAB, 0xFF6C, 0xFDCA,
0xFB44, 0xF804, 0xF433, 0xEFFB, 0xEB84, 0xE6F9, 0xE282, 0xDE4A, 0xDA79, 0xD739, 0xD4B3, 0xD312, 0xD27D, 0x06C0,
0x05BB, 0x0427, 0x021F, 0xFFBD, 0xFD19, 0xFA4F, 0xF778, 0xF4AE, 0xF20B, 0xEFA8, 0xEDA0, 0xEC0D, 0xEB07, 0xEAAB,
};
static JointIndex sChildZeldaAnim_01991CJointIndices[18] = {
{ 0x0000, 0x0006, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x0015, 0x0004 },
{ 0x0002, 0x0002, 0x0024 },
{ 0x0002, 0x0002, 0x0033 },
{ 0x0002, 0x0002, 0x0042 },
{ 0x0002, 0x0002, 0x0051 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0005, 0x0060, 0x0005 },
{ 0x006F, 0x007E, 0x008D },
{ 0x0002, 0x0002, 0x009C },
{ 0x00AB, 0x00BA, 0x00C9 },
{ 0x00D8, 0x00E7, 0x00F6 },
{ 0x0002, 0x0002, 0x0105 },
{ 0x0114, 0x0123, 0x0132 },
{ 0x0002, 0x0002, 0x0141 },
};
AnimationHeader gChildZeldaAnim_01991C = { { 15 }, sChildZeldaAnim_01991CFrameData, sChildZeldaAnim_01991CJointIndices, 6 };
static u8 unaccounted_01992C[4] = {
0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01A2FCFrameData[1200] = {
0x086F, 0x09AE, 0x0000, 0x4000, 0x086F, 0x086E, 0x086E, 0x086E, 0x086E, 0x084F, 0x0804, 0x07A1, 0x073F, 0x06F3,
0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5, 0x06D5,
0x06D5, 0x06D5, 0x09AE, 0x09A3, 0x098C, 0x0974, 0x096A, 0x0972, 0x0988, 0x09A5, 0x09C1, 0x09D7, 0x09DF, 0x09DF,
0x09DC, 0x09D9, 0x09D5, 0x09D0, 0x09CA, 0x09C4, 0x09BD, 0x09B7, 0x09B1, 0x09AB, 0x09A6, 0x09A2, 0x099E, 0x099C,
0x0000, 0x0000, 0x0000, 0x0000, 0xFEEC, 0xFBEC, 0xF759, 0xF18D, 0xEAE1, 0xE3AF, 0xDC51, 0xD51F, 0xCE73, 0xC8A7,
0xC414, 0xC114, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xBF09, 0xBF08,
0xBF06, 0xBF06, 0xBF0C, 0xBEEF, 0xBEAD, 0xBE7C, 0xBE7C, 0xBE9E, 0xBEC1, 0xBEE0, 0xBEF7, 0xBF05, 0xBF0C, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xF6F5, 0xF731, 0xF7C1, 0xF874,
0xF915, 0xF9AB, 0xFA57, 0xFB09, 0xFBAD, 0xFC46, 0xFCDD, 0xFD6C, 0xFDEF, 0xFE5F, 0xFEB8, 0xFEF1, 0xFF06, 0xFF06,
0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xFF06, 0xC036, 0xC034, 0xC02F, 0xC02A, 0xC027, 0xC0FA,
0xC2CB, 0xC49A, 0xC56B, 0xC52C, 0xC48E, 0xC3B1, 0xC2B4, 0xC1B8, 0xC0DC, 0xC041, 0xC006, 0xC006, 0xC006, 0xC006,
0xC006, 0xC006, 0xC006, 0xC006, 0xC006, 0xC006, 0x0000, 0xFFE8, 0xFF9C, 0xFF1A, 0xFE86, 0xFDFF, 0xFDCC, 0xFE36,
0xFF18, 0xFFFB, 0x0000, 0xFFC8, 0xFFBE, 0xFFD2, 0xFFF0, 0x000B, 0x0018, 0x001A, 0x001B, 0x001D, 0x001E, 0x001F,
0x0021, 0x0021, 0x0022, 0x0023, 0x0000, 0x0043, 0x00F9, 0x0208, 0x0348, 0x04E1, 0x0691, 0x0791, 0x071B, 0x0590,
0x043A, 0x0320, 0x020B, 0x0116, 0x0051, 0xFFCE, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9E,
0xFF9E, 0xFF9E, 0xFC16, 0xFACD, 0xF807, 0xF52B, 0xF360, 0xF338, 0xF47F, 0xF741, 0xFB42, 0x0095, 0x0131, 0xFEC2,
0xFCD8, 0xFB93, 0xFA8F, 0xF9B3, 0xF8FB, 0xF857, 0xF7B7, 0xF720, 0xF694, 0xF617, 0xF5AA, 0xF551, 0xF50E, 0xF4E4,
0x1748, 0x18C4, 0x1BAC, 0x1E08, 0x1E7A, 0x1C0E, 0x173B, 0x10A7, 0x0922, 0x0042, 0x0000, 0x0506, 0x0917, 0x0BE3,
0x0E13, 0x0FD2, 0x112D, 0x1253, 0x1370, 0x147E, 0x1578, 0x1658, 0x1719, 0x17B8, 0x1830, 0x187B, 0x0000, 0x0002,
0x0006, 0x000D, 0x000D, 0xFFD3, 0xFF6A, 0xFF23, 0xFF3A, 0xFF79, 0xFF88, 0xFF85, 0xFF95, 0xFFB0, 0xFFCE, 0xFFE7,
0xFFF1, 0xFFF0, 0xFFEF, 0xFFEE, 0xFFED, 0xFFEC, 0xFFEB, 0xFFEB, 0xFFEA, 0xFFEA, 0x0000, 0xFFFB, 0xFFF0, 0xFFE3,
0xFFE4, 0x0064, 0x015C, 0x0240, 0x026F, 0x0223, 0x0232, 0x0238, 0x01EE, 0x016F, 0x00E1, 0x006E, 0x003F, 0x003F,
0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0xFC55, 0xFB5C, 0xF964, 0xF7A5, 0xF6E1, 0xF6FA,
0xF7AE, 0xF95C, 0xFC12, 0xFEEF, 0xFFAF, 0xFE6F, 0xFD29, 0xFBF3, 0xFADE, 0xF9F1, 0xF931, 0xF88C, 0xF7EC, 0xF755,
0xF6C9, 0xF64B, 0xF5DF, 0xF586, 0xF543, 0xF518, 0x1745, 0x18C0, 0x1BB8, 0x1E5E, 0x1F6F, 0x1EE7, 0x1D5A, 0x1A83,
0x1643, 0x1183, 0x0F44, 0x0F6F, 0x0F85, 0x0F96, 0x0FC2, 0x1036, 0x111D, 0x1244, 0x1362, 0x1471, 0x156B, 0x164B,
0x170D, 0x17AC, 0x1824, 0x1870, 0x0000, 0x0037, 0x0092, 0x00A4, 0x0000, 0xFE49, 0xFBCE, 0xF926, 0xF6E7, 0xF4D7,
0xF2C6, 0xF15B, 0xF13F, 0xF258, 0xF402, 0xF610, 0xF854, 0xFAA1, 0xFCCB, 0xFEA4, 0x0000, 0x00BB, 0x00F0, 0x00CA,
0x0078, 0x0026, 0x0000, 0x0015, 0x0039, 0x0040, 0x0000, 0xFF3D, 0xFE1D, 0xFD0A, 0xFC6C, 0xFC76, 0xFCEA, 0xFD82,
0xFDF7, 0xFE44, 0xFE90, 0xFEDB, 0xFF23, 0xFF66, 0xFFA2, 0xFFD6, 0x0000, 0x0019, 0x0020, 0x0019, 0x000D, 0x0001,
0x03D4, 0x0208, 0xFDF7, 0xF9A6, 0xF714, 0xF6E3, 0xF7FA, 0xF9C1, 0xFBA2, 0xFE01, 0x0101, 0x03A5, 0x04EF, 0x04F2,
0x047C, 0x03AE, 0x02AB, 0x0192, 0x0086, 0xFFA7, 0xFF16, 0xFEDD, 0xFEE1, 0xFF0E, 0xFF50, 0xFF93, 0x0000, 0xFFFD,
0xFFF9, 0xFFF8, 0x0000, 0x0091, 0x017D, 0x01C8, 0x0077, 0xFC05, 0xF563, 0xEF47, 0xEC66, 0xEC95, 0xEDB6, 0xEF92,
0xF1EF, 0xF498, 0xF752, 0xF9E7, 0xFC1E, 0xFE63, 0xFFFF, 0x005C, 0x0051, 0x001C, 0x0000, 0xFFDD, 0xFFA2, 0xFF96,
0x0000, 0x0163, 0x0374, 0x0543, 0x05DE, 0x047F, 0x01D2, 0xFF17, 0xFD90, 0xFD3D, 0xFD3C, 0xFD7A, 0xFDE4, 0xFE66,
0xFEED, 0xFF65, 0xFFBB, 0xFFEB, 0x0000, 0x0005, 0x0002, 0xFFFC, 0x0272, 0x05A8, 0x0CDF, 0x1478, 0x18D5, 0x1866,
0x154B, 0x1170, 0x0EBF, 0x0DB4, 0x0D4C, 0x0D33, 0x0D15, 0x0CDB, 0x0CA7, 0x0C78, 0x0C50, 0x0C2D, 0x0C11, 0x0BFB,
0x0BEC, 0x0C39, 0x0CA0, 0x0CCB, 0x0CEE, 0x0CFB, 0x0000, 0xFFDE, 0xFFA6, 0xFF9B, 0x0000, 0x0149, 0x0330, 0x04E9,
0x05A3, 0x04C4, 0x02DB, 0x00DB, 0xFFB4, 0xFF5F, 0xFF30, 0xFF1F, 0xFF26, 0xFF3F, 0xFF62, 0xFF8B, 0xFFB1, 0xFFCF,
0xFFDE, 0xFFE5, 0xFFEF, 0xFFF7, 0x0000, 0xFFF7, 0xFFE9, 0xFFE6, 0x0000, 0x0015, 0x0027, 0x0084, 0x0177, 0x03B1,
0x06D6, 0x099C, 0x0AB8, 0x0A59, 0x0996, 0x0886, 0x073B, 0x05CC, 0x044E, 0x02D5, 0x0175, 0x0046, 0xFF5A, 0xFF06,
0xFF4E, 0xFFC9, 0x02B0, 0x0114, 0xFD72, 0xF997, 0xF750, 0xF763, 0xF8C2, 0xFA79, 0xFB94, 0xFBDE, 0xFBD7, 0xFB93,
0xFB2A, 0xFAAD, 0xFA20, 0xF987, 0xF8E5, 0xF83F, 0xF798, 0xF6F4, 0xF656, 0xF5C3, 0xF53E, 0xF4D0, 0xF483, 0xF45A,
0x4000, 0x4000, 0x4000, 0x4000, 0x3E3F, 0x3A10, 0x3512, 0x30E3, 0x2F22, 0x2FDB, 0x31C5, 0x3478, 0x3791, 0x3AAA,
0x3D5D, 0x3F46, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0xF93D, 0xF93D,
0xF93D, 0xF93D, 0xF95C, 0xF9A7, 0xFA00, 0xFA4A, 0xFA6A, 0xFA56, 0xFA20, 0xF9CF, 0xF96A, 0xF8FA, 0xF886, 0xF815,
0xF7B0, 0xF74C, 0xF6DE, 0xF66A, 0xF5F6, 0xF586, 0xF51F, 0xF4C7, 0xF481, 0xF454, 0x099C, 0x09BC, 0x0A04, 0x0A4C,
0x0A6C, 0x0A6A, 0x0A66, 0x0A62, 0x0A60, 0x0A68, 0x0A7E, 0x0A9E, 0x0AC4, 0x0AEC, 0x0B12, 0x0B32, 0x0B48, 0x0B50,
0x0B50, 0x0B50, 0x0B50, 0x0B50, 0x0B50, 0x0B50, 0x0B50, 0x0B50, 0xF832, 0xF868, 0xF8A9, 0xF864, 0xF70A, 0xF48D,
0xF1CA, 0xEF8D, 0xEEA0, 0xEF39, 0xF0D4, 0xF325, 0xF5E5, 0xF8CA, 0xFB8A, 0xFDDC, 0xFF76, 0x000F, 0x000F, 0x000F,
0x000F, 0x000F, 0x000F, 0x000F, 0x000F, 0x000F, 0x8BD2, 0x8C85, 0x8E0F, 0x8F9A, 0x904D, 0x8FA9, 0x8D90, 0x89C1,
0x83FB, 0x7CF9, 0x75D1, 0x6EC7, 0x681B, 0x6211, 0x5CEB, 0x58EC, 0x5655, 0x5569, 0x5569, 0x5569, 0x5569, 0x5569,
0x5569, 0x5569, 0x5569, 0x5569, 0x618A, 0x62AB, 0x6527, 0x67A3, 0x68C4, 0x689B, 0x6843, 0x67EA, 0x67C1, 0x65CC,
0x60E6, 0x5A88, 0x542A, 0x4F44, 0x4D4F, 0x4D94, 0x4E2D, 0x4EC5, 0x4F0B, 0x4EED, 0x4E9F, 0x4E30, 0x4DB1, 0x4D31,
0x4CC2, 0x4C74, 0x44EA, 0x49A7, 0x5414, 0x5E81, 0x633E, 0x692C, 0x7636, 0x8341, 0x892E, 0x8756, 0x82B8, 0x7CB9,
0x76B9, 0x721C, 0x7044, 0x7085, 0x7116, 0x71A6, 0x71E8, 0x71CD, 0x7188, 0x7126, 0x70B5, 0x7044, 0x6FE2, 0x6F9C,
0x5808, 0x5B1C, 0x61E3, 0x68AA, 0x6BBF, 0x6CBB, 0x6EE5, 0x710F, 0x720B, 0x6EF5, 0x673E, 0x5D36, 0x532E, 0x4B76,
0x4860, 0x4922, 0x4ACC, 0x4C76, 0x4D37, 0x4CE6, 0x4C11, 0x4AE3, 0x4989, 0x482F, 0x4702, 0x462C, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x000F, 0x001E, 0x002F,
0x0040, 0x004F, 0x005A, 0x005E, 0x005E, 0x005E, 0x005E, 0x005E, 0x005E, 0x005E, 0x0000, 0xFFC9, 0xFF33, 0xFE53,
0xFD3D, 0xFC08, 0xFAC8, 0xF993, 0xF87E, 0xF79E, 0xF707, 0xF6D1, 0xF829, 0xFBB5, 0x00B9, 0x0679, 0x0C39, 0x113D,
0x14C9, 0x1622, 0x1622, 0x1622, 0x1622, 0x1622, 0x1622, 0x1622, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709,
0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF709, 0xF70A, 0xF70D, 0xF710, 0xF714, 0xF718, 0xF71B, 0xF71E, 0xF71F,
0xF71F, 0xF71F, 0xF71F, 0xF71F, 0xF71F, 0xF71F, 0xF6F4, 0xF686, 0xF594, 0xF4A2, 0xF434, 0xF454, 0xF4B2, 0xF549,
0xF616, 0xF711, 0xF828, 0xF94D, 0xFA6F, 0xFB7F, 0xFC6D, 0xFD2B, 0xFDA8, 0xFDD5, 0xFDD5, 0xFDD5, 0xFDD5, 0xFDD5,
0xFDD5, 0xFDD5, 0xFDD5, 0xFDD5, 0x0889, 0x0885, 0x08AA, 0x0943, 0x0A9B, 0x0CED, 0x0FAC, 0x11F7, 0x12ED, 0x1260,
0x10E7, 0x0EC4, 0x0C3C, 0x0993, 0x070B, 0x04E9, 0x036F, 0x02E2, 0x02E2, 0x02E2, 0x02E2, 0x02E2, 0x02E2, 0x02E2,
0x02E2, 0x02E2, 0x88A9, 0x8A3E, 0x8DBA, 0x9135, 0x92CA, 0x9223, 0x8FFE, 0x8C0F, 0x860F, 0x7EF1, 0x77F9, 0x7155,
0x6B36, 0x65CA, 0x6140, 0x5DC8, 0x5B91, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9, 0x5AC9,
0x81DB, 0x7AEA, 0x693D, 0x5187, 0x3880, 0x25BA, 0x1BC8, 0x17DD, 0x172D, 0x1927, 0x1E19, 0x2485, 0x2AF2, 0x2FE4,
0x31DE, 0x3195, 0x30F7, 0x3058, 0x3010, 0x3021, 0x3050, 0x3091, 0x30DC, 0x3127, 0x3168, 0x3196, 0xB5C5, 0xB9D1,
0xC3F8, 0xD140, 0xDEAD, 0xEC7B, 0xFA99, 0x0596, 0x0A04, 0x07F7, 0x02D8, 0xFC2F, 0xF586, 0xF066, 0xEE5A, 0xEE99,
0xEF25, 0xEFB1, 0xEFF0, 0xEFE1, 0xEFB7, 0xEF7D, 0xEF3A, 0xEEF8, 0xEEBD, 0xEE94, 0x9AE3, 0xA3A3, 0xB85E, 0xD0C9,
0xE49A, 0xF0E4, 0xF8BF, 0xFCEA, 0xFE23, 0xF908, 0xEC46, 0xDBAF, 0xCB18, 0xBE55, 0xB93B, 0xB9EE, 0xBB78, 0xBD03,
0xBDB6, 0xBD8A, 0xBD17, 0xBC74, 0xBBB9, 0xBAFE, 0xBA5B, 0xB9E8, 0x0E70, 0x0DAC, 0x0B93, 0x0871, 0x0492, 0x0041,
0xFBCA, 0xF779, 0xF39A, 0xF078, 0xEE5F, 0xED9B, 0xED77, 0xED18, 0xEC91, 0xEBF6, 0xEB5B, 0xEAD4, 0xEA75, 0xEA50,
0xEA55, 0xEA60, 0xEA70, 0xEA81, 0xEA91, 0xEA9C, 0xEB55, 0xEC41, 0xEEC6, 0xF28A, 0xF733, 0xFC63, 0x01C2, 0x06F2,
0x0B9B, 0x0F5F, 0x11E4, 0x12D0, 0x10DC, 0x0BB7, 0x0470, 0xFC1A, 0xF3C3, 0xEC7C, 0xE757, 0xE563, 0xE543, 0xE4EF,
0xE47D, 0xE400, 0xE38E, 0xE33A, 0xFF4F, 0xFEF4, 0xFDF8, 0xFC81, 0xFAB0, 0xF8AB, 0xF693, 0xF48E, 0xF2BD, 0xF146,
0xF04A, 0xEFEE, 0xF02C, 0xF0CF, 0xF1B6, 0xF2BE, 0xF3C6, 0xF4AC, 0xF54F, 0xF58D, 0xF586, 0xF575, 0xF55E, 0xF544,
0xF52D, 0xF51C, 0x0000, 0xFD2C, 0xF6F4, 0xF0BD, 0xEDE9, 0xEE44, 0xEF40, 0xF0BD, 0xF29A, 0xF4B7, 0xF6F4, 0xF932,
0xFB4F, 0xFD2C, 0xFEA9, 0xFFA5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x000C, 0x002B, 0x005A, 0x0093, 0x00D1, 0x010E, 0x0147, 0x0176, 0x0196, 0x0920, 0x0925,
0x0930, 0x0941, 0x0955, 0x0955, 0x0929, 0x08D8, 0x0865, 0x07D6, 0x0730, 0x0676, 0x05AF, 0x04DF, 0x040B, 0x0337,
0x0269, 0x01A1, 0x00E0, 0x002A, 0xFF81, 0xFEEA, 0xFE66, 0xFDFA, 0xFDA9, 0xFD76,
};
static JointIndex sChildZeldaAnim_01A2FCJointIndices[18] = {
{ 0x0004, 0x001E, 0x0002 },
{ 0x0002, 0x0038, 0x0002 },
{ 0x0052, 0x006C, 0x0086 },
{ 0x00A0, 0x00BA, 0x00D4 },
{ 0x0002, 0x0002, 0x00EE },
{ 0x0108, 0x0122, 0x013C },
{ 0x0002, 0x0002, 0x0156 },
{ 0x0170, 0x018A, 0x01A4 },
{ 0x01BE, 0x01D8, 0x01F2 },
{ 0x020C, 0x0226, 0x0240 },
{ 0x025A, 0x0274, 0x0003 },
{ 0x028E, 0x02A8, 0x02C2 },
{ 0x02DC, 0x02F6, 0x0310 },
{ 0x032A, 0x0344, 0x035E },
{ 0x0378, 0x0392, 0x03AC },
{ 0x03C6, 0x03E0, 0x03FA },
{ 0x0414, 0x042E, 0x0448 },
{ 0x0462, 0x047C, 0x0496 },
};
AnimationHeader gChildZeldaAnim_01A2FC = { { 26 }, sChildZeldaAnim_01A2FCFrameData, sChildZeldaAnim_01A2FCJointIndices, 4 };
static u8 unaccounted_01A30C[4] = {
0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01AAE0FrameData[946] = {
0x06D5, 0x099B, 0x0000, 0xC000, 0xBF0F, 0xFF06, 0xC006, 0x003F, 0x4000, 0x099B, 0x099C, 0x099D, 0x099E, 0x09A0,
0x09A3, 0x09A5, 0x09A7, 0x09AA, 0x09AC, 0x09AD, 0x09AE, 0x09AF, 0x09AE, 0x09AD, 0x09AC, 0x09AA, 0x09A7, 0x09A5,
0x09A3, 0x09A0, 0x099E, 0x099D, 0x099C, 0x0023, 0x0023, 0x0022, 0x0022, 0x0022, 0x0021, 0x0021, 0x0020, 0x0020,
0x001F, 0x001F, 0x001F, 0x001F, 0x001F, 0x001F, 0x001F, 0x0020, 0x0020, 0x0021, 0x0021, 0x0022, 0x0022, 0x0022,
0x0023, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D,
0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9D, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xFF9E, 0xF4D5, 0xF4DC, 0xF4F1,
0xF510, 0xF538, 0xF566, 0xF597, 0xF5C8, 0xF5F8, 0xF622, 0xF645, 0xF65B, 0xF664, 0xF65B, 0xF645, 0xF622, 0xF5F8,
0xF5C8, 0xF597, 0xF566, 0xF538, 0xF510, 0xF4F1, 0xF4DC, 0x1896, 0x1889, 0x1864, 0x182C, 0x17E5, 0x1794, 0x173C,
0x16E4, 0x168F, 0x1643, 0x1606, 0x15DD, 0x15CE, 0x15DD, 0x1606, 0x1643, 0x168F, 0x16E4, 0x173C, 0x1794, 0x17E5,
0x182C, 0x1864, 0x1889, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEB, 0xFFEB, 0xFFEB, 0xFFEC, 0xFFEC, 0xFFEC,
0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEB, 0xFFEB, 0xFFEB, 0xFFEA, 0xFFEA, 0xFFEA, 0xFFEA, 0xF509,
0xF511, 0xF525, 0xF545, 0xF56D, 0xF59A, 0xF5CB, 0xF5FD, 0xF62C, 0xF657, 0xF679, 0xF690, 0xF699, 0xF690, 0xF679,
0xF657, 0xF62C, 0xF5FD, 0xF5CB, 0xF59A, 0xF56D, 0xF545, 0xF525, 0xF511, 0x188B, 0x187E, 0x1859, 0x1821, 0x17DA,
0x1788, 0x1731, 0x16D8, 0x1683, 0x1637, 0x15F9, 0x15D0, 0x15C1, 0x15D0, 0x15F9, 0x1637, 0x1683, 0x16D8, 0x1731,
0x1788, 0x17DA, 0x1821, 0x1859, 0x187E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0x0000, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB,
0xFFFB, 0xFFFC, 0xFFFE, 0xFFFF, 0x0001, 0x0002, 0x0003, 0x0004, 0x0003, 0x0002, 0xFFFF, 0xFFC1, 0xFFE1, 0x0005,
0x002C, 0x0054, 0x007B, 0x00A2, 0x00C6, 0x00E7, 0x0102, 0x0118, 0x0125, 0x012A, 0x012C, 0x0131, 0x0135, 0x0136,
0x0133, 0x0128, 0x0113, 0x00F2, 0x00C2, 0x0081, 0x002C, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
0xFFFD, 0xFFFD, 0xFFFD, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFD, 0xFFFD, 0xFFFC, 0xFFFB, 0xFFFA, 0xFFFA, 0xFFF9, 0xFFF9,
0xFFF9, 0xFFFA, 0xFFFB, 0xFFF9, 0xFFF9, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF8, 0xFFF9,
0xFFF9, 0xFFF9, 0xFFF8, 0xFFF6, 0xFFF4, 0xFFF1, 0xFFEE, 0xFFEC, 0xFFEA, 0xFFE9, 0xFFEA, 0xFFED, 0xFFF1, 0x0CE0,
0x0CA3, 0x0C55, 0x0BFC, 0x0B9B, 0x0B36, 0x0AD1, 0x0A71, 0x0A19, 0x09CE, 0x0993, 0x096D, 0x095F, 0x095C, 0x0956,
0x0952, 0x0956, 0x0967, 0x0989, 0x09C1, 0x0A15, 0x0A8A, 0x0B25, 0x0BEA, 0xFFFC, 0xFFFE, 0xFFFF, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFC, 0x0011, 0x001C, 0x0024, 0x0029, 0x002D, 0x002E, 0x002E, 0x002D, 0x002B,
0x0029, 0x0027, 0x0026, 0x0025, 0x0025, 0x0024, 0x0023, 0x0021, 0x001F, 0x001D, 0x001B, 0x0019, 0x0017, 0x0014,
0x0013, 0xF459, 0xF474, 0xF49D, 0xF4D0, 0xF50A, 0xF548, 0xF588, 0xF5C6, 0xF5FF, 0xF631, 0xF658, 0xF672, 0xF67B,
0xF67C, 0xF67D, 0xF67B, 0xF674, 0xF666, 0xF64D, 0xF628, 0xF5F4, 0xF5AE, 0xF554, 0xF4E3, 0xF444, 0xF44A, 0xF459,
0xF471, 0xF490, 0xF4B3, 0xF4D8, 0xF4FF, 0xF524, 0xF547, 0xF566, 0xF57D, 0xF58D, 0xF593, 0xF58B, 0xF576, 0xF556,
0xF52E, 0xF502, 0xF4D5, 0xF4A9, 0xF481, 0xF461, 0xF44C, 0x0B50, 0x0B50, 0x0B51, 0x0B51, 0x0B52, 0x0B53, 0x0B54,
0x0B55, 0x0B56, 0x0B57, 0x0B58, 0x0B58, 0x0B58, 0x0B58, 0x0B58, 0x0B57, 0x0B56, 0x0B55, 0x0B54, 0x0B53, 0x0B52,
0x0B51, 0x0B51, 0x0B50, 0x000F, 0x0015, 0x0026, 0x003F, 0x005F, 0x0083, 0x00AA, 0x00D0, 0x00F4, 0x0114, 0x012D,
0x013E, 0x0144, 0x013E, 0x012D, 0x0114, 0x00F4, 0x00D0, 0x00AA, 0x0083, 0x005F, 0x003F, 0x0026, 0x0015, 0x5569,
0x556F, 0x557E, 0x5595, 0x55B3, 0x55D4, 0x55F7, 0x561A, 0x563B, 0x5658, 0x5670, 0x567F, 0x5685, 0x567F, 0x5670,
0x5658, 0x563B, 0x561A, 0x55F7, 0x55D4, 0x55B3, 0x5595, 0x557E, 0x556F, 0x4C56, 0x4C59, 0x4C62, 0x4C70, 0x4C81,
0x4C94, 0x4CA9, 0x4CBD, 0x4CD1, 0x4CE2, 0x4CEF, 0x4CF8, 0x4CFC, 0x4CF8, 0x4CEF, 0x4CE2, 0x4CD1, 0x4CBD, 0x4CA9,
0x4C94, 0x4C81, 0x4C70, 0x4C62, 0x4C59, 0x6F82, 0x6F8C, 0x6FAA, 0x6FD6, 0x700D, 0x704C, 0x708E, 0x70D0, 0x710F,
0x7146, 0x7172, 0x718F, 0x719A, 0x718F, 0x7172, 0x7146, 0x710F, 0x70D0, 0x708E, 0x704C, 0x700D, 0x6FD6, 0x6FAA,
0x6F8C, 0x45DB, 0x45E5, 0x45FE, 0x4626, 0x4656, 0x468E, 0x46C9, 0x4704, 0x473B, 0x476C, 0x4793, 0x47AD, 0x47B6,
0x47AD, 0x4793, 0x476C, 0x473B, 0x4704, 0x46C9, 0x468E, 0x4656, 0x4626, 0x45FE, 0x45E5, 0x005E, 0x0071, 0x00A6,
0x00F5, 0x0158, 0x01C9, 0x0241, 0x02B9, 0x032A, 0x038D, 0x03DD, 0x0411, 0x0424, 0x0411, 0x03DD, 0x038D, 0x032A,
0x02B9, 0x0241, 0x01C9, 0x0158, 0x00F5, 0x00A6, 0x0071, 0x1622, 0x161E, 0x1613, 0x1602, 0x15ED, 0x15D6, 0x15BD,
0x15A3, 0x158C, 0x1577, 0x1566, 0x155B, 0x1557, 0x155B, 0x1566, 0x1577, 0x158C, 0x15A3, 0x15BD, 0x15D6, 0x15ED,
0x1602, 0x1613, 0x161E, 0xF71F, 0xF734, 0xF76F, 0xF7C8, 0xF837, 0xF8B6, 0xF93C, 0xF9C2, 0xFA41, 0xFAB0, 0xFB09,
0xFB44, 0xFB5A, 0xFB44, 0xFB09, 0xFAB0, 0xFA41, 0xF9C2, 0xF93C, 0xF8B6, 0xF837, 0xF7C8, 0xF76F, 0xF734, 0xFDD5,
0xFDD5, 0xFDD5, 0xFDD5, 0xFDD6, 0xFDD6, 0xFDD7, 0xFDD7, 0xFDD7, 0xFDD8, 0xFDD8, 0xFDD8, 0xFDD8, 0xFDD8, 0xFDD8,
0xFDD8, 0xFDD7, 0xFDD7, 0xFDD7, 0xFDD6, 0xFDD6, 0xFDD5, 0xFDD5, 0xFDD5, 0x02E2, 0x02DF, 0x02D6, 0x02C9, 0x02B8,
0x02A5, 0x0291, 0x027D, 0x0269, 0x0259, 0x024B, 0x0242, 0x023F, 0x0242, 0x024B, 0x0259, 0x0269, 0x027D, 0x0291,
0x02A5, 0x02B8, 0x02C9, 0x02D6, 0x02DF, 0x5AC9, 0x5AD2, 0x5AEC, 0x5B12, 0x5B42, 0x5B79, 0x5BB3, 0x5BED, 0x5C24,
0x5C54, 0x5C7B, 0x5C94, 0x5C9D, 0x5C94, 0x5C7B, 0x5C54, 0x5C24, 0x5BED, 0x5BB3, 0x5B79, 0x5B42, 0x5B12, 0x5AEC,
0x5AD2, 0x31A8, 0x31A2, 0x3194, 0x317E, 0x3162, 0x3143, 0x3122, 0x3101, 0x30E1, 0x30C6, 0x30B0, 0x30A1, 0x309C,
0x30A1, 0x30B0, 0x30C6, 0x30E1, 0x3101, 0x3122, 0x3143, 0x3162, 0x317E, 0x3194, 0x31A2, 0xEE84, 0xEE90, 0xEEAE,
0xEEDC, 0xEF16, 0xEF58, 0xEF9E, 0xEFE4, 0xF026, 0xF060, 0xF08E, 0xF0AD, 0xF0B8, 0xF0AD, 0xF08E, 0xF060, 0xF026,
0xEFE4, 0xEF9E, 0xEF58, 0xEF16, 0xEEDC, 0xEEAE, 0xEE90, 0xB9BC, 0xB9CA, 0xB9F1, 0xBA2B, 0xBA75, 0xBAC8, 0xBB20,
0xBB78, 0xBBCC, 0xBC15, 0xBC50, 0xBC76, 0xBC85, 0xBC76, 0xBC50, 0xBC15, 0xBBCC, 0xBB78, 0xBB20, 0xBAC8, 0xBA75,
0xBA2B, 0xB9F1, 0xB9CA, 0xEAA0, 0xEA96, 0xEA78, 0xEA4A, 0xEA12, 0xE9D1, 0xE98D, 0xE949, 0xE908, 0xE8D0, 0xE8A3,
0xE885, 0xE87A, 0xE885, 0xE8A3, 0xE8D0, 0xE908, 0xE949, 0xE98D, 0xE9D1, 0xEA12, 0xEA4A, 0xEA78, 0xEA96, 0xE31A,
0xE30B, 0xE2E1, 0xE2A3, 0xE254, 0xE1FB, 0xE19C, 0xE13E, 0xE0E4, 0xE096, 0xE057, 0xE02E, 0xE01F, 0xE02E, 0xE057,
0xE096, 0xE0E4, 0xE13E, 0xE19C, 0xE1FB, 0xE254, 0xE2A3, 0xE2E1, 0xE30B, 0xF515, 0xF525, 0xF551, 0xF593, 0xF5E6,
0xF644, 0xF6A8, 0xF70C, 0xF76A, 0xF7BD, 0xF7FF, 0xF82B, 0xF83B, 0xF82B, 0xF7FF, 0xF7BD, 0xF76A, 0xF70C, 0xF6A8,
0xF644, 0xF5E6, 0xF593, 0xF551, 0xF525, 0x0000, 0x0001, 0x0002, 0x0005, 0x0008, 0x000B, 0x000F, 0x0012, 0x0016,
0x0019, 0x001B, 0x001D, 0x001D, 0x001D, 0x001B, 0x0019, 0x0016, 0x0012, 0x000F, 0x000B, 0x0008, 0x0005, 0x0002,
0x0001, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A0, 0x01A0, 0x01A0, 0x01A0, 0x01A0,
0x01A0, 0x01A0, 0x01A0, 0x01A0, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0x01A1, 0xFD64, 0xFD6E, 0xFD87,
0xFDAC, 0xFDDC, 0xFE11, 0xFE4A, 0xFE83, 0xFEB9, 0xFEE9, 0xFF0E, 0xFF27, 0xFF30, 0xFF27, 0xFF0E, 0xFEE9, 0xFEB9,
0xFE83, 0xFE4A, 0xFE11, 0xFDDC, 0xFDAC, 0xFD87, 0xFD6E, 0x0000,
};
static JointIndex sChildZeldaAnim_01AAE0JointIndices[18] = {
{ 0x0000, 0x0009, 0x0002 },
{ 0x0002, 0x0003, 0x0002 },
{ 0x0004, 0x0005, 0x0006 },
{ 0x0021, 0x0039, 0x0051 },
{ 0x0002, 0x0002, 0x0069 },
{ 0x0081, 0x0007, 0x0099 },
{ 0x0002, 0x0002, 0x00B1 },
{ 0x00C9, 0x00E1, 0x00F9 },
{ 0x0111, 0x0129, 0x0141 },
{ 0x0159, 0x0171, 0x0189 },
{ 0x0008, 0x01A1, 0x0008 },
{ 0x01B9, 0x01D1, 0x01E9 },
{ 0x0201, 0x0219, 0x0231 },
{ 0x0249, 0x0261, 0x0279 },
{ 0x0291, 0x02A9, 0x02C1 },
{ 0x02D9, 0x02F1, 0x0309 },
{ 0x0321, 0x0339, 0x0351 },
{ 0x0369, 0x0381, 0x0399 },
};
AnimationHeader gChildZeldaAnim_01AAE0 = { { 24 }, sChildZeldaAnim_01AAE0FrameData, sChildZeldaAnim_01AAE0JointIndices, 9 };
static s16 sChildZeldaAnim_01AE88FrameData[406] = {
0x0001, 0x09DD, 0x0000, 0xBF0F, 0xC000, 0x4000, 0xF716, 0xF716, 0xF715, 0xF714, 0xF714, 0xF713, 0xF712, 0xF711,
0xF710, 0xF70F, 0xF70F, 0xF70E, 0xF70E, 0xF70E, 0xF70F, 0xF70F, 0xF710, 0xF712, 0xF714, 0xF716, 0x0C1E, 0x0C1E,
0x0C1F, 0x0C20, 0x0C22, 0x0C23, 0x0C25, 0x0C26, 0x0C28, 0x0C29, 0x0C2A, 0x0C2B, 0x0C2B, 0x0C2B, 0x0C2B, 0x0C2A,
0x0C28, 0x0C25, 0x0C22, 0x0C1E, 0xF737, 0xF736, 0xF736, 0xF735, 0xF734, 0xF733, 0xF732, 0xF732, 0xF731, 0xF730,
0xF72F, 0xF72F, 0xF72F, 0xF72F, 0xF72F, 0xF730, 0xF731, 0xF732, 0xF734, 0xF737, 0x0C40, 0x0C41, 0x0C42, 0x0C43,
0x0C45, 0x0C46, 0x0C48, 0x0C49, 0x0C4B, 0x0C4C, 0x0C4D, 0x0C4E, 0x0C4E, 0x0C4E, 0x0C4D, 0x0C4C, 0x0C4A, 0x0C48,
0x0C44, 0x0C40, 0xEAA8, 0xEAA1, 0xEA97, 0xEA8B, 0xEA7D, 0xEA70, 0xEA63, 0xEA59, 0xEA52, 0xEA50, 0xEA52, 0xEA59,
0xEA63, 0xEA70, 0xEA7D, 0xEA8B, 0xEA97, 0xEAA1, 0xEAA8, 0xEAAB, 0x24E7, 0x2539, 0x25AF, 0x2637, 0x26C3, 0x2746,
0x27B9, 0x2812, 0x284D, 0x2862, 0x284D, 0x2812, 0x27B8, 0x2745, 0x26C0, 0x2632, 0x25A6, 0x252C, 0x24D3, 0x24AE,
0xF8DB, 0xF8B1, 0xF875, 0xF831, 0xF7ED, 0xF7AD, 0xF776, 0xF74C, 0xF730, 0xF726, 0xF730, 0xF74B, 0xF775, 0xF7AC,
0xF7EC, 0xF831, 0xF876, 0xF8B4, 0xF8E1, 0xF8F4, 0x5046, 0x5005, 0x4FA7, 0x4F37, 0x4EC3, 0x4E52, 0x4DEE, 0x4D9E,
0x4D69, 0x4D56, 0x4D69, 0x4D9E, 0x4DEE, 0x4E52, 0x4EC3, 0x4F3A, 0x4FAB, 0x500D, 0x5053, 0x5070, 0xBE01, 0xBDF0,
0xBDD6, 0xBDB8, 0xBD97, 0xBD76, 0xBD58, 0xBD3F, 0xBD2E, 0xBD28, 0xBD2D, 0xBD3E, 0xBD56, 0xBD74, 0xBD94, 0xBDB5,
0xBDD3, 0xBDEC, 0xBDFE, 0xBE04, 0x1342, 0x136C, 0x13A9, 0x13F3, 0x1444, 0x1495, 0x14DF, 0x151D, 0x1546, 0x1555,
0x1546, 0x151D, 0x14DF, 0x1495, 0x1444, 0x13F3, 0x13A9, 0x136C, 0x1342, 0x1333, 0xE898, 0xE8C1, 0xE8FE, 0xE949,
0xE99A, 0xE9EA, 0xEA35, 0xEA72, 0xEA9B, 0xEAAB, 0xEA9B, 0xEA72, 0xEA35, 0xE9EA, 0xE99A, 0xE949, 0xE8FE, 0xE8C1,
0xE898, 0xE889, 0xD22C, 0xD14E, 0xD008, 0xCE7C, 0xCCCD, 0xCB1E, 0xC992, 0xC84B, 0xC76E, 0xC71C, 0xC76E, 0xC84B,
0xC992, 0xCB1E, 0xCCCD, 0xCE7C, 0xD008, 0xD14E, 0xD22C, 0xD27D, 0xDC28, 0xDBCC, 0xDB5E, 0xDAE2, 0xDA5F, 0xD9DD,
0xD965, 0xD901, 0xD8BE, 0xD8A5, 0xD8BF, 0xD906, 0xD970, 0xD9EE, 0xDA77, 0xDAFF, 0xDB7E, 0xDBEF, 0xDC4C, 0xDC94,
0x067E, 0x06AE, 0x06E8, 0x0728, 0x076B, 0x07AD, 0x07E8, 0x0819, 0x0839, 0x0845, 0x0838, 0x0816, 0x07E2, 0x07A3,
0x075E, 0x0718, 0x06D5, 0x0699, 0x0667, 0x0641, 0x5110, 0x50C9, 0x5070, 0x5009, 0x4F9B, 0x4F2C, 0x4EC5, 0x4E6F,
0x4E35, 0x4E1F, 0x4E35, 0x4E72, 0x4ECB, 0x4F36, 0x4FA9, 0x501A, 0x5083, 0x50DE, 0x5126, 0x5158, 0xBDE3, 0xBDD3,
0xBDBA, 0xBD9C, 0xBD7C, 0xBD5C, 0xBD3E, 0xBD26, 0xBD15, 0xBD0F, 0xBD16, 0xBD26, 0xBD3E, 0xBD5C, 0xBD7C, 0xBD9D,
0xBDBB, 0xBDD4, 0xBDE5, 0xBDEC, 0xF3DA, 0xF3B0, 0xF373, 0xF329, 0xF2D8, 0xF287, 0xF23D, 0xF200, 0xF1D6, 0xF1C7,
0xF1D6, 0xF200, 0xF23D, 0xF287, 0xF2D8, 0xF329, 0xF373, 0xF3B0, 0xF3DA, 0xF3E9, 0x1AA8, 0x1AA1, 0x1A97, 0x1A8B,
0x1A7D, 0x1A70, 0x1A63, 0x1A59, 0x1A52, 0x1A50, 0x1A52, 0x1A59, 0x1A63, 0x1A70, 0x1A7D, 0x1A8B, 0x1A97, 0x1AA1,
0x1AA8, 0x1AAB, 0xD245, 0xD1AD, 0xD0CD, 0xCFBC, 0xCE94, 0xCD6C, 0xCC5B, 0xCB7B, 0xCAE3, 0xCAAB, 0xCAE3, 0xCB7B,
0xCC5B, 0xCD6C, 0xCE94, 0xCFBC, 0xD0CD, 0xD1AD, 0xD245, 0xD27D, 0xEAB5, 0xEAD1, 0xEAF9, 0xEB2B, 0xEB61, 0xEB97,
0xEBC8, 0xEBF1, 0xEC0D, 0xEC17, 0xEC0D, 0xEBF1, 0xEBC8, 0xEB97, 0xEB61, 0xEB2B, 0xEAF9, 0xEAD1, 0xEAB5, 0xEAAB,
};
static JointIndex sChildZeldaAnim_01AE88JointIndices[18] = {
{ 0x0000, 0x0001, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0003, 0x0002, 0x0004 },
{ 0x0002, 0x0002, 0x0006 },
{ 0x0002, 0x0002, 0x001A },
{ 0x0002, 0x0002, 0x002E },
{ 0x0002, 0x0002, 0x0042 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0005, 0x0056, 0x0005 },
{ 0x006A, 0x007E, 0x0092 },
{ 0x0002, 0x0002, 0x00A6 },
{ 0x00BA, 0x00CE, 0x00E2 },
{ 0x00F6, 0x010A, 0x011E },
{ 0x0002, 0x0002, 0x0132 },
{ 0x0146, 0x015A, 0x016E },
{ 0x0002, 0x0002, 0x0182 },
};
AnimationHeader gChildZeldaAnim_01AE88 = { { 20 }, sChildZeldaAnim_01AE88FrameData, sChildZeldaAnim_01AE88JointIndices, 6 };
static u8 unaccounted_01AE98[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01B874FrameData[1204] = {
0x0000, 0x09DD, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, 0x008F, 0x0126,
0x01D8, 0x0293, 0x0343, 0x03D5, 0x0437, 0x0464, 0x046A, 0x0457, 0x0437, 0x0418, 0x0405, 0x040B, 0x0437, 0x0499,
0x052C, 0x05DC, 0x0696, 0x0749, 0x07DF, 0x0848, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F, 0x086F,
0x086F, 0x09DD, 0x09DE, 0x09DE, 0x09DF, 0x09DF, 0x09E0, 0x09E0, 0x09E0, 0x09E0, 0x09E1, 0x09E1, 0x09E1, 0x09E1,
0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E1,
0x09E1, 0x09E1, 0x09E1, 0x09E0, 0x09E0, 0x09E0, 0x09E0, 0x09DF, 0x09DF, 0x09DE, 0x09DE, 0x09DD, 0x09DD, 0xFFF0,
0xFFC4, 0xFF7C, 0xFF1A, 0xFEA0, 0xFE0E, 0xFD67, 0xFCAC, 0xFBDE, 0xFB00, 0xFA12, 0xF916, 0xF80F, 0xF6FC, 0xF5E0,
0xF4BC, 0xF393, 0xF264, 0xF133, 0xF000, 0xEECD, 0xED9C, 0xEC6D, 0xEB44, 0xEA20, 0xE904, 0xE7F1, 0xE6EA, 0xE5EE,
0xE500, 0xE422, 0xE354, 0xE299, 0xE1F2, 0xE160, 0xE0E5, 0xE083, 0xE03B, 0xE00F, 0xE000, 0xBF0F, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF10, 0xBF12, 0xBF14, 0xBF17, 0xBF18, 0xBF18,
0xBF15, 0xBF12, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0F, 0xBF12, 0xBF16, 0xBF1A,
0xBF1C, 0xBF1B, 0xBF18, 0xBF13, 0xBF10, 0xBF0E, 0xBF0E, 0xBF0E, 0xBF0F, 0x0000, 0x0001, 0x0001, 0x0002, 0x0003,
0x0004, 0x0003, 0x0000, 0xFFFA, 0xFFF0, 0xFFE3, 0xFFD2, 0xFFBF, 0xFFAB, 0xFF9A, 0xFF8D, 0xFF88, 0xFF8E, 0xFF9C,
0xFFB2, 0xFFCB, 0xFFE4, 0xFFF8, 0x0000, 0xFFF9, 0xFFE3, 0xFFC4, 0xFF9F, 0xFF7A, 0xFF5A, 0xFF43, 0xFF3C, 0xFF44,
0xFF5A, 0xFF78, 0xFF9B, 0xFFBF, 0xFFDE, 0xFFF5, 0x0000, 0xC00C, 0xC029, 0xC04E, 0xC06F, 0xC082, 0xC07D, 0xC055,
0xC000, 0xBF62, 0xBE7D, 0xBD74, 0xBC67, 0xBB72, 0xBAAC, 0xBA2C, 0xBA05, 0xBA4F, 0xBAFC, 0xBBEC, 0xBD00, 0xBE15,
0xBF0A, 0xBFB9, 0xC000, 0xBFC7, 0xBF28, 0xBE46, 0xBD42, 0xBC3E, 0xBB5B, 0xBAB8, 0xBA73, 0xBA9B, 0xBB1B, 0xBBDE,
0xBCCE, 0xBDD1, 0xBEC7, 0xBF8E, 0xC000, 0xFFFE, 0xFFF8, 0xFFF1, 0xFFEB, 0xFFE8, 0xFFEA, 0xFFF0, 0x0000, 0x0021,
0x005A, 0x00A6, 0x00FD, 0x0153, 0x019D, 0x01CE, 0x01DE, 0x01C2, 0x0180, 0x0128, 0x00CA, 0x0076, 0x0035, 0x000D,
0xFFFF, 0x000A, 0x002E, 0x0069, 0x00B8, 0x0111, 0x0164, 0x01A5, 0x01C1, 0x01B2, 0x0181, 0x0139, 0x00E5, 0x0091,
0x004B, 0x0019, 0x0000, 0x000F, 0x0033, 0x0060, 0x0088, 0x00A0, 0x0099, 0x0068, 0x0000, 0xFF3E, 0xFE26, 0xFCE1,
0xFB99, 0xFA6F, 0xF980, 0xF8E5, 0xF8B6, 0xF90F, 0xF9E1, 0xFB05, 0xFC56, 0xFDA9, 0xFED6, 0xFFAE, 0x0006, 0xFFC1,
0xFEFE, 0xFDE8, 0xFCAA, 0xFB6E, 0xFA5A, 0xF994, 0xF940, 0xF971, 0xFA0C, 0xFAF9, 0xFC1D, 0xFD58, 0xFE84, 0xFF78,
0x0003, 0xF733, 0xF764, 0xF79D, 0xF7D4, 0xF7FC, 0xF809, 0xF7F0, 0xF7A9, 0xF724, 0xF676, 0xF5C9, 0xF534, 0xF4C1,
0xF474, 0xF44F, 0xF452, 0xF484, 0xF4E0, 0xF561, 0xF5FE, 0xF6B1, 0xF767, 0xF7FD, 0xF83F, 0xF80A, 0xF784, 0xF6E1,
0xF644, 0xF5BF, 0xF558, 0xF511, 0xF4ED, 0xF4EE, 0xF50E, 0xF54B, 0xF5A6, 0xF61C, 0xF6A0, 0xF71A, 0xF75C, 0x0BE5,
0x0B92, 0x0B32, 0x0AD7, 0x0A97, 0x0A88, 0x0AC0, 0x0B4A, 0x0C46, 0x0D8C, 0x0ED3, 0x0FF1, 0x10D5, 0x117A, 0x11DE,
0x11FE, 0x11CD, 0x1149, 0x1077, 0x0F5F, 0x0E13, 0x0CBA, 0x0B9B, 0x0B22, 0x0B97, 0x0CB2, 0x0E0E, 0x0F62, 0x1088,
0x116A, 0x1201, 0x1244, 0x1231, 0x11D4, 0x1134, 0x1055, 0x0F41, 0x0E13, 0x0D02, 0x0C61, 0xFFFE, 0xFFF7, 0xFFF0,
0xFFE8, 0xFFE4, 0xFFE6, 0xFFEF, 0x0000, 0x001B, 0x0033, 0x0025, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000,
0x0006, 0x0000, 0x0003, 0x002E, 0x0024, 0x000D, 0x0001, 0x000B, 0x0021, 0x0030, 0x0003, 0x0000, 0x0000, 0x0000,
0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x003E, 0x0032, 0x0016, 0x0000, 0x000E, 0x0032, 0x005F, 0x0088, 0x009F,
0x0099, 0x0068, 0x0000, 0xFF3E, 0xFE22, 0xFCD8, 0xFB8C, 0xFA5F, 0xF96D, 0xF8D1, 0xF8A0, 0xF8F9, 0xF9CB, 0xFAF1,
0xFC43, 0xFD9B, 0xFECA, 0xFFA3, 0xFFFA, 0xFFB3, 0xFEEE, 0xFDD4, 0xFC90, 0xFB50, 0xFA39, 0xF970, 0xF91C, 0xF94E,
0xF9EB, 0xFADB, 0xFC03, 0xFD46, 0xFE79, 0xFF70, 0xFFFD, 0xF740, 0xF736, 0xF724, 0xF714, 0xF70E, 0xF71D, 0xF74B,
0xF7A8, 0xF85E, 0xF9A4, 0xFC1D, 0xFE00, 0xFE08, 0xFE12, 0xFE1C, 0xFDFC, 0xFE21, 0xFDF1, 0xFE04, 0xFDC3, 0xFABF,
0xF8FB, 0xF807, 0xF7AB, 0xF7E7, 0xF8B3, 0xFA27, 0xFDAF, 0xFDF9, 0xFE1A, 0xFE31, 0xFE15, 0xFE0E, 0xFE21, 0xFE06,
0xFDE8, 0xFA33, 0xF884, 0xF77C, 0xF6F5, 0x0C34, 0x0C44, 0x0C5F, 0x0C75, 0x0C76, 0x0C51, 0x0BF4, 0x0B48, 0x09FD,
0x07B5, 0x0350, 0x0000, 0x0000, 0x0000, 0x0000, 0x0042, 0x0000, 0x0042, 0x0000, 0x0043, 0x0569, 0x0854, 0x09D7,
0x0A60, 0x09F9, 0x08AF, 0x064B, 0x0042, 0x0000, 0x0000, 0x0000, 0x0042, 0x0042, 0x0000, 0x0000, 0x0000, 0x0664,
0x093E, 0x0B00, 0x0BF3, 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0006, 0x0004, 0x0000, 0xFFF9, 0xFFEE, 0xFFE1,
0xFFD3, 0xFFC6, 0xFFBA, 0xFFB3, 0xFFB0, 0xFFB4, 0xFFBE, 0xFFCC, 0xFFDC, 0xFFEC, 0xFFF9, 0x0000, 0x0000, 0xFFF6,
0xFFE3, 0xFFCA, 0xFFAF, 0xFF94, 0xFF7D, 0xFF6D, 0xFF66, 0xFF6D, 0xFF7E, 0xFF97, 0xFFB3, 0xFFCF, 0xFFE8, 0xFFF9,
0x0000, 0x000B, 0x0025, 0x0045, 0x0062, 0x0073, 0x006E, 0x004B, 0x0000, 0xFF72, 0xFE9D, 0xFD9D, 0xFC8E, 0xFB8B,
0xFAB1, 0xFA19, 0xF9E0, 0xFA22, 0xFAD0, 0xFBC7, 0xFCE3, 0xFE00, 0xFEFC, 0xFFB2, 0x0000, 0xFFD0, 0xFF3C, 0xFE64,
0xFD69, 0xFC6C, 0xFB8F, 0xFAF2, 0xFAB7, 0xFAF1, 0xFB8A, 0xFC63, 0xFD5B, 0xFE54, 0xFF2D, 0xFFC6, 0x0000, 0xFFFF,
0xFFFE, 0xFFFB, 0xFFF9, 0xFFF8, 0xFFF9, 0xFFFB, 0x0000, 0x000A, 0x0018, 0x0029, 0x003C, 0x004D, 0x005C, 0x0066,
0x006A, 0x0062, 0x004D, 0x0031, 0x0014, 0xFFFB, 0xFFEC, 0xFFEB, 0x0000, 0x0034, 0x0087, 0x00EE, 0x015C, 0x01C6,
0x0220, 0x025F, 0x0276, 0x025B, 0x0214, 0x01AF, 0x013B, 0x00C7, 0x0062, 0x001B, 0x0000, 0xFFF7, 0xFFFF, 0x0010,
0x0025, 0x0034, 0x0038, 0x0029, 0x0000, 0xFFAD, 0xFF32, 0xFE9D, 0xFE00, 0xFD6A, 0xFCEB, 0xFC93, 0xFC72, 0xFC99,
0xFD00, 0xFD92, 0xFE39, 0xFEE0, 0xFF72, 0xFFD9, 0x0000, 0xFFD9, 0xFF72, 0xFEE0, 0xFE39, 0xFD92, 0xFD00, 0xFC99,
0xFC72, 0xFC99, 0xFCFF, 0xFD90, 0xFE37, 0xFEDE, 0xFF70, 0xFFD7, 0x0000, 0xFE2A, 0xFDFB, 0xFDB5, 0xFD5E, 0xFCFD,
0xFC94, 0xFC25, 0xFBB2, 0xFB3E, 0xFAC8, 0xFA54, 0xF9E2, 0xF976, 0xF912, 0xF8BB, 0xF873, 0xF83B, 0xF812, 0xF7F8,
0xF7EE, 0xF7F3, 0xF807, 0xF82C, 0xF866, 0xF8CE, 0xF974, 0xFA4A, 0xFB3B, 0xFC31, 0xFD13, 0xFDCE, 0xFE4F, 0xFEA0,
0xFED9, 0xFEFF, 0xFF14, 0xFF1C, 0xFF20, 0xFF26, 0xFF36, 0xF4D7, 0xF4C2, 0xF4A1, 0xF477, 0xF443, 0xF408, 0xF3C6,
0xF380, 0xF337, 0xF2ED, 0xF2A2, 0xF259, 0xF214, 0xF1D5, 0xF19D, 0xF16F, 0xF140, 0xF10E, 0xF0E1, 0xF0C2, 0xF0B9,
0xF0CE, 0xF108, 0xF16D, 0xF212, 0xF2FA, 0xF40B, 0xF52F, 0xF64F, 0xF757, 0xF834, 0xF8D3, 0xF934, 0xF96C, 0xF986,
0xF98C, 0xF989, 0xF986, 0xF990, 0xF9B3, 0x850B, 0x85A1, 0x867B, 0x8779, 0x8883, 0x8989, 0x8A80, 0x8B62, 0x8C24,
0x8CC9, 0x8D56, 0x8DD5, 0x8E4B, 0x8EBD, 0x8F30, 0x8FA8, 0x904A, 0x9123, 0x9210, 0x92EF, 0x939C, 0x93F2, 0x93C9,
0x92F4, 0x9114, 0x8E14, 0x8A34, 0x85BC, 0x80F7, 0x7C39, 0x77EB, 0x74AB, 0x72A4, 0x715D, 0x70C2, 0x70B2, 0x70FE,
0x7162, 0x7193, 0x7141, 0xF1F8, 0xF0B3, 0xEEDC, 0xECB3, 0xEA64, 0xE80D, 0xE5C0, 0xE389, 0xE16F, 0xDF76, 0xDDA3,
0xDBF7, 0xDA79, 0xD92D, 0xD817, 0xD73E, 0xD6B5, 0xD680, 0xD683, 0xD6A7, 0xD6D4, 0xD6F8, 0xD708, 0xD706, 0xD734,
0xD7F5, 0xD982, 0xDBFD, 0xDF66, 0xE38D, 0xE7FF, 0xEBC2, 0xEE80, 0xF0CD, 0xF281, 0xF38C, 0xF40A, 0xF43A, 0xF476,
0xF51B, 0xFF93, 0xFF07, 0xFE5E, 0xFD9C, 0xFCC7, 0xFBE2, 0xFAF1, 0xF9F8, 0xF8FC, 0xF800, 0xF709, 0xF61A, 0xF538,
0xF467, 0xF3AB, 0xF308, 0xF281, 0xF21D, 0xF1DD, 0xF1C7, 0xF1DD, 0xF21D, 0xF282, 0xF308, 0xF3AC, 0xF468, 0xF53A,
0xF61C, 0xF70B, 0xF803, 0xF8FF, 0xF9FB, 0xFAF4, 0xFBE5, 0xFCCA, 0xFD9F, 0xFE60, 0xFF08, 0xFF94, 0x0000, 0xFF93,
0xFF07, 0xFE5E, 0xFD9C, 0xFCC7, 0xFBE2, 0xFAF1, 0xF9F8, 0xF8FC, 0xF800, 0xF709, 0xF61A, 0xF538, 0xF467, 0xF3AB,
0xF308, 0xF281, 0xF21D, 0xF1DD, 0xF1C7, 0xF1DD, 0xF21D, 0xF282, 0xF308, 0xF3AC, 0xF468, 0xF53A, 0xF61C, 0xF70B,
0xF803, 0xF8FF, 0xF9FB, 0xFAF4, 0xFBE5, 0xFCCA, 0xFD9F, 0xFE60, 0xFF08, 0xFF94, 0x0000, 0xF573, 0xF744, 0xF9AB,
0xFC83, 0xFFB2, 0x0321, 0x06B7, 0x0A5F, 0x0E03, 0x1191, 0x14F6, 0x1822, 0x1B03, 0x1DA3, 0x2005, 0x220E, 0x234E,
0x23A7, 0x2378, 0x231E, 0x22E5, 0x230A, 0x23C0, 0x253C, 0x27CA, 0x2B69, 0x2FE3, 0x34EB, 0x3A2D, 0xBF60, 0xC43C,
0xC833, 0xCAC7, 0xCC16, 0xCC41, 0xCBA2, 0xCAB5, 0xC9EF, 0xC9AD, 0xCA35, 0x0D9A, 0x0E14, 0x0EA8, 0x0F2B, 0x0F87,
0x0FB5, 0x0FB4, 0x0F8F, 0x0F55, 0x0F18, 0x0EE7, 0x0ED0, 0x0EDC, 0x0EF7, 0x0F0B, 0x0F19, 0x0EFB, 0x0E98, 0x0E01,
0x0D52, 0x0CAF, 0x0C45, 0x0C42, 0x0CE4, 0x0E7C, 0x1123, 0x14BE, 0x1908, 0x1DA1, 0x5DE4, 0x59F6, 0x5708, 0x552D,
0x5418, 0x53AC, 0x53C9, 0x5447, 0x54F9, 0x55AA, 0x562A, 0x862A, 0x87E9, 0x8A47, 0x8CEB, 0x8FA1, 0x923F, 0x94A8,
0x96C3, 0x9880, 0x99DA, 0x9ADB, 0x9B94, 0x9C13, 0x9C55, 0x9C4F, 0x9C08, 0x9B67, 0x9A73, 0x9958, 0x983B, 0x973B,
0x9674, 0x95FC, 0x95E3, 0x9633, 0x96DB, 0x97D3, 0x9929, 0x9AF3, 0x1D3A, 0x1FD8, 0x2218, 0x2341, 0x2336, 0x220C,
0x201F, 0x1DED, 0x1BE8, 0x1A77, 0x1A07, 0xEF2C, 0xEBD7, 0xE774, 0xE2B1, 0xDDE6, 0xD944, 0xD4E6, 0xD0DF, 0xCD3F,
0xCA0D, 0xC74D, 0xC500, 0xC322, 0xC1AA, 0xC08F, 0xBFC4, 0xBF5F, 0xBF61, 0xBFA7, 0xC015, 0xC083, 0xC0B9, 0xC07F,
0xBFB8, 0xBE89, 0xBD9F, 0xBDBB, 0xBF55, 0xC27D, 0xC6D1, 0xCB8D, 0xCF93, 0xD223, 0xD363, 0xD37F, 0xD2CC, 0xD1AB,
0xD079, 0xCF8A, 0xCF27, 0xFFFC, 0xFFF2, 0xFFE5, 0xFFDA, 0xFFD3, 0xFFD5, 0xFFE3, 0x0000, 0x0037, 0x008A, 0x00ED,
0x0156, 0x01BB, 0x0210, 0x024B, 0x0261, 0x0246, 0x0201, 0x01A0, 0x0130, 0x00C1, 0x005F, 0x001A, 0x0000, 0x000B,
0x002A, 0x005D, 0x00A2, 0x00F9, 0x0161, 0x01D9, 0x0261, 0x030F, 0x03EF, 0x04ED, 0x05F6, 0x06F4, 0x07D3, 0x087F,
0x08E4, 0xFFDB, 0xFFBD, 0xFFA9, 0xFF9F, 0xFFA1, 0xFFB1, 0xFFD0, 0x0000, 0x0053, 0x00CE, 0x0163, 0x0200, 0x0296,
0x0315, 0x036D, 0x038E, 0x0367, 0x0300, 0x026E, 0x01C7, 0x0120, 0x008E, 0x0027, 0x0000, 0x0027, 0x008E, 0x0120,
0x01C7, 0x026E, 0x0300, 0x0367, 0x038E, 0x036B, 0x030C, 0x0285, 0x01E7, 0x0145, 0x00B2, 0x0040, 0x0000, 0x0000,
};
static JointIndex sChildZeldaAnim_01B874JointIndices[18] = {
{ 0x0003, 0x002B, 0x0000 },
{ 0x0000, 0x0053, 0x0000 },
{ 0x007B, 0x00A3, 0x00CB },
{ 0x00F3, 0x011B, 0x0143 },
{ 0x0000, 0x0000, 0x016B },
{ 0x0193, 0x01BB, 0x01E3 },
{ 0x0000, 0x0000, 0x020B },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0233, 0x025B, 0x0283 },
{ 0x0002, 0x02AB, 0x0002 },
{ 0x02D3, 0x02FB, 0x0323 },
{ 0x0000, 0x0000, 0x034B },
{ 0x0000, 0x0373, 0x039B },
{ 0x03C3, 0x03EB, 0x0413 },
{ 0x0000, 0x0000, 0x043B },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0463, 0x0000, 0x048B },
};
AnimationHeader gChildZeldaAnim_01B874 = { { 40 }, sChildZeldaAnim_01B874FrameData, sChildZeldaAnim_01B874JointIndices, 3 };
static u8 unaccounted_01B884[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01BCF0FrameData[506] = {
0x086F, 0x09DC, 0x0000, 0xE000, 0x4000, 0x09DC, 0x09DA, 0x09D7, 0x09D3, 0x09D0, 0x09CC, 0x09C9, 0x09C6, 0x09C5,
0x09C4, 0x09C5, 0x09C6, 0x09C9, 0x09CC, 0x09D0, 0x09D3, 0x09D7, 0x09D9, 0x09DC, 0x09DD, 0xBF0F, 0xBF10, 0xBF10,
0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF0F, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0x0004, 0x0007, 0x0008, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0008,
0x0007, 0x0007, 0x0005, 0x0004, 0x0003, 0x0002, 0x0001, 0x0000, 0x0000, 0xC035, 0xC060, 0xC080, 0xC098, 0xC0A8,
0xC0B0, 0xC0B1, 0xC0AD, 0xC0A3, 0xC096, 0xC085, 0xC072, 0xC05F, 0xC04B, 0xC037, 0xC026, 0xC016, 0xC00B, 0xC003,
0xC000, 0xFFF5, 0xFFEB, 0xFFE3, 0xFFDC, 0xFFD6, 0xFFD2, 0xFFD0, 0xFFCF, 0xFFD1, 0xFFD4, 0xFFD9, 0xFFDF, 0xFFE5,
0xFFEB, 0xFFF1, 0xFFF6, 0xFFFA, 0xFFFD, 0xFFFF, 0x0000, 0x0043, 0x0077, 0x009F, 0x00BB, 0x00CE, 0x00D7, 0x00D8,
0x00D3, 0x00C7, 0x00B7, 0x00A3, 0x008C, 0x0075, 0x005D, 0x0045, 0x0030, 0x001E, 0x000F, 0x0006, 0x0003, 0xF758,
0xF725, 0xF6D1, 0xF669, 0xF5F9, 0xF58B, 0xF528, 0xF4D7, 0xF49F, 0xF485, 0xF48F, 0xF4B7, 0xF4F8, 0xF54D, 0xF5AE,
0xF617, 0xF680, 0xF6DF, 0xF72A, 0xF756, 0x0C4C, 0x0C8F, 0x0D13, 0x0DBF, 0x0E7E, 0x0F3C, 0x0FEA, 0x107B, 0x10E2,
0x1115, 0x110C, 0x10CE, 0x1065, 0x0FDB, 0x0F39, 0x0E8A, 0x0DDA, 0x0D39, 0x0CB8, 0x0C6C, 0xFFF5, 0xFFEA, 0xFFE1,
0xFFD9, 0xFFD2, 0xFFCE, 0xFFCB, 0xFFCB, 0xFFCD, 0xFFD2, 0xFFD7, 0xFFDE, 0xFFE5, 0xFFEC, 0xFFF2, 0xFFF7, 0xFFFB,
0xFFFE, 0x0000, 0x0000, 0x003F, 0x0074, 0x009C, 0x00B9, 0x00CC, 0x00D5, 0x00D7, 0x00D1, 0x00C5, 0x00B5, 0x00A0,
0x008A, 0x0072, 0x0059, 0x0042, 0x002C, 0x0019, 0x000A, 0x0001, 0xFFFD, 0xF69F, 0xF630, 0xF5B7, 0xF53A, 0xF4C3,
0xF457, 0xF3FB, 0xF3B5, 0xF389, 0xF37E, 0xF396, 0xF3CE, 0xF420, 0xF486, 0xF4FB, 0xF577, 0xF5F3, 0xF664, 0xF6BD,
0xF6EF, 0x0C9E, 0x0D70, 0x0E53, 0x0F38, 0x1010, 0x10D2, 0x1174, 0x11ED, 0x1235, 0x1243, 0x1212, 0x11A8, 0x1111,
0x1057, 0x0F82, 0x0EA1, 0x0DC2, 0x0CF7, 0x0C57, 0x0BFF, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0006, 0x0006,
0x0006, 0x0006, 0x0005, 0x0005, 0x0004, 0x0003, 0x0003, 0x0002, 0x0002, 0x0001, 0x0001, 0x0000, 0x0000, 0xFF48,
0xFF4D, 0xFF47, 0xFF3B, 0xFF2B, 0xFF19, 0xFF08, 0xFEF9, 0xFEED, 0xFEE4, 0xFEE0, 0xFEE1, 0xFEE5, 0xFEED, 0xFEF8,
0xFF05, 0xFF14, 0xFF22, 0xFF2D, 0xFF35, 0xF9E2, 0xFA07, 0xFA24, 0xFA39, 0xFA46, 0xFA4C, 0xFA4D, 0xFA48, 0xFA3F,
0xFA33, 0xFA25, 0xFA15, 0xFA03, 0xF9F2, 0xF9E2, 0xF9D3, 0xF9C6, 0xF9BC, 0xF9B5, 0xF9B3, 0x70BD, 0x708E, 0x70A5,
0x70EC, 0x714C, 0x71B7, 0x721F, 0x727E, 0x72CB, 0x72FF, 0x7317, 0x7315, 0x72FD, 0x72D2, 0x7297, 0x7250, 0x7203,
0x71B7, 0x7174, 0x7148, 0xF5C4, 0xF5C4, 0xF53C, 0xF45B, 0xF350, 0xF23F, 0xF140, 0xF067, 0xEFC4, 0xEF66, 0xEF59,
0xEF90, 0xF001, 0xF09F, 0xF160, 0xF238, 0xF318, 0xF3ED, 0xF49D, 0xF50B, 0x0051, 0x0092, 0x00C5, 0x00E9, 0x0101,
0x010E, 0x0111, 0x010B, 0x00FE, 0x00EC, 0x00D4, 0x00B9, 0x009C, 0x007E, 0x0061, 0x0045, 0x002C, 0x0018, 0x0009,
0x0001, 0x0051, 0x0092, 0x00C5, 0x00E9, 0x0101, 0x010E, 0x0111, 0x010B, 0x00FE, 0x00EC, 0x00D4, 0x00B9, 0x009C,
0x007E, 0x0061, 0x0045, 0x002C, 0x0018, 0x0009, 0x0001, 0xCB20, 0xCBDC, 0xCC6F, 0xCCDC, 0xCD24, 0xCD4B, 0xCD54,
0xCD42, 0xCD19, 0xCCDD, 0xCC92, 0xCC40, 0xCBEA, 0xCB92, 0xCB3D, 0xCAEE, 0xCAA9, 0xCA71, 0xCA4A, 0xCA37, 0x5677,
0x56AF, 0x56D5, 0x56EC, 0x56F7, 0x56FA, 0x56F6, 0x56EE, 0x56E2, 0x56D4, 0x56C3, 0x56AE, 0x5696, 0x567D, 0x5663,
0x564C, 0x5639, 0x562B, 0x5625, 0x5628, 0x1A35, 0x1A49, 0x1A4B, 0x1A43, 0x1A36, 0x1A2A, 0x1A21, 0x1A1C, 0x1A1B,
0x1A1F, 0x1A23, 0x1A23, 0x1A1E, 0x1A16, 0x1A0C, 0x1A02, 0x19FA, 0x19F6, 0x19F8, 0x1A03, 0xCF26, 0xCF27, 0xCF29,
0xCF2B, 0xCF2D, 0xCF2F, 0xCF2F, 0xCF2F, 0xCF2F, 0xCF2E, 0xCF2C, 0xCF2B, 0xCF2A, 0xCF2A, 0xCF2A, 0xCF29, 0xCF29,
0xCF29, 0xCF29, 0xCF28, 0x0919, 0x0943, 0x0963, 0x097B, 0x098B, 0x0993, 0x0995, 0x0991, 0x0989, 0x097D, 0x096E,
0x095C, 0x0949, 0x0936, 0x0923, 0x0910, 0x0900, 0x08F3, 0x08E9, 0x08E4, 0xFFE3, 0xFFCC, 0xFFBA, 0xFFAD, 0xFFA5,
0xFFA0, 0xFF9F, 0xFFA1, 0xFFA6, 0xFFAC, 0xFFB5, 0xFFBE, 0xFFC9, 0xFFD3, 0xFFDE, 0xFFE7, 0xFFF0, 0xFFF8, 0xFFFD,
0x0000, 0x0000,
};
static JointIndex sChildZeldaAnim_01BCF0JointIndices[18] = {
{ 0x0000, 0x0005, 0x0002 },
{ 0x0002, 0x0003, 0x0002 },
{ 0x0019, 0x002D, 0x0041 },
{ 0x0055, 0x0069, 0x007D },
{ 0x0002, 0x0002, 0x0091 },
{ 0x00A5, 0x00B9, 0x00CD },
{ 0x0002, 0x0002, 0x00E1 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0004, 0x00F5, 0x0004 },
{ 0x0109, 0x011D, 0x0131 },
{ 0x0002, 0x0002, 0x0145 },
{ 0x0002, 0x0159, 0x016D },
{ 0x0181, 0x0195, 0x01A9 },
{ 0x0002, 0x0002, 0x01BD },
{ 0x0002, 0x0002, 0x0002 },
{ 0x01D1, 0x0002, 0x01E5 },
};
AnimationHeader gChildZeldaAnim_01BCF0 = { { 20 }, sChildZeldaAnim_01BCF0FrameData, sChildZeldaAnim_01BCF0JointIndices, 5 };
static s16 sChildZeldaAnim_01C494FrameData[916] = {
0x0001, 0x09DC, 0x0000, 0xC000, 0x4000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x09DC, 0x09DB,
0x09D9, 0x09D8, 0x09D6, 0x09D4, 0x09D2, 0x09D0, 0x09CE, 0x09CC, 0x09CA, 0x09C8, 0x09C7, 0x09C6, 0x09C5, 0x09C4,
0x09C4, 0x09C6, 0x09CB, 0x09D1, 0x09D7, 0x09DC, 0x09DF, 0x09E0, 0x09E1, 0x09E2, 0x09E2, 0x09E2, 0x09E2, 0x09E2,
0x09E1, 0x09E0, 0x09DF, 0x09DE, 0x09DD, 0x0000, 0x0000, 0x0001, 0x0002, 0x0002, 0x0003, 0x0004, 0x0004, 0x0005,
0x0005, 0x0005, 0x0005, 0x0005, 0x0004, 0x0003, 0x0002, 0x0000, 0xFFFB, 0xFFF1, 0xFFE5, 0xFFDA, 0xFFD1, 0xFFCE,
0xFFCF, 0xFFD1, 0xFFD5, 0xFFD9, 0xFFDE, 0xFFE4, 0xFFE9, 0xFFEF, 0xFFF5, 0xFFF9, 0xFFFD, 0x0000, 0xBF0F, 0xBF0F,
0xBF0F, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF11, 0xBF11, 0xBF11, 0xBF11, 0xBF11, 0xBF11, 0xBF11, 0xBF10, 0xBF10,
0xBF0F, 0xBF0D, 0xBF0A, 0xBF06, 0xBF03, 0xBF00, 0xBEFF, 0xBEFF, 0xBF00, 0xBF01, 0xBF02, 0xBF04, 0xBF06, 0xBF08,
0xBF0A, 0xBF0B, 0xBF0D, 0xBF0E, 0xBF0F, 0x0001, 0x0002, 0x0004, 0x0007, 0x000B, 0x000E, 0x0011, 0x0014, 0x0017,
0x0019, 0x001A, 0x001A, 0x0018, 0x0015, 0x0010, 0x0009, 0x0000, 0xFFE7, 0xFFBA, 0xFF82, 0xFF4D, 0xFF26, 0xFF16,
0xFF1A, 0xFF25, 0xFF35, 0xFF4A, 0xFF62, 0xFF7C, 0xFF97, 0xFFB1, 0xFFCA, 0xFFE0, 0xFFF3, 0x0000, 0xF6F1, 0xF6C3,
0xF68B, 0xF64E, 0xF60C, 0xF5C9, 0xF586, 0xF544, 0xF504, 0xF4C9, 0xF492, 0xF462, 0xF438, 0xF417, 0xF3FF, 0xF3F1,
0xF3EE, 0xF425, 0xF4AE, 0xF571, 0xF64D, 0xF718, 0xF792, 0xF7C5, 0xF7E9, 0xF7FF, 0xF808, 0xF805, 0xF7F7, 0xF7E0,
0xF7C1, 0xF79C, 0xF772, 0xF744, 0xF714, 0x0C5C, 0x0CAE, 0x0D0F, 0x0D7B, 0x0DED, 0x0E63, 0x0ED9, 0x0F4C, 0x0FBB,
0x1023, 0x1083, 0x10D8, 0x1121, 0x115C, 0x1188, 0x11A2, 0x11A9, 0x114F, 0x1068, 0x0F20, 0x0DA9, 0x0C4D, 0x0B78,
0x0B1D, 0x0ADB, 0x0AB0, 0x0A9B, 0x0A9A, 0x0AAC, 0x0ACE, 0x0AFE, 0x0B39, 0x0B7E, 0x0BCA, 0x0C1D, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0xF714, 0xF6E6, 0xF6AF, 0xF672, 0xF631, 0xF5EF, 0xF5AC, 0xF56A, 0xF52B,
0xF4F0, 0xF4BA, 0xF48A, 0xF461, 0xF440, 0xF428, 0xF41B, 0xF418, 0xF44F, 0xF4D9, 0xF59B, 0xF676, 0xF73F, 0xF7B9,
0xF7EB, 0xF80E, 0xF824, 0xF82C, 0xF829, 0xF81B, 0xF803, 0xF7E5, 0xF7C0, 0xF796, 0xF769, 0xF738, 0x0C7F, 0x0CD1,
0x0D31, 0x0D9C, 0x0E0D, 0x0E82, 0x0EF7, 0x0F69, 0x0FD8, 0x103F, 0x109E, 0x10F3, 0x113C, 0x1176, 0x11A2, 0x11BC,
0x11C3, 0x1169, 0x1084, 0x0F3E, 0x0DCA, 0x0C71, 0x0B9E, 0x0B45, 0x0B04, 0x0AD9, 0x0AC5, 0x0AC4, 0x0AD6, 0x0AF7,
0x0B27, 0x0B61, 0x0BA5, 0x0BF0, 0x0C42, 0xEAC6, 0xEB13, 0xEB8C, 0xEC29, 0xECE4, 0xEDB7, 0xEE9A, 0xEF88, 0xF078,
0xF166, 0xF249, 0xF31C, 0xF3D7, 0xF474, 0xF4ED, 0xF53A, 0xF555, 0xFBC9, 0x07C5, 0x0E39, 0x0CE4, 0x09B7, 0x05EE,
0x02C1, 0x016C, 0x016C, 0x016C, 0x016C, 0x016C, 0x016C, 0x0204, 0x036D, 0x051C, 0x0685, 0x071C, 0x20D8, 0x216F,
0x2211, 0x22B7, 0x226B, 0x1FFE, 0x213C, 0x20DE, 0x20C3, 0x1EAC, 0x1CB4, 0x1BA7, 0x1B08, 0x1A9F, 0x1BA2, 0x19BC,
0x186A, 0x1DEC, 0x1A8B, 0x1727, 0x15EF, 0x1518, 0x160B, 0x170F, 0x190A, 0x1CDC, 0x2216, 0x288D, 0x2E97, 0x311D,
0x31CF, 0x3390, 0x3572, 0x36D4, 0x374D, 0xFAD8, 0xF9E4, 0xF88F, 0xF6E8, 0xF57E, 0xF516, 0xF257, 0xF063, 0xEE2F,
0xED1A, 0xEC06, 0xEA79, 0xE8D5, 0xE756, 0xE553, 0xE5AB, 0xE64A, 0xDF28, 0xDDD1, 0xDF74, 0xE43E, 0xEFBE, 0xFC23,
0x0194, 0x0031, 0xFD9E, 0xFA84, 0xF764, 0xF529, 0xF461, 0xF43D, 0xF40C, 0xF3FC, 0xF409, 0xF40F, 0x52F1, 0x5304,
0x534B, 0x53BD, 0x54EA, 0x578C, 0x57E3, 0x5944, 0x5A75, 0x5CE3, 0x5F25, 0x60B9, 0x61EB, 0x62D7, 0x62B5, 0x642A,
0x6500, 0x664F, 0x6F23, 0x7310, 0x71C8, 0x6E20, 0x6976, 0x66B4, 0x658D, 0x63B9, 0x60E6, 0x5D02, 0x591C, 0x577E,
0x5772, 0x5718, 0x56CF, 0x56B5, 0x56BB, 0xBDC7, 0xBD08, 0xBBE7, 0xBA7B, 0xB8DA, 0xB719, 0xB54B, 0xB382, 0xB1CC,
0xB037, 0xAECC, 0xAD94, 0xAC94, 0xABD0, 0xAB4B, 0xAB07, 0xAB08, 0xB144, 0xBE60, 0xC6CA, 0xC423, 0xC06D, 0xC10C,
0xC14B, 0xBF9F, 0xBF5C, 0xBF04, 0xBE9E, 0xBE2E, 0xBDBA, 0xBDEC, 0xBF08, 0xC07B, 0xC1B3, 0xC21A, 0x11DF, 0x120B,
0x1222, 0x11DE, 0x1121, 0x0FFE, 0x0E8A, 0x0CD9, 0x0AFF, 0x0911, 0x0723, 0x0549, 0x0398, 0x0224, 0x0101, 0x0044,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0xFF43, 0xFD7F, 0xFB64, 0xF9A1, 0xF8E4, 0xED06, 0xEACC, 0xE99A, 0xE9ED, 0xEAD7, 0xEC3F, 0xEE0A, 0xF021, 0xF26B,
0xF4CD, 0xF72F, 0xF978, 0xFB8F, 0xFD5B, 0xFEC2, 0xFFAC, 0x0000, 0xFA78, 0xF033, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB,
0xEAAB, 0xEAAB, 0xE757, 0xDF67, 0xD5EE, 0xCDFF, 0xCAAB, 0xCAAB, 0xCAAB, 0xCAAB, 0xCAAB, 0xCAAB, 0xD56D, 0xD599,
0xD5B0, 0xD64E, 0xD808, 0xDAAF, 0xDE14, 0xE206, 0xE658, 0xEAD8, 0xEF59, 0xF3AA, 0xF79D, 0xFB01, 0xFDA8, 0xFF62,
0x0000, 0xF4F0, 0xE065, 0xD555, 0xD613, 0xD7D6, 0xD9F1, 0xDBB4, 0xDC72, 0xDDEC, 0xE173, 0xE5A9, 0xE930, 0xEAAB,
0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB, 0xDFB9, 0xE005, 0xE075, 0xE108, 0xE1BA, 0xE28A, 0xE376, 0xE47C, 0xE599,
0xE6C7, 0xE7FE, 0xE932, 0xEA55, 0xEB55, 0xEC1F, 0xECA0, 0xECC4, 0xEF98, 0xF1BD, 0xF13C, 0xEDDC, 0xE638, 0xDEF8,
0xDB89, 0xD9E2, 0xD7B7, 0xD554, 0xD2E0, 0xD0D3, 0xCFF2, 0xCF82, 0xCE8E, 0xCD85, 0xCCBD, 0xCC75, 0x04C9, 0x053B,
0x05F0, 0x06E0, 0x0800, 0x0948, 0x0AAE, 0x0C27, 0x0DAB, 0x0F2D, 0x10A2, 0x1200, 0x1338, 0x1440, 0x150B, 0x158D,
0x15BB, 0x184E, 0x1B6E, 0x1C5F, 0x19C9, 0x1317, 0x0A82, 0x0688, 0x0787, 0x0884, 0x0984, 0x0A72, 0x0B28, 0x0B7D,
0x0B93, 0x0BA0, 0x0B97, 0x0B81, 0x0B7A, 0x536C, 0x5409, 0x54FB, 0x5633, 0x57A2, 0x593C, 0x5AF2, 0x5CBA, 0x5E8A,
0x6055, 0x6210, 0x63AE, 0x6522, 0x665C, 0x6749, 0x67D7, 0x67F6, 0x6D90, 0x745F, 0x761E, 0x734F, 0x6C4B, 0x6446,
0x5FAF, 0x5E39, 0x5CF9, 0x5B8D, 0x5A0D, 0x58C8, 0x584D, 0x586F, 0x58A1, 0x58E5, 0x592A, 0x594E, 0xBD98, 0xBCDA,
0xBBBA, 0xBA4F, 0xB8B0, 0xB6F1, 0xB525, 0xB35D, 0xB1AA, 0xB016, 0xAEAD, 0xAD76, 0xAC77, 0xABB3, 0xAB2E, 0xAAEA,
0xAAEA, 0xB11D, 0xBE23, 0xC67C, 0xC3DA, 0xC029, 0xC0C4, 0xC100, 0xBF58, 0xBF15, 0xBEBD, 0xBE57, 0xBDE8, 0xBD74,
0xBDA5, 0xBEBE, 0xC02D, 0xC162, 0xC1C7, 0xF57C, 0xF5E3, 0xF67C, 0xF736, 0xF800, 0xF8CA, 0xF984, 0xFA1D, 0xFA84,
0xFAAB, 0xFAF6, 0xFBB9, 0xFCC4, 0xFDE7, 0xFEF1, 0xFFB4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00BD, 0x0281, 0x049C, 0x065F, 0x071C, 0x118A, 0x10E4,
0x0FEF, 0x0EC6, 0x0D83, 0x0C40, 0x0B16, 0x0A22, 0x097C, 0x093F, 0x08BB, 0x0769, 0x059B, 0x03A3, 0x01D5, 0x0083,
0x0000, 0x0588, 0x0FCD, 0x1555, 0x1671, 0x1917, 0x1C3F, 0x1EE4, 0x2000, 0x2238, 0x2782, 0x2DD3, 0x331D, 0x3555,
0x3555, 0x3555, 0x3555, 0x3555, 0x3555, 0xD612, 0xD812, 0xDB04, 0xDE98, 0xE27D, 0xE662, 0xE9F6, 0xECE8, 0xEEE8,
0xEFA5, 0xF08D, 0xF2E3, 0xF615, 0xF990, 0xFCC2, 0xFF18, 0x0000, 0xF4F0, 0xE065, 0xD555, 0xD613, 0xD7D6, 0xD9F1,
0xDBB4, 0xDC72, 0xDDEC, 0xE173, 0xE5A9, 0xE930, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAAB, 0xEAEE, 0xEBAC,
0xECD6, 0xEE5A, 0xF028, 0xF230, 0xF460, 0xF6AA, 0xF8FB, 0xFB45, 0xFD75, 0xFF7D, 0x014B, 0x02CF, 0x03F9, 0x04B7,
0x04FA, 0x00EC, 0xF964, 0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF555, 0xF78D, 0xFCD8, 0x0328, 0x0873, 0x0AAB,
0x0A4C, 0x096A, 0x085D, 0x077B, 0x071C, 0x0000,
};
static JointIndex sChildZeldaAnim_01C494JointIndices[18] = {
{ 0x0005, 0x0028, 0x004B },
{ 0x0002, 0x0002, 0x0002 },
{ 0x006E, 0x0091, 0x0003 },
{ 0x0002, 0x0002, 0x00B4 },
{ 0x0002, 0x0002, 0x00D7 },
{ 0x0002, 0x00FA, 0x011D },
{ 0x0002, 0x0002, 0x0140 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x0004, 0x0163, 0x0004 },
{ 0x0186, 0x01A9, 0x01CC },
{ 0x0002, 0x0002, 0x01EF },
{ 0x0212, 0x0235, 0x0258 },
{ 0x027B, 0x029E, 0x02C1 },
{ 0x0002, 0x0002, 0x02E4 },
{ 0x0307, 0x032A, 0x034D },
{ 0x0002, 0x0002, 0x0370 },
};
AnimationHeader gChildZeldaAnim_01C494 = { { 35 }, sChildZeldaAnim_01C494FrameData, sChildZeldaAnim_01C494JointIndices, 5 };
static u8 unaccounted_01C4A4[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static s16 sChildZeldaAnim_01C7B0FrameData[330] = {
0x0000, 0x09DB, 0x0002, 0xC000, 0x4000, 0x071C, 0xF8E4, 0xCAAB, 0xEAAB, 0x3555, 0x09DB, 0x09D9, 0x09D6, 0x09D2,
0x09CF, 0x09CC, 0x09C9, 0x09C6, 0x09C5, 0x09C4, 0x09C5, 0x09C6, 0x09C9, 0x09CC, 0x09CF, 0x09D3, 0x09D6, 0x09D9,
0x09DB, 0x09DD, 0x0002, 0x0003, 0x0003, 0x0002, 0x0002, 0x0001, 0x0000, 0xFFFF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE,
0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF10, 0xBF0F,
0xBF0F, 0xBF0F, 0xBF0F, 0xBF0E, 0xBF0E, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F, 0xBF0F,
0x0008, 0x000C, 0x000D, 0x000B, 0x0008, 0x0004, 0xFFFF, 0xFFFA, 0xFFF7, 0xFFF6, 0xFFF6, 0xFFF7, 0xFFF8, 0xFFF9,
0xFFFB, 0xFFFC, 0xFFFE, 0xFFFF, 0x0000, 0x0000, 0xF6D1, 0xF675, 0xF60A, 0xF599, 0xF52B, 0xF4C6, 0xF46F, 0xF42B,
0xF3FE, 0xF3EE, 0xF3FF, 0xF42D, 0xF473, 0xF4CD, 0xF535, 0xF5A5, 0xF616, 0xF680, 0xF6D9, 0xF713, 0x0C90, 0x0D32,
0x0DEF, 0x0EB6, 0x0F78, 0x102B, 0x10C6, 0x113E, 0x118D, 0x11AA, 0x118C, 0x113B, 0x10BF, 0x1021, 0x0F69, 0x0EA4,
0x0DDC, 0x0D21, 0x0C85, 0x0C1D, 0xF6F7, 0xF69B, 0xF631, 0xF5C2, 0xF555, 0xF4F0, 0xF49A, 0xF456, 0xF42A, 0xF41A,
0xF42B, 0xF459, 0xF49F, 0xF4F8, 0xF55F, 0xF5CE, 0xF63F, 0xF6A8, 0xF6FF, 0xF739, 0x0CB4, 0x0D54, 0x0E10, 0x0ED5,
0x0F96, 0x1048, 0x10E1, 0x1159, 0x11A7, 0x11C4, 0x11A6, 0x1155, 0x10DA, 0x103D, 0x0F87, 0x0EC3, 0x0DFD, 0x0D43,
0x0CA9, 0x0C42, 0x3727, 0x36F3, 0x36B2, 0x3669, 0x361D, 0x35D1, 0x358A, 0x354E, 0x3522, 0x350B, 0x350E, 0x3529,
0x3557, 0x3593, 0x35DA, 0x3625, 0x3673, 0x36BF, 0x3706, 0x3746, 0xF40B, 0xF40E, 0xF418, 0xF426, 0xF438, 0xF44C,
0xF461, 0xF475, 0xF486, 0xF492, 0xF499, 0xF49A, 0xF497, 0xF490, 0xF485, 0xF476, 0xF464, 0xF44E, 0xF434, 0xF416,
0x56C4, 0x56C3, 0x56BB, 0x56AE, 0x569E, 0x568E, 0x5680, 0x5676, 0x5671, 0x5673, 0x567B, 0x5687, 0x5694, 0x56A3,
0x56B1, 0x56BD, 0x56C7, 0x56CB, 0x56CA, 0x56BF, 0xC1EC, 0xC1CA, 0xC1B4, 0xC1A7, 0xC1A2, 0xC1A4, 0xC1AB, 0xC1B4,
0xC1BD, 0xC1C5, 0xC1CC, 0xC1D8, 0xC1E6, 0xC1F5, 0xC204, 0xC212, 0xC21D, 0xC224, 0xC225, 0xC21E, 0xCC89, 0xCCA7,
0xCCCE, 0xCCFA, 0xCD28, 0xCD54, 0xCD7C, 0xCD9C, 0xCDB2, 0xCDBA, 0xCDB2, 0xCD9C, 0xCD7B, 0xCD53, 0xCD26, 0xCCF8,
0xCCCD, 0xCCA6, 0xCC87, 0xCC74, 0x0B80, 0x0B81, 0x0B7D, 0x0B76, 0x0B6D, 0x0B63, 0x0B59, 0x0B50, 0x0B4A, 0x0B48,
0x0B4A, 0x0B4E, 0x0B54, 0x0B5B, 0x0B63, 0x0B6B, 0x0B72, 0x0B78, 0x0B7D, 0x0B80, 0x5952, 0x5950, 0x594A, 0x5940,
0x5935, 0x5929, 0x591D, 0x5913, 0x590D, 0x590A, 0x590C, 0x5910, 0x5917, 0x591F, 0x5928, 0x5932, 0x593B, 0x5943,
0x5949, 0x594D, 0xC19A, 0xC17B, 0xC168, 0xC15F, 0xC15D, 0xC161, 0xC168, 0xC170, 0xC176, 0xC178, 0xC17A, 0xC17E,
0xC185, 0xC18D, 0xC197, 0xC1A1, 0xC1AB, 0xC1B5, 0xC1BD, 0xC1C3,
};
static JointIndex sChildZeldaAnim_01C7B0JointIndices[18] = {
{ 0x0000, 0x000A, 0x001E },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0032, 0x0046, 0x0003 },
{ 0x0000, 0x0000, 0x005A },
{ 0x0000, 0x0000, 0x006E },
{ 0x0000, 0x0000, 0x0082 },
{ 0x0000, 0x0000, 0x0096 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000 },
{ 0x0004, 0x0005, 0x0004 },
{ 0x00AA, 0x00BE, 0x00D2 },
{ 0x0000, 0x0000, 0x00E6 },
{ 0x0006, 0x0007, 0x0008 },
{ 0x00FA, 0x010E, 0x0122 },
{ 0x0000, 0x0000, 0x0136 },
{ 0x0005, 0x0009, 0x0008 },
{ 0x0000, 0x0000, 0x0005 },
};
AnimationHeader gChildZeldaAnim_01C7B0 = { { 20 }, sChildZeldaAnim_01C7B0FrameData, sChildZeldaAnim_01C7B0JointIndices, 10 };
static s16 sChildZeldaAnim_01CE08FrameData[750] = {
0x086F, 0x09AE, 0x0000, 0x4000, 0xF709, 0x09AE, 0x09AD, 0x09AC, 0x09A9, 0x09A6, 0x09A2, 0x099F, 0x099B, 0x0997,
0x0994, 0x0991, 0x0990, 0x098F, 0x0990, 0x0991, 0x0994, 0x0997, 0x099B, 0x099F, 0x09A2, 0x09A6, 0x09A9, 0x09AC,
0x09AD, 0xBF09, 0xBF09, 0xBF09, 0xBF09, 0xBF08, 0xBF08, 0xBF07, 0xBF07, 0xBF06, 0xBF06, 0xBF05, 0xBF05, 0xBF05,
0xBF05, 0xBF05, 0xBF06, 0xBF06, 0xBF07, 0xBF07, 0xBF08, 0xBF08, 0xBF09, 0xBF09, 0xBF09, 0xF6F5, 0xF6E8, 0xF6C2,
0xF68A, 0xF643, 0xF5F2, 0xF59D, 0xF548, 0xF4F7, 0xF4B0, 0xF478, 0xF452, 0xF445, 0xF452, 0xF478, 0xF4B0, 0xF4F7,
0xF548, 0xF59D, 0xF5F2, 0xF643, 0xF68A, 0xF6C2, 0xF6E8, 0xC036, 0xC037, 0xC037, 0xC039, 0xC03A, 0xC03C, 0xC03E,
0xC040, 0xC043, 0xC044, 0xC046, 0xC047, 0xC047, 0xC047, 0xC046, 0xC044, 0xC043, 0xC040, 0xC03E, 0xC03C, 0xC03A,
0xC039, 0xC037, 0xC037, 0xFC16, 0xFC1B, 0xFC29, 0xFC3F, 0xFC5C, 0xFC7E, 0xFCA5, 0xFCCE, 0xFCF7, 0xFD1C, 0xFD3B,
0xFD4F, 0xFD57, 0xFD4F, 0xFD3B, 0xFD1C, 0xFCF7, 0xFCCE, 0xFCA5, 0xFC7E, 0xFC5C, 0xFC3F, 0xFC29, 0xFC1B, 0x1748,
0x175D, 0x1798, 0x17EF, 0x185A, 0x18D0, 0x1949, 0x19BF, 0x1A2B, 0x1A87, 0x1AD0, 0x1AFF, 0x1B10, 0x1AFF, 0x1AD0,
0x1A87, 0x1A2B, 0x19BF, 0x1949, 0x18D0, 0x185A, 0x17EF, 0x1798, 0x175D, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFC55, 0xFC5A, 0xFC68, 0xFC7E, 0xFC9C, 0xFCBF, 0xFCE7, 0xFD10, 0xFD39,
0xFD5F, 0xFD7D, 0xFD92, 0xFD9A, 0xFD92, 0xFD7D, 0xFD5F, 0xFD39, 0xFD10, 0xFCE7, 0xFCBF, 0xFC9C, 0xFC7E, 0xFC68,
0xFC5A, 0x1745, 0x175A, 0x1795, 0x17EB, 0x1855, 0x18CA, 0x1943, 0x19B8, 0x1A23, 0x1A7F, 0x1AC7, 0x1AF6, 0x1B07,
0x1AF6, 0x1AC7, 0x1A7F, 0x1A23, 0x19B8, 0x1943, 0x18CA, 0x1855, 0x17EB, 0x1795, 0x175A, 0x03D4, 0x03D2, 0x03CB,
0x03C1, 0x03B4, 0x03A5, 0x0396, 0x0386, 0x0378, 0x036B, 0x0361, 0x035A, 0x0357, 0x035A, 0x0361, 0x036B, 0x0378,
0x0386, 0x0396, 0x03A5, 0x03B4, 0x03C1, 0x03CB, 0x03D2, 0x0272, 0x029E, 0x0319, 0x03D2, 0x04BA, 0x05C1, 0x06D8,
0x07EF, 0x08F7, 0x09DF, 0x0A98, 0x0B12, 0x0B3F, 0x0B12, 0x0A98, 0x09DF, 0x08F7, 0x07EF, 0x06D8, 0x05C1, 0x04BA,
0x03D2, 0x0319, 0x029E, 0x02B0, 0x0292, 0x023D, 0x01BC, 0x011B, 0x0064, 0xFFA2, 0xFEE0, 0xFE29, 0xFD88, 0xFD08,
0xFCB3, 0xFC94, 0xFCB3, 0xFD08, 0xFD88, 0xFE29, 0xFEE0, 0xFFA2, 0x0064, 0x011B, 0x01BC, 0x023D, 0x0292, 0xF93D,
0xF938, 0xF92D, 0xF91C, 0xF906, 0xF8EE, 0xF8D4, 0xF8BA, 0xF8A2, 0xF88D, 0xF87B, 0xF870, 0xF86C, 0xF870, 0xF87B,
0xF88D, 0xF8A2, 0xF8BA, 0xF8D4, 0xF8EE, 0xF906, 0xF91C, 0xF92D, 0xF938, 0x099C, 0x099C, 0x099D, 0x099F, 0x09A1,
0x09A4, 0x09A7, 0x09A9, 0x09AC, 0x09AE, 0x09B0, 0x09B1, 0x09B2, 0x09B1, 0x09B0, 0x09AE, 0x09AC, 0x09A9, 0x09A7,
0x09A4, 0x09A1, 0x099F, 0x099D, 0x099C, 0xF832, 0xF829, 0xF812, 0xF7EF, 0xF7C3, 0xF792, 0xF75D, 0xF728, 0xF6F6,
0xF6CA, 0xF6A7, 0xF690, 0xF688, 0xF690, 0xF6A7, 0xF6CA, 0xF6F6, 0xF728, 0xF75D, 0xF792, 0xF7C3, 0xF7EF, 0xF812,
0xF829, 0x8BD2, 0x8BD0, 0x8BCA, 0x8BC2, 0x8BB7, 0x8BAB, 0x8B9D, 0x8B90, 0x8B84, 0x8B79, 0x8B71, 0x8B6B, 0x8B69,
0x8B6B, 0x8B71, 0x8B79, 0x8B84, 0x8B90, 0x8B9D, 0x8BAB, 0x8BB7, 0x8BC2, 0x8BCA, 0x8BD0, 0x618A, 0x6163, 0x60F9,
0x6059, 0x5F90, 0x5EAB, 0x5DBA, 0x5CC8, 0x5BE4, 0x5B1A, 0x5A7A, 0x5A10, 0x59E9, 0x5A10, 0x5A7A, 0x5B1A, 0x5BE4,
0x5CC8, 0x5DBA, 0x5EAB, 0x5F90, 0x6059, 0x60F9, 0x6163, 0x44EA, 0x44E6, 0x44DB, 0x44CB, 0x44B7, 0x44A0, 0x4488,
0x4470, 0x4459, 0x4445, 0x4435, 0x442A, 0x4426, 0x442A, 0x4435, 0x4445, 0x4459, 0x4470, 0x4488, 0x44A0, 0x44B7,
0x44CB, 0x44DB, 0x44E6, 0x5808, 0x57E1, 0x5776, 0x56D5, 0x560B, 0x5525, 0x5432, 0x533E, 0x5259, 0x518E, 0x50ED,
0x5082, 0x505B, 0x5082, 0x50ED, 0x518E, 0x5259, 0x533E, 0x5432, 0x5525, 0x560B, 0x56D5, 0x5776, 0x57E1, 0x0000,
0x0027, 0x0093, 0x0136, 0x0202, 0x02E9, 0x03DF, 0x04D4, 0x05BC, 0x0688, 0x072B, 0x0797, 0x07BE, 0x0797, 0x072B,
0x0688, 0x05BC, 0x04D4, 0x03DF, 0x02E9, 0x0202, 0x0136, 0x0093, 0x0027, 0x0000, 0x0015, 0x004D, 0x00A3, 0x010E,
0x0188, 0x020A, 0x028B, 0x0305, 0x0370, 0x03C6, 0x03FF, 0x0413, 0x03FF, 0x03C6, 0x0370, 0x0305, 0x028B, 0x020A,
0x0188, 0x010E, 0x00A3, 0x004D, 0x0015, 0xF6F4, 0xF6F2, 0xF6EE, 0xF6E6, 0xF6DD, 0xF6D3, 0xF6C8, 0xF6BD, 0xF6B2,
0xF6A9, 0xF6A2, 0xF69D, 0xF69B, 0xF69D, 0xF6A2, 0xF6A9, 0xF6B2, 0xF6BD, 0xF6C8, 0xF6D3, 0xF6DD, 0xF6E6, 0xF6EE,
0xF6F2, 0x0889, 0x088E, 0x089B, 0x08AF, 0x08C8, 0x08E5, 0x0904, 0x0922, 0x093F, 0x0958, 0x096C, 0x097A, 0x097E,
0x097A, 0x096C, 0x0958, 0x093F, 0x0922, 0x0904, 0x08E5, 0x08C8, 0x08AF, 0x089B, 0x088E, 0x88A9, 0x88A1, 0x8889,
0x8866, 0x883A, 0x8807, 0x87D2, 0x879C, 0x876A, 0x873E, 0x871A, 0x8703, 0x86FA, 0x8703, 0x871A, 0x873E, 0x876A,
0x879C, 0x87D2, 0x8807, 0x883A, 0x8866, 0x8889, 0x88A1, 0x81DB, 0x8194, 0x80CF, 0x7FA6, 0x7E32, 0x7C8B, 0x7ACB,
0x790C, 0x7765, 0x75F1, 0x74C8, 0x7403, 0x73BC, 0x7403, 0x74C8, 0x75F1, 0x7765, 0x790C, 0x7ACB, 0x7C8B, 0x7E32,
0x7FA6, 0x80CF, 0x8194, 0xB5C5, 0xB5BD, 0xB5A8, 0xB588, 0xB561, 0xB534, 0xB504, 0xB4D5, 0xB4A8, 0xB480, 0xB460,
0xB44B, 0xB444, 0xB44B, 0xB460, 0xB480, 0xB4A8, 0xB4D5, 0xB504, 0xB534, 0xB561, 0xB588, 0xB5A8, 0xB5BD, 0x9AE3,
0x9B2B, 0x9BF4, 0x9D24, 0x9EA1, 0xA051, 0xA21B, 0xA3E5, 0xA595, 0xA712, 0xA842, 0xA90B, 0xA954, 0xA90B, 0xA842,
0xA712, 0xA595, 0xA3E5, 0xA21B, 0xA051, 0x9EA1, 0x9D24, 0x9BF4, 0x9B2B, 0x0E70, 0x0E53, 0x0E03, 0x0D8A, 0x0CF2,
0x0C46, 0x0B90, 0x0AD9, 0x0A2D, 0x0995, 0x091C, 0x08CC, 0x08AF, 0x08CC, 0x091C, 0x0995, 0x0A2D, 0x0AD9, 0x0B90,
0x0C46, 0x0CF2, 0x0D8A, 0x0E03, 0x0E53, 0xEB55, 0xEB58, 0xEB61, 0xEB6E, 0xEB7D, 0xEB90, 0xEBA3, 0xEBB6, 0xEBC8,
0xEBD8, 0xEBE5, 0xEBED, 0xEBF0, 0xEBED, 0xEBE5, 0xEBD8, 0xEBC8, 0xEBB6, 0xEBA3, 0xEB90, 0xEB7D, 0xEB6E, 0xEB61,
0xEB58, 0xFF4F, 0xFF23, 0xFEA8, 0xFDEF, 0xFD07, 0xFBFF, 0xFAE8, 0xF9D0, 0xF8C9, 0xF7E0, 0xF727, 0xF6AC, 0xF680,
0xF6AC, 0xF727, 0xF7E0, 0xF8C9, 0xF9D0, 0xFAE8, 0xFBFF, 0xFD07, 0xFDEF, 0xFEA8, 0xFF23, 0x0920, 0x0914, 0x08F2,
0x08BF, 0x087E, 0x0835, 0x07E7, 0x079A, 0x0751, 0x0710, 0x06DD, 0x06BB, 0x06AF, 0x06BB, 0x06DD, 0x0710, 0x0751,
0x079A, 0x07E7, 0x0835, 0x087E, 0x08BF, 0x08F2, 0x0914, 0x0000,
};
static JointIndex sChildZeldaAnim_01CE08JointIndices[18] = {
{ 0x0000, 0x0005, 0x0002 },
{ 0x0002, 0x0002, 0x0002 },
{ 0x001D, 0x0035, 0x004D },
{ 0x0002, 0x0002, 0x0065 },
{ 0x0002, 0x0002, 0x007D },
{ 0x0002, 0x0095, 0x00AD },
{ 0x0002, 0x0002, 0x00C5 },
{ 0x0002, 0x0002, 0x00DD },
{ 0x0002, 0x0002, 0x00F5 },
{ 0x0002, 0x0002, 0x010D },
{ 0x0003, 0x0125, 0x0003 },
{ 0x013D, 0x0155, 0x016D },
{ 0x0185, 0x019D, 0x01B5 },
{ 0x01CD, 0x01E5, 0x0004 },
{ 0x01FD, 0x0215, 0x022D },
{ 0x0245, 0x025D, 0x0275 },
{ 0x028D, 0x02A5, 0x02BD },
{ 0x0002, 0x0002, 0x02D5 },
};
AnimationHeader gChildZeldaAnim_01CE08 = { { 24 }, sChildZeldaAnim_01CE08FrameData, sChildZeldaAnim_01CE08JointIndices, 5 };
static u8 unaccounted_01CE18[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
|
86aba8a4838d493d4c3c21f626c11462b7a3485f
|
fdbb74a95924e2677466614f6ab6e2bb13b2a95a
|
/third_party/nsync/mu_semaphore.h
|
a2c9c6b454c8794c7850d7e457ec8450d125efde
|
[
"Apache-2.0",
"ISC"
] |
permissive
|
jart/cosmopolitan
|
fb11b5658939023977060a7c6c71a74093d9cb44
|
0d748ad58e1063dd1f8560f18a0c75293b9415b7
|
refs/heads/master
| 2023-09-06T09:17:29.303607
| 2023-09-02T03:49:13
| 2023-09-02T03:50:18
| 272,457,606
| 11,887
| 435
|
ISC
| 2023-09-14T17:47:58
| 2020-06-15T14:16:13
|
C
|
UTF-8
|
C
| false
| false
| 931
|
h
|
mu_semaphore.h
|
#ifndef NSYNC_SEM_H_
#define NSYNC_SEM_H_
#include "third_party/nsync/time.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
typedef struct nsync_semaphore_s_ {
void *sem_space[32]; /* internal storage */
} nsync_semaphore;
/* Initialize *s; the initial value is 0. */
void nsync_mu_semaphore_init(nsync_semaphore *s);
/* Wait until the count of *s exceeds 0, and decrement it. */
errno_t nsync_mu_semaphore_p(nsync_semaphore *s);
/* Wait until one of: the count of *s is non-zero, in which case
decrement *s and return 0; or abs_deadline expires, in which case
return ETIMEDOUT. */
errno_t nsync_mu_semaphore_p_with_deadline(nsync_semaphore *s,
nsync_time abs_deadline);
/* Ensure that the count of *s is at least 1. */
void nsync_mu_semaphore_v(nsync_semaphore *s);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* NSYNC_SEM_H_ */
|
4797ddb9b8e41645c7ff4e75a2167988567690d6
|
b1fcecfa2d9b42db62ba22f4635b3e845bf4ab56
|
/nginx/src/http/ngx_http_script.c
|
a1c593b11490856c2d1e72fc1808fda268bf6f9e
|
[
"BSD-2-Clause"
] |
permissive
|
chronolaw/annotated_nginx
|
606b5ae08b8173daa01fcac353b089b17deff08d
|
60b0e2a15d4c7c51313bd117bab026046c3da01b
|
refs/heads/master
| 2023-06-29T09:15:23.066046
| 2023-06-17T08:35:25
| 2023-06-17T08:35:25
| 51,183,743
| 573
| 206
| null | null | null | null |
UTF-8
|
C
| false
| false
| 46,257
|
c
|
ngx_http_script.c
|
// annotated by chrono since 2016
//
// * ngx_http_complex_value
// * ngx_http_compile_complex_value
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
static ngx_int_t ngx_http_script_init_arrays(ngx_http_script_compile_t *sc);
static ngx_int_t ngx_http_script_done(ngx_http_script_compile_t *sc);
static ngx_int_t ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc,
ngx_str_t *value, ngx_uint_t last);
static ngx_int_t ngx_http_script_add_var_code(ngx_http_script_compile_t *sc,
ngx_str_t *name);
static ngx_int_t ngx_http_script_add_args_code(ngx_http_script_compile_t *sc);
#if (NGX_PCRE)
static ngx_int_t ngx_http_script_add_capture_code(ngx_http_script_compile_t *sc,
ngx_uint_t n);
#endif
static ngx_int_t
ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc);
static size_t ngx_http_script_full_name_len_code(ngx_http_script_engine_t *e);
static void ngx_http_script_full_name_code(ngx_http_script_engine_t *e);
#define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code
static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL;
void
ngx_http_script_flush_complex_value(ngx_http_request_t *r,
ngx_http_complex_value_t *val)
{
ngx_uint_t *index;
index = val->flushes;
if (index) {
while (*index != (ngx_uint_t) -1) {
if (r->variables[*index].no_cacheable) {
r->variables[*index].valid = 0;
r->variables[*index].not_found = 0;
}
index++;
}
}
}
// 运行时获取变量值
ngx_int_t
ngx_http_complex_value(ngx_http_request_t *r, ngx_http_complex_value_t *val,
ngx_str_t *value)
{
size_t len;
ngx_http_script_code_pt code;
ngx_http_script_len_code_pt lcode;
ngx_http_script_engine_t e;
if (val->lengths == NULL) {
*value = val->value;
return NGX_OK;
}
ngx_http_script_flush_complex_value(r, val);
ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
e.ip = val->lengths;
e.request = r;
e.flushed = 1;
len = 0;
while (*(uintptr_t *) e.ip) {
lcode = *(ngx_http_script_len_code_pt *) e.ip;
len += lcode(&e);
}
value->len = len;
value->data = ngx_pnalloc(r->pool, len);
if (value->data == NULL) {
return NGX_ERROR;
}
e.ip = val->values;
e.pos = value->data;
e.buf = *value;
while (*(uintptr_t *) e.ip) {
code = *(ngx_http_script_code_pt *) e.ip;
code((ngx_http_script_engine_t *) &e);
}
*value = e.buf;
return NGX_OK;
}
// 1.17.0
size_t
ngx_http_complex_value_size(ngx_http_request_t *r,
ngx_http_complex_value_t *val, size_t default_value)
{
size_t size;
ngx_str_t value;
if (val == NULL) {
return default_value;
}
if (val->lengths == NULL) {
return val->u.size;
}
if (ngx_http_complex_value(r, val, &value) != NGX_OK) {
return default_value;
}
size = ngx_parse_size(&value);
if (size == (size_t) NGX_ERROR) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"invalid size \"%V\"", &value);
return default_value;
}
return size;
}
// 编译复杂变量
ngx_int_t
ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv)
{
ngx_str_t *v;
ngx_uint_t i, n, nv, nc;
ngx_array_t flushes, lengths, values, *pf, *pl, *pv;
ngx_http_script_compile_t sc;
v = ccv->value;
// 变量计数,即$的数量
nv = 0;
// 正则capture计数
nc = 0;
for (i = 0; i < v->len; i++) {
if (v->data[i] == '$') {
if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') {
nc++;
} else {
nv++;
}
}
}
// 空字符串,或者第一个字符不是$
if ((v->len == 0 || v->data[0] != '$')
&& (ccv->conf_prefix || ccv->root_prefix))
{
if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) {
return NGX_ERROR;
}
ccv->conf_prefix = 0;
ccv->root_prefix = 0;
}
// 设置复杂变量的值
// value指向原始字符串
ccv->complex_value->value = *v;
ccv->complex_value->flushes = NULL;
ccv->complex_value->lengths = NULL;
ccv->complex_value->values = NULL;
// 如果没有$,就是普通字符串,不需要再处理了
if (nv == 0 && nc == 0) {
return NGX_OK;
}
// 变量数加1
n = nv + 1;
// 初始化flushes数组
if (ngx_array_init(&flushes, ccv->cf->pool, n, sizeof(ngx_uint_t))
!= NGX_OK)
{
return NGX_ERROR;
}
n = nv * (2 * sizeof(ngx_http_script_copy_code_t)
+ sizeof(ngx_http_script_var_code_t))
+ sizeof(uintptr_t);
// 初始化lengths数组
if (ngx_array_init(&lengths, ccv->cf->pool, n, 1) != NGX_OK) {
return NGX_ERROR;
}
n = (nv * (2 * sizeof(ngx_http_script_copy_code_t)
+ sizeof(ngx_http_script_var_code_t))
+ sizeof(uintptr_t)
+ v->len
+ sizeof(uintptr_t) - 1)
& ~(sizeof(uintptr_t) - 1);
// 初始化values数组
if (ngx_array_init(&values, ccv->cf->pool, n, 1) != NGX_OK) {
return NGX_ERROR;
}
pf = &flushes;
pl = &lengths;
pv = &values;
ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
sc.cf = ccv->cf;
sc.source = v;
sc.flushes = &pf;
sc.lengths = &pl;
sc.values = &pv;
sc.complete_lengths = 1;
sc.complete_values = 1;
sc.zero = ccv->zero;
sc.conf_prefix = ccv->conf_prefix;
sc.root_prefix = ccv->root_prefix;
// 执行脚本编译
if (ngx_http_script_compile(&sc) != NGX_OK) {
return NGX_ERROR;
}
if (flushes.nelts) {
ccv->complex_value->flushes = flushes.elts;
ccv->complex_value->flushes[flushes.nelts] = (ngx_uint_t) -1;
}
ccv->complex_value->lengths = lengths.elts;
ccv->complex_value->values = values.elts;
return NGX_OK;
}
char *
ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
char *p = conf;
ngx_str_t *value;
ngx_http_complex_value_t **cv;
ngx_http_compile_complex_value_t ccv;
cv = (ngx_http_complex_value_t **) (p + cmd->offset);
if (*cv != NGX_CONF_UNSET_PTR && *cv != NULL) {
return "is duplicate";
}
*cv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
if (*cv == NULL) {
return NGX_CONF_ERROR;
}
value = cf->args->elts;
ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
ccv.cf = cf;
ccv.value = &value[1];
ccv.complex_value = *cv;
if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
return NGX_CONF_ERROR;
}
return NGX_CONF_OK;
}
char *
ngx_http_set_complex_value_zero_slot(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf)
{
char *p = conf;
ngx_str_t *value;
ngx_http_complex_value_t **cv;
ngx_http_compile_complex_value_t ccv;
cv = (ngx_http_complex_value_t **) (p + cmd->offset);
if (*cv != NGX_CONF_UNSET_PTR) {
return "is duplicate";
}
*cv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
if (*cv == NULL) {
return NGX_CONF_ERROR;
}
value = cf->args->elts;
ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
ccv.cf = cf;
ccv.value = &value[1];
ccv.complex_value = *cv;
ccv.zero = 1;
if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
return NGX_CONF_ERROR;
}
return NGX_CONF_OK;
}
char *
ngx_http_set_complex_value_size_slot(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf)
{
char *p = conf;
char *rv;
ngx_http_complex_value_t *cv;
rv = ngx_http_set_complex_value_slot(cf, cmd, conf);
if (rv != NGX_CONF_OK) {
return rv;
}
cv = *(ngx_http_complex_value_t **) (p + cmd->offset);
if (cv->lengths) {
return NGX_CONF_OK;
}
cv->u.size = ngx_parse_size(&cv->value);
if (cv->u.size == (size_t) NGX_ERROR) {
return "invalid value";
}
return NGX_CONF_OK;
}
ngx_int_t
ngx_http_test_predicates(ngx_http_request_t *r, ngx_array_t *predicates)
{
ngx_str_t val;
ngx_uint_t i;
ngx_http_complex_value_t *cv;
if (predicates == NULL) {
return NGX_OK;
}
cv = predicates->elts;
for (i = 0; i < predicates->nelts; i++) {
if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
return NGX_ERROR;
}
if (val.len && (val.len != 1 || val.data[0] != '0')) {
return NGX_DECLINED;
}
}
return NGX_OK;
}
ngx_int_t
ngx_http_test_required_predicates(ngx_http_request_t *r,
ngx_array_t *predicates)
{
ngx_str_t val;
ngx_uint_t i;
ngx_http_complex_value_t *cv;
if (predicates == NULL) {
return NGX_OK;
}
cv = predicates->elts;
for (i = 0; i < predicates->nelts; i++) {
if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
return NGX_ERROR;
}
if (val.len == 0 || (val.len == 1 && val.data[0] == '0')) {
return NGX_DECLINED;
}
}
return NGX_OK;
}
char *
ngx_http_set_predicate_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
char *p = conf;
ngx_str_t *value;
ngx_uint_t i;
ngx_array_t **a;
ngx_http_complex_value_t *cv;
ngx_http_compile_complex_value_t ccv;
a = (ngx_array_t **) (p + cmd->offset);
if (*a == NGX_CONF_UNSET_PTR) {
*a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t));
if (*a == NULL) {
return NGX_CONF_ERROR;
}
}
value = cf->args->elts;
for (i = 1; i < cf->args->nelts; i++) {
cv = ngx_array_push(*a);
if (cv == NULL) {
return NGX_CONF_ERROR;
}
ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
ccv.cf = cf;
ccv.value = &value[i];
ccv.complex_value = cv;
if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
return NGX_CONF_ERROR;
}
}
return NGX_CONF_OK;
}
ngx_uint_t
ngx_http_script_variables_count(ngx_str_t *value)
{
ngx_uint_t i, n;
for (n = 0, i = 0; i < value->len; i++) {
if (value->data[i] == '$') {
n++;
}
}
return n;
}
ngx_int_t
ngx_http_script_compile(ngx_http_script_compile_t *sc)
{
u_char ch;
ngx_str_t name;
ngx_uint_t i, bracket;
if (ngx_http_script_init_arrays(sc) != NGX_OK) {
return NGX_ERROR;
}
for (i = 0; i < sc->source->len; /* void */ ) {
name.len = 0;
if (sc->source->data[i] == '$') {
if (++i == sc->source->len) {
goto invalid_variable;
}
if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') {
#if (NGX_PCRE)
ngx_uint_t n;
n = sc->source->data[i] - '0';
if (sc->captures_mask & ((ngx_uint_t) 1 << n)) {
sc->dup_capture = 1;
}
sc->captures_mask |= (ngx_uint_t) 1 << n;
if (ngx_http_script_add_capture_code(sc, n) != NGX_OK) {
return NGX_ERROR;
}
i++;
continue;
#else
ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0,
"using variable \"$%c\" requires "
"PCRE library", sc->source->data[i]);
return NGX_ERROR;
#endif
}
if (sc->source->data[i] == '{') {
bracket = 1;
if (++i == sc->source->len) {
goto invalid_variable;
}
name.data = &sc->source->data[i];
} else {
bracket = 0;
name.data = &sc->source->data[i];
}
for ( /* void */ ; i < sc->source->len; i++, name.len++) {
ch = sc->source->data[i];
if (ch == '}' && bracket) {
i++;
bracket = 0;
break;
}
if ((ch >= 'A' && ch <= 'Z')
|| (ch >= 'a' && ch <= 'z')
|| (ch >= '0' && ch <= '9')
|| ch == '_')
{
continue;
}
break;
}
if (bracket) {
ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0,
"the closing bracket in \"%V\" "
"variable is missing", &name);
return NGX_ERROR;
}
if (name.len == 0) {
goto invalid_variable;
}
sc->variables++;
if (ngx_http_script_add_var_code(sc, &name) != NGX_OK) {
return NGX_ERROR;
}
continue;
}
if (sc->source->data[i] == '?' && sc->compile_args) {
sc->args = 1;
sc->compile_args = 0;
if (ngx_http_script_add_args_code(sc) != NGX_OK) {
return NGX_ERROR;
}
i++;
continue;
}
name.data = &sc->source->data[i];
while (i < sc->source->len) {
if (sc->source->data[i] == '$') {
break;
}
if (sc->source->data[i] == '?') {
sc->args = 1;
if (sc->compile_args) {
break;
}
}
i++;
name.len++;
}
sc->size += name.len;
if (ngx_http_script_add_copy_code(sc, &name, (i == sc->source->len))
!= NGX_OK)
{
return NGX_ERROR;
}
}
return ngx_http_script_done(sc);
invalid_variable:
ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name");
return NGX_ERROR;
}
u_char *
ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
void *code_lengths, size_t len, void *code_values)
{
ngx_uint_t i;
ngx_http_script_code_pt code;
ngx_http_script_len_code_pt lcode;
ngx_http_script_engine_t e;
ngx_http_core_main_conf_t *cmcf;
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
for (i = 0; i < cmcf->variables.nelts; i++) {
if (r->variables[i].no_cacheable) {
r->variables[i].valid = 0;
r->variables[i].not_found = 0;
}
}
ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
e.ip = code_lengths;
e.request = r;
e.flushed = 1;
while (*(uintptr_t *) e.ip) {
lcode = *(ngx_http_script_len_code_pt *) e.ip;
len += lcode(&e);
}
value->len = len;
value->data = ngx_pnalloc(r->pool, len);
if (value->data == NULL) {
return NULL;
}
e.ip = code_values;
e.pos = value->data;
while (*(uintptr_t *) e.ip) {
code = *(ngx_http_script_code_pt *) e.ip;
code((ngx_http_script_engine_t *) &e);
}
return e.pos;
}
void
ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
ngx_array_t *indices)
{
ngx_uint_t n, *index;
if (indices) {
index = indices->elts;
for (n = 0; n < indices->nelts; n++) {
if (r->variables[index[n]].no_cacheable) {
r->variables[index[n]].valid = 0;
r->variables[index[n]].not_found = 0;
}
}
}
}
static ngx_int_t
ngx_http_script_init_arrays(ngx_http_script_compile_t *sc)
{
ngx_uint_t n;
if (sc->flushes && *sc->flushes == NULL) {
n = sc->variables ? sc->variables : 1;
*sc->flushes = ngx_array_create(sc->cf->pool, n, sizeof(ngx_uint_t));
if (*sc->flushes == NULL) {
return NGX_ERROR;
}
}
if (*sc->lengths == NULL) {
n = sc->variables * (2 * sizeof(ngx_http_script_copy_code_t)
+ sizeof(ngx_http_script_var_code_t))
+ sizeof(uintptr_t);
*sc->lengths = ngx_array_create(sc->cf->pool, n, 1);
if (*sc->lengths == NULL) {
return NGX_ERROR;
}
}
if (*sc->values == NULL) {
n = (sc->variables * (2 * sizeof(ngx_http_script_copy_code_t)
+ sizeof(ngx_http_script_var_code_t))
+ sizeof(uintptr_t)
+ sc->source->len
+ sizeof(uintptr_t) - 1)
& ~(sizeof(uintptr_t) - 1);
*sc->values = ngx_array_create(sc->cf->pool, n, 1);
if (*sc->values == NULL) {
return NGX_ERROR;
}
}
sc->variables = 0;
return NGX_OK;
}
static ngx_int_t
ngx_http_script_done(ngx_http_script_compile_t *sc)
{
ngx_str_t zero;
uintptr_t *code;
if (sc->zero) {
zero.len = 1;
zero.data = (u_char *) "\0";
if (ngx_http_script_add_copy_code(sc, &zero, 0) != NGX_OK) {
return NGX_ERROR;
}
}
if (sc->conf_prefix || sc->root_prefix) {
if (ngx_http_script_add_full_name_code(sc) != NGX_OK) {
return NGX_ERROR;
}
}
if (sc->complete_lengths) {
code = ngx_http_script_add_code(*sc->lengths, sizeof(uintptr_t), NULL);
if (code == NULL) {
return NGX_ERROR;
}
*code = (uintptr_t) NULL;
}
if (sc->complete_values) {
code = ngx_http_script_add_code(*sc->values, sizeof(uintptr_t),
&sc->main);
if (code == NULL) {
return NGX_ERROR;
}
*code = (uintptr_t) NULL;
}
return NGX_OK;
}
void *
ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, size_t size)
{
if (*codes == NULL) {
*codes = ngx_array_create(pool, 256, 1);
if (*codes == NULL) {
return NULL;
}
}
return ngx_array_push_n(*codes, size);
}
void *
ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code)
{
u_char *elts, **p;
void *new;
elts = codes->elts;
new = ngx_array_push_n(codes, size);
if (new == NULL) {
return NULL;
}
if (code) {
if (elts != codes->elts) {
p = code;
*p += (u_char *) codes->elts - elts;
}
}
return new;
}
static ngx_int_t
ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc, ngx_str_t *value,
ngx_uint_t last)
{
u_char *p;
size_t size, len, zero;
ngx_http_script_copy_code_t *code;
zero = (sc->zero && last);
len = value->len + zero;
code = ngx_http_script_add_code(*sc->lengths,
sizeof(ngx_http_script_copy_code_t), NULL);
if (code == NULL) {
return NGX_ERROR;
}
code->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
code->len = len;
size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1)
& ~(sizeof(uintptr_t) - 1);
code = ngx_http_script_add_code(*sc->values, size, &sc->main);
if (code == NULL) {
return NGX_ERROR;
}
code->code = ngx_http_script_copy_code;
code->len = len;
p = ngx_cpymem((u_char *) code + sizeof(ngx_http_script_copy_code_t),
value->data, value->len);
if (zero) {
*p = '\0';
sc->zero = 0;
}
return NGX_OK;
}
size_t
ngx_http_script_copy_len_code(ngx_http_script_engine_t *e)
{
ngx_http_script_copy_code_t *code;
code = (ngx_http_script_copy_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_copy_code_t);
return code->len;
}
void
ngx_http_script_copy_code(ngx_http_script_engine_t *e)
{
u_char *p;
ngx_http_script_copy_code_t *code;
code = (ngx_http_script_copy_code_t *) e->ip;
p = e->pos;
if (!e->skip) {
e->pos = ngx_copy(p, e->ip + sizeof(ngx_http_script_copy_code_t),
code->len);
}
e->ip += sizeof(ngx_http_script_copy_code_t)
+ ((code->len + sizeof(uintptr_t) - 1) & ~(sizeof(uintptr_t) - 1));
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script copy: \"%*s\"", e->pos - p, p);
}
static ngx_int_t
ngx_http_script_add_var_code(ngx_http_script_compile_t *sc, ngx_str_t *name)
{
ngx_int_t index, *p;
ngx_http_script_var_code_t *code;
index = ngx_http_get_variable_index(sc->cf, name);
if (index == NGX_ERROR) {
return NGX_ERROR;
}
if (sc->flushes) {
p = ngx_array_push(*sc->flushes);
if (p == NULL) {
return NGX_ERROR;
}
*p = index;
}
code = ngx_http_script_add_code(*sc->lengths,
sizeof(ngx_http_script_var_code_t), NULL);
if (code == NULL) {
return NGX_ERROR;
}
code->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_var_len_code;
code->index = (uintptr_t) index;
code = ngx_http_script_add_code(*sc->values,
sizeof(ngx_http_script_var_code_t),
&sc->main);
if (code == NULL) {
return NGX_ERROR;
}
code->code = ngx_http_script_copy_var_code;
code->index = (uintptr_t) index;
return NGX_OK;
}
size_t
ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e)
{
ngx_http_variable_value_t *value;
ngx_http_script_var_code_t *code;
code = (ngx_http_script_var_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_var_code_t);
if (e->flushed) {
value = ngx_http_get_indexed_variable(e->request, code->index);
} else {
value = ngx_http_get_flushed_variable(e->request, code->index);
}
if (value && !value->not_found) {
return value->len;
}
return 0;
}
void
ngx_http_script_copy_var_code(ngx_http_script_engine_t *e)
{
u_char *p;
ngx_http_variable_value_t *value;
ngx_http_script_var_code_t *code;
code = (ngx_http_script_var_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_var_code_t);
if (!e->skip) {
if (e->flushed) {
value = ngx_http_get_indexed_variable(e->request, code->index);
} else {
value = ngx_http_get_flushed_variable(e->request, code->index);
}
if (value && !value->not_found) {
p = e->pos;
e->pos = ngx_copy(p, value->data, value->len);
ngx_log_debug2(NGX_LOG_DEBUG_HTTP,
e->request->connection->log, 0,
"http script var: \"%*s\"", e->pos - p, p);
}
}
}
static ngx_int_t
ngx_http_script_add_args_code(ngx_http_script_compile_t *sc)
{
uintptr_t *code;
code = ngx_http_script_add_code(*sc->lengths, sizeof(uintptr_t), NULL);
if (code == NULL) {
return NGX_ERROR;
}
*code = (uintptr_t) ngx_http_script_mark_args_code;
code = ngx_http_script_add_code(*sc->values, sizeof(uintptr_t), &sc->main);
if (code == NULL) {
return NGX_ERROR;
}
*code = (uintptr_t) ngx_http_script_start_args_code;
return NGX_OK;
}
size_t
ngx_http_script_mark_args_code(ngx_http_script_engine_t *e)
{
e->is_args = 1;
e->ip += sizeof(uintptr_t);
return 1;
}
void
ngx_http_script_start_args_code(ngx_http_script_engine_t *e)
{
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script args");
e->is_args = 1;
e->args = e->pos;
e->ip += sizeof(uintptr_t);
}
#if (NGX_PCRE)
void
ngx_http_script_regex_start_code(ngx_http_script_engine_t *e)
{
size_t len;
ngx_int_t rc;
ngx_uint_t n;
ngx_http_request_t *r;
ngx_http_script_engine_t le;
ngx_http_script_len_code_pt lcode;
ngx_http_script_regex_code_t *code;
code = (ngx_http_script_regex_code_t *) e->ip;
r = e->request;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http script regex: \"%V\"", &code->name);
if (code->uri) {
e->line = r->uri;
} else {
e->sp--;
e->line.len = e->sp->len;
e->line.data = e->sp->data;
}
rc = ngx_http_regex_exec(r, code->regex, &e->line);
if (rc == NGX_DECLINED) {
if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
"\"%V\" does not match \"%V\"",
&code->name, &e->line);
}
r->ncaptures = 0;
if (code->test) {
if (code->negative_test) {
e->sp->len = 1;
e->sp->data = (u_char *) "1";
} else {
e->sp->len = 0;
e->sp->data = (u_char *) "";
}
e->sp++;
e->ip += sizeof(ngx_http_script_regex_code_t);
return;
}
e->ip += code->next;
return;
}
if (rc == NGX_ERROR) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
"\"%V\" matches \"%V\"", &code->name, &e->line);
}
if (code->test) {
if (code->negative_test) {
e->sp->len = 0;
e->sp->data = (u_char *) "";
} else {
e->sp->len = 1;
e->sp->data = (u_char *) "1";
}
e->sp++;
e->ip += sizeof(ngx_http_script_regex_code_t);
return;
}
if (code->status) {
e->status = code->status;
if (!code->redirect) {
e->ip = ngx_http_script_exit;
return;
}
}
if (code->uri) {
r->internal = 1;
r->valid_unparsed_uri = 0;
if (code->break_cycle) {
r->valid_location = 0;
r->uri_changed = 0;
} else {
r->uri_changed = 1;
}
}
if (code->lengths == NULL) {
e->buf.len = code->size;
if (code->uri) {
if (r->ncaptures && (r->quoted_uri || r->plus_in_uri)) {
e->buf.len += 2 * ngx_escape_uri(NULL, r->uri.data, r->uri.len,
NGX_ESCAPE_ARGS);
}
}
for (n = 2; n < r->ncaptures; n += 2) {
e->buf.len += r->captures[n + 1] - r->captures[n];
}
} else {
ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
le.ip = code->lengths->elts;
le.line = e->line;
le.request = r;
le.quote = code->redirect;
len = 0;
while (*(uintptr_t *) le.ip) {
lcode = *(ngx_http_script_len_code_pt *) le.ip;
len += lcode(&le);
}
e->buf.len = len;
}
if (code->add_args && r->args.len) {
e->buf.len += r->args.len + 1;
}
e->buf.data = ngx_pnalloc(r->pool, e->buf.len);
if (e->buf.data == NULL) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
e->quote = code->redirect;
e->pos = e->buf.data;
e->ip += sizeof(ngx_http_script_regex_code_t);
}
void
ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
{
u_char *dst, *src;
ngx_http_request_t *r;
ngx_http_script_regex_end_code_t *code;
code = (ngx_http_script_regex_end_code_t *) e->ip;
r = e->request;
e->quote = 0;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http script regex end");
if (code->redirect) {
dst = e->buf.data;
src = e->buf.data;
ngx_unescape_uri(&dst, &src, e->pos - e->buf.data,
NGX_UNESCAPE_REDIRECT);
if (src < e->pos) {
dst = ngx_movemem(dst, src, e->pos - src);
}
e->pos = dst;
if (code->add_args && r->args.len) {
*e->pos++ = (u_char) (code->args ? '&' : '?');
e->pos = ngx_copy(e->pos, r->args.data, r->args.len);
}
e->buf.len = e->pos - e->buf.data;
if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
"rewritten redirect: \"%V\"", &e->buf);
}
ngx_http_clear_location(r);
r->headers_out.location = ngx_list_push(&r->headers_out.headers);
if (r->headers_out.location == NULL) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
r->headers_out.location->hash = 1;
r->headers_out.location->next = NULL;
ngx_str_set(&r->headers_out.location->key, "Location");
r->headers_out.location->value = e->buf;
e->ip += sizeof(ngx_http_script_regex_end_code_t);
return;
}
if (e->args) {
e->buf.len = e->args - e->buf.data;
if (code->add_args && r->args.len) {
*e->pos++ = '&';
e->pos = ngx_copy(e->pos, r->args.data, r->args.len);
}
r->args.len = e->pos - e->args;
r->args.data = e->args;
e->args = NULL;
} else {
e->buf.len = e->pos - e->buf.data;
if (!code->add_args) {
r->args.len = 0;
}
}
if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
"rewritten data: \"%V\", args: \"%V\"",
&e->buf, &r->args);
}
if (code->uri) {
r->uri = e->buf;
if (r->uri.len == 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"the rewritten URI has a zero length");
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
ngx_http_set_exten(r);
}
e->ip += sizeof(ngx_http_script_regex_end_code_t);
}
static ngx_int_t
ngx_http_script_add_capture_code(ngx_http_script_compile_t *sc, ngx_uint_t n)
{
ngx_http_script_copy_capture_code_t *code;
code = ngx_http_script_add_code(*sc->lengths,
sizeof(ngx_http_script_copy_capture_code_t),
NULL);
if (code == NULL) {
return NGX_ERROR;
}
code->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_capture_len_code;
code->n = 2 * n;
code = ngx_http_script_add_code(*sc->values,
sizeof(ngx_http_script_copy_capture_code_t),
&sc->main);
if (code == NULL) {
return NGX_ERROR;
}
code->code = ngx_http_script_copy_capture_code;
code->n = 2 * n;
if (sc->ncaptures < n) {
sc->ncaptures = n;
}
return NGX_OK;
}
size_t
ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e)
{
int *cap;
u_char *p;
ngx_uint_t n;
ngx_http_request_t *r;
ngx_http_script_copy_capture_code_t *code;
r = e->request;
code = (ngx_http_script_copy_capture_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_copy_capture_code_t);
n = code->n;
if (n < r->ncaptures) {
cap = r->captures;
if ((e->is_args || e->quote)
&& (e->request->quoted_uri || e->request->plus_in_uri))
{
p = r->captures_data;
return cap[n + 1] - cap[n]
+ 2 * ngx_escape_uri(NULL, &p[cap[n]], cap[n + 1] - cap[n],
NGX_ESCAPE_ARGS);
} else {
return cap[n + 1] - cap[n];
}
}
return 0;
}
void
ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e)
{
int *cap;
u_char *p, *pos;
ngx_uint_t n;
ngx_http_request_t *r;
ngx_http_script_copy_capture_code_t *code;
r = e->request;
code = (ngx_http_script_copy_capture_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_copy_capture_code_t);
n = code->n;
pos = e->pos;
if (n < r->ncaptures) {
cap = r->captures;
p = r->captures_data;
if ((e->is_args || e->quote)
&& (e->request->quoted_uri || e->request->plus_in_uri))
{
e->pos = (u_char *) ngx_escape_uri(pos, &p[cap[n]],
cap[n + 1] - cap[n],
NGX_ESCAPE_ARGS);
} else {
e->pos = ngx_copy(pos, &p[cap[n]], cap[n + 1] - cap[n]);
}
}
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script capture: \"%*s\"", e->pos - pos, pos);
}
#endif
static ngx_int_t
ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc)
{
ngx_http_script_full_name_code_t *code;
code = ngx_http_script_add_code(*sc->lengths,
sizeof(ngx_http_script_full_name_code_t),
NULL);
if (code == NULL) {
return NGX_ERROR;
}
code->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_full_name_len_code;
code->conf_prefix = sc->conf_prefix;
code = ngx_http_script_add_code(*sc->values,
sizeof(ngx_http_script_full_name_code_t),
&sc->main);
if (code == NULL) {
return NGX_ERROR;
}
code->code = ngx_http_script_full_name_code;
code->conf_prefix = sc->conf_prefix;
return NGX_OK;
}
static size_t
ngx_http_script_full_name_len_code(ngx_http_script_engine_t *e)
{
ngx_http_script_full_name_code_t *code;
code = (ngx_http_script_full_name_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_full_name_code_t);
return code->conf_prefix ? ngx_cycle->conf_prefix.len:
ngx_cycle->prefix.len;
}
static void
ngx_http_script_full_name_code(ngx_http_script_engine_t *e)
{
ngx_http_script_full_name_code_t *code;
ngx_str_t value, *prefix;
code = (ngx_http_script_full_name_code_t *) e->ip;
value.data = e->buf.data;
value.len = e->pos - e->buf.data;
prefix = code->conf_prefix ? (ngx_str_t *) &ngx_cycle->conf_prefix:
(ngx_str_t *) &ngx_cycle->prefix;
if (ngx_get_full_name(e->request->pool, prefix, &value) != NGX_OK) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
e->buf = value;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script fullname: \"%V\"", &value);
e->ip += sizeof(ngx_http_script_full_name_code_t);
}
void
ngx_http_script_return_code(ngx_http_script_engine_t *e)
{
ngx_http_script_return_code_t *code;
code = (ngx_http_script_return_code_t *) e->ip;
if (code->status < NGX_HTTP_BAD_REQUEST
|| code->text.value.len
|| code->text.lengths)
{
e->status = ngx_http_send_response(e->request, code->status, NULL,
&code->text);
} else {
e->status = code->status;
}
e->ip = ngx_http_script_exit;
}
void
ngx_http_script_break_code(ngx_http_script_engine_t *e)
{
ngx_http_request_t *r;
r = e->request;
if (r->uri_changed) {
r->valid_location = 0;
r->uri_changed = 0;
}
e->ip = ngx_http_script_exit;
}
void
ngx_http_script_if_code(ngx_http_script_engine_t *e)
{
ngx_http_script_if_code_t *code;
code = (ngx_http_script_if_code_t *) e->ip;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script if");
e->sp--;
if (e->sp->len && (e->sp->len != 1 || e->sp->data[0] != '0')) {
if (code->loc_conf) {
e->request->loc_conf = code->loc_conf;
ngx_http_update_location_config(e->request);
}
e->ip += sizeof(ngx_http_script_if_code_t);
return;
}
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script if: false");
e->ip += code->next;
}
void
ngx_http_script_equal_code(ngx_http_script_engine_t *e)
{
ngx_http_variable_value_t *val, *res;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script equal");
e->sp--;
val = e->sp;
res = e->sp - 1;
e->ip += sizeof(uintptr_t);
if (val->len == res->len
&& ngx_strncmp(val->data, res->data, res->len) == 0)
{
*res = ngx_http_variable_true_value;
return;
}
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script equal: no");
*res = ngx_http_variable_null_value;
}
void
ngx_http_script_not_equal_code(ngx_http_script_engine_t *e)
{
ngx_http_variable_value_t *val, *res;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script not equal");
e->sp--;
val = e->sp;
res = e->sp - 1;
e->ip += sizeof(uintptr_t);
if (val->len == res->len
&& ngx_strncmp(val->data, res->data, res->len) == 0)
{
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script not equal: no");
*res = ngx_http_variable_null_value;
return;
}
*res = ngx_http_variable_true_value;
}
void
ngx_http_script_file_code(ngx_http_script_engine_t *e)
{
ngx_str_t path;
ngx_http_request_t *r;
ngx_open_file_info_t of;
ngx_http_core_loc_conf_t *clcf;
ngx_http_variable_value_t *value;
ngx_http_script_file_code_t *code;
value = e->sp - 1;
code = (ngx_http_script_file_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_file_code_t);
path.len = value->len - 1;
path.data = value->data;
r = e->request;
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http script file op %p \"%V\"", (void *) code->op, &path);
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.test_only = 1;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
{
if (of.err == 0) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
if (of.err != NGX_ENOENT
&& of.err != NGX_ENOTDIR
&& of.err != NGX_ENAMETOOLONG)
{
ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
"%s \"%s\" failed", of.failed, value->data);
}
switch (code->op) {
case ngx_http_script_file_plain:
case ngx_http_script_file_dir:
case ngx_http_script_file_exists:
case ngx_http_script_file_exec:
goto false_value;
case ngx_http_script_file_not_plain:
case ngx_http_script_file_not_dir:
case ngx_http_script_file_not_exists:
case ngx_http_script_file_not_exec:
goto true_value;
}
goto false_value;
}
switch (code->op) {
case ngx_http_script_file_plain:
if (of.is_file) {
goto true_value;
}
goto false_value;
case ngx_http_script_file_not_plain:
if (of.is_file) {
goto false_value;
}
goto true_value;
case ngx_http_script_file_dir:
if (of.is_dir) {
goto true_value;
}
goto false_value;
case ngx_http_script_file_not_dir:
if (of.is_dir) {
goto false_value;
}
goto true_value;
case ngx_http_script_file_exists:
if (of.is_file || of.is_dir || of.is_link) {
goto true_value;
}
goto false_value;
case ngx_http_script_file_not_exists:
if (of.is_file || of.is_dir || of.is_link) {
goto false_value;
}
goto true_value;
case ngx_http_script_file_exec:
if (of.is_exec) {
goto true_value;
}
goto false_value;
case ngx_http_script_file_not_exec:
if (of.is_exec) {
goto false_value;
}
goto true_value;
}
false_value:
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http script file op false");
*value = ngx_http_variable_null_value;
return;
true_value:
*value = ngx_http_variable_true_value;
return;
}
void
ngx_http_script_complex_value_code(ngx_http_script_engine_t *e)
{
size_t len;
ngx_http_script_engine_t le;
ngx_http_script_len_code_pt lcode;
ngx_http_script_complex_value_code_t *code;
code = (ngx_http_script_complex_value_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_complex_value_code_t);
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script complex value");
ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
le.ip = code->lengths->elts;
le.line = e->line;
le.request = e->request;
le.quote = e->quote;
for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) {
lcode = *(ngx_http_script_len_code_pt *) le.ip;
}
e->buf.len = len;
e->buf.data = ngx_pnalloc(e->request->pool, len);
if (e->buf.data == NULL) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
e->pos = e->buf.data;
e->sp->len = e->buf.len;
e->sp->data = e->buf.data;
e->sp++;
}
void
ngx_http_script_value_code(ngx_http_script_engine_t *e)
{
ngx_http_script_value_code_t *code;
code = (ngx_http_script_value_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_value_code_t);
e->sp->len = code->text_len;
e->sp->data = (u_char *) code->text_data;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script value: \"%v\"", e->sp);
e->sp++;
}
void
ngx_http_script_set_var_code(ngx_http_script_engine_t *e)
{
ngx_http_request_t *r;
ngx_http_script_var_code_t *code;
code = (ngx_http_script_var_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_var_code_t);
r = e->request;
e->sp--;
r->variables[code->index].len = e->sp->len;
r->variables[code->index].valid = 1;
r->variables[code->index].no_cacheable = 0;
r->variables[code->index].not_found = 0;
r->variables[code->index].data = e->sp->data;
#if (NGX_DEBUG)
{
ngx_http_variable_t *v;
ngx_http_core_main_conf_t *cmcf;
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
v = cmcf->variables.elts;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script set $%V", &v[code->index].name);
}
#endif
}
void
ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e)
{
ngx_http_script_var_handler_code_t *code;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script set var handler");
code = (ngx_http_script_var_handler_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_var_handler_code_t);
e->sp--;
code->handler(e->request, e->sp, code->data);
}
void
ngx_http_script_var_code(ngx_http_script_engine_t *e)
{
ngx_http_variable_value_t *value;
ngx_http_script_var_code_t *code;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script var");
code = (ngx_http_script_var_code_t *) e->ip;
e->ip += sizeof(ngx_http_script_var_code_t);
value = ngx_http_get_flushed_variable(e->request, code->index);
if (value && !value->not_found) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
"http script var: \"%v\"", value);
*e->sp = *value;
e->sp++;
return;
}
*e->sp = ngx_http_variable_null_value;
e->sp++;
}
void
ngx_http_script_nop_code(ngx_http_script_engine_t *e)
{
e->ip += sizeof(uintptr_t);
}
|
80925240231be51fa3fc1256f597d9ee4ab0f526
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/media/usb/cx231xx/cx231xx-vbi.h
|
16c7d20a22a4a79b6107f4e9245e3fb67b6fb5ed
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 2,261
|
h
|
cx231xx-vbi.h
|
/*
cx231xx_vbi.h - driver for Conexant Cx23100/101/102 USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
Based on cx88 driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _CX231XX_VBI_H
#define _CX231XX_VBI_H
extern struct videobuf_queue_ops cx231xx_vbi_qops;
#define NTSC_VBI_START_LINE 10 /* line 10 - 21 */
#define NTSC_VBI_END_LINE 21
#define NTSC_VBI_LINES (NTSC_VBI_END_LINE-NTSC_VBI_START_LINE+1)
#define PAL_VBI_START_LINE 6
#define PAL_VBI_END_LINE 23
#define PAL_VBI_LINES (PAL_VBI_END_LINE-PAL_VBI_START_LINE+1)
#define VBI_STRIDE 1440
#define VBI_SAMPLES_PER_LINE 1440
#define CX231XX_NUM_VBI_PACKETS 4
#define CX231XX_NUM_VBI_BUFS 5
/* stream functions */
int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
int num_bufs, int max_pkt_size,
int (*bulk_copy) (struct cx231xx *dev,
struct urb *urb));
void cx231xx_uninit_vbi_isoc(struct cx231xx *dev);
/* vbi data copy functions */
u32 cx231xx_get_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
u8 sav_eav, u8 *p_buffer, u32 buffer_size);
u32 cx231xx_copy_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
u8 *p_line, u32 length, int field_number);
void cx231xx_reset_vbi_buffer(struct cx231xx *dev,
struct cx231xx_dmaqueue *dma_q);
int cx231xx_do_vbi_copy(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
u8 *p_buffer, u32 bytes_to_copy);
u8 cx231xx_is_vbi_buffer_done(struct cx231xx *dev,
struct cx231xx_dmaqueue *dma_q);
#endif
|
6c807e24e843ec8e3141bb3a270ef3d761898e71
|
89db60818afeb3dc7c3b7abe9ceae155f074f7f2
|
/src/cmd/fossil/9srv.c
|
0dad3d11f4cc431cbc1251f864a808479613a5e1
|
[
"bzip2-1.0.6",
"LPL-1.02",
"MIT"
] |
permissive
|
9fans/plan9port
|
63c3d01928c6f8a8617d3ea6ecc05bac72391132
|
65c090346a38a8c30cb242d345aa71060116340c
|
refs/heads/master
| 2023-08-25T17:14:26.233105
| 2023-08-23T13:21:37
| 2023-08-23T18:47:08
| 26,095,474
| 1,645
| 468
|
NOASSERTION
| 2023-09-05T16:55:41
| 2014-11-02T22:40:13
|
C
|
UTF-8
|
C
| false
| false
| 4,076
|
c
|
9srv.c
|
#include "stdinc.h"
#include "9.h"
typedef struct Srv Srv;
struct Srv {
int fd;
int srvfd;
char* service;
char* mntpnt;
Srv* next;
Srv* prev;
};
static struct {
RWLock lock;
Srv* head;
Srv* tail;
} sbox;
#ifndef PLAN9PORT
static int
srvFd(char* name, int mode, int fd, char** mntpnt)
{
int n, srvfd;
char *p, buf[10];
/*
* Drop a file descriptor with given name and mode into /srv.
* Create with ORCLOSE and don't close srvfd so it will be removed
* automatically on process exit.
*/
p = smprint("/srv/%s", name);
if((srvfd = create(p, ORCLOSE|OWRITE, mode)) < 0){
vtfree(p);
p = smprint("#s/%s", name);
if((srvfd = create(p, ORCLOSE|OWRITE, mode)) < 0){
werrstr("create %s: %r", p);
vtfree(p);
return -1;
}
}
n = snprint(buf, sizeof(buf), "%d", fd);
if(write(srvfd, buf, n) < 0){
close(srvfd);
werrstr("write %s: %r", p);
vtfree(p);
return -1;
}
*mntpnt = p;
return srvfd;
}
#endif
static void
srvFree(Srv* srv)
{
if(srv->prev != nil)
srv->prev->next = srv->next;
else
sbox.head = srv->next;
if(srv->next != nil)
srv->next->prev = srv->prev;
else
sbox.tail = srv->prev;
if(srv->srvfd != -1)
close(srv->srvfd);
vtfree(srv->service);
vtfree(srv->mntpnt);
vtfree(srv);
}
static Srv*
srvAlloc(char* service, int mode, int fd)
{
Dir *dir;
Srv *srv;
int srvfd;
char *mntpnt;
wlock(&sbox.lock);
for(srv = sbox.head; srv != nil; srv = srv->next){
if(strcmp(srv->service, service) != 0)
continue;
/*
* If the service exists, but is stale,
* free it up and let the name be reused.
*/
if((dir = dirfstat(srv->srvfd)) != nil){
free(dir);
werrstr("srv: already serving '%s'", service);
wunlock(&sbox.lock);
return nil;
}
srvFree(srv);
break;
}
#ifdef PLAN9PORT
mntpnt = nil;
if((srvfd = post9pservice(fd, service, mntpnt)) < 0){
#else
if((srvfd = srvFd(service, mode, fd, &mntpnt)) < 0){
#endif
wunlock(&sbox.lock);
return nil;
}
close(fd);
srv = vtmallocz(sizeof(Srv));
srv->srvfd = srvfd;
srv->service = vtstrdup(service);
srv->mntpnt = mntpnt;
if(sbox.tail != nil){
srv->prev = sbox.tail;
sbox.tail->next = srv;
}
else{
sbox.head = srv;
srv->prev = nil;
}
sbox.tail = srv;
wunlock(&sbox.lock);
return srv;
}
static int
cmdSrv(int argc, char* argv[])
{
Con *con;
Srv *srv;
char *usage = "usage: srv [-APWdp] [service]";
int conflags, dflag, fd[2], mode, pflag, r;
dflag = 0;
pflag = 0;
conflags = 0;
mode = 0666;
ARGBEGIN{
default:
return cliError(usage);
case 'A':
conflags |= ConNoAuthCheck;
break;
case 'I':
conflags |= ConIPCheck;
break;
case 'N':
conflags |= ConNoneAllow;
break;
case 'P':
conflags |= ConNoPermCheck;
mode = 0600;
break;
case 'W':
conflags |= ConWstatAllow;
mode = 0600;
break;
case 'd':
dflag = 1;
break;
case 'p':
pflag = 1;
mode = 0600;
break;
}ARGEND
if(pflag && (conflags&ConNoPermCheck)){
werrstr("srv: cannot use -P with -p");
return 0;
}
switch(argc){
default:
return cliError(usage);
case 0:
rlock(&sbox.lock);
for(srv = sbox.head; srv != nil; srv = srv->next)
consPrint("\t%s\t%d\n", srv->service, srv->srvfd);
runlock(&sbox.lock);
return 1;
case 1:
if(!dflag)
break;
wlock(&sbox.lock);
for(srv = sbox.head; srv != nil; srv = srv->next){
if(strcmp(srv->service, argv[0]) != 0)
continue;
srvFree(srv);
break;
}
wunlock(&sbox.lock);
if(srv == nil){
werrstr("srv: '%s' not found", argv[0]);
return 0;
}
return 1;
}
#ifdef PLAN9PORT /* fossilcons unsupported */
if(pflag)
return 1;
#endif
if(pipe(fd) < 0){
werrstr("srv pipe: %r");
return 0;
}
if((srv = srvAlloc(argv[0], mode, fd[0])) == nil){
close(fd[0]); close(fd[1]);
return 0;
}
if(pflag)
r = consOpen(fd[1], srv->srvfd, -1);
else{
con = conAlloc(fd[1], srv->mntpnt, conflags);
if(con == nil)
r = 0;
else
r = 1;
}
if(r == 0){
close(fd[1]);
wlock(&sbox.lock);
srvFree(srv);
wunlock(&sbox.lock);
}
return r;
}
int
srvInit(void)
{
cliAddCmd("srv", cmdSrv);
return 1;
}
|
051a84a8b696e30b0f07ad1567fbbae6845a4566
|
59864cbd213b5da6f50d6255b0a021564b3d5bd4
|
/challenges/CableGrind/pov_36/pov.c
|
019541968689bc068def771173e08bd0c202aafa
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown",
"BSD-2-Clause"
] |
permissive
|
trailofbits/cb-multios
|
8af96a4fbc3b34644367faa135347f88e0e0d0a3
|
810d7b24b1f62f56ef49b148fe155b0d0629cad2
|
refs/heads/master
| 2023-09-05T03:56:20.229403
| 2022-12-27T15:47:54
| 2022-12-27T15:47:54
| 41,688,943
| 522
| 133
|
MIT
| 2023-06-29T02:47:13
| 2015-08-31T17:04:31
|
C
|
UTF-8
|
C
| false
| false
| 16,204
|
c
|
pov.c
|
#include "libpov.h"
int main(int cgc_argc, char *cgc_argv[]) {
cgc_negotiate_type1(0x0, 0x0, 0);
do {
//*** writing data
static unsigned char write_00000_00000[] =
"\x04\x04\x00\x00";
static unsigned int write_00000_00000_len = 4;
unsigned char *write_00000 = NULL;
unsigned int write_00000_len = 0;
write_00000 = cgc_append_buf(write_00000, &write_00000_len, write_00000_00000, write_00000_00000_len);
if (write_00000_len > 0) {
cgc_transmit_all(1, write_00000, write_00000_len);
}
cgc_free(write_00000);
} while (0);
do {
//*** writing data
static unsigned char write_00001_00000[] =
"\x01\x00\x00\x00\x00\x00\x00\x00\xf0\x03\x00\x00\xe8\x03\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00\x86\x39\x63\x0b"
"\x4e\xce\x88\x69\x95\x6b\xc7\xf1\x9c\x5b\xa6\x0e\xa8\x0b\x11\x8d"
"\xd5\x00\x00\x00\x99\x1b\x00\x1b\x94\x0c\x15\xf9\xa3\x87\x7b\xf4"
"\xfa\x58\x98\x09\xe2\x43\x88\x46\x67\x92\x23\xc7\xea\xc8\x08\xb4"
"\x7b\x38\xc1\xdb\xd0\x11\xb9\x05\x0c\x05\x3a\x67\x4d\x08\x3c\xeb"
"\x72\x25\xf7\x97\x6b\x8f\xf9\x03\x06\x62\xc5\x4e\x97\x07\x56\xba"
"\x3f\xdf\xc0\xb0\x84\x0a\xaa\xcf\xe7\x69\x87\x71\x35\xd0\xfc\xe1"
"\xdc\x57\x57\x65\x63\x55\xe1\x50\x08\x55\x46\x48\xe3\x23\xda\xb5"
"\x84\x9c\x99\x9e\xce\x61\x76\x17\xcb\xa2\xba\x6d\x47\x41\xe7\x2a"
"\x74\x1d\xec\xe2\xe7\x79\xc6\x8d\xa2\x4e\x42\xc1\xb2\x42\xa4\x32"
"\xde\xf1\x5e\xa1\xf7\x68\xe5\x79\x96\x61\x01\xc2\x6c\xf9\x2d\x80"
"\xd1\xba\xc3\x22\x2b\x57\x83\x87\xdb\x62\x61\x00\xfa\xca\xd6\x31"
"\x21\x5d\x1f\xfc\x08\x32\x8f\x03\x2b\x62\x38\x72\x1b\xea\xfd\xaf"
"\x2c\xc0\xc2\x44\x60\xff\xb0\x52\x95\x8f\xde\x68\x27\x80\xd0\xc0"
"\x30\xa7\x61\xf1\xc6\x53\x45\xb6\xbe\x1a\x0e\x18\x4a\x48\x99\x16"
"\x56\x6d\xef\x8c\x82\xbc\xe1\xa2\xd7\xc6\xda\xa5\x8c\x70\xac\x29"
"\xd5\xbc\x72\x8a\x18\xc6\x34\xed\xd1\xa0\xcf\x9a\xa3\x67\x93\x45"
"\xdb\x66\xb9\xbb\xb8\x48\x8f\x52\x6d\x47\x8c\x73\x20\x8c\xd9\x0b"
"\xa0\x70\x39\xf6\x71\x00\x87\xf7\x38\xf7\xf1\x6b\x31\xe4\xc6\x8b"
"\x9b\x7a\x9f\x13\x8a\x88\xeb\x31\xfb\xd0\x20\x29\xa2\x54\xa2\xbb"
"\x5b\xe7\x05\x5a\xda\x33\x2a\xbf\xd8\xab\x7f\xc4\x61\xbf\x04\xa3"
"\x18\xfd\x7a\x0a\x8a\x4d\xf7\x20\x07\xe6\x1b\xa1\xea\x92\x86\x02"
"\xe1\xac\x96\xff\xc3\x4d\x30\x6f\x3e\x21\x16\x85\xd3\xad\x78\x7d"
"\x17\xa6\xfc\x32\x9c\xf4\xaa\x8f\xbe\xa1\x71\x38\x83\x35\xcf\xbf"
"\x17\xc7\xed\x8f\x16\xcc\xfe\xb7\x3a\x8f\x4f\x33\x4c\x71\x73\xa2"
"\xa3\x7a\xb9\xdd\xc2\x6e\xb6\xfd\x53\xee\x54\xcc\x9c\x2e\x42\x9c"
"\xf2\xd8\xd6\x57\xab\x4c\x93\xd5\xe5\x64\xb6\xba\x79\x8d\xca\x88"
"\xbb\xf3\x85\x97\x71\x9f\x65\xf8\x6b\x93\x54\xde\x92\x0f\x0b\x39"
"\xac\xc3\x76\x9a\xe2\x33\xa6\x6a\xc2\x89\x4c\x42\xd8\x72\x05\xee"
"\x4a\x14\x3f\x38\x6b\x43\x84\x7b\xe8\x0f\x3c\x2e\x44\x26\x52\x9a"
"\xc5\x7f\xbd\x23\x75\x46\x39\x08\xc2\xaf\x76\x51\xc4\xf8\x4e\x3f"
"\xe7\x70\x6c\x63\x2d\x9a\x1b\x1b\x85\x34\x43\xc9\xc8\x5d\x1b\xd7"
"\xdb\xf8\x11\x2b\x78\x65\x5e\x47\xf7\x77\x70\x31\x25\x69\xa4\x8a"
"\xfb\xd6\x40\xd1\x27\xa8\x00\xeb\xf9\x3f\x20\x0d\xaa\xb2\xf4\x23"
"\x5b\x74\x98\x16\x18\x1b\x3c\xe1\xac\x05\x87\x89\x77\xe4\x4e\xe2"
"\xef\xd7\x3d\x4e\x23\x59\xd8\xe6\x29\x5a\x60\x2d\xb8\x9d\x2c\xf3"
"\x35\xa7\xb9\xe7\xba\xb0\xb5\xbe\x0a\x25\xa3\xe9\x24\xf5\x14\x18"
"\xc7\x1b\x19\xc3\x25\xae\xe2\x3d\x7b\x8b\x96\x93\xce\x8c\xe7\x12"
"\xcc\xb1\x62\x5c\xe4\xd8\x13\xd5\x62\xfa\xa2\xb4\x99\x40\x23\x9c"
"\x72\xc6\x14\x71\x73\xca\x1c\x4b\x4d\xbf\x8b\x70\xf7\xec\xb9\xb0"
"\xa2\x73\x66\xd0\xb2\x39\x2f\x1a\xfe\x7e\x2d\xfb\x0e\x8b\x79\xd7"
"\x55\x27\xbc\x5c\x28\xa9\x44\xf2\x24\x8d\x8c\x3d\x45\x5c\x09\x7c"
"\xef\xdb\x15\x12\x09\xc2\x62\x71\x1d\x27\x66\xf2\xde\xd4\xa1\xca"
"\xe0\xff\x09\x3c\x12\x66\x06\x25\xfc\x03\xb8\xc5\x1f\x12\xf9\xa7"
"\x18\xfe\x93\x36\xc1\x5c\x0c\x16\x85\x06\x2d\x20\x0a\x9b\xc5\x81"
"\xc6\x81\x4c\xd2\x60\x74\xa4\x43\x96\xf5\x05\x5c\x89\x6f\x39\xe0"
"\x30\x99\xf1\x98\x3a\x13\x0a\xce\xf7\x4f\x59\xb6\x03\x2a\xca\x7e"
"\xe2\x63\x5d\x2b\x43\x9f\x40\xb5\xdd\xe6\x26\x67\x0a\x1c\x9f\x88"
"\x45\xcb\x03\x5f\xe1\x03\xbd\xf1\xe9\x38\x61\x53\x10\xa1\x4f\xc8"
"\x54\xd7\x41\x5c\x88\x5a\x99\x8b\x9d\x60\x8f\x07\xa3\x0d\x00\x9b"
"\x11\xba\x2f\xe9\x01\xa7\xbd\xd0\x5d\xc8\xdb\xc2\x42\x85\x86\xbb"
"\x13\xd3\xe2\xe7\x99\x53\x75\x3a\xea\xf6\xd6\xad\xc2\x53\x43\x69"
"\x84\x85\x58\xb4\xe4\x62\xce\x46\x2f\x40\xc9\x0f\xcd\x16\x69\x9b"
"\x3a\x9d\x99\xd5\x5d\xa8\x84\x01\x43\xea\xc0\x40\x66\x52\x87\xe5"
"\x76\x55\xa2\xd0\x55\x18\x10\x97\x8c\x2f\x0e\x00\x9e\x6a\x87\x2b"
"\x3c\x3b\xb5\x29\xf4\x43\x69\x6f\xe2\xd0\x6b\x79\x40\xf4\xa2\xf5"
"\xda\x94\x5c\x07\xb9\xb1\xc2\xce\xc3\x27\x53\x9b\x91\x44\x0e\xf2"
"\xac\x75\xaf\xef\x14\x70\x66\x47\x90\x82\xed\x02\xba\x55\xce\xe9"
"\x3a\x58\x1e\x5b\x05\x39\x15\x97\x8c\xe3\x66\x6e\xab\xd5\x10\x00"
"\xb1\x57\x12\x8d\xfc\xb4\xcc\xab\x82\x2d\x5b\x34\x03\x30\x63\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20";
static unsigned int write_00001_00000_len = 1028;
unsigned char *write_00001 = NULL;
unsigned int write_00001_len = 0;
write_00001 = cgc_append_buf(write_00001, &write_00001_len, write_00001_00000, write_00001_00000_len);
if (write_00001_len > 0) {
cgc_transmit_all(1, write_00001, write_00001_len);
}
cgc_free(write_00001);
} while (0);
do {
unsigned char *read_00000;
unsigned int read_00000_len;
unsigned int read_00000_ptr = 0;
//**** delimited read
static unsigned char read_00000_delim[] =
"\x0a";
read_00000 = NULL;
read_00000_len = 0;
int read_00000_res = cgc_delimited_read(0, &read_00000, &read_00000_len, read_00000_delim, 1);
if (read_00000_res) {} //silence unused variable warning
//**** read match data
static unsigned char match_00000_00000[] =
"\x53\x74\x61\x72\x74\x69\x6e\x67\x20\x64\x69\x73\x73\x65\x63\x74"
"\x69\x6f\x6e\x2e\x2e\x2e";
read_00000_ptr += cgc_data_match(read_00000 + read_00000_ptr, read_00000_len - read_00000_ptr, match_00000_00000, 22);
cgc_free(read_00000);
if (read_00000_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00001;
unsigned int read_00001_len;
unsigned int read_00001_ptr = 0;
//**** delimited read
static unsigned char read_00001_delim[] =
"\x3d\x3d\x3d\x3d\x0a";
read_00001 = NULL;
read_00001_len = 0;
int read_00001_res = cgc_delimited_read(0, &read_00001, &read_00001_len, read_00001_delim, 5);
if (read_00001_res) {} //silence unused variable warning
/* read match pcre:
.*New Packet
*/
static char read_00001_00000_regex[] =
"\x2e\x2a\x4e\x65\x77\x20\x50\x61\x63\x6b\x65\x74";
static match_result read_00001_00000_match;
pcre *read_00001_00000_pcre = cgc_init_regex(read_00001_00000_regex);
if (read_00001_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00001_00000_pcre, 0, read_00001 + read_00001_ptr, read_00001_len - read_00001_ptr, &read_00001_00000_match);
if (rc > 0) {
read_00001_ptr += read_00001_00000_match.match_end - read_00001_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00001_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00001);
if (read_00001_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00002;
unsigned int read_00002_len;
unsigned int read_00002_ptr = 0;
//**** delimited read
static unsigned char read_00002_delim[] =
"\x3d\x3d\x3d\x0a";
read_00002 = NULL;
read_00002_len = 0;
int read_00002_res = cgc_delimited_read(0, &read_00002, &read_00002_len, read_00002_delim, 4);
if (read_00002_res) {} //silence unused variable warning
/* read match pcre:
.*===rofl
*/
static char read_00002_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x72\x6f\x66\x6c";
static match_result read_00002_00000_match;
pcre *read_00002_00000_pcre = cgc_init_regex(read_00002_00000_regex);
if (read_00002_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00002_00000_pcre, 0, read_00002 + read_00002_ptr, read_00002_len - read_00002_ptr, &read_00002_00000_match);
if (rc > 0) {
read_00002_ptr += read_00002_00000_match.match_end - read_00002_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00002_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00002);
if (read_00002_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00003;
unsigned int read_00003_len;
unsigned int read_00003_ptr = 0;
//**** delimited read
static unsigned char read_00003_delim[] =
"\x3d\x3d\x3d\x0a";
read_00003 = NULL;
read_00003_len = 0;
int read_00003_res = cgc_delimited_read(0, &read_00003, &read_00003_len, read_00003_delim, 4);
if (read_00003_res) {} //silence unused variable warning
/* read match pcre:
.*===outlawrypervertedness
*/
static char read_00003_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x6f\x75\x74\x6c\x61\x77\x72\x79\x70\x65\x72"
"\x76\x65\x72\x74\x65\x64\x6e\x65\x73\x73";
static match_result read_00003_00000_match;
pcre *read_00003_00000_pcre = cgc_init_regex(read_00003_00000_regex);
if (read_00003_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00003_00000_pcre, 0, read_00003 + read_00003_ptr, read_00003_len - read_00003_ptr, &read_00003_00000_match);
if (rc > 0) {
read_00003_ptr += read_00003_00000_match.match_end - read_00003_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00003_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00003);
if (read_00003_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00004;
unsigned int read_00004_len;
unsigned int read_00004_ptr = 0;
//**** delimited read
static unsigned char read_00004_delim[] =
"\x3d\x3d\x3d\x0a";
read_00004 = NULL;
read_00004_len = 0;
int read_00004_res = cgc_delimited_read(0, &read_00004, &read_00004_len, read_00004_delim, 4);
if (read_00004_res) {} //silence unused variable warning
/* read match pcre:
.*===ineloquentundishonored
*/
static char read_00004_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x69\x6e\x65\x6c\x6f\x71\x75\x65\x6e\x74\x75"
"\x6e\x64\x69\x73\x68\x6f\x6e\x6f\x72\x65\x64";
static match_result read_00004_00000_match;
pcre *read_00004_00000_pcre = cgc_init_regex(read_00004_00000_regex);
if (read_00004_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00004_00000_pcre, 0, read_00004 + read_00004_ptr, read_00004_len - read_00004_ptr, &read_00004_00000_match);
if (rc > 0) {
read_00004_ptr += read_00004_00000_match.match_end - read_00004_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00004_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00004);
if (read_00004_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00005;
unsigned int read_00005_len;
unsigned int read_00005_ptr = 0;
//**** delimited read
static unsigned char read_00005_delim[] =
"\x3d\x3d\x3d\x0a";
read_00005 = NULL;
read_00005_len = 0;
int read_00005_res = cgc_delimited_read(0, &read_00005, &read_00005_len, read_00005_delim, 4);
if (read_00005_res) {} //silence unused variable warning
/* read match pcre:
.*===goniometerhexameral
*/
static char read_00005_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x67\x6f\x6e\x69\x6f\x6d\x65\x74\x65\x72\x68"
"\x65\x78\x61\x6d\x65\x72\x61\x6c";
static match_result read_00005_00000_match;
pcre *read_00005_00000_pcre = cgc_init_regex(read_00005_00000_regex);
if (read_00005_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00005_00000_pcre, 0, read_00005 + read_00005_ptr, read_00005_len - read_00005_ptr, &read_00005_00000_match);
if (rc > 0) {
read_00005_ptr += read_00005_00000_match.match_end - read_00005_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00005_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00005);
if (read_00005_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00006;
unsigned int read_00006_len;
unsigned int read_00006_ptr = 0;
//**** delimited read
static unsigned char read_00006_delim[] =
"\x3d\x3d\x3d\x0a";
read_00006 = NULL;
read_00006_len = 0;
int read_00006_res = cgc_delimited_read(0, &read_00006, &read_00006_len, read_00006_delim, 4);
if (read_00006_res) {} //silence unused variable warning
/* read match pcre:
.*Dissection finished
*/
static char read_00006_00000_regex[] =
"\x2e\x2a\x44\x69\x73\x73\x65\x63\x74\x69\x6f\x6e\x20\x66\x69\x6e"
"\x69\x73\x68\x65\x64";
static match_result read_00006_00000_match;
pcre *read_00006_00000_pcre = cgc_init_regex(read_00006_00000_regex);
if (read_00006_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00006_00000_pcre, 0, read_00006 + read_00006_ptr, read_00006_len - read_00006_ptr, &read_00006_00000_match);
if (rc > 0) {
read_00006_ptr += read_00006_00000_match.match_end - read_00006_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00006_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00006);
if (read_00006_ptr) {} //silence unused variable warning if any
} while (0);
}
|
81e639a93e9370a13c2740c05323b0331df500fc
|
537ee21156abb410a49c9a908b499d62396c965e
|
/src/include/srpc/rpc_thrift_idl.h
|
997d3ee2c39b39427a37ae274c7e1281697eec38
|
[
"Apache-2.0"
] |
permissive
|
sogou/srpc
|
b5ee496f72235558f50ee6eaf111c86403d58dbd
|
b3c738650ec63b45aac341f2a117e473f932691d
|
refs/heads/master
| 2023-09-05T11:12:31.860614
| 2023-09-04T12:56:46
| 2023-09-04T12:56:46
| 295,369,297
| 1,756
| 372
|
Apache-2.0
| 2023-09-04T12:56:47
| 2020-09-14T09:35:14
|
C++
|
UTF-8
|
C
| false
| false
| 29
|
h
|
rpc_thrift_idl.h
|
../../thrift/rpc_thrift_idl.h
|
6e41d2593b7462fb1d5890a6cf7f80780ce2f4d2
|
de22e1e826e75096c32fd4685b377e2e750f94c8
|
/tests/slicing/sources/loop3.c
|
a6aeec57e77a8d3906beb802fabe87cd19dcd52f
|
[
"MIT"
] |
permissive
|
mchalupa/dg
|
bb1430ebe5c9957d5f1b1278567674bdc03546ce
|
df6e4e23d2a0740ec9d9fa38e80032bd80556c95
|
refs/heads/master
| 2023-09-05T02:57:01.261394
| 2022-06-29T12:53:04
| 2022-12-19T10:12:03
| 31,018,102
| 458
| 146
|
MIT
| 2023-05-02T12:43:24
| 2015-02-19T14:12:47
|
C++
|
UTF-8
|
C
| false
| false
| 178
|
c
|
loop3.c
|
int glob = 1;
int main(void) {
int a = 0, b = 0;
while (a < 10) {
a += b;
b += 1;
test_assert(glob >= 1);
glob++;
}
return 0;
}
|
9ad1241bd6e3282f01e0dd78c4dc0829062a4cc3
|
95ae7dfa9ee578f1b24a65986ff78bf77ceca0c5
|
/Engine/lib/curl/lib/openldap.c
|
19f2ad9f08e0f25aeeb6f0ed08b544b6598ddaa3
|
[
"curl",
"MIT",
"LicenseRef-scancode-unknown"
] |
permissive
|
TorqueGameEngines/Torque3D
|
4e1f6a05cc0928980c8c7c20bcdd680eaa6dcee8
|
a445a4364664e299196bd551d213844486080145
|
refs/heads/development
| 2023-09-03T12:40:40.658487
| 2023-08-24T14:44:43
| 2023-08-24T14:44:43
| 267,440,108
| 1,192
| 178
|
MIT
| 2023-09-13T14:28:16
| 2020-05-27T22:35:54
|
C++
|
UTF-8
|
C
| false
| false
| 35,185
|
c
|
openldap.c
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2011 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2010, Howard Chu, <hyc@openldap.org>
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "curl_setup.h"
#if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP)
/*
* Notice that USE_OPENLDAP is only a source code selection switch. When
* libcurl is built with USE_OPENLDAP defined the libcurl source code that
* gets compiled is the code from openldap.c, otherwise the code that gets
* compiled is the code from ldap.c.
*
* When USE_OPENLDAP is defined a recent version of the OpenLDAP library
* might be required for compilation and runtime. In order to use ancient
* OpenLDAP library versions, USE_OPENLDAP shall not be defined.
*/
#include <ldap.h>
#include "urldata.h"
#include <curl/curl.h>
#include "sendf.h"
#include "vtls/vtls.h"
#include "transfer.h"
#include "curl_ldap.h"
#include "curl_base64.h"
#include "connect.h"
#include "curl_sasl.h"
#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
/*
* Uncommenting this will enable the built-in debug logging of the openldap
* library. The debug log level can be set using the CURL_OPENLDAP_TRACE
* environment variable. The debug output is written to stderr.
*
* The library supports the following debug flags:
* LDAP_DEBUG_NONE 0x0000
* LDAP_DEBUG_TRACE 0x0001
* LDAP_DEBUG_CONSTRUCT 0x0002
* LDAP_DEBUG_DESTROY 0x0004
* LDAP_DEBUG_PARAMETER 0x0008
* LDAP_DEBUG_ANY 0xffff
*
* For example, use CURL_OPENLDAP_TRACE=0 for no debug,
* CURL_OPENLDAP_TRACE=2 for LDAP_DEBUG_CONSTRUCT messages only,
* CURL_OPENLDAP_TRACE=65535 for all debug message levels.
*/
/* #define CURL_OPENLDAP_DEBUG */
/* Machine states. */
typedef enum {
OLDAP_STOP, /* Do nothing state, stops the state machine */
OLDAP_SSL, /* Performing SSL handshake. */
OLDAP_STARTTLS, /* STARTTLS request sent. */
OLDAP_TLS, /* Performing TLS handshake. */
OLDAP_MECHS, /* Get SASL authentication mechanisms. */
OLDAP_SASL, /* SASL binding reply. */
OLDAP_BIND, /* Simple bind reply. */
OLDAP_BINDV2, /* Simple bind reply in protocol version 2. */
OLDAP_LAST /* Never used */
} ldapstate;
#ifndef _LDAP_PVT_H
extern int ldap_pvt_url_scheme2proto(const char *);
extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url,
LDAP **ld);
#endif
static CURLcode oldap_setup_connection(struct Curl_easy *data,
struct connectdata *conn);
static CURLcode oldap_do(struct Curl_easy *data, bool *done);
static CURLcode oldap_done(struct Curl_easy *data, CURLcode, bool);
static CURLcode oldap_connect(struct Curl_easy *data, bool *done);
static CURLcode oldap_connecting(struct Curl_easy *data, bool *done);
static CURLcode oldap_disconnect(struct Curl_easy *data,
struct connectdata *conn, bool dead);
static CURLcode oldap_perform_auth(struct Curl_easy *data, const char *mech,
const struct bufref *initresp);
static CURLcode oldap_continue_auth(struct Curl_easy *data, const char *mech,
const struct bufref *resp);
static CURLcode oldap_cancel_auth(struct Curl_easy *data, const char *mech);
static CURLcode oldap_get_message(struct Curl_easy *data, struct bufref *out);
static Curl_recv oldap_recv;
/*
* LDAP protocol handler.
*/
const struct Curl_handler Curl_handler_ldap = {
"LDAP", /* scheme */
oldap_setup_connection, /* setup_connection */
oldap_do, /* do_it */
oldap_done, /* done */
ZERO_NULL, /* do_more */
oldap_connect, /* connect_it */
oldap_connecting, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* domore_getsock */
ZERO_NULL, /* perform_getsock */
oldap_disconnect, /* disconnect */
ZERO_NULL, /* readwrite */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
PORT_LDAP, /* defport */
CURLPROTO_LDAP, /* protocol */
CURLPROTO_LDAP, /* family */
PROTOPT_NONE /* flags */
};
#ifdef USE_SSL
/*
* LDAPS protocol handler.
*/
const struct Curl_handler Curl_handler_ldaps = {
"LDAPS", /* scheme */
oldap_setup_connection, /* setup_connection */
oldap_do, /* do_it */
oldap_done, /* done */
ZERO_NULL, /* do_more */
oldap_connect, /* connect_it */
oldap_connecting, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* domore_getsock */
ZERO_NULL, /* perform_getsock */
oldap_disconnect, /* disconnect */
ZERO_NULL, /* readwrite */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
PORT_LDAPS, /* defport */
CURLPROTO_LDAPS, /* protocol */
CURLPROTO_LDAP, /* family */
PROTOPT_SSL /* flags */
};
#endif
/* SASL parameters for the ldap protocol */
static const struct SASLproto saslldap = {
"ldap", /* The service name */
oldap_perform_auth, /* Send authentication command */
oldap_continue_auth, /* Send authentication continuation */
oldap_cancel_auth, /* Send authentication cancellation */
oldap_get_message, /* Get SASL response message */
0, /* Maximum initial response length (no max) */
LDAP_SASL_BIND_IN_PROGRESS, /* Code received when continuation is expected */
LDAP_SUCCESS, /* Code to receive upon authentication success */
SASL_AUTH_NONE, /* Default mechanisms */
0 /* Configuration flags */
};
struct ldapconninfo {
struct SASL sasl; /* SASL-related parameters */
LDAP *ld; /* Openldap connection handle. */
Curl_recv *recv; /* For stacking SSL handler */
Curl_send *send;
struct berval *servercred; /* SASL data from server. */
ldapstate state; /* Current machine state. */
int proto; /* LDAP_PROTO_TCP/LDAP_PROTO_UDP/LDAP_PROTO_IPC */
int msgid; /* Current message id. */
};
struct ldapreqinfo {
int msgid;
int nument;
};
/*
* state()
*
* This is the ONLY way to change LDAP state!
*/
static void state(struct Curl_easy *data, ldapstate newstate)
{
struct ldapconninfo *ldapc = data->conn->proto.ldapc;
#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
/* for debug purposes */
static const char * const names[] = {
"STOP",
"SSL",
"STARTTLS",
"TLS",
"MECHS",
"SASL",
"BIND",
"BINDV2",
/* LAST */
};
if(ldapc->state != newstate)
infof(data, "LDAP %p state change from %s to %s",
(void *)ldapc, names[ldapc->state], names[newstate]);
#endif
ldapc->state = newstate;
}
/* Map some particular LDAP error codes to CURLcode values. */
static CURLcode oldap_map_error(int rc, CURLcode result)
{
switch(rc) {
case LDAP_NO_MEMORY:
result = CURLE_OUT_OF_MEMORY;
break;
case LDAP_INVALID_CREDENTIALS:
result = CURLE_LOGIN_DENIED;
break;
case LDAP_PROTOCOL_ERROR:
result = CURLE_UNSUPPORTED_PROTOCOL;
break;
case LDAP_INSUFFICIENT_ACCESS:
result = CURLE_REMOTE_ACCESS_DENIED;
break;
}
return result;
}
static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp)
{
CURLcode result = CURLE_OK;
int rc = LDAP_URL_ERR_BADURL;
static const char * const url_errs[] = {
"success",
"out of memory",
"bad parameter",
"unrecognized scheme",
"unbalanced delimiter",
"bad URL",
"bad host or port",
"bad or missing attributes",
"bad or missing scope",
"bad or missing filter",
"bad or missing extensions"
};
*ludp = NULL;
if(!data->state.up.user && !data->state.up.password &&
!data->state.up.options)
rc = ldap_url_parse(data->state.url, ludp);
if(rc != LDAP_URL_SUCCESS) {
const char *msg = "url parsing problem";
result = rc == LDAP_URL_ERR_MEM? CURLE_OUT_OF_MEMORY: CURLE_URL_MALFORMAT;
rc -= LDAP_URL_SUCCESS;
if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0]))
msg = url_errs[rc];
failf(data, "LDAP local: %s", msg);
}
return result;
}
/* Parse the login options. */
static CURLcode oldap_parse_login_options(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct ldapconninfo *li = conn->proto.ldapc;
const char *ptr = conn->options;
while(!result && ptr && *ptr) {
const char *key = ptr;
const char *value;
while(*ptr && *ptr != '=')
ptr++;
value = ptr + 1;
while(*ptr && *ptr != ';')
ptr++;
if(checkprefix("AUTH=", key))
result = Curl_sasl_parse_url_auth_option(&li->sasl, value, ptr - value);
else
result = CURLE_SETOPT_OPTION_SYNTAX;
if(*ptr == ';')
ptr++;
}
return result == CURLE_URL_MALFORMAT? CURLE_SETOPT_OPTION_SYNTAX: result;
}
static CURLcode oldap_setup_connection(struct Curl_easy *data,
struct connectdata *conn)
{
CURLcode result;
LDAPURLDesc *lud;
struct ldapconninfo *li;
/* Early URL syntax check. */
result = oldap_url_parse(data, &lud);
ldap_free_urldesc(lud);
if(!result) {
li = calloc(1, sizeof(struct ldapconninfo));
if(!li)
result = CURLE_OUT_OF_MEMORY;
else {
li->proto = ldap_pvt_url_scheme2proto(data->state.up.scheme);
conn->proto.ldapc = li;
connkeep(conn, "OpenLDAP default");
/* Initialize the SASL storage */
Curl_sasl_init(&li->sasl, data, &saslldap);
/* Clear the TLS upgraded flag */
conn->bits.tls_upgraded = FALSE;
result = oldap_parse_login_options(conn);
}
}
return result;
}
/*
* Get the SASL authentication challenge from the server credential buffer.
*/
static CURLcode oldap_get_message(struct Curl_easy *data, struct bufref *out)
{
struct berval *servercred = data->conn->proto.ldapc->servercred;
if(!servercred || !servercred->bv_val)
return CURLE_WEIRD_SERVER_REPLY;
Curl_bufref_set(out, servercred->bv_val, servercred->bv_len, NULL);
return CURLE_OK;
}
/*
* Sends an initial SASL bind request to the server.
*/
static CURLcode oldap_perform_auth(struct Curl_easy *data, const char *mech,
const struct bufref *initresp)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode result = CURLE_OK;
struct berval cred;
struct berval *pcred = &cred;
int rc;
cred.bv_val = (char *) Curl_bufref_ptr(initresp);
cred.bv_len = Curl_bufref_len(initresp);
if(!cred.bv_val)
pcred = NULL;
rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid);
if(rc != LDAP_SUCCESS)
result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND);
return result;
}
/*
* Sends SASL continuation.
*/
static CURLcode oldap_continue_auth(struct Curl_easy *data, const char *mech,
const struct bufref *resp)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode result = CURLE_OK;
struct berval cred;
struct berval *pcred = &cred;
int rc;
cred.bv_val = (char *) Curl_bufref_ptr(resp);
cred.bv_len = Curl_bufref_len(resp);
if(!cred.bv_val)
pcred = NULL;
rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid);
if(rc != LDAP_SUCCESS)
result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND);
return result;
}
/*
* Sends SASL bind cancellation.
*/
static CURLcode oldap_cancel_auth(struct Curl_easy *data, const char *mech)
{
struct ldapconninfo *li = data->conn->proto.ldapc;
CURLcode result = CURLE_OK;
int rc = ldap_sasl_bind(li->ld, NULL, LDAP_SASL_NULL, NULL, NULL, NULL,
&li->msgid);
(void)mech;
if(rc != LDAP_SUCCESS)
result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND);
return result;
}
/* Starts LDAP simple bind. */
static CURLcode oldap_perform_bind(struct Curl_easy *data, ldapstate newstate)
{
CURLcode result = CURLE_OK;
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
char *binddn = NULL;
struct berval passwd;
int rc;
passwd.bv_val = NULL;
passwd.bv_len = 0;
if(data->state.aptr.user) {
binddn = conn->user;
passwd.bv_val = conn->passwd;
passwd.bv_len = strlen(passwd.bv_val);
}
rc = ldap_sasl_bind(li->ld, binddn, LDAP_SASL_SIMPLE, &passwd,
NULL, NULL, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, newstate);
else
result = oldap_map_error(rc,
data->state.aptr.user?
CURLE_LOGIN_DENIED: CURLE_LDAP_CANNOT_BIND);
return result;
}
/* Query the supported SASL authentication mechanisms. */
static CURLcode oldap_perform_mechs(struct Curl_easy *data)
{
CURLcode result = CURLE_OK;
struct ldapconninfo *li = data->conn->proto.ldapc;
int rc;
static const char * const supportedSASLMechanisms[] = {
"supportedSASLMechanisms",
NULL
};
rc = ldap_search_ext(li->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)",
(char **) supportedSASLMechanisms, 0,
NULL, NULL, NULL, 0, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, OLDAP_MECHS);
else
result = oldap_map_error(rc, CURLE_LOGIN_DENIED);
return result;
}
/* Starts SASL bind. */
static CURLcode oldap_perform_sasl(struct Curl_easy *data)
{
saslprogress progress = SASL_IDLE;
struct ldapconninfo *li = data->conn->proto.ldapc;
CURLcode result = Curl_sasl_start(&li->sasl, data, TRUE, &progress);
state(data, OLDAP_SASL);
if(!result && progress != SASL_INPROGRESS)
result = CURLE_LOGIN_DENIED;
return result;
}
#ifdef USE_SSL
static Sockbuf_IO ldapsb_tls;
static bool ssl_installed(struct connectdata *conn)
{
return conn->proto.ldapc->recv != NULL;
}
static CURLcode oldap_ssl_connect(struct Curl_easy *data, ldapstate newstate)
{
CURLcode result = CURLE_OK;
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
bool ssldone = 0;
result = Curl_ssl_connect_nonblocking(data, conn, FALSE,
FIRSTSOCKET, &ssldone);
if(!result) {
state(data, newstate);
if(ssldone) {
Sockbuf *sb;
/* Install the libcurl SSL handlers into the sockbuf. */
ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb);
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data);
li->recv = conn->recv[FIRSTSOCKET];
li->send = conn->send[FIRSTSOCKET];
}
}
return result;
}
/* Send the STARTTLS request */
static CURLcode oldap_perform_starttls(struct Curl_easy *data)
{
CURLcode result = CURLE_OK;
struct ldapconninfo *li = data->conn->proto.ldapc;
int rc = ldap_start_tls(li->ld, NULL, NULL, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, OLDAP_STARTTLS);
else
result = oldap_map_error(rc, CURLE_USE_SSL_FAILED);
return result;
}
#endif
static CURLcode oldap_connect(struct Curl_easy *data, bool *done)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
static const int version = LDAP_VERSION3;
int rc;
char *hosturl;
#ifdef CURL_OPENLDAP_DEBUG
static int do_trace = -1;
#endif
(void)done;
hosturl = aprintf("ldap%s://%s:%d",
conn->handler->flags & PROTOPT_SSL? "s": "",
conn->host.name, conn->remote_port);
if(!hosturl)
return CURLE_OUT_OF_MEMORY;
rc = ldap_init_fd(conn->sock[FIRSTSOCKET], li->proto, hosturl, &li->ld);
if(rc) {
failf(data, "LDAP local: Cannot connect to %s, %s",
hosturl, ldap_err2string(rc));
free(hosturl);
return CURLE_COULDNT_CONNECT;
}
free(hosturl);
#ifdef CURL_OPENLDAP_DEBUG
if(do_trace < 0) {
const char *env = getenv("CURL_OPENLDAP_TRACE");
do_trace = (env && strtol(env, NULL, 10) > 0);
}
if(do_trace)
ldap_set_option(li->ld, LDAP_OPT_DEBUG_LEVEL, &do_trace);
#endif
/* Try version 3 first. */
ldap_set_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &version);
/* Do not chase referrals. */
ldap_set_option(li->ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF);
#ifdef USE_SSL
if(conn->handler->flags & PROTOPT_SSL)
return oldap_ssl_connect(data, OLDAP_SSL);
if(data->set.use_ssl) {
CURLcode result = oldap_perform_starttls(data);
if(!result || data->set.use_ssl != CURLUSESSL_TRY)
return result;
}
#endif
if(li->sasl.prefmech != SASL_AUTH_NONE)
return oldap_perform_mechs(data);
/* Force bind even if anonymous bind is not needed in protocol version 3
to detect missing version 3 support. */
return oldap_perform_bind(data, OLDAP_BIND);
}
/* Handle the supported SASL mechanisms query response */
static CURLcode oldap_state_mechs_resp(struct Curl_easy *data,
LDAPMessage *msg, int code)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
int rc;
BerElement *ber = NULL;
CURLcode result = CURLE_OK;
struct berval bv, *bvals;
switch(ldap_msgtype(msg)) {
case LDAP_RES_SEARCH_ENTRY:
/* Got a list of supported SASL mechanisms. */
if(code != LDAP_SUCCESS && code != LDAP_NO_RESULTS_RETURNED)
return CURLE_LOGIN_DENIED;
rc = ldap_get_dn_ber(li->ld, msg, &ber, &bv);
if(rc < 0)
return oldap_map_error(rc, CURLE_BAD_CONTENT_ENCODING);
for(rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals);
rc == LDAP_SUCCESS;
rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals)) {
int i;
if(!bv.bv_val)
break;
if(bvals) {
for(i = 0; bvals[i].bv_val; i++) {
size_t llen;
unsigned short mech = Curl_sasl_decode_mech((char *) bvals[i].bv_val,
bvals[i].bv_len, &llen);
if(bvals[i].bv_len == llen)
li->sasl.authmechs |= mech;
}
ber_memfree(bvals);
}
}
ber_free(ber, 0);
break;
case LDAP_RES_SEARCH_RESULT:
switch(code) {
case LDAP_SIZELIMIT_EXCEEDED:
infof(data, "Too many authentication mechanisms\n");
/* FALLTHROUGH */
case LDAP_SUCCESS:
case LDAP_NO_RESULTS_RETURNED:
if(Curl_sasl_can_authenticate(&li->sasl, data))
result = oldap_perform_sasl(data);
else
result = CURLE_LOGIN_DENIED;
break;
default:
result = oldap_map_error(code, CURLE_LOGIN_DENIED);
break;
}
break;
default:
break;
}
return result;
}
/* Handle a SASL bind response. */
static CURLcode oldap_state_sasl_resp(struct Curl_easy *data,
LDAPMessage *msg, int code)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode result = CURLE_OK;
saslprogress progress;
int rc;
li->servercred = NULL;
rc = ldap_parse_sasl_bind_result(li->ld, msg, &li->servercred, 0);
if(rc != LDAP_SUCCESS) {
failf(data, "LDAP local: sasl ldap_parse_result %s", ldap_err2string(rc));
result = oldap_map_error(rc, CURLE_LOGIN_DENIED);
}
else {
result = Curl_sasl_continue(&li->sasl, data, code, &progress);
if(!result && progress != SASL_INPROGRESS)
state(data, OLDAP_STOP);
}
if(li->servercred)
ber_bvfree(li->servercred);
return result;
}
/* Handle a simple bind response. */
static CURLcode oldap_state_bind_resp(struct Curl_easy *data, LDAPMessage *msg,
int code)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode result = CURLE_OK;
struct berval *bv = NULL;
int rc;
if(code != LDAP_SUCCESS)
return oldap_map_error(code, CURLE_LDAP_CANNOT_BIND);
rc = ldap_parse_sasl_bind_result(li->ld, msg, &bv, 0);
if(rc != LDAP_SUCCESS) {
failf(data, "LDAP local: bind ldap_parse_sasl_bind_result %s",
ldap_err2string(rc));
result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND);
}
else
state(data, OLDAP_STOP);
if(bv)
ber_bvfree(bv);
return result;
}
static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
{
CURLcode result = CURLE_OK;
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
LDAPMessage *msg = NULL;
struct timeval tv = {0, 0};
int code = LDAP_SUCCESS;
int rc;
if(li->state != OLDAP_SSL && li->state != OLDAP_TLS) {
/* Get response to last command. */
rc = ldap_result(li->ld, li->msgid, LDAP_MSG_ONE, &tv, &msg);
switch(rc) {
case 0: /* Timed out. */
return CURLE_OK;
case LDAP_RES_SEARCH_ENTRY:
case LDAP_RES_SEARCH_REFERENCE:
break;
default:
li->msgid = 0; /* Nothing to abandon upon error. */
if(rc < 0) {
failf(data, "LDAP local: connecting ldap_result %s",
ldap_err2string(rc));
return oldap_map_error(rc, CURLE_COULDNT_CONNECT);
}
break;
}
/* Get error code from message. */
rc = ldap_parse_result(li->ld, msg, &code, NULL, NULL, NULL, NULL, 0);
if(rc)
code = rc;
else {
/* store the latest code for later retrieval */
data->info.httpcode = code;
}
/* If protocol version 3 is not supported, fallback to version 2. */
if(code == LDAP_PROTOCOL_ERROR && li->state != OLDAP_BINDV2 &&
#ifdef USE_SSL
(ssl_installed(conn) || data->set.use_ssl <= CURLUSESSL_TRY) &&
#endif
li->sasl.prefmech == SASL_AUTH_NONE) {
static const int version = LDAP_VERSION2;
ldap_set_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &version);
ldap_msgfree(msg);
return oldap_perform_bind(data, OLDAP_BINDV2);
}
}
/* Handle response message according to current state. */
switch(li->state) {
#ifdef USE_SSL
case OLDAP_SSL:
result = oldap_ssl_connect(data, OLDAP_SSL);
if(!result && ssl_installed(conn)) {
if(li->sasl.prefmech != SASL_AUTH_NONE)
result = oldap_perform_mechs(data);
else
result = oldap_perform_bind(data, OLDAP_BIND);
}
break;
case OLDAP_STARTTLS:
if(code != LDAP_SUCCESS) {
if(data->set.use_ssl != CURLUSESSL_TRY)
result = oldap_map_error(code, CURLE_USE_SSL_FAILED);
else if(li->sasl.prefmech != SASL_AUTH_NONE)
result = oldap_perform_mechs(data);
else
result = oldap_perform_bind(data, OLDAP_BIND);
break;
}
/* FALLTHROUGH */
case OLDAP_TLS:
result = oldap_ssl_connect(data, OLDAP_TLS);
if(result && data->set.use_ssl != CURLUSESSL_TRY)
result = oldap_map_error(code, CURLE_USE_SSL_FAILED);
else if(ssl_installed(conn)) {
conn->bits.tls_upgraded = TRUE;
if(li->sasl.prefmech != SASL_AUTH_NONE)
result = oldap_perform_mechs(data);
else if(data->state.aptr.user)
result = oldap_perform_bind(data, OLDAP_BIND);
else {
state(data, OLDAP_STOP); /* Version 3 supported: no bind required */
result = CURLE_OK;
}
}
break;
#endif
case OLDAP_MECHS:
result = oldap_state_mechs_resp(data, msg, code);
break;
case OLDAP_SASL:
result = oldap_state_sasl_resp(data, msg, code);
break;
case OLDAP_BIND:
case OLDAP_BINDV2:
result = oldap_state_bind_resp(data, msg, code);
break;
default:
/* internal error */
result = CURLE_COULDNT_CONNECT;
break;
}
ldap_msgfree(msg);
*done = li->state == OLDAP_STOP;
if(*done)
conn->recv[FIRSTSOCKET] = oldap_recv;
if(result && li->msgid) {
ldap_abandon_ext(li->ld, li->msgid, NULL, NULL);
li->msgid = 0;
}
return result;
}
static CURLcode oldap_disconnect(struct Curl_easy *data,
struct connectdata *conn,
bool dead_connection)
{
struct ldapconninfo *li = conn->proto.ldapc;
(void) dead_connection;
#ifndef USE_SSL
(void)data;
#endif
if(li) {
if(li->ld) {
#ifdef USE_SSL
if(ssl_installed(conn)) {
Sockbuf *sb;
ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb);
ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data);
}
#endif
ldap_unbind_ext(li->ld, NULL, NULL);
li->ld = NULL;
}
Curl_sasl_cleanup(conn, li->sasl.authused);
conn->proto.ldapc = NULL;
free(li);
}
return CURLE_OK;
}
static CURLcode oldap_do(struct Curl_easy *data, bool *done)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
struct ldapreqinfo *lr;
CURLcode result;
int rc;
LDAPURLDesc *lud;
int msgid;
connkeep(conn, "OpenLDAP do");
infof(data, "LDAP local: %s", data->state.url);
result = oldap_url_parse(data, &lud);
if(!result) {
rc = ldap_search_ext(li->ld, lud->lud_dn, lud->lud_scope,
lud->lud_filter, lud->lud_attrs, 0,
NULL, NULL, NULL, 0, &msgid);
ldap_free_urldesc(lud);
if(rc != LDAP_SUCCESS) {
failf(data, "LDAP local: ldap_search_ext %s", ldap_err2string(rc));
result = CURLE_LDAP_SEARCH_FAILED;
}
else {
lr = calloc(1, sizeof(struct ldapreqinfo));
if(!lr) {
ldap_abandon_ext(li->ld, msgid, NULL, NULL);
result = CURLE_OUT_OF_MEMORY;
}
else {
lr->msgid = msgid;
data->req.p.ldap = lr;
Curl_setup_transfer(data, FIRSTSOCKET, -1, FALSE, -1);
*done = TRUE;
}
}
}
return result;
}
static CURLcode oldap_done(struct Curl_easy *data, CURLcode res,
bool premature)
{
struct connectdata *conn = data->conn;
struct ldapreqinfo *lr = data->req.p.ldap;
(void)res;
(void)premature;
if(lr) {
/* if there was a search in progress, abandon it */
if(lr->msgid) {
struct ldapconninfo *li = conn->proto.ldapc;
ldap_abandon_ext(li->ld, lr->msgid, NULL, NULL);
lr->msgid = 0;
}
data->req.p.ldap = NULL;
free(lr);
}
return CURLE_OK;
}
static CURLcode client_write(struct Curl_easy *data,
const char *prefix, size_t plen,
const char *value, size_t len,
const char *suffix, size_t slen)
{
CURLcode result = CURLE_OK;
if(prefix) {
/* If we have a zero-length value and the prefix ends with a space
separator, drop the latter. */
if(!len && plen && prefix[plen - 1] == ' ')
plen--;
result = Curl_client_write(data, CLIENTWRITE_BODY, (char *) prefix, plen);
if(!result)
data->req.bytecount += plen;
}
if(!result && value) {
result = Curl_client_write(data, CLIENTWRITE_BODY, (char *) value, len);
if(!result)
data->req.bytecount += len;
}
if(!result && suffix) {
result = Curl_client_write(data, CLIENTWRITE_BODY, (char *) suffix, slen);
if(!result)
data->req.bytecount += slen;
}
return result;
}
static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
size_t len, CURLcode *err)
{
struct connectdata *conn = data->conn;
struct ldapconninfo *li = conn->proto.ldapc;
struct ldapreqinfo *lr = data->req.p.ldap;
int rc;
LDAPMessage *msg = NULL;
BerElement *ber = NULL;
struct timeval tv = {0, 0};
struct berval bv, *bvals;
int binary = 0;
CURLcode result = CURLE_AGAIN;
int code;
char *info = NULL;
(void)len;
(void)buf;
(void)sockindex;
rc = ldap_result(li->ld, lr->msgid, LDAP_MSG_ONE, &tv, &msg);
if(rc < 0) {
failf(data, "LDAP local: search ldap_result %s", ldap_err2string(rc));
result = CURLE_RECV_ERROR;
}
*err = result;
/* error or timed out */
if(!msg)
return -1;
result = CURLE_OK;
switch(ldap_msgtype(msg)) {
case LDAP_RES_SEARCH_RESULT:
lr->msgid = 0;
rc = ldap_parse_result(li->ld, msg, &code, NULL, &info, NULL, NULL, 0);
if(rc) {
failf(data, "LDAP local: search ldap_parse_result %s",
ldap_err2string(rc));
result = CURLE_LDAP_SEARCH_FAILED;
break;
}
/* store the latest code for later retrieval */
data->info.httpcode = code;
switch(code) {
case LDAP_SIZELIMIT_EXCEEDED:
infof(data, "There are more than %d entries", lr->nument);
/* FALLTHROUGH */
case LDAP_SUCCESS:
data->req.size = data->req.bytecount;
break;
default:
failf(data, "LDAP remote: search failed %s %s", ldap_err2string(code),
info ? info : "");
result = CURLE_LDAP_SEARCH_FAILED;
break;
}
if(info)
ldap_memfree(info);
break;
case LDAP_RES_SEARCH_ENTRY:
lr->nument++;
rc = ldap_get_dn_ber(li->ld, msg, &ber, &bv);
if(rc < 0) {
result = CURLE_RECV_ERROR;
break;
}
result = client_write(data, STRCONST("DN: "), bv.bv_val, bv.bv_len,
STRCONST("\n"));
if(result)
break;
for(rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals);
rc == LDAP_SUCCESS;
rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals)) {
int i;
if(!bv.bv_val)
break;
if(!bvals) {
result = client_write(data, STRCONST("\t"), bv.bv_val, bv.bv_len,
STRCONST(":\n"));
if(result)
break;
continue;
}
binary = bv.bv_len > 7 &&
!strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7);
for(i = 0; bvals[i].bv_val != NULL; i++) {
int binval = 0;
result = client_write(data, STRCONST("\t"), bv.bv_val, bv.bv_len,
STRCONST(":"));
if(result)
break;
if(!binary) {
/* check for leading or trailing whitespace */
if(ISSPACE(bvals[i].bv_val[0]) ||
ISSPACE(bvals[i].bv_val[bvals[i].bv_len - 1]))
binval = 1;
else {
/* check for unprintable characters */
unsigned int j;
for(j = 0; j < bvals[i].bv_len; j++)
if(!ISPRINT(bvals[i].bv_val[j])) {
binval = 1;
break;
}
}
}
if(binary || binval) {
char *val_b64 = NULL;
size_t val_b64_sz = 0;
/* Binary value, encode to base64. */
if(bvals[i].bv_len)
result = Curl_base64_encode(bvals[i].bv_val, bvals[i].bv_len,
&val_b64, &val_b64_sz);
if(!result)
result = client_write(data, STRCONST(": "), val_b64, val_b64_sz,
STRCONST("\n"));
free(val_b64);
}
else
result = client_write(data, STRCONST(" "),
bvals[i].bv_val, bvals[i].bv_len,
STRCONST("\n"));
if(result)
break;
}
ber_memfree(bvals);
bvals = NULL;
if(!result)
result = client_write(data, STRCONST("\n"), NULL, 0, NULL, 0);
if(result)
break;
}
ber_free(ber, 0);
if(!result)
result = client_write(data, STRCONST("\n"), NULL, 0, NULL, 0);
if(!result)
result = CURLE_AGAIN;
break;
}
ldap_msgfree(msg);
*err = result;
return result? -1: 0;
}
#ifdef USE_SSL
static int
ldapsb_tls_setup(Sockbuf_IO_Desc *sbiod, void *arg)
{
sbiod->sbiod_pvt = arg;
return 0;
}
static int
ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod)
{
sbiod->sbiod_pvt = NULL;
return 0;
}
/* We don't need to do anything because libcurl does it already */
static int
ldapsb_tls_close(Sockbuf_IO_Desc *sbiod)
{
(void)sbiod;
return 0;
}
static int
ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg)
{
(void)arg;
if(opt == LBER_SB_OPT_DATA_READY) {
struct Curl_easy *data = sbiod->sbiod_pvt;
return Curl_ssl_data_pending(data->conn, FIRSTSOCKET);
}
return 0;
}
static ber_slen_t
ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
{
struct Curl_easy *data = sbiod->sbiod_pvt;
ber_slen_t ret = 0;
if(data) {
struct connectdata *conn = data->conn;
if(conn) {
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode err = CURLE_RECV_ERROR;
ret = (li->recv)(data, FIRSTSOCKET, buf, len, &err);
if(ret < 0 && err == CURLE_AGAIN) {
SET_SOCKERRNO(EWOULDBLOCK);
}
}
}
return ret;
}
static ber_slen_t
ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
{
struct Curl_easy *data = sbiod->sbiod_pvt;
ber_slen_t ret = 0;
if(data) {
struct connectdata *conn = data->conn;
if(conn) {
struct ldapconninfo *li = conn->proto.ldapc;
CURLcode err = CURLE_SEND_ERROR;
ret = (li->send)(data, FIRSTSOCKET, buf, len, &err);
if(ret < 0 && err == CURLE_AGAIN) {
SET_SOCKERRNO(EWOULDBLOCK);
}
}
}
return ret;
}
static Sockbuf_IO ldapsb_tls =
{
ldapsb_tls_setup,
ldapsb_tls_remove,
ldapsb_tls_ctrl,
ldapsb_tls_read,
ldapsb_tls_write,
ldapsb_tls_close
};
#endif /* USE_SSL */
#endif /* !CURL_DISABLE_LDAP && USE_OPENLDAP */
|
e3202b384b95190b5177f2ae7b34571aa36f186f
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/staging/vt6656/baseband.c
|
55185336afe2539ac329ba5a83bca79db55fd652
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 66,164
|
c
|
baseband.c
|
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*
* File: baseband.c
*
* Purpose: Implement functions to access baseband
*
* Author: Jerry Chen
*
* Date: Jun. 5, 2002
*
* Functions:
* BBuGetFrameTime - Calculate data frame transmitting time
* BBvCalculateParameter - Calculate PhyLength, PhyService and Phy Signal parameter for baseband Tx
* BBbVT3184Init - VIA VT3184 baseband chip init code
*
* Revision History:
*
*
*/
#include "tmacro.h"
#include "tether.h"
#include "mac.h"
#include "baseband.h"
#include "rf.h"
#include "srom.h"
#include "control.h"
#include "datarate.h"
#include "rndis.h"
static int msglevel =MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG;
u8 abyVT3184_AGC[] = {
0x00, //0
0x00, //1
0x02, //2
0x02, //3 //RobertYu:20060505, 0x04, //3
0x04, //4
0x04, //5 //RobertYu:20060505, 0x06, //5
0x06, //6
0x06, //7
0x08, //8
0x08, //9
0x0A, //A
0x0A, //B
0x0C, //C
0x0C, //D
0x0E, //E
0x0E, //F
0x10, //10
0x10, //11
0x12, //12
0x12, //13
0x14, //14
0x14, //15
0x16, //16
0x16, //17
0x18, //18
0x18, //19
0x1A, //1A
0x1A, //1B
0x1C, //1C
0x1C, //1D
0x1E, //1E
0x1E, //1F
0x20, //20
0x20, //21
0x22, //22
0x22, //23
0x24, //24
0x24, //25
0x26, //26
0x26, //27
0x28, //28
0x28, //29
0x2A, //2A
0x2A, //2B
0x2C, //2C
0x2C, //2D
0x2E, //2E
0x2E, //2F
0x30, //30
0x30, //31
0x32, //32
0x32, //33
0x34, //34
0x34, //35
0x36, //36
0x36, //37
0x38, //38
0x38, //39
0x3A, //3A
0x3A, //3B
0x3C, //3C
0x3C, //3D
0x3E, //3E
0x3E //3F
};
u8 abyVT3184_AL2230[] = {
0x31,//00
0x00,
0x00,
0x00,
0x00,
0x80,
0x00,
0x00,
0x70,
0x45,//tx //0x64 for FPGA
0x2A,
0x76,
0x00,
0x00,
0x80,
0x00,
0x00,//10
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x8e, //RobertYu:20060522, //0x8d,
0x0a, //RobertYu:20060515, //0x09,
0x00,
0x00,
0x00,
0x00,//20
0x00,
0x00,
0x00,
0x00,
0x4a,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x4a,
0x00,
0x0c, //RobertYu:20060522, //0x10,
0x26,//30
0x5b,
0x00,
0x00,
0x00,
0x00,
0xaa,
0xaa,
0xff,
0xff,
0x79,
0x00,
0x00,
0x0b,
0x48,
0x04,
0x00,//40
0x08,
0x00,
0x08,
0x08,
0x14,
0x05,
0x09,
0x00,
0x00,
0x00,
0x00,
0x09,
0x73,
0x00,
0xc5,
0x00,//50 //RobertYu:20060505, //0x15,//50
0x19,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xd0, //RobertYu:20060505, //0xb0,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xe4,//60
0x80,
0x00,
0x00,
0x00,
0x00,
0x98,
0x0a,
0x00,
0x00,
0x00,
0x00,
0x00, //0x80 for FPGA
0x03,
0x01,
0x00,
0x00,//70
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x8c,//80
0x01,
0x09,
0x00,
0x00,
0x00,
0x00,
0x00,
0x08,
0x00,
0x1f, //RobertYu:20060516, //0x0f,
0xb7,
0x88,
0x47,
0xaa,
0x00, //RobertYu:20060505, //0x02,
0x20,//90 //RobertYu:20060505, //0x22,//90
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xeb,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,//a0
0x00,
0x00,
0x00,
0x00,
0x00,
0x10,
0x00,
0x18,
0x00,
0x00,
0x00,
0x00,
0x15, //RobertYu:20060516, //0x00,
0x00,
0x18,
0x38,//b0
0x30,
0x00,
0x00,
0xff,
0x0f,
0xe4,
0xe2,
0x00,
0x00,
0x00,
0x03,
0x01,
0x00,
0x00,
0x00,
0x18,//c0
0x20,
0x07,
0x18,
0xff,
0xff, //RobertYu:20060509, //0x2c,
0x0e, //RobertYu:20060530, //0x0c,
0x0a,
0x0e,
0x00, //RobertYu:20060505, //0x01,
0x82, //RobertYu:20060516, //0x8f,
0xa7,
0x3c,
0x10,
0x30, //RobertYu:20060627, //0x0b,
0x05, //RobertYu:20060516, //0x25,
0x40,//d0
0x12,
0x00,
0x00,
0x10,
0x28,
0x80,
0x2A,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,//e0
0xf3, //RobertYu:20060516, //0xd3,
0x00,
0x00,
0x00,
0x10,
0x00,
0x12, //RobertYu:20060627, //0x10,
0x00,
0xf4,
0x00,
0xff,
0x79,
0x20,
0x30,
0x05, //RobertYu:20060516, //0x0c,
0x00,//f0
0x3e,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
};
//{{RobertYu:20060515, new BB setting for VT3226D0
u8 abyVT3184_VT3226D0[] = {
0x31,//00
0x00,
0x00,
0x00,
0x00,
0x80,
0x00,
0x00,
0x70,
0x45,//tx //0x64 for FPGA
0x2A,
0x76,
0x00,
0x00,
0x80,
0x00,
0x00,//10
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x8e, //RobertYu:20060525, //0x8d,
0x0a, //RobertYu:20060515, //0x09,
0x00,
0x00,
0x00,
0x00,//20
0x00,
0x00,
0x00,
0x00,
0x4a,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x4a,
0x00,
0x0c, //RobertYu:20060525, //0x10,
0x26,//30
0x5b,
0x00,
0x00,
0x00,
0x00,
0xaa,
0xaa,
0xff,
0xff,
0x79,
0x00,
0x00,
0x0b,
0x48,
0x04,
0x00,//40
0x08,
0x00,
0x08,
0x08,
0x14,
0x05,
0x09,
0x00,
0x00,
0x00,
0x00,
0x09,
0x73,
0x00,
0xc5,
0x00,//50 //RobertYu:20060505, //0x15,//50
0x19,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xd0, //RobertYu:20060505, //0xb0,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xe4,//60
0x80,
0x00,
0x00,
0x00,
0x00,
0x98,
0x0a,
0x00,
0x00,
0x00,
0x00,
0x00, //0x80 for FPGA
0x03,
0x01,
0x00,
0x00,//70
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x8c,//80
0x01,
0x09,
0x00,
0x00,
0x00,
0x00,
0x00,
0x08,
0x00,
0x1f, //RobertYu:20060515, //0x0f,
0xb7,
0x88,
0x47,
0xaa,
0x00, //RobertYu:20060505, //0x02,
0x20,//90 //RobertYu:20060505, //0x22,//90
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0xeb,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,//a0
0x00,
0x00,
0x00,
0x00,
0x00,
0x10,
0x00,
0x18,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x38,//b0
0x30,
0x00,
0x00,
0xff,
0x0f,
0xe4,
0xe2,
0x00,
0x00,
0x00,
0x03,
0x01,
0x00,
0x00,
0x00,
0x18,//c0
0x20,
0x07,
0x18,
0xff,
0xff, //RobertYu:20060509, //0x2c,
0x10, //RobertYu:20060525, //0x0c,
0x0a,
0x0e,
0x00, //RobertYu:20060505, //0x01,
0x84, //RobertYu:20060525, //0x8f,
0xa7,
0x3c,
0x10,
0x24, //RobertYu:20060627, //0x18,
0x05, //RobertYu:20060515, //0x25,
0x40,//d0
0x12,
0x00,
0x00,
0x10,
0x28,
0x80,
0x2A,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,//e0
0xf3, //RobertYu:20060515, //0xd3,
0x00,
0x00,
0x00,
0x10,
0x00,
0x10, //RobertYu:20060627, //0x0e,
0x00,
0xf4,
0x00,
0xff,
0x79,
0x20,
0x30,
0x08, //RobertYu:20060515, //0x0c,
0x00,//f0
0x3e,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
};
const u16 awcFrameTime[MAX_RATE] =
{10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216};
/*
static
unsigned long
s_ulGetLowSQ3(PSDevice pDevice);
static
unsigned long
s_ulGetRatio(PSDevice pDevice);
static
void
s_vClearSQ3Value(PSDevice pDevice);
*/
/*
* Description: Calculate data frame transmitting time
*
* Parameters:
* In:
* byPreambleType - Preamble Type
* byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
* cbFrameLength - Baseband Type
* wRate - Tx Rate
* Out:
*
* Return Value: FrameTime
*
*/
unsigned int
BBuGetFrameTime(
u8 byPreambleType,
u8 byPktType,
unsigned int cbFrameLength,
u16 wRate
)
{
unsigned int uFrameTime;
unsigned int uPreamble;
unsigned int uTmp;
unsigned int uRateIdx = (unsigned int)wRate;
unsigned int uRate = 0;
if (uRateIdx > RATE_54M) {
ASSERT(0);
return 0;
}
uRate = (unsigned int)awcFrameTime[uRateIdx];
if (uRateIdx <= 3) { //CCK mode
if (byPreambleType == 1) {//Short
uPreamble = 96;
} else {
uPreamble = 192;
}
uFrameTime = (cbFrameLength * 80) / uRate; //?????
uTmp = (uFrameTime * uRate) / 80;
if (cbFrameLength != uTmp) {
uFrameTime ++;
}
return (uPreamble + uFrameTime);
}
else {
uFrameTime = (cbFrameLength * 8 + 22) / uRate; //????????
uTmp = ((uFrameTime * uRate) - 22) / 8;
if(cbFrameLength != uTmp) {
uFrameTime ++;
}
uFrameTime = uFrameTime * 4; //???????
if(byPktType != PK_TYPE_11A) {
uFrameTime += 6;
}
return (20 + uFrameTime); //??????
}
}
/*
* Description: Calculate Length, Service, and Signal fields of Phy for Tx
*
* Parameters:
* In:
* pDevice - Device Structure
* cbFrameLength - Tx Frame Length
* wRate - Tx Rate
* Out:
* pwPhyLen - pointer to Phy Length field
* pbyPhySrv - pointer to Phy Service field
* pbyPhySgn - pointer to Phy Signal field
*
* Return Value: none
*
*/
void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
u16 wRate, u8 byPacketType, u16 *pwPhyLen, u8 *pbyPhySrv,
u8 *pbyPhySgn)
{
u32 cbBitCount;
u32 cbUsCount = 0;
u32 cbTmp;
int bExtBit;
u8 byPreambleType = pDevice->byPreambleType;
int bCCK = pDevice->bCCK;
cbBitCount = cbFrameLength * 8;
bExtBit = false;
switch (wRate) {
case RATE_1M :
cbUsCount = cbBitCount;
*pbyPhySgn = 0x00;
break;
case RATE_2M :
cbUsCount = cbBitCount / 2;
if (byPreambleType == 1)
*pbyPhySgn = 0x09;
else // long preamble
*pbyPhySgn = 0x01;
break;
case RATE_5M :
if (bCCK == false)
cbBitCount ++;
cbUsCount = (cbBitCount * 10) / 55;
cbTmp = (cbUsCount * 55) / 10;
if (cbTmp != cbBitCount)
cbUsCount ++;
if (byPreambleType == 1)
*pbyPhySgn = 0x0a;
else // long preamble
*pbyPhySgn = 0x02;
break;
case RATE_11M :
if (bCCK == false)
cbBitCount ++;
cbUsCount = cbBitCount / 11;
cbTmp = cbUsCount * 11;
if (cbTmp != cbBitCount) {
cbUsCount ++;
if ((cbBitCount - cbTmp) <= 3)
bExtBit = true;
}
if (byPreambleType == 1)
*pbyPhySgn = 0x0b;
else // long preamble
*pbyPhySgn = 0x03;
break;
case RATE_6M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9B; //1001 1011
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8B; //1000 1011
}
break;
case RATE_9M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9F; //1001 1111
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8F; //1000 1111
}
break;
case RATE_12M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9A; //1001 1010
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8A; //1000 1010
}
break;
case RATE_18M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9E; //1001 1110
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8E; //1000 1110
}
break;
case RATE_24M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x99; //1001 1001
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x89; //1000 1001
}
break;
case RATE_36M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9D; //1001 1101
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8D; //1000 1101
}
break;
case RATE_48M :
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x98; //1001 1000
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x88; //1000 1000
}
break;
case RATE_54M :
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8C; //1000 1100
}
break;
default :
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100
}
else {//11g, 2.4GHZ
*pbyPhySgn = 0x8C; //1000 1100
}
break;
}
if (byPacketType == PK_TYPE_11B) {
*pbyPhySrv = 0x00;
if (bExtBit)
*pbyPhySrv = *pbyPhySrv | 0x80;
*pwPhyLen = (u16) cbUsCount;
}
else {
*pbyPhySrv = 0x00;
*pwPhyLen = (u16)cbFrameLength;
}
}
/*
* Description: Set Antenna mode
*
* Parameters:
* In:
* pDevice - Device Structure
* byAntennaMode - Antenna Mode
* Out:
* none
*
* Return Value: none
*
*/
void BBvSetAntennaMode(struct vnt_private *pDevice, u8 byAntennaMode)
{
switch (byAntennaMode) {
case ANT_TXA:
case ANT_TXB:
break;
case ANT_RXA:
pDevice->byBBRxConf &= 0xFC;
break;
case ANT_RXB:
pDevice->byBBRxConf &= 0xFE;
pDevice->byBBRxConf |= 0x02;
break;
}
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_SET_ANTMD,
(u16) byAntennaMode,
0,
0,
NULL);
}
/*
* Description: Set Antenna mode
*
* Parameters:
* In:
* pDevice - Device Structure
* byAntennaMode - Antenna Mode
* Out:
* none
*
* Return Value: none
*
*/
int BBbVT3184Init(struct vnt_private *pDevice)
{
int ntStatus;
u16 wLength;
u8 * pbyAddr;
u8 * pbyAgc;
u16 wLengthAgc;
u8 abyArray[256];
u8 data;
ntStatus = CONTROLnsRequestIn(pDevice,
MESSAGE_TYPE_READ,
0,
MESSAGE_REQUEST_EEPROM,
EEP_MAX_CONTEXT_SIZE,
pDevice->abyEEPROM);
if (ntStatus != STATUS_SUCCESS) {
return false;
}
// if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
// return false;
//zonetype initial
pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
if(pDevice->config_file.ZoneType >= 0) { //read zonetype file ok!
if ((pDevice->config_file.ZoneType == 0)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] !=0x00)){ //for USA
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :USA\n");
}
else if((pDevice->config_file.ZoneType == 1)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x01)){ //for Japan
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :Japan\n");
}
else if((pDevice->config_file.ZoneType == 2)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x02)){ //for Europe
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :Europe\n");
}
else {
if(pDevice->config_file.ZoneType !=pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice->config_file.ZoneType,pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
else
printk("Read Zonetype file success,use default zonetype setting[%02x]\n",pDevice->config_file.ZoneType);
}
}
if ( !pDevice->bZoneRegExist ) {
pDevice->byZoneType = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
}
pDevice->byRFType = pDevice->abyEEPROM[EEP_OFS_RFTYPE];
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Zone Type %x\n", pDevice->byZoneType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RF Type %d\n", pDevice->byRFType);
if ((pDevice->byRFType == RF_AL2230) || (pDevice->byRFType == RF_AL2230S)) {
pDevice->byBBRxConf = abyVT3184_AL2230[10];
wLength = sizeof(abyVT3184_AL2230);
pbyAddr = abyVT3184_AL2230;
pbyAgc = abyVT3184_AGC;
wLengthAgc = sizeof(abyVT3184_AGC);
pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0;
pDevice->abyBBVGA[3] = 0x0;
pDevice->ldBmThreshold[0] = -70;
pDevice->ldBmThreshold[1] = -48;
pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0;
}
else if (pDevice->byRFType == RF_AIROHA7230) {
pDevice->byBBRxConf = abyVT3184_AL2230[10];
wLength = sizeof(abyVT3184_AL2230);
pbyAddr = abyVT3184_AL2230;
pbyAgc = abyVT3184_AGC;
wLengthAgc = sizeof(abyVT3184_AGC);
// Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//pbyAddr[0x09] = 0x41;
// Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//pbyAddr[0x0a] = 0x28;
// Select VC1/VC2, CR215 = 0x02->0x06
pbyAddr[0xd7] = 0x06;
pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0;
pDevice->abyBBVGA[3] = 0x0;
pDevice->ldBmThreshold[0] = -70;
pDevice->ldBmThreshold[1] = -48;
pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0;
}
else if ( (pDevice->byRFType == RF_VT3226) || (pDevice->byRFType == RF_VT3226D0) ) {
pDevice->byBBRxConf = abyVT3184_VT3226D0[10]; //RobertYu:20060515
wLength = sizeof(abyVT3184_VT3226D0); //RobertYu:20060515
pbyAddr = abyVT3184_VT3226D0; //RobertYu:20060515
pbyAgc = abyVT3184_AGC;
wLengthAgc = sizeof(abyVT3184_AGC);
pDevice->abyBBVGA[0] = 0x20; //RobertYu:20060104, reguest by Jack
pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0;
pDevice->abyBBVGA[3] = 0x0;
pDevice->ldBmThreshold[0] = -70;
pDevice->ldBmThreshold[1] = -48;
pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0;
// Fix VT3226 DFC system timing issue
MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL2, SOFTPWRCTL_RFLEOPT);
//}}
//{{RobertYu:20060609
} else if ( (pDevice->byRFType == RF_VT3342A0) ) {
pDevice->byBBRxConf = abyVT3184_VT3226D0[10];
wLength = sizeof(abyVT3184_VT3226D0);
pbyAddr = abyVT3184_VT3226D0;
pbyAgc = abyVT3184_AGC;
wLengthAgc = sizeof(abyVT3184_AGC);
pDevice->abyBBVGA[0] = 0x20;
pDevice->abyBBVGA[1] = 0x10;
pDevice->abyBBVGA[2] = 0x0;
pDevice->abyBBVGA[3] = 0x0;
pDevice->ldBmThreshold[0] = -70;
pDevice->ldBmThreshold[1] = -48;
pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0;
// Fix VT3226 DFC system timing issue
MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL2, SOFTPWRCTL_RFLEOPT);
//}}
} else {
return true;
}
memcpy(abyArray, pbyAddr, wLength);
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE,
0,
MESSAGE_REQUEST_BBREG,
wLength,
abyArray
);
memcpy(abyArray, pbyAgc, wLengthAgc);
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE,
0,
MESSAGE_REQUEST_BBAGC,
wLengthAgc,
abyArray
);
if ((pDevice->byRFType == RF_VT3226) || //RobertYu:20051116, 20060111 remove VT3226D0
(pDevice->byRFType == RF_VT3342A0) //RobertYu:20060609
) {
ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_ITRTMSET,0x23);
MACvRegBitsOn(pDevice,MAC_REG_PAPEDELAY,0x01);
}
else if (pDevice->byRFType == RF_VT3226D0)
{
ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_ITRTMSET,0x11);
MACvRegBitsOn(pDevice,MAC_REG_PAPEDELAY,0x01);
}
ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x04,0x7F);
ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01);
RFbRFTableDownload(pDevice);
/* Fix for TX USB resets from vendors driver */
CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ, USB_REG4,
MESSAGE_REQUEST_MEM, sizeof(data), &data);
data |= 0x2;
CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, USB_REG4,
MESSAGE_REQUEST_MEM, sizeof(data), &data);
return true;//ntStatus;
}
/*
* Description: Set ShortSlotTime mode
*
* Parameters:
* In:
* pDevice - Device Structure
* Out:
* none
*
* Return Value: none
*
*/
void BBvSetShortSlotTime(struct vnt_private *pDevice)
{
u8 byBBVGA=0;
if (pDevice->bShortSlotTime)
pDevice->byBBRxConf &= 0xDF;//1101 1111
else
pDevice->byBBRxConf |= 0x20;//0010 0000
ControlvReadByte (pDevice, MESSAGE_REQUEST_BBREG, 0xE7, &byBBVGA);
if (byBBVGA == pDevice->abyBBVGA[0])
pDevice->byBBRxConf |= 0x20;//0010 0000
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0A, pDevice->byBBRxConf);
}
void BBvSetVGAGainOffset(struct vnt_private *pDevice, u8 byData)
{
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, byData);
// patch for 3253B0 Baseband with Cardbus module
if (pDevice->bShortSlotTime)
pDevice->byBBRxConf &= 0xDF; /* 1101 1111 */
else
pDevice->byBBRxConf |= 0x20; /* 0010 0000 */
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0A, pDevice->byBBRxConf);//CR10
}
/*
* Description: BBvSetDeepSleep
*
* Parameters:
* In:
* pDevice - Device Structure
* Out:
* none
*
* Return Value: none
*
*/
void BBvSetDeepSleep(struct vnt_private *pDevice)
{
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);//CR12
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0D, 0xB9);//CR13
}
void BBvExitDeepSleep(struct vnt_private *pDevice)
{
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0C, 0x00);//CR12
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0D, 0x01);//CR13
}
static unsigned long s_ulGetLowSQ3(struct vnt_private *pDevice)
{
int ii;
unsigned long ulSQ3 = 0;
unsigned long ulMaxPacket;
ulMaxPacket = pDevice->aulPktNum[RATE_54M];
if (pDevice->aulPktNum[RATE_54M] != 0)
ulSQ3 = pDevice->aulSQ3Val[RATE_54M] / pDevice->aulPktNum[RATE_54M];
for (ii = RATE_48M; ii >= RATE_6M; ii--)
if (pDevice->aulPktNum[ii] > ulMaxPacket) {
ulMaxPacket = pDevice->aulPktNum[ii];
ulSQ3 = pDevice->aulSQ3Val[ii] / pDevice->aulPktNum[ii];
}
return ulSQ3;
}
static unsigned long s_ulGetRatio(struct vnt_private *pDevice)
{
int ii, jj;
unsigned long ulRatio = 0;
unsigned long ulMaxPacket;
unsigned long ulPacketNum;
//This is a thousand-ratio
ulMaxPacket = pDevice->aulPktNum[RATE_54M];
if ( pDevice->aulPktNum[RATE_54M] != 0 ) {
ulPacketNum = pDevice->aulPktNum[RATE_54M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
ulRatio += TOP_RATE_54M;
}
for (ii = RATE_48M; ii >= RATE_1M; ii--)
if ( pDevice->aulPktNum[ii] > ulMaxPacket ) {
ulPacketNum = 0;
for ( jj=RATE_54M;jj>=ii;jj--)
ulPacketNum += pDevice->aulPktNum[jj];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
ulRatio += TOP_RATE_48M;
ulMaxPacket = pDevice->aulPktNum[ii];
}
return ulRatio;
}
static void s_vClearSQ3Value(struct vnt_private *pDevice)
{
int ii;
pDevice->uDiversityCnt = 0;
for ( ii=RATE_1M;ii<MAX_RATE;ii++) {
pDevice->aulPktNum[ii] = 0;
pDevice->aulSQ3Val[ii] = 0;
}
}
/*
* Description: Antenna Diversity
*
* Parameters:
* In:
* pDevice - Device Structure
* byRSR - RSR from received packet
* bySQ3 - SQ3 value from received packet
* Out:
* none
*
* Return Value: none
*
*/
void BBvAntennaDiversity(struct vnt_private *pDevice,
u8 byRxRate, u8 bySQ3)
{
pDevice->uDiversityCnt++;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pDevice->uDiversityCnt = %d\n", (int)pDevice->uDiversityCnt);
if (byRxRate == 2) {
pDevice->aulPktNum[RATE_1M]++;
}
else if (byRxRate==4) {
pDevice->aulPktNum[RATE_2M]++;
}
else if (byRxRate==11) {
pDevice->aulPktNum[RATE_5M]++;
}
else if (byRxRate==22) {
pDevice->aulPktNum[RATE_11M]++;
}
else if(byRxRate==12){
pDevice->aulPktNum[RATE_6M]++;
pDevice->aulSQ3Val[RATE_6M] += bySQ3;
}
else if(byRxRate==18){
pDevice->aulPktNum[RATE_9M]++;
pDevice->aulSQ3Val[RATE_9M] += bySQ3;
}
else if(byRxRate==24){
pDevice->aulPktNum[RATE_12M]++;
pDevice->aulSQ3Val[RATE_12M] += bySQ3;
}
else if(byRxRate==36){
pDevice->aulPktNum[RATE_18M]++;
pDevice->aulSQ3Val[RATE_18M] += bySQ3;
}
else if(byRxRate==48){
pDevice->aulPktNum[RATE_24M]++;
pDevice->aulSQ3Val[RATE_24M] += bySQ3;
}
else if(byRxRate==72){
pDevice->aulPktNum[RATE_36M]++;
pDevice->aulSQ3Val[RATE_36M] += bySQ3;
}
else if(byRxRate==96){
pDevice->aulPktNum[RATE_48M]++;
pDevice->aulSQ3Val[RATE_48M] += bySQ3;
}
else if(byRxRate==108){
pDevice->aulPktNum[RATE_54M]++;
pDevice->aulSQ3Val[RATE_54M] += bySQ3;
}
if (pDevice->byAntennaState == 0) {
if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ulDiversityNValue=[%d],54M-[%d]\n",(int)pDevice->ulDiversityNValue, (int)pDevice->aulPktNum[RATE_54M]);
pDevice->ulSQ3_State0 = s_ulGetLowSQ3(pDevice);
pDevice->ulRatio_State0 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State0, SQ3= [%08x] rate = [%08x]\n",(int)pDevice->ulSQ3_State0,(int)pDevice->ulRatio_State0);
if ( ((pDevice->aulPktNum[RATE_54M] < pDevice->ulDiversityNValue/2) &&
(pDevice->ulSQ3_State0 > pDevice->ulSQ3TH) ) ||
(pDevice->ulSQ3_State0 == 0 ) ) {
if ( pDevice->byTMax == 0 )
return;
bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_ANTENNA,
NULL);
pDevice->byAntennaState = 1;
del_timer(&pDevice->TimerSQ3Tmax3);
del_timer(&pDevice->TimerSQ3Tmax2);
pDevice->TimerSQ3Tmax1.expires = RUN_AT(pDevice->byTMax * HZ);
add_timer(&pDevice->TimerSQ3Tmax1);
} else {
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
add_timer(&pDevice->TimerSQ3Tmax3);
}
s_vClearSQ3Value(pDevice);
}
} else { //byAntennaState == 1
if (pDevice->uDiversityCnt > pDevice->ulDiversityMValue) {
del_timer(&pDevice->TimerSQ3Tmax1);
pDevice->ulSQ3_State1 = s_ulGetLowSQ3(pDevice);
pDevice->ulRatio_State1 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State1, rate0 = %08x,rate1 = %08x\n",(int)pDevice->ulRatio_State0,(int)pDevice->ulRatio_State1);
if ( ((pDevice->ulSQ3_State1 == 0) && (pDevice->ulSQ3_State0 != 0)) ||
((pDevice->ulSQ3_State1 == 0) && (pDevice->ulSQ3_State0 == 0) && (pDevice->ulRatio_State1 < pDevice->ulRatio_State0)) ||
((pDevice->ulSQ3_State1 != 0) && (pDevice->ulSQ3_State0 != 0) && (pDevice->ulSQ3_State0 < pDevice->ulSQ3_State1))
) {
bScheduleCommand((void *) pDevice,
WLAN_CMD_CHANGE_ANTENNA,
NULL);
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ);
add_timer(&pDevice->TimerSQ3Tmax3);
add_timer(&pDevice->TimerSQ3Tmax2);
}
pDevice->byAntennaState = 0;
s_vClearSQ3Value(pDevice);
}
} //byAntennaState
}
/*+
*
* Description:
* Timer for SQ3 antenna diversity
*
* Parameters:
* In:
* pvSysSpec1
* hDeviceContext - Pointer to the adapter
* pvSysSpec2
* pvSysSpec3
* Out:
* none
*
* Return Value: none
*
-*/
void TimerSQ3CallBack(struct vnt_private *pDevice)
{
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack...");
spin_lock_irq(&pDevice->lock);
bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
pDevice->byAntennaState = 0;
s_vClearSQ3Value(pDevice);
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ);
add_timer(&pDevice->TimerSQ3Tmax3);
add_timer(&pDevice->TimerSQ3Tmax2);
spin_unlock_irq(&pDevice->lock);
}
/*+
*
* Description:
* Timer for SQ3 antenna diversity
*
* Parameters:
* In:
* pvSysSpec1
* hDeviceContext - Pointer to the adapter
* pvSysSpec2
* pvSysSpec3
* Out:
* none
*
* Return Value: none
*
-*/
void TimerSQ3Tmax3CallBack(struct vnt_private *pDevice)
{
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3Tmax3CallBack...");
spin_lock_irq(&pDevice->lock);
pDevice->ulRatio_State0 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State0 = [%08x]\n",(int)pDevice->ulRatio_State0);
s_vClearSQ3Value(pDevice);
if ( pDevice->byTMax == 0 ) {
pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
add_timer(&pDevice->TimerSQ3Tmax3);
spin_unlock_irq(&pDevice->lock);
return;
}
bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
pDevice->byAntennaState = 1;
del_timer(&pDevice->TimerSQ3Tmax3);
del_timer(&pDevice->TimerSQ3Tmax2);
pDevice->TimerSQ3Tmax1.expires = RUN_AT(pDevice->byTMax * HZ);
add_timer(&pDevice->TimerSQ3Tmax1);
spin_unlock_irq(&pDevice->lock);
}
void BBvUpdatePreEDThreshold(struct vnt_private *pDevice, int bScanning)
{
switch(pDevice->byRFType)
{
case RF_AL2230:
case RF_AL2230S:
case RF_AIROHA7230:
//RobertYu:20060627, update new table
if( bScanning )
{ // need Max sensitivity //RSSI -69, -70,....
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70, -71,...\n");
break;
}
if(pDevice->byBBPreEDRSSI <= 45) { // RSSI 0, -1,-2,....-45
if(pDevice->byBBPreEDIndex == 20) break;
pDevice->byBBPreEDIndex = 20;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-45\n");
} else if(pDevice->byBBPreEDRSSI <= 46) { //RSSI -46
if(pDevice->byBBPreEDIndex == 19) break;
pDevice->byBBPreEDIndex = 19;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x1A); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46\n");
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -47
if(pDevice->byBBPreEDIndex == 18) break;
pDevice->byBBPreEDIndex = 18;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x15); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -47\n");
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
if(pDevice->byBBPreEDIndex == 17) break;
pDevice->byBBPreEDIndex = 17;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0E); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
if(pDevice->byBBPreEDIndex == 16) break;
pDevice->byBBPreEDIndex = 16;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x09); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
if(pDevice->byBBPreEDIndex == 15) break;
pDevice->byBBPreEDIndex = 15;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x06); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
if(pDevice->byBBPreEDIndex == 14) break;
pDevice->byBBPreEDIndex = 14;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x03); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
if(pDevice->byBBPreEDIndex == 13) break;
pDevice->byBBPreEDIndex = 13;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xA0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
if(pDevice->byBBPreEDIndex == 12) break;
pDevice->byBBPreEDIndex = 12;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x20); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
if(pDevice->byBBPreEDIndex == 11) break;
pDevice->byBBPreEDIndex = 11;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xA0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
if(pDevice->byBBPreEDIndex == 10) break;
pDevice->byBBPreEDIndex = 10;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x54); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
if(pDevice->byBBPreEDIndex == 9) break;
pDevice->byBBPreEDIndex = 9;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x18); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
if(pDevice->byBBPreEDIndex == 8) break;
pDevice->byBBPreEDIndex = 8;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xE3); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
if(pDevice->byBBPreEDIndex == 7) break;
pDevice->byBBPreEDIndex = 7;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB9); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
if(pDevice->byBBPreEDIndex == 6) break;
pDevice->byBBPreEDIndex = 6;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x93); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
if(pDevice->byBBPreEDIndex == 5) break;
pDevice->byBBPreEDIndex = 5;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x79); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
if(pDevice->byBBPreEDIndex == 4) break;
pDevice->byBBPreEDIndex = 4;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x62); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
if(pDevice->byBBPreEDIndex == 3) break;
pDevice->byBBPreEDIndex = 3;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x51); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
} else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67
if(pDevice->byBBPreEDIndex == 2) break;
pDevice->byBBPreEDIndex = 2;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67\n");
} else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68
if(pDevice->byBBPreEDIndex == 1) break;
pDevice->byBBPreEDIndex = 1;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x36); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -68\n");
} else { //RSSI -69, -70,....
if(pDevice->byBBPreEDIndex == 0) break;
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,...\n");
}
break;
case RF_VT3226:
case RF_VT3226D0:
//RobertYu:20060627, update new table
if( bScanning )
{ // need Max sensitivity //RSSI -69, -70, ...
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,..\n");
break;
}
if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41
if(pDevice->byBBPreEDIndex == 22) break;
pDevice->byBBPreEDIndex = 22;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
} else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42
if(pDevice->byBBPreEDIndex == 21) break;
pDevice->byBBPreEDIndex = 21;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x36); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -42\n");
} else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43
if(pDevice->byBBPreEDIndex == 20) break;
pDevice->byBBPreEDIndex = 20;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x26); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -43\n");
} else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45
if(pDevice->byBBPreEDIndex == 19) break;
pDevice->byBBPreEDIndex = 19;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x18); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -44,-45\n");
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47
if(pDevice->byBBPreEDIndex == 18) break;
pDevice->byBBPreEDIndex = 18;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x11); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46,-47\n");
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
if(pDevice->byBBPreEDIndex == 17) break;
pDevice->byBBPreEDIndex = 17;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0a); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
if(pDevice->byBBPreEDIndex == 16) break;
pDevice->byBBPreEDIndex = 16;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x07); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
if(pDevice->byBBPreEDIndex == 15) break;
pDevice->byBBPreEDIndex = 15;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x04); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
if(pDevice->byBBPreEDIndex == 14) break;
pDevice->byBBPreEDIndex = 14;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
if(pDevice->byBBPreEDIndex == 13) break;
pDevice->byBBPreEDIndex = 13;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
if(pDevice->byBBPreEDIndex == 12) break;
pDevice->byBBPreEDIndex = 12;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
if(pDevice->byBBPreEDIndex == 11) break;
pDevice->byBBPreEDIndex = 11;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x70); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
if(pDevice->byBBPreEDIndex == 10) break;
pDevice->byBBPreEDIndex = 10;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
if(pDevice->byBBPreEDIndex == 9) break;
pDevice->byBBPreEDIndex = 9;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xEA); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
if(pDevice->byBBPreEDIndex == 8) break;
pDevice->byBBPreEDIndex = 8;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
if(pDevice->byBBPreEDIndex == 7) break;
pDevice->byBBPreEDIndex = 7;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x9C); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
if(pDevice->byBBPreEDIndex == 6) break;
pDevice->byBBPreEDIndex = 6;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x80); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
if(pDevice->byBBPreEDIndex == 5) break;
pDevice->byBBPreEDIndex = 5;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x68); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
if(pDevice->byBBPreEDIndex == 4) break;
pDevice->byBBPreEDIndex = 4;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x52); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
if(pDevice->byBBPreEDIndex == 3) break;
pDevice->byBBPreEDIndex = 3;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
} else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67
if(pDevice->byBBPreEDIndex == 2) break;
pDevice->byBBPreEDIndex = 2;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x36); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67\n");
} else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68
if(pDevice->byBBPreEDIndex == 1) break;
pDevice->byBBPreEDIndex = 1;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x2D); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -68\n");
} else { //RSSI -69, -70, ...
if(pDevice->byBBPreEDIndex == 0) break;
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,..\n");
}
break;
case RF_VT3342A0: //RobertYu:20060627, testing table
if( bScanning )
{ // need Max sensitivity //RSSI -67, -68, ...
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67, -68,..\n");
break;
}
if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41
if(pDevice->byBBPreEDIndex == 20) break;
pDevice->byBBPreEDIndex = 20;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
} else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42
if(pDevice->byBBPreEDIndex == 19) break;
pDevice->byBBPreEDIndex = 19;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x36); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -42\n");
} else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43
if(pDevice->byBBPreEDIndex == 18) break;
pDevice->byBBPreEDIndex = 18;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x26); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -43\n");
} else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45
if(pDevice->byBBPreEDIndex == 17) break;
pDevice->byBBPreEDIndex = 17;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x18); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -44,-45\n");
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47
if(pDevice->byBBPreEDIndex == 16) break;
pDevice->byBBPreEDIndex = 16;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x11); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46,-47\n");
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
if(pDevice->byBBPreEDIndex == 15) break;
pDevice->byBBPreEDIndex = 15;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0a); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
if(pDevice->byBBPreEDIndex == 14) break;
pDevice->byBBPreEDIndex = 14;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x07); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
if(pDevice->byBBPreEDIndex == 13) break;
pDevice->byBBPreEDIndex = 13;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x04); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
if(pDevice->byBBPreEDIndex == 12) break;
pDevice->byBBPreEDIndex = 12;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
if(pDevice->byBBPreEDIndex == 11) break;
pDevice->byBBPreEDIndex = 11;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
if(pDevice->byBBPreEDIndex == 10) break;
pDevice->byBBPreEDIndex = 10;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
if(pDevice->byBBPreEDIndex == 9) break;
pDevice->byBBPreEDIndex = 9;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x70); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
if(pDevice->byBBPreEDIndex == 8) break;
pDevice->byBBPreEDIndex = 8;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
if(pDevice->byBBPreEDIndex == 7) break;
pDevice->byBBPreEDIndex = 7;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xEA); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
if(pDevice->byBBPreEDIndex == 6) break;
pDevice->byBBPreEDIndex = 6;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
if(pDevice->byBBPreEDIndex == 5) break;
pDevice->byBBPreEDIndex = 5;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x9C); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
if(pDevice->byBBPreEDIndex == 4) break;
pDevice->byBBPreEDIndex = 4;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x80); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
if(pDevice->byBBPreEDIndex == 3) break;
pDevice->byBBPreEDIndex = 3;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x68); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
if(pDevice->byBBPreEDIndex == 2) break;
pDevice->byBBPreEDIndex = 2;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x52); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
if(pDevice->byBBPreEDIndex == 1) break;
pDevice->byBBPreEDIndex = 1;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
} else { //RSSI -67, -68, ...
if(pDevice->byBBPreEDIndex == 0) break;
pDevice->byBBPreEDIndex = 0;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); //CR206(0xCE)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67, -68,..\n");
}
break;
}
}
|
2c4872abc66f039e6c8366b3c6c0a01330b6d412
|
3a30cfb29aac91e5c75d4dbcefddfd1f34d5f18c
|
/c-tests/lacc/convert-int-float.c
|
3e8dd9db3b8d5649cb94245513b7e1e540c381fc
|
[
"MIT",
"MPL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LGPL-2.0-only"
] |
permissive
|
vnmakarov/mir
|
a1725bc9c828e8580df6b7ae94e04175db8abe93
|
928e28fb3acaa50d051a906e76a55cc48a556574
|
refs/heads/master
| 2023-09-02T11:10:37.434581
| 2023-08-25T19:25:40
| 2023-08-25T19:25:40
| 178,932,492
| 2,005
| 156
|
MIT
| 2023-08-01T20:29:59
| 2019-04-01T19:24:56
|
C
|
UTF-8
|
C
| false
| false
| 187
|
c
|
convert-int-float.c
|
int cvtfloat(void) {
float f;
unsigned char c = 0xff;
f = c;
return f;
}
int cvtdouble(void) {
double d;
d = 32;
return d;
}
int main(void) {
return cvtfloat() - cvtdouble();
}
|
db2664736c700a5c70fb47de4f62384bbd873f9e
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_cello/AKWF_cello_0010.h
|
2eb6c80d70939ef83eca8c61371c9fb5302f29b1
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,684
|
h
|
AKWF_cello_0010.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_cello_0010 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| * * |
| * * |
| * * |
| * * |
| * * |
| ** ** * *** |
| **** * ** ** ******** |
|** ** ** ***** ** ** ** |
|* *** ** ** ** * |
|* ** ** ** ********* *** |
| ** **** ** * * ** *** * ** |
| ** * ** **** ** ** ** ** ** * * ** *|
| * * ** *** ****** * * **** ** ** ** ****|
| ** *** *** * ***** *** * ** * ** |
| *** ** ** ** *** |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_cello_0010 [] = {
33578, 36023, 38339, 40723, 42760, 44501, 45763, 46445, 46564, 46231, 45404, 44207, 42864, 41409, 40164, 39281,
38872, 39093, 40038, 41648, 43939, 46725, 49972, 53221, 56429, 59343, 61787, 63757, 65024, 65526, 65114, 63951,
62057, 59602, 56818, 53880, 50999, 48236, 45793, 43792, 42148, 40844, 40016, 39619, 39612, 39897, 40187, 40450,
40529, 40300, 39735, 38772, 37424, 35825, 34061, 32240, 30477, 28758, 27094, 25497, 24064, 22839, 21808, 21077,
20652, 20547, 20753, 21223, 21979, 22831, 23975, 25328, 26760, 28322, 29834, 31262, 32429, 33168, 33315, 32897,
31976, 30637, 29038, 27398, 25946, 24786, 24084, 23759, 23856, 24254, 24853, 25635, 26433, 27191, 27808, 28410,
28886, 29215, 29389, 29345, 29055, 28557, 27916, 27169, 26465, 25815, 25304, 25077, 25128, 25346, 25942, 26693,
27581, 28597, 29521, 30584, 31636, 32635, 33812, 35048, 36310, 37747, 39105, 40398, 41748, 43003, 44041, 44870,
45501, 46242, 46783, 46861, 46500, 45541, 44611, 43705, 42952, 42727, 42869, 43104, 43359, 43880, 44440, 44915,
45284, 45334, 45110, 44339, 42994, 41166, 38773, 36051, 33034, 30015, 27370, 25142, 23441, 22334, 21744, 21699,
22166, 23035, 24226, 25855, 28037, 30506, 32796, 34602, 35846, 36606, 36902, 36829, 36614, 36218, 35688, 35302,
35299, 35520, 35757, 35924, 35910, 35722, 35544, 35336, 34931, 34182, 32991, 31596, 30246, 28918, 27773, 26792,
26012, 25560, 25299, 25307, 25322, 25293, 25117, 24838, 24416, 23748, 22966, 22070, 21100, 19995, 18983, 18220,
17744, 17686, 18269, 19538, 21338, 23463, 25661, 27765, 29722, 31322, 32619, 33347, 33439, 33083, 32229, 31028,
29392, 27522, 25539, 23602, 21949, 20909, 20587, 20910, 21829, 23239, 25107, 27203, 29465, 31679, 33616, 35040,
35887, 36092, 35604, 34408, 32674, 30618, 28511, 26587, 25087, 24242, 23999, 24497, 25573, 27217, 29064, 31471,
};
|
51dbacd324fbd15203b42e037d442bdd851e01ef
|
564ae40950e6d71e30d3fecfa83ebbeaadfc72bc
|
/firmware/usbasp/usbasp.h
|
781397abe7ff06809922f53f7514112a4dcc9ad8
|
[
"MIT"
] |
permissive
|
nofeletru/UsbAsp-flash
|
3790dc0abd9b038969ea3bebe0833b4f8e88a184
|
9dc854fe189ca35577d3d39abf2d93eaad3b32fb
|
refs/heads/master
| 2023-07-27T11:04:46.516047
| 2023-07-25T12:32:43
| 2023-07-25T12:34:29
| 38,684,672
| 683
| 164
|
MIT
| 2023-07-24T08:52:40
| 2015-07-07T11:56:44
|
Pascal
|
UTF-8
|
C
| false
| false
| 2,985
|
h
|
usbasp.h
|
/*
* usbasp.c - part of USBasp
*
* Autor..........: Thomas Fischl <tfischl@gmx.de>
* Description....: Definitions and macros for usbasp
* Licence........: GNU GPL v2 (see Readme.txt)
* Creation Date..: 2009-02-28
* Last change....: 2009-02-28
*/
#ifndef USBASP_H_
#define USBASP_H_
/* USB function call identifiers */
#define USBASP_FUNC_CONNECT 1
#define USBASP_FUNC_DISCONNECT 2
#define USBASP_FUNC_TRANSMIT 3
#define USBASP_FUNC_READFLASH 4
#define USBASP_FUNC_ENABLEPROG 5
#define USBASP_FUNC_WRITEFLASH 6
#define USBASP_FUNC_READEEPROM 7
#define USBASP_FUNC_WRITEEEPROM 8
#define USBASP_FUNC_SETLONGADDRESS 9
#define USBASP_FUNC_SETISPSCK 10
#define USBASP_FUNC_TPI_CONNECT 11
#define USBASP_FUNC_TPI_DISCONNECT 12
#define USBASP_FUNC_TPI_RAWREAD 13
#define USBASP_FUNC_TPI_RAWWRITE 14
#define USBASP_FUNC_TPI_READBLOCK 15
#define USBASP_FUNC_TPI_WRITEBLOCK 16
#define USBASP_FUNC_GETCAPABILITIES 127
#define USBASP_FUNC_SPI_CONNECT 50
#define USBASP_FUNC_SPI_READ 51
#define USBASP_FUNC_SPI_WRITE 52
#define USBASP_FUNC_I2C_INIT 70
#define USBASP_FUNC_I2C_READ 71
#define USBASP_FUNC_I2C_WRITE 72
#define USBASP_FUNC_I2C_START 73
#define USBASP_FUNC_I2C_STOP 74
#define USBASP_FUNC_I2C_READBYTE 75
#define USBASP_FUNC_I2C_WRITEBYTE 76
#define USBASP_FUNC_MW_READ 92
#define USBASP_FUNC_MW_WRITE 93
#define USBASP_FUNC_MW_BUSY 94
/* USBASP capabilities */
#define USBASP_CAP_0_TPI 0x01
#define USBASP_CAP_3_FLASH 0x01
/* programming state */
#define PROG_STATE_IDLE 0
#define PROG_STATE_WRITEFLASH 1
#define PROG_STATE_READFLASH 2
#define PROG_STATE_READEEPROM 3
#define PROG_STATE_WRITEEEPROM 4
#define PROG_STATE_TPI_READ 5
#define PROG_STATE_TPI_WRITE 6
#define PROG_STATE_SPI_WRITE 50
#define PROG_STATE_SPI_READ 51
#define PROG_STATE_I2C_WRITE 53
#define PROG_STATE_I2C_READ 54
#define PROG_STATE_MW_READ 57
#define PROG_STATE_MW_WRITE 58
/* Block mode flags */
#define PROG_BLOCKFLAG_FIRST 1
#define PROG_BLOCKFLAG_LAST 2
/* ISP SCK speed identifiers */
#define USBASP_ISP_SCK_AUTO 0
#define USBASP_ISP_SCK_0_5 1 /* 500 Hz */
#define USBASP_ISP_SCK_1 2 /* 1 kHz */
#define USBASP_ISP_SCK_2 3 /* 2 kHz */
#define USBASP_ISP_SCK_4 4 /* 4 kHz */
#define USBASP_ISP_SCK_8 5 /* 8 kHz */
#define USBASP_ISP_SCK_16 6 /* 16 kHz */
#define USBASP_ISP_SCK_32 7 /* 32 kHz */
#define USBASP_ISP_SCK_93_75 8 /* 93.75 kHz */
#define USBASP_ISP_SCK_187_5 9 /* 187.5 kHz */
#define USBASP_ISP_SCK_375 10 /* 375 kHz */
#define USBASP_ISP_SCK_750 11 /* 750 kHz */
#define USBASP_ISP_SCK_1500 12 /* 1.5 MHz */
#define USBASP_ISP_SCK_3000 13 /* 3 MHz */
/* macros for gpio functions */
#define ledRedOn() PORTC &= ~(1 << PC1)
#define ledRedOff() PORTC |= (1 << PC1)
#define ledGreenOn() PORTC &= ~(1 << PC0)
#define ledGreenOff() PORTC |= (1 << PC0)
#endif /* USBASP_H_ */
|
7b43ae42c767bb5e4d6ba3546f1589f2ab2c09ca
|
503bf74961cc3d52236d52439eeb7e8059860b7a
|
/src/ui-entry-renderers.c
|
0ed3caab65d8a283570d7e1290f2b70eb38a6fe2
|
[] |
no_license
|
angband/angband
|
f00cce82a82b73f8c58a0dc12cbd2f3957dab5ce
|
e2f4b269f276b9fd7a25cba2b9a49fac84642416
|
refs/heads/master
| 2023-08-29T15:58:27.283723
| 2023-08-25T16:50:33
| 2023-08-28T21:40:44
| 1,033,705
| 1,206
| 386
| null | 2023-09-13T21:18:28
| 2010-10-29T01:17:48
|
C
|
UTF-8
|
C
| false
| false
| 44,324
|
c
|
ui-entry-renderers.c
|
/**
* \file ui-entry-renderers.c
* \brief Define backend handling for character screen and equippable comparison
*
* Copyright (c) 2020 Eric Branlund
*
* This work is free software; you can redistribute it and/or modify it
* under the terms of either:
*
* a) the GNU General Public License as published by the Free Software
* Foundation, version 2, or
*
* b) the "Angband licence":
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
*/
#include "ui-entry-init.h"
#include "ui-entry-renderers.h"
#include "ui-term.h"
#include "z-color.h"
#include "z-util.h"
#include "z-virt.h"
/*
* This is the maximum number of symbols/colors used by any renderer. Used to
* limit what's extracted from the configuration file.
*/
#define MAX_PALETTE (64)
/*
* This is the maximum number of characters to use for any units label. Used
* to limit what's extracted from the configuration file.
*/
#define MAX_UNITS_LABEL (24)
struct renderer_info;
typedef void (*renderer_func)(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info);
typedef int (*valuewidth_func)(const struct renderer_info *info);
static void safe_queue_chars(int x, int y, int n, int a, const wchar_t *s);
static void format_int(int i, bool add_one, wchar_t zero, wchar_t overflow,
bool nonneg, bool use_sign, int nbuf, wchar_t *buf);
static void show_combined_generic(const struct renderer_info *info,
const struct ui_entry_details *details, int vcombined, int acombined);
/* Implemented backends. */
static void renderer_COMPACT_RESIST_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info);
static int valuewidth_COMPACT_RESIST_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info);
static void renderer_COMPACT_FLAG_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info
);
static int valuewidth_COMPACT_FLAG_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info);
static void renderer_COMPACT_FLAG_WITH_CANCEL_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info
);
static int valuewidth_COMPACT_FLAG_WITH_CANCEL_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info);
static void renderer_NUMERIC_AS_SIGN_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info);
static int valuewidth_NUMERIC_AS_SIGN_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info);
static void renderer_NUMERIC_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info);
static int valuewidth_NUMERIC_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info);
static void renderer_NUMERIC_RENDERER_WITH_BOOL_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info);
static int valuewidth_NUMERIC_RENDERER_WITH_BOOL_AUX(
const struct renderer_info *info);
struct backend_info {
renderer_func func;
valuewidth_func vw_func;
const char *default_combiner_name;
const char *default_colors;
const char *default_labelcolors;
const char *default_symbols;
int default_ndigit;
int default_sign;
};
enum {
UI_ENTRY_NO_SIGN,
UI_ENTRY_ALWAYS_SIGN,
UI_ENTRY_NEGATIVE_SIGN,
UI_ENTRY_SIGN_DEFAULT = INT_MIN
};
static const struct backend_info backends[] =
{
#define F(x) renderer_##x
#define FWIDTH(x) valuewidth_##x
#define UI_ENTRY_RENDERER(x, co, c, lc, s, n, sg) { F(x), FWIDTH(x), co, c, lc, s, n, UI_ENTRY_##sg},
#include "list-ui-entry-renderers.h"
#undef UI_ENTRY_RENDERER
#undef F
#undef FWIDTH
};
static const char *backend_names[] = {
#define UI_ENTRY_RENDERER(x, co, c, lc, s, n, sg) #x,
#include "list-ui-entry-renderers.h"
#undef UI_ENTRY_RENDERER
NULL
};
static char *convert_attrs_to_chars(const int *attr, int n);
static void convert_chars_to_attrs(const char *colors, int n, int *attr);
struct renderer_info {
char *name;
char *comb_rend_nm;
int *colors;
int *label_colors;
wchar_t *symbols;
wchar_t *units_label;
const struct backend_info *backend;
int combined_renderer_index;
int combiner_index;
int ncolors;
int nlabcolors;
int nsym;
int ndigit;
int sign;
int units_nlabel;
};
static int renderer_count = 0;
static int renderer_allocated = 0;
static struct renderer_info *renderers = 0;
/**
* Return the first valid index accepted by ui_entry_renderer_apply()
* and the other functions expecting a renderer index. Any index whose
* value is greater than or equal to ui_entry_get_min_index() and less than
* ui_entry_get_index_limit() is valid.
*/
int ui_entry_renderer_get_min_index(void)
{
return 1;
}
/**
* Return the upper bound for indices accepted by ui_entry_renderer_apply()
* and the other functions expecting a renderer index. Any index whose
* value is greater than or equal to ui_entry_get_min_index() and less than
* ui_entry_get_index_limit() is valid.
*/
int ui_entry_renderer_get_index_limit(void)
{
return renderer_count + 1;
}
/**
* Returns the name for the renderer as configured in ui_entry_renderers.txt.
* The returned value will be NULL if ind is out of bounds.
*/
const char *ui_entry_renderer_get_name(int ind)
{
return (ind >= 1 && ind <= renderer_count) ?
renderers[ind - 1].name : NULL;
}
/**
* Look up a renderer by name. If the name is not one of those configured in
* ui_entry_renderers.txt, returns zero. Otherwise returns the index for
* the renderer.
*/
int ui_entry_renderer_lookup(const char *name)
{
int i = 0;
while (i < renderer_count) {
if (streq(name, renderers[i].name)) {
return i + 1;
}
++i;
}
return 0;
}
/**
* Query a renderer for the number of characters used to draw a value. ind
* is the index for the renderer; use ui_entry_renderer_lookup to get it.
* Will return -1 if the renderer is not valid or does not have an implemented
* backend.
*/
int ui_entry_renderer_query_value_width(int ind)
{
if (ind <= 0 || ind > renderer_count || !renderers[ind - 1].backend) {
return -1;
}
return (*renderers[ind - 1].backend->vw_func)(renderers + ind - 1);
}
/**
* Query a renderer for the number of characters used to draw the combined
* value. ind is the index for the renderer; use ui_entry_renderer_lookup to
* get it. Will return -1 if the renderer is not valid or has not been
* attached to another renderer to show the combined value.
*/
int ui_entry_renderer_query_combined_width(int ind)
{
const struct renderer_info *combined_renderer;
if (ind <= 0 || ind > renderer_count ||
renderers[ind - 1].combined_renderer_index <= 0 ||
renderers[ind - 1].combined_renderer_index > renderer_count) {
return -1;
}
combined_renderer =
&renderers[renderers[ind - 1].combined_renderer_index - 1];
return (combined_renderer->backend) ?
(*combined_renderer->backend->vw_func)(combined_renderer) : -1;
}
/**
* Returns the combiner index, suitable as the first argument to
* ui_entry_combiner_get_funcs(), for the given user interface renderer.
* Returns zero if the renderer is not valid or has an invalid combiner.
*/
int ui_entry_renderer_query_combiner(int ind)
{
return (ind > 0 && ind <= renderer_count) ?
renderers[ind - 1].combiner_index : 0;
}
/**
* Use a renderer to draw a set of values and, optionally, their label and
* combined value. ind is the index for the renderer; use
* ui_entry_renderer_lookup to get it. label and nlabel specify the label to
* draw. If nlabel is 0, no label will be drawn. vals, auxvals, and n set
* the values to draw. vals and auxvals each refer to n values. details
* controls certain aspects of the rendering including positions and the
* handling of the combined value. The comments for it in
* ui-entry-renderers.h describe it in more detail.
*/
void ui_entry_renderer_apply(int ind, const wchar_t *label, int nlabel,
const int *vals, const int *auxvals, int n,
const struct ui_entry_details *details)
{
if (ind <= 0 || ind > renderer_count || !renderers[ind - 1].backend) {
return;
}
(*renderers[ind - 1].backend->func)(
label, nlabel, vals, auxvals, n, details, renderers + ind - 1);
}
/*
* Change the colors, label colors, or symbols used by a renderer. Any of
* the three may be a null pointer which leaves the current setting for that
* unchanged. Returns zero if successful. Returns a nonzero value if the
* renderer index is invalid or it was not possible to convert one or more
* of the values to change.
*/
int ui_entry_renderer_customize(int ind, const char *colors,
const char *label_colors, const char *symbols)
{
size_t length;
if (ind <= 0 || ind > renderer_count) {
return 1;
}
if (colors != 0) {
length = strlen(colors);
convert_chars_to_attrs(colors,
(length < (size_t) renderers[ind - 1].ncolors) ?
(int) length : renderers[ind - 1].ncolors,
renderers[ind - 1].colors);
}
if (label_colors != 0) {
length = strlen(label_colors);
convert_chars_to_attrs(label_colors,
(length < (size_t) renderers[ind - 1].ncolors) ?
(int) length : renderers[ind - 1].ncolors,
renderers[ind - 1].label_colors);
}
if (symbols != 0) {
wchar_t *tmp = mem_alloc((renderers[ind - 1].nsym + 1) *
sizeof(*tmp));
length = text_mbstowcs(tmp, symbols,
renderers[ind - 1].nsym + 1);
if (length == (size_t)-1) {
return 1;
}
(void) memcpy(renderers[ind - 1].symbols, tmp,
(((int)length < renderers[ind - 1].nsym) ?
(int)length : renderers[ind - 1].nsym) *
sizeof(*renderers[ind - 1].symbols));
mem_free(tmp);
}
return 0;
}
/*
* If ind is valid, returns a dynamically allocated string with the current
* setting for the palette of colors. That string should be released with
* string_free(). Otherwise, returns NULL.
*/
char *ui_entry_renderer_get_colors(int ind)
{
if (ind < 1 || ind > renderer_count) {
return NULL;
}
return convert_attrs_to_chars(renderers[ind - 1].colors,
renderers[ind - 1].ncolors);
}
/*
* If ind is valid, returns a dynamically allocated string with the current
* setting for the palette of label colors. That string should be released
* with string_free(). Otherwise, returns NULL.
*/
char *ui_entry_renderer_get_label_colors(int ind)
{
if (ind < 1 || ind > renderer_count) {
return NULL;
}
return convert_attrs_to_chars(renderers[ind - 1].label_colors,
renderers[ind - 1].nlabcolors);
}
/*
* If ind is valid, returns a dynamically allocated string with the current
* setting for the palette of symbols. That string should be released
* with mem_free(). Otherwise, returns NULL.
*/
char *ui_entry_renderer_get_symbols(int ind)
{
char *result, *p;
int isym;
if (ind < 1 || ind > renderer_count) {
return NULL;
}
result = mem_alloc(renderers[ind - 1].nsym * text_wcsz() + 1);
p = result;
for (isym = 0; isym < renderers[ind - 1].nsym; ++isym) {
int n = text_wctomb(p, renderers[ind - 1].symbols[isym]);
if (n > 0) {
p += n;
} else {
*p++ = ' ';
}
}
/* Terminate the string. */
*p = 0;
return result;
}
static void safe_queue_chars(int x, int y, int n, int a, const wchar_t *s)
{
if (y < 0 || y >= Term->hgt) {
return;
}
if (n + x > Term->wid) {
n = Term->wid - x;
}
if (n <= 0) {
return;
}
Term_queue_chars(x, y, n, a, s);
}
static void format_int(int i, bool add_one, wchar_t zero, wchar_t overflow,
bool nonneg, bool use_sign, int nbuf, wchar_t *buf)
{
static bool first_call = true;
static wchar_t wdigits[14];
const char *digits = "0123456789+- ";
int j = nbuf - 1;
div_t parts;
if (first_call) {
if (text_mbstowcs(wdigits, digits, 14) == (size_t)-1) {
quit("Invalid encoding for digits");
}
first_call = false;
}
/* Special handling for first digit. */
assert(nbuf > 0);
if (i == 0 && !add_one) {
parts.quot = 0;
parts.rem = 0;
buf[j] = zero;
} else {
parts = div(i, 10);
if (add_one) {
++parts.rem;
if (parts.rem == 10) {
parts.rem = 0;
++parts.quot;
}
}
buf[j] = wdigits[parts.rem];
}
--j;
while (parts.quot > 0 && j >= 0) {
parts = div(parts.quot, 10);
buf[j] = wdigits[parts.rem];
--j;
}
if (parts.quot > 0 || (use_sign && j == -1)) {
if (use_sign) {
buf[0] = (nonneg) ? wdigits[10] : wdigits[11];
j = 1;
} else {
j = 0;
}
while (j < nbuf) {
buf[j] = overflow;
++j;
}
} else {
if (use_sign && (i != 0 || add_one || zero == wdigits[0])) {
buf[j] = (nonneg) ? wdigits[10] : wdigits[11];
--j;
}
while (j >= 0) {
buf[j] = wdigits[12];
--j;
}
}
}
static void show_combined_generic(const struct renderer_info *info,
const struct ui_entry_details *details, int vcombined, int acombined)
{
struct ui_entry_details combined_details;
combined_details.label_position = loc(0, 0);
combined_details.value_position = details->combined_position;
combined_details.position_step = loc(0, 0);
combined_details.combined_position = loc(0, 0);
combined_details.vertical_label = false;
combined_details.alternate_color_first = false;
combined_details.known_rune = details->known_rune;
combined_details.show_combined = false;
ui_entry_renderer_apply(info->combined_renderer_index, NULL,
0, &vcombined, &acombined, 1, &combined_details);
}
/**
* Result is 0 (no resistance)), 1 (resistance), 2 (vulnerable), 3 (immune),
* 4 (unknown), 5 (not present), 6 (resistance and vulnerable).
*/
static int convert_vanilla_res_level(int i)
{
int result;
if (i == UI_ENTRY_UNKNOWN_VALUE) {
result = 4;
} else if (i == UI_ENTRY_VALUE_NOT_PRESENT) {
result = 5;
} else if (i == UI_ENTRY_RESIST0_RES_VUL) {
result = 6;
} else if (i >= 3) {
result = 3;
} else if (i >= 1) {
result = 1;
} else if (i <= -1) {
result = 2;
} else {
result = 0;
}
return result;
}
static void renderer_COMPACT_RESIST_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
/*
* Fastest varying is no timed effect, timed resistance,
* timed vulnerability, timed immunity, unknown timed effect,
* no value for timed effect, timed resistance + timed vulnerability
*/
const int combined_effect_tbl[7][7] = {
/* No permanent effect */
{ 2, 6, 9, 11, 2, 2, 18 },
/* Permanent resistance */
{ 3, 7, 10, 12, 3, 3, 19 },
/* Permanent vulnerability */
{ 4, 8, 4, 13, 4, 4, 20 },
/* Permanent immunity */
{ 5, 5, 5, 5, 5, 5, 5 },
/* Unknown permanent effect */
{ 0, 0, 0, 0, 0, 0, 0 },
/* No value for permanent effect */
{ 1, 1, 1, 1, 1, 1, 1 },
/* Permanent resistance + permanent vulnerability */
{ 14, 15, 16, 17, 14, 14, 21 }
};
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 22 : 0;
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 44 && info->nlabcolors >= 13 &&
info->nsym >= 22);
for (i = 0; i < n; ++i) {
int untimed_effect = convert_vanilla_res_level(vals[i]);
int timed_effect = convert_vanilla_res_level(auxvals[i]);
int palette_index;
assert(untimed_effect >= 0 && untimed_effect < 7 &&
timed_effect >= 0 && timed_effect < 7);
palette_index =
combined_effect_tbl[untimed_effect][timed_effect];
Term_putch(p.x, p.y,
info->colors[palette_index + color_offset],
info->symbols[palette_index]);
p = loc_sum(p, details->position_step);
color_offset ^= 22;
}
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
const int combined_label_tbl[7][7] = {
/* No permanent effect */
{ 1, 5, 8, 10, 1, 1, 1 },
/* Permanent resistance */
{ 2, 6, 9, 11, 2, 2, 2 },
/* Permanent vulnerability */
{ 3, 7, 3, 12, 3, 3, 3 },
/* Permanent immunity */
{ 4, 4, 4, 4, 4, 4, 4 },
/* Unknown permanent effect */
{ 1, 5, 8, 10, 1, 1, 1 },
/* No value for permanent effect */
{ 1, 5, 8, 10, 1, 1, 1 },
/* Permanent resistance + permanent vulnerability */
{ 1, 5, 8, 10, 1, 1, 1 }
};
int palette_index;
if (details->known_rune) {
int untimed_effect = convert_vanilla_res_level(vc);
int timed_effect = convert_vanilla_res_level(ac);
assert(untimed_effect >= 0 && untimed_effect < 7 &&
timed_effect >= 0 && timed_effect < 7);
palette_index =
combined_label_tbl[untimed_effect][timed_effect];
} else {
palette_index = 0;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_COMPACT_RESIST_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info)
{
return 1;
}
static void renderer_COMPACT_FLAG_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 5 : 0;
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 10 && info->nlabcolors >= 4 && info->nsym >= 5);
for (i = 0; i < n; ++i) {
int palette_index = 2;
if (vals[i] == UI_ENTRY_UNKNOWN_VALUE) {
palette_index = 0;
} else if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
} else if (vals[i]) {
palette_index = 3;
}
if (auxvals[i] && auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
if (vals[i] == 0) {
palette_index = 4;
}
}
Term_putch(p.x, p.y,
info->colors[palette_index + color_offset],
info->symbols[palette_index]);
p = loc_sum(p, details->position_step);
color_offset ^= 5;
}
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
int palette_index = 1;
if (! details->known_rune) {
palette_index = 0;
} else if (vc && vc != UI_ENTRY_UNKNOWN_VALUE &&
vc != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 2;
} else if (ac && ac != UI_ENTRY_UNKNOWN_VALUE &&
ac != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 3;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_COMPACT_FLAG_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info)
{
return 1;
}
static void renderer_COMPACT_FLAG_WITH_CANCEL_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 11 : 0;
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 22 && info->nlabcolors >= 7 && info->nsym >= 11);
for (i = 0; i < n; ++i) {
int palette_index;
if (vals[i] == UI_ENTRY_UNKNOWN_VALUE ||
auxvals[i] == UI_ENTRY_UNKNOWN_VALUE) {
palette_index = 0;
} else if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT &&
auxvals[i] == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
} else if (auxvals[i] == UI_ENTRY_VALUE_NOT_PRESENT ||
auxvals[i] == 0) {
if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT ||
vals[i] == 0) {
palette_index = 2;
} else if (vals[i] > 0) {
palette_index = 3;
} else {
palette_index = 4;
}
} else if (auxvals[i] > 0) {
if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT ||
vals[i] == 0) {
palette_index = 5;
} else if (vals[i] > 0) {
palette_index = 6;
} else {
palette_index = 7;
}
} else {
if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT ||
vals[i] == 0) {
palette_index = 8;
} else if (vals[i] > 0) {
palette_index = 9;
} else {
palette_index = 10;
}
}
Term_putch(p.x, p.y,
info->colors[palette_index + color_offset],
info->symbols[palette_index]);
p = loc_sum(p, details->position_step);
color_offset ^= 11;
}
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
int palette_index;
if (! details->known_rune) {
palette_index = 0;
} else if (vc == UI_ENTRY_VALUE_NOT_PRESENT ||
vc == UI_ENTRY_UNKNOWN_VALUE || vc == 0) {
if (ac == UI_ENTRY_VALUE_NOT_PRESENT ||
ac == UI_ENTRY_UNKNOWN_VALUE || ac == 0) {
palette_index = 4;
} else if (ac > 0) {
palette_index = 6;
} else {
palette_index = 2;
}
} else if (vc > 0) {
if (ac == UI_ENTRY_VALUE_NOT_PRESENT ||
ac == UI_ENTRY_UNKNOWN_VALUE || ac >= 0) {
palette_index = 5;
} else {
palette_index = 3;
}
} else {
palette_index = 1;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_COMPACT_FLAG_WITH_CANCEL_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info)
{
return 1;
}
static void renderer_NUMERIC_AS_SIGN_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 7 : 0;
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 14 && info->nlabcolors >= 6 && info->nsym >= 7);
for (i = 0; i < n; ++i) {
int palette_index = 2;
if (vals[i] == UI_ENTRY_UNKNOWN_VALUE || (vals[i] == 0 &&
auxvals[i] == UI_ENTRY_UNKNOWN_VALUE)) {
palette_index = 0;
} else if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
} else if (vals[i] > 0) {
palette_index = 3;
} else if (vals[i] < 0) {
palette_index = 4;
}
if (auxvals[i] > 0 && auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
if (vals[i] == 0) {
palette_index = 5;
}
} else if (auxvals[i] < 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
if (vals[i] == 0) {
palette_index = 6;
}
}
Term_putch(p.x, p.y,
info->colors[palette_index + color_offset],
info->symbols[palette_index]);
p = loc_sum(p, details->position_step);
color_offset ^= 7;
}
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
int palette_index;
if (! details->known_rune) {
palette_index = 0;
} else if (vc == UI_ENTRY_UNKNOWN_VALUE ||
vc == UI_ENTRY_VALUE_NOT_PRESENT || vc == 0) {
if (ac == UI_ENTRY_UNKNOWN_VALUE ||
ac == UI_ENTRY_VALUE_NOT_PRESENT || ac == 0) {
palette_index = 1;
} else if (ac > 0) {
palette_index = 4;
} else {
palette_index = 5;
}
} else if (vc > 0) {
palette_index = 2;
} else {
palette_index = 3;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_NUMERIC_AS_SIGN_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info)
{
return 1;
}
static void renderer_NUMERIC_RENDERER_WITH_COMBINED_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 7 : 0;
int nbuf = info->ndigit + ((info->sign == UI_ENTRY_NO_SIGN) ? 0 : 1);
wchar_t *buffer = mem_alloc(nbuf * sizeof(*buffer));
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 14 && info->nlabcolors >= 6 && info->nsym >= 7);
for (i = 0; i < n; ++i) {
int palette_index;
if (vals[i] == UI_ENTRY_UNKNOWN_VALUE || (vals[i] == 0 &&
auxvals[i] == UI_ENTRY_UNKNOWN_VALUE)) {
palette_index = 0;
format_int(0, false, info->symbols[0],
info->symbols[0], true,
info->sign == UI_ENTRY_ALWAYS_SIGN, nbuf,
buffer);
} else if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
format_int(0, false, info->symbols[1],
info->symbols[1], true,
info->sign == UI_ENTRY_ALWAYS_SIGN, nbuf,
buffer);
} else if (vals[i] > 0) {
palette_index = 3;
format_int(vals[i], false, info->symbols[2],
info->symbols[3], true,
info->sign == UI_ENTRY_ALWAYS_SIGN,
nbuf, buffer);
} else if (vals[i] < 0) {
int v;
bool o;
palette_index = 4;
if (vals[i] == INT_MIN) {
v = -(INT_MIN + 1);
o = true;
} else {
v = -vals[i];
o = false;
}
format_int(v, o, info->symbols[2], info->symbols[4],
false, info->sign != UI_ENTRY_NO_SIGN, nbuf,
buffer);
} else if (auxvals[i] > 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 5;
format_int(auxvals[i], false, info->symbols[2],
info->symbols[5], true,
info->sign == UI_ENTRY_ALWAYS_SIGN, nbuf,
buffer);
} else if (auxvals[i] < 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
int v;
bool o;
palette_index = 6;
if (auxvals[i] == INT_MIN) {
v = -(INT_MIN + 1);
o = true;
} else {
v = -vals[i];
o = false;
}
format_int(v, o, info->symbols[2], info->symbols[6],
false, info->sign != UI_ENTRY_NO_SIGN, nbuf,
buffer);
} else {
palette_index = 2;
format_int(0, false, info->symbols[2],
info->symbols[3], true,
info->sign == UI_ENTRY_ALWAYS_SIGN,
nbuf, buffer);
}
safe_queue_chars(p.x, p.y, nbuf,
info->colors[palette_index + color_offset], buffer);
if (info->units_nlabel != 0) {
safe_queue_chars(p.x + nbuf, p.y, info->units_nlabel,
info->colors[palette_index + color_offset],
info->units_label);
}
p = loc_sum(p, details->position_step);
color_offset ^= 7;
}
mem_free(buffer);
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
int palette_index;
if (! details->known_rune) {
palette_index = 0;
} else if (vc == 0 || vc == UI_ENTRY_UNKNOWN_VALUE ||
vc == UI_ENTRY_VALUE_NOT_PRESENT) {
if (ac == 0 || ac == UI_ENTRY_UNKNOWN_VALUE ||
ac == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
} else if (ac > 0) {
palette_index = 4;
} else {
palette_index = 5;
}
} else if (vc > 0) {
palette_index = 2;
} else {
palette_index = 3;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_NUMERIC_RENDERER_WITH_COMBINED_AUX(
const struct renderer_info *info)
{
return info->ndigit + ((info->sign == UI_ENTRY_NO_SIGN) ? 0 : 1) +
info->units_nlabel;
}
static void renderer_NUMERIC_RENDERER_WITH_BOOL_AUX(
const wchar_t *label,
int nlabel,
const int *vals,
const int *auxvals,
int n,
const struct ui_entry_details *details,
const struct renderer_info *info)
{
struct loc p = details->value_position;
int color_offset = (details->alternate_color_first) ? 8 : 0;
int nbuf = info->ndigit + ((info->sign == UI_ENTRY_NO_SIGN) ? 0 : 1);
wchar_t *buffer = mem_alloc(nbuf * sizeof(*buffer));
struct ui_entry_combiner_funcs combiner;
int vc, ac;
int i;
/* Check for defaults that are too short in list-ui-entry-renders.h. */
assert(info->ncolors >= 16 && info->nlabcolors >= 7 && info->nsym >= 6);
for (i = 0; i < n; ++i) {
int palette_index;
if (vals[i] == UI_ENTRY_UNKNOWN_VALUE || (vals[i] == 0 &&
auxvals[i] == UI_ENTRY_UNKNOWN_VALUE)) {
palette_index = 0;
format_int(0, false, info->symbols[0],
info->symbols[0], true,
info->sign == UI_ENTRY_ALWAYS_SIGN, nbuf,
buffer);
} else if (vals[i] == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 1;
format_int(0, false, info->symbols[1],
info->symbols[1], true,
info->sign == UI_ENTRY_ALWAYS_SIGN, nbuf,
buffer);
} else if (vals[i] > 0) {
if (auxvals[i] != 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 5;
} else {
palette_index = 4;
}
format_int(vals[i], false, info->symbols[2],
info->symbols[4], true,
info->sign == UI_ENTRY_ALWAYS_SIGN,
nbuf, buffer);
} else if (vals[i] < 0) {
int v;
bool o;
if (auxvals[i] != 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 7;
} else {
palette_index = 6;
}
if (vals[i] == INT_MIN) {
v = -(INT_MIN + 1);
o = true;
} else {
v = -vals[i];
o = false;
}
format_int(v, o, info->symbols[2], info->symbols[5],
false, info->sign != UI_ENTRY_NO_SIGN,
nbuf, buffer);
} else {
int zerosym;
if (auxvals[i] != 0 &&
auxvals[i] != UI_ENTRY_UNKNOWN_VALUE &&
auxvals[i] != UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = 3;
zerosym = 3;
} else {
palette_index = 2;
zerosym = 2;
}
format_int(0, false, info->symbols[zerosym],
info->symbols[4], true,
info->sign == UI_ENTRY_ALWAYS_SIGN,
nbuf, buffer);
}
safe_queue_chars(p.x, p.y, nbuf,
info->colors[palette_index + color_offset], buffer);
if (info->units_nlabel != 0) {
safe_queue_chars(p.x + nbuf, p.y, info->units_nlabel,
info->colors[palette_index + color_offset],
info->units_label);
}
p = loc_sum(p, details->position_step);
color_offset ^= 8;
}
mem_free(buffer);
if (nlabel <= 0 && !details->show_combined) {
return;
}
if (ui_entry_combiner_get_funcs(info->combiner_index, &combiner)) {
assert(0);
}
(*combiner.vec_func)(n, vals, auxvals, &vc, &ac);
if (nlabel > 0) {
bool acbool = ac && ac != UI_ENTRY_UNKNOWN_VALUE &&
ac != UI_ENTRY_VALUE_NOT_PRESENT;
int palette_index;
if (! details->known_rune) {
palette_index = 0;
} else if (vc == 0 || vc == UI_ENTRY_UNKNOWN_VALUE ||
vc == UI_ENTRY_VALUE_NOT_PRESENT) {
palette_index = (acbool) ? 6 : 5;
} else if (vc > 0) {
palette_index = (acbool) ? 2 : 1;
} else {
palette_index = (acbool) ? 4 : 3;
}
if (details->vertical_label) {
p = details->label_position;
for (i = 0; i < nlabel; ++i) {
Term_putch(p.x, p.y,
info->label_colors[palette_index],
label[i]);
p.y += 1;
}
} else {
safe_queue_chars(details->label_position.x,
details->label_position.y, nlabel,
info->label_colors[palette_index], label);
}
}
if (details->show_combined) {
show_combined_generic(info, details, vc, ac);
}
}
static int valuewidth_NUMERIC_RENDERER_WITH_BOOL_AUX(
const struct renderer_info *info)
{
return info->ndigit + ((info->sign == UI_ENTRY_NO_SIGN) ? 0 : 1) +
info->units_nlabel;
}
static int lookup_backend_by_name(const char *name)
{
int n = N_ELEMENTS(backend_names);
int i = 0;
while (i < n) {
if (streq(backend_names[i], name)) {
return i + 1;
}
++i;
}
return 0;
}
static char *convert_attrs_to_chars(const int *attr, int n)
{
char buf[9];
int nbuf = N_ELEMENTS(buf) - 1;
char *result = NULL;
int i = 0, j = 0;
while (1) {
if (i == nbuf || j >= n) {
buf[i] = '\0';
result = string_append(result, buf);
if (j >= n) {
return result;
}
i = 0;
}
if (attr[j] >= 0 && attr[j] < BASIC_COLORS) {
buf[i] = color_table[attr[j]].index_char;
} else {
buf[i] = 'w';
}
++i;
++j;
}
}
static void convert_chars_to_attrs(const char *colors, int n, int *attr)
{
int i;
for (i = 0; i < n; ++i) {
attr[i] = color_char_to_attr(colors[i]);
}
}
static void augment_colors(const char *colors, int **attr, int *nattr)
{
int n = (int) strlen(colors);
if (*nattr < n) {
int *newattr = mem_alloc(sizeof(*newattr) * n);
if (*nattr > 0) {
(void) memcpy(newattr, *attr, *nattr *
sizeof(*newattr));
}
mem_free(*attr);
convert_chars_to_attrs(colors + *nattr, n - *nattr,
newattr + *nattr);
*attr = newattr;
*nattr = n;
}
}
static void augment_symbols(const char *symbols, wchar_t **s, int *n)
{
wchar_t defsym[MAX_PALETTE];
size_t nd = text_mbstowcs(defsym, symbols, MAX_PALETTE);
if (nd == (size_t)-1) {
quit("Invalid encoding for default symbols");
}
if (*n < (int) nd) {
wchar_t *newsym = mem_alloc((nd + 1) * sizeof(*newsym));
if (*n > 0) {
(void) memcpy(newsym, *s, *n * sizeof(*newsym));
}
mem_free(*s);
(void) memcpy(newsym + *n, defsym + *n,
((int) nd - *n) * sizeof(*newsym));
/* Ensure null termination. */
if (text_mbstowcs(newsym + nd, "", 1) == (size_t)-1) {
quit("Couldn't terminate null character string");
}
*n = (int) nd;
*s = newsym;
}
}
static enum parser_error parse_renderer_name(struct parser *p)
{
const char *name = parser_getstr(p, "name");
int ind = ui_entry_renderer_lookup(name);
struct renderer_info *renderer;
if (ind == 0) {
if (renderer_count >= renderer_allocated) {
if (renderer_allocated > INT_MAX / 2) {
return PARSE_ERROR_TOO_MANY_ENTRIES;
}
renderer_allocated = (renderer_allocated == 0) ?
4 : renderer_allocated * 2;
renderers = mem_realloc(renderers,
renderer_allocated * sizeof(*renderers));
}
renderer = renderers + renderer_count;
++renderer_count;
renderer->name = string_make(name);
renderer->comb_rend_nm = NULL;
renderer->colors = NULL;
renderer->label_colors = NULL;
renderer->symbols = NULL;
renderer->units_label = NULL;
renderer->backend = NULL;
renderer->combined_renderer_index = 0;
renderer->combiner_index = 0;
renderer->ncolors = 0;
renderer->nlabcolors = 0;
renderer->nsym = 0;
renderer->ndigit = INT_MIN;
renderer->sign = UI_ENTRY_SIGN_DEFAULT;
renderer->units_nlabel = 0;
} else {
renderer = renderers + ind - 1;
}
parser_setpriv(p, renderer);
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_code(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *code;
int ind;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
code = parser_getstr(p, "code");
ind = lookup_backend_by_name(code);
if (ind == 0) {
return PARSE_ERROR_INVALID_VALUE;
}
renderer->backend = backends + ind - 1;
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_combine(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *name;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
name = parser_getstr(p, "combine");
renderer->combiner_index = ui_entry_combiner_lookup(name);
return (renderer->combiner_index) ?
PARSE_ERROR_NONE : PARSE_ERROR_INVALID_VALUE;
}
static enum parser_error parse_renderer_colors(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *colors;
size_t n;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
colors = parser_getstr(p, "colors");
mem_free(renderer->colors);
n = strlen(colors);
renderer->ncolors = (n < MAX_PALETTE) ? (int) n : MAX_PALETTE;
renderer->colors = mem_alloc(renderer->ncolors *
sizeof(*renderer->colors));
convert_chars_to_attrs(colors, renderer->ncolors, renderer->colors);
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_labelcolors(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *colors;
size_t n;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
colors = parser_getstr(p, "colors");
mem_free(renderer->label_colors);
n = strlen(colors);
renderer->nlabcolors = (n < MAX_PALETTE) ? (int) n : MAX_PALETTE;
renderer->label_colors = mem_alloc(renderer->nlabcolors *
sizeof(*renderer->label_colors));
convert_chars_to_attrs(colors, renderer->nlabcolors,
renderer->label_colors);
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_symbols(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *symbols;
size_t n;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
symbols = parser_getstr(p, "symbols");
mem_free(renderer->symbols);
renderer->symbols = mem_alloc((MAX_PALETTE + 1) *
sizeof(*renderer->symbols));
n = text_mbstowcs(renderer->symbols, symbols, MAX_PALETTE);
if (n == (size_t)-1) {
return PARSE_ERROR_INVALID_VALUE;
}
/* Make sure there's a null terminator. */
if (text_mbstowcs(renderer->symbols + n, "", 1) == (size_t)-1) {
return PARSE_ERROR_INVALID_VALUE;
}
renderer->nsym = n;
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_combined_renderer(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *name;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
name = parser_getstr(p, "name");
string_free(renderer->comb_rend_nm);
renderer->comb_rend_nm = string_make(name);
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_ndigit(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
int ndigit;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
ndigit = parser_getint(p, "ndigit");
if (ndigit < 1) {
return PARSE_ERROR_INVALID_VALUE;
}
renderer->ndigit = ndigit;
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_sign(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *sign;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
sign = parser_getstr(p, "sign");
if (streq(sign, "NO_SIGN")) {
renderer->sign = UI_ENTRY_NO_SIGN;
} else if (streq(sign, "ALWAYS_SIGN")) {
renderer->sign = UI_ENTRY_ALWAYS_SIGN;
} else if (streq(sign, "NEGATIVE_SIGN")) {
renderer->sign = UI_ENTRY_NEGATIVE_SIGN;
} else {
return PARSE_ERROR_INVALID_VALUE;
}
return PARSE_ERROR_NONE;
}
static enum parser_error parse_renderer_units(struct parser *p)
{
struct renderer_info *renderer = parser_priv(p);
const char *units;
size_t n, n2;
if (!renderer) {
return PARSE_ERROR_MISSING_RECORD_HEADER;
}
mem_free(renderer->units_label);
renderer->units_label = mem_alloc((MAX_UNITS_LABEL + 1) *
sizeof(*renderer->units_label));
units = parser_getstr(p, "units");
n = text_mbstowcs(renderer->units_label, units, MAX_UNITS_LABEL);
if (n == (size_t)-1) {
return PARSE_ERROR_INVALID_VALUE;
}
/* Ensure null termination. */
n2 = text_mbstowcs(renderer->units_label + n, "", 1);
if (n2 == (size_t)-1) {
return PARSE_ERROR_INVALID_VALUE;
}
renderer->units_nlabel = n;
return PARSE_ERROR_NONE;
}
static struct parser *init_parse_ui_entry_renderer(void)
{
struct parser *p = parser_new();
parser_setpriv(p, NULL);
parser_reg(p, "name str name", parse_renderer_name);
parser_reg(p, "code str code", parse_renderer_code);
parser_reg(p, "combine str combine", parse_renderer_combine);
parser_reg(p, "colors str colors", parse_renderer_colors);
parser_reg(p, "labelcolors str colors", parse_renderer_labelcolors);
parser_reg(p, "symbols str symbols", parse_renderer_symbols);
parser_reg(p, "ndigit int ndigit", parse_renderer_ndigit);
parser_reg(p, "sign str sign", parse_renderer_sign);
parser_reg(p, "units str units", parse_renderer_units);
parser_reg(p, "combined-renderer str name",
parse_renderer_combined_renderer);
return p;
}
static errr run_parse_ui_entry_renderer(struct parser *p)
{
return parse_file(p, "ui_entry_renderer");
}
static errr finish_parse_ui_entry_renderer(struct parser *p)
{
int i;
for (i = 0; i < renderer_count; ++i) {
/* Get the combined value renderer. */
if (renderers[i].comb_rend_nm) {
renderers[i].combined_renderer_index =
ui_entry_renderer_lookup(renderers[i].comb_rend_nm);
string_free(renderers[i].comb_rend_nm);
renderers[i].comb_rend_nm = NULL;
}
if (!renderers[i].backend) {
continue;
}
/* Use the default combiner if nothing was set. */
if (!renderers[i].combiner_index) {
renderers[i].combiner_index = ui_entry_combiner_lookup(
renderers[i].backend->default_combiner_name);
assert(renderers[i].combiner_index != 0);
}
/*
* If have fewer colors or symbols than the defaults for the
* backend, augment what was set with the default values.
*/
augment_colors(renderers[i].backend->default_colors,
&renderers[i].colors, &renderers[i].ncolors);
augment_colors(renderers[i].backend->default_labelcolors,
&renderers[i].label_colors, &renderers[i].nlabcolors);
augment_symbols(renderers[i].backend->default_symbols,
&renderers[i].symbols, &renderers[i].nsym);
if (renderers[i].ndigit == INT_MIN) {
renderers[i].ndigit =
renderers[i].backend->default_ndigit;
}
if (renderers[i].sign == UI_ENTRY_SIGN_DEFAULT) {
renderers[i].sign =
renderers[i].backend->default_sign;
}
}
parser_destroy(p);
return 0;
}
static void cleanup_parse_ui_entry_renderer(void)
{
int i;
for (i = 0; i < renderer_count; i++) {
mem_free(renderers[i].symbols);
mem_free(renderers[i].label_colors);
mem_free(renderers[i].colors);
string_free(renderers[i].comb_rend_nm);
string_free(renderers[i].name);
}
mem_free(renderers);
renderers = NULL;
renderer_count = 0;
renderer_allocated = 0;
}
struct file_parser ui_entry_renderer_parser = {
"ui_entry_renderer",
init_parse_ui_entry_renderer,
run_parse_ui_entry_renderer,
finish_parse_ui_entry_renderer,
cleanup_parse_ui_entry_renderer
};
|
aa2d8d7f5045ef5a898be084262709179276ad9e
|
8838eb997879add5759b6dfb23f9a646464e53ca
|
/src/compat/posix/sys/mman/mmap_stub.c
|
dd50515253be4a64fe1059929ffebf7971c409f3
|
[
"BSD-2-Clause"
] |
permissive
|
embox/embox
|
d6aacec876978522f01cdc4b8de37a668c6f4c80
|
98e3c06e33f3fdac10a29c069c20775568e0a6d1
|
refs/heads/master
| 2023-09-04T03:02:20.165042
| 2023-09-02T14:55:31
| 2023-09-02T14:55:31
| 33,078,138
| 1,087
| 325
|
BSD-2-Clause
| 2023-09-14T16:58:34
| 2015-03-29T15:27:48
|
C
|
UTF-8
|
C
| false
| false
| 598
|
c
|
mmap_stub.c
|
/**
* @file mmap.c
* @brief Various memory mapping
* @author Denis Deryugin <deryugin.denis@gmail.com>
* @version
* @date 28.02.2018
*/
#include <errno.h>
#include <stddef.h>
#include <sys/mman.h>
#include <util/log.h>
#include <module/embox/kernel/task/idesc/idesc_mmap_api.h>
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) {
if (fd > 0) {
/* Call device-specific handler.
* Working with plain files is not supported for now */
return idesc_mmap(addr, len, prot, flags, fd, off);
}
return addr;
}
int munmap(void *addr, size_t size) {
return 0;
}
|
ff7bf4fb29b6af0ac9978deff15a1f8600f093b2
|
c26d7b0ed875357278e61627da2da0650da77986
|
/src/libc/stdio/filbuf.c
|
0a54f7f379e6aa5f4e0351240dc79124c81c7b88
|
[
"BSD-3-Clause"
] |
permissive
|
RetroBSD/retrobsd
|
5343d9e3c424637fc3ad5b03fe720b2744490025
|
486f81f6abff01c7dcc207235cd2979b226a95ff
|
refs/heads/master
| 2023-09-02T23:12:05.110883
| 2023-07-07T18:41:40
| 2023-07-07T18:41:40
| 18,598,087
| 282
| 59
|
BSD-3-Clause
| 2023-07-18T07:35:36
| 2014-04-09T13:25:46
|
C
|
UTF-8
|
C
| false
| false
| 1,479
|
c
|
filbuf.c
|
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
int
_filbuf(iop)
register FILE *iop;
{
int size;
struct stat stbuf;
extern char *_smallbuf;
char c;
if (iop->_flag & _IORW)
iop->_flag |= _IOREAD;
if ((iop->_flag&_IOREAD) == 0)
return(EOF);
if (iop->_flag&(_IOSTRG|_IOEOF))
return(EOF);
tryagain:
if (iop->_base==NULL) {
if (iop->_flag&_IONBF) {
iop->_base = _smallbuf ? &_smallbuf[fileno(iop)] : &c;
goto tryagain;
}
if (fstat(fileno(iop), &stbuf) < 0 || stbuf.st_blksize <= NULL)
size = BUFSIZ;
else
size = stbuf.st_blksize;
if ((iop->_base = malloc(size)) == NULL) {
iop->_flag |= _IONBF;
goto tryagain;
}
iop->_flag |= _IOMYBUF;
iop->_bufsiz = size;
}
if (iop == stdin) {
if (stdout->_flag&_IOLBF)
fflush(stdout);
if (stderr->_flag&_IOLBF)
fflush(stderr);
}
iop->_cnt = read(fileno(iop), iop->_base,
iop->_flag & _IONBF ? 1 : iop->_bufsiz);
iop->_ptr = iop->_base;
if (iop->_flag & _IONBF && iop->_base == &c)
iop->_base = NULL;
if (--iop->_cnt < 0) {
if (iop->_cnt == -1) {
iop->_flag |= _IOEOF;
if (iop->_flag & _IORW)
iop->_flag &= ~_IOREAD;
} else
iop->_flag |= _IOERR;
iop->_cnt = 0;
return(EOF);
}
return(*iop->_ptr++&0377);
}
|
80f53cbc86a8df044ac1864c1372f42b0075e789
|
d60dcdd392e32cd6272f7f364e5b4d556d6b84fb
|
/dtaidistance/lib/DTAIDistanceC/DTAIDistanceC/dd_dtw_openmp.c
|
98580820a156a59267c8485cf655ac17a2ef09e3
|
[
"Apache-2.0"
] |
permissive
|
wannesm/dtaidistance
|
7e39ba5086129f330a297d82af1b25854c016f74
|
d914ab85021f67ff1c58d45727e0e4844ad26d8e
|
refs/heads/master
| 2023-08-31T06:21:45.836316
| 2023-08-01T12:51:50
| 2023-08-01T12:53:50
| 80,764,246
| 943
| 188
|
NOASSERTION
| 2023-05-23T14:44:06
| 2017-02-02T20:11:03
|
Python
|
UTF-8
|
C
| false
| false
| 11,982
|
c
|
dd_dtw_openmp.c
|
/*!
@file dtw_openmp.c
@brief DTAIDistance.dtw
@author Wannes Meert
@copyright Copyright © 2020 Wannes Meert. Apache License, Version 2.0, see LICENSE for details.
*/
#include "dd_dtw_openmp.h"
bool is_openmp_supported() {
#if defined(_OPENMP)
return true;
#else
return false;
#endif
}
/**
Check the arguments passed to dtw_distances_* and prepare the array of indices to be used.
The indices are created upfront to allow for easy parallelization.
@param block Block to indicate which series to compare.
@param nb_series_r Number of series in the first matrix
@param nb_series_c Number of series in the second matrix
@param cbs Column begin indices for a row series index
@param rls Location start for row in distances array
@param length Length of (compact) distances matrix
@param settings : Settings for DTW
@return 0 if all is ok, other number if not.
*/
int dtw_distances_prepare(DTWBlock *block, idx_t nb_series_r, idx_t nb_series_c, idx_t **cbs, idx_t **rls, idx_t *length, DTWSettings *settings) {
idx_t cb, rs, ir;
*length = dtw_distances_length(block, nb_series_r, nb_series_c);
if (length == 0) {
return 1;
}
// Correct block
if (block->re == 0) {
block->re = nb_series_r;
}
if (block->ce == 0) {
block->ce = nb_series_c;
}
if (block->re <= block->rb) {
*length = 0;
return 1;
}
if (block->ce <= block->cb) {
*length = 0;
return 1;
}
if (block->triu) {
*cbs = (idx_t *)malloc(sizeof(idx_t) * (block->re - block->rb));
if (!cbs) {
printf("Error: dtw_distances_* - cannot allocate memory (cbs length = %zu)", block->re - block->rb);
*length = 0;
return 1;
}
*rls = (idx_t *)malloc(sizeof(idx_t) * (block->re - block->rb));
if (!rls) {
printf("Error: dtw_distances_* - cannot allocate memory (rls length = %zu)", block->re - block->rb);
*length = 0;
return 1;
}
ir = 0;
rs = 0;
assert(block->rb < block->re);
for (idx_t r=block->rb; r<block->re; r++) {
if (r + 1 > block->cb) {
cb = r+1;
} else {
cb = block->cb;
}
(*cbs)[ir] = cb;
(*rls)[ir] = rs;
rs += block->ce - cb;
ir += 1;
}
} else { // triu=false
*cbs = NULL;
*rls = NULL;
}
return 0;
}
/*!
Distance matrix for n-dimensional DTW, executed on a list of pointers to arrays and in parallel.
@see dtw_distances_ptrs
*/
idx_t dtw_distances_ptrs_parallel(seq_t **ptrs, idx_t nb_ptrs, idx_t* lengths,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_ptrs, nb_ptrs, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
// Rows have different lengths, thus use guided scheduling to make threads with shorter rows
// not wait for threads with longer rows. Also the first rows are always longer than the last
// ones (upper triangular matrix), so this nicely aligns with the guided strategy.
// Using schedule("static, 1") is also fast for the same reason (neighbor rows are almost
// the same length, thus a circular assignment works well) but assumes all DTW computations take
// the same amount of time.
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance(ptrs[r], lengths[r],
ptrs[c], lengths[c], settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
/*!
Distance matrix for n-dimensional DTW, executed on a list of pointers to arrays and in parallel.
@see dtw_distances_ndim_ptrs
*/
idx_t dtw_distances_ndim_ptrs_parallel(seq_t **ptrs, idx_t nb_ptrs, idx_t* lengths, int ndim,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_ptrs, nb_ptrs, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance_ndim(ptrs[r], lengths[r],
ptrs[c], lengths[c],
ndim, settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
/*!
Distance matrix for n-dimensional DTW, executed on a 2-dimensional array and in parallel.
@see dtw_distances_matrix
*/
idx_t dtw_distances_matrix_parallel(seq_t *matrix, idx_t nb_rows, idx_t nb_cols,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_rows, nb_rows, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance(&matrix[r*nb_cols], nb_cols,
&matrix[c*nb_cols], nb_cols, settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
/*!
Distance matrix for n-dimensional DTW, executed on a 3-dimensional array and in parallel.
@see dtw_distances_ndim_matrix
*/
idx_t dtw_distances_ndim_matrix_parallel(seq_t *matrix, idx_t nb_rows, idx_t nb_cols, int ndim,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_rows, nb_rows, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance_ndim(&matrix[r*nb_cols*ndim], nb_cols,
&matrix[c*nb_cols*ndim], nb_cols,
ndim, settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
/*!
@see dtw_distances_matrices
*/
idx_t dtw_distances_matrices_parallel(seq_t *matrix_r, idx_t nb_rows_r, idx_t nb_cols_r,
seq_t *matrix_c, idx_t nb_rows_c, idx_t nb_cols_c,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_rows_r, nb_rows_c, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance(&matrix_r[r*nb_cols_r], nb_cols_r,
&matrix_c[c*nb_cols_c], nb_cols_c, settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
/*!
@see dtw_distances_ndim_matrices
*/
idx_t dtw_distances_ndim_matrices_parallel(seq_t *matrix_r, idx_t nb_rows_r, idx_t nb_cols_r,
seq_t *matrix_c, idx_t nb_rows_c, idx_t nb_cols_c, int ndim,
seq_t* output, DTWBlock* block, DTWSettings* settings) {
idx_t r, c, r_i, c_i;
idx_t length;
idx_t *cbs, *rls;
if (dtw_distances_prepare(block, nb_rows_r, nb_rows_c, &cbs, &rls, &length, settings) != 0) {
return 0;
}
#if defined(_OPENMP)
r_i=0;
#pragma omp parallel for private(r_i, c_i, r, c) schedule(guided)
for (r_i=0; r_i < (block->re - block->rb); r_i++) {
r = block->rb + r_i;
c_i = 0;
if (block->triu) {
c = cbs[r_i];
} else {
c = block->cb;
}
for (; c<block->ce; c++) {
double value = dtw_distance_ndim(&matrix_r[r*nb_cols_r*ndim], nb_cols_r,
&matrix_c[c*nb_cols_c*ndim], nb_cols_c,
ndim, settings);
if (block->triu) {
output[rls[r_i] + c_i] = value;
} else {
output[(block->ce - block->cb) * r_i + c_i] = value;
}
c_i++;
}
}
if (block->triu) {
free(cbs);
free(rls);
}
return length;
#else
printf("ERROR: DTAIDistanceC is compiled without OpenMP support.\n");
for (r_i=0; r_i<length; r_i++) {
output[r_i] = 0;
}
return 0;
#endif
}
|
082308c24ae01ca68f314559ea47ea0c561427d6
|
d34971201b9b1aba0b5883508287fcbc72099363
|
/imagepipeline-native/src/main/jni/memchunk/NativeMemoryChunk.h
|
e9a2f6303cf4af049b0789f6de0e749fbef3747b
|
[
"MIT"
] |
permissive
|
facebook/fresco
|
6a9f7c9d501faaf8aefcdae6f495633659812b9f
|
8b7ebca781d0ab7029b0c77cc28fab7a0af08a9c
|
refs/heads/main
| 2023-09-05T03:35:16.680080
| 2023-09-04T17:08:32
| 2023-09-04T17:08:32
| 31,533,997
| 19,373
| 5,139
|
MIT
| 2023-09-14T18:34:31
| 2015-03-02T09:58:04
|
Java
|
UTF-8
|
C
| false
| false
| 413
|
h
|
NativeMemoryChunk.h
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef _NATIVE_MEMORY_CHUNK_H_
#define _NATIVE_MEMORY_CHUNK_H_
#ifdef __cplusplus
extern "C" {
#endif
jint registerNativeMemoryChunkMethods(JNIEnv* env);
#ifdef __cplusplus
}
#endif
#endif /* _NATIVE_MEMORY_CHUNK_H_ */
|
a143caf45098e72d30202f9ee6a5ac45c3b4ea10
|
b5c2f808cee8655a1a5fa15ea8a49c51a7b7ea46
|
/pkg2zip_aes_x86.c
|
a6963c102460a02b58a2fd40ff4e36b48eddd059
|
[
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-proprietary-license",
"Unlicense"
] |
permissive
|
lusid1/pkg2zip
|
df3a73135329faefab6e4ef0bd5dee0fd9fecc93
|
97a398523adc6090a5722289b35de76c015076c4
|
refs/heads/master
| 2023-07-09T02:20:40.695995
| 2023-01-11T19:54:12
| 2023-01-11T19:54:12
| 165,358,779
| 162
| 41
|
Unlicense
| 2023-06-25T01:27:25
| 2019-01-12T07:13:54
|
C
|
UTF-8
|
C
| false
| false
| 6,006
|
c
|
pkg2zip_aes_x86.c
|
#include "pkg2zip_aes.h"
#include <string.h>
#include <wmmintrin.h> // AESNI
#include <tmmintrin.h> // SSSE3
#define AES128_INIT(ctx, x, rcon) \
{ \
__m128i a, b; \
_mm_store_si128(ctx, x); \
a = _mm_aeskeygenassist_si128(x, rcon); \
a = _mm_shuffle_epi32(a, 0xff); \
b = _mm_slli_si128(x, 4); \
x = _mm_xor_si128(x, b); \
b = _mm_slli_si128(b, 4); \
x = _mm_xor_si128(x, b); \
b = _mm_slli_si128(b, 4); \
x = _mm_xor_si128(x, b); \
x = _mm_xor_si128(x, a); \
}
void aes128_init_x86(aes128_key* ctx, const uint8_t* key)
{
__m128i* ekey = (__m128i*)ctx->key;
__m128i x = _mm_loadu_si128((const __m128i*)key);
AES128_INIT(ekey + 0, x, 0x01);
AES128_INIT(ekey + 1, x, 0x02);
AES128_INIT(ekey + 2, x, 0x04);
AES128_INIT(ekey + 3, x, 0x08);
AES128_INIT(ekey + 4, x, 0x10);
AES128_INIT(ekey + 5, x, 0x20);
AES128_INIT(ekey + 6, x, 0x40);
AES128_INIT(ekey + 7, x, 0x80);
AES128_INIT(ekey + 8, x, 0x1b);
AES128_INIT(ekey + 9, x, 0x36);
_mm_store_si128(ekey + 10, x);
}
void aes128_init_dec_x86(aes128_key* ctx, const uint8_t* key)
{
aes128_key enc;
aes128_init_x86(&enc, key);
const __m128i* ekey = (__m128i*)&enc.key;
__m128i* dkey = (__m128i*)&ctx->key;
_mm_store_si128(dkey + 10, _mm_load_si128(ekey + 0));
for (size_t i = 1; i < 10; i++)
{
_mm_store_si128(dkey + 10 - i, _mm_aesimc_si128(_mm_load_si128(ekey + i)));
}
_mm_store_si128(dkey + 0, _mm_load_si128(ekey + 10));
}
static __m128i aes128_encrypt_x86(__m128i input, const __m128i* key)
{
__m128i tmp = _mm_xor_si128(input, _mm_load_si128(key + 0));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 1));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 2));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 3));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 4));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 5));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 6));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 7));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 8));
tmp = _mm_aesenc_si128(tmp, _mm_load_si128(key + 9));
return _mm_aesenclast_si128(tmp, _mm_load_si128(key + 10));
}
static __m128i aes128_decrypt_x86(__m128i input, const __m128i* key)
{
__m128i tmp = _mm_xor_si128(input, _mm_load_si128(key + 0));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 1));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 2));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 3));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 4));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 5));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 6));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 7));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 8));
tmp = _mm_aesdec_si128(tmp, _mm_load_si128(key + 9));
return _mm_aesdeclast_si128(tmp, _mm_load_si128(key + 10));
}
void aes128_ecb_encrypt_x86(const aes128_key* ctx, const uint8_t* input, uint8_t* output)
{
const __m128i* key = (__m128i*)ctx->key;
__m128i tmp = aes128_encrypt_x86(_mm_loadu_si128((const __m128i*)input), key);
_mm_storeu_si128((__m128i*)output, tmp);
}
void aes128_ecb_decrypt_x86(const aes128_key* ctx, const uint8_t* input, uint8_t* output)
{
const __m128i* key = (__m128i*)ctx->key;
__m128i tmp = aes128_decrypt_x86(_mm_loadu_si128((const __m128i*)input), key);
_mm_storeu_si128((__m128i*)output, tmp);
}
static __m128i ctr_increment(__m128i counter)
{
__m128i swap = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
__m128i tmp = _mm_shuffle_epi8(counter, swap);
tmp = _mm_add_epi64(tmp, _mm_set_epi32(0, 0, 0, 1));
return _mm_shuffle_epi8(tmp, swap);
}
void aes128_ctr_xor_x86(const aes128_key* ctx, const uint8_t* iv, uint8_t* buffer, size_t size)
{
const __m128i* key = (__m128i*)ctx->key;
__m128i counter = _mm_loadu_si128((const __m128i*)iv);
while (size >= 16)
{
__m128i block = aes128_encrypt_x86(counter, key);
__m128i tmp = _mm_xor_si128(_mm_loadu_si128((const __m128i*)buffer), block);
_mm_storeu_si128((__m128i*)buffer, tmp);
counter = ctr_increment(counter);
buffer += 16;
size -= 16;
}
if (size != 0)
{
uint8_t full[16];
memcpy(full, buffer, size);
memset(full + size, 0, 16 - size);
__m128i block = aes128_encrypt_x86(counter, key);
__m128i tmp = _mm_xor_si128(_mm_loadu_si128((const __m128i*)full), block);
_mm_storeu_si128((__m128i*)full, tmp);
memcpy(buffer, full, size);
}
}
void aes128_cmac_process_x86(const aes128_key* ctx, uint8_t* block, const uint8_t* buffer, uint32_t size)
{
const __m128i* key = (__m128i*)ctx->key;
__m128i* data = (__m128i*)buffer;
__m128i tmp = _mm_loadu_si128((__m128i*)block);
for (uint32_t i = 0; i < size; i += 16)
{
__m128i input = _mm_loadu_si128(data++);
tmp = _mm_xor_si128(tmp, input);
tmp = aes128_encrypt_x86(tmp, key);
}
_mm_storeu_si128((__m128i*)block, tmp);
}
void aes128_psp_decrypt_x86(const aes128_key* ctx, const uint8_t* prev, const uint8_t* block, uint8_t* buffer, uint32_t size)
{
const __m128i* key = (__m128i*)ctx->key;
__m128i one = _mm_setr_epi32(0, 0, 0, 1);
__m128i x = _mm_load_si128((__m128i*)prev);
__m128i y = _mm_load_si128((__m128i*)block);
__m128i* data = (__m128i*)buffer;
for (uint32_t i = 0; i < size; i += 16)
{
y = _mm_add_epi32(y, one);
__m128i out = aes128_decrypt_x86(y, key);
out = _mm_xor_si128(out, _mm_loadu_si128(data));
out = _mm_xor_si128(out, x);
_mm_storeu_si128(data++, out);
x = y;
}
}
|
1e38d0e9ee432fe734bf808c0d0f6e3328723199
|
e5a9df79c9f46c1b256a0049d52c6dc51a6cf45b
|
/pkg/unzip/config.h
|
5d254d27b4ab6ebb5ccaae14b9d81408da3d802e
|
[
"ISC"
] |
permissive
|
oasislinux/oasis
|
aabf2a11f568af399c12ead8dd5c2945df8f5b48
|
0ae82dcc8be1ff6e64186e5616419769c2adaaee
|
refs/heads/master
| 2023-08-28T22:45:59.642919
| 2023-08-25T20:09:09
| 2023-08-25T20:09:09
| 60,745,639
| 1,929
| 69
|
NOASSERTION
| 2023-08-25T20:39:37
| 2016-06-09T02:55:17
|
Roff
|
UTF-8
|
C
| false
| false
| 330
|
h
|
config.h
|
#define ACORN_FTYPE_NFS
#define DATE_FORMAT DF_YMD
#define IZ_HAVE_UXUIDGID
#define LARGE_FILE_SUPPORT
#define UNICODE_SUPPORT
#define UNICODE_WCHAR
#define UNIX
#define USE_BZIP2
#define UTF8_MAYBE_NATIVE
#define WILD_STOP_AT_DIR
/* why does Debian define these? */
#define NOMEMCPY
#define NO_LCHMOD
#define NO_WORKING_ISPRINT
|
e0c55dc18259db7bca2d395587e76c73d1c0f74e
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/x86/crypto/aesni-intel_glue.c
|
990c9699b6628b93c6dd5300b74aa197cc195976
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 38,603
|
c
|
aesni-intel_glue.c
|
/*
* Support for Intel AES-NI instructions. This file contains glue
* code, the real AES implementation is in intel-aes_asm.S.
*
* Copyright (C) 2008, Intel Corp.
* Author: Huang Ying <ying.huang@intel.com>
*
* Added RFC4106 AES-GCM support for 128-bit keys under the AEAD
* interface for 64-bit kernels.
* Authors: Adrian Hoban <adrian.hoban@intel.com>
* Gabriele Paoloni <gabriele.paoloni@intel.com>
* Tadeusz Struk (tadeusz.struk@intel.com)
* Aidan O'Mahony (aidan.o.mahony@intel.com)
* Copyright (c) 2010, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <linux/hardirq.h>
#include <linux/types.h>
#include <linux/crypto.h>
#include <linux/module.h>
#include <linux/err.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
#include <crypto/cryptd.h>
#include <crypto/ctr.h>
#include <crypto/b128ops.h>
#include <crypto/lrw.h>
#include <crypto/xts.h>
#include <asm/cpu_device_id.h>
#include <asm/i387.h>
#include <asm/crypto/aes.h>
#include <asm/crypto/ablk_helper.h>
#include <crypto/scatterwalk.h>
#include <crypto/internal/aead.h>
#include <linux/workqueue.h>
#include <linux/spinlock.h>
#ifdef CONFIG_X86_64
#include <asm/crypto/glue_helper.h>
#endif
#if defined(CONFIG_CRYPTO_PCBC) || defined(CONFIG_CRYPTO_PCBC_MODULE)
#define HAS_PCBC
#endif
/* This data is stored at the end of the crypto_tfm struct.
* It's a type of per "session" data storage location.
* This needs to be 16 byte aligned.
*/
struct aesni_rfc4106_gcm_ctx {
u8 hash_subkey[16];
struct crypto_aes_ctx aes_key_expanded;
u8 nonce[4];
struct cryptd_aead *cryptd_tfm;
};
struct aesni_gcm_set_hash_subkey_result {
int err;
struct completion completion;
};
struct aesni_hash_subkey_req_data {
u8 iv[16];
struct aesni_gcm_set_hash_subkey_result result;
struct scatterlist sg;
};
#define AESNI_ALIGN (16)
#define AES_BLOCK_MASK (~(AES_BLOCK_SIZE-1))
#define RFC4106_HASH_SUBKEY_SIZE 16
struct aesni_lrw_ctx {
struct lrw_table_ctx lrw_table;
u8 raw_aes_ctx[sizeof(struct crypto_aes_ctx) + AESNI_ALIGN - 1];
};
struct aesni_xts_ctx {
u8 raw_tweak_ctx[sizeof(struct crypto_aes_ctx) + AESNI_ALIGN - 1];
u8 raw_crypt_ctx[sizeof(struct crypto_aes_ctx) + AESNI_ALIGN - 1];
};
asmlinkage int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
unsigned int key_len);
asmlinkage void aesni_enc(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in);
asmlinkage void aesni_dec(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in);
asmlinkage void aesni_ecb_enc(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len);
asmlinkage void aesni_ecb_dec(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len);
asmlinkage void aesni_cbc_enc(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len, u8 *iv);
asmlinkage void aesni_cbc_dec(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len, u8 *iv);
int crypto_fpu_init(void);
void crypto_fpu_exit(void);
#ifdef CONFIG_X86_64
asmlinkage void aesni_ctr_enc(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len, u8 *iv);
asmlinkage void aesni_xts_crypt8(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, bool enc, u8 *iv);
/* asmlinkage void aesni_gcm_enc()
* void *ctx, AES Key schedule. Starts on a 16 byte boundary.
* u8 *out, Ciphertext output. Encrypt in-place is allowed.
* const u8 *in, Plaintext input
* unsigned long plaintext_len, Length of data in bytes for encryption.
* u8 *iv, Pre-counter block j0: 4 byte salt (from Security Association)
* concatenated with 8 byte Initialisation Vector (from IPSec ESP
* Payload) concatenated with 0x00000001. 16-byte aligned pointer.
* u8 *hash_subkey, the Hash sub key input. Data starts on a 16-byte boundary.
* const u8 *aad, Additional Authentication Data (AAD)
* unsigned long aad_len, Length of AAD in bytes. With RFC4106 this
* is going to be 8 or 12 bytes
* u8 *auth_tag, Authenticated Tag output.
* unsigned long auth_tag_len), Authenticated Tag Length in bytes.
* Valid values are 16 (most likely), 12 or 8.
*/
asmlinkage void aesni_gcm_enc(void *ctx, u8 *out,
const u8 *in, unsigned long plaintext_len, u8 *iv,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len);
/* asmlinkage void aesni_gcm_dec()
* void *ctx, AES Key schedule. Starts on a 16 byte boundary.
* u8 *out, Plaintext output. Decrypt in-place is allowed.
* const u8 *in, Ciphertext input
* unsigned long ciphertext_len, Length of data in bytes for decryption.
* u8 *iv, Pre-counter block j0: 4 byte salt (from Security Association)
* concatenated with 8 byte Initialisation Vector (from IPSec ESP
* Payload) concatenated with 0x00000001. 16-byte aligned pointer.
* u8 *hash_subkey, the Hash sub key input. Data starts on a 16-byte boundary.
* const u8 *aad, Additional Authentication Data (AAD)
* unsigned long aad_len, Length of AAD in bytes. With RFC4106 this is going
* to be 8 or 12 bytes
* u8 *auth_tag, Authenticated Tag output.
* unsigned long auth_tag_len) Authenticated Tag Length in bytes.
* Valid values are 16 (most likely), 12 or 8.
*/
asmlinkage void aesni_gcm_dec(void *ctx, u8 *out,
const u8 *in, unsigned long ciphertext_len, u8 *iv,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len);
static inline struct
aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm)
{
return
(struct aesni_rfc4106_gcm_ctx *)
PTR_ALIGN((u8 *)
crypto_tfm_ctx(crypto_aead_tfm(tfm)), AESNI_ALIGN);
}
#endif
static inline struct crypto_aes_ctx *aes_ctx(void *raw_ctx)
{
unsigned long addr = (unsigned long)raw_ctx;
unsigned long align = AESNI_ALIGN;
if (align <= crypto_tfm_ctx_alignment())
align = 1;
return (struct crypto_aes_ctx *)ALIGN(addr, align);
}
static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx,
const u8 *in_key, unsigned int key_len)
{
struct crypto_aes_ctx *ctx = aes_ctx(raw_ctx);
u32 *flags = &tfm->crt_flags;
int err;
if (key_len != AES_KEYSIZE_128 && key_len != AES_KEYSIZE_192 &&
key_len != AES_KEYSIZE_256) {
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
if (!irq_fpu_usable())
err = crypto_aes_expand_key(ctx, in_key, key_len);
else {
kernel_fpu_begin();
err = aesni_set_key(ctx, in_key, key_len);
kernel_fpu_end();
}
return err;
}
static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len)
{
return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len);
}
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
if (!irq_fpu_usable())
crypto_aes_encrypt_x86(ctx, dst, src);
else {
kernel_fpu_begin();
aesni_enc(ctx, dst, src);
kernel_fpu_end();
}
}
static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
if (!irq_fpu_usable())
crypto_aes_decrypt_x86(ctx, dst, src);
else {
kernel_fpu_begin();
aesni_dec(ctx, dst, src);
kernel_fpu_end();
}
}
static void __aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
aesni_enc(ctx, dst, src);
}
static void __aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
aesni_dec(ctx, dst, src);
}
static int ecb_encrypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
while ((nbytes = walk.nbytes)) {
aesni_ecb_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr,
nbytes & AES_BLOCK_MASK);
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
kernel_fpu_end();
return err;
}
static int ecb_decrypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
while ((nbytes = walk.nbytes)) {
aesni_ecb_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr,
nbytes & AES_BLOCK_MASK);
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
kernel_fpu_end();
return err;
}
static int cbc_encrypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
while ((nbytes = walk.nbytes)) {
aesni_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr,
nbytes & AES_BLOCK_MASK, walk.iv);
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
kernel_fpu_end();
return err;
}
static int cbc_decrypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
while ((nbytes = walk.nbytes)) {
aesni_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr,
nbytes & AES_BLOCK_MASK, walk.iv);
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
kernel_fpu_end();
return err;
}
#ifdef CONFIG_X86_64
static void ctr_crypt_final(struct crypto_aes_ctx *ctx,
struct blkcipher_walk *walk)
{
u8 *ctrblk = walk->iv;
u8 keystream[AES_BLOCK_SIZE];
u8 *src = walk->src.virt.addr;
u8 *dst = walk->dst.virt.addr;
unsigned int nbytes = walk->nbytes;
aesni_enc(ctx, keystream, ctrblk);
crypto_xor(keystream, src, nbytes);
memcpy(dst, keystream, nbytes);
crypto_inc(ctrblk, AES_BLOCK_SIZE);
}
static int ctr_crypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
{
struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
struct blkcipher_walk walk;
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
aesni_ctr_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr,
nbytes & AES_BLOCK_MASK, walk.iv);
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
if (walk.nbytes) {
ctr_crypt_final(ctx, &walk);
err = blkcipher_walk_done(desc, &walk, 0);
}
kernel_fpu_end();
return err;
}
#endif
static int ablk_ecb_init(struct crypto_tfm *tfm)
{
return ablk_init_common(tfm, "__driver-ecb-aes-aesni");
}
static int ablk_cbc_init(struct crypto_tfm *tfm)
{
return ablk_init_common(tfm, "__driver-cbc-aes-aesni");
}
#ifdef CONFIG_X86_64
static int ablk_ctr_init(struct crypto_tfm *tfm)
{
return ablk_init_common(tfm, "__driver-ctr-aes-aesni");
}
#endif
#ifdef HAS_PCBC
static int ablk_pcbc_init(struct crypto_tfm *tfm)
{
return ablk_init_common(tfm, "fpu(pcbc(__driver-aes-aesni))");
}
#endif
static void lrw_xts_encrypt_callback(void *ctx, u8 *blks, unsigned int nbytes)
{
aesni_ecb_enc(ctx, blks, blks, nbytes);
}
static void lrw_xts_decrypt_callback(void *ctx, u8 *blks, unsigned int nbytes)
{
aesni_ecb_dec(ctx, blks, blks, nbytes);
}
static int lrw_aesni_setkey(struct crypto_tfm *tfm, const u8 *key,
unsigned int keylen)
{
struct aesni_lrw_ctx *ctx = crypto_tfm_ctx(tfm);
int err;
err = aes_set_key_common(tfm, ctx->raw_aes_ctx, key,
keylen - AES_BLOCK_SIZE);
if (err)
return err;
return lrw_init_table(&ctx->lrw_table, key + keylen - AES_BLOCK_SIZE);
}
static void lrw_aesni_exit_tfm(struct crypto_tfm *tfm)
{
struct aesni_lrw_ctx *ctx = crypto_tfm_ctx(tfm);
lrw_free_table(&ctx->lrw_table);
}
static int lrw_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
be128 buf[8];
struct lrw_crypt_req req = {
.tbuf = buf,
.tbuflen = sizeof(buf),
.table_ctx = &ctx->lrw_table,
.crypt_ctx = aes_ctx(ctx->raw_aes_ctx),
.crypt_fn = lrw_xts_encrypt_callback,
};
int ret;
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
ret = lrw_crypt(desc, dst, src, nbytes, &req);
kernel_fpu_end();
return ret;
}
static int lrw_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
be128 buf[8];
struct lrw_crypt_req req = {
.tbuf = buf,
.tbuflen = sizeof(buf),
.table_ctx = &ctx->lrw_table,
.crypt_ctx = aes_ctx(ctx->raw_aes_ctx),
.crypt_fn = lrw_xts_decrypt_callback,
};
int ret;
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
ret = lrw_crypt(desc, dst, src, nbytes, &req);
kernel_fpu_end();
return ret;
}
static int xts_aesni_setkey(struct crypto_tfm *tfm, const u8 *key,
unsigned int keylen)
{
struct aesni_xts_ctx *ctx = crypto_tfm_ctx(tfm);
u32 *flags = &tfm->crt_flags;
int err;
/* key consists of keys of equal size concatenated, therefore
* the length must be even
*/
if (keylen % 2) {
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
/* first half of xts-key is for crypt */
err = aes_set_key_common(tfm, ctx->raw_crypt_ctx, key, keylen / 2);
if (err)
return err;
/* second half of xts-key is for tweak */
return aes_set_key_common(tfm, ctx->raw_tweak_ctx, key + keylen / 2,
keylen / 2);
}
static void aesni_xts_tweak(void *ctx, u8 *out, const u8 *in)
{
aesni_enc(ctx, out, in);
}
#ifdef CONFIG_X86_64
static void aesni_xts_enc(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
glue_xts_crypt_128bit_one(ctx, dst, src, iv, GLUE_FUNC_CAST(aesni_enc));
}
static void aesni_xts_dec(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
glue_xts_crypt_128bit_one(ctx, dst, src, iv, GLUE_FUNC_CAST(aesni_dec));
}
static void aesni_xts_enc8(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
aesni_xts_crypt8(ctx, (u8 *)dst, (const u8 *)src, true, (u8 *)iv);
}
static void aesni_xts_dec8(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
aesni_xts_crypt8(ctx, (u8 *)dst, (const u8 *)src, false, (u8 *)iv);
}
static const struct common_glue_ctx aesni_enc_xts = {
.num_funcs = 2,
.fpu_blocks_limit = 1,
.funcs = { {
.num_blocks = 8,
.fn_u = { .xts = GLUE_XTS_FUNC_CAST(aesni_xts_enc8) }
}, {
.num_blocks = 1,
.fn_u = { .xts = GLUE_XTS_FUNC_CAST(aesni_xts_enc) }
} }
};
static const struct common_glue_ctx aesni_dec_xts = {
.num_funcs = 2,
.fpu_blocks_limit = 1,
.funcs = { {
.num_blocks = 8,
.fn_u = { .xts = GLUE_XTS_FUNC_CAST(aesni_xts_dec8) }
}, {
.num_blocks = 1,
.fn_u = { .xts = GLUE_XTS_FUNC_CAST(aesni_xts_dec) }
} }
};
static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
return glue_xts_crypt_128bit(&aesni_enc_xts, desc, dst, src, nbytes,
XTS_TWEAK_CAST(aesni_xts_tweak),
aes_ctx(ctx->raw_tweak_ctx),
aes_ctx(ctx->raw_crypt_ctx));
}
static int xts_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
return glue_xts_crypt_128bit(&aesni_dec_xts, desc, dst, src, nbytes,
XTS_TWEAK_CAST(aesni_xts_tweak),
aes_ctx(ctx->raw_tweak_ctx),
aes_ctx(ctx->raw_crypt_ctx));
}
#else
static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
be128 buf[8];
struct xts_crypt_req req = {
.tbuf = buf,
.tbuflen = sizeof(buf),
.tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
.tweak_fn = aesni_xts_tweak,
.crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
.crypt_fn = lrw_xts_encrypt_callback,
};
int ret;
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
ret = xts_crypt(desc, dst, src, nbytes, &req);
kernel_fpu_end();
return ret;
}
static int xts_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
be128 buf[8];
struct xts_crypt_req req = {
.tbuf = buf,
.tbuflen = sizeof(buf),
.tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
.tweak_fn = aesni_xts_tweak,
.crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
.crypt_fn = lrw_xts_decrypt_callback,
};
int ret;
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
kernel_fpu_begin();
ret = xts_crypt(desc, dst, src, nbytes, &req);
kernel_fpu_end();
return ret;
}
#endif
#ifdef CONFIG_X86_64
static int rfc4106_init(struct crypto_tfm *tfm)
{
struct cryptd_aead *cryptd_tfm;
struct aesni_rfc4106_gcm_ctx *ctx = (struct aesni_rfc4106_gcm_ctx *)
PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN);
struct crypto_aead *cryptd_child;
struct aesni_rfc4106_gcm_ctx *child_ctx;
cryptd_tfm = cryptd_alloc_aead("__driver-gcm-aes-aesni", 0, 0);
if (IS_ERR(cryptd_tfm))
return PTR_ERR(cryptd_tfm);
cryptd_child = cryptd_aead_child(cryptd_tfm);
child_ctx = aesni_rfc4106_gcm_ctx_get(cryptd_child);
memcpy(child_ctx, ctx, sizeof(*ctx));
ctx->cryptd_tfm = cryptd_tfm;
tfm->crt_aead.reqsize = sizeof(struct aead_request)
+ crypto_aead_reqsize(&cryptd_tfm->base);
return 0;
}
static void rfc4106_exit(struct crypto_tfm *tfm)
{
struct aesni_rfc4106_gcm_ctx *ctx =
(struct aesni_rfc4106_gcm_ctx *)
PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN);
if (!IS_ERR(ctx->cryptd_tfm))
cryptd_free_aead(ctx->cryptd_tfm);
return;
}
static void
rfc4106_set_hash_subkey_done(struct crypto_async_request *req, int err)
{
struct aesni_gcm_set_hash_subkey_result *result = req->data;
if (err == -EINPROGRESS)
return;
result->err = err;
complete(&result->completion);
}
static int
rfc4106_set_hash_subkey(u8 *hash_subkey, const u8 *key, unsigned int key_len)
{
struct crypto_ablkcipher *ctr_tfm;
struct ablkcipher_request *req;
int ret = -EINVAL;
struct aesni_hash_subkey_req_data *req_data;
ctr_tfm = crypto_alloc_ablkcipher("ctr(aes)", 0, 0);
if (IS_ERR(ctr_tfm))
return PTR_ERR(ctr_tfm);
crypto_ablkcipher_clear_flags(ctr_tfm, ~0);
ret = crypto_ablkcipher_setkey(ctr_tfm, key, key_len);
if (ret)
goto out_free_ablkcipher;
ret = -ENOMEM;
req = ablkcipher_request_alloc(ctr_tfm, GFP_KERNEL);
if (!req)
goto out_free_ablkcipher;
req_data = kmalloc(sizeof(*req_data), GFP_KERNEL);
if (!req_data)
goto out_free_request;
memset(req_data->iv, 0, sizeof(req_data->iv));
/* Clear the data in the hash sub key container to zero.*/
/* We want to cipher all zeros to create the hash sub key. */
memset(hash_subkey, 0, RFC4106_HASH_SUBKEY_SIZE);
init_completion(&req_data->result.completion);
sg_init_one(&req_data->sg, hash_subkey, RFC4106_HASH_SUBKEY_SIZE);
ablkcipher_request_set_tfm(req, ctr_tfm);
ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP |
CRYPTO_TFM_REQ_MAY_BACKLOG,
rfc4106_set_hash_subkey_done,
&req_data->result);
ablkcipher_request_set_crypt(req, &req_data->sg,
&req_data->sg, RFC4106_HASH_SUBKEY_SIZE, req_data->iv);
ret = crypto_ablkcipher_encrypt(req);
if (ret == -EINPROGRESS || ret == -EBUSY) {
ret = wait_for_completion_interruptible
(&req_data->result.completion);
if (!ret)
ret = req_data->result.err;
}
kfree(req_data);
out_free_request:
ablkcipher_request_free(req);
out_free_ablkcipher:
crypto_free_ablkcipher(ctr_tfm);
return ret;
}
static int rfc4106_set_key(struct crypto_aead *parent, const u8 *key,
unsigned int key_len)
{
int ret = 0;
struct crypto_tfm *tfm = crypto_aead_tfm(parent);
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(parent);
struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
struct aesni_rfc4106_gcm_ctx *child_ctx =
aesni_rfc4106_gcm_ctx_get(cryptd_child);
u8 *new_key_align, *new_key_mem = NULL;
if (key_len < 4) {
crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
/*Account for 4 byte nonce at the end.*/
key_len -= 4;
if (key_len != AES_KEYSIZE_128) {
crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
memcpy(ctx->nonce, key + key_len, sizeof(ctx->nonce));
/*This must be on a 16 byte boundary!*/
if ((unsigned long)(&(ctx->aes_key_expanded.key_enc[0])) % AESNI_ALIGN)
return -EINVAL;
if ((unsigned long)key % AESNI_ALIGN) {
/*key is not aligned: use an auxuliar aligned pointer*/
new_key_mem = kmalloc(key_len+AESNI_ALIGN, GFP_KERNEL);
if (!new_key_mem)
return -ENOMEM;
new_key_align = PTR_ALIGN(new_key_mem, AESNI_ALIGN);
memcpy(new_key_align, key, key_len);
key = new_key_align;
}
if (!irq_fpu_usable())
ret = crypto_aes_expand_key(&(ctx->aes_key_expanded),
key, key_len);
else {
kernel_fpu_begin();
ret = aesni_set_key(&(ctx->aes_key_expanded), key, key_len);
kernel_fpu_end();
}
/*This must be on a 16 byte boundary!*/
if ((unsigned long)(&(ctx->hash_subkey[0])) % AESNI_ALIGN) {
ret = -EINVAL;
goto exit;
}
ret = rfc4106_set_hash_subkey(ctx->hash_subkey, key, key_len);
memcpy(child_ctx, ctx, sizeof(*ctx));
exit:
kfree(new_key_mem);
return ret;
}
/* This is the Integrity Check Value (aka the authentication tag length and can
* be 8, 12 or 16 bytes long. */
static int rfc4106_set_authsize(struct crypto_aead *parent,
unsigned int authsize)
{
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(parent);
struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
switch (authsize) {
case 8:
case 12:
case 16:
break;
default:
return -EINVAL;
}
crypto_aead_crt(parent)->authsize = authsize;
crypto_aead_crt(cryptd_child)->authsize = authsize;
return 0;
}
static int rfc4106_encrypt(struct aead_request *req)
{
int ret;
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
if (!irq_fpu_usable()) {
struct aead_request *cryptd_req =
(struct aead_request *) aead_request_ctx(req);
memcpy(cryptd_req, req, sizeof(*req));
aead_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
return crypto_aead_encrypt(cryptd_req);
} else {
struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
kernel_fpu_begin();
ret = cryptd_child->base.crt_aead.encrypt(req);
kernel_fpu_end();
return ret;
}
}
static int rfc4106_decrypt(struct aead_request *req)
{
int ret;
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
if (!irq_fpu_usable()) {
struct aead_request *cryptd_req =
(struct aead_request *) aead_request_ctx(req);
memcpy(cryptd_req, req, sizeof(*req));
aead_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
return crypto_aead_decrypt(cryptd_req);
} else {
struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
kernel_fpu_begin();
ret = cryptd_child->base.crt_aead.decrypt(req);
kernel_fpu_end();
return ret;
}
}
static int __driver_rfc4106_encrypt(struct aead_request *req)
{
u8 one_entry_in_sg = 0;
u8 *src, *dst, *assoc;
__be32 counter = cpu_to_be32(1);
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
void *aes_ctx = &(ctx->aes_key_expanded);
unsigned long auth_tag_len = crypto_aead_authsize(tfm);
u8 iv_tab[16+AESNI_ALIGN];
u8* iv = (u8 *) PTR_ALIGN((u8 *)iv_tab, AESNI_ALIGN);
struct scatter_walk src_sg_walk;
struct scatter_walk assoc_sg_walk;
struct scatter_walk dst_sg_walk;
unsigned int i;
/* Assuming we are supporting rfc4106 64-bit extended */
/* sequence numbers We need to have the AAD length equal */
/* to 8 or 12 bytes */
if (unlikely(req->assoclen != 8 && req->assoclen != 12))
return -EINVAL;
/* IV below built */
for (i = 0; i < 4; i++)
*(iv+i) = ctx->nonce[i];
for (i = 0; i < 8; i++)
*(iv+4+i) = req->iv[i];
*((__be32 *)(iv+12)) = counter;
if ((sg_is_last(req->src)) && (sg_is_last(req->assoc))) {
one_entry_in_sg = 1;
scatterwalk_start(&src_sg_walk, req->src);
scatterwalk_start(&assoc_sg_walk, req->assoc);
src = scatterwalk_map(&src_sg_walk);
assoc = scatterwalk_map(&assoc_sg_walk);
dst = src;
if (unlikely(req->src != req->dst)) {
scatterwalk_start(&dst_sg_walk, req->dst);
dst = scatterwalk_map(&dst_sg_walk);
}
} else {
/* Allocate memory for src, dst, assoc */
src = kmalloc(req->cryptlen + auth_tag_len + req->assoclen,
GFP_ATOMIC);
if (unlikely(!src))
return -ENOMEM;
assoc = (src + req->cryptlen + auth_tag_len);
scatterwalk_map_and_copy(src, req->src, 0, req->cryptlen, 0);
scatterwalk_map_and_copy(assoc, req->assoc, 0,
req->assoclen, 0);
dst = src;
}
aesni_gcm_enc(aes_ctx, dst, src, (unsigned long)req->cryptlen, iv,
ctx->hash_subkey, assoc, (unsigned long)req->assoclen, dst
+ ((unsigned long)req->cryptlen), auth_tag_len);
/* The authTag (aka the Integrity Check Value) needs to be written
* back to the packet. */
if (one_entry_in_sg) {
if (unlikely(req->src != req->dst)) {
scatterwalk_unmap(dst);
scatterwalk_done(&dst_sg_walk, 0, 0);
}
scatterwalk_unmap(src);
scatterwalk_unmap(assoc);
scatterwalk_done(&src_sg_walk, 0, 0);
scatterwalk_done(&assoc_sg_walk, 0, 0);
} else {
scatterwalk_map_and_copy(dst, req->dst, 0,
req->cryptlen + auth_tag_len, 1);
kfree(src);
}
return 0;
}
static int __driver_rfc4106_decrypt(struct aead_request *req)
{
u8 one_entry_in_sg = 0;
u8 *src, *dst, *assoc;
unsigned long tempCipherLen = 0;
__be32 counter = cpu_to_be32(1);
int retval = 0;
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
void *aes_ctx = &(ctx->aes_key_expanded);
unsigned long auth_tag_len = crypto_aead_authsize(tfm);
u8 iv_and_authTag[32+AESNI_ALIGN];
u8 *iv = (u8 *) PTR_ALIGN((u8 *)iv_and_authTag, AESNI_ALIGN);
u8 *authTag = iv + 16;
struct scatter_walk src_sg_walk;
struct scatter_walk assoc_sg_walk;
struct scatter_walk dst_sg_walk;
unsigned int i;
if (unlikely((req->cryptlen < auth_tag_len) ||
(req->assoclen != 8 && req->assoclen != 12)))
return -EINVAL;
/* Assuming we are supporting rfc4106 64-bit extended */
/* sequence numbers We need to have the AAD length */
/* equal to 8 or 12 bytes */
tempCipherLen = (unsigned long)(req->cryptlen - auth_tag_len);
/* IV below built */
for (i = 0; i < 4; i++)
*(iv+i) = ctx->nonce[i];
for (i = 0; i < 8; i++)
*(iv+4+i) = req->iv[i];
*((__be32 *)(iv+12)) = counter;
if ((sg_is_last(req->src)) && (sg_is_last(req->assoc))) {
one_entry_in_sg = 1;
scatterwalk_start(&src_sg_walk, req->src);
scatterwalk_start(&assoc_sg_walk, req->assoc);
src = scatterwalk_map(&src_sg_walk);
assoc = scatterwalk_map(&assoc_sg_walk);
dst = src;
if (unlikely(req->src != req->dst)) {
scatterwalk_start(&dst_sg_walk, req->dst);
dst = scatterwalk_map(&dst_sg_walk);
}
} else {
/* Allocate memory for src, dst, assoc */
src = kmalloc(req->cryptlen + req->assoclen, GFP_ATOMIC);
if (!src)
return -ENOMEM;
assoc = (src + req->cryptlen);
scatterwalk_map_and_copy(src, req->src, 0, req->cryptlen, 0);
scatterwalk_map_and_copy(assoc, req->assoc, 0,
req->assoclen, 0);
dst = src;
}
aesni_gcm_dec(aes_ctx, dst, src, tempCipherLen, iv,
ctx->hash_subkey, assoc, (unsigned long)req->assoclen,
authTag, auth_tag_len);
/* Compare generated tag with passed in tag. */
retval = memcmp(src + tempCipherLen, authTag, auth_tag_len) ?
-EBADMSG : 0;
if (one_entry_in_sg) {
if (unlikely(req->src != req->dst)) {
scatterwalk_unmap(dst);
scatterwalk_done(&dst_sg_walk, 0, 0);
}
scatterwalk_unmap(src);
scatterwalk_unmap(assoc);
scatterwalk_done(&src_sg_walk, 0, 0);
scatterwalk_done(&assoc_sg_walk, 0, 0);
} else {
scatterwalk_map_and_copy(dst, req->dst, 0, tempCipherLen, 1);
kfree(src);
}
return retval;
}
#endif
static struct crypto_alg aesni_algs[] = { {
.cra_name = "aes",
.cra_driver_name = "aes-aesni",
.cra_priority = 300,
.cra_flags = CRYPTO_ALG_TYPE_CIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1,
.cra_alignmask = 0,
.cra_module = THIS_MODULE,
.cra_u = {
.cipher = {
.cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = aes_set_key,
.cia_encrypt = aes_encrypt,
.cia_decrypt = aes_decrypt
}
}
}, {
.cra_name = "__aes-aesni",
.cra_driver_name = "__driver-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_CIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1,
.cra_alignmask = 0,
.cra_module = THIS_MODULE,
.cra_u = {
.cipher = {
.cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = aes_set_key,
.cia_encrypt = __aes_encrypt,
.cia_decrypt = __aes_decrypt
}
}
}, {
.cra_name = "__ecb-aes-aesni",
.cra_driver_name = "__driver-ecb-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1,
.cra_alignmask = 0,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.setkey = aes_set_key,
.encrypt = ecb_encrypt,
.decrypt = ecb_decrypt,
},
},
}, {
.cra_name = "__cbc-aes-aesni",
.cra_driver_name = "__driver-cbc-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1,
.cra_alignmask = 0,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.setkey = aes_set_key,
.encrypt = cbc_encrypt,
.decrypt = cbc_decrypt,
},
},
}, {
.cra_name = "ecb(aes)",
.cra_driver_name = "ecb-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_ecb_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_decrypt,
},
},
}, {
.cra_name = "cbc(aes)",
.cra_driver_name = "cbc-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_cbc_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_decrypt,
},
},
#ifdef CONFIG_X86_64
}, {
.cra_name = "__ctr-aes-aesni",
.cra_driver_name = "__driver-ctr-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct crypto_aes_ctx) +
AESNI_ALIGN - 1,
.cra_alignmask = 0,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = aes_set_key,
.encrypt = ctr_crypt,
.decrypt = ctr_crypt,
},
},
}, {
.cra_name = "ctr(aes)",
.cra_driver_name = "ctr-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_ctr_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_encrypt,
.geniv = "chainiv",
},
},
}, {
.cra_name = "__gcm-aes-aesni",
.cra_driver_name = "__driver-gcm-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_AEAD,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct aesni_rfc4106_gcm_ctx) +
AESNI_ALIGN,
.cra_alignmask = 0,
.cra_type = &crypto_aead_type,
.cra_module = THIS_MODULE,
.cra_u = {
.aead = {
.encrypt = __driver_rfc4106_encrypt,
.decrypt = __driver_rfc4106_decrypt,
},
},
}, {
.cra_name = "rfc4106(gcm(aes))",
.cra_driver_name = "rfc4106-gcm-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct aesni_rfc4106_gcm_ctx) +
AESNI_ALIGN,
.cra_alignmask = 0,
.cra_type = &crypto_nivaead_type,
.cra_module = THIS_MODULE,
.cra_init = rfc4106_init,
.cra_exit = rfc4106_exit,
.cra_u = {
.aead = {
.setkey = rfc4106_set_key,
.setauthsize = rfc4106_set_authsize,
.encrypt = rfc4106_encrypt,
.decrypt = rfc4106_decrypt,
.geniv = "seqiv",
.ivsize = 8,
.maxauthsize = 16,
},
},
#endif
#ifdef HAS_PCBC
}, {
.cra_name = "pcbc(aes)",
.cra_driver_name = "pcbc-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_pcbc_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_decrypt,
},
},
#endif
}, {
.cra_name = "__lrw-aes-aesni",
.cra_driver_name = "__driver-lrw-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct aesni_lrw_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
.cra_exit = lrw_aesni_exit_tfm,
.cra_u = {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE + AES_BLOCK_SIZE,
.max_keysize = AES_MAX_KEY_SIZE + AES_BLOCK_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = lrw_aesni_setkey,
.encrypt = lrw_encrypt,
.decrypt = lrw_decrypt,
},
},
}, {
.cra_name = "__xts-aes-aesni",
.cra_driver_name = "__driver-xts-aes-aesni",
.cra_priority = 0,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct aesni_xts_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
.cra_u = {
.blkcipher = {
.min_keysize = 2 * AES_MIN_KEY_SIZE,
.max_keysize = 2 * AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = xts_aesni_setkey,
.encrypt = xts_encrypt,
.decrypt = xts_decrypt,
},
},
}, {
.cra_name = "lrw(aes)",
.cra_driver_name = "lrw-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE + AES_BLOCK_SIZE,
.max_keysize = AES_MAX_KEY_SIZE + AES_BLOCK_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_decrypt,
},
},
}, {
.cra_name = "xts(aes)",
.cra_driver_name = "xts-aes-aesni",
.cra_priority = 400,
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct async_helper_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = ablk_init,
.cra_exit = ablk_exit,
.cra_u = {
.ablkcipher = {
.min_keysize = 2 * AES_MIN_KEY_SIZE,
.max_keysize = 2 * AES_MAX_KEY_SIZE,
.ivsize = AES_BLOCK_SIZE,
.setkey = ablk_set_key,
.encrypt = ablk_encrypt,
.decrypt = ablk_decrypt,
},
},
} };
static const struct x86_cpu_id aesni_cpu_id[] = {
X86_FEATURE_MATCH(X86_FEATURE_AES),
{}
};
MODULE_DEVICE_TABLE(x86cpu, aesni_cpu_id);
static int __init aesni_init(void)
{
int err;
if (!x86_match_cpu(aesni_cpu_id))
return -ENODEV;
err = crypto_fpu_init();
if (err)
return err;
return crypto_register_algs(aesni_algs, ARRAY_SIZE(aesni_algs));
}
static void __exit aesni_exit(void)
{
crypto_unregister_algs(aesni_algs, ARRAY_SIZE(aesni_algs));
crypto_fpu_exit();
}
module_init(aesni_init);
module_exit(aesni_exit);
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CRYPTO("aes");
|
429b395df57fa07e51aa98c11e3ed5b54c33bbc2
|
060bc5ba9a8f707bdac927f30842febf9a4676a1
|
/contrib/tests/benchmarks/valloc.c
|
a3bd8e866e8825d149d6573eb657f75847c50d1c
|
[
"BSD-4-Clause-UC",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
sergev/LiteBSD
|
14ae93caa709d4707c3b122c243641c8214583c3
|
6f89c18880065a83d3d18661c80f72fb3397a888
|
refs/heads/master
| 2023-01-10T02:20:05.357875
| 2022-07-19T16:41:32
| 2022-07-19T16:41:32
| 19,167,171
| 318
| 58
|
NOASSERTION
| 2022-12-28T16:23:01
| 2014-04-26T02:55:34
|
C
|
UTF-8
|
C
| false
| false
| 312
|
c
|
valloc.c
|
char *
valloc(npages, pagesize)
int npages;
register int pagesize;
{
int off;
char *base, *sbrk();
base = sbrk(0);
off = (int)base & (pagesize - 1);
if (off) {
(void) sbrk(pagesize - off);
base += pagesize - off;
}
if (sbrk(npages * pagesize) == (char *)-1)
return ((char *)0);
return (base);
}
|
eeae35c51acf5fb80d9fd7a22b51f0bef0f7d0be
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/arm/imx/imx23_digctl.c
|
2f44da9ba1e5fb0c88b29fa6e7b20c2ba15ae96a
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 4,896
|
c
|
imx23_digctl.c
|
/* $Id: imx23_digctl.c,v 1.2 2019/10/18 04:09:01 msaitoh Exp $ */
/*
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Petri Laakso.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/bus.h>
#include <sys/cdefs.h>
#include <sys/device.h>
#include <sys/errno.h>
#include <sys/timetc.h>
#include <arm/imx/imx23_digctlreg.h>
#include <arm/imx/imx23_digctlvar.h>
#include <arm/imx/imx23var.h>
typedef struct digctl_softc {
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_hdl;
} *digctl_softc_t;
static int digctl_match(device_t, cfdata_t, void *);
static void digctl_attach(device_t, device_t, void *);
static int digctl_activate(device_t, enum devact);
static void digctl_reset(struct digctl_softc *);
static void digctl_init(struct digctl_softc *);
/* timecounter. */
static u_int digctl_tc_get_timecount(struct timecounter *);
static digctl_softc_t _sc = NULL;
CFATTACH_DECL3_NEW(digctl,
sizeof(struct digctl_softc),
digctl_match,
digctl_attach,
NULL,
digctl_activate,
NULL,
NULL,
0
);
static struct timecounter tc_useconds;
#define DCTL_RD(sc, reg) \
bus_space_read_4(sc->sc_iot, sc->sc_hdl, (reg))
#define DCTL_WR(sc, reg, val) \
bus_space_write_4(sc->sc_iot, sc->sc_hdl, (reg), (val))
static int
digctl_match(device_t parent, cfdata_t match, void *aux)
{
struct apb_attach_args *aa = aux;
if ((aa->aa_addr == HW_DIGCTL_BASE) && (aa->aa_size == HW_DIGCTL_SIZE))
return 1;
return 0;
}
static void
digctl_attach(device_t parent, device_t self, void *aux)
{
struct digctl_softc *sc = device_private(self);
struct apb_attach_args *aa = aux;
static int digctl_attached = 0;
sc->sc_dev = self;
sc->sc_iot = aa->aa_iot;
if (digctl_attached) {
aprint_error_dev(sc->sc_dev, "already attached\n");
return;
}
if (bus_space_map(sc->sc_iot, aa->aa_addr, aa->aa_size, 0,
&sc->sc_hdl))
{
aprint_error_dev(sc->sc_dev, "Unable to map bus space\n");
return;
}
digctl_reset(sc);
digctl_init(sc);
aprint_normal("\n");
/*
* Setup timecounter to use digctl microseconds counter.
*/
tc_useconds.tc_get_timecount = digctl_tc_get_timecount;
tc_useconds.tc_poll_pps = NULL;
tc_useconds.tc_counter_mask = 0xffffffff; /* 32bit counter. */
tc_useconds.tc_frequency = 1000000; /* @ 1MHz */
tc_useconds.tc_name = "digctl";
tc_useconds.tc_quality = 100;
/* Enable counter. */
DCTL_WR(sc, HW_DIGCTL_CTRL_CLR, HW_DIGCTL_CTRL_XTAL24M_GATE);
tc_init(&tc_useconds);
digctl_attached = 1;
return;
}
static int
digctl_activate(device_t self, enum devact act)
{
return EOPNOTSUPP;
}
/*
* Inspired by i.MX23 RM "39.3.10 Correct Way to Soft Reset a Block"
*/
static void
digctl_reset(struct digctl_softc *sc)
{
return;
}
static void
digctl_init(struct digctl_softc *sc)
{
_sc = sc;
return;
}
/*
* Control USB controller clocks.
*/
void
digctl_usb_clkgate(int value)
{
struct digctl_softc *sc = _sc;
if (sc == NULL) {
aprint_error("digctl is not initialized");
return;
}
if (value) {
/* Clocks OFF. */
DCTL_WR(sc, HW_DIGCTL_CTRL_SET, HW_DIGCTL_CTRL_USB_CLKGATE);
} else {
/* Clocks ON. */
DCTL_WR(sc, HW_DIGCTL_CTRL_CLR, HW_DIGCTL_CTRL_USB_CLKGATE);
}
return;
}
/*
*
*/
static u_int
digctl_tc_get_timecount(struct timecounter *tc)
{
struct digctl_softc *sc = _sc;
return DCTL_RD(sc, HW_DIGCTL_MICROSECONDS);
}
|
88c28b22832a8ec6d17d41c59536f0b4004d2e95
|
b6acd6eed2b8946c1c1e19fa30081cbab0a2954f
|
/starry_io/Project/ppm_capture.h
|
70b340da2b0e274919682c32d593049760a2b674
|
[
"BSD-3-Clause"
] |
permissive
|
JcZou/StarryPilot
|
7ce1ed454f133ccd30d71916811e2bf23196d2eb
|
97af0338a54e1eeece877c72222aeaf4b7e80ad7
|
refs/heads/master
| 2023-03-12T19:10:17.225314
| 2021-11-27T19:44:26
| 2021-11-27T19:44:26
| 137,048,745
| 304
| 172
|
BSD-3-Clause
| 2020-08-26T07:34:49
| 2018-06-12T09:27:59
|
C
|
UTF-8
|
C
| false
| false
| 860
|
h
|
ppm_capture.h
|
/**
******************************************************************************
* @file ppm_capture.h
* @author J Zou
* @version V1.0
* @date 16-Feb-2017
* @brief PPM Decoder
******************************************************************************
*/
#ifndef _PPM_CAPTURE_H_
#define _PPM_CAPTURE_H_
#include "stm32f10x.h"
enum
{
STA_EDGE_1 = 0,
STA_EDGE_2,
STA_EDGE_3,
STA_EDGE_4,
STA_EDGE_5,
STA_EDGE_6,
STA_EDGE_7,
STA_EDGE_8,
STA_EDGE_9
};
typedef struct
{
uint8_t status;
uint8_t bad_frame;
uint16_t last_ic;
uint32_t ppm_val[8]; /* ppm raw value in microseconds */
}ppm_status_machine_param;
uint8_t ppm_capture_init(void);
void get_ppm_value(uint32_t val[8]);
uint8_t ppm_ready(void);
void ppm_clear_ready(void);
uint8_t send_ppm_value(void);
uint8_t config_ppm_send_freq(uint8_t freq);
#endif
|
45ce9d7ec906819cfd3a5ca910d0add0e72e4447
|
c8b39acfd4a857dc15ed3375e0d93e75fa3f1f64
|
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/src/H5Tpublic.h
|
d646ef1e887e048fdf6a5de709e2bd6db4f45519
|
[
"MIT",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
windystrife/UnrealEngine_NVIDIAGameWorks
|
c3c7863083653caf1bc67d3ef104fb4b9f302e2a
|
b50e6338a7c5b26374d66306ebc7807541ff815e
|
refs/heads/4.18-GameWorks
| 2023-03-11T02:50:08.471040
| 2022-01-13T20:50:29
| 2022-01-13T20:50:29
| 124,100,479
| 262
| 179
|
MIT
| 2022-12-16T05:36:38
| 2018-03-06T15:44:09
|
C++
|
UTF-8
|
C
| false
| false
| 27,329
|
h
|
H5Tpublic.h
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains public declarations for the H5T module.
*/
#ifndef _H5Tpublic_H
#define _H5Tpublic_H
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
#define HOFFSET(S,M) (offsetof(S,M))
/* These are the various classes of datatypes */
/* If this goes over 16 types (0-15), the file format will need to change) */
typedef enum H5T_class_t {
H5T_NO_CLASS = -1, /*error */
H5T_INTEGER = 0, /*integer types */
H5T_FLOAT = 1, /*floating-point types */
H5T_TIME = 2, /*date and time types */
H5T_STRING = 3, /*character string types */
H5T_BITFIELD = 4, /*bit field types */
H5T_OPAQUE = 5, /*opaque types */
H5T_COMPOUND = 6, /*compound types */
H5T_REFERENCE = 7, /*reference types */
H5T_ENUM = 8, /*enumeration types */
H5T_VLEN = 9, /*Variable-Length types */
H5T_ARRAY = 10, /*Array types */
H5T_NCLASSES /*this must be last */
} H5T_class_t;
/* Byte orders */
typedef enum H5T_order_t {
H5T_ORDER_ERROR = -1, /*error */
H5T_ORDER_LE = 0, /*little endian */
H5T_ORDER_BE = 1, /*bit endian */
H5T_ORDER_VAX = 2, /*VAX mixed endian */
H5T_ORDER_MIXED = 3, /*Compound type with mixed member orders */
H5T_ORDER_NONE = 4 /*no particular order (strings, bits,..) */
/*H5T_ORDER_NONE must be last */
} H5T_order_t;
/* Types of integer sign schemes */
typedef enum H5T_sign_t {
H5T_SGN_ERROR = -1, /*error */
H5T_SGN_NONE = 0, /*this is an unsigned type */
H5T_SGN_2 = 1, /*two's complement */
H5T_NSGN = 2 /*this must be last! */
} H5T_sign_t;
/* Floating-point normalization schemes */
typedef enum H5T_norm_t {
H5T_NORM_ERROR = -1, /*error */
H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */
H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */
H5T_NORM_NONE = 2 /*not normalized */
/*H5T_NORM_NONE must be last */
} H5T_norm_t;
/*
* Character set to use for text strings. Do not change these values since
* they appear in HDF5 files!
*/
typedef enum H5T_cset_t {
H5T_CSET_ERROR = -1, /*error */
H5T_CSET_ASCII = 0, /*US ASCII */
H5T_CSET_UTF8 = 1, /*UTF-8 Unicode encoding */
H5T_CSET_RESERVED_2 = 2, /*reserved for later use */
H5T_CSET_RESERVED_3 = 3, /*reserved for later use */
H5T_CSET_RESERVED_4 = 4, /*reserved for later use */
H5T_CSET_RESERVED_5 = 5, /*reserved for later use */
H5T_CSET_RESERVED_6 = 6, /*reserved for later use */
H5T_CSET_RESERVED_7 = 7, /*reserved for later use */
H5T_CSET_RESERVED_8 = 8, /*reserved for later use */
H5T_CSET_RESERVED_9 = 9, /*reserved for later use */
H5T_CSET_RESERVED_10 = 10, /*reserved for later use */
H5T_CSET_RESERVED_11 = 11, /*reserved for later use */
H5T_CSET_RESERVED_12 = 12, /*reserved for later use */
H5T_CSET_RESERVED_13 = 13, /*reserved for later use */
H5T_CSET_RESERVED_14 = 14, /*reserved for later use */
H5T_CSET_RESERVED_15 = 15 /*reserved for later use */
} H5T_cset_t;
#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */
/*
* Type of padding to use in character strings. Do not change these values
* since they appear in HDF5 files!
*/
typedef enum H5T_str_t {
H5T_STR_ERROR = -1, /*error */
H5T_STR_NULLTERM = 0, /*null terminate like in C */
H5T_STR_NULLPAD = 1, /*pad with nulls */
H5T_STR_SPACEPAD = 2, /*pad with spaces like in Fortran */
H5T_STR_RESERVED_3 = 3, /*reserved for later use */
H5T_STR_RESERVED_4 = 4, /*reserved for later use */
H5T_STR_RESERVED_5 = 5, /*reserved for later use */
H5T_STR_RESERVED_6 = 6, /*reserved for later use */
H5T_STR_RESERVED_7 = 7, /*reserved for later use */
H5T_STR_RESERVED_8 = 8, /*reserved for later use */
H5T_STR_RESERVED_9 = 9, /*reserved for later use */
H5T_STR_RESERVED_10 = 10, /*reserved for later use */
H5T_STR_RESERVED_11 = 11, /*reserved for later use */
H5T_STR_RESERVED_12 = 12, /*reserved for later use */
H5T_STR_RESERVED_13 = 13, /*reserved for later use */
H5T_STR_RESERVED_14 = 14, /*reserved for later use */
H5T_STR_RESERVED_15 = 15 /*reserved for later use */
} H5T_str_t;
#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */
/* Type of padding to use in other atomic types */
typedef enum H5T_pad_t {
H5T_PAD_ERROR = -1, /*error */
H5T_PAD_ZERO = 0, /*always set to zero */
H5T_PAD_ONE = 1, /*always set to one */
H5T_PAD_BACKGROUND = 2, /*set to background value */
H5T_NPAD = 3 /*THIS MUST BE LAST */
} H5T_pad_t;
/* Commands sent to conversion functions */
typedef enum H5T_cmd_t {
H5T_CONV_INIT = 0, /*query and/or initialize private data */
H5T_CONV_CONV = 1, /*convert data from source to dest datatype */
H5T_CONV_FREE = 2 /*function is being removed from path */
} H5T_cmd_t;
/* How is the `bkg' buffer used by the conversion function? */
typedef enum H5T_bkg_t {
H5T_BKG_NO = 0, /*background buffer is not needed, send NULL */
H5T_BKG_TEMP = 1, /*bkg buffer used as temp storage only */
H5T_BKG_YES = 2 /*init bkg buf with data before conversion */
} H5T_bkg_t;
/* Type conversion client data */
typedef struct H5T_cdata_t {
H5T_cmd_t command;/*what should the conversion function do? */
H5T_bkg_t need_bkg;/*is the background buffer needed? */
hbool_t recalc; /*recalculate private data */
void *priv; /*private data */
} H5T_cdata_t;
/* Conversion function persistence */
typedef enum H5T_pers_t {
H5T_PERS_DONTCARE = -1, /*wild card */
H5T_PERS_HARD = 0, /*hard conversion function */
H5T_PERS_SOFT = 1 /*soft conversion function */
} H5T_pers_t;
/* The order to retrieve atomic native datatype */
typedef enum H5T_direction_t {
H5T_DIR_DEFAULT = 0, /*default direction is inscendent */
H5T_DIR_ASCEND = 1, /*in inscendent order */
H5T_DIR_DESCEND = 2 /*in descendent order */
} H5T_direction_t;
/* The exception type passed into the conversion callback function */
typedef enum H5T_conv_except_t {
H5T_CONV_EXCEPT_RANGE_HI = 0, /*source value is greater than destination's range */
H5T_CONV_EXCEPT_RANGE_LOW = 1, /*source value is less than destination's range */
H5T_CONV_EXCEPT_PRECISION = 2, /*source value loses precision in destination */
H5T_CONV_EXCEPT_TRUNCATE = 3, /*source value is truncated in destination */
H5T_CONV_EXCEPT_PINF = 4, /*source value is positive infinity(floating number) */
H5T_CONV_EXCEPT_NINF = 5, /*source value is negative infinity(floating number) */
H5T_CONV_EXCEPT_NAN = 6 /*source value is NaN(floating number) */
} H5T_conv_except_t;
/* The return value from conversion callback function H5T_conv_except_func_t */
typedef enum H5T_conv_ret_t {
H5T_CONV_ABORT = -1, /*abort conversion */
H5T_CONV_UNHANDLED = 0, /*callback function failed to handle the exception */
H5T_CONV_HANDLED = 1 /*callback function handled the exception successfully */
} H5T_conv_ret_t;
/* Variable Length Datatype struct in memory */
/* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */
typedef struct {
size_t len; /* Length of VL data (in base type units) */
void *p; /* Pointer to VL data */
} hvl_t;
/* Variable Length String information */
#define H5T_VARIABLE ((size_t)(-1)) /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */
/* Opaque information */
#define H5T_OPAQUE_TAG_MAX 256 /* Maximum length of an opaque tag */
/* This could be raised without too much difficulty */
#ifdef __cplusplus
extern "C" {
#endif
/* All datatype conversion functions are... */
typedef herr_t (*H5T_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf,
void *bkg, hid_t dset_xfer_plist);
/* Exception handler. If an exception like overflow happenes during conversion,
* this function is called if it's registered through H5Pset_type_conv_cb.
*/
typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type,
hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data);
/* When this header is included from a private header, don't make calls to H5open() */
#undef H5OPEN
#ifndef _H5private_H
#define H5OPEN H5open(),
#else /* _H5private_H */
#define H5OPEN
#endif /* _H5private_H */
/*
* The IEEE floating point types in various byte orders.
*/
#define H5T_IEEE_F32BE (H5OPEN H5T_IEEE_F32BE_g)
#define H5T_IEEE_F32LE (H5OPEN H5T_IEEE_F32LE_g)
#define H5T_IEEE_F64BE (H5OPEN H5T_IEEE_F64BE_g)
#define H5T_IEEE_F64LE (H5OPEN H5T_IEEE_F64LE_g)
H5_DLLVAR hid_t H5T_IEEE_F32BE_g;
H5_DLLVAR hid_t H5T_IEEE_F32LE_g;
H5_DLLVAR hid_t H5T_IEEE_F64BE_g;
H5_DLLVAR hid_t H5T_IEEE_F64LE_g;
/*
* These are "standard" types. For instance, signed (2's complement) and
* unsigned integers of various sizes and byte orders.
*/
#define H5T_STD_I8BE (H5OPEN H5T_STD_I8BE_g)
#define H5T_STD_I8LE (H5OPEN H5T_STD_I8LE_g)
#define H5T_STD_I16BE (H5OPEN H5T_STD_I16BE_g)
#define H5T_STD_I16LE (H5OPEN H5T_STD_I16LE_g)
#define H5T_STD_I32BE (H5OPEN H5T_STD_I32BE_g)
#define H5T_STD_I32LE (H5OPEN H5T_STD_I32LE_g)
#define H5T_STD_I64BE (H5OPEN H5T_STD_I64BE_g)
#define H5T_STD_I64LE (H5OPEN H5T_STD_I64LE_g)
#define H5T_STD_U8BE (H5OPEN H5T_STD_U8BE_g)
#define H5T_STD_U8LE (H5OPEN H5T_STD_U8LE_g)
#define H5T_STD_U16BE (H5OPEN H5T_STD_U16BE_g)
#define H5T_STD_U16LE (H5OPEN H5T_STD_U16LE_g)
#define H5T_STD_U32BE (H5OPEN H5T_STD_U32BE_g)
#define H5T_STD_U32LE (H5OPEN H5T_STD_U32LE_g)
#define H5T_STD_U64BE (H5OPEN H5T_STD_U64BE_g)
#define H5T_STD_U64LE (H5OPEN H5T_STD_U64LE_g)
#define H5T_STD_B8BE (H5OPEN H5T_STD_B8BE_g)
#define H5T_STD_B8LE (H5OPEN H5T_STD_B8LE_g)
#define H5T_STD_B16BE (H5OPEN H5T_STD_B16BE_g)
#define H5T_STD_B16LE (H5OPEN H5T_STD_B16LE_g)
#define H5T_STD_B32BE (H5OPEN H5T_STD_B32BE_g)
#define H5T_STD_B32LE (H5OPEN H5T_STD_B32LE_g)
#define H5T_STD_B64BE (H5OPEN H5T_STD_B64BE_g)
#define H5T_STD_B64LE (H5OPEN H5T_STD_B64LE_g)
#define H5T_STD_REF_OBJ (H5OPEN H5T_STD_REF_OBJ_g)
#define H5T_STD_REF_DSETREG (H5OPEN H5T_STD_REF_DSETREG_g)
H5_DLLVAR hid_t H5T_STD_I8BE_g;
H5_DLLVAR hid_t H5T_STD_I8LE_g;
H5_DLLVAR hid_t H5T_STD_I16BE_g;
H5_DLLVAR hid_t H5T_STD_I16LE_g;
H5_DLLVAR hid_t H5T_STD_I32BE_g;
H5_DLLVAR hid_t H5T_STD_I32LE_g;
H5_DLLVAR hid_t H5T_STD_I64BE_g;
H5_DLLVAR hid_t H5T_STD_I64LE_g;
H5_DLLVAR hid_t H5T_STD_U8BE_g;
H5_DLLVAR hid_t H5T_STD_U8LE_g;
H5_DLLVAR hid_t H5T_STD_U16BE_g;
H5_DLLVAR hid_t H5T_STD_U16LE_g;
H5_DLLVAR hid_t H5T_STD_U32BE_g;
H5_DLLVAR hid_t H5T_STD_U32LE_g;
H5_DLLVAR hid_t H5T_STD_U64BE_g;
H5_DLLVAR hid_t H5T_STD_U64LE_g;
H5_DLLVAR hid_t H5T_STD_B8BE_g;
H5_DLLVAR hid_t H5T_STD_B8LE_g;
H5_DLLVAR hid_t H5T_STD_B16BE_g;
H5_DLLVAR hid_t H5T_STD_B16LE_g;
H5_DLLVAR hid_t H5T_STD_B32BE_g;
H5_DLLVAR hid_t H5T_STD_B32LE_g;
H5_DLLVAR hid_t H5T_STD_B64BE_g;
H5_DLLVAR hid_t H5T_STD_B64LE_g;
H5_DLLVAR hid_t H5T_STD_REF_OBJ_g;
H5_DLLVAR hid_t H5T_STD_REF_DSETREG_g;
/*
* Types which are particular to Unix.
*/
#define H5T_UNIX_D32BE (H5OPEN H5T_UNIX_D32BE_g)
#define H5T_UNIX_D32LE (H5OPEN H5T_UNIX_D32LE_g)
#define H5T_UNIX_D64BE (H5OPEN H5T_UNIX_D64BE_g)
#define H5T_UNIX_D64LE (H5OPEN H5T_UNIX_D64LE_g)
H5_DLLVAR hid_t H5T_UNIX_D32BE_g;
H5_DLLVAR hid_t H5T_UNIX_D32LE_g;
H5_DLLVAR hid_t H5T_UNIX_D64BE_g;
H5_DLLVAR hid_t H5T_UNIX_D64LE_g;
/*
* Types particular to the C language. String types use `bytes' instead
* of `bits' as their size.
*/
#define H5T_C_S1 (H5OPEN H5T_C_S1_g)
H5_DLLVAR hid_t H5T_C_S1_g;
/*
* Types particular to Fortran.
*/
#define H5T_FORTRAN_S1 (H5OPEN H5T_FORTRAN_S1_g)
H5_DLLVAR hid_t H5T_FORTRAN_S1_g;
/*
* These types are for Intel CPU's. They are little endian with IEEE
* floating point.
*/
#define H5T_INTEL_I8 H5T_STD_I8LE
#define H5T_INTEL_I16 H5T_STD_I16LE
#define H5T_INTEL_I32 H5T_STD_I32LE
#define H5T_INTEL_I64 H5T_STD_I64LE
#define H5T_INTEL_U8 H5T_STD_U8LE
#define H5T_INTEL_U16 H5T_STD_U16LE
#define H5T_INTEL_U32 H5T_STD_U32LE
#define H5T_INTEL_U64 H5T_STD_U64LE
#define H5T_INTEL_B8 H5T_STD_B8LE
#define H5T_INTEL_B16 H5T_STD_B16LE
#define H5T_INTEL_B32 H5T_STD_B32LE
#define H5T_INTEL_B64 H5T_STD_B64LE
#define H5T_INTEL_F32 H5T_IEEE_F32LE
#define H5T_INTEL_F64 H5T_IEEE_F64LE
/*
* These types are for DEC Alpha CPU's. They are little endian with IEEE
* floating point.
*/
#define H5T_ALPHA_I8 H5T_STD_I8LE
#define H5T_ALPHA_I16 H5T_STD_I16LE
#define H5T_ALPHA_I32 H5T_STD_I32LE
#define H5T_ALPHA_I64 H5T_STD_I64LE
#define H5T_ALPHA_U8 H5T_STD_U8LE
#define H5T_ALPHA_U16 H5T_STD_U16LE
#define H5T_ALPHA_U32 H5T_STD_U32LE
#define H5T_ALPHA_U64 H5T_STD_U64LE
#define H5T_ALPHA_B8 H5T_STD_B8LE
#define H5T_ALPHA_B16 H5T_STD_B16LE
#define H5T_ALPHA_B32 H5T_STD_B32LE
#define H5T_ALPHA_B64 H5T_STD_B64LE
#define H5T_ALPHA_F32 H5T_IEEE_F32LE
#define H5T_ALPHA_F64 H5T_IEEE_F64LE
/*
* These types are for MIPS cpu's commonly used in SGI systems. They are big
* endian with IEEE floating point.
*/
#define H5T_MIPS_I8 H5T_STD_I8BE
#define H5T_MIPS_I16 H5T_STD_I16BE
#define H5T_MIPS_I32 H5T_STD_I32BE
#define H5T_MIPS_I64 H5T_STD_I64BE
#define H5T_MIPS_U8 H5T_STD_U8BE
#define H5T_MIPS_U16 H5T_STD_U16BE
#define H5T_MIPS_U32 H5T_STD_U32BE
#define H5T_MIPS_U64 H5T_STD_U64BE
#define H5T_MIPS_B8 H5T_STD_B8BE
#define H5T_MIPS_B16 H5T_STD_B16BE
#define H5T_MIPS_B32 H5T_STD_B32BE
#define H5T_MIPS_B64 H5T_STD_B64BE
#define H5T_MIPS_F32 H5T_IEEE_F32BE
#define H5T_MIPS_F64 H5T_IEEE_F64BE
/*
* The VAX floating point types (i.e. in VAX byte order)
*/
#define H5T_VAX_F32 (H5OPEN H5T_VAX_F32_g)
#define H5T_VAX_F64 (H5OPEN H5T_VAX_F64_g)
H5_DLLVAR hid_t H5T_VAX_F32_g;
H5_DLLVAR hid_t H5T_VAX_F64_g;
/*
* The predefined native types. These are the types detected by H5detect and
* they violate the naming scheme a little. Instead of a class name,
* precision and byte order as the last component, they have a C-like type
* name. If the type begins with `U' then it is the unsigned version of the
* integer type; other integer types are signed. The type LLONG corresponds
* to C's `long long' and LDOUBLE is `long double' (these types might be the
* same as `LONG' and `DOUBLE' respectively).
*/
#define H5T_NATIVE_CHAR (CHAR_MIN?H5T_NATIVE_SCHAR:H5T_NATIVE_UCHAR)
#define H5T_NATIVE_SCHAR (H5OPEN H5T_NATIVE_SCHAR_g)
#define H5T_NATIVE_UCHAR (H5OPEN H5T_NATIVE_UCHAR_g)
#define H5T_NATIVE_SHORT (H5OPEN H5T_NATIVE_SHORT_g)
#define H5T_NATIVE_USHORT (H5OPEN H5T_NATIVE_USHORT_g)
#define H5T_NATIVE_INT (H5OPEN H5T_NATIVE_INT_g)
#define H5T_NATIVE_UINT (H5OPEN H5T_NATIVE_UINT_g)
#define H5T_NATIVE_LONG (H5OPEN H5T_NATIVE_LONG_g)
#define H5T_NATIVE_ULONG (H5OPEN H5T_NATIVE_ULONG_g)
#define H5T_NATIVE_LLONG (H5OPEN H5T_NATIVE_LLONG_g)
#define H5T_NATIVE_ULLONG (H5OPEN H5T_NATIVE_ULLONG_g)
#define H5T_NATIVE_FLOAT (H5OPEN H5T_NATIVE_FLOAT_g)
#define H5T_NATIVE_DOUBLE (H5OPEN H5T_NATIVE_DOUBLE_g)
#if H5_SIZEOF_LONG_DOUBLE !=0
#define H5T_NATIVE_LDOUBLE (H5OPEN H5T_NATIVE_LDOUBLE_g)
#endif
#define H5T_NATIVE_B8 (H5OPEN H5T_NATIVE_B8_g)
#define H5T_NATIVE_B16 (H5OPEN H5T_NATIVE_B16_g)
#define H5T_NATIVE_B32 (H5OPEN H5T_NATIVE_B32_g)
#define H5T_NATIVE_B64 (H5OPEN H5T_NATIVE_B64_g)
#define H5T_NATIVE_OPAQUE (H5OPEN H5T_NATIVE_OPAQUE_g)
#define H5T_NATIVE_HADDR (H5OPEN H5T_NATIVE_HADDR_g)
#define H5T_NATIVE_HSIZE (H5OPEN H5T_NATIVE_HSIZE_g)
#define H5T_NATIVE_HSSIZE (H5OPEN H5T_NATIVE_HSSIZE_g)
#define H5T_NATIVE_HERR (H5OPEN H5T_NATIVE_HERR_g)
#define H5T_NATIVE_HBOOL (H5OPEN H5T_NATIVE_HBOOL_g)
H5_DLLVAR hid_t H5T_NATIVE_SCHAR_g;
H5_DLLVAR hid_t H5T_NATIVE_UCHAR_g;
H5_DLLVAR hid_t H5T_NATIVE_SHORT_g;
H5_DLLVAR hid_t H5T_NATIVE_USHORT_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_g;
H5_DLLVAR hid_t H5T_NATIVE_LONG_g;
H5_DLLVAR hid_t H5T_NATIVE_ULONG_g;
H5_DLLVAR hid_t H5T_NATIVE_LLONG_g;
H5_DLLVAR hid_t H5T_NATIVE_ULLONG_g;
H5_DLLVAR hid_t H5T_NATIVE_FLOAT_g;
H5_DLLVAR hid_t H5T_NATIVE_DOUBLE_g;
#if H5_SIZEOF_LONG_DOUBLE !=0
H5_DLLVAR hid_t H5T_NATIVE_LDOUBLE_g;
#endif
H5_DLLVAR hid_t H5T_NATIVE_B8_g;
H5_DLLVAR hid_t H5T_NATIVE_B16_g;
H5_DLLVAR hid_t H5T_NATIVE_B32_g;
H5_DLLVAR hid_t H5T_NATIVE_B64_g;
H5_DLLVAR hid_t H5T_NATIVE_OPAQUE_g;
H5_DLLVAR hid_t H5T_NATIVE_HADDR_g;
H5_DLLVAR hid_t H5T_NATIVE_HSIZE_g;
H5_DLLVAR hid_t H5T_NATIVE_HSSIZE_g;
H5_DLLVAR hid_t H5T_NATIVE_HERR_g;
H5_DLLVAR hid_t H5T_NATIVE_HBOOL_g;
/* C9x integer types */
#define H5T_NATIVE_INT8 (H5OPEN H5T_NATIVE_INT8_g)
#define H5T_NATIVE_UINT8 (H5OPEN H5T_NATIVE_UINT8_g)
#define H5T_NATIVE_INT_LEAST8 (H5OPEN H5T_NATIVE_INT_LEAST8_g)
#define H5T_NATIVE_UINT_LEAST8 (H5OPEN H5T_NATIVE_UINT_LEAST8_g)
#define H5T_NATIVE_INT_FAST8 (H5OPEN H5T_NATIVE_INT_FAST8_g)
#define H5T_NATIVE_UINT_FAST8 (H5OPEN H5T_NATIVE_UINT_FAST8_g)
H5_DLLVAR hid_t H5T_NATIVE_INT8_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT8_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST8_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST8_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_FAST8_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST8_g;
#define H5T_NATIVE_INT16 (H5OPEN H5T_NATIVE_INT16_g)
#define H5T_NATIVE_UINT16 (H5OPEN H5T_NATIVE_UINT16_g)
#define H5T_NATIVE_INT_LEAST16 (H5OPEN H5T_NATIVE_INT_LEAST16_g)
#define H5T_NATIVE_UINT_LEAST16 (H5OPEN H5T_NATIVE_UINT_LEAST16_g)
#define H5T_NATIVE_INT_FAST16 (H5OPEN H5T_NATIVE_INT_FAST16_g)
#define H5T_NATIVE_UINT_FAST16 (H5OPEN H5T_NATIVE_UINT_FAST16_g)
H5_DLLVAR hid_t H5T_NATIVE_INT16_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT16_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST16_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST16_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_FAST16_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST16_g;
#define H5T_NATIVE_INT32 (H5OPEN H5T_NATIVE_INT32_g)
#define H5T_NATIVE_UINT32 (H5OPEN H5T_NATIVE_UINT32_g)
#define H5T_NATIVE_INT_LEAST32 (H5OPEN H5T_NATIVE_INT_LEAST32_g)
#define H5T_NATIVE_UINT_LEAST32 (H5OPEN H5T_NATIVE_UINT_LEAST32_g)
#define H5T_NATIVE_INT_FAST32 (H5OPEN H5T_NATIVE_INT_FAST32_g)
#define H5T_NATIVE_UINT_FAST32 (H5OPEN H5T_NATIVE_UINT_FAST32_g)
H5_DLLVAR hid_t H5T_NATIVE_INT32_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT32_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST32_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST32_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_FAST32_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST32_g;
#define H5T_NATIVE_INT64 (H5OPEN H5T_NATIVE_INT64_g)
#define H5T_NATIVE_UINT64 (H5OPEN H5T_NATIVE_UINT64_g)
#define H5T_NATIVE_INT_LEAST64 (H5OPEN H5T_NATIVE_INT_LEAST64_g)
#define H5T_NATIVE_UINT_LEAST64 (H5OPEN H5T_NATIVE_UINT_LEAST64_g)
#define H5T_NATIVE_INT_FAST64 (H5OPEN H5T_NATIVE_INT_FAST64_g)
#define H5T_NATIVE_UINT_FAST64 (H5OPEN H5T_NATIVE_UINT_FAST64_g)
H5_DLLVAR hid_t H5T_NATIVE_INT64_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT64_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST64_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST64_g;
H5_DLLVAR hid_t H5T_NATIVE_INT_FAST64_g;
H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g;
/* Operations defined on all datatypes */
H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size);
H5_DLL hid_t H5Tcopy(hid_t type_id);
H5_DLL herr_t H5Tclose(hid_t type_id);
H5_DLL htri_t H5Tequal(hid_t type1_id, hid_t type2_id);
H5_DLL herr_t H5Tlock(hid_t type_id);
H5_DLL herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id,
hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id);
H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id);
H5_DLL herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id);
H5_DLL hid_t H5Tget_create_plist(hid_t type_id);
H5_DLL htri_t H5Tcommitted(hid_t type_id);
H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc);
H5_DLL hid_t H5Tdecode(const void *buf);
/* Operations defined on compound datatypes */
H5_DLL herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset,
hid_t member_id);
H5_DLL herr_t H5Tpack(hid_t type_id);
/* Operations defined on enumeration datatypes */
H5_DLL hid_t H5Tenum_create(hid_t base_id);
H5_DLL herr_t H5Tenum_insert(hid_t type, const char *name, const void *value);
H5_DLL herr_t H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/,
size_t size);
H5_DLL herr_t H5Tenum_valueof(hid_t type, const char *name,
void *value/*out*/);
/* Operations defined on variable-length datatypes */
H5_DLL hid_t H5Tvlen_create(hid_t base_id);
/* Operations defined on array datatypes */
H5_DLL hid_t H5Tarray_create2(hid_t base_id, unsigned ndims,
const hsize_t dim[/* ndims */]);
H5_DLL int H5Tget_array_ndims(hid_t type_id);
H5_DLL int H5Tget_array_dims2(hid_t type_id, hsize_t dims[]);
/* Operations defined on opaque datatypes */
H5_DLL herr_t H5Tset_tag(hid_t type, const char *tag);
H5_DLL char *H5Tget_tag(hid_t type);
/* Querying property values */
H5_DLL hid_t H5Tget_super(hid_t type);
H5_DLL H5T_class_t H5Tget_class(hid_t type_id);
H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls);
H5_DLL size_t H5Tget_size(hid_t type_id);
H5_DLL H5T_order_t H5Tget_order(hid_t type_id);
H5_DLL size_t H5Tget_precision(hid_t type_id);
H5_DLL int H5Tget_offset(hid_t type_id);
H5_DLL herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/,
H5T_pad_t *msb/*out*/);
H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id);
H5_DLL herr_t H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
size_t *epos/*out*/, size_t *esize/*out*/,
size_t *mpos/*out*/, size_t *msize/*out*/);
H5_DLL size_t H5Tget_ebias(hid_t type_id);
H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id);
H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id);
H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id);
H5_DLL int H5Tget_nmembers(hid_t type_id);
H5_DLL char *H5Tget_member_name(hid_t type_id, unsigned membno);
H5_DLL int H5Tget_member_index(hid_t type_id, const char *name);
H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno);
H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, unsigned membno);
H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno);
H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value/*out*/);
H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id);
H5_DLL htri_t H5Tis_variable_str(hid_t type_id);
H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction);
/* Setting property values */
H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size);
H5_DLL herr_t H5Tset_order(hid_t type_id, H5T_order_t order);
H5_DLL herr_t H5Tset_precision(hid_t type_id, size_t prec);
H5_DLL herr_t H5Tset_offset(hid_t type_id, size_t offset);
H5_DLL herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb);
H5_DLL herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign);
H5_DLL herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos,
size_t esize, size_t mpos, size_t msize);
H5_DLL herr_t H5Tset_ebias(hid_t type_id, size_t ebias);
H5_DLL herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm);
H5_DLL herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad);
H5_DLL herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset);
H5_DLL herr_t H5Tset_strpad(hid_t type_id, H5T_str_t strpad);
/* Type conversion database */
H5_DLL herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id,
hid_t dst_id, H5T_conv_t func);
H5_DLL herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id,
hid_t dst_id, H5T_conv_t func);
H5_DLL H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata);
H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts,
void *buf, void *background, hid_t plist_id);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Macros */
/* Typedefs */
/* Function prototypes */
H5_DLL herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id);
H5_DLL hid_t H5Topen1(hid_t loc_id, const char *name);
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
const hsize_t dim[/* ndims */],
const int perm[/* ndims */]);
H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
}
#endif
#endif /* _H5Tpublic_H */
|
16b1ef8c1a893b8932aecce23231ee3f0b99a252
|
97c44f18459163c0baa546ab2578339b716c3238
|
/hedera/BRHederaAddress.h
|
dff0c200e798701078abc60b044d592893eb1b91
|
[
"MIT"
] |
permissive
|
breadwallet/breadwallet-core
|
fe8a0ac99f3e47216860b2918c8ad14d3503b140
|
73566cb79f753954eccbf07d5ab25ca54741198e
|
refs/heads/develop
| 2023-08-21T22:27:45.735652
| 2020-02-06T18:43:51
| 2020-02-06T18:43:51
| 37,500,549
| 284
| 283
|
MIT
| 2023-03-21T09:07:32
| 2015-06-16T01:22:12
|
C
|
UTF-8
|
C
| false
| false
| 2,709
|
h
|
BRHederaAddress.h
|
//
// BRHederaAddress.h
// Core
//
// Created by Carl Cherry on Oct. 23, 2019.
// Copyright © 2019 Breadwinner AG. All rights reserved.
//
// See the LICENSE file at the project root for license information.
// See the CONTRIBUTORS file at the project root for a list of contributors.
//
#ifndef BRHederaAddress_h
#define BRHederaAddress_h
#include "support/BRKey.h"
#ifdef __cplusplus
extern "C" {
#endif
#define HEDERA_ADDRESS_SERIALIZED_SIZE 24
typedef struct BRHederaAddressRecord *BRHederaAddress;
/**
* Get the hedera address string representation of the address
*
* @param address - a BRHederaAddress
*
* @return pointer to allocated buffer holding the null terminated string
*/
extern char * // Caller must free using the "free" function
hederaAddressAsString (BRHederaAddress address);
/**
* Create a hedera address from a valid hedera address string
*
* @param address - hedera address string in the "r..." format
*
* @return address - a BRHederaAddress object
*/
extern BRHederaAddress
hederaAddressCreateFromString(const char * hederaAddressString);
extern BRHederaAddress
hederaAddressCreate(int64_t shard, int64_t realm, int64_t account_num);
/**
* Free the memory associated with a BRHederaAddress
*
* @param address - a BRHederaAddress
*
* @return void
*/
extern void
hederaAddressFree (BRHederaAddress address);
/**
* Check is this address is the
*
* @param address - a BRHederaAddress
*
* @return 1 if this is the "Fee" address, 0 if not
*/
extern int
hederaAddressIsFeeAddress (BRHederaAddress address);
/**
* Get the Hedera address field values
*
* @param address - a BRHederaAddress
*
* @return int64_t value
*/
int64_t hederaAddressGetShard (BRHederaAddress address);
int64_t hederaAddressGetRealm (BRHederaAddress address);
int64_t hederaAddressGetAccount (BRHederaAddress address);
/**
* Copy a BRHederaAddress
*
* @param address - a BRHederaAddress
*
* @return copy - an exact copy of the specified address
*/
extern BRHederaAddress hederaAddressClone (BRHederaAddress address);
/**
* Compare 2 hedera addresses
*
* @param a1 first address
* @param a2 second address
*
* @return 1 - if addresses are equal
* 0 - if not equal
*/
extern int // 1 if equal
hederaAddressEqual (BRHederaAddress a1, BRHederaAddress a2);
/**
* Serialize an Hedera address for storing
* @param address - the hedera address to serialize
* @param size_t* pointer to hold the size of the serialized bytes
*
* @return pointer to buffer holding bytes
*/
extern void
hederaAddressSerialize(BRHederaAddress address, uint8_t * buffer, size_t bufferSize);
#ifdef __cplusplus
}
#endif
#endif /* BRHederaAddress_h */
|
32229c45d51c267c45638a6dfa437d82efd807dd
|
0a3ea198a89cacc190ca9e0cae0877173e819c43
|
/Sileo/Backend/C Contrib/dpkgversion.h
|
5b8169a113d5c0600e3dffd0920ca34b9b2008d3
|
[
"BSD-2-Clause"
] |
permissive
|
Sileo/Sileo
|
9d17b2b35fa46d7ec90d5e2f419035a426fe8415
|
18e0ac2c90e8658ed9b787dca25a4c7c34edf93a
|
refs/heads/main
| 2023-09-03T13:19:48.557667
| 2023-08-22T13:30:11
| 2023-08-22T13:30:11
| 186,243,031
| 1,100
| 218
|
BSD-4-Clause
| 2023-09-09T02:48:31
| 2019-05-12T10:53:31
|
Swift
|
UTF-8
|
C
| false
| false
| 532
|
h
|
dpkgversion.h
|
//
// dpkgversion.h
// Sileo
//
// Created by Amy While on 21/07/2022.
// Copyright © 2022 Sileo Team. All rights reserved.
//
#ifndef dpkgversion_h
#define dpkgversion_h
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
struct DpkgVersion {
char *version;
char *revision;
uint epoch;
uint8_t requiresFree;
};
int compareVersion(const char *version1, int version1Count, const char *version2, int version2Count);
#endif /* dpkgversion_h */
|
bab5984805fb2be242aa43085e1f95667e2e0139
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/stm32/libraries/STM32WBxx_HAL/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h
|
e97b0c4fb5096cc207782a588b8aadada7919737
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 183,184
|
h
|
stm32wbxx_hal_rcc.h
|
/**
******************************************************************************
* @file stm32wbxx_hal_rcc.h
* @author MCD Application Team
* @brief Header file of RCC HAL module.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32WBxx_HAL_RCC_H
#define STM32WBxx_HAL_RCC_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32wbxx_hal_def.h"
#include "stm32wbxx_ll_rcc.h"
#include "stm32wbxx_ll_bus.h"
/** @addtogroup STM32WBxx_HAL_Driver
* @{
*/
/** @addtogroup RCC
* @{
*/
/* Private constants ---------------------------------------------------------*/
/** @addtogroup RCC_Private_Constants
* @{
*/
/* Defines used for Flags */
#define CR_REG_INDEX 1U
#define BDCR_REG_INDEX 2U
#define CSR_REG_INDEX 3U
#define CRRCR_REG_INDEX 4U
#define RCC_FLAG_MASK 0x1FU
/* Defines Oscillator Masks */
#if defined(RCC_HSI48_SUPPORT)
#define RCC_OSCILLATORTYPE_ALL (RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_MSI | \
RCC_OSCILLATORTYPE_LSI1 | RCC_OSCILLATORTYPE_LSI2 | RCC_OSCILLATORTYPE_LSE) /*!< All Oscillator to configure */
#else
#define RCC_OSCILLATORTYPE_ALL (RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_MSI | \
RCC_OSCILLATORTYPE_LSI1 | RCC_OSCILLATORTYPE_LSI2 | RCC_OSCILLATORTYPE_LSE) /*!< All Oscillator to configure */
#endif
/** @defgroup RCC_Reset_Flag Reset Flag
* @{
*/
#define RCC_RESET_FLAG_OBL RCC_CSR_OBLRSTF /*!< Option Byte Loader reset flag */
#define RCC_RESET_FLAG_PIN RCC_CSR_PINRSTF /*!< PIN reset flag */
#define RCC_RESET_FLAG_PWR RCC_CSR_BORRSTF /*!< BOR or POR/PDR reset flag */
#define RCC_RESET_FLAG_SW RCC_CSR_SFTRSTF /*!< Software Reset flag */
#define RCC_RESET_FLAG_IWDG RCC_CSR_IWDGRSTF /*!< Independent Watchdog reset flag */
#define RCC_RESET_FLAG_WWDG RCC_CSR_WWDGRSTF /*!< Window watchdog reset flag */
#define RCC_RESET_FLAG_LPWR RCC_CSR_LPWRRSTF /*!< Low power reset flag */
#define RCC_RESET_FLAG_ALL (RCC_RESET_FLAG_OBL | RCC_RESET_FLAG_PIN | RCC_RESET_FLAG_PWR | \
RCC_RESET_FLAG_SW | RCC_RESET_FLAG_IWDG | RCC_RESET_FLAG_WWDG | \
RCC_RESET_FLAG_LPWR)
/**
* @}
*/
/**
* @}
*/
/* Private macros ------------------------------------------------------------*/
/** @addtogroup RCC_Private_Macros
* @{
*/
#define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \
(((__OSCILLATOR__) & ~RCC_OSCILLATORTYPE_ALL) == 0x00U))
#define IS_RCC_HSE(__HSE__) (((__HSE__) == RCC_HSE_OFF) || ((__HSE__) == RCC_HSE_ON))
#define IS_RCC_LSE(__LSE__) (((__LSE__) == RCC_LSE_OFF) || ((__LSE__) == RCC_LSE_ON) || \
((__LSE__) == RCC_LSE_BYPASS))
#define IS_RCC_HSI(__HSI__) (((__HSI__) == RCC_HSI_OFF) || ((__HSI__) == RCC_HSI_ON))
#define IS_RCC_HSI_CALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)127U)
#define IS_RCC_LSI(__LSI__) (((__LSI__) == RCC_LSI_OFF) || ((__LSI__) == RCC_LSI_ON))
#define IS_RCC_LSI2_CALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)15U)
#define IS_RCC_MSI(__MSI__) (((__MSI__) == RCC_MSI_OFF) || ((__MSI__) == RCC_MSI_ON))
#define IS_RCC_MSICALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)255U)
#if defined(RCC_HSI48_SUPPORT)
#define IS_RCC_HSI48(__HSI48__) (((__HSI48__) == RCC_HSI48_OFF) || ((__HSI48__) == RCC_HSI48_ON))
#endif
#define IS_RCC_PLL(__PLL__) (((__PLL__) == RCC_PLL_NONE) ||((__PLL__) == RCC_PLL_OFF) || \
((__PLL__) == RCC_PLL_ON))
#define IS_RCC_PLLSOURCE(__SOURCE__) (((__SOURCE__) == RCC_PLLSOURCE_NONE) || \
((__SOURCE__) == RCC_PLLSOURCE_MSI) || \
((__SOURCE__) == RCC_PLLSOURCE_HSI) || \
((__SOURCE__) == RCC_PLLSOURCE_HSE))
#define IS_RCC_PLLM_VALUE(__VALUE__) (((__VALUE__) == RCC_PLLM_DIV1) || \
((__VALUE__) == RCC_PLLM_DIV2) || \
((__VALUE__) == RCC_PLLM_DIV3) || \
((__VALUE__) == RCC_PLLM_DIV4) || \
((__VALUE__) == RCC_PLLM_DIV5) || \
((__VALUE__) == RCC_PLLM_DIV6) || \
((__VALUE__) == RCC_PLLM_DIV7) || \
((__VALUE__) == RCC_PLLM_DIV8))
#define IS_RCC_PLLN_VALUE(__VALUE__) ((6U <= (__VALUE__)) && ((__VALUE__) <= 127U))
#define IS_RCC_PLLP_VALUE(__VALUE__) ((RCC_PLLP_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLP_DIV32))
#define IS_RCC_PLLQ_VALUE(__VALUE__) ((RCC_PLLQ_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLQ_DIV8))
#define IS_RCC_PLLR_VALUE(__VALUE__) ((RCC_PLLR_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLR_DIV8))
#if defined(SAI1)
#define IS_RCC_PLLSAI1CLOCKOUT_VALUE(__VALUE__) (((((__VALUE__) & RCC_PLLSAI1_ADCCLK) == RCC_PLLSAI1_ADCCLK) || \
(((__VALUE__) & RCC_PLLSAI1_SAI1CLK) == RCC_PLLSAI1_SAI1CLK) || \
(((__VALUE__) & RCC_PLLSAI1_USBCLK) == RCC_PLLSAI1_USBCLK)) && \
(((__VALUE__) & ~(RCC_PLLSAI1_ADCCLK | RCC_PLLSAI1_SAI1CLK | RCC_PLLSAI1_USBCLK)) == 0U))
#endif
#define IS_RCC_MSI_CLOCK_RANGE(__RANGE__) (((__RANGE__) == RCC_MSIRANGE_0) || \
((__RANGE__) == RCC_MSIRANGE_1) || \
((__RANGE__) == RCC_MSIRANGE_2) || \
((__RANGE__) == RCC_MSIRANGE_3) || \
((__RANGE__) == RCC_MSIRANGE_4) || \
((__RANGE__) == RCC_MSIRANGE_5) || \
((__RANGE__) == RCC_MSIRANGE_6) || \
((__RANGE__) == RCC_MSIRANGE_7) || \
((__RANGE__) == RCC_MSIRANGE_8) || \
((__RANGE__) == RCC_MSIRANGE_9) || \
((__RANGE__) == RCC_MSIRANGE_10) || \
((__RANGE__) == RCC_MSIRANGE_11))
#define IS_RCC_CLOCKTYPE(__CLK__) ((1U <= (__CLK__)) && ((__CLK__) <= (RCC_CLOCKTYPE_SYSCLK | \
RCC_CLOCKTYPE_HCLK | \
RCC_CLOCKTYPE_PCLK1 | \
RCC_CLOCKTYPE_PCLK2 | \
RCC_CLOCKTYPE_HCLK2 | \
RCC_CLOCKTYPE_HCLK4)))
#define IS_RCC_SYSCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_MSI) || \
((__SOURCE__) == RCC_SYSCLKSOURCE_HSI) || \
((__SOURCE__) == RCC_SYSCLKSOURCE_HSE) || \
((__SOURCE__) == RCC_SYSCLKSOURCE_PLLCLK))
#define IS_RCC_HCLKx(__HCLK__) (((__HCLK__) == RCC_SYSCLK_DIV1) || ((__HCLK__) == RCC_SYSCLK_DIV2) || ((__HCLK__) == RCC_SYSCLK_DIV3) || \
((__HCLK__) == RCC_SYSCLK_DIV4) || ((__HCLK__) == RCC_SYSCLK_DIV5) || ((__HCLK__) == RCC_SYSCLK_DIV6) || \
((__HCLK__) == RCC_SYSCLK_DIV8) || ((__HCLK__) == RCC_SYSCLK_DIV10) || ((__HCLK__) == RCC_SYSCLK_DIV16) || \
((__HCLK__) == RCC_SYSCLK_DIV32) || ((__HCLK__) == RCC_SYSCLK_DIV64) || ((__HCLK__) == RCC_SYSCLK_DIV128) || \
((__HCLK__) == RCC_SYSCLK_DIV256) || ((__HCLK__) == RCC_SYSCLK_DIV512))
#define IS_RCC_PCLKx(__PCLK__) (((__PCLK__) == RCC_HCLK_DIV1) || ((__PCLK__) == RCC_HCLK_DIV2) || \
((__PCLK__) == RCC_HCLK_DIV4) || ((__PCLK__) == RCC_HCLK_DIV8) || \
((__PCLK__) == RCC_HCLK_DIV16))
#define IS_RCC_RTCCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_RTCCLKSOURCE_NONE) || \
((__SOURCE__) == RCC_RTCCLKSOURCE_LSE) || \
((__SOURCE__) == RCC_RTCCLKSOURCE_LSI) || \
((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV32))
#if defined(RCC_MCO3_SUPPORT)
#define IS_RCC_MCO(__MCOX__) (((__MCOX__) == RCC_MCO1) || \
((__MCOX__) == RCC_MCO2) || \
((__MCOX__) == RCC_MCO3))
#else
#define IS_RCC_MCO(__MCOX__) (((__MCOX__) == RCC_MCO1) || \
((__MCOX__) == RCC_MCO2))
#endif
#if defined(RCC_HSI48_SUPPORT)
#define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || \
((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \
((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \
((__SOURCE__) == RCC_MCO1SOURCE_HSI) || \
((__SOURCE__) == RCC_MCO1SOURCE_HSE) || \
((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSI1) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSI2) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSE) || \
((__SOURCE__) == RCC_MCO1SOURCE_HSI48))
#else
#define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || \
((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \
((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \
((__SOURCE__) == RCC_MCO1SOURCE_HSI) || \
((__SOURCE__) == RCC_MCO1SOURCE_HSE) || \
((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSI1) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSI2) || \
((__SOURCE__) == RCC_MCO1SOURCE_LSE))
#endif
#define IS_RCC_MCO2SOURCE(__SOURCE__) IS_RCC_MCO1SOURCE((__SOURCE__))
#define IS_RCC_MCO3SOURCE(__SOURCE__) IS_RCC_MCO1SOURCE((__SOURCE__))
#define IS_RCC_MCODIV(__DIV__) (((__DIV__) == RCC_MCODIV_1) || ((__DIV__) == RCC_MCODIV_2) || \
((__DIV__) == RCC_MCODIV_4) || ((__DIV__) == RCC_MCODIV_8) || \
((__DIV__) == RCC_MCODIV_16))
#define IS_RCC_LSE_DRIVE(__DRIVE__) (((__DRIVE__) == RCC_LSEDRIVE_LOW) || \
((__DRIVE__) == RCC_LSEDRIVE_MEDIUMLOW) || \
((__DRIVE__) == RCC_LSEDRIVE_MEDIUMHIGH) || \
((__DRIVE__) == RCC_LSEDRIVE_HIGH))
#define IS_RCC_STOP_WAKEUPCLOCK(__SOURCE__) (((__SOURCE__) == RCC_STOP_WAKEUPCLOCK_MSI) || \
((__SOURCE__) == RCC_STOP_WAKEUPCLOCK_HSI))
/**
* @}
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup RCC_Exported_Types RCC Exported Types
* @{
*/
/**
* @brief RCC PLL configuration structure definition
*/
typedef struct
{
uint32_t PLLState; /*!< The new state of the PLL.
This parameter must be a value of @ref RCC_PLL_Config */
uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source.
This parameter must be a value of @ref RCC_PLL_Clock_Source */
uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock.
This parameter must be a value of @ref RCC_PLLM_Clock_Divider */
uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock.
This parameter must be a number between Min_Data = 6 and Max_Data = 127 */
uint32_t PLLP; /*!< PLLP: Division factor for SAI & ADC clock.
This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
uint32_t PLLQ; /*!< PLLQ: Division factor for RNG and USB clocks.
This parameter must be a value of @ref RCC_PLLQ_Clock_Divider */
uint32_t PLLR; /*!< PLLR: Division for the main system clock.
User have to set the PLLR parameter correctly to not exceed max frequency 64MHZ.
This parameter must be a value of @ref RCC_PLLR_Clock_Divider */
} RCC_PLLInitTypeDef;
/**
* @brief RCC Internal/External Oscillator (HSE, HSI, HSI48, MSI, LSE and LSI) configuration structure definition
*/
typedef struct
{
uint32_t OscillatorType; /*!< The oscillators to be configured.
This parameter can be a combination of @ref RCC_Oscillator_Type */
uint32_t HSEState; /*!< The new state of the HSE.
This parameter can be a value of @ref RCC_HSE_Config */
uint32_t LSEState; /*!< The new state of the LSE.
This parameter can be a value of @ref RCC_LSE_Config */
uint32_t HSIState; /*!< The new state of the HSI.
This parameter can be a value of @ref RCC_HSI_Config */
uint32_t HSICalibrationValue; /*!< The calibration trimming value (default is @ref RCC_HSICALIBRATION_DEFAULT).*/
uint32_t LSIState; /*!< The new state of the LSI.
This parameter can be a value of @ref RCC_LSI_Config */
uint32_t LSI2CalibrationValue; /*!< The LSI2 calibration trimming value .
This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xF */
uint32_t MSIState; /*!< The new state of the MSI.
This parameter can be a value of @ref RCC_MSI_Config */
uint32_t MSICalibrationValue; /*!< The calibration trimming value (default is @ref RCC_MSICALIBRATION_DEFAULT).
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */
uint32_t MSIClockRange; /*!< The MSI frequency range.
This parameter can be a value of @ref RCC_MSI_Clock_Range */
#if defined(RCC_HSI48_SUPPORT)
uint32_t HSI48State; /*!< The new state of the HSI48 .
This parameter can be a value of @ref RCC_HSI48_Config */
#endif
RCC_PLLInitTypeDef PLL; /*!< Main PLL structure parameters */
} RCC_OscInitTypeDef;
/**
* @brief RCC System, AHB and APB buses clock configuration structure definition
*/
typedef struct
{
uint32_t ClockType; /*!< The clock to be configured.
This parameter can be a combination of @ref RCC_System_Clock_Type */
uint32_t SYSCLKSource; /*!< The clock source used as system clock (SYSCLK).
This parameter can be a value of @ref RCC_System_Clock_Source */
uint32_t AHBCLKDivider; /*!< The AHBx clock (HCLK1) divider. This clock is derived from the system clock (SYSCLK).
This parameter can be a value of @ref RCC_AHBx_Clock_Source */
uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_APBx_Clock_Source */
uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_APBx_Clock_Source */
uint32_t AHBCLK2Divider; /*!< The AHB clock (HCLK2) divider. This clock is derived from the system clock (SYSCLK).
This parameter can be a value of @ref RCC_AHBx_Clock_Source */
uint32_t AHBCLK4Divider; /*!< The AHB shared clock (HCLK4) divider. This clock is derived from the system clock (SYSCLK).
This parameter can be a value of @ref RCC_AHBx_Clock_Source */
} RCC_ClkInitTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup RCC_Exported_Constants RCC Exported Constants
* @{
*/
/** @defgroup RCC_Timeout_Value Timeout Values
* @{
*/
#define RCC_DBP_TIMEOUT_VALUE 2U /* 2 ms (minimum Tick + 1) */
#define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT /* LSE timeout in ms */
/**
* @}
*/
/** @defgroup RCC_Oscillator_Type Oscillator Type
* @{
*/
#define RCC_OSCILLATORTYPE_NONE 0x00000000U /*!< Oscillator configuration unchanged */
#define RCC_OSCILLATORTYPE_HSE 0x00000001U /*!< HSE to configure */
#define RCC_OSCILLATORTYPE_HSI 0x00000002U /*!< HSI to configure */
#define RCC_OSCILLATORTYPE_LSE 0x00000004U /*!< LSE to configure */
#define RCC_OSCILLATORTYPE_LSI1 0x00000008U /*!< LSI1 to configure */
#define RCC_OSCILLATORTYPE_LSI2 0x00000010U /*!< LSI2 to configure */
#define RCC_OSCILLATORTYPE_MSI 0x00000020U /*!< MSI to configure */
#if defined(RCC_HSI48_SUPPORT)
#define RCC_OSCILLATORTYPE_HSI48 0x00000040U /*!< HSI48 to configure */
#endif
/**
* @}
*/
/** @defgroup RCC_HSE_Config HSE Config
* @{
*/
#define RCC_HSE_OFF 0x00000000U /*!< HSE clock deactivation */
#define RCC_HSE_ON RCC_CR_HSEON /*!< HSE clock activation */
/**
* @}
*/
/** @defgroup RCC_LSE_Config LSE Config
* @{
*/
#define RCC_LSE_OFF 0x00000000U /*!< LSE clock deactivation */
#define RCC_LSE_ON RCC_BDCR_LSEON /*!< LSE clock activation */
#define RCC_LSE_BYPASS ((uint32_t)(RCC_BDCR_LSEBYP | RCC_BDCR_LSEON)) /*!< External clock source for LSE clock */
/**
* @}
*/
/** @defgroup RCC_HSI_Config HSI Config
* @{
*/
#define RCC_HSI_OFF 0x00000000U /*!< HSI clock deactivation */
#define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */
#define RCC_HSICALIBRATION_DEFAULT 64U /*!< Default HSI calibration trimming value */
/**
* @}
*/
/** @defgroup RCC_LSI_Config LSI Config
* @{
*/
#define RCC_LSI_OFF 0x00000000U /*!< LSI clock deactivation */
#define RCC_LSI_ON (RCC_CSR_LSI1ON | RCC_CSR_LSI2ON) /*!< LSI1 or LSI2 clock activation */
/**
* @}
*/
/** @defgroup RCC_MSI_Config MSI Config
* @{
*/
#define RCC_MSI_OFF 0x00000000U /*!< MSI clock deactivation */
#define RCC_MSI_ON RCC_CR_MSION /*!< MSI clock activation */
#define RCC_MSICALIBRATION_DEFAULT 0U /*!< Default MSI calibration trimming value */
/**
* @}
*/
#if defined(RCC_HSI48_SUPPORT)
/** @defgroup RCC_HSI48_Config HSI48 Config
* @{
*/
#define RCC_HSI48_OFF 0x00000000U /*!< HSI48 clock deactivation */
#define RCC_HSI48_ON RCC_CRRCR_HSI48ON /*!< HSI48 clock activation */
/**
* @}
*/
#endif
/** @defgroup RCC_PLL_Config PLL Config
* @{
*/
#define RCC_PLL_NONE 0x00000000U /*!< PLL configuration unchanged */
#define RCC_PLL_OFF 0x00000001U /*!< PLL deactivation */
#define RCC_PLL_ON 0x00000002U /*!< PLL activation */
/**
* @}
*/
/** @defgroup RCC_PLLM_Clock_Divider PLLM Clock Divider
* @{
*/
#define RCC_PLLM_DIV1 LL_RCC_PLLM_DIV_1 /*!< PLLM division factor = 1 */
#define RCC_PLLM_DIV2 LL_RCC_PLLM_DIV_2 /*!< PLLM division factor = 2 */
#define RCC_PLLM_DIV3 LL_RCC_PLLM_DIV_3 /*!< PLLM division factor = 3 */
#define RCC_PLLM_DIV4 LL_RCC_PLLM_DIV_4 /*!< PLLM division factor = 4 */
#define RCC_PLLM_DIV5 LL_RCC_PLLM_DIV_5 /*!< PLLM division factor = 5 */
#define RCC_PLLM_DIV6 LL_RCC_PLLM_DIV_6 /*!< PLLM division factor = 6 */
#define RCC_PLLM_DIV7 LL_RCC_PLLM_DIV_7 /*!< PLLM division factor = 7 */
#define RCC_PLLM_DIV8 LL_RCC_PLLM_DIV_8 /*!< PLLM division factor = 8 */
/**
* @}
*/
/** @defgroup RCC_PLLP_Clock_Divider PLLP Clock Divider
* @{
*/
#define RCC_PLLP_DIV2 LL_RCC_PLLP_DIV_2 /*!< PLLP division factor = 2 */
#define RCC_PLLP_DIV3 LL_RCC_PLLP_DIV_3 /*!< PLLP division factor = 3 */
#define RCC_PLLP_DIV4 LL_RCC_PLLP_DIV_4 /*!< PLLP division factor = 4 */
#define RCC_PLLP_DIV5 LL_RCC_PLLP_DIV_5 /*!< PLLP division factor = 5 */
#define RCC_PLLP_DIV6 LL_RCC_PLLP_DIV_6 /*!< PLLP division factor = 6 */
#define RCC_PLLP_DIV7 LL_RCC_PLLP_DIV_7 /*!< PLLP division factor = 7 */
#define RCC_PLLP_DIV8 LL_RCC_PLLP_DIV_8 /*!< PLLP division factor = 8 */
#define RCC_PLLP_DIV9 LL_RCC_PLLP_DIV_9 /*!< PLLP division factor = 9 */
#define RCC_PLLP_DIV10 LL_RCC_PLLP_DIV_10 /*!< PLLP division factor = 10 */
#define RCC_PLLP_DIV11 LL_RCC_PLLP_DIV_11 /*!< PLLP division factor = 11 */
#define RCC_PLLP_DIV12 LL_RCC_PLLP_DIV_12 /*!< PLLP division factor = 12 */
#define RCC_PLLP_DIV13 LL_RCC_PLLP_DIV_13 /*!< PLLP division factor = 13 */
#define RCC_PLLP_DIV14 LL_RCC_PLLP_DIV_14 /*!< PLLP division factor = 14 */
#define RCC_PLLP_DIV15 LL_RCC_PLLP_DIV_15 /*!< PLLP division factor = 15 */
#define RCC_PLLP_DIV16 LL_RCC_PLLP_DIV_16 /*!< PLLP division factor = 16 */
#define RCC_PLLP_DIV17 LL_RCC_PLLP_DIV_17 /*!< PLLP division factor = 17 */
#define RCC_PLLP_DIV18 LL_RCC_PLLP_DIV_18 /*!< PLLP division factor = 18 */
#define RCC_PLLP_DIV19 LL_RCC_PLLP_DIV_19 /*!< PLLP division factor = 19 */
#define RCC_PLLP_DIV20 LL_RCC_PLLP_DIV_20 /*!< PLLP division factor = 20 */
#define RCC_PLLP_DIV21 LL_RCC_PLLP_DIV_21 /*!< PLLP division factor = 21 */
#define RCC_PLLP_DIV22 LL_RCC_PLLP_DIV_22 /*!< PLLP division factor = 22 */
#define RCC_PLLP_DIV23 LL_RCC_PLLP_DIV_23 /*!< PLLP division factor = 23 */
#define RCC_PLLP_DIV24 LL_RCC_PLLP_DIV_24 /*!< PLLP division factor = 24 */
#define RCC_PLLP_DIV25 LL_RCC_PLLP_DIV_25 /*!< PLLP division factor = 25 */
#define RCC_PLLP_DIV26 LL_RCC_PLLP_DIV_26 /*!< PLLP division factor = 26 */
#define RCC_PLLP_DIV27 LL_RCC_PLLP_DIV_27 /*!< PLLP division factor = 27 */
#define RCC_PLLP_DIV28 LL_RCC_PLLP_DIV_28 /*!< PLLP division factor = 28 */
#define RCC_PLLP_DIV29 LL_RCC_PLLP_DIV_29 /*!< PLLP division factor = 29 */
#define RCC_PLLP_DIV30 LL_RCC_PLLP_DIV_30 /*!< PLLP division factor = 30 */
#define RCC_PLLP_DIV31 LL_RCC_PLLP_DIV_31 /*!< PLLP division factor = 31 */
#define RCC_PLLP_DIV32 LL_RCC_PLLP_DIV_32 /*!< PLLP division factor = 32 */
/**
* @}
*/
/** @defgroup RCC_PLLQ_Clock_Divider PLLQ Clock Divider
* @{
*/
#define RCC_PLLQ_DIV2 LL_RCC_PLLQ_DIV_2 /*!< PLLQ division factor = 2 */
#define RCC_PLLQ_DIV3 LL_RCC_PLLQ_DIV_3 /*!< PLLQ division factor = 3 */
#define RCC_PLLQ_DIV4 LL_RCC_PLLQ_DIV_4 /*!< PLLQ division factor = 4 */
#define RCC_PLLQ_DIV5 LL_RCC_PLLQ_DIV_5 /*!< PLLQ division factor = 5 */
#define RCC_PLLQ_DIV6 LL_RCC_PLLQ_DIV_6 /*!< PLLQ division factor = 6 */
#define RCC_PLLQ_DIV7 LL_RCC_PLLQ_DIV_7 /*!< PLLQ division factor = 7 */
#define RCC_PLLQ_DIV8 LL_RCC_PLLQ_DIV_8 /*!< PLLQ division factor = 8 */
/**
* @}
*/
/** @defgroup RCC_PLLR_Clock_Divider PLLR Clock Divider
* @{
*/
#define RCC_PLLR_DIV2 LL_RCC_PLLR_DIV_2 /*!< PLLR division factor = 2 */
#define RCC_PLLR_DIV3 LL_RCC_PLLR_DIV_3 /*!< PLLR division factor = 3 */
#define RCC_PLLR_DIV4 LL_RCC_PLLR_DIV_4 /*!< PLLR division factor = 4 */
#define RCC_PLLR_DIV5 LL_RCC_PLLR_DIV_5 /*!< PLLR division factor = 5 */
#define RCC_PLLR_DIV6 LL_RCC_PLLR_DIV_6 /*!< PLLR division factor = 6 */
#define RCC_PLLR_DIV7 LL_RCC_PLLR_DIV_7 /*!< PLLR division factor = 7 */
#define RCC_PLLR_DIV8 LL_RCC_PLLR_DIV_8 /*!< PLLR division factor = 8 */
/**
* @}
*/
/** @defgroup RCC_PLL_Clock_Source PLL Clock Source
* @{
*/
#define RCC_PLLSOURCE_NONE LL_RCC_PLLSOURCE_NONE /*!< No clock selected as PLL entry clock source */
#define RCC_PLLSOURCE_MSI LL_RCC_PLLSOURCE_MSI /*!< MSI clock selected as PLL entry clock source */
#define RCC_PLLSOURCE_HSI LL_RCC_PLLSOURCE_HSI /*!< HSI clock selected as PLL entry clock source */
#define RCC_PLLSOURCE_HSE LL_RCC_PLLSOURCE_HSE /*!< HSE clock selected as PLL entry clock source */
/**
* @}
*/
/** @defgroup RCC_PLL_Clock_Output PLL Clock Output
* @{
*/
#define RCC_PLL_SYSCLK RCC_PLLCFGR_PLLREN /*!< PLLCLK selection from main PLL */
#define RCC_PLL_USBCLK RCC_PLLCFGR_PLLQEN /*!< PLLUSBCLK selection from main PLL */
#define RCC_PLL_RNGCLK RCC_PLLCFGR_PLLQEN /*!< PLLRNGCLK selection from main PLL */
#if defined(SAI1)
#define RCC_PLL_SAI1CLK RCC_PLLCFGR_PLLPEN /*!< PLLSAI1CLK selection from main PLL */
#endif
#define RCC_PLL_ADCCLK RCC_PLLCFGR_PLLPEN /*!< PLLADCCLK selection from main PLL */
/**
* @}
*/
#if defined(SAI1)
/** @defgroup RCC_PLLSAI1_Clock_Output PLLSAI1 Clock Output
* @{
*/
#define RCC_PLLSAI1_ADCCLK RCC_PLLSAI1CFGR_PLLREN /*!< PLLADCCLK selection from PLLSAI1 */
#define RCC_PLLSAI1_USBCLK RCC_PLLSAI1CFGR_PLLQEN /*!< USBCLK selection from PLLSAI1 */
#define RCC_PLLSAI1_SAI1CLK RCC_PLLSAI1CFGR_PLLPEN /*!< PLLSAI1CLK selection from PLLSAI1 */
/**
* @}
*/
#endif
/** @defgroup RCC_MSI_Clock_Range MSI Clock Range
* @{
*/
#define RCC_MSIRANGE_0 LL_RCC_MSIRANGE_0 /*!< MSI = 100 KHz */
#define RCC_MSIRANGE_1 LL_RCC_MSIRANGE_1 /*!< MSI = 200 KHz */
#define RCC_MSIRANGE_2 LL_RCC_MSIRANGE_2 /*!< MSI = 400 KHz */
#define RCC_MSIRANGE_3 LL_RCC_MSIRANGE_3 /*!< MSI = 800 KHz */
#define RCC_MSIRANGE_4 LL_RCC_MSIRANGE_4 /*!< MSI = 1 MHz */
#define RCC_MSIRANGE_5 LL_RCC_MSIRANGE_5 /*!< MSI = 2 MHz */
#define RCC_MSIRANGE_6 LL_RCC_MSIRANGE_6 /*!< MSI = 4 MHz */
#define RCC_MSIRANGE_7 LL_RCC_MSIRANGE_7 /*!< MSI = 8 MHz */
#define RCC_MSIRANGE_8 LL_RCC_MSIRANGE_8 /*!< MSI = 16 MHz */
#define RCC_MSIRANGE_9 LL_RCC_MSIRANGE_9 /*!< MSI = 24 MHz */
#define RCC_MSIRANGE_10 LL_RCC_MSIRANGE_10 /*!< MSI = 32 MHz */
#define RCC_MSIRANGE_11 LL_RCC_MSIRANGE_11 /*!< MSI = 48 MHz */
/**
* @}
*/
/** @defgroup RCC_System_Clock_Type System Clock Type
* @{
*/
#define RCC_CLOCKTYPE_SYSCLK 0x00000001U /*!< SYSCLK to configure */
#define RCC_CLOCKTYPE_HCLK 0x00000002U /*!< HCLK to configure */
#define RCC_CLOCKTYPE_PCLK1 0x00000004U /*!< PCLK1 to configure */
#define RCC_CLOCKTYPE_PCLK2 0x00000008U /*!< PCLK2 to configure */
#define RCC_CLOCKTYPE_HCLK2 0x00000020U /*!< HCLK2 to configure */
#define RCC_CLOCKTYPE_HCLK4 0x00000040U /*!< HCLK4 to configure */
/**
* @}
*/
/** @defgroup RCC_System_Clock_Source System Clock Source
* @{
*/
#define RCC_SYSCLKSOURCE_MSI LL_RCC_SYS_CLKSOURCE_MSI /*!< MSI selection as system clock */
#define RCC_SYSCLKSOURCE_HSI LL_RCC_SYS_CLKSOURCE_HSI /*!< HSI selection as system clock */
#define RCC_SYSCLKSOURCE_HSE LL_RCC_SYS_CLKSOURCE_HSE /*!< HSE selection as system clock */
#define RCC_SYSCLKSOURCE_PLLCLK LL_RCC_SYS_CLKSOURCE_PLL /*!< PLL selection as system clock */
/**
* @}
*/
/** @defgroup RCC_System_Clock_Source_Status System Clock Source Status
* @{
*/
#define RCC_SYSCLKSOURCE_STATUS_MSI LL_RCC_SYS_CLKSOURCE_STATUS_MSI /*!< MSI used as system clock */
#define RCC_SYSCLKSOURCE_STATUS_HSI LL_RCC_SYS_CLKSOURCE_STATUS_HSI /*!< HSI used as system clock */
#define RCC_SYSCLKSOURCE_STATUS_HSE LL_RCC_SYS_CLKSOURCE_STATUS_HSE /*!< HSE used as system clock */
#define RCC_SYSCLKSOURCE_STATUS_PLLCLK LL_RCC_SYS_CLKSOURCE_STATUS_PLL /*!< PLL used as system clock */
/**
* @}
*/
/** @defgroup RCC_AHBx_Clock_Source AHB Clock Source
* @{
*/
#define RCC_SYSCLK_DIV1 LL_RCC_SYSCLK_DIV_1 /*!< SYSCLK not divided */
#define RCC_SYSCLK_DIV2 LL_RCC_SYSCLK_DIV_2 /*!< SYSCLK divided by 2 */
#define RCC_SYSCLK_DIV3 LL_RCC_SYSCLK_DIV_3 /*!< SYSCLK divided by 3 */
#define RCC_SYSCLK_DIV4 LL_RCC_SYSCLK_DIV_4 /*!< SYSCLK divided by 4 */
#define RCC_SYSCLK_DIV5 LL_RCC_SYSCLK_DIV_5 /*!< SYSCLK divided by 5 */
#define RCC_SYSCLK_DIV6 LL_RCC_SYSCLK_DIV_6 /*!< SYSCLK divided by 6 */
#define RCC_SYSCLK_DIV8 LL_RCC_SYSCLK_DIV_8 /*!< SYSCLK divided by 8 */
#define RCC_SYSCLK_DIV10 LL_RCC_SYSCLK_DIV_10 /*!< SYSCLK divided by 10 */
#define RCC_SYSCLK_DIV16 LL_RCC_SYSCLK_DIV_16 /*!< SYSCLK divided by 16 */
#define RCC_SYSCLK_DIV32 LL_RCC_SYSCLK_DIV_32 /*!< SYSCLK divided by 32 */
#define RCC_SYSCLK_DIV64 LL_RCC_SYSCLK_DIV_64 /*!< SYSCLK divided by 64 */
#define RCC_SYSCLK_DIV128 LL_RCC_SYSCLK_DIV_128 /*!< SYSCLK divided by 128 */
#define RCC_SYSCLK_DIV256 LL_RCC_SYSCLK_DIV_256 /*!< SYSCLK divided by 256 */
#define RCC_SYSCLK_DIV512 LL_RCC_SYSCLK_DIV_512 /*!< SYSCLK divided by 512 */
/**
* @}
*/
/** @defgroup RCC_APBx_Clock_Source APB1 Clock Source
* @{
*/
#define RCC_HCLK_DIV1 LL_RCC_APB1_DIV_1 /*!< HCLK not divided */
#define RCC_HCLK_DIV2 LL_RCC_APB1_DIV_2 /*!< HCLK divided by 2 */
#define RCC_HCLK_DIV4 LL_RCC_APB1_DIV_4 /*!< HCLK divided by 4 */
#define RCC_HCLK_DIV8 LL_RCC_APB1_DIV_8 /*!< HCLK divided by 8 */
#define RCC_HCLK_DIV16 LL_RCC_APB1_DIV_16 /*!< HCLK divided by 16 */
/**
* @}
*/
/** @defgroup RCC_RTC_Clock_Source RTC Clock Source
* @{
*/
#define RCC_RTCCLKSOURCE_NONE LL_RCC_RTC_CLKSOURCE_NONE /*!< No clock used as RTC clock */
#define RCC_RTCCLKSOURCE_LSE LL_RCC_RTC_CLKSOURCE_LSE /*!< LSE oscillator clock used as RTC clock */
#define RCC_RTCCLKSOURCE_LSI LL_RCC_RTC_CLKSOURCE_LSI /*!< LSI oscillator clock used as RTC clock */
#define RCC_RTCCLKSOURCE_HSE_DIV32 LL_RCC_RTC_CLKSOURCE_HSE_DIV32 /*!< HSE oscillator clock divided by 32 used as RTC clock */
/**
* @}
*/
/** @defgroup RCC_MCO_Index MCO Index
* @{
*/
#define RCC_MCO1 0x00000000U /*!< MCO1 index */
#define RCC_MCO2 0x00000001U /*!< MCO2 index */
#if defined(RCC_MCO3_SUPPORT)
#define RCC_MCO3 0x00000002U /*!< MCO3 index */
#endif
#define RCC_MCO RCC_MCO1 /*!< MCO1 to be compliant with other families with 1 MCO*/
/**
* @}
*/
/** @defgroup RCC_MCO1_Clock_Source MCO1 Clock Source
* @{
*/
#define RCC_MCO1SOURCE_NOCLOCK LL_RCC_MCO1SOURCE_NOCLOCK /*!< MCO1 output disabled, no clock on MCO1 */
#define RCC_MCO1SOURCE_SYSCLK LL_RCC_MCO1SOURCE_SYSCLK /*!< SYSCLK selection as MCO1 source */
#define RCC_MCO1SOURCE_MSI LL_RCC_MCO1SOURCE_MSI /*!< MSI selection as MCO1 source */
#define RCC_MCO1SOURCE_HSI LL_RCC_MCO1SOURCE_HSI /*!< HSI selection as MCO1 source */
#define RCC_MCO1SOURCE_HSE LL_RCC_MCO1SOURCE_HSE /*!< HSE after stabilization selection as MCO1 source */
#define RCC_MCO1SOURCE_PLLCLK LL_RCC_MCO1SOURCE_PLLCLK /*!< PLLCLK selection as MCO1 source */
#define RCC_MCO1SOURCE_LSI1 LL_RCC_MCO1SOURCE_LSI1 /*!< LSI1 selection as MCO1 source */
#define RCC_MCO1SOURCE_LSI2 LL_RCC_MCO1SOURCE_LSI2 /*!< LSI2 selection as MCO1 source */
#define RCC_MCO1SOURCE_LSE LL_RCC_MCO1SOURCE_LSE /*!< LSE selection as MCO1 source */
#if defined(RCC_HSI48_SUPPORT)
#define RCC_MCO1SOURCE_HSI48 LL_RCC_MCO1SOURCE_HSI48 /*!< HSI48 selection as MCO1 source */
#endif
#define RCC_MCO1SOURCE_HSE_BEFORE_STAB LL_RCC_MCO1SOURCE_HSE_BEFORE_STAB /*!< HSE before stabilization selection as MCO1 source */
/**
* @}
*/
/** @defgroup RCC_MCOx_Clock_Prescaler MCO Clock Prescaler
* @{
*/
#define RCC_MCODIV_1 LL_RCC_MCO1_DIV_1 /*!< MCO not divided */
#define RCC_MCODIV_2 LL_RCC_MCO1_DIV_2 /*!< MCO divided by 2 */
#define RCC_MCODIV_4 LL_RCC_MCO1_DIV_4 /*!< MCO divided by 4 */
#define RCC_MCODIV_8 LL_RCC_MCO1_DIV_8 /*!< MCO divided by 8 */
#define RCC_MCODIV_16 LL_RCC_MCO1_DIV_16 /*!< MCO divided by 16 */
/**
* @}
*/
/** @defgroup RCC_HSEAMPTHRESHOLD HSE bias current factor
* @{
*/
#define RCC_HSEAMPTHRESHOLD_1_2 LL_RCC_HSEAMPTHRESHOLD_1_2 /*!< HSE bias current factor 1/2 */
#define RCC_HSEAMPTHRESHOLD_3_4 LL_RCC_HSEAMPTHRESHOLD_3_4 /*!< HSE bias current factor 3/4 */
/**
* @}
*/
/** @defgroup RCC_HSE_CURRENTMAX HSE current max limit
* @{
*/
#define RCC_HSE_CURRENTMAX_0 LL_RCC_HSE_CURRENTMAX_0 /*!< HSE current max limit 0.18 mA/V */
#define RCC_HSE_CURRENTMAX_1 LL_RCC_HSE_CURRENTMAX_1 /*!< HSE current max limit 0.57 mA/V */
#define RCC_HSE_CURRENTMAX_2 LL_RCC_HSE_CURRENTMAX_2 /*!< HSE current max limit 0.78 mA/V */
#define RCC_HSE_CURRENTMAX_3 LL_RCC_HSE_CURRENTMAX_3 /*!< HSE current max limit 1.13 mA/V */
#define RCC_HSE_CURRENTMAX_4 LL_RCC_HSE_CURRENTMAX_4 /*!< HSE current max limit 0.61 mA/V */
#define RCC_HSE_CURRENTMAX_5 LL_RCC_HSE_CURRENTMAX_5 /*!< HSE current max limit 1.65 mA/V */
#define RCC_HSE_CURRENTMAX_6 LL_RCC_HSE_CURRENTMAX_6 /*!< HSE current max limit 2.12 mA/V */
#define RCC_HSE_CURRENTMAX_7 LL_RCC_HSE_CURRENTMAX_7 /*!< HSE current max limit 2.84 mA/V */
/**
* @}
*/
/** @defgroup RCC_Interrupt Interrupts
* @{
*/
#define RCC_IT_LSI1RDY LL_RCC_CIFR_LSI1RDYF /*!< LSI1 Ready Interrupt flag */
#define RCC_IT_LSI2RDY LL_RCC_CIFR_LSI2RDYF /*!< LSI2 Ready Interrupt flag */
#define RCC_IT_LSERDY LL_RCC_CIFR_LSERDYF /*!< LSE Ready Interrupt flag */
#define RCC_IT_MSIRDY LL_RCC_CIFR_MSIRDYF /*!< MSI Ready Interrupt flag */
#define RCC_IT_HSIRDY LL_RCC_CIFR_HSIRDYF /*!< HSI Ready Interrupt flag */
#define RCC_IT_HSERDY LL_RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */
#define RCC_IT_PLLRDY LL_RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */
#if defined(SAI1)
#define RCC_IT_PLLSAI1RDY LL_RCC_CIFR_PLLSAI1RDYF /*!< PLLSAI1 Ready Interrupt flag */
#endif
#define RCC_IT_HSECSS LL_RCC_CIFR_CSSF /*!< HSE Clock Security System Interrupt flag */
#define RCC_IT_LSECSS LL_RCC_CIFR_LSECSSF /*!< LSE Clock Security System Interrupt flag */
#if defined(RCC_HSI48_SUPPORT)
#define RCC_IT_HSI48RDY LL_RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */
#endif
/**
* @}
*/
/** @defgroup RCC_Flag Flags
* Elements values convention: XXXYYYYYb
* - YYYYY : Flag position in the register
* - XXX : Register index
* - 001: CR register
* - 010: BDCR register
* - 011: CSR register
* - 100: CRRCR register
* @{
*/
/* Flags in the CR register */
#define RCC_FLAG_MSIRDY ((CR_REG_INDEX << 5U) | RCC_CR_MSIRDY_Pos) /*!< MSI Ready flag */
#define RCC_FLAG_HSIRDY ((CR_REG_INDEX << 5U) | RCC_CR_HSIRDY_Pos) /*!< HSI Ready flag */
#define RCC_FLAG_HSERDY ((CR_REG_INDEX << 5U) | RCC_CR_HSERDY_Pos) /*!< HSE Ready flag */
#define RCC_FLAG_PLLRDY ((CR_REG_INDEX << 5U) | RCC_CR_PLLRDY_Pos) /*!< PLL Ready flag */
#if defined(SAI1)
#define RCC_FLAG_PLLSAI1RDY ((CR_REG_INDEX << 5U) | RCC_CR_PLLSAI1RDY_Pos) /*!< PLLSAI1 Ready flag */
#endif
/* Flags in the BDCR register */
#define RCC_FLAG_LSERDY ((BDCR_REG_INDEX << 5U) | RCC_BDCR_LSERDY_Pos) /*!< LSE Ready flag */
#define RCC_FLAG_LSECSSD ((BDCR_REG_INDEX << 5U) | RCC_BDCR_LSECSSD_Pos) /*!< LSE Clock Security System failure detection flag */
/* Flags in the CSR register */
#define RCC_FLAG_LSI1RDY ((CSR_REG_INDEX << 5U) | RCC_CSR_LSI1RDY_Pos) /*!< LSI1 Ready flag */
#define RCC_FLAG_LSI2RDY ((CSR_REG_INDEX << 5U) | RCC_CSR_LSI2RDY_Pos) /*!< LSI2 Ready flag */
#define RCC_FLAG_OBLRST ((CSR_REG_INDEX << 5U) | RCC_CSR_OBLRSTF_Pos) /*!< Option Byte Loader reset flag */
#define RCC_FLAG_PINRST ((CSR_REG_INDEX << 5U) | RCC_CSR_PINRSTF_Pos) /*!< Pin reset flag (NRST pin) */
#define RCC_FLAG_BORRST ((CSR_REG_INDEX << 5U) | RCC_CSR_BORRSTF_Pos) /*!< BOR reset flag */
#define RCC_FLAG_SFTRST ((CSR_REG_INDEX << 5U) | RCC_CSR_SFTRSTF_Pos) /*!< Software Reset flag */
#define RCC_FLAG_IWDGRST ((CSR_REG_INDEX << 5U) | RCC_CSR_IWDGRSTF_Pos) /*!< Watchdog reset flag */
#define RCC_FLAG_WWDGRST ((CSR_REG_INDEX << 5U) | RCC_CSR_WWDGRSTF_Pos) /*!< Window watchdog reset flag */
#define RCC_FLAG_LPWRRST ((CSR_REG_INDEX << 5U) | RCC_CSR_LPWRRSTF_Pos) /*!< Low-Power reset flag */
/* Flags in the CRRCR register */
#if defined(RCC_HSI48_SUPPORT)
#define RCC_FLAG_HSI48RDY ((CRRCR_REG_INDEX << 5U) | RCC_CRRCR_HSI48RDY_Pos) /*!< HSI48 Ready flag */
#endif
/**
* @}
*/
/** @defgroup RCC_LSEDrive_Config LSE Drive Configuration
* @{
*/
#define RCC_LSEDRIVE_LOW LL_RCC_LSEDRIVE_LOW /*!< LSE low drive capability */
#define RCC_LSEDRIVE_MEDIUMLOW LL_RCC_LSEDRIVE_MEDIUMLOW /*!< LSE medium low drive capability */
#define RCC_LSEDRIVE_MEDIUMHIGH LL_RCC_LSEDRIVE_MEDIUMHIGH /*!< LSE medium high drive capability */
#define RCC_LSEDRIVE_HIGH LL_RCC_LSEDRIVE_HIGH /*!< LSE high drive capability */
/**
* @}
*/
/** @defgroup RCC_Stop_WakeUpClock Wake-Up from STOP Clock
* @{
*/
#define RCC_STOP_WAKEUPCLOCK_MSI LL_RCC_STOP_WAKEUPCLOCK_MSI /*!< MSI selection after wake-up from STOP */
#define RCC_STOP_WAKEUPCLOCK_HSI LL_RCC_STOP_WAKEUPCLOCK_HSI /*!< HSI selection after wake-up from STOP */
/**
* @}
*/
/**
* @}
*/
/* Exported macros -----------------------------------------------------------*/
/** @defgroup RCC_Exported_Macros RCC Exported Macros
* @{
*/
/** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable AHB1 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB1 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_DMA1_CLK_ENABLE() LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_CLK_ENABLE() LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_CLK_ENABLE() LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_CRC_CLK_ENABLE() LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_CLK_ENABLE() LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_DMA1_CLK_DISABLE() LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_CLK_DISABLE() LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_CLK_DISABLE() LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_CRC_CLK_DISABLE() LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_CLK_DISABLE() LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_TSC)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Peripheral_Clock_Enable_Disable AHB2 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB2 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_GPIOA_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_GPIOA_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_CLK_DISABLE() LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_AES1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Enable_Disable AHB3 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB3 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_HSEM_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_IPCC_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_FLASH_CLK_ENABLE() LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_FLASH)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_HSEM_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_IPCC_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_FLASH_CLK_DISABLE() LL_AHB3_GRP1_DisableClock(LL_AHB3_GRP1_PERIPH_FLASH)
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Enable_Disable APB1 Peripheral Clock Enable Disable
* @brief Enable or disable the APB1 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_RTCAPB_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_WWDG_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_WWDG)
#define __HAL_RCC_TIM2_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_CLK_ENABLE() LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_LPTIM2_CLK_ENABLE() LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_CLK_ENABLE() LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_RTCAPB_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_TIM2_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_CLK_DISABLE() LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_LPTIM2_CLK_DISABLE() LL_APB1_GRP2_DisableClock(LL_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_CLK_DISABLE() LL_APB1_GRP2_DisableClock(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Enable_Disable APB2 Peripheral Clock Enable Disable
* @brief Enable or disable the APB2 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_CLK_ENABLE() LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_CLK_DISABLE() LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_SAI1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable_Status AHB1 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB1 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_DMA1_IS_CLK_ENABLED() LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_IS_CLK_ENABLED() LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_IS_CLK_ENABLED() LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_CRC_IS_CLK_ENABLED() LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_IS_CLK_ENABLED() LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_DMA1_IS_CLK_DISABLED() !(LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMA1))
#if defined(DMA2)
#define __HAL_RCC_DMA2_IS_CLK_DISABLED() !(LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMA2))
#endif
#define __HAL_RCC_DMAMUX1_IS_CLK_DISABLED() !(LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_DMAMUX1))
#define __HAL_RCC_CRC_IS_CLK_DISABLED() !(LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_CRC))
#if defined(TSC)
#define __HAL_RCC_TSC_IS_CLK_DISABLED() !(LL_AHB1_GRP1_IsEnabledClock(LL_AHB1_GRP1_PERIPH_TSC))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Clock_Enable_Disable_Status AHB2 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB2 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_GPIOA_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_IS_CLK_ENABLED() LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_GPIOA_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOA))
#define __HAL_RCC_GPIOB_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOB))
#define __HAL_RCC_GPIOC_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOC))
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOD))
#endif
#define __HAL_RCC_GPIOE_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOE))
#define __HAL_RCC_GPIOH_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_GPIOH))
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_ADC))
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_IS_CLK_DISABLED() !(LL_AHB2_GRP1_IsEnabledClock(LL_AHB2_GRP1_PERIPH_AES1))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Enable_Disable_Status AHB3 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB3 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_HSEM_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_IPCC_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_FLASH_IS_CLK_ENABLED() LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_FLASH)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_QUADSPI))
#endif
#define __HAL_RCC_PKA_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_PKA))
#define __HAL_RCC_AES2_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_AES2))
#define __HAL_RCC_RNG_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_RNG))
#define __HAL_RCC_HSEM_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_HSEM))
#define __HAL_RCC_IPCC_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_IPCC))
#define __HAL_RCC_FLASH_IS_CLK_DISABLED() !(LL_AHB3_GRP1_IsEnabledClock(LL_AHB3_GRP1_PERIPH_FLASH))
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Enable_Disable_Status APB1 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the APB1 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_RTCAPB_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_WWDG_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_WWDG)
#define __HAL_RCC_TIM2_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_IS_CLK_ENABLED() LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_LPTIM2_IS_CLK_ENABLED() LL_APB1_GRP2_IsEnabledClock(LL_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_IS_CLK_ENABLED() LL_APB1_GRP2_IsEnabledClock(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_RTCAPB_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_RTCAPB))
#define __HAL_RCC_WWDG_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_WWDG))
#define __HAL_RCC_TIM2_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM2))
#if defined(LCD)
#define __HAL_RCC_LCD_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_LCD))
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_SPI2))
#endif
#define __HAL_RCC_I2C1_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_I2C1))
#if defined(I2C3)
#define __HAL_RCC_I2C3_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_I2C3))
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_CRS))
#endif
#if defined(USB)
#define __HAL_RCC_USB_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_USB))
#endif
#define __HAL_RCC_LPTIM1_IS_CLK_DISABLED() !(LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_LPTIM1))
#define __HAL_RCC_LPTIM2_IS_CLK_DISABLED() !(LL_APB1_GRP2_IsEnabledClock(LL_APB1_GRP2_PERIPH_LPTIM2))
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_IS_CLK_DISABLED() !(LL_APB1_GRP2_IsEnabledClock(LL_APB1_GRP2_PERIPH_LPUART1))
#endif
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Enable_Disable_Status APB2 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the APB2 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_IS_CLK_ENABLED() LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_ADC))
#endif
#define __HAL_RCC_TIM1_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM1))
#define __HAL_RCC_SPI1_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_SPI1))
#define __HAL_RCC_USART1_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_USART1))
#define __HAL_RCC_TIM16_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM16))
#define __HAL_RCC_TIM17_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM17))
#if defined(SAI1)
#define __HAL_RCC_SAI1_IS_CLK_DISABLED() !(LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_SAI1))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable AHB1 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB1 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2DMA1_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_C2DMAMUX1_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_C2SRAM1_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_C2CRC_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_C2TSC_CLK_ENABLE() LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_C2DMA1_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_C2DMAMUX1_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_C2SRAM1_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_C2CRC_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_C2TSC_CLK_DISABLE() LL_C2_AHB1_GRP1_DisableClock(LL_C2_AHB1_GRP1_PERIPH_TSC)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Peripheral_Clock_Enable_Disable AHB2 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB2 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2GPIOA_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_C2GPIOB_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_C2GPIOC_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_C2GPIOE_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_C2GPIOH_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_CLK_ENABLE() LL_C2_AHB2_GRP1_EnableClock(LL_C2_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_C2GPIOA_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_C2GPIOB_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_C2GPIOC_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_C2GPIOE_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_C2GPIOH_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_CLK_DISABLE() LL_C2_AHB2_GRP1_DisableClock(LL_C2_AHB2_GRP1_PERIPH_AES1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Enable_Disable AHB3 Peripheral Clock Enable Disable
* @brief Enable or disable the AHB3 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2PKA_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_C2AES2_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_C2RNG_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_C2HSEM_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_C2IPCC_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_C2FLASH_CLK_ENABLE() LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_FLASH)
#define __HAL_RCC_C2PKA_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_C2AES2_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_C2RNG_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_C2HSEM_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_C2IPCC_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_C2FLASH_CLK_DISABLE() LL_C2_AHB3_GRP1_DisableClock(LL_C2_AHB3_GRP1_PERIPH_FLASH)
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Enable_Disable APB1 Peripheral Clock Enable Disable
* @brief Enable or disable the APB1 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2RTCAPB_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_C2TIM2_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_C2LCD_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_C2I2C1_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_C2LPTIM1_CLK_ENABLE() LL_C2_APB1_GRP1_EnableClock(LL_C2_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_C2LPTIM2_CLK_ENABLE() LL_C2_APB1_GRP2_EnableClock(LL_C2_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_CLK_ENABLE() LL_C2_APB1_GRP2_EnableClock(LL_C2_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_C2RTCAPB_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_C2TIM2_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_C2LCD_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_C2I2C1_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_C2LPTIM1_CLK_DISABLE() LL_C2_APB1_GRP1_DisableClock(LL_C2_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_C2LPTIM2_CLK_DISABLE() LL_C2_APB1_GRP2_DisableClock(LL_C2_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_CLK_DISABLE() LL_C2_APB1_GRP2_DisableClock(LL_C2_APB1_GRP2_PERIPH_LPUART1)
#endif
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Enable_Disable APB2 Peripheral Clock Enable Disable
* @brief Enable or disable the APB2 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_C2TIM1_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_C2SPI1_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_C2USART1_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_C2TIM16_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_C2TIM17_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_CLK_ENABLE() LL_C2_APB2_GRP1_EnableClock(LL_C2_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_C2TIM1_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_C2SPI1_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_C2USART1_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_C2TIM16_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_C2TIM17_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_CLK_DISABLE() LL_C2_APB2_GRP1_DisableClock(LL_C2_APB2_GRP1_PERIPH_SAI1)
#endif
/**
* @}
*/
/** @defgroup RCC_APB3_Clock_Enable_Disable APB3 Peripheral Clock Enable Disable
* @brief Enable or disable the APB3 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2BLE_CLK_ENABLE() LL_C2_APB3_GRP1_EnableClock(LL_C2_APB3_GRP1_PERIPH_BLE)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_CLK_ENABLE() LL_C2_APB3_GRP1_EnableClock(LL_C2_APB3_GRP1_PERIPH_802)
#endif
#define __HAL_RCC_C2BLE_CLK_DISABLE() LL_C2_APB3_GRP1_DisableClock(LL_C2_APB3_GRP1_PERIPH_BLE)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_CLK_DISABLE() LL_C2_APB3_GRP1_DisableClock(LL_C2_APB3_GRP1_PERIPH_802)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable_Status AHB1 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB1 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2DMA1_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_C2DMAMUX1_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_C2SRAM1_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_C2CRC_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_C2TSC_IS_CLK_ENABLED() LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_C2DMA1_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMA1))
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMA2))
#endif
#define __HAL_RCC_C2DMAMUX1_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1))
#define __HAL_RCC_C2SRAM1_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1))
#define __HAL_RCC_C2CRC_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_CRC))
#if defined(TSC)
#define __HAL_RCC_C2TSC_IS_CLK_DISABLED() !(LL_C2_AHB1_GRP1_IsEnabledClock(LL_C2_AHB1_GRP1_PERIPH_TSC))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Clock_Enable_Disable_Status AHB2 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB2 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2GPIOA_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_C2GPIOB_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_C2GPIOC_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_C2GPIOE_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_C2GPIOH_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_IS_CLK_ENABLED() LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_C2GPIOA_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOA))
#define __HAL_RCC_C2GPIOB_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOB))
#define __HAL_RCC_C2GPIOC_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOC))
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOD))
#endif
#define __HAL_RCC_C2GPIOE_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOE))
#define __HAL_RCC_C2GPIOH_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_GPIOH))
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_ADC))
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_IS_CLK_DISABLED() !(LL_C2_AHB2_GRP1_IsEnabledClock(LL_C2_AHB2_GRP1_PERIPH_AES1))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Enable_Disable_Status AHB3 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the AHB3 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2PKA_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_C2AES2_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_C2RNG_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_C2HSEM_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_C2IPCC_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_C2FLASH_IS_CLK_ENABLED() LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_FLASH)
#define __HAL_RCC_C2PKA_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_PKA))
#define __HAL_RCC_C2AES2_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_AES2))
#define __HAL_RCC_C2RNG_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_RNG))
#define __HAL_RCC_C2HSEM_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_HSEM))
#define __HAL_RCC_C2IPCC_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_IPCC))
#define __HAL_RCC_C2FLASH_IS_CLK_DISABLED() !(LL_C2_AHB3_GRP1_IsEnabledClock(LL_C2_AHB3_GRP1_PERIPH_FLASH))
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Enable_Disable_Status APB1 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the APB1 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2RTCAPB_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_C2TIM2_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_C2LCD_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_C2I2C1_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_C2LPTIM1_IS_CLK_ENABLED() LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_C2LPTIM2_IS_CLK_ENABLED() LL_C2_APB1_GRP2_IsEnabledClock(LL_C2_APB1_GRP2_PERIPH_LPTIM2)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_IS_CLK_ENABLED() LL_C2_APB1_GRP2_IsEnabledClock(LL_C2_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_C2RTCAPB_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_RTCAPB))
#define __HAL_RCC_C2TIM2_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_TIM2))
#if defined(LCD)
#define __HAL_RCC_C2LCD_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_LCD))
#endif
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_SPI2))
#endif
#define __HAL_RCC_C2I2C1_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_I2C1))
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_I2C3))
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_CRS))
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_USB))
#endif
#define __HAL_RCC_C2LPTIM1_IS_CLK_DISABLED() !(LL_C2_APB1_GRP1_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_LPTIM1))
#define __HAL_RCC_C2LPTIM2_IS_CLK_DISABLED() !(LL_C2_APB1_GRP2_IsEnabledClock(LL_C2_APB1_GRP2_PERIPH_LPTIM2))
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_IS_CLK_DISABLED() !(LL_C2_APB1_GRP2_IsEnabledClock(LL_C2_APB1_GRP1_PERIPH_LPTIM1))
#endif
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Enable_Disable_Status APB2 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the APB2 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_C2TIM1_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_C2SPI1_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_C2USART1_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_C2TIM16_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_C2TIM17_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_IS_CLK_ENABLED() LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_ADC))
#endif
#define __HAL_RCC_C2TIM1_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM1))
#define __HAL_RCC_C2SPI1_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_SPI1))
#define __HAL_RCC_C2USART1_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_USART1))
#define __HAL_RCC_C2TIM16_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM16))
#define __HAL_RCC_C2TIM17_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_TIM17))
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_IS_CLK_DISABLED() !( LL_C2_APB2_GRP1_IsEnabledClock(LL_C2_APB2_GRP1_PERIPH_SAI1))
#endif
/**
* @}
*/
/** @defgroup RCC_APB3_Clock_Enable_Disable_Status APB3 Peripheral Clock Enabled or Disabled Status
* @brief Check whether the APB3 peripheral clock is enabled or not.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @{
*/
#define __HAL_RCC_C2BLE_IS_CLK_ENABLED() LL_C2_APB3_GRP1_IsEnabledClock(LL_C2_APB3_GRP1_PERIPH_BLE)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_IS_CLK_ENABLED() LL_C2_APB3_GRP1_IsEnabledClock(LL_C2_APB3_GRP1_PERIPH_802)
#endif
#define __HAL_RCC_C2BLE_IS_CLK_DISABLED() !(LL_C2_APB3_GRP1_IsEnabledClock(LL_C2_APB3_GRP1_PERIPH_BLE))
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_IS_CLK_DISABLED() !(LL_C2_APB3_GRP1_IsEnabledClock(LL_C2_APB3_GRP1_PERIPH_802))
#endif
/**
* @}
*/
/** @defgroup RCC_AHB1_Force_Release_Reset AHB1 Peripheral Force Release Reset
* @brief Force or release AHB1 peripheral reset.
* @{
*/
#define __HAL_RCC_AHB1_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_ALL)
#define __HAL_RCC_DMA1_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_CRC_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_FORCE_RESET() LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_AHB1_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_ALL)
#define __HAL_RCC_DMA1_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_CRC_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_RELEASE_RESET() LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_TSC)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Force_Release_Reset AHB2 Peripheral Force Release Reset
* @brief Force or release AHB2 peripheral reset.
* @{
*/
#define __HAL_RCC_AHB2_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_ALL)
#define __HAL_RCC_GPIOA_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_FORCE_RESET() LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_AHB2_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_ALL)
#define __HAL_RCC_GPIOA_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_RELEASE_RESET() LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_AES1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Force_Release_Reset AHB3 Peripheral Force Release Reset
* @brief Force or release AHB3 peripheral reset.
* @{
*/
#define __HAL_RCC_AHB3_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_ALL)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_HSEM_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_IPCC_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_FLASH_FORCE_RESET() LL_AHB3_GRP1_ForceReset(LL_AHB3_GRP1_PERIPH_FLASH)
#define __HAL_RCC_AHB3_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_ALL)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_HSEM_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_HSEM)
#define __HAL_RCC_IPCC_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_IPCC)
#define __HAL_RCC_FLASH_RELEASE_RESET() LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_FLASH)
/**
* @}
*/
/** @defgroup RCC_APB1_Force_Release_Reset APB1 Peripheral Force Release Reset
* @brief Force or release APB1 peripheral reset.
* @{
*/
#define __HAL_RCC_APB1L_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_ALL)
#define __HAL_RCC_TIM2_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_FORCE_RESET() LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_APB1H_FORCE_RESET() LL_APB1_GRP2_ForceReset(LL_APB1_GRP2_PERIPH_ALL)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_FORCE_RESET() LL_APB1_GRP2_ForceReset(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_LPTIM2_FORCE_RESET() LL_APB1_GRP2_ForceReset(LL_APB1_GRP2_PERIPH_LPTIM2)
#define __HAL_RCC_APB1_FORCE_RESET() do { \
__HAL_RCC_APB1L_FORCE_RESET();\
__HAL_RCC_APB1H_FORCE_RESET();\
} while(0U)
#define __HAL_RCC_APB1L_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_ALL)
#define __HAL_RCC_TIM2_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_LCD)
#endif
#if defined(SPI2)
#define __HAL_RCC_SPI2_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_RELEASE_RESET() LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_LPTIM1)
#define __HAL_RCC_APB1H_RELEASE_RESET() LL_APB1_GRP2_ReleaseReset(LL_APB1_GRP2_PERIPH_ALL)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_RELEASE_RESET() LL_APB1_GRP2_ReleaseReset(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_LPTIM2_RELEASE_RESET() LL_APB1_GRP2_ReleaseReset(LL_APB1_GRP2_PERIPH_LPTIM2)
#define __HAL_RCC_APB1_RELEASE_RESET() do { \
__HAL_RCC_APB1L_RELEASE_RESET();\
__HAL_RCC_APB1H_RELEASE_RESET();\
} while(0U)
/**
* @}
*/
/** @defgroup RCC_APB2_Force_Release_Reset APB2 Peripheral Force Release Reset
* @brief Force or release APB2 peripheral reset.
* @{
*/
#define __HAL_RCC_APB2_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_ALL)
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_FORCE_RESET() LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_SAI1)
#endif
#define __HAL_RCC_APB2_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_ALL)
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_RELEASE_RESET() LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_SAI1)
#endif
/**
* @}
*/
/** @defgroup RCC_APB3_Force_Release_Reset APB3 Peripheral Force Release Reset
* @brief Force or release APB3 peripheral reset.
* @{
*/
#define __HAL_RCC_APB3_FORCE_RESET() LL_APB3_GRP1_ForceReset(LL_APB3_GRP1_PERIPH_ALL)
#define __HAL_RCC_RF_FORCE_RESET() LL_APB3_GRP1_ForceReset(LL_APB3_GRP1_PERIPH_RF)
#define __HAL_RCC_APB3_RELEASE_RESET() LL_APB3_GRP1_ReleaseReset(LL_APB3_GRP1_PERIPH_ALL)
#define __HAL_RCC_RF_RELEASE_RESET() LL_APB3_GRP1_ReleaseReset(LL_APB3_GRP1_PERIPH_RF)
/**
* @}
*/
/** @defgroup RCC_AHB1_Clock_Sleep_Enable_Disable AHB1 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_CLK_SLEEP_ENABLE() LL_AHB1_GRP1_EnableClockSleep(LL_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_DMAMUX1_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_TSC_CLK_SLEEP_DISABLE() LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_C2DMA1_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_C2DMAMUX1_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_C2SRAM1_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_C2CRC_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_C2TSC_CLK_SLEEP_ENABLE() LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_TSC)
#endif
#define __HAL_RCC_C2DMA1_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMA1)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMA2)
#endif
#define __HAL_RCC_C2DMAMUX1_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_DMAMUX1)
#define __HAL_RCC_C2SRAM1_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_SRAM1)
#define __HAL_RCC_C2CRC_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_CRC)
#if defined(TSC)
#define __HAL_RCC_C2TSC_CLK_SLEEP_DISABLE() LL_C2_AHB1_GRP1_DisableClockSleep(LL_C2_AHB1_GRP1_PERIPH_TSC)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Clock_Sleep_Enable_Disable AHB2 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_CLK_SLEEP_ENABLE() LL_AHB2_GRP1_EnableClockSleep(LL_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_CLK_SLEEP_DISABLE() LL_AHB2_GRP1_DisableClockSleep(LL_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_C2GPIOA_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_C2GPIOB_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_C2GPIOC_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_C2GPIOE_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_C2GPIOH_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_CLK_SLEEP_ENABLE() LL_C2_AHB2_GRP1_EnableClockSleep(LL_C2_AHB2_GRP1_PERIPH_AES1)
#endif
#define __HAL_RCC_C2GPIOA_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOA)
#define __HAL_RCC_C2GPIOB_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOB)
#define __HAL_RCC_C2GPIOC_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOC)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOD)
#endif
#define __HAL_RCC_C2GPIOE_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOE)
#define __HAL_RCC_C2GPIOH_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_GPIOH)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_ADC)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_CLK_SLEEP_DISABLE() LL_C2_AHB2_GRP1_DisableClockSleep(LL_C2_AHB2_GRP1_PERIPH_AES1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Sleep_Enable_Disable AHB3 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_SRAM2)
#define __HAL_RCC_FLASH_CLK_SLEEP_ENABLE() LL_AHB3_GRP1_EnableClockSleep(LL_AHB3_GRP1_PERIPH_FLASH)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_QUADSPI)
#endif
#define __HAL_RCC_PKA_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_AES2_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_RNG_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_SRAM2)
#define __HAL_RCC_FLASH_CLK_SLEEP_DISABLE() LL_AHB3_GRP1_DisableClockSleep(LL_AHB3_GRP1_PERIPH_FLASH)
#define __HAL_RCC_C2PKA_CLK_SLEEP_ENABLE() LL_C2_AHB3_GRP1_EnableClockSleep(LL_C2_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_C2AES2_CLK_SLEEP_ENABLE() LL_C2_AHB3_GRP1_EnableClockSleep(LL_C2_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_C2RNG_CLK_SLEEP_ENABLE() LL_C2_AHB3_GRP1_EnableClockSleep(LL_C2_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_C2SRAM2_CLK_SLEEP_ENABLE() LL_C2_AHB3_GRP1_EnableClockSleep(LL_C2_AHB3_GRP1_PERIPH_SRAM2)
#define __HAL_RCC_C2FLASH_CLK_SLEEP_ENABLE() LL_C2_AHB3_GRP1_EnableClockSleep(LL_C2_AHB3_GRP1_PERIPH_FLASH)
#define __HAL_RCC_C2PKA_CLK_SLEEP_DISABLE() LL_C2_AHB3_GRP1_DisableClockSleep(LL_C2_AHB3_GRP1_PERIPH_PKA)
#define __HAL_RCC_C2AES2_CLK_SLEEP_DISABLE() LL_C2_AHB3_GRP1_DisableClockSleep(LL_C2_AHB3_GRP1_PERIPH_AES2)
#define __HAL_RCC_C2RNG_CLK_SLEEP_DISABLE() LL_C2_AHB3_GRP1_DisableClockSleep(LL_C2_AHB3_GRP1_PERIPH_RNG)
#define __HAL_RCC_C2SRAM2_CLK_SLEEP_DISABLE() LL_C2_AHB3_GRP1_DisableClockSleep(LL_C2_AHB3_GRP1_PERIPH_SRAM2)
#define __HAL_RCC_C2FLASH_CLK_SLEEP_DISABLE() LL_C2_AHB3_GRP1_DisableClockSleep(LL_C2_AHB3_GRP1_PERIPH_FLASH)
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable APB1 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_LCD)
#endif
#define __HAL_RCC_RTCAPB_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_WWDG_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_WWDG)
#if defined(SPI2)
#define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE() LL_APB1_GRP1_EnableClockSleep(LL_APB1_GRP1_PERIPH_LPTIM1)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE() LL_APB1_GRP2_EnableClockSleep(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE() LL_APB1_GRP2_EnableClockSleep(LL_APB1_GRP2_PERIPH_LPTIM2)
#define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_LCD_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_LCD)
#endif
#define __HAL_RCC_RTCAPB_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_RTCAPB)
#define __HAL_RCC_WWDG_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_WWDG)
#if defined(SPI2)
#define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_USB_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE() LL_APB1_GRP1_DisableClockSleep(LL_APB1_GRP1_PERIPH_LPTIM1)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE() LL_APB1_GRP2_DisableClockSleep(LL_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE() LL_APB1_GRP2_DisableClockSleep(LL_APB1_GRP2_PERIPH_LPTIM2)
#define __HAL_RCC_C2TIM2_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_C2LCD_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_LCD)
#endif
#define __HAL_RCC_C2RTCAPB_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_RTCAPB)
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_C2I2C1_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_C2LPTIM1_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP1_EnableClockSleep(LL_C2_APB1_GRP1_PERIPH_LPTIM1)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP2_EnableClockSleep(LL_C2_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_C2LPTIM2_CLK_SLEEP_ENABLE() LL_C2_APB1_GRP2_EnableClockSleep(LL_C2_APB1_GRP2_PERIPH_LPTIM2)
#define __HAL_RCC_C2TIM2_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_TIM2)
#if defined(LCD)
#define __HAL_RCC_C2LCD_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_LCD)
#endif
#define __HAL_RCC_C2RTCAPB_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_RTCAPB)
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_SPI2)
#endif
#define __HAL_RCC_C2I2C1_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_I2C1)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_I2C3)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_CRS)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_USB)
#endif
#define __HAL_RCC_C2LPTIM1_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP1_DisableClockSleep(LL_C2_APB1_GRP1_PERIPH_LPTIM1)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP2_DisableClockSleep(LL_C2_APB1_GRP2_PERIPH_LPUART1)
#endif
#define __HAL_RCC_C2LPTIM2_CLK_SLEEP_DISABLE() LL_C2_APB1_GRP2_DisableClockSleep(LL_C2_APB1_GRP2_PERIPH_LPTIM2)
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable APB2 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() LL_APB2_GRP1_EnableClockSleep(LL_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_TIM16_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_TIM17_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() LL_APB2_GRP1_DisableClockSleep(LL_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_C2TIM1_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_C2SPI1_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_C2USART1_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_C2TIM16_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_C2TIM17_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_CLK_SLEEP_ENABLE() LL_C2_APB2_GRP1_EnableClockSleep(LL_C2_APB2_GRP1_PERIPH_SAI1)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_ADC)
#endif
#define __HAL_RCC_C2TIM1_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM1)
#define __HAL_RCC_C2SPI1_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_SPI1)
#define __HAL_RCC_C2USART1_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_USART1)
#define __HAL_RCC_C2TIM16_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM16)
#define __HAL_RCC_C2TIM17_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_TIM17)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_CLK_SLEEP_DISABLE() LL_C2_APB2_GRP1_DisableClockSleep(LL_C2_APB2_GRP1_PERIPH_SAI1)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB1_Clock_Sleep_Enable_Disable_Status AHB1 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the AHB1 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_DMA1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN) != RESET)
#if defined(DMA2)
#define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN) != RESET)
#endif
#define __HAL_RCC_DMAMUX1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMAMUX1SMEN) != RESET)
#define __HAL_RCC_SRAM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN) != RESET)
#define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN) != RESET)
#if defined(TSC)
#define __HAL_RCC_TSC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN) != RESET)
#endif
#define __HAL_RCC_DMA1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN) == RESET)
#if defined(DMA2)
#define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN) == RESET)
#endif
#define __HAL_RCC_DMAMUX1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMAMUX1SMEN) == RESET)
#define __HAL_RCC_SRAM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN) == RESET)
#define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN) == RESET)
#if defined(TSC)
#define __HAL_RCC_TSC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN) == RESET)
#endif
#define __HAL_RCC_C2DMA1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMA1SMEN) != RESET)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMA2SMEN) != RESET)
#endif
#define __HAL_RCC_C2DMAMUX1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMAMUX1SMEN) != RESET)
#define __HAL_RCC_C2SRAM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_SRAM1SMEN) != RESET)
#define __HAL_RCC_C2CRC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_CRCSMEN) != RESET)
#if defined(TSC)
#define __HAL_RCC_C2TSC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_TSCSMEN) != RESET)
#endif
#define __HAL_RCC_C2DMA1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMA1SMEN) == RESET)
#if defined(DMA2)
#define __HAL_RCC_C2DMA2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMA2SMEN) == RESET)
#endif
#define __HAL_RCC_C2DMAMUX1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_DMAMUX1SMEN) == RESET)
#define __HAL_RCC_C2SRAM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_SRAM1SMEN) == RESET)
#define __HAL_RCC_C2CRC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_CRCSMEN) == RESET)
#if defined(TSC)
#define __HAL_RCC_C2TSC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB1SMENR, RCC_C2AHB1SMENR_TSCSMEN) == RESET)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB2_Clock_Sleep_Enable_Disable_Status AHB2 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the AHB2 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN) != RESET)
#define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN) != RESET)
#define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN) != RESET)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN) != RESET)
#endif
#define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN) != RESET)
#define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN) != RESET)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN) != RESET)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AES1SMEN) != RESET)
#endif
#define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN) == RESET)
#define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN) == RESET)
#define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN) == RESET)
#if defined(GPIOD)
#define __HAL_RCC_GPIOD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN) == RESET)
#endif
#define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN) == RESET)
#define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN) == RESET)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN) == RESET)
#endif
#if defined(AES1)
#define __HAL_RCC_AES1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AES1SMEN) == RESET)
#endif
#define __HAL_RCC_C2GPIOA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOASMEN) != RESET)
#define __HAL_RCC_C2GPIOB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOBSMEN) != RESET)
#define __HAL_RCC_C2GPIOC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOCSMEN) != RESET)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIODSMEN) != RESET)
#endif
#define __HAL_RCC_C2GPIOE_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOESMEN) != RESET)
#define __HAL_RCC_C2GPIOH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOHSMEN) != RESET)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_ADCSMEN) != RESET)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_AES1SMEN) != RESET)
#endif
#define __HAL_RCC_C2GPIOA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOASMEN) == RESET)
#define __HAL_RCC_C2GPIOB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOBSMEN) == RESET)
#define __HAL_RCC_C2GPIOC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOCSMEN) == RESET)
#if defined(GPIOD)
#define __HAL_RCC_C2GPIOD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIODSMEN) == RESET)
#endif
#define __HAL_RCC_C2GPIOE_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOESMEN) == RESET)
#define __HAL_RCC_C2GPIOH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_GPIOHSMEN) == RESET)
#if defined(ADC_SUPPORT_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_ADCSMEN) == RESET)
#endif
#if defined(AES1)
#define __HAL_RCC_C2AES1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB2SMENR, RCC_C2AHB2SMENR_AES1SMEN) == RESET)
#endif
/**
* @}
*/
/** @defgroup RCC_AHB3_Clock_Sleep_Enable_Disable_Status AHB3 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the AHB3 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QUADSPISMEN) != RESET)
#endif
#define __HAL_RCC_PKA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_PKASMEN) != RESET)
#define __HAL_RCC_AES2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_AES2SMEN) != RESET)
#define __HAL_RCC_RNG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_RNGSMEN) != RESET)
#define __HAL_RCC_SRAM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_SRAM2SMEN) != RESET)
#define __HAL_RCC_FLASH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FLASHSMEN) != RESET)
#if defined(QUADSPI)
#define __HAL_RCC_QUADSPI_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QUADSPISMEN) == RESET)
#endif
#define __HAL_RCC_PKA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_PKASMEN) == RESET)
#define __HAL_RCC_AES2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_AES2SMEN) == RESET)
#define __HAL_RCC_RNG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_RNGSMEN) == RESET)
#define __HAL_RCC_SRAM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_SRAM2SMEN) == RESET)
#define __HAL_RCC_FLASH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FLASHSMEN) == RESET)
#define __HAL_RCC_C2PKA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_PKASMEN) != RESET)
#define __HAL_RCC_C2AES2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_AES2SMEN) != RESET)
#define __HAL_RCC_C2RNG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_RNGSMEN) != RESET)
#define __HAL_RCC_C2SRAM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_SRAM2SMEN) != RESET)
#define __HAL_RCC_C2FLASH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_FLASHSMEN) != RESET)
#define __HAL_RCC_C2PKA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_PKASMEN) == RESET)
#define __HAL_RCC_C2AES2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_AES2SMEN) == RESET)
#define __HAL_RCC_C2RNG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_RNGSMEN) == RESET)
#define __HAL_RCC_C2SRAM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_SRAM2SMEN) == RESET)
#define __HAL_RCC_C2FLASH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2AHB3SMENR, RCC_C2AHB3SMENR_FLASHSMEN) == RESET)
/**
* @}
*/
/** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable_Status APB1 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the APB1 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_TIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN) != RESET)
#if defined(LCD)
#define __HAL_RCC_LCD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN) != RESET)
#endif
#define __HAL_RCC_RTCAPB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN) != RESET)
#define __HAL_RCC_WWDG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN) != RESET)
#if defined(SPI2)
#define __HAL_RCC_SPI2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN) != RESET)
#endif
#define __HAL_RCC_I2C1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN) != RESET)
#if defined(I2C3)
#define __HAL_RCC_I2C3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN) != RESET)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN) != RESET)
#endif
#if defined(USB)
#define __HAL_RCC_USB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBSMEN) != RESET)
#endif
#define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN) != RESET)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN) != RESET)
#endif
#define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN) != RESET)
#define __HAL_RCC_TIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN) == RESET)
#if defined(LCD)
#define __HAL_RCC_LCD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN) == RESET)
#endif
#define __HAL_RCC_RTCAPB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN) == RESET)
#define __HAL_RCC_WWDG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN) == RESET)
#if defined(SPI2)
#define __HAL_RCC_SPI2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN) == RESET)
#endif
#define __HAL_RCC_I2C1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN) == RESET)
#if defined(I2C3)
#define __HAL_RCC_I2C3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN) == RESET)
#endif
#if defined(CRS)
#define __HAL_RCC_CRS_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN) == RESET)
#endif
#if defined(USB)
#define __HAL_RCC_USB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBSMEN) == RESET)
#endif
#define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN) == RESET)
#if defined(LPUART1)
#define __HAL_RCC_LPUART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN) == RESET)
#endif
#define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN) == RESET)
#define __HAL_RCC_C2TIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_TIM2SMEN) != RESET)
#if defined(LCD)
#define __HAL_RCC_C2LCD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_LCDSMEN) != RESET)
#endif
#define __HAL_RCC_C2RTCAPB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_RTCAPBSMEN) != RESET)
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_SPI2SMEN) != RESET)
#endif
#define __HAL_RCC_C2I2C1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_I2C1SMEN) != RESET)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_I2C3SMEN) != RESET)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_CRSSMEN) != RESET)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_USBSMEN) != RESET)
#endif
#define __HAL_RCC_C2LPTIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_LPTIM1SMEN) != RESET)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR2, RCC_C2APB1SMENR2_LPUART1SMEN) != RESET)
#endif
#define __HAL_RCC_C2LPTIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB1SMENR2, RCC_C2APB1SMENR2_LPTIM2SMEN) != RESET)
#define __HAL_RCC_C2TIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_TIM2SMEN) == RESET)
#if defined(LCD)
#define __HAL_RCC_C2LCD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_LCDSMEN) == RESET)
#endif
#define __HAL_RCC_C2RTCAPB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_RTCAPBSMEN) == RESET)
#if defined(SPI2)
#define __HAL_RCC_C2SPI2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_SPI2SMEN) == RESET)
#endif
#define __HAL_RCC_C2I2C1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_I2C1SMEN) == RESET)
#if defined(I2C3)
#define __HAL_RCC_C2I2C3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_I2C3SMEN) == RESET)
#endif
#if defined(CRS)
#define __HAL_RCC_C2CRS_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_CRSSMEN) == RESET)
#endif
#if defined(USB)
#define __HAL_RCC_C2USB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_USBSMEN) == RESET)
#endif
#define __HAL_RCC_C2LPTIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR1, RCC_C2APB1SMENR1_LPTIM1SMEN) == RESET)
#if defined(LPUART1)
#define __HAL_RCC_C2LPUART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR2, RCC_C2APB1SMENR2_LPUART1SMEN) == RESET)
#endif
#define __HAL_RCC_C2LPTIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB1SMENR2, RCC_C2APB1SMENR2_LPTIM2SMEN) == RESET)
/**
* @}
*/
/** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable_Status APB2 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the APB2 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_ADCSMEN) != RESET)
#endif
#define __HAL_RCC_TIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN) != RESET)
#define __HAL_RCC_SPI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN) != RESET)
#define __HAL_RCC_USART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN) != RESET)
#define __HAL_RCC_TIM16_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN) != RESET)
#define __HAL_RCC_TIM17_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN) != RESET)
#if defined(SAI1)
#define __HAL_RCC_SAI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN) != RESET)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_ADC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_ADCSMEN) == RESET)
#endif
#define __HAL_RCC_TIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN) == RESET)
#define __HAL_RCC_SPI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN) == RESET)
#define __HAL_RCC_USART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN) == RESET)
#define __HAL_RCC_TIM16_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN) == RESET)
#define __HAL_RCC_TIM17_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN) == RESET)
#if defined(SAI1)
#define __HAL_RCC_SAI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN) == RESET)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_ADCSMEN) != RESET)
#endif
#define __HAL_RCC_C2TIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM1SMEN) != RESET)
#define __HAL_RCC_C2SPI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_SPI1SMEN) != RESET)
#define __HAL_RCC_C2USART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_USART1SMEN) != RESET)
#define __HAL_RCC_C2TIM16_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM16SMEN) != RESET)
#define __HAL_RCC_C2TIM17_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM17SMEN) != RESET)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_SAI1SMEN) != RESET)
#endif
#if defined(ADC_SUPPORT_2_5_MSPS)
#define __HAL_RCC_C2ADC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_ADCSMEN) == RESET)
#endif
#define __HAL_RCC_C2TIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM1SMEN) == RESET)
#define __HAL_RCC_C2SPI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_SPI1SMEN) == RESET)
#define __HAL_RCC_C2USART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_USART1SMEN) == RESET)
#define __HAL_RCC_C2TIM16_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM16SMEN) == RESET)
#define __HAL_RCC_C2TIM17_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_TIM17SMEN) == RESET)
#if defined(SAI1)
#define __HAL_RCC_C2SAI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB2SMENR, RCC_C2APB2SMENR_SAI1SMEN) == RESET)
#endif
/**
* @}
*/
/** @defgroup RCC_C2APB3_Clock_Sleep_Enable_Disable APB3 Peripheral Clock Sleep Enable Disable
* @brief Enable or disable the APB3 peripheral clock during Low Power (Sleep) mode.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_C2BLE_CLK_SLEEP_ENABLE() LL_C2_APB3_GRP1_EnableClockSleep(LL_C2_APB3_GRP1_PERIPH_BLE)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_CLK_SLEEP_ENABLE() LL_C2_APB3_GRP1_EnableClockSleep(LL_C2_APB3_GRP1_PERIPH_802)
#endif
#define __HAL_RCC_C2BLE_CLK_SLEEP_DISABLE() LL_C2_APB3_GRP1_DisableClockSleep(LL_C2_APB3_GRP1_PERIPH_BLE)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_CLK_SLEEP_DISABLE() LL_C2_APB3_GRP1_DisableClockSleep(LL_C2_APB3_GRP1_PERIPH_802)
#endif
/**
* @}
*/
/** @defgroup RCC_C2APB3_Clock_Sleep_Enable_Disable_Status APB3 Peripheral Clock Sleep Enabled or Disabled Status
* @brief Check whether the APB3 peripheral clock during Low Power (Sleep) mode is enabled or not.
* @note Peripheral clock gating in SLEEP mode can be used to further reduce
* power consumption.
* @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
* @note By default, all peripheral clocks are enabled during SLEEP mode.
* @{
*/
#define __HAL_RCC_C2BLE_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB3SMENR, RCC_C2APB3SMENR_BLESMEN) != RESET)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->C2APB3SMENR, RCC_C2APB3SMENR_802SMEN) != RESET)
#endif
#define __HAL_RCC_C2BLE_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB3SMENR, RCC_C2APB3SMENR_BLESMEN) == RESET)
#if defined(RCC_802_SUPPORT)
#define __HAL_RCC_C2802_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->C2APB3SMENR, RCC_C2APB3SMENR_802SMEN) == RESET)
#endif
/**
* @}
*/
/** @defgroup RCC_Backup_Domain_Reset RCC Backup Domain Reset
* @{
*/
/** @brief Macros to force or release the Backup domain reset.
* @note This function resets the RTC peripheral (including the backup registers)
* and the RTC clock source selection in RCC_CSR register.
* @note The BKPSRAM is not affected by this reset.
* @retval None
*/
#define __HAL_RCC_BACKUPRESET_FORCE() LL_RCC_ForceBackupDomainReset()
#define __HAL_RCC_BACKUPRESET_RELEASE() LL_RCC_ReleaseBackupDomainReset()
/**
* @}
*/
/** @defgroup RCC_RTC_Clock_Configuration RCC RTC Clock Configuration
* @{
*/
/** @brief Macros to enable or disable the RTC clock.
* @note As the RTC is in the Backup domain and write access is denied to
* this domain after reset, you have to enable write access using
* HAL_PWR_EnableBkUpAccess() function before to configure the RTC
* (to be done once after reset).
* @note These macros must be used after the RTC clock source was selected.
* @retval None
*/
#define __HAL_RCC_RTC_ENABLE() LL_RCC_EnableRTC()
#define __HAL_RCC_RTC_DISABLE() LL_RCC_DisableRTC()
/**
* @}
*/
/** @brief Macros to enable the Internal High Speed oscillator (HSI).
* @note The HSI is stopped by hardware when entering STOP, STANDBY or SHUTDOWN modes.
* It is enabled by hardware to force the HSI oscillator ON when STOPWUCK=1
* or HSIASFS = 1 when leaving Stop modes, or in case of failure of the HSE
* crystal oscillator and Security System CSS is enabled.
* @note After enabling the HSI, the application software should wait on HSIRDY
* flag to be set indicating that HSI clock is stable and can be used as
* system clock source.
* @retval None
*/
#define __HAL_RCC_HSI_ENABLE() LL_RCC_HSI_Enable()
/** @brief Macro to disable the Internal High Speed oscillator (HSI).
* @note HSI can not be stopped if it is used as system clock source. In this case,
* you have to select another source of the system clock then stop the HSI.
* @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
* clock cycles.
* @retval None
*/
#define __HAL_RCC_HSI_DISABLE() LL_RCC_HSI_Disable()
/** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value.
* @note The calibration is used to compensate for the variations in voltage
* and temperature that influence the frequency of the internal HSI RC.
* @param __HSICALIBRATIONVALUE__ specifies the calibration trimming value
* (default is RCC_HSICALIBRATION_DEFAULT).
* This parameter must be a number between Min_data=0 and Max_Data=127.
* @retval None
*/
#define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICALIBRATIONVALUE__) LL_RCC_HSI_SetCalibTrimming(__HSICALIBRATIONVALUE__)
/**
* @brief Macros to enable or disable the wakeup the Internal High Speed oscillator (HSI)
* in parallel to the Internal Multi Speed oscillator (MSI) used at system wakeup.
* @note The enable of this function has not effect on the HSION bit.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
#define __HAL_RCC_HSIAUTOMATIC_START_ENABLE() LL_RCC_HSI_EnableAutoFromStop()
#define __HAL_RCC_HSIAUTOMATIC_START_DISABLE() LL_RCC_HSI_DisableAutoFromStop()
/**
* @brief Macros to enable or disable the force of the Internal High Speed oscillator (HSI)
* in STOP mode to be quickly available as kernel clock for USARTs and I2Cs.
* @note Keeping the HSI ON in STOP mode allows to avoid slowing down the communication
* speed because of the HSI startup time.
* @note The enable of this function has not effect on the HSION bit.
* @retval None
*/
#define __HAL_RCC_HSISTOP_ENABLE() LL_RCC_HSI_EnableInStopMode()
#define __HAL_RCC_HSISTOP_DISABLE() LL_RCC_HSI_DisableInStopMode()
/**
* @brief Macros to enable or disable the Internal Multi Speed oscillator (MSI).
* @note The MSI is stopped by hardware when entering STOP and STANDBY modes.
* It is used (enabled by hardware) as system clock source after
* startup from Reset, wakeup from STOP and STANDBY mode, or in case
* of failure of the HSE used directly or indirectly as system clock
* (if the Clock Security System CSS is enabled).
* @note MSI can not be stopped if it is used as system clock source.
* In this case, you have to select another source of the system
* clock then stop the MSI.
* @note After enabling the MSI, the application software should wait on
* MSIRDY flag to be set indicating that MSI clock is stable and can
* be used as system clock source.
* @note When the MSI is stopped, MSIRDY flag goes low after 6 MSI oscillator
* clock cycles.
* @retval None
*/
#define __HAL_RCC_MSI_ENABLE() LL_RCC_MSI_Enable()
#define __HAL_RCC_MSI_DISABLE() LL_RCC_MSI_Disable()
/** @brief Macro to adjust the Internal Multi Speed oscillator (MSI) calibration value.
* @note The calibration is used to compensate for the variations in voltage
* and temperature that influence the frequency of the internal MSI RC.
* Refer to the Application Note AN3300 for more details on how to
* calibrate the MSI.
* @param __MSICALIBRATIONVALUE__ specifies the calibration trimming value
* (default is @ref RCC_MSICALIBRATION_DEFAULT).
* This parameter must be a number between 0 and 255.
* @retval None
*/
#define __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(__MSICALIBRATIONVALUE__) LL_RCC_MSI_SetCalibTrimming(__MSICALIBRATIONVALUE__)
/**
* @brief Macro configures the Internal Multi Speed oscillator (MSI) clock range in run mode
* @note After restart from Reset , the MSI clock is around 4 MHz.
* After stop the startup clock can be MSI (at any of its possible
* frequencies, the one that was used before entering stop mode) or HSI.
* After Standby its frequency can be selected between 4 possible values
* (1, 2, 4 or 8 MHz).
* @note MSIRANGE can be modified when MSI is OFF (MSION=0) or when MSI is ready
* (MSIRDY=1).
* @note The MSI clock range after reset can be modified on the fly.
* @param __MSIRANGEVALUE__ specifies the MSI clock range.
* This parameter must be one of the following values:
* @arg @ref RCC_MSIRANGE_0 MSI clock is around 100 KHz
* @arg @ref RCC_MSIRANGE_1 MSI clock is around 200 KHz
* @arg @ref RCC_MSIRANGE_2 MSI clock is around 400 KHz
* @arg @ref RCC_MSIRANGE_3 MSI clock is around 800 KHz
* @arg @ref RCC_MSIRANGE_4 MSI clock is around 1 MHz
* @arg @ref RCC_MSIRANGE_5 MSI clock is around 2MHz
* @arg @ref RCC_MSIRANGE_6 MSI clock is around 4MHz (default after Reset)
* @arg @ref RCC_MSIRANGE_7 MSI clock is around 8 MHz
* @arg @ref RCC_MSIRANGE_8 MSI clock is around 16 MHz
* @arg @ref RCC_MSIRANGE_9 MSI clock is around 24 MHz
* @arg @ref RCC_MSIRANGE_10 MSI clock is around 32 MHz
* @arg @ref RCC_MSIRANGE_11 MSI clock is around 48 MHz
* @retval None
*/
#define __HAL_RCC_MSI_RANGE_CONFIG(__MSIRANGEVALUE__) LL_RCC_MSI_SetRange(__MSIRANGEVALUE__)
/** @brief Macro to get the Internal Multi Speed oscillator (MSI) clock range in run mode
* @retval MSI clock range.
* This parameter must be one of the following values:
* @arg @ref RCC_MSIRANGE_0 MSI clock is around 100 KHz
* @arg @ref RCC_MSIRANGE_1 MSI clock is around 200 KHz
* @arg @ref RCC_MSIRANGE_2 MSI clock is around 400 KHz
* @arg @ref RCC_MSIRANGE_3 MSI clock is around 800 KHz
* @arg @ref RCC_MSIRANGE_4 MSI clock is around 1 MHz
* @arg @ref RCC_MSIRANGE_5 MSI clock is around 2 MHz
* @arg @ref RCC_MSIRANGE_6 MSI clock is around 4 MHz (default after Reset)
* @arg @ref RCC_MSIRANGE_7 MSI clock is around 8 MHz
* @arg @ref RCC_MSIRANGE_8 MSI clock is around 16 MHz
* @arg @ref RCC_MSIRANGE_9 MSI clock is around 24 MHz
* @arg @ref RCC_MSIRANGE_10 MSI clock is around 32 MHz
* @arg @ref RCC_MSIRANGE_11 MSI clock is around 48 MHz
*/
#define __HAL_RCC_GET_MSI_RANGE() LL_RCC_MSI_GetRange()
/** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI1).
* @note After enabling the LSI1, the application software should wait on
* LSI1RDY flag to be set indicating that LSI1 clock is stable and can
* be used to clock the IWDG and/or the RTC.
* @retval None
*/
#define __HAL_RCC_LSI1_ENABLE() LL_RCC_LSI1_Enable()
#define __HAL_RCC_LSI1_DISABLE() LL_RCC_LSI1_Disable()
/** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI2).
* @note After enabling the LSI2, the application software should wait on
* LSI2RDY flag to be set indicating that LSI2 clock is stable and can
* be used to clock the IWDG and/or the RTC.
* @retval None
*/
#define __HAL_RCC_LSI2_ENABLE() LL_RCC_LSI2_Enable()
#define __HAL_RCC_LSI2_DISABLE() LL_RCC_LSI2_Disable()
/** @brief Macro to adjust the Internal Low Speed oscillator (LSI2) calibration value.
* @note The calibration is used to compensate for the variations in voltage
* and temperature that influence the frequency of the internal HSI RC.
* @param __LSI2TRIMMINGVALUE__ specifies the calibration trimming value
* This parameter must be a number between Min_data=0 and Max_Data=15.
* @retval None
*/
#define __HAL_RCC_LSI2_CALIBRATIONVALUE_ADJUST(__LSI2TRIMMINGVALUE__) LL_RCC_LSI2_SetTrimming(__LSI2TRIMMINGVALUE__)
/**
* @brief Macro to configure the External High Speed oscillator (HSE).
* @note After enabling the HSE (RCC_HSE_ON), the application
* software should wait on HSERDY flag to be set indicating that HSE clock
* is stable and can be used to clock the PLL and/or system clock.
* @note HSE state can not be changed if it is used directly or through the
* PLL as system clock. In this case, you have to select another source
* of the system clock then change the HSE state (ex. disable it).
* @note The HSE is stopped by hardware when entering STOP and STANDBY modes.
* @note This function reset the CSSON bit, so if the clock security system(CSS)
* was previously enabled you have to enable it again after calling this
* function.
* @param __STATE__ specifies the new state of the HSE.
* This parameter can be one of the following values:
* @arg @ref RCC_HSE_OFF Turn OFF the HSE oscillator, HSERDY flag goes low after
* 6 HSE oscillator clock cycles.
* @arg @ref RCC_HSE_ON Turn ON the HSE oscillator.
* @note (*) Value not defined for all devices
* @retval None
*/
#define __HAL_RCC_HSE_CONFIG(__STATE__) \
do { \
if((__STATE__) == RCC_HSE_ON) \
{ \
LL_RCC_HSE_Enable(); \
} \
else \
{ \
LL_RCC_HSE_Disable(); \
} \
} while(0U)
/** @brief Macros to enable or disable the HSE Prescaler
* @note HSE div2 could be used as Sysclk or PLL entry in Range2
* @retval None
*/
#define __HAL_RCC_HSE_DIV2_ENABLE() LL_RCC_HSE_EnableDiv2()
#define __HAL_RCC_HSE_DIV2_DISABLE() LL_RCC_HSE_DisableDiv2()
/**
* @brief Macro to configure the External Low Speed oscillator (LSE).
* @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not
* supported by this macro. User should request a transition to LSE Off
* first and then LSE On or LSE Bypass.
* @note As the LSE is in the Backup domain and write access is denied to
* this domain after reset, you have to enable write access using
* HAL_PWR_EnableBkUpAccess() function before to configure the LSE
* (to be done once after reset).
* @note After enabling the LSE (RCC_LSE_ON or RCC_LSE_BYPASS), the application
* software should wait on LSERDY flag to be set indicating that LSE clock
* is stable and can be used to clock the RTC.
* @param __STATE__ specifies the new state of the LSE.
* This parameter can be one of the following values:
* @arg @ref RCC_LSE_OFF Turn OFF the LSE oscillator, LSERDY flag goes low after
* 6 LSE oscillator clock cycles.
* @arg @ref RCC_LSE_ON Turn ON the LSE oscillator.
* @arg @ref RCC_LSE_BYPASS LSE oscillator bypassed with external clock.
* @retval None
*/
#define __HAL_RCC_LSE_CONFIG(__STATE__) \
do { \
if((__STATE__) == RCC_LSE_ON) \
{ \
LL_RCC_LSE_Enable(); \
} \
else if((__STATE__) == RCC_LSE_BYPASS) \
{ \
LL_RCC_LSE_EnableBypass(); \
LL_RCC_LSE_Enable(); \
} \
else \
{ \
LL_RCC_LSE_Disable(); \
LL_RCC_LSE_DisableBypass(); \
} \
} while(0U)
#if defined(RCC_HSI48_SUPPORT)
/** @brief Macros to enable or disable the Internal High Speed 48MHz oscillator (HSI48).
* @note The HSI48 is stopped by hardware when entering STOP and STANDBY modes.
* @note After enabling the HSI48, the application software should wait on HSI48RDY
* flag to be set indicating that HSI48 clock is stable.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
#define __HAL_RCC_HSI48_ENABLE() LL_RCC_HSI48_Enable()
#define __HAL_RCC_HSI48_DISABLE() LL_RCC_HSI48_Disable()
#endif
/** @brief Macros to configure HSE sense amplifier threshold.
* @note to configure HSE sense amplifier, first disable HSE
* using @ref __HAL_RCC_HSE_CONFIG(RCC_HSE_OFF) macro.
*
* @param __HSE_AMPTHRES__ specifies the HSE sense amplifier threshold.
* This parameter can be one of the following values:
* @arg @ref RCC_HSEAMPTHRESHOLD_1_2 HSE bias current factor 1/2.
* @arg @ref RCC_HSEAMPTHRESHOLD_3_4 HSE bias current factor 3/4.
* @retval None
*/
#define __HAL_RCC_HSE_AMPCONFIG(__HSE_AMPTHRES__) LL_RCC_HSE_SetSenseAmplifier(__HSE_AMPTHRES__)
/** @brief Macros to configure HSE current control.
* @note to configure HSE current control, first disable HSE
* using @ref __HAL_RCC_HSE_CONFIG(RCC_HSE_OFF) macro.
*
* @param __HSE_CURRENTMAX__ specifies the HSE current max limit.
* This parameter can be one of the following values:
* @arg @ref RCC_HSE_CURRENTMAX_0 HSE current max limit 0.18 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_1 HSE current max limit 0.57 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_2 HSE current max limit 0.78 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_3 HSE current max limit 1.13 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_4 HSE current max limit 0.61 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_5 HSE current max limit 1.65 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_6 HSE current max limit 2.12 mA/V.
* @arg @ref RCC_HSE_CURRENTMAX_7 HSE current max limit 2.84 mA/V.
* @retval None
*/
#define __HAL_RCC_HSE_CURRENTCONFIG(__HSE_CURRENTMAX__) LL_RCC_HSE_SetCurrentControl(__HSE_CURRENTMAX__)
/** @brief Macros to configure HSE capacitor tuning.
* @note to configure HSE current control, first disable HSE
* using __HAL_RCC_HSE_CONFIG(RCC_HSE_OFF) macro.
*
* @param __HSE_LOAD_CAPACITANCE__ specifies the HSE capacitor value.
* This Value Between Min_Data = 0 and Max_Data = 63
* @retval None
*/
#define __HAL_RCC_HSE_CAPACITORTUNING(__HSE_LOAD_CAPACITANCE__) LL_RCC_HSE_SetCapacitorTuning(__HSE_LOAD_CAPACITANCE__)
/** @brief Macros to configure the RTC clock (RTCCLK).
* @param __RTC_CLKSOURCE__ specifies the RTC clock source.
* This parameter can be one of the following values:
* @arg @ref RCC_RTCCLKSOURCE_NONE none clock selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 selected
* @note As the RTC clock configuration bits are in the Backup domain and write
* access is denied to this domain after reset, you have to enable write
* access using the Power Backup Access macro before to configure
* the RTC clock source (to be done once after reset).
* @note Once the RTC clock is configured it cannot be changed unless the
* Backup domain is reset using @ref __HAL_RCC_BACKUPRESET_FORCE() macro, or by
* a Power On Reset (POR).
* @note If the LSE or LSI is used as RTC clock source, the RTC continues to
* work in STOP and STANDBY modes, and can be used as wakeup source.
* However, when the HSE clock is used as RTC clock source, the RTC
* cannot be used in STOP and STANDBY modes.
* @note The maximum input clock frequency for RTC is 1MHz (when using HSE as
* RTC clock source).
* @retval None
*/
#define __HAL_RCC_RTC_CONFIG(__RTC_CLKSOURCE__) LL_RCC_SetRTCClockSource(__RTC_CLKSOURCE__)
/** @brief Macro to get the RTC clock source.
* @retval The returned value can be one of the following:
* @arg @ref RCC_RTCCLKSOURCE_NONE none clock selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock.
* @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 selected
*/
#define __HAL_RCC_GET_RTC_SOURCE() LL_RCC_GetRTCClockSource()
/** @brief Macros to enable or disable the main PLL.
* @note After enabling the main PLL, the application software should wait on
* PLLRDY flag to be set indicating that PLL clock is stable and can
* be used as system clock source.
* @note The main PLL can not be disabled if it is used as system clock source
* @note The main PLL is disabled by hardware when entering STOP and STANDBY modes.
* @retval None
*/
#define __HAL_RCC_PLL_ENABLE() LL_RCC_PLL_Enable()
#define __HAL_RCC_PLL_DISABLE() LL_RCC_PLL_Disable()
/** @brief Macro to configure the PLL clock source.
* @param __PLLSOURCE__ specifies the PLL entry clock source.
* This parameter can be one of the following values:
* @arg @ref RCC_PLLSOURCE_NONE No clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_MSI MSI oscillator clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry
* @note This function must be used only when the main PLL is disabled.
* @note This clock source is common for the main PLL and audio PLL (PLL and PLLSAI1).
* @retval None
*
*/
#define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__) \
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
/** @brief Macro to configure the PLL multiplication factor.
* @note This function must be used only when the main PLL is disabled.
* @param __PLLM__ specifies the division factor for PLL VCO input clock
* This parameter must be a value of @ref RCC_PLLM_Clock_Divider.
* @note You have to set the PLLM parameter correctly to ensure that the VCO input
* frequency ranges from 4 to 16 MHz. It is recommended to select a frequency
* of 16 MHz to limit PLL jitter.
* @retval None
*
*/
#define __HAL_RCC_PLL_PLLM_CONFIG(__PLLM__) \
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLM, (__PLLM__))
/**
* @brief Macro to configure the main PLL clock source, multiplication and division factors.
* @note This function must be used only when the main PLL is disabled.
*
* @param __PLLSOURCE__ specifies the PLL entry clock source.
* This parameter can be one of the following values:
* @arg @ref RCC_PLLSOURCE_NONE No clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_MSI MSI oscillator clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry
* @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry
* @note This clock source is common for the main PLL and audio PLL (PLL and PLLSAI1).
*
* @param __PLLM__ specifies the division factor for PLL VCO input clock.
* This parameter must be a value of @ref RCC_PLLM_Clock_Divider.
* @note You have to set the PLLM parameter correctly to ensure that the VCO input
* frequency ranges from 2.66 to 16 MHz. It is recommended to select a frequency
* of 16 MHz to limit PLL jitter.
*
* @param __PLLN__ specifies the multiplication factor for PLL VCO output clock.
* This parameter must be a number between 6 and 127.
* @note You have to set the PLLN parameter correctly to ensure that the VCO
* output frequency is between 96 and 344 MHz.
*
* @param __PLLP__ specifies the division factor for ADC and SAI1 clock.
* This parameter must be a value of @ref RCC_PLLP_Clock_Divider.
*
* @param __PLLQ__ specifies the division factor for USB and RNG clocks.
* This parameter must be a value of @ref RCC_PLLQ_Clock_Divider
* @note If the USB FS is used in your application, you have to set the
* PLLQ parameter correctly to have 48 MHz clock for the USB. However,
* the RNG need a frequency lower than or equal to 48 MHz to work
* correctly.
*
* @param __PLLR__ specifies the division factor for the main system clock.
* This parameter must be a value of @ref RCC_PLLR_Clock_Divider
* @note You have to set the PLLR parameter correctly to not exceed 48 MHZ.
* @retval None
*/
#define __HAL_RCC_PLL_CONFIG(__PLLSOURCE__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__,__PLLR__ ) \
MODIFY_REG( RCC->PLLCFGR, \
(RCC_PLLCFGR_PLLSRC | \
RCC_PLLCFGR_PLLM | \
RCC_PLLCFGR_PLLN | \
RCC_PLLCFGR_PLLP | \
RCC_PLLCFGR_PLLQ | \
RCC_PLLCFGR_PLLR), \
((uint32_t) (__PLLSOURCE__) | \
(uint32_t) (__PLLM__) | \
(uint32_t) ((__PLLN__) << RCC_PLLCFGR_PLLN_Pos) | \
(uint32_t) (__PLLP__) | \
(uint32_t) (__PLLQ__) | \
(uint32_t) (__PLLR__)))
/** @brief Macro to get the oscillator used as PLL clock source.
* @retval The oscillator used as PLL clock source. The returned value can be one
* of the following:
* @arg @ref RCC_PLLSOURCE_NONE No oscillator is used as PLL clock source.
* @arg @ref RCC_PLLSOURCE_MSI MSI oscillator is used as PLL clock source.
* @arg @ref RCC_PLLSOURCE_HSI HSI oscillator is used as PLL clock source.
* @arg @ref RCC_PLLSOURCE_HSE HSE oscillator is used as PLL clock source.
*/
#define __HAL_RCC_GET_PLL_OSCSOURCE() LL_RCC_PLL_GetMainSource()
/**
* @brief Enable or disable each clock output (RCC_PLL_SYSCLK, RCC_PLL_USBCLK, RCC_PLL_SAI1CLK)
* @note Enabling/disabling clock outputs RCC_PLL_SAI1CLK and RCC_PLL_USBCLK can be done at anytime
* without the need to stop the PLL in order to save power. But RCC_PLL_SYSCLK cannot
* be stopped if used as System Clock.
* @param __PLLCLOCKOUT__ specifies the PLL clock to be output.
* This parameter can be one or a combination of the following values:
* @arg @ref RCC_PLL_SAI1CLK This clock is used to generate the clock for SAI
* @arg @ref RCC_PLL_ADCCLK This clock is used to generate the clock for ADC
* @arg @ref RCC_PLL_USBCLK This Clock is used to generate the clock for the USB FS (48 MHz)
* @arg @ref RCC_PLL_RNGCLK This clock is used to generate the clock for RNG
* @arg @ref RCC_PLL_SYSCLK This Clock is used to generate the high speed system clock (up to 64MHz)
* @retval None
*/
#define __HAL_RCC_PLLCLKOUT_ENABLE(__PLLCLOCKOUT__) SET_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
#define __HAL_RCC_PLLCLKOUT_DISABLE(__PLLCLOCKOUT__) CLEAR_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
/**
* @brief Get clock output enable status (RCC_PLL_SYSCLK, RCC_PLL_USBCLK, RCC_PLL_SAI1CLK)
* @param __PLLCLOCKOUT__ specifies the output PLL clock to be checked.
* This parameter can be one of the following values:
* @arg @ref RCC_PLL_SAI1CLK This clock is used to generate an accurate clock to achieve high-quality audio performance on SAI interface
* @arg @ref RCC_PLL_ADCCLK same
* @arg @ref RCC_PLL_USBCLK This Clock is used to generate the clock for the USB FS (48 MHz)
* @arg @ref RCC_PLL_RNGCLK same
* @arg @ref RCC_PLL_SYSCLK This Clock is used to generate the high speed system clock (up to 64MHz)
* @retval SET / RESET
*/
#define __HAL_RCC_GET_PLLCLKOUT_CONFIG(__PLLCLOCKOUT__) READ_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
/**
* @brief Macro to configure the system clock source.
* @param __SYSCLKSOURCE__ specifies the system clock source.
* This parameter can be one of the following values:
* @arg @ref RCC_SYSCLKSOURCE_MSI MSI oscillator is used as system clock source.
* @arg @ref RCC_SYSCLKSOURCE_HSI HSI oscillator is used as system clock source.
* @arg @ref RCC_SYSCLKSOURCE_HSE HSE oscillator is used as system clock source.
* @arg @ref RCC_SYSCLKSOURCE_PLLCLK PLL output is used as system clock source.
* @retval None
*/
#define __HAL_RCC_SYSCLK_CONFIG(__SYSCLKSOURCE__) LL_RCC_SetSysClkSource(__SYSCLKSOURCE__)
/** @brief Macro to get the clock source used as system clock.
* @retval The clock source used as system clock. The returned value can be one
* of the following:
* @arg @ref RCC_SYSCLKSOURCE_STATUS_MSI MSI used as system clock.
* @arg @ref RCC_SYSCLKSOURCE_STATUS_HSI HSI used as system clock.
* @arg @ref RCC_SYSCLKSOURCE_STATUS_HSE HSE used as system clock.
* @arg @ref RCC_SYSCLKSOURCE_STATUS_PLLCLK PLL used as system clock.
*/
#define __HAL_RCC_GET_SYSCLK_SOURCE() LL_RCC_GetSysClkSource()
/**
* @brief Macro to configure the External Low Speed oscillator (LSE) drive capability.
* @note As the LSE is in the Backup domain and write access is denied to
* this domain after reset, you have to enable write access using
* HAL_PWR_EnableBkUpAccess() function before to configure the LSE
* (to be done once after reset).
* @param __LSEDRIVE__ specifies the new state of the LSE drive capability.
* This parameter can be one of the following values:
* @arg @ref RCC_LSEDRIVE_LOW LSE oscillator low drive capability.
* @arg @ref RCC_LSEDRIVE_MEDIUMLOW LSE oscillator medium low drive capability.
* @arg @ref RCC_LSEDRIVE_MEDIUMHIGH LSE oscillator medium high drive capability.
* @arg @ref RCC_LSEDRIVE_HIGH LSE oscillator high drive capability.
* @retval None
*/
#define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) LL_RCC_LSE_SetDriveCapability(__LSEDRIVE__)
/**
* @brief Macro to configure the wake up from stop clock.
* @param __STOPWUCLK__ specifies the clock source used after wake up from stop.
* This parameter can be one of the following values:
* @arg @ref RCC_STOP_WAKEUPCLOCK_MSI MSI selected as system clock source
* @arg @ref RCC_STOP_WAKEUPCLOCK_HSI HSI selected as system clock source
* @retval None
*/
#define __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(__STOPWUCLK__) LL_RCC_SetClkAfterWakeFromStop(__STOPWUCLK__)
/** @brief Macro to configure the MCO clock.
* @param __MCOCLKSOURCE__ specifies the MCO clock source.
* This parameter can be one of the following values:
* @arg @ref RCC_MCO1SOURCE_NOCLOCK MCO output disabled
* @arg @ref RCC_MCO1SOURCE_SYSCLK System clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_MSI MSI clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_HSI HSI clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_HSE HSE clock selected as MCO sourcee
* @arg @ref RCC_MCO1SOURCE_PLLCLK Main PLL clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_LSI1 LSI1 clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_LSI2 LSI2 clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_LSE LSE clock selected as MCO source
* @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO source (*)
*
* @param __MCODIV__ specifies the MCO clock prescaler.
* This parameter can be one of the following values:
* @arg @ref RCC_MCODIV_1 MCO clock source is divided by 1
* @arg @ref RCC_MCODIV_2 MCO clock source is divided by 2
* @arg @ref RCC_MCODIV_4 MCO clock source is divided by 4
* @arg @ref RCC_MCODIV_8 MCO clock source is divided by 8
* @arg @ref RCC_MCODIV_16 MCO clock source is divided by 16
*
* @note (*) Value not defined for all devices
*/
#define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) LL_RCC_ConfigMCO((__MCOCLKSOURCE__), (__MCODIV__))
/** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management
* @brief macros to manage the specified RCC Flags and interrupts.
* @{
*/
/** @brief Enable RCC interrupt.
* @param __INTERRUPT__ specifies the RCC interrupt sources to be enabled.
* This parameter can be any combination of the following values:
* @arg @ref RCC_IT_LSI1RDY LSI1 ready interrupt enable
* @arg @ref RCC_IT_LSERDY LSE ready interrupt enable
* @arg @ref RCC_IT_MSIRDY HSI ready interrupt enable
* @arg @ref RCC_IT_HSIRDY HSI ready interrupt enable
* @arg @ref RCC_IT_HSERDY HSE ready interrupt enable
* @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt enable
* @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt enable
* @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt enable
* @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt enable (*)
* @arg @ref RCC_IT_LSI2RDY LSI2 ready interrupt enable
*
* @note (*) Value not defined for all devices
*
* @retval None
*/
#define __HAL_RCC_ENABLE_IT(__INTERRUPT__) SET_BIT(RCC->CIER, (__INTERRUPT__))
/** @brief Disable RCC interrupt.
* @param __INTERRUPT__ specifies the RCC interrupt sources to be disabled.
* This parameter can be any combination of the following values:
* @arg @ref RCC_IT_LSI1RDY LSI1 ready interrupt enable
* @arg @ref RCC_IT_LSERDY LSE ready interrupt enable
* @arg @ref RCC_IT_MSIRDY HSI ready interrupt enable
* @arg @ref RCC_IT_HSIRDY HSI ready interrupt enable
* @arg @ref RCC_IT_HSERDY HSE ready interrupt enable
* @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt enable
* @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt enable
* @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt enable
* @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt enable (*)
* @arg @ref RCC_IT_LSI2RDY LSI2 ready interrupt enable
*
* @note (*) Value not defined for all devices
*
* @retval None
*/
#define __HAL_RCC_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(RCC->CIER, (__INTERRUPT__))
/** @brief Clear RCC interrupt pending bits (Perform Byte access to RCC_CICR[17:0]
* bits to clear the selected interrupt pending bits.
* @param __INTERRUPT__ specifies the interrupt pending bit to clear.
* This parameter can be any combination of the following values:
* @arg @ref RCC_IT_LSI1RDY LSI1 ready interrupt clear
* @arg @ref RCC_IT_LSERDY LSE ready interrupt clear
* @arg @ref RCC_IT_MSIRDY HSI ready interrupt clear
* @arg @ref RCC_IT_HSIRDY HSI ready interrupt clear
* @arg @ref RCC_IT_HSERDY HSE ready interrupt clear
* @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt clear
* @arg @ref RCC_IT_PLLRDY PLLSAI1 ready interrupt clear
* @arg @ref RCC_IT_HSECSS HSE Clock security system interrupt clear
* @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt clear
* @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt clear (*)
* @arg @ref RCC_IT_LSI2RDY LSI2 ready interrupt clear
*
* @note (*) Value not defined for all devices
*/
#define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (RCC->CICR = (__INTERRUPT__))
/** @brief Check whether the RCC interrupt has occurred or not.
* @param __INTERRUPT__ specifies the RCC interrupt source to check.
* This parameter can be one of the following values:
* @arg @ref RCC_IT_LSI1RDY LSI1 ready interrupt flag
* @arg @ref RCC_IT_LSERDY LSE ready interrupt flag
* @arg @ref RCC_IT_MSIRDY HSI ready interrupt flag
* @arg @ref RCC_IT_HSIRDY HSI ready interrupt flag
* @arg @ref RCC_IT_HSERDY HSE ready interrupt flag
* @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt flag
* @arg @ref RCC_IT_PLLRDY PLLSAI1 ready interrupt flag
* @arg @ref RCC_IT_HSECSS HSE Clock security system interrupt flag
* @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt flag
* @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt flag (*)
* @arg @ref RCC_IT_LSI2RDY LSI2 ready interrupt flag
*
* @note (*) Value not defined for all devices
*
* @retval The new state of __INTERRUPT__ (TRUE or FALSE).
*/
#define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIFR & (__INTERRUPT__)) == (__INTERRUPT__))
/** @brief Set RMVF bit to clear the reset flags.
* The reset flags are: RCC_FLAG_OBLRST, RCC_FLAG_PINRST, RCC_FLAG_BORRST,
* RCC_FLAG_SFTRST, RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST and RCC_FLAG_LPWRRST.
* @retval None
*/
#define __HAL_RCC_CLEAR_RESET_FLAGS() LL_RCC_ClearResetFlags()
/** @brief Check whether the selected RCC flag is set or not.
* @param __FLAG__ specifies the flag to check.
* This parameter can be one of the following values:
* @arg @ref RCC_FLAG_MSIRDY MSI oscillator clock ready
* @arg @ref RCC_FLAG_HSIRDY HSI oscillator clock ready
* @arg @ref RCC_FLAG_HSERDY HSE oscillator clock ready
* @arg @ref RCC_FLAG_PLLRDY Main PLL clock ready
* @arg @ref RCC_FLAG_PLLRDY PLLSAI1 clock ready
* @arg @ref RCC_FLAG_HSI48RDY HSI48 clock ready for devices with HSI48 (*)
* @arg @ref RCC_FLAG_LSERDY LSE oscillator clock ready
* @arg @ref RCC_FLAG_LSECSSD Clock security system failure on LSE oscillator detection
* @arg @ref RCC_FLAG_LSI1RDY LSI1 oscillator clock ready
* @arg @ref RCC_FLAG_LSI2RDY LSI2 oscillator clock ready
* @arg @ref RCC_FLAG_BORRST BOR reset
* @arg @ref RCC_FLAG_OBLRST OBLRST reset
* @arg @ref RCC_FLAG_PINRST Pin reset
* @arg @ref RCC_FLAG_SFTRST Software reset
* @arg @ref RCC_FLAG_IWDGRST Independent Watchdog reset
* @arg @ref RCC_FLAG_WWDGRST Window Watchdog reset
* @arg @ref RCC_FLAG_LPWRRST Low Power reset
*
* @note (*) Value not defined for all devices
*
* @retval The new state of __FLAG__ (TRUE or FALSE).
*/
#define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == CR_REG_INDEX) ? RCC->CR : \
((((__FLAG__) >> 5U) == CRRCR_REG_INDEX) ? RCC->CRRCR : \
((((__FLAG__) >> 5U) == BDCR_REG_INDEX) ? RCC->BDCR : \
((((__FLAG__) >> 5U) == CSR_REG_INDEX) ? RCC->CSR : RCC->CIFR)))) & \
(1U << ((__FLAG__) & RCC_FLAG_MASK))) != RESET) \
? 1U : 0U)
/**
* @}
*/
/**
* @}
*/
/* Include RCC HAL Extended module */
#include "stm32wbxx_hal_rcc_ex.h"
/* Exported functions --------------------------------------------------------*/
/** @addtogroup RCC_Exported_Functions
* @{
*/
/** @addtogroup RCC_Exported_Functions_Group1
* @{
*/
/* Initialization and de-initialization functions ******************************/
HAL_StatusTypeDef HAL_RCC_DeInit(void);
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
/**
* @}
*/
/** @addtogroup RCC_Exported_Functions_Group2
* @{
*/
/* Peripheral Control functions ************************************************/
void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv);
void HAL_RCC_EnableCSS(void);
uint32_t HAL_RCC_GetSysClockFreq(void);
uint32_t HAL_RCC_GetHCLKFreq(void);
uint32_t HAL_RCC_GetHCLK2Freq(void);
uint32_t HAL_RCC_GetHCLK4Freq(void);
uint32_t HAL_RCC_GetPCLK1Freq(void);
uint32_t HAL_RCC_GetPCLK2Freq(void);
void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency);
/* LSE & HSE CSS NMI IRQ handler */
void HAL_RCC_NMI_IRQHandler(void);
/* User Callbacks in non blocking mode (IT mode) */
void HAL_RCC_CSSCallback(void);
uint32_t HAL_RCC_GetResetSource(void);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* STM32WBxx_HAL_RCC_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
303672200361c80da27e8ac3f8c385e647d1c91c
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/net/wan/sdla.c
|
de3bbf43fc5ac14f41ee9d76eeacb1f059eeaab3
|
[
"GPL-1.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 38,854
|
c
|
sdla.c
|
/*
* SDLA An implementation of a driver for the Sangoma S502/S508 series
* multi-protocol PC interface card. Initial offering is with
* the DLCI driver, providing Frame Relay support for linux.
*
* Global definitions for the Frame relay interface.
*
* Version: @(#)sdla.c 0.30 12 Sep 1996
*
* Credits: Sangoma Technologies, for the use of 2 cards for an extended
* period of time.
* David Mandelstam <dm@sangoma.com> for getting me started on
* this project, and incentive to complete it.
* Gene Kozen <74604.152@compuserve.com> for providing me with
* important information about the cards.
*
* Author: Mike McLagan <mike.mclagan@linux.org>
*
* Changes:
* 0.15 Mike McLagan Improved error handling, packet dropping
* 0.20 Mike McLagan New transmit/receive flags for config
* If in FR mode, don't accept packets from
* non DLCI devices.
* 0.25 Mike McLagan Fixed problem with rejecting packets
* from non DLCI devices.
* 0.30 Mike McLagan Fixed kernel panic when used with modified
* ifconfig
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/if_frad.h>
#include <linux/sdla.h>
#include <linux/bitops.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/uaccess.h>
static const char* version = "SDLA driver v0.30, 12 Sep 1996, mike.mclagan@linux.org";
static unsigned int valid_port[] = { 0x250, 0x270, 0x280, 0x300, 0x350, 0x360, 0x380, 0x390};
static unsigned int valid_mem[] = {
0xA0000, 0xA2000, 0xA4000, 0xA6000, 0xA8000, 0xAA000, 0xAC000, 0xAE000,
0xB0000, 0xB2000, 0xB4000, 0xB6000, 0xB8000, 0xBA000, 0xBC000, 0xBE000,
0xC0000, 0xC2000, 0xC4000, 0xC6000, 0xC8000, 0xCA000, 0xCC000, 0xCE000,
0xD0000, 0xD2000, 0xD4000, 0xD6000, 0xD8000, 0xDA000, 0xDC000, 0xDE000,
0xE0000, 0xE2000, 0xE4000, 0xE6000, 0xE8000, 0xEA000, 0xEC000, 0xEE000};
static DEFINE_SPINLOCK(sdla_lock);
/*********************************************************
*
* these are the core routines that access the card itself
*
*********************************************************/
#define SDLA_WINDOW(dev,addr) outb((((addr) >> 13) & 0x1F), (dev)->base_addr + SDLA_REG_Z80_WINDOW)
static void __sdla_read(struct net_device *dev, int addr, void *buf, short len)
{
char *temp;
const void *base;
int offset, bytes;
temp = buf;
while(len)
{
offset = addr & SDLA_ADDR_MASK;
bytes = offset + len > SDLA_WINDOW_SIZE ? SDLA_WINDOW_SIZE - offset : len;
base = (const void *) (dev->mem_start + offset);
SDLA_WINDOW(dev, addr);
memcpy(temp, base, bytes);
addr += bytes;
temp += bytes;
len -= bytes;
}
}
static void sdla_read(struct net_device *dev, int addr, void *buf, short len)
{
unsigned long flags;
spin_lock_irqsave(&sdla_lock, flags);
__sdla_read(dev, addr, buf, len);
spin_unlock_irqrestore(&sdla_lock, flags);
}
static void __sdla_write(struct net_device *dev, int addr,
const void *buf, short len)
{
const char *temp;
void *base;
int offset, bytes;
temp = buf;
while(len)
{
offset = addr & SDLA_ADDR_MASK;
bytes = offset + len > SDLA_WINDOW_SIZE ? SDLA_WINDOW_SIZE - offset : len;
base = (void *) (dev->mem_start + offset);
SDLA_WINDOW(dev, addr);
memcpy(base, temp, bytes);
addr += bytes;
temp += bytes;
len -= bytes;
}
}
static void sdla_write(struct net_device *dev, int addr,
const void *buf, short len)
{
unsigned long flags;
spin_lock_irqsave(&sdla_lock, flags);
__sdla_write(dev, addr, buf, len);
spin_unlock_irqrestore(&sdla_lock, flags);
}
static void sdla_clear(struct net_device *dev)
{
unsigned long flags;
char *base;
int len, addr, bytes;
len = 65536;
addr = 0;
bytes = SDLA_WINDOW_SIZE;
base = (void *) dev->mem_start;
spin_lock_irqsave(&sdla_lock, flags);
while(len)
{
SDLA_WINDOW(dev, addr);
memset(base, 0, bytes);
addr += bytes;
len -= bytes;
}
spin_unlock_irqrestore(&sdla_lock, flags);
}
static char sdla_byte(struct net_device *dev, int addr)
{
unsigned long flags;
char byte, *temp;
temp = (void *) (dev->mem_start + (addr & SDLA_ADDR_MASK));
spin_lock_irqsave(&sdla_lock, flags);
SDLA_WINDOW(dev, addr);
byte = *temp;
spin_unlock_irqrestore(&sdla_lock, flags);
return byte;
}
static void sdla_stop(struct net_device *dev)
{
struct frad_local *flp;
flp = netdev_priv(dev);
switch(flp->type)
{
case SDLA_S502A:
outb(SDLA_S502A_HALT, dev->base_addr + SDLA_REG_CONTROL);
flp->state = SDLA_HALT;
break;
case SDLA_S502E:
outb(SDLA_HALT, dev->base_addr + SDLA_REG_Z80_CONTROL);
outb(SDLA_S502E_ENABLE, dev->base_addr + SDLA_REG_CONTROL);
flp->state = SDLA_S502E_ENABLE;
break;
case SDLA_S507:
flp->state &= ~SDLA_CPUEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
case SDLA_S508:
flp->state &= ~SDLA_CPUEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
}
}
static void sdla_start(struct net_device *dev)
{
struct frad_local *flp;
flp = netdev_priv(dev);
switch(flp->type)
{
case SDLA_S502A:
outb(SDLA_S502A_NMI, dev->base_addr + SDLA_REG_CONTROL);
outb(SDLA_S502A_START, dev->base_addr + SDLA_REG_CONTROL);
flp->state = SDLA_S502A_START;
break;
case SDLA_S502E:
outb(SDLA_S502E_CPUEN, dev->base_addr + SDLA_REG_Z80_CONTROL);
outb(0x00, dev->base_addr + SDLA_REG_CONTROL);
flp->state = 0;
break;
case SDLA_S507:
flp->state |= SDLA_CPUEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
case SDLA_S508:
flp->state |= SDLA_CPUEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
}
}
/****************************************************
*
* this is used for the S502A/E cards to determine
* the speed of the onboard CPU. Calibration is
* necessary for the Frame Relay code uploaded
* later. Incorrect results cause timing problems
* with link checks & status messages
*
***************************************************/
static int sdla_z80_poll(struct net_device *dev, int z80_addr, int jiffs, char resp1, char resp2)
{
unsigned long start, done, now;
char resp, *temp;
start = now = jiffies;
done = jiffies + jiffs;
temp = (void *)dev->mem_start;
temp += z80_addr & SDLA_ADDR_MASK;
resp = ~resp1;
while (time_before(jiffies, done) && (resp != resp1) && (!resp2 || (resp != resp2)))
{
if (jiffies != now)
{
SDLA_WINDOW(dev, z80_addr);
now = jiffies;
resp = *temp;
}
}
return time_before(jiffies, done) ? jiffies - start : -1;
}
/* constants for Z80 CPU speed */
#define Z80_READY '1' /* Z80 is ready to begin */
#define LOADER_READY '2' /* driver is ready to begin */
#define Z80_SCC_OK '3' /* SCC is on board */
#define Z80_SCC_BAD '4' /* SCC was not found */
static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr)
{
int jiffs;
char data;
sdla_start(dev);
if (sdla_z80_poll(dev, 0, 3*HZ, Z80_READY, 0) < 0)
return -EIO;
data = LOADER_READY;
sdla_write(dev, 0, &data, 1);
if ((jiffs = sdla_z80_poll(dev, 0, 8*HZ, Z80_SCC_OK, Z80_SCC_BAD)) < 0)
return -EIO;
sdla_stop(dev);
sdla_read(dev, 0, &data, 1);
if (data == Z80_SCC_BAD)
{
printk("%s: SCC bad\n", dev->name);
return -EIO;
}
if (data != Z80_SCC_OK)
return -EINVAL;
if (jiffs < 165)
ifr->ifr_mtu = SDLA_CPU_16M;
else if (jiffs < 220)
ifr->ifr_mtu = SDLA_CPU_10M;
else if (jiffs < 258)
ifr->ifr_mtu = SDLA_CPU_8M;
else if (jiffs < 357)
ifr->ifr_mtu = SDLA_CPU_7M;
else if (jiffs < 467)
ifr->ifr_mtu = SDLA_CPU_5M;
else
ifr->ifr_mtu = SDLA_CPU_3M;
return 0;
}
/************************************************
*
* Direct interaction with the Frame Relay code
* starts here.
*
************************************************/
struct _dlci_stat
{
short dlci;
char flags;
} __packed;
struct _frad_stat
{
char flags;
struct _dlci_stat dlcis[SDLA_MAX_DLCI];
};
static void sdla_errors(struct net_device *dev, int cmd, int dlci, int ret, int len, void *data)
{
struct _dlci_stat *pstatus;
short *pdlci;
int i;
char *state, line[30];
switch (ret)
{
case SDLA_RET_MODEM:
state = data;
if (*state & SDLA_MODEM_DCD_LOW)
netdev_info(dev, "Modem DCD unexpectedly low!\n");
if (*state & SDLA_MODEM_CTS_LOW)
netdev_info(dev, "Modem CTS unexpectedly low!\n");
/* I should probably do something about this! */
break;
case SDLA_RET_CHANNEL_OFF:
netdev_info(dev, "Channel became inoperative!\n");
/* same here */
break;
case SDLA_RET_CHANNEL_ON:
netdev_info(dev, "Channel became operative!\n");
/* same here */
break;
case SDLA_RET_DLCI_STATUS:
netdev_info(dev, "Status change reported by Access Node\n");
len /= sizeof(struct _dlci_stat);
for(pstatus = data, i=0;i < len;i++,pstatus++)
{
if (pstatus->flags & SDLA_DLCI_NEW)
state = "new";
else if (pstatus->flags & SDLA_DLCI_DELETED)
state = "deleted";
else if (pstatus->flags & SDLA_DLCI_ACTIVE)
state = "active";
else
{
sprintf(line, "unknown status: %02X", pstatus->flags);
state = line;
}
netdev_info(dev, "DLCI %i: %s\n",
pstatus->dlci, state);
/* same here */
}
break;
case SDLA_RET_DLCI_UNKNOWN:
netdev_info(dev, "Received unknown DLCIs:");
len /= sizeof(short);
for(pdlci = data,i=0;i < len;i++,pdlci++)
pr_cont(" %i", *pdlci);
pr_cont("\n");
break;
case SDLA_RET_TIMEOUT:
netdev_err(dev, "Command timed out!\n");
break;
case SDLA_RET_BUF_OVERSIZE:
netdev_info(dev, "Bc/CIR overflow, acceptable size is %i\n",
len);
break;
case SDLA_RET_BUF_TOO_BIG:
netdev_info(dev, "Buffer size over specified max of %i\n",
len);
break;
case SDLA_RET_CHANNEL_INACTIVE:
case SDLA_RET_DLCI_INACTIVE:
case SDLA_RET_CIR_OVERFLOW:
case SDLA_RET_NO_BUFS:
if (cmd == SDLA_INFORMATION_WRITE)
break;
default:
netdev_dbg(dev, "Cmd 0x%02X generated return code 0x%02X\n",
cmd, ret);
/* Further processing could be done here */
break;
}
}
static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags,
void *inbuf, short inlen, void *outbuf, short *outlen)
{
static struct _frad_stat status;
struct frad_local *flp;
struct sdla_cmd *cmd_buf;
unsigned long pflags;
unsigned long jiffs;
int ret, waiting, len;
long window;
flp = netdev_priv(dev);
window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF;
cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK));
ret = 0;
len = 0;
jiffs = jiffies + HZ; /* 1 second is plenty */
spin_lock_irqsave(&sdla_lock, pflags);
SDLA_WINDOW(dev, window);
cmd_buf->cmd = cmd;
cmd_buf->dlci = dlci;
cmd_buf->flags = flags;
if (inbuf)
memcpy(cmd_buf->data, inbuf, inlen);
cmd_buf->length = inlen;
cmd_buf->opp_flag = 1;
spin_unlock_irqrestore(&sdla_lock, pflags);
waiting = 1;
len = 0;
while (waiting && time_before_eq(jiffies, jiffs))
{
if (waiting++ % 3)
{
spin_lock_irqsave(&sdla_lock, pflags);
SDLA_WINDOW(dev, window);
waiting = ((volatile int)(cmd_buf->opp_flag));
spin_unlock_irqrestore(&sdla_lock, pflags);
}
}
if (!waiting)
{
spin_lock_irqsave(&sdla_lock, pflags);
SDLA_WINDOW(dev, window);
ret = cmd_buf->retval;
len = cmd_buf->length;
if (outbuf && outlen)
{
*outlen = *outlen >= len ? len : *outlen;
if (*outlen)
memcpy(outbuf, cmd_buf->data, *outlen);
}
/* This is a local copy that's used for error handling */
if (ret)
memcpy(&status, cmd_buf->data, len > sizeof(status) ? sizeof(status) : len);
spin_unlock_irqrestore(&sdla_lock, pflags);
}
else
ret = SDLA_RET_TIMEOUT;
if (ret != SDLA_RET_OK)
sdla_errors(dev, cmd, dlci, ret, len, &status);
return ret;
}
/***********************************************
*
* these functions are called by the DLCI driver
*
***********************************************/
static int sdla_reconfig(struct net_device *dev);
static int sdla_activate(struct net_device *slave, struct net_device *master)
{
struct frad_local *flp;
int i;
flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master)
break;
if (i == CONFIG_DLCI_MAX)
return -ENODEV;
flp->dlci[i] = abs(flp->dlci[i]);
if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE))
sdla_cmd(slave, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL);
return 0;
}
static int sdla_deactivate(struct net_device *slave, struct net_device *master)
{
struct frad_local *flp;
int i;
flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master)
break;
if (i == CONFIG_DLCI_MAX)
return -ENODEV;
flp->dlci[i] = -abs(flp->dlci[i]);
if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE))
sdla_cmd(slave, SDLA_DEACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL);
return 0;
}
static int sdla_assoc(struct net_device *slave, struct net_device *master)
{
struct frad_local *flp;
int i;
if (master->type != ARPHRD_DLCI)
return -EINVAL;
flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++)
{
if (!flp->master[i])
break;
if (abs(flp->dlci[i]) == *(short *)(master->dev_addr))
return -EADDRINUSE;
}
if (i == CONFIG_DLCI_MAX)
return -EMLINK; /* #### Alan: Comments on this ?? */
flp->master[i] = master;
flp->dlci[i] = -*(short *)(master->dev_addr);
master->mtu = slave->mtu;
if (netif_running(slave)) {
if (flp->config.station == FRAD_STATION_CPE)
sdla_reconfig(slave);
else
sdla_cmd(slave, SDLA_ADD_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL);
}
return 0;
}
static int sdla_deassoc(struct net_device *slave, struct net_device *master)
{
struct frad_local *flp;
int i;
flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master)
break;
if (i == CONFIG_DLCI_MAX)
return -ENODEV;
flp->master[i] = NULL;
flp->dlci[i] = 0;
if (netif_running(slave)) {
if (flp->config.station == FRAD_STATION_CPE)
sdla_reconfig(slave);
else
sdla_cmd(slave, SDLA_DELETE_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL);
}
return 0;
}
static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, int get)
{
struct frad_local *flp;
struct dlci_local *dlp;
int i;
short len, ret;
flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master)
break;
if (i == CONFIG_DLCI_MAX)
return -ENODEV;
dlp = netdev_priv(master);
ret = SDLA_RET_OK;
len = sizeof(struct dlci_conf);
if (netif_running(slave)) {
if (get)
ret = sdla_cmd(slave, SDLA_READ_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0,
NULL, 0, &dlp->config, &len);
else
ret = sdla_cmd(slave, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0,
&dlp->config, sizeof(struct dlci_conf) - 4 * sizeof(short), NULL, NULL);
}
return ret == SDLA_RET_OK ? 0 : -EIO;
}
/**************************
*
* now for the Linux driver
*
**************************/
/* NOTE: the DLCI driver deals with freeing the SKB!! */
static netdev_tx_t sdla_transmit(struct sk_buff *skb,
struct net_device *dev)
{
struct frad_local *flp;
int ret, addr, accept, i;
short size;
unsigned long flags;
struct buf_entry *pbuf;
flp = netdev_priv(dev);
ret = 0;
accept = 1;
netif_stop_queue(dev);
/*
* stupid GateD insists on setting up the multicast router thru us
* and we're ill equipped to handle a non Frame Relay packet at this
* time!
*/
accept = 1;
switch (dev->type)
{
case ARPHRD_FRAD:
if (skb->dev->type != ARPHRD_DLCI)
{
netdev_warn(dev, "Non DLCI device, type %i, tried to send on FRAD module\n",
skb->dev->type);
accept = 0;
}
break;
default:
netdev_warn(dev, "unknown firmware type 0x%04X\n",
dev->type);
accept = 0;
break;
}
if (accept)
{
/* this is frame specific, but till there's a PPP module, it's the default */
switch (flp->type)
{
case SDLA_S502A:
case SDLA_S502E:
ret = sdla_cmd(dev, SDLA_INFORMATION_WRITE, *(short *)(skb->dev->dev_addr), 0, skb->data, skb->len, NULL, NULL);
break;
case SDLA_S508:
size = sizeof(addr);
ret = sdla_cmd(dev, SDLA_INFORMATION_WRITE, *(short *)(skb->dev->dev_addr), 0, NULL, skb->len, &addr, &size);
if (ret == SDLA_RET_OK)
{
spin_lock_irqsave(&sdla_lock, flags);
SDLA_WINDOW(dev, addr);
pbuf = (void *)(((int) dev->mem_start) + (addr & SDLA_ADDR_MASK));
__sdla_write(dev, pbuf->buf_addr, skb->data, skb->len);
SDLA_WINDOW(dev, addr);
pbuf->opp_flag = 1;
spin_unlock_irqrestore(&sdla_lock, flags);
}
break;
}
switch (ret)
{
case SDLA_RET_OK:
dev->stats.tx_packets++;
break;
case SDLA_RET_CIR_OVERFLOW:
case SDLA_RET_BUF_OVERSIZE:
case SDLA_RET_NO_BUFS:
dev->stats.tx_dropped++;
break;
default:
dev->stats.tx_errors++;
break;
}
}
netif_wake_queue(dev);
for(i=0;i<CONFIG_DLCI_MAX;i++)
{
if(flp->master[i]!=NULL)
netif_wake_queue(flp->master[i]);
}
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
static void sdla_receive(struct net_device *dev)
{
struct net_device *master;
struct frad_local *flp;
struct dlci_local *dlp;
struct sk_buff *skb;
struct sdla_cmd *cmd;
struct buf_info *pbufi;
struct buf_entry *pbuf;
unsigned long flags;
int i=0, received, success, addr, buf_base, buf_top;
short dlci, len, len2, split;
flp = netdev_priv(dev);
success = 1;
received = addr = buf_top = buf_base = 0;
len = dlci = 0;
skb = NULL;
master = NULL;
cmd = NULL;
pbufi = NULL;
pbuf = NULL;
spin_lock_irqsave(&sdla_lock, flags);
switch (flp->type)
{
case SDLA_S502A:
case SDLA_S502E:
cmd = (void *) (dev->mem_start + (SDLA_502_RCV_BUF & SDLA_ADDR_MASK));
SDLA_WINDOW(dev, SDLA_502_RCV_BUF);
success = cmd->opp_flag;
if (!success)
break;
dlci = cmd->dlci;
len = cmd->length;
break;
case SDLA_S508:
pbufi = (void *) (dev->mem_start + (SDLA_508_RXBUF_INFO & SDLA_ADDR_MASK));
SDLA_WINDOW(dev, SDLA_508_RXBUF_INFO);
pbuf = (void *) (dev->mem_start + ((pbufi->rse_base + flp->buffer * sizeof(struct buf_entry)) & SDLA_ADDR_MASK));
success = pbuf->opp_flag;
if (!success)
break;
buf_top = pbufi->buf_top;
buf_base = pbufi->buf_base;
dlci = pbuf->dlci;
len = pbuf->length;
addr = pbuf->buf_addr;
break;
}
/* common code, find the DLCI and get the SKB */
if (success)
{
for (i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i] == dlci)
break;
if (i == CONFIG_DLCI_MAX)
{
netdev_notice(dev, "Received packet from invalid DLCI %i, ignoring\n",
dlci);
dev->stats.rx_errors++;
success = 0;
}
}
if (success)
{
master = flp->master[i];
skb = dev_alloc_skb(len + sizeof(struct frhdr));
if (skb == NULL)
{
netdev_notice(dev, "Memory squeeze, dropping packet\n");
dev->stats.rx_dropped++;
success = 0;
}
else
skb_reserve(skb, sizeof(struct frhdr));
}
/* pick up the data */
switch (flp->type)
{
case SDLA_S502A:
case SDLA_S502E:
if (success)
__sdla_read(dev, SDLA_502_RCV_BUF + SDLA_502_DATA_OFS, skb_put(skb,len), len);
SDLA_WINDOW(dev, SDLA_502_RCV_BUF);
cmd->opp_flag = 0;
break;
case SDLA_S508:
if (success)
{
/* is this buffer split off the end of the internal ring buffer */
split = addr + len > buf_top + 1 ? len - (buf_top - addr + 1) : 0;
len2 = len - split;
__sdla_read(dev, addr, skb_put(skb, len2), len2);
if (split)
__sdla_read(dev, buf_base, skb_put(skb, split), split);
}
/* increment the buffer we're looking at */
SDLA_WINDOW(dev, SDLA_508_RXBUF_INFO);
flp->buffer = (flp->buffer + 1) % pbufi->rse_num;
pbuf->opp_flag = 0;
break;
}
if (success)
{
dev->stats.rx_packets++;
dlp = netdev_priv(master);
(*dlp->receive)(skb, master);
}
spin_unlock_irqrestore(&sdla_lock, flags);
}
static irqreturn_t sdla_isr(int dummy, void *dev_id)
{
struct net_device *dev;
struct frad_local *flp;
char byte;
dev = dev_id;
flp = netdev_priv(dev);
if (!flp->initialized)
{
netdev_warn(dev, "irq %d for uninitialized device\n", dev->irq);
return IRQ_NONE;
}
byte = sdla_byte(dev, flp->type == SDLA_S508 ? SDLA_508_IRQ_INTERFACE : SDLA_502_IRQ_INTERFACE);
switch (byte)
{
case SDLA_INTR_RX:
sdla_receive(dev);
break;
/* the command will get an error return, which is processed above */
case SDLA_INTR_MODEM:
case SDLA_INTR_STATUS:
sdla_cmd(dev, SDLA_READ_DLC_STATUS, 0, 0, NULL, 0, NULL, NULL);
break;
case SDLA_INTR_TX:
case SDLA_INTR_COMPLETE:
case SDLA_INTR_TIMER:
netdev_warn(dev, "invalid irq flag 0x%02X\n", byte);
break;
}
/* the S502E requires a manual acknowledgement of the interrupt */
if (flp->type == SDLA_S502E)
{
flp->state &= ~SDLA_S502E_INTACK;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
flp->state |= SDLA_S502E_INTACK;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
}
/* this clears the byte, informing the Z80 we're done */
byte = 0;
sdla_write(dev, flp->type == SDLA_S508 ? SDLA_508_IRQ_INTERFACE : SDLA_502_IRQ_INTERFACE, &byte, sizeof(byte));
return IRQ_HANDLED;
}
static void sdla_poll(unsigned long device)
{
struct net_device *dev;
struct frad_local *flp;
dev = (struct net_device *) device;
flp = netdev_priv(dev);
if (sdla_byte(dev, SDLA_502_RCV_BUF))
sdla_receive(dev);
flp->timer.expires = 1;
add_timer(&flp->timer);
}
static int sdla_close(struct net_device *dev)
{
struct frad_local *flp;
struct intr_info intr;
int len, i;
short dlcis[CONFIG_DLCI_MAX];
flp = netdev_priv(dev);
len = 0;
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i])
dlcis[len++] = abs(flp->dlci[i]);
len *= 2;
if (flp->config.station == FRAD_STATION_NODE)
{
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i] > 0)
sdla_cmd(dev, SDLA_DEACTIVATE_DLCI, 0, 0, dlcis, len, NULL, NULL);
sdla_cmd(dev, SDLA_DELETE_DLCI, 0, 0, &flp->dlci[i], sizeof(flp->dlci[i]), NULL, NULL);
}
memset(&intr, 0, sizeof(intr));
/* let's start up the reception */
switch(flp->type)
{
case SDLA_S502A:
del_timer(&flp->timer);
break;
case SDLA_S502E:
sdla_cmd(dev, SDLA_SET_IRQ_TRIGGER, 0, 0, &intr, sizeof(char) + sizeof(short), NULL, NULL);
flp->state &= ~SDLA_S502E_INTACK;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
case SDLA_S507:
break;
case SDLA_S508:
sdla_cmd(dev, SDLA_SET_IRQ_TRIGGER, 0, 0, &intr, sizeof(struct intr_info), NULL, NULL);
flp->state &= ~SDLA_S508_INTEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
break;
}
sdla_cmd(dev, SDLA_DISABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
netif_stop_queue(dev);
return 0;
}
struct conf_data {
struct frad_conf config;
short dlci[CONFIG_DLCI_MAX];
};
static int sdla_open(struct net_device *dev)
{
struct frad_local *flp;
struct dlci_local *dlp;
struct conf_data data;
struct intr_info intr;
int len, i;
char byte;
flp = netdev_priv(dev);
if (!flp->initialized)
return -EPERM;
if (!flp->configured)
return -EPERM;
/* time to send in the configuration */
len = 0;
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i])
data.dlci[len++] = abs(flp->dlci[i]);
len *= 2;
memcpy(&data.config, &flp->config, sizeof(struct frad_conf));
len += sizeof(struct frad_conf);
sdla_cmd(dev, SDLA_DISABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL);
if (flp->type == SDLA_S508)
flp->buffer = 0;
sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
/* let's start up the reception */
memset(&intr, 0, sizeof(intr));
switch(flp->type)
{
case SDLA_S502A:
flp->timer.expires = 1;
add_timer(&flp->timer);
break;
case SDLA_S502E:
flp->state |= SDLA_S502E_ENABLE;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
flp->state |= SDLA_S502E_INTACK;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
byte = 0;
sdla_write(dev, SDLA_502_IRQ_INTERFACE, &byte, sizeof(byte));
intr.flags = SDLA_INTR_RX | SDLA_INTR_STATUS | SDLA_INTR_MODEM;
sdla_cmd(dev, SDLA_SET_IRQ_TRIGGER, 0, 0, &intr, sizeof(char) + sizeof(short), NULL, NULL);
break;
case SDLA_S507:
break;
case SDLA_S508:
flp->state |= SDLA_S508_INTEN;
outb(flp->state, dev->base_addr + SDLA_REG_CONTROL);
byte = 0;
sdla_write(dev, SDLA_508_IRQ_INTERFACE, &byte, sizeof(byte));
intr.flags = SDLA_INTR_RX | SDLA_INTR_STATUS | SDLA_INTR_MODEM;
intr.irq = dev->irq;
sdla_cmd(dev, SDLA_SET_IRQ_TRIGGER, 0, 0, &intr, sizeof(struct intr_info), NULL, NULL);
break;
}
if (flp->config.station == FRAD_STATION_CPE)
{
byte = SDLA_ICS_STATUS_ENQ;
sdla_cmd(dev, SDLA_ISSUE_IN_CHANNEL_SIGNAL, 0, 0, &byte, sizeof(byte), NULL, NULL);
}
else
{
sdla_cmd(dev, SDLA_ADD_DLCI, 0, 0, data.dlci, len - sizeof(struct frad_conf), NULL, NULL);
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i] > 0)
sdla_cmd(dev, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], 2*sizeof(flp->dlci[i]), NULL, NULL);
}
/* configure any specific DLCI settings */
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i])
{
dlp = netdev_priv(flp->master[i]);
if (dlp->configured)
sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL);
}
netif_start_queue(dev);
return 0;
}
static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get)
{
struct frad_local *flp;
struct conf_data data;
int i;
short size;
if (dev->type == 0xFFFF)
return -EUNATCH;
flp = netdev_priv(dev);
if (!get)
{
if (netif_running(dev))
return -EBUSY;
if(copy_from_user(&data.config, conf, sizeof(struct frad_conf)))
return -EFAULT;
if (data.config.station & ~FRAD_STATION_NODE)
return -EINVAL;
if (data.config.flags & ~FRAD_VALID_FLAGS)
return -EINVAL;
if ((data.config.kbaud < 0) ||
((data.config.kbaud > 128) && (flp->type != SDLA_S508)))
return -EINVAL;
if (data.config.clocking & ~(FRAD_CLOCK_INT | SDLA_S508_PORT_RS232))
return -EINVAL;
if ((data.config.mtu < 0) || (data.config.mtu > SDLA_MAX_MTU))
return -EINVAL;
if ((data.config.T391 < 5) || (data.config.T391 > 30))
return -EINVAL;
if ((data.config.T392 < 5) || (data.config.T392 > 30))
return -EINVAL;
if ((data.config.N391 < 1) || (data.config.N391 > 255))
return -EINVAL;
if ((data.config.N392 < 1) || (data.config.N392 > 10))
return -EINVAL;
if ((data.config.N393 < 1) || (data.config.N393 > 10))
return -EINVAL;
memcpy(&flp->config, &data.config, sizeof(struct frad_conf));
flp->config.flags |= SDLA_DIRECT_RECV;
if (flp->type == SDLA_S508)
flp->config.flags |= SDLA_TX70_RX30;
if (dev->mtu != flp->config.mtu)
{
/* this is required to change the MTU */
dev->mtu = flp->config.mtu;
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i])
flp->master[i]->mtu = flp->config.mtu;
}
flp->config.mtu += sizeof(struct frhdr);
/* off to the races! */
if (!flp->configured)
sdla_start(dev);
flp->configured = 1;
}
else
{
/* no sense reading if the CPU isn't started */
if (netif_running(dev))
{
size = sizeof(data);
if (sdla_cmd(dev, SDLA_READ_DLCI_CONFIGURATION, 0, 0, NULL, 0, &data, &size) != SDLA_RET_OK)
return -EIO;
}
else
if (flp->configured)
memcpy(&data.config, &flp->config, sizeof(struct frad_conf));
else
memset(&data.config, 0, sizeof(struct frad_conf));
memcpy(&flp->config, &data.config, sizeof(struct frad_conf));
data.config.flags &= FRAD_VALID_FLAGS;
data.config.mtu -= data.config.mtu > sizeof(struct frhdr) ? sizeof(struct frhdr) : data.config.mtu;
return copy_to_user(conf, &data.config, sizeof(struct frad_conf))?-EFAULT:0;
}
return 0;
}
static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read)
{
struct sdla_mem mem;
char *temp;
if(copy_from_user(&mem, info, sizeof(mem)))
return -EFAULT;
if (read)
{
temp = kzalloc(mem.len, GFP_KERNEL);
if (!temp)
return -ENOMEM;
sdla_read(dev, mem.addr, temp, mem.len);
if(copy_to_user(mem.data, temp, mem.len))
{
kfree(temp);
return -EFAULT;
}
kfree(temp);
}
else
{
temp = memdup_user(mem.data, mem.len);
if (IS_ERR(temp))
return PTR_ERR(temp);
sdla_write(dev, mem.addr, temp, mem.len);
kfree(temp);
}
return 0;
}
static int sdla_reconfig(struct net_device *dev)
{
struct frad_local *flp;
struct conf_data data;
int i, len;
flp = netdev_priv(dev);
len = 0;
for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i])
data.dlci[len++] = flp->dlci[i];
len *= 2;
memcpy(&data, &flp->config, sizeof(struct frad_conf));
len += sizeof(struct frad_conf);
sdla_cmd(dev, SDLA_DISABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL);
sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
return 0;
}
static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct frad_local *flp;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
flp = netdev_priv(dev);
if (!flp->initialized)
return -EINVAL;
switch (cmd)
{
case FRAD_GET_CONF:
case FRAD_SET_CONF:
return sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF);
case SDLA_IDENTIFY:
ifr->ifr_flags = flp->type;
break;
case SDLA_CPUSPEED:
return sdla_cpuspeed(dev, ifr);
/* ==========================================================
NOTE: This is rather a useless action right now, as the
current driver does not support protocols other than
FR. However, Sangoma has modules for a number of
other protocols in the works.
============================================================*/
case SDLA_PROTOCOL:
if (flp->configured)
return -EALREADY;
switch (ifr->ifr_flags)
{
case ARPHRD_FRAD:
dev->type = ifr->ifr_flags;
break;
default:
return -ENOPROTOOPT;
}
break;
case SDLA_CLEARMEM:
sdla_clear(dev);
break;
case SDLA_WRITEMEM:
case SDLA_READMEM:
if(!capable(CAP_SYS_RAWIO))
return -EPERM;
return sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM);
case SDLA_START:
sdla_start(dev);
break;
case SDLA_STOP:
sdla_stop(dev);
break;
default:
return -EOPNOTSUPP;
}
return 0;
}
static int sdla_change_mtu(struct net_device *dev, int new_mtu)
{
struct frad_local *flp;
flp = netdev_priv(dev);
if (netif_running(dev))
return -EBUSY;
/* for now, you can't change the MTU! */
return -EOPNOTSUPP;
}
static int sdla_set_config(struct net_device *dev, struct ifmap *map)
{
struct frad_local *flp;
int i;
char byte;
unsigned base;
int err = -EINVAL;
flp = netdev_priv(dev);
if (flp->initialized)
return -EINVAL;
for(i=0; i < ARRAY_SIZE(valid_port); i++)
if (valid_port[i] == map->base_addr)
break;
if (i == ARRAY_SIZE(valid_port))
return -EINVAL;
if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){
pr_warn("io-port 0x%04lx in use\n", dev->base_addr);
return -EINVAL;
}
base = map->base_addr;
/* test for card types, S502A, S502E, S507, S508 */
/* these tests shut down the card completely, so clear the state */
flp->type = SDLA_UNKNOWN;
flp->state = 0;
for(i=1;i<SDLA_IO_EXTENTS;i++)
if (inb(base + i) != 0xFF)
break;
if (i == SDLA_IO_EXTENTS) {
outb(SDLA_HALT, base + SDLA_REG_Z80_CONTROL);
if ((inb(base + SDLA_S502_STS) & 0x0F) == 0x08) {
outb(SDLA_S502E_INTACK, base + SDLA_REG_CONTROL);
if ((inb(base + SDLA_S502_STS) & 0x0F) == 0x0C) {
outb(SDLA_HALT, base + SDLA_REG_CONTROL);
flp->type = SDLA_S502E;
goto got_type;
}
}
}
for(byte=inb(base),i=0;i<SDLA_IO_EXTENTS;i++)
if (inb(base + i) != byte)
break;
if (i == SDLA_IO_EXTENTS) {
outb(SDLA_HALT, base + SDLA_REG_CONTROL);
if ((inb(base + SDLA_S502_STS) & 0x7E) == 0x30) {
outb(SDLA_S507_ENABLE, base + SDLA_REG_CONTROL);
if ((inb(base + SDLA_S502_STS) & 0x7E) == 0x32) {
outb(SDLA_HALT, base + SDLA_REG_CONTROL);
flp->type = SDLA_S507;
goto got_type;
}
}
}
outb(SDLA_HALT, base + SDLA_REG_CONTROL);
if ((inb(base + SDLA_S508_STS) & 0x3F) == 0x00) {
outb(SDLA_S508_INTEN, base + SDLA_REG_CONTROL);
if ((inb(base + SDLA_S508_STS) & 0x3F) == 0x10) {
outb(SDLA_HALT, base + SDLA_REG_CONTROL);
flp->type = SDLA_S508;
goto got_type;
}
}
outb(SDLA_S502A_HALT, base + SDLA_REG_CONTROL);
if (inb(base + SDLA_S502_STS) == 0x40) {
outb(SDLA_S502A_START, base + SDLA_REG_CONTROL);
if (inb(base + SDLA_S502_STS) == 0x40) {
outb(SDLA_S502A_INTEN, base + SDLA_REG_CONTROL);
if (inb(base + SDLA_S502_STS) == 0x44) {
outb(SDLA_S502A_START, base + SDLA_REG_CONTROL);
flp->type = SDLA_S502A;
goto got_type;
}
}
}
netdev_notice(dev, "Unknown card type\n");
err = -ENODEV;
goto fail;
got_type:
switch(base) {
case 0x270:
case 0x280:
case 0x380:
case 0x390:
if (flp->type != SDLA_S508 && flp->type != SDLA_S507)
goto fail;
}
switch (map->irq) {
case 2:
if (flp->type != SDLA_S502E)
goto fail;
break;
case 10:
case 11:
case 12:
case 15:
case 4:
if (flp->type != SDLA_S508 && flp->type != SDLA_S507)
goto fail;
break;
case 3:
case 5:
case 7:
if (flp->type == SDLA_S502A)
goto fail;
break;
default:
goto fail;
}
err = -EAGAIN;
if (request_irq(dev->irq, sdla_isr, 0, dev->name, dev))
goto fail;
if (flp->type == SDLA_S507) {
switch(dev->irq) {
case 3:
flp->state = SDLA_S507_IRQ3;
break;
case 4:
flp->state = SDLA_S507_IRQ4;
break;
case 5:
flp->state = SDLA_S507_IRQ5;
break;
case 7:
flp->state = SDLA_S507_IRQ7;
break;
case 10:
flp->state = SDLA_S507_IRQ10;
break;
case 11:
flp->state = SDLA_S507_IRQ11;
break;
case 12:
flp->state = SDLA_S507_IRQ12;
break;
case 15:
flp->state = SDLA_S507_IRQ15;
break;
}
}
for(i=0; i < ARRAY_SIZE(valid_mem); i++)
if (valid_mem[i] == map->mem_start)
break;
err = -EINVAL;
if (i == ARRAY_SIZE(valid_mem))
goto fail2;
if (flp->type == SDLA_S502A && (map->mem_start & 0xF000) >> 12 == 0x0E)
goto fail2;
if (flp->type != SDLA_S507 && map->mem_start >> 16 == 0x0B)
goto fail2;
if (flp->type == SDLA_S507 && map->mem_start >> 16 == 0x0D)
goto fail2;
byte = flp->type != SDLA_S508 ? SDLA_8K_WINDOW : 0;
byte |= (map->mem_start & 0xF000) >> (12 + (flp->type == SDLA_S508 ? 1 : 0));
switch(flp->type) {
case SDLA_S502A:
case SDLA_S502E:
switch (map->mem_start >> 16) {
case 0x0A:
byte |= SDLA_S502_SEG_A;
break;
case 0x0C:
byte |= SDLA_S502_SEG_C;
break;
case 0x0D:
byte |= SDLA_S502_SEG_D;
break;
case 0x0E:
byte |= SDLA_S502_SEG_E;
break;
}
break;
case SDLA_S507:
switch (map->mem_start >> 16) {
case 0x0A:
byte |= SDLA_S507_SEG_A;
break;
case 0x0B:
byte |= SDLA_S507_SEG_B;
break;
case 0x0C:
byte |= SDLA_S507_SEG_C;
break;
case 0x0E:
byte |= SDLA_S507_SEG_E;
break;
}
break;
case SDLA_S508:
switch (map->mem_start >> 16) {
case 0x0A:
byte |= SDLA_S508_SEG_A;
break;
case 0x0C:
byte |= SDLA_S508_SEG_C;
break;
case 0x0D:
byte |= SDLA_S508_SEG_D;
break;
case 0x0E:
byte |= SDLA_S508_SEG_E;
break;
}
break;
}
/* set the memory bits, and enable access */
outb(byte, base + SDLA_REG_PC_WINDOW);
switch(flp->type)
{
case SDLA_S502E:
flp->state = SDLA_S502E_ENABLE;
break;
case SDLA_S507:
flp->state |= SDLA_MEMEN;
break;
case SDLA_S508:
flp->state = SDLA_MEMEN;
break;
}
outb(flp->state, base + SDLA_REG_CONTROL);
dev->irq = map->irq;
dev->base_addr = base;
dev->mem_start = map->mem_start;
dev->mem_end = dev->mem_start + 0x2000;
flp->initialized = 1;
return 0;
fail2:
free_irq(map->irq, dev);
fail:
release_region(base, SDLA_IO_EXTENTS);
return err;
}
static const struct net_device_ops sdla_netdev_ops = {
.ndo_open = sdla_open,
.ndo_stop = sdla_close,
.ndo_do_ioctl = sdla_ioctl,
.ndo_set_config = sdla_set_config,
.ndo_start_xmit = sdla_transmit,
.ndo_change_mtu = sdla_change_mtu,
};
static void setup_sdla(struct net_device *dev)
{
struct frad_local *flp = netdev_priv(dev);
netdev_boot_setup_check(dev);
dev->netdev_ops = &sdla_netdev_ops;
dev->flags = 0;
dev->type = 0xFFFF;
dev->hard_header_len = 0;
dev->addr_len = 0;
dev->mtu = SDLA_MAX_MTU;
flp->activate = sdla_activate;
flp->deactivate = sdla_deactivate;
flp->assoc = sdla_assoc;
flp->deassoc = sdla_deassoc;
flp->dlci_conf = sdla_dlci_conf;
init_timer(&flp->timer);
flp->timer.expires = 1;
flp->timer.data = (unsigned long) dev;
flp->timer.function = sdla_poll;
}
static struct net_device *sdla;
static int __init init_sdla(void)
{
int err;
printk("%s.\n", version);
sdla = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla);
if (!sdla)
return -ENOMEM;
err = register_netdev(sdla);
if (err)
free_netdev(sdla);
return err;
}
static void __exit exit_sdla(void)
{
struct frad_local *flp = netdev_priv(sdla);
unregister_netdev(sdla);
if (flp->initialized) {
free_irq(sdla->irq, sdla);
release_region(sdla->base_addr, SDLA_IO_EXTENTS);
}
del_timer_sync(&flp->timer);
free_netdev(sdla);
}
MODULE_LICENSE("GPL");
module_init(init_sdla);
module_exit(exit_sdla);
|
a43c1cf0e0ff6e4574bf388805fb21e68b24cf8e
|
d5b32fc79745e49341d6b4c824df429e3376c4e4
|
/game/cstb/rainbow.h
|
c58f8589ed9dedd0ca157a09598af83a773bc3b4
|
[
"WTFPL"
] |
permissive
|
sgadrat/super-tilt-bro
|
ab78be86cd894a8e0e5ac9871c075dfbd6fda4e0
|
c39b11e8072651f3f44187c15edc568f4b13fde0
|
refs/heads/master
| 2023-09-01T10:54:40.954738
| 2023-08-25T20:44:07
| 2023-08-25T20:44:07
| 68,089,592
| 122
| 12
|
WTFPL
| 2021-03-08T21:29:36
| 2016-09-13T08:25:53
|
Assembly
|
UTF-8
|
C
| false
| false
| 4,325
|
h
|
rainbow.h
|
#pragma once
#include "cstb/utils.h"
#include "cstb/mem_labels.h"
#include <stdint.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
////////////////////////////////////
// Constants
////////////////////////////////////
#include "cstb/rainbow_constants.h"
////////////////////////////////////
// Registers
////////////////////////////////////
extern uint8_t volatile RAINBOW_MAPPER_VERSION;
extern uint8_t volatile RAINBOW_WIFI_CONF;
extern uint8_t volatile RAINBOW_WIFI_RX;
extern uint8_t volatile RAINBOW_WIFI_TX;
extern uint8_t volatile RAINBOW_WRAM_BANKING;
////////////////////////////////////
// Buffers
////////////////////////////////////
extern uint8_t esp_rx_buffer;
extern uint8_t esp_tx_buffer;
////////////////////////////////////
// Routines without arguments
// simply declare it as extern
////////////////////////////////////
////////////////////////////////////
// Routines that need some glue code
// implement the glue
////////////////////////////////////
void esp_send_cmd();
static void wrap_esp_send_cmd(uint8_t const* cmd) {
*tmpfield1 = ptr_lsb(cmd);
*tmpfield2 = ptr_msb(cmd);
esp_send_cmd();
}
void esp_get_msg();
static uint8_t wrap_esp_get_msg(uint8_t* dest) {
*tmpfield1 = ptr_lsb(dest);
*tmpfield2 = ptr_msb(dest);
esp_get_msg();
return *dest;
}
////////////////////////////////////
// Utility functions that have no asm counterpart
////////////////////////////////////
static bool esp_rx_message_ready() {
return (RAINBOW_WIFI_RX & 0x80) != 0;
}
static void esp_rx_message_acknowledge() {
RAINBOW_WIFI_RX = 0;
}
static void esp_tx_message_send() {
RAINBOW_WIFI_TX = 0;
}
static void esp_wait_answer(uint8_t type) {
uint8_t* const rx = &esp_rx_buffer;
bool found = false;
while(!found) {
esp_wait_rx();
if (rx[ESP_MSG_TYPE] != type) {
esp_rx_message_acknowledge();
}else {
found = true;
}
}
}
static void esp_enable_wifi(bool wifi, bool access_point, bool web_server) {
esp_wait_tx();
uint8_t* const buff = &esp_tx_buffer;
buff[0] = 2;
buff[1] = TOESP_MSG_WIFI_SET_CONFIG;
buff[2] = (wifi?1:0) + (access_point?2:0) + (web_server?4:0);
esp_tx_message_send();
}
static void esp_wait_ready() {
esp_wait_tx();
uint8_t* const buff = &esp_tx_buffer;
buff[0] = 1;
buff[1] = TOESP_MSG_GET_ESP_STATUS;
esp_tx_message_send();
esp_wait_answer(FROMESP_MSG_READY);
}
static void esp_set_server_settings(uint16_t port, char const* host) {
uint8_t const host_len = strnlen8(host, 200); // Lil' bit below 256 because ESP message headers + port information
esp_wait_tx();
uint8_t* const buff = &esp_tx_buffer;
buff[0] = host_len + 4;
buff[1] = TOESP_MSG_SERVER_SET_SETTINGS;
buff[2] = u16_msb(port);
buff[3] = u16_lsb(port);
buff[4] = host_len;
wrap_fixed_memcpy(buff+5, (uint8_t*)host, host_len);
esp_tx_message_send();
}
static void esp_file_close() {
uint8_t* const tx = &esp_tx_buffer;
esp_wait_tx();
tx[0] = 1;
tx[1] = TOESP_MSG_FILE_CLOSE;
esp_tx_message_send();
}
static bool esp_file_exists(uint8_t path, uint8_t file) {
uint8_t* const tx = &esp_tx_buffer;
uint8_t* const rx = &esp_rx_buffer;
esp_wait_tx();
tx[0] = 4;
tx[1] = TOESP_MSG_FILE_EXISTS;
tx[2] = ESP_FILE_MODE_AUTO;
tx[3] = path;
tx[4] = file;
esp_tx_message_send();
esp_wait_answer(FROMESP_MSG_FILE_EXISTS);
bool exists = rx[ESP_MSG_PAYLOAD];
esp_rx_message_acknowledge();
return exists;
}
static void esp_file_open(uint8_t path, uint8_t file) {
uint8_t* const tx = &esp_tx_buffer;
esp_wait_tx();
tx[0] = 4;
tx[1] = TOESP_MSG_FILE_OPEN;
tx[2] = ESP_FILE_MODE_AUTO;
tx[3] = path;
tx[4] = file;
esp_tx_message_send();
}
static uint8_t esp_file_read(uint8_t* dest, uint8_t count) {
uint8_t* const tx = &esp_tx_buffer;
uint8_t* const rx = &esp_rx_buffer;
esp_wait_tx();
tx[0] = 2;
tx[1] = TOESP_MSG_FILE_READ;
tx[2] = count;
esp_tx_message_send();
esp_wait_answer(FROMESP_MSG_FILE_DATA);
uint8_t n_read = rx[ESP_MSG_PAYLOAD+0];
wrap_fixed_memcpy(dest, rx+ESP_MSG_PAYLOAD+1, n_read);
esp_rx_message_acknowledge();
return n_read;
}
static void esp_file_write(uint8_t* src, uint8_t count) {
uint8_t* const tx = &esp_tx_buffer;
esp_wait_tx();
tx[0] = count + 1;
tx[1] = TOESP_MSG_FILE_WRITE;
wrap_fixed_memcpy(tx+2, src, count);
esp_tx_message_send();
}
#pragma GCC diagnostic pop
|
9c8a692500059bdfae576b0f49cee240b4b9c079
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/board/rtl8730e/src/component/os_dep/platform_stdlib.h
|
74de71395c464285c2150ab19fd91ade522bfaa5
|
[
"Apache-2.0",
"GPL-1.0-or-later",
"BSD-3-Clause",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 1,316
|
h
|
platform_stdlib.h
|
/******************************************************************************
* Copyright (c) 2013-2016 Realtek Semiconductor Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __PLATFORM_STDLIB_H__
#define __PLATFORM_STDLIB_H__
#if defined (CONFIG_PLATFORM_8721D)
#include "platform_stdlib_rtl8721d.h"
#elif defined(CONFIG_PLATFORM_8735B)
#include "platform_stdlib_rtl8735b.h"
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h> /* va_list */
#include "ameba.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_PLATFORM_AMEBA_X) && (CONFIG_PLATFORM_AMEBA_X == 0)
#include "basic_types.h"
#endif
#ifdef __cplusplus
}
#endif
#endif //__PLATFORM_STDLIB_H__
|
51ff6940ef68eafa6763c75302bc95c9ac35e201
|
c0bfd93cd7f26a271268e504959256f1e02c6806
|
/components/esp-tls/private_include/esp_tls_error_capture_internal.h
|
d047b543b5ea6d6ec5b0f53f8a06cc4f597119d7
|
[
"Apache-2.0"
] |
permissive
|
espressif/ESP8266_RTOS_SDK
|
606f396e92d2675d9854f0fabd88587fbbbaf267
|
af0cdc36fa2600033d0a09301c754008cf1503c1
|
refs/heads/master
| 2023-08-24T22:40:15.373553
| 2023-05-06T02:04:24
| 2023-05-06T02:04:24
| 27,584,181
| 3,163
| 1,749
|
Apache-2.0
| 2023-08-09T10:48:13
| 2014-12-05T09:27:12
|
C
|
UTF-8
|
C
| false
| false
| 2,131
|
h
|
esp_tls_error_capture_internal.h
|
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__
#define __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__
/**
* Note: this is an implementation placeholder for error logger.
* This version is internal to esp-tls component and only saves single esp_err of last occurred error
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Definition of different types/sources of error codes reported
* from different components
*/
typedef enum {
ERR_TYPE_UNKNOWN = 0,
ERR_TYPE_SYSTEM,
ERR_TYPE_MBEDTLS,
ERR_TYPE_MBEDTLS_CERT_FLAGS,
ERR_TYPE_ESP,
ERR_TYPE_WOLFSSL,
ERR_TYPE_WOLFSSL_CERT_FLAGS,
} err_type_t;
/**
* Error tracker logging macro, this implementation saves latest errors of
* ERR_TYPE_ESP, ERR_TYPE_ESP_TLS and ERR_TYPE_ESP_TLS_CERT_FLAGS types
*/
#define ESP_INT_EVENT_TRACKER_CAPTURE(h, type, code) esp_int_event_tracker_capture(h, type, code)
static inline void esp_int_event_tracker_capture(esp_tls_error_handle_t h, uint32_t type, int code)
{
if (h) {
if (type == ERR_TYPE_ESP) {
h->last_error = code;
} else if (type == ERR_TYPE_MBEDTLS) {
h->esp_tls_error_code = code;
} else if (type == ERR_TYPE_MBEDTLS_CERT_FLAGS) {
h->esp_tls_flags = code;
} else if (type == ERR_TYPE_WOLFSSL) {
h->esp_tls_error_code = code;
} else if (type == ERR_TYPE_WOLFSSL_CERT_FLAGS) {
h->esp_tls_flags = code;
}
}
}
#ifdef __cplusplus
}
#endif
#endif //__ESP_TLS_ERROR_CAPTURE_INTERNAL_H__
|
84747e6c1b93d33d9cd269effbb017afec25e551
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/dev/ic/seeq8003reg.h
|
613b35921d6d17bbd9117aec11fcc6d3a36c0dd9
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 6,027
|
h
|
seeq8003reg.h
|
/* $NetBSD: seeq8003reg.h,v 1.4 2022/12/30 09:08:48 andvar Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Register definitions for the Seeq 8003 and 80C03 ethernet controllers
*
* Based on documentation available at
* http://www.lsilogic.com/techlib/techdocs/networking/eol/80c03.pdf .
*/
#define SEEQ_ADDR0 0 /* Station Address Byte 0 */
#define SEEQ_ADDR1 1 /* Station Address Byte 1 */
#define SEEQ_ADDR2 2 /* Station Address Byte 2 */
#define SEEQ_ADDR3 3 /* Station Address Byte 3 */
#define SEEQ_ADDR4 4 /* Station Address Byte 4 */
#define SEEQ_ADDR5 5 /* Station Address Byte 5 */
#define SEEQ_TXCOLLS0 0 /* Transmit Collision Counter LSB */
#define SEEQ_TXCOLLS1 1 /* Transmit Collision Counter MSB */
#define SEEQ_ALLCOLL0 2 /* Total Collision Counter LSB */
#define SEEQ_ALLCOLL1 3 /* Total Collision Counter MSB */
#define SEEQ_TEST 4 /* "For Test Only" - Do Not Use */
#define SEEQ_SQE 5 /* SQE / No Carrier */
#define SQE_FLAG 0x01 /* SQE Flag */
#define SQE_NOCARR 0x02 /* No Carrier Flag */
#define SEEQ_RXCMD 6 /* Rx Command */
#define RXCMD_IE_OFLOW 0x01 /* Interrupt on Overflow Error */
#define RXCMD_IE_CRC 0x02 /* Interrupt on CRC Error */
#define RXCMD_IE_DRIB 0x04 /* Interrupt on Dribble Error */
#define RXCMD_IE_SHORT 0x08 /* Interrupt on Short Frame */
#define RXCMD_IE_END 0x10 /* Interrupt on End of Frame */
#define RXCMD_IE_GOOD 0x20 /* Interrupt on Good Frame */
#define RXCMD_REC_MASK 0xc0 /* Receiver Match Mode Mask */
#define RXCMD_REC_NONE 0x00 /* Receiver Disabled */
#define RXCMD_REC_ALL 0x40 /* Receive All Frames */
#define RXCMD_REC_BROAD 0x80 /* Receive Station/Broadcast Frames */
#define RXCMD_REC_MULTI 0xc0 /* Station/Broadcast/Multicast */
#define SEEQ_RXSTAT 6 /* Rx Status */
#define RXSTAT_OFLOW 0x01 /* Frame Overflow Error */
#define RXSTAT_CRC 0x02 /* Frame CRC Error */
#define RXSTAT_DRIB 0x04 /* Frame Dribble Error */
#define RXSTAT_SHORT 0x08 /* Received Short Frame */
#define RXSTAT_END 0x10 /* Received End of Frame */
#define RXSTAT_GOOD 0x20 /* Received Good Frame */
#define RXSTAT_OLDNEW 0x80 /* Old/New Status */
#define SEEQ_TXCMD 7 /* Tx Command */
#define TXCMD_IE_UFLOW 0x01 /* Interrupt on Transmit Underflow */
#define TXCMD_IE_COLL 0x02 /* Interrupt on Transmit Collision */
#define TXCMD_IE_16COLL 0x04 /* Interrupt on 16 Collisions */
#define TXCMD_IE_GOOD 0x08 /* Interrupt on Transmit Success */
#define TXCMD_ENABLE_C 0xf0 /* (80C03) Enable 80C03 Mode */
#define TXCMD_BANK_MASK 0x60 /* (80C03) Register Bank Mask */
#define TXCMD_BANK0 0x00 /* (80C03) Register Bank 0 (8003) */
#define TXCMD_BANK1 0x20 /* (80C03) Register Bank 1 (Writes) */
#define TXCMD_BANK2 0x40 /* (80C03) Register Bank 2 (Writes) */
#define SEEQ_TXSTAT 7 /* Tx Status */
#define TXSTAT_UFLOW 0x01 /* Transmit Underflow */
#define TXSTAT_COLL 0x02 /* Transmit Collision */
#define TXSTAT_16COLL 0x04 /* 16 Collisions */
#define TXSTAT_GOOD 0x08 /* Transmit Success */
#define TXSTAT_OLDNEW 0x80 /* Old/New Status */
/*
* 80C03 Mode Register Bank 1
*/
#define SEEQ_MC_HASH0 0 /* Multicast Filter Byte 0 (LSB) */
#define SEEQ_MC_HASH1 1 /* Multicast Filter Byte 1 */
#define SEEQ_MC_HASH2 2 /* Multicast Filter Byte 2 */
#define SEEQ_MC_HASH3 3 /* Multicast Filter Byte 3 */
#define SEEQ_MC_HASH4 4 /* Multicast Filter Byte 4 */
#define SEEQ_MC_HASH5 5 /* Multicast Filter Byte 5 */
/*
* 80C03 Mode Register Bank 2
*/
#define SEEQ_MC_HASH6 0 /* Multicast Filter Byte 6 */
#define SEEQ_MC_HASH7 1 /* Multicast Filter Byte 7 (MSB) */
#define SEEQ_RESERVED0 2 /* Reserved (Set to All Zeroes) */
#define SEEQ_TXCTRL 3 /* Tx Control */
#define TXCTRL_TXCOLL 0x01 /* Clear/Enable Tx Collision Counter */
#define TXCTRL_COLL 0x02 /* Clear/Enable Collision Counter */
#define TXCTRL_SQE 0x04 /* Clear/Enable SQE Flag */
#define TXCTRL_HASH 0x08 /* Enable Multicast Hash Filter */
#define TXCTRL_SHORT 0x10 /* Receive Short (<13 Bytes) Frames */
#define TXCTRL_NOCARR 0x20 /* Clear/Enable No Carrier Flag */
#define SEEQ_CFG 4 /* Transmit/Receive Configuration */
#define CFG_RX_GRPADDR 0x01 /* Ignore Last 4 Bits of Address */
#define CFG_TX_AUTOPAD 0x02 /* Automatically Pad to 60 Bytes */
#define CFG_TX_NOPRE 0x04 /* Do Not Add Preamble Pattern */
#define CFG_RX_NOOWN 0x08 /* Do Not Receive Own Packets */
#define CFG_TX_NOCRC 0x10 /* No Not Append CRC */
#define CFG_TX_DUPLEX 0x20 /* AutoDUPLEX - Ignore Carrier */
#define CFG_RX_CRCFIFO 0x40 /* Write CRC to FIFO */
#define CFG_RX_FASTDISC 0x80 /* Fast Receive Discard Mode */
#define SEEQ_RESERVED1 5 /* Reserved */
#define SEEQ_RESERVED2 6 /* Reserved */
#define SEEQ_RESERVED3 7 /* Reserved */
|
eb747b7ab9193e4c12ff704153855e4f7ded3cb4
|
b732361d6b3405c3e79ac0a7d8361cf5b329b015
|
/ext/phalcon/html/helper/button.zep.h
|
d6fe3992ef59e8e2d944bb9de3fb9a8061862dd9
|
[
"BSD-3-Clause"
] |
permissive
|
phalcon/cphalcon
|
4a5b26f47b5c2a4107541d7fd73c595c0d90ed73
|
fc183e11e8b96c43daf7d893244846206dc2aa73
|
refs/heads/master
| 2023-03-07T22:09:48.814291
| 2023-02-28T16:45:15
| 2023-02-28T16:45:15
| 2,854,337
| 8,135
| 2,343
|
BSD-3-Clause
| 2023-09-12T12:41:13
| 2011-11-26T05:52:50
|
PHP
|
UTF-8
|
C
| false
| true
| 704
|
h
|
button.zep.h
|
extern zend_class_entry *phalcon_html_helper_button_ce;
ZEPHIR_INIT_CLASS(Phalcon_Html_Helper_Button);
PHP_METHOD(Phalcon_Html_Helper_Button, __invoke);
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_helper_button___invoke, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
#if PHP_VERSION_ID >= 80000
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]")
#else
ZEND_ARG_ARRAY_INFO(0, attributes, 0)
#endif
ZEND_ARG_TYPE_INFO(0, raw, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEPHIR_INIT_FUNCS(phalcon_html_helper_button_method_entry) {
PHP_ME(Phalcon_Html_Helper_Button, __invoke, arginfo_phalcon_html_helper_button___invoke, ZEND_ACC_PUBLIC)
PHP_FE_END
};
|
d038c41f9c8dc84ee39feacb8fd427a8be502b24
|
36a92ec73c174daf7d1cd05d20dc7e1baa7ed831
|
/fast-models-examples/GICv3.x_GICv4.x_example/src/gicv4_virt.c
|
907b08a8aefbc8f5d4de2bca55e3b7b4ad0c9656
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
ARM-software/Tool-Solutions
|
88d941367949c5f491ee73d3413d17cc8bc834ff
|
04545fbffcae472b7d880bb0453e118fb2885e95
|
refs/heads/main
| 2023-09-02T00:15:57.634633
| 2023-08-18T11:00:28
| 2023-08-18T12:33:44
| 155,524,900
| 241
| 149
|
Apache-2.0
| 2023-09-12T09:27:14
| 2018-10-31T08:39:51
|
C
|
WINDOWS-1258
|
C
| false
| false
| 13,463
|
c
|
gicv4_virt.c
|
// ----------------------------------------------------------
// GICv3 Physical LPI functions
//
// Copyright (C) Arm Limited, 2019 All rights reserved.
//
// The example code is provided to you as an aid to learning when working
// with Arm-based technology, including but not limited to programming tutorials.
// Arm hereby grants to you, subject to the terms and conditions of this Licence,
// a non-exclusive, non-transferable, non-sub-licensable, free-of-charge licence,
// to use and copy the Software solely for the purpose of demonstration and
// evaluation.
//
// You accept that the Software has not been tested by Arm therefore the Software
// is provided “as is”, without warranty of any kind, express or implied. In no
// event shall the authors or copyright holders be liable for any claim, damages
// or other liability, whether in action or contract, tort or otherwise, arising
// from, out of or in connection with the Software or the use of Software.
//
// ------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include "gicv3_registers.h"
#include "gicv4_virt.h"
extern void itsAddCommand(uint8_t* command);
// The first release of ARM Compiler 6 does not support the DSB
// intrinsic. Re-creating manually.
static __inline void __dsb(void)
{
asm("dsb sy");
}
// ------------------------------------------------------------
// Setting location of interfaces
// ------------------------------------------------------------
extern struct GICv3_its_ctlr_if* gic_its;
extern struct GICv3_its_int_if* gic_its_ints;
struct GICv3_its_sgi_if* gic_its_sgi;
extern struct GICv3_rdist_if* gic_rdist;
// ------------------------------------------------------------
// Address space set up
// ------------------------------------------------------------
void setSGIBaseAddr(void)
{
gic_its_sgi = (struct GICv3_its_sgi_if*)((uint64_t)gic_its + 0x20000);
}
// ------------------------------------------------------------
// Discovery
// ------------------------------------------------------------
uint32_t isGICv4x(uint32_t rd)
{
if (((gic_rdist[rd].lpis.GICR_TYPER[0] >> 1) & 0x1) == 0)
return GICV3_v3X; // GICR_TYPER.VLPIS==0, so GICv3.x
if (((gic_rdist[rd].lpis.GICR_TYPER[0] >> 7) & 0x1) == 0)
return GICV3_v40; // GICR_TYPER.RVPEID==0, so GICv4.0
// GICR_TYPER.{VLPIS,RVPEID}=={1,1} => GICv4.1
return GICV3_v41;
}
// ------------------------------------------------------------
uint32_t hasVSGI(uint32_t rd)
{
uint32_t its_type, rd_type;
its_type = (gic_its->GITS_TYPER >> 39) & 0x1;
rd_type = (gic_rdist[rd].lpis.GICR_TYPER[0] >> 26) & 0x1;
// Return 1 if both RD and ITS support vSGI, otherwise return 0
return (its_type & rd_type);
}
// ------------------------------------------------------------
// Redistributor setup functions
// ------------------------------------------------------------
uint32_t setVPEConfTableAddr(uint32_t rd, uint64_t addr, uint64_t attributes, uint32_t num_pages)
{
uint64_t tmp;
addr = addr & (uint64_t)0x0000FFFFFFFFF000;
//attributes = attributes & (uint64_t)0xF800000000000C00;
num_pages = num_pages & 0x000000000000007F;
#ifdef DEBUG
printf("setVPEConfTableAddr:: Setting up vPE Configuration Table on RD%d at 0x%lx, with %d pages\n", rd, addr, num_pages);
#endif
// check number of pages is not 0
if (num_pages == 0)
{
#ifdef DEBUG
printf("setVPEConfTableAddr:: ERROR - Page count for Command Queue cannot be 0\n");
#endif
return 1;
}
// check the number of pages is within the maximum
if (num_pages > 127)
{
#ifdef DEBUG
printf("setVPEConfTableAddr:: ERROR - Page count for Command Queue cannot be greater than 127\n");
#endif
return 1;
}
// work out queue size in bytes, then zero memory
// This code assumes that VA=PA for allocated memory
tmp = num_pages * 4096;
memset((void*)addr, 0, tmp);
// Combine address, attributes and size
// TBD add in attributes, current fixed as Device
tmp = addr | (num_pages - 1) | ((uint64_t)1 << 52) | (uint64_t)1 << 63;
gic_rdist[rd].vlpis.GICR_VPROPBASER = tmp;
return 0;
}
// ------------------------------------------------------------
uint32_t makeResident(uint32_t rd, uint32_t vpeid, uint32_t g0, uint32_t g1)
{
#ifdef DEBUG
printf("makeResident:: Making vPEID 0x%x resident on RD%d\n", vpeid, rd);
#endif
// Check there isn't already a vPE resident
if ((gic_rdist[rd].vlpis.GICR_VPENDBASER & ((uint64_t)1 << 63)) == 1)
{
#ifdef DEBUG
printf("makeResident:: ERROR - a vPE is already resident\n");
#endif
return 0xFFFFFFFF;
}
gic_rdist[rd].vlpis.GICR_VPENDBASER = ((uint64_t)vpeid & 0xFFFF) |
((uint64_t)1 << 63) |
((uint64_t)(g1 & 0x1) << 59) |
((uint64_t)(g0 & 0x1) << 58);
// Poll for residency to take affect
while ((gic_rdist[rd].vlpis.GICR_VPENDBASER & ((uint64_t)0x1 << 60)) != 0)
{}
return 0;
}
// ------------------------------------------------------------
// Enables LPIs for the currently selected Redistributor
uint32_t makeNotResident(uint32_t rd, uint32_t db)
{
// First clear the valid bit
gic_rdist[rd].vlpis.GICR_VPENDBASER = ((uint64_t)(db & 0x1) << 62);
// Now poll for dirty==0
while ((gic_rdist[rd].vlpis.GICR_VPENDBASER & ((uint64_t)0x1 << 60)) != 0)
{}
// Return pending last
return (gic_rdist[rd].vlpis.GICR_VPENDBASER & ((uint64_t)0x1 << 61));
}
// ------------------------------------------------------------
// Configuring LPI functions
// ------------------------------------------------------------
// Configures specified vLPI
uint32_t configureVLPI(uint8_t* table, uint32_t ID, uint32_t enable, uint32_t priority)
{
uint8_t* config;
#ifdef DEBUG
printf("configureVLPI:: Configuring vINITD %d as priority 0x%x and enable=%d\n", ID, priority, enable);
#endif
// Check lower limit
if (ID < 8192)
{
#ifdef DEBUG
printf("configureVLPI:: ERROR - INTID %d is not a valid LPI\n", ID);
#endif
return 1;
}
// TBD - Check the upper limit, which requires knowing the table size.
// Mask off unused bits of the priority and enable
enable = enable & 0x1;
priority = priority & 0x7C;
// Combine priority and enable, write result into table
// Note: bit 1 is RES1
table[(ID - 8192)] = (0x2 | enable | priority);
__dsb();
return 0;
}
// ------------------------------------------------------------
// ITS setup functions
// ------------------------------------------------------------
uint32_t itsSharedTableSupport(void)
{
return ((gic_its->GITS_TYPER >> 41) & 0x3);
}
// ------------------------------------------------------------
uint32_t itsGetAffinity(void)
{
return gic_its->GITS_MPIDR;
}
// ------------------------------------------------------------
// vSGI
// ------------------------------------------------------------
void itsSendSGI(uint32_t vintid, uint32_t vpeid)
{
gic_its_sgi->GITS_SGIR = (uint64_t)(vintid & 0xF) | ((uint64_t)(vpeid & 0xFF) << 32);
return;
}
// ------------------------------------------------------------
// ITS commands
// ------------------------------------------------------------
void itsVMAPP(uint32_t vpeid, uint32_t target, uint64_t conf_addr, uint64_t pend_addr, uint32_t alloc, uint32_t v, uint32_t doorbell, uint32_t size)
{
uint8_t command[32];
uint32_t i;
// Fill command with 0s
for (i=0; i<32; i++)
command[i] = 0;
// Check whether "target" is PA or Processor Number
if ((gic_its->GITS_TYPER & (1 << 19)) != 0)
target = target >> 16;
// Construct command
command[0] = 0x29;
command[1] = alloc | 0x2; // Assume that memory is zeroed, so PTZ=1
command[2] = (uint8_t)(0xFF & (conf_addr >> 16));
command[3] = (uint8_t)(0xFF & (conf_addr >> 24));
command[4] = (uint8_t)(0xFF & (conf_addr >> 32));
command[5] = (uint8_t)(0xFF & (conf_addr >> 40));
command[6] = (uint8_t)(0xFF & (conf_addr >> 48));
//command[7]
command[8] = (uint8_t)(0xFF & doorbell);
command[9] = (uint8_t)(0xFF & (doorbell >> 8));
command[10] = (uint8_t)(0xFF & (doorbell >> 16));
command[11] = (uint8_t)(0xFF & (doorbell >> 24));
command[12] = (uint8_t)(0xFF & vpeid);
command[13] = (uint8_t)(0xFF & (vpeid >> 8));
//command[14]
//command[15]
//command[16]
//command[17]
command[18] = (uint8_t)(0xFF & target);
command[19] = (uint8_t)(0xFF & (target >> 8));
command[20] = (uint8_t)(0xFF & (target >> 16));
command[21] = (uint8_t)(0xFF & (target >> 24));
//command[22]
command[23] = (uint8_t)(v << 7);
command[24] = size;
//command[25]
command[26] = (uint8_t)(0xFF & (pend_addr >> 16));
command[27] = (uint8_t)(0xFF & (pend_addr >> 24));
command[28] = (uint8_t)(0xFF & (pend_addr >> 32));
command[29] = (uint8_t)(0xFF & (pend_addr >> 40));
command[30] = (uint8_t)(0xFF & (pend_addr >> 48));
//command[31]
// Add command to queue
itsAddCommand(command);
return;
}
// ------------------------------------------------------------
void itsVSYNC(uint32_t vpeid)
{
uint8_t command[32];
uint32_t i;
// Fill command with 0s
for (i=0; i<32; i++)
command[i] = 0;
// Construct command
command[0] = 0x25;
//command[1]
//command[2]
//command[3]
//command[4]
//command[5]
//command[6]
//command[7]
//command[8]
//command[9]
//command[10]
//command[11]
command[12] = (uint8_t)(0xFF & vpeid);
command[13] = (uint8_t)(0xFF & (vpeid >> 8));
//command[14]
//command[15]
//command[16]
//command[17]
//command[18]
//command[19]
//command[20]
//command[21]
//command[22]
//command[23]
//ocmmand[24]
//command[25]
//command[26]
//command[27]
//command[28]
//command[29]
//command[30]
//command[31]
// Add command to queue
itsAddCommand(command);
return;
}
// ------------------------------------------------------------
void itsVMAPTI(uint32_t DeviceID, uint32_t EventID, uint32_t doorbell, uint32_t vpeid, uint32_t vINTID)
{
uint8_t command[32];
uint32_t i;
// Fill command with 0s
for (i=0; i<32; i++)
command[i] = 0;
// Construct command
command[0] = 0x2A;
//command[1]
//command[2]
//command[3]
command[4] = (uint8_t)(0xFF & DeviceID);
command[5] = (uint8_t)(0xFF & (DeviceID >> 8));
command[6] = (uint8_t)(0xFF & (DeviceID >> 16));
command[7] = (uint8_t)(0xFF & (DeviceID >> 24));
command[8] = (uint8_t)(0xFF & EventID);
command[9] = (uint8_t)(0xFF & (EventID >> 8));
command[10] = (uint8_t)(0xFF & (EventID >> 16));
command[11] = (uint8_t)(0xFF & (EventID >> 24));
command[12] = (uint8_t)(0xFF & vpeid);
command[13] = (uint8_t)(0xFF & (vpeid >> 8));
//command[14]
//command[15]
command[16] = (uint8_t)(0xFF & vINTID);
command[17] = (uint8_t)(0xFF & (vINTID >> 8));
command[18] = (uint8_t)(0xFF & (vINTID >> 16));
command[19] = (uint8_t)(0xFF & (vINTID >> 24));
command[20] = (uint8_t)(0xFF & doorbell);
command[21] = (uint8_t)(0xFF & (doorbell >> 8));
command[22] = (uint8_t)(0xFF & (doorbell >> 16));
command[23] = (uint8_t)(0xFF & (doorbell >> 24));
// Add command to queue
itsAddCommand(command);
return;
}
// ------------------------------------------------------------
void itsINVDB(uint32_t vpeid)
{
uint8_t command[32];
uint32_t i;
// Fill command with 0s
for (i=0; i<32; i++)
command[i] = 0;
// Construct command
command[0] = 0x2E;
//command[1]
//command[2]
//command[3]
//command[4]
//command[5]
//command[6]
//command[7]
//command[8]
//command[9]
//command[10]
//command[11]
command[12] = (uint8_t)(0xFF & vpeid);
command[13] = (uint8_t)(0xFF & (vpeid >> 8));
//command[14]
//command[15]
// Add command to queue
itsAddCommand(command);
return;
}
// ------------------------------------------------------------
void itsVSGI(uint32_t vpeid, uint32_t vintid, uint32_t enable, uint32_t priority, uint32_t group, uint32_t clear)
{
uint8_t command[32];
uint32_t i;
// Fill command with 0s
for (i=0; i<32; i++)
command[i] = 0;
// Construct command
command[0] = 0x23;
if (clear==0)
command[1] = (uint8_t)(enable | (group << 2));
else
command[1] = 0x2;
command[2] = (uint8_t)(0xF0 & priority);
//command[3]
command[4] = vintid;
//command[5]
//command[6]
//command[7]
//command[8]
//command[9]
//command[10]
//command[11]
command[12] = (uint8_t)(0xFF & vpeid);
command[13] = (uint8_t)(0xFF & (vpeid >> 8));
//command[14]
//command[15]
// Add command to queue
itsAddCommand(command);
return;
}
// ------------------------------------------------------------
// End of giv3_virt.c
// ------------------------------------------------------------
|
f31968f9612b3d19a0ba001c8825878e85850ff2
|
f34c3cc5ee087643bf6492afea1503b8f8440869
|
/board/drivers/fake_siren.h
|
38c87deb0cc34fc33f28a839257d679b8f851b5a
|
[
"MIT"
] |
permissive
|
commaai/panda
|
24334163d7c2ee49b5baa854fe355681fd5ceaba
|
72f1603a89c7fecb6746d0154232f2d8187ebe70
|
refs/heads/master
| 2023-09-04T12:48:22.461254
| 2023-09-01T23:32:08
| 2023-09-01T23:32:08
| 87,490,037
| 1,493
| 781
|
MIT
| 2023-09-14T21:34:19
| 2017-04-07T01:11:08
|
C
|
UTF-8
|
C
| false
| false
| 4,752
|
h
|
fake_siren.h
|
#include "stm32h7/lli2c.h"
#define CODEC_I2C_ADDR 0x10
// 1Vpp sine wave with 1V offset
const uint8_t fake_siren_lut[360] = { 134U, 135U, 137U, 138U, 139U, 140U, 141U, 143U, 144U, 145U, 146U, 148U, 149U, 150U, 151U, 152U, 154U, 155U, 156U, 157U, 158U, 159U, 160U, 162U, 163U, 164U, 165U, 166U, 167U, 168U, 169U, 170U, 171U, 172U, 174U, 175U, 176U, 177U, 177U, 178U, 179U, 180U, 181U, 182U, 183U, 184U, 185U, 186U, 186U, 187U, 188U, 189U, 190U, 190U, 191U, 192U, 193U, 193U, 194U, 195U, 195U, 196U, 196U, 197U, 197U, 198U, 199U, 199U, 199U, 200U, 200U, 201U, 201U, 202U, 202U, 202U, 203U, 203U, 203U, 203U, 204U, 204U, 204U, 204U, 204U, 204U, 204U, 205U, 205U, 205U, 205U, 205U, 205U, 205U, 204U, 204U, 204U, 204U, 204U, 204U, 204U, 203U, 203U, 203U, 203U, 202U, 202U, 202U, 201U, 201U, 200U, 200U, 199U, 199U, 199U, 198U, 197U, 197U, 196U, 196U, 195U, 195U, 194U, 193U, 193U, 192U, 191U, 190U, 190U, 189U, 188U, 187U, 186U, 186U, 185U, 184U, 183U, 182U, 181U, 180U, 179U, 178U, 177U, 177U, 176U, 175U, 174U, 172U, 171U, 170U, 169U, 168U, 167U, 166U, 165U, 164U, 163U, 162U, 160U, 159U, 158U, 157U, 156U, 155U, 154U, 152U, 151U, 150U, 149U, 148U, 146U, 145U, 144U, 143U, 141U, 140U, 139U, 138U, 137U, 135U, 134U, 133U, 132U, 130U, 129U, 128U, 127U, 125U, 124U, 123U, 122U, 121U, 119U, 118U, 117U, 116U, 115U, 113U, 112U, 111U, 110U, 109U, 108U, 106U, 105U, 104U, 103U, 102U, 101U, 100U, 99U, 98U, 97U, 96U, 95U, 94U, 93U, 92U, 91U, 90U, 89U, 88U, 87U, 86U, 85U, 84U, 83U, 82U, 82U, 81U, 80U, 79U, 78U, 78U, 77U, 76U, 76U, 75U, 74U, 74U, 73U, 72U, 72U, 71U, 71U, 70U, 70U, 69U, 69U, 68U, 68U, 67U, 67U, 67U, 66U, 66U, 66U, 65U, 65U, 65U, 65U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 63U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 64U, 65U, 65U, 65U, 65U, 66U, 66U, 66U, 67U, 67U, 67U, 68U, 68U, 69U, 69U, 70U, 70U, 71U, 71U, 72U, 72U, 73U, 74U, 74U, 75U, 76U, 76U, 77U, 78U, 78U, 79U, 80U, 81U, 82U, 82U, 83U, 84U, 85U, 86U, 87U, 88U, 89U, 90U, 91U, 92U, 93U, 94U, 95U, 96U, 97U, 98U, 99U, 100U, 101U, 102U, 103U, 104U, 105U, 106U, 108U, 109U, 110U, 111U, 112U, 113U, 115U, 116U, 117U, 118U, 119U, 121U, 122U, 123U, 124U, 125U, 127U, 128U, 129U, 130U, 132U, 133U };
bool fake_siren_enabled = false;
void fake_siren_codec_enable(bool enabled) {
if (enabled) {
bool success = true;
success &= i2c_set_reg_bits(I2C5, CODEC_I2C_ADDR, 0x2B, (1U << 1)); // Left speaker mix from INA1
success &= i2c_set_reg_bits(I2C5, CODEC_I2C_ADDR, 0x2C, (1U << 1)); // Right speaker mix from INA1
success &= i2c_set_reg_mask(I2C5, CODEC_I2C_ADDR, 0x3D, 0x17, 0b11111); // Left speaker volume
success &= i2c_set_reg_mask(I2C5, CODEC_I2C_ADDR, 0x3E, 0x17, 0b11111); // Right speaker volume
success &= i2c_set_reg_mask(I2C5, CODEC_I2C_ADDR, 0x37, 0b101, 0b111); // INA gain
success &= i2c_set_reg_bits(I2C5, CODEC_I2C_ADDR, 0x4C, (1U << 7)); // Enable INA
success &= i2c_set_reg_bits(I2C5, CODEC_I2C_ADDR, 0x51, (1U << 7)); // Disable global shutdown
if (!success) {
print("Siren codec enable failed\n");
fault_occurred(FAULT_SIREN_MALFUNCTION);
}
} else {
// Disable INA input. Make sure to retry a few times if the I2C bus is busy.
for (uint8_t i=0U; i<10U; i++) {
if (i2c_clear_reg_bits(I2C5, CODEC_I2C_ADDR, 0x4C, (1U << 7))) {
break;
}
}
}
}
void fake_siren_set(bool enabled) {
if (enabled != fake_siren_enabled) {
fake_siren_codec_enable(enabled);
}
if (enabled) {
register_set_bits(&DMA1_Stream1->CR, DMA_SxCR_EN);
} else {
register_clear_bits(&DMA1_Stream1->CR, DMA_SxCR_EN);
}
fake_siren_enabled = enabled;
}
void fake_siren_init(void) {
// Init DAC
register_set(&DAC1->MCR, 0U, 0xFFFFFFFFU);
register_set(&DAC1->CR, DAC_CR_TEN1 | (6U << DAC_CR_TSEL1_Pos) | DAC_CR_DMAEN1, 0xFFFFFFFFU);
register_set_bits(&DAC1->CR, DAC_CR_EN1);
// Setup DMAMUX (DAC_CH1_DMA as input)
register_set(&DMAMUX1_Channel1->CCR, 67U, DMAMUX_CxCR_DMAREQ_ID_Msk);
// Setup DMA
register_set(&DMA1_Stream1->M0AR, (uint32_t) fake_siren_lut, 0xFFFFFFFFU);
register_set(&DMA1_Stream1->PAR, (uint32_t) &(DAC1->DHR8R1), 0xFFFFFFFFU);
DMA1_Stream1->NDTR = sizeof(fake_siren_lut);
register_set(&DMA1_Stream1->FCR, 0U, 0x00000083U);
DMA1_Stream1->CR = (0b11 << DMA_SxCR_PL_Pos);
DMA1_Stream1->CR |= DMA_SxCR_MINC | DMA_SxCR_CIRC | (1 << DMA_SxCR_DIR_Pos);
// Init trigger timer (around 2.5kHz)
register_set(&TIM7->PSC, 0U, 0xFFFFU);
register_set(&TIM7->ARR, 133U, 0xFFFFU);
register_set(&TIM7->CR2, (0b10 << TIM_CR2_MMS_Pos), TIM_CR2_MMS_Msk);
register_set(&TIM7->CR1, TIM_CR1_ARPE | TIM_CR1_URS, 0x088EU);
TIM7->SR = 0U;
TIM7->CR1 |= TIM_CR1_CEN;
// Enable the I2C to the codec
i2c_init(I2C5);
fake_siren_codec_enable(false);
}
|
cdcd53dee067edab4b6f3ba0087198def2f6cf90
|
d38ed5f31d74a79a054ed55dd9123a8d615283b9
|
/third_party/libgit2/tests/config/config_helpers.c
|
d92ff1a4ee81d660127f5d1a092b1f64a8147239
|
[
"Apache-2.0",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain",
"GCC-exception-2.0",
"LGPL-2.0-or-later",
"Zlib",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"ISC",
"MIT"
] |
permissive
|
chigraph/chigraph
|
8ff76a14337da29fa2b2a84d5c35f2eac4156c6e
|
6981bdd6763db54edfe284c1f7d223193584c69a
|
refs/heads/master
| 2022-12-21T13:46:57.273039
| 2022-12-17T18:41:19
| 2022-12-17T18:41:19
| 60,776,831
| 364
| 65
|
Apache-2.0
| 2019-12-13T14:46:43
| 2016-06-09T13:27:37
|
C++
|
UTF-8
|
C
| false
| false
| 1,385
|
c
|
config_helpers.c
|
#include "clar_libgit2.h"
#include "config_helpers.h"
#include "repository.h"
#include "buffer.h"
void assert_config_entry_existence(
git_repository *repo,
const char *name,
bool is_supposed_to_exist)
{
git_config *config;
git_config_entry *entry = NULL;
int result;
cl_git_pass(git_repository_config__weakptr(&config, repo));
result = git_config_get_entry(&entry, config, name);
git_config_entry_free(entry);
if (is_supposed_to_exist)
cl_git_pass(result);
else
cl_assert_equal_i(GIT_ENOTFOUND, result);
}
void assert_config_entry_value(
git_repository *repo,
const char *name,
const char *expected_value)
{
git_config *config;
git_buf buf = GIT_BUF_INIT;
cl_git_pass(git_repository_config__weakptr(&config, repo));
cl_git_pass(git_config_get_string_buf(&buf, config, name));
cl_assert_equal_s(expected_value, git_buf_cstr(&buf));
git_buf_dispose(&buf);
}
static int count_config_entries_cb(
const git_config_entry *entry,
void *payload)
{
int *how_many = (int *)payload;
GIT_UNUSED(entry);
(*how_many)++;
return 0;
}
int count_config_entries_match(git_repository *repo, const char *pattern)
{
git_config *config;
int how_many = 0;
cl_git_pass(git_repository_config(&config, repo));
cl_assert_equal_i(0, git_config_foreach_match(
config, pattern, count_config_entries_cb, &how_many));
git_config_free(config);
return how_many;
}
|
ab792d4707ec6720fb9e0ba3bf90492c0f6f42f5
|
c4a119311ac01bbe7d5ab81b1d3d663ad0900ab6
|
/python-modules/pybluez/bluez/bluetooth/sdp_lib.h
|
e506ac15a8fcdbaba2004c77e7ff8ba5cff6b15b
|
[
"GPL-2.0-only",
"Apache-2.0"
] |
permissive
|
kuri65536/python-for-android
|
1d8d99e81e64bc87805c2c58ee0dcf43d413e72e
|
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
|
refs/heads/master
| 2021-06-02T01:17:29.685199
| 2018-05-05T00:12:13
| 2018-05-05T01:36:22
| 32,235,625
| 280
| 122
|
Apache-2.0
| 2020-05-15T06:47:36
| 2015-03-14T22:44:36
|
Python
|
UTF-8
|
C
| false
| false
| 21,650
|
h
|
sdp_lib.h
|
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2001-2002 Nokia Corporation
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2002-2003 Stephen Crane <steve.crane@rococosoft.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __SDP_LIB_H
#define __SDP_LIB_H
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* SDP lists
*/
typedef void(*sdp_list_func_t)(void *, void *);
typedef void(*sdp_free_func_t)(void *);
typedef int (*sdp_comp_func_t)(const void *, const void *);
sdp_list_t *sdp_list_append(sdp_list_t *list, void *d);
sdp_list_t *sdp_list_remove(sdp_list_t *list, void *d);
sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *data, sdp_comp_func_t f);
void sdp_list_free(sdp_list_t *list, sdp_free_func_t f);
static inline int sdp_list_len(const sdp_list_t *list)
{
int n = 0;
for (; list; list = list->next)
n++;
return n;
}
static inline sdp_list_t *sdp_list_find(sdp_list_t *list, void *u, sdp_comp_func_t f)
{
for (; list; list = list->next)
if (f(list->data, u) == 0)
return list;
return NULL;
}
static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u)
{
for (; list; list = list->next)
f(list->data, u);
}
/*
* Values of the flags parameter to sdp_record_register
*/
#define SDP_RECORD_PERSIST 0x01
#define SDP_DEVICE_RECORD 0x02
/*
* Values of the flags parameter to sdp_connect
*/
#define SDP_RETRY_IF_BUSY 0x01
#define SDP_WAIT_ON_CLOSE 0x02
#define SDP_NON_BLOCKING 0x04
/*
* a session with an SDP server
*/
typedef struct {
int sock;
int state;
int local;
int flags;
uint16_t tid; // Current transaction ID
void *priv;
} sdp_session_t;
typedef enum {
/*
* Attributes are specified as individual elements
*/
SDP_ATTR_REQ_INDIVIDUAL = 1,
/*
* Attributes are specified as a range
*/
SDP_ATTR_REQ_RANGE
} sdp_attrreq_type_t;
/*
* When the pdu_id(type) is a sdp error response, check the status value
* to figure out the error reason. For status values 0x0001-0x0006 check
* Bluetooth SPEC. If the status is 0xffff, call sdp_get_error function
* to get the real reason:
* - wrong transaction ID(EPROTO)
* - wrong PDU id or(EPROTO)
* - I/O error
*/
typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata);
/*
* create an L2CAP connection to a Bluetooth device
*
* INPUT:
*
* bdaddr_t *src:
* Address of the local device to use to make the connection
* (or BDADDR_ANY)
*
* bdaddr_t *dst:
* Address of the SDP server device
*/
sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags);
int sdp_close(sdp_session_t *session);
int sdp_get_socket(const sdp_session_t *session);
/*
* SDP transaction: functions for asynchronous search.
*/
sdp_session_t *sdp_create(int sk, uint32_t flags);
int sdp_get_error(sdp_session_t *session);
int sdp_process(sdp_session_t *session);
int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata);
int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num);
int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
uint16_t sdp_gen_tid(sdp_session_t *session);
/*
* find all devices in the piconet
*/
int sdp_general_inquiry(inquiry_info *ii, int dev_num, int duration, uint8_t *found);
/* flexible extraction of basic attributes - Jean II */
int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attr, int *value);
int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int valuelen);
/*
* Basic sdp data functions
*/
sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value);
sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length);
void sdp_data_free(sdp_data_t *data);
sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id);
sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len);
sdp_data_t *sdp_seq_alloc_with_length(void **dtds, void **values, int *length, int len);
sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data);
int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data);
void sdp_attr_remove(sdp_record_t *rec, uint16_t attr);
void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *data);
int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t attr, sdp_list_t *seq);
int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp);
/*
* NOTE that none of the functions below will update the SDP server,
* unless the {register, update}sdp_record_t() function is invoked.
* All functions which return an integer value, return 0 on success
* or -1 on failure.
*/
/*
* Create an attribute and add it to the service record's attribute list.
* This consists of the data type descriptor of the attribute,
* the value of the attribute and the attribute identifier.
*/
int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *p);
/*
* Set the information attributes of the service record.
* The set of attributes comprises service name, description
* and provider name
*/
void sdp_set_info_attr(sdp_record_t *rec, const char *name, const char *prov, const char *desc);
/*
* Set the ServiceClassID attribute to the sequence specified by seq.
* Note that the identifiers need to be in sorted order from the most
* specific to the most generic service class that this service
* conforms to.
*/
static inline int sdp_set_service_classes(sdp_record_t *rec, sdp_list_t *seq)
{
return sdp_set_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seq);
}
/*
* Get the service classes to which the service conforms.
*
* When set, the list contains elements of ServiceClassIdentifer(uint16_t)
* ordered from most specific to most generic
*/
static inline int sdp_get_service_classes(const sdp_record_t *rec, sdp_list_t **seqp)
{
return sdp_get_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seqp);
}
/*
* Set the BrowseGroupList attribute to the list specified by seq.
*
* A service can belong to one or more service groups
* and the list comprises such group identifiers (UUIDs)
*/
static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq)
{
return sdp_set_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seq);
}
/*
* Set the access protocols of the record to those specified in proto
*/
int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
/*
* Set the additional access protocols of the record to those specified in proto
*/
int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
/*
* Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM)
*/
int sdp_get_proto_port(const sdp_list_t *list, int proto);
/*
* Get protocol descriptor.
*/
sdp_data_t *sdp_get_proto_desc(sdp_list_t *list, int proto);
/*
* Set the LanguageBase attributes to the values specified in list
* (a linked list of sdp_lang_attr_t objects, one for each language in
* which user-visible attributes are present).
*/
int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *list);
/*
* Set the ServiceInfoTimeToLive attribute of the service.
* This is the number of seconds that this record is guaranteed
* not to change after being obtained by a client.
*/
static inline int sdp_set_service_ttl(sdp_record_t *rec, uint32_t ttl)
{
return sdp_attr_add_new(rec, SDP_ATTR_SVCINFO_TTL, SDP_UINT32, &ttl);
}
/*
* Set the ServiceRecordState attribute of a service. This is
* guaranteed to change if there is any kind of modification to
* the record.
*/
static inline int sdp_set_record_state(sdp_record_t *rec, uint32_t state)
{
return sdp_attr_add_new(rec, SDP_ATTR_RECORD_STATE, SDP_UINT32, &state);
}
/*
* Set the ServiceID attribute of a service.
*/
void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid);
/*
* Set the GroupID attribute of a service
*/
void sdp_set_group_id(sdp_record_t *rec, uuid_t grouuuid);
/*
* Set the ServiceAvailability attribute of a service.
*
* Note that this represents the relative availability
* of the service: 0x00 means completely unavailable;
* 0xFF means maximum availability.
*/
static inline int sdp_set_service_avail(sdp_record_t *rec, uint8_t avail)
{
return sdp_attr_add_new(rec, SDP_ATTR_SERVICE_AVAILABILITY, SDP_UINT8, &avail);
}
/*
* Set the profile descriptor list attribute of a record.
*
* Each element in the list is an object of type
* sdp_profile_desc_t which is a definition of the
* Bluetooth profile that this service conforms to.
*/
int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *desc);
/*
* Set URL attributes of a record.
*
* ClientExecutableURL: a URL to a client's platform specific (WinCE,
* PalmOS) executable code that can be used to access this service.
*
* DocumentationURL: a URL pointing to service documentation
*
* IconURL: a URL to an icon that can be used to represent this service.
*
* Note: pass NULL for any URLs that you don't want to set or remove
*/
void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char *docURL, const char *iconURL);
/*
* a service search request.
*
* INPUT :
*
* sdp_list_t *search
* list containing elements of the search
* pattern. Each entry in the list is a UUID
* of the service to be searched
*
* uint16_t max_rec_num
* An integer specifying the maximum number of
* entries that the client can handle in the response.
*
* OUTPUT :
*
* int return value
* 0
* The request completed successfully. This does not
* mean the requested services were found
* -1
* The request completed unsuccessfully
*
* sdp_list_t *rsp_list
* This variable is set on a successful return if there are
* non-zero service handles. It is a singly linked list of
* service record handles (uint16_t)
*/
int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp_list);
/*
* a service attribute request.
*
* INPUT :
*
* uint32_t handle
* The handle of the service for which the attribute(s) are
* requested
*
* sdp_attrreq_type_t reqtype
* Attribute identifiers are 16 bit unsigned integers specified
* in one of 2 ways described below :
* SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers
* They are the actual attribute identifiers in ascending order
*
* SDP_ATTR_REQ_RANGE - 32bit identifier range
* The high-order 16bits is the start of range
* the low-order 16bits are the end of range
* 0x0000 to 0xFFFF gets all attributes
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
* Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
* int return value
* 0
* The request completed successfully. This does not
* mean the requested services were found
* -1
* The request completed unsuccessfully due to a timeout
*/
sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
/*
* This is a service search request combined with the service
* attribute request. First a service class match is done and
* for matching service, requested attributes are extracted
*
* INPUT :
*
* sdp_list_t *search
* Singly linked list containing elements of the search
* pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16)
* of the service to be searched
*
* AttributeSpecification attrSpec
* Attribute identifiers are 16 bit unsigned integers specified
* in one of 2 ways described below :
* SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers
* They are the actual attribute identifiers in ascending order
*
* SDP_ATTR_REQ_RANGE - 32bit identifier range
* The high-order 16bits is the start of range
* the low-order 16bits are the end of range
* 0x0000 to 0xFFFF gets all attributes
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
* Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
* int return value
* 0
* The request completed successfully. This does not
* mean the requested services were found
* -1
* The request completed unsuccessfully due to a timeout
*
* sdp_list_t *rsp_list
* This variable is set on a successful return to point to
* service(s) found. Each element of this list is of type
* sdp_record_t *.
*/
int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list);
/*
* Allocate/free a service record and its attributes
*/
sdp_record_t *sdp_record_alloc(void);
void sdp_record_free(sdp_record_t *rec);
/*
* Register a service record.
*
* Note: It is the responsbility of the Service Provider to create the
* record first and set its attributes using setXXX() methods.
*
* The service provider must then call sdp_record_register() to make
* the service record visible to SDP clients. This function returns 0
* on success or -1 on failure (and sets errno).
*/
int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, uint8_t *data, uint32_t size, uint8_t flags, uint32_t *handle);
int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags);
int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags);
/*
* Unregister a service record.
*/
int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle);
int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec);
int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec);
/*
* Update an existing service record. (Calling this function
* before a previous call to sdp_record_register() will result
* in an error.)
*/
int sdp_device_record_update_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle, uint8_t *data, uint32_t size);
int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec);
int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec);
void sdp_record_print(const sdp_record_t *rec);
/*
* UUID functions
*/
uuid_t *sdp_uuid16_create(uuid_t *uuid, uint16_t data);
uuid_t *sdp_uuid32_create(uuid_t *uuid, uint32_t data);
uuid_t *sdp_uuid128_create(uuid_t *uuid, const void *data);
int sdp_uuid16_cmp(const void *p1, const void *p2);
int sdp_uuid128_cmp(const void *p1, const void *p2);
int sdp_uuid_cmp(const void *p1, const void *p2);
uuid_t *sdp_uuid_to_uuid128(const uuid_t *uuid);
void sdp_uuid16_to_uuid128(uuid_t *uuid128, const uuid_t *uuid16);
void sdp_uuid32_to_uuid128(uuid_t *uuid128, const uuid_t *uuid32);
int sdp_uuid128_to_uuid(uuid_t *uuid);
int sdp_uuid_to_proto(uuid_t *uuid);
int sdp_uuid_extract(const uint8_t *buffer, int bufsize, uuid_t *uuid, int *scanned);
void sdp_uuid_print(const uuid_t *uuid);
#define MAX_LEN_UUID_STR 37
#define MAX_LEN_PROTOCOL_UUID_STR 8
#define MAX_LEN_SERVICECLASS_UUID_STR 28
#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 28
int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n);
int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n);
int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n);
int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n);
/*
* In all the sdp_get_XXX(handle, XXX *xxx) functions below,
* the XXX * is set to point to the value, should it exist
* and 0 is returned. If the value does not exist, -1 is
* returned and errno set to ENODATA.
*
* In all the methods below, the memory management rules are
* simple. Don't free anything! The pointer returned, in the
* case of constructed types, is a pointer to the contents
* of the sdp_record_t.
*/
/*
* Get the access protocols from the service record
*/
int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
/*
* Get the additional access protocols from the service record
*/
int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
/*
* Extract the list of browse groups to which the service belongs.
* When set, seqp contains elements of GroupID (uint16_t)
*/
static inline int sdp_get_browse_groups(const sdp_record_t *rec, sdp_list_t **seqp)
{
return sdp_get_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seqp);
}
/*
* Extract language attribute meta-data of the service record.
* For each language in the service record, LangSeq has a struct of type
* sdp_lang_attr_t.
*/
int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq);
/*
* Extract the Bluetooth profile descriptor sequence from a record.
* Each element in the list is of type sdp_profile_desc_t
* which contains the UUID of the profile and its version number
* (encoded as major and minor in the high-order 8bits
* and low-order 8bits respectively of the uint16_t)
*/
int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDesc);
/*
* Extract SDP server version numbers
*
* Note: that this is an attribute of the SDP server only and
* contains a list of uint16_t each of which represent the
* major and minor SDP version numbers supported by this server
*/
int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **pVnumList);
int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid);
int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid);
int sdp_get_record_state(const sdp_record_t *rec, uint32_t *svcRecState);
int sdp_get_service_avail(const sdp_record_t *rec, uint8_t *svcAvail);
int sdp_get_service_ttl(const sdp_record_t *rec, uint32_t *svcTTLInfo);
int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState);
static inline int sdp_get_service_name(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len);
}
static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len);
}
static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len);
}
static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len);
}
static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len);
}
static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len)
{
return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len);
}
/*
* Set the supported features
* sf should be a list of list with each feature data
* Returns 0 on success -1 on fail
*/
int sdp_set_supp_feat(sdp_record_t *rec, const sdp_list_t *sf);
/*
* Get the supported features
* seqp is set to a list of list with each feature data
* Returns 0 on success, if an error occurred -1 is returned and errno is set
*/
int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp);
sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int bufsize, int *scanned);
sdp_record_t *sdp_copy_record(sdp_record_t *rec);
void sdp_data_print(sdp_data_t *data);
void sdp_print_service_attr(sdp_list_t *alist);
int sdp_attrid_comp_func(const void *key1, const void *key2);
void sdp_set_seq_len(uint8_t *ptr, uint32_t length);
void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id);
void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d);
void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len);
int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data);
int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu);
int sdp_extract_seqtype(const uint8_t *buf, int bufsize, uint8_t *dtdp, int *size);
sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int bufsize, int *extractedLength, sdp_record_t *rec);
void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid);
void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq);
int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize);
#ifdef __cplusplus
}
#endif
#endif /* __SDP_LIB_H */
|
93ab9c05389dbddaa8247b86cfbd0bab7f7a14c0
|
a7a403dec4e064d9f1975531d0bfea16da3623f8
|
/api-conversion/SDL_config_iphoneos.h
|
3eaf0b2ba25ccd7773a3029cc913c37b8f41423b
|
[
"MIT"
] |
permissive
|
MasterQ32/SDL.zig
|
e1163e78bf32832d21feeae93f66a5bc0ca21e89
|
602aeb7f1d33da71626aff54a25ef69fef7c613b
|
refs/heads/master
| 2023-08-29T00:35:54.489172
| 2023-08-04T19:34:21
| 2023-08-04T19:34:21
| 225,314,689
| 238
| 58
|
MIT
| 2023-09-07T06:53:57
| 2019-12-02T07:43:30
|
C
|
UTF-8
|
C
| false
| false
| 3,757
|
h
|
SDL_config_iphoneos.h
|
#ifndef SDL_config_iphoneos_h_
#define SDL_config_iphoneos_h_
#define SDL_config_h_
#include "SDL_platform.h"
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define HAVE_GCC_ATOMICS 1
#define STDC_HEADERS 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_DLOPEN 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_HAPTIC_DUMMY 1
#define SDL_JOYSTICK_MFI 1
#define SDL_JOYSTICK_VIRTUAL 1
#ifdef __TVOS__
#define SDL_SENSOR_DUMMY 1
#else
#define SDL_SENSOR_COREMOTION 1
#endif
#define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
#define SDL_TIMER_UNIX 1
#define SDL_VIDEO_DRIVER_UIKIT 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#if !TARGET_OS_MACCATALYST
#define SDL_VIDEO_OPENGL_ES2 1
#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)))
#define SDL_PLATFORM_SUPPORTS_METAL 1
#else
#define SDL_PLATFORM_SUPPORTS_METAL 0
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_RENDER_METAL 1
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_VULKAN 1
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_METAL 1
#endif
#define SDL_POWER_UIKIT 1
#define SDL_IPHONE_KEYBOARD 1
#define SDL_IPHONE_LAUNCHSCREEN 1
#define SDL_FILESYSTEM_COCOA 1
#endif
|
cd51ed9a7657c9e5dbef8b9aa7a0f000ac8eeb98
|
035660e8cc10571ebbd0d4393fef063bb7eb98f6
|
/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
|
17eb5c9ef9181745b898527094151cd8449d8a0a
|
[] |
no_license
|
zeldaret/mm
|
f163a5e7c4314105777369fa7671ce9c2a99922a
|
4ae00e909e74044f05155683b49d2561f91de7ba
|
refs/heads/master
| 2023-08-06T07:22:04.912966
| 2023-08-04T20:36:03
| 2023-08-04T20:36:03
| 247,875,852
| 915
| 328
| null | 2023-09-14T11:48:59
| 2020-03-17T04:03:07
|
C
|
UTF-8
|
C
| false
| false
| 20,573
|
c
|
z_en_baguo.c
|
/*
* File: z_en_baguo.c
* Overlay: ovl_En_Baguo
* Description: Nejiron
*/
#include "z_en_baguo.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnBaguo*)thisx)
void EnBaguo_Init(Actor* thisx, PlayState* play);
void EnBaguo_Destroy(Actor* thisx, PlayState* play);
void EnBaguo_Update(Actor* thisx, PlayState* play);
void EnBaguo_UndergroundIdle(EnBaguo* this, PlayState* play);
void EnBaguo_EmergeFromUnderground(EnBaguo* this, PlayState* play);
void EnBaguo_Idle(EnBaguo* this, PlayState* play);
void EnBaguo_Roll(EnBaguo* this, PlayState* play);
void EnBaguo_SetupRetreatUnderground(EnBaguo* this);
void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play);
void EnBaguo_DrawBody(Actor* thisx, PlayState* play);
void EnBaguo_InitializeEffect(EnBaguo* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scale, s16 timer);
void EnBaguo_UpdateEffects(EnBaguo* this, PlayState* play);
void EnBaguo_DrawEffects(EnBaguo* this, PlayState* play);
typedef enum {
/* 0 */ NEJIRON_ACTION_INACTIVE, // The Nejiron is either underground or emerging from underground
/* 1 */ NEJIRON_ACTION_ACTIVE, // The Nejiron is above ground and actively chasing the player
/* 2 */ NEJIRON_ACTION_RETREATING, // The Nejiron is burrowing back underground
/* 3 */ NEJIRON_ACTION_EXPLODING // The Nejiron has detonated
} NejironAction;
/**
* These directions are relative to the Nejiron.
*/
typedef enum {
/* 0 */ NEJIRON_DIRECTION_RIGHT,
/* 1 */ NEJIRON_DIRECTION_LEFT
} NejironRollDirection;
ActorInit En_Baguo_InitVars = {
ACTOR_EN_BAGUO,
ACTORCAT_ENEMY,
FLAGS,
OBJECT_GMO,
sizeof(EnBaguo),
(ActorFunc)EnBaguo_Init,
(ActorFunc)EnBaguo_Destroy,
(ActorFunc)EnBaguo_Update,
(ActorFunc)NULL,
};
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEMTYPE_UNK0,
{ 0xF7CFFFFF, 0x04, 0x04 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_ON,
},
{ 1, { { 0, 0, 0 }, 0 }, 1 },
},
};
static ColliderJntSphInit sJntSphInit = {
{
COLTYPE_HARD,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
ARRAY_COUNT(sJntSphElementsInit),
sJntSphElementsInit,
};
typedef enum {
/* 0x0 */ NEJIRON_DMGEFF_NONE, // Does not interact with the Nejiron at all
/* 0xE */ NEJIRON_DMGEFF_KILL = 14, // Kills and detonates the Nejiron
/* 0xF */ NEJIRON_DMGEFF_RECOIL // Deals no damage, but displays the appropriate hit mark and recoil animation
} NejironDamageEffect;
static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Deku Stick */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Horse trample */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Explosives */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Zora boomerang */ DMG_ENTRY(3, NEJIRON_DMGEFF_KILL),
/* Normal arrow */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* UNK_DMG_0x06 */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Hookshot */ DMG_ENTRY(3, NEJIRON_DMGEFF_KILL),
/* Goron punch */ DMG_ENTRY(2, NEJIRON_DMGEFF_KILL),
/* Sword */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Goron pound */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Fire arrow */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Ice arrow */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Light arrow */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Goron spikes */ DMG_ENTRY(2, NEJIRON_DMGEFF_KILL),
/* Deku spin */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Deku bubble */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Deku launch */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* UNK_DMG_0x12 */ DMG_ENTRY(0, NEJIRON_DMGEFF_RECOIL),
/* Zora barrier */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Normal shield */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Light ray */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Thrown object */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Zora punch */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Spin attack */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
/* Sword beam */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Normal Roll */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* UNK_DMG_0x1B */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Unblockable */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* UNK_DMG_0x1E */ DMG_ENTRY(0, NEJIRON_DMGEFF_NONE),
/* Powder Keg */ DMG_ENTRY(1, NEJIRON_DMGEFF_KILL),
};
void EnBaguo_Init(Actor* thisx, PlayState* play) {
EnBaguo* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
SkelAnime_Init(play, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable, NEJIRON_LIMB_MAX);
this->actor.hintId = TATL_HINT_ID_NEJIRON;
this->maxDistanceFromHome = 240.0f;
this->maxDistanceFromHome += this->actor.world.rot.z * 40.0f;
this->actor.world.rot.z = 0;
Actor_SetScale(&this->actor, 0.01f);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.targetMode = 2;
Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.modelSphere.radius = 30;
this->collider.elements[0].dim.scale = 1.0f;
this->collider.elements[0].dim.modelSphere.center.x = 80;
this->collider.elements[0].dim.modelSphere.center.y = 80;
this->collider.elements[0].dim.modelSphere.center.z = 0;
this->actor.shape.yOffset = -3000.0f;
this->actor.gravity = -3.0f;
this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~ACTOR_FLAG_1;
this->collider.base.acFlags |= AC_HARD;
this->actionFunc = EnBaguo_UndergroundIdle;
}
void EnBaguo_Destroy(Actor* thisx, PlayState* play) {
EnBaguo* this = THIS;
Collider_DestroyJntSph(play, &this->collider);
}
void EnBaguo_UndergroundIdle(EnBaguo* this, PlayState* play) {
this->action = NEJIRON_ACTION_INACTIVE;
if ((this->actor.xzDistToPlayer < 200.0f) && (Player_GetMask(play) != PLAYER_MASK_STONE)) {
this->actor.draw = EnBaguo_DrawBody;
Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_APPEAR);
this->actor.world.rot.z = 0;
this->actor.world.rot.x = this->actor.world.rot.z;
this->actor.flags &= ~ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = EnBaguo_EmergeFromUnderground;
}
this->actor.shape.rot.y = this->actor.world.rot.y;
}
void EnBaguo_EmergeFromUnderground(EnBaguo* this, PlayState* play) {
this->actor.world.rot.y += 0x1518;
this->actor.shape.rot.y = this->actor.world.rot.y;
if ((play->gameplayFrames % 8) == 0) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10,
8.0f, 500, 10, 1);
}
Math_ApproachF(&this->actor.shape.shadowScale, 50.0f, 0.3f, 5.0f);
Math_ApproachF(&this->actor.shape.yOffset, 2700.0f, 100.0f, 500.0f);
if (this->actor.shape.yOffset > 2650.0f) {
this->action = NEJIRON_ACTION_ACTIVE;
this->actor.shape.yOffset = 2700.0f;
this->timer = 60;
this->actionFunc = EnBaguo_Idle;
}
}
void EnBaguo_Idle(EnBaguo* this, PlayState* play) {
s16 absoluteYaw;
s16 yaw;
if (this->timer != 0) {
// Depending on how the last roll ended, this actor may be "sitting" on
// something other than its legs. This slowly corrects that.
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 10, 100, 1000);
Math_SmoothStepToS(&this->actor.world.rot.z, 0, 10, 100, 1000);
// If this actor isn't mostly facing the player, do a discrete turn towards
// them. It takes 8 frames to turn, and we must wait 8 frames to do another.
if ((this->timer & 8) != 0) {
if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) > 200.0f) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 300, 1000);
if ((play->gameplayFrames % 8) == 0) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos,
this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1);
Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_VOICE);
}
}
}
this->actor.shape.rot.y = this->actor.world.rot.y;
} else {
yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
absoluteYaw = ABS_ALT(yaw);
Math_Vec3f_Copy(&this->targetRotation, &gZeroVec3f);
Math_Vec3f_Copy(&this->currentRotation, &gZeroVec3f);
if (absoluteYaw < 0x2000) {
this->targetRotation.x = 2000.0f;
} else {
this->zRollDirection = NEJIRON_DIRECTION_RIGHT;
this->targetRotation.z = 2000.0f;
if ((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0) {
this->zRollDirection = NEJIRON_DIRECTION_LEFT;
}
}
this->timer = 38;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->bouncedFlag = 0;
this->actionFunc = EnBaguo_Roll;
}
}
void EnBaguo_Roll(EnBaguo* this, PlayState* play) {
f32 xDistanceFromHome = this->actor.home.pos.x - this->actor.world.pos.x;
f32 zDistanceFromHome = this->actor.home.pos.z - this->actor.world.pos.z;
if ((sqrtf(SQ(xDistanceFromHome) + SQ(zDistanceFromHome)) > this->maxDistanceFromHome) ||
(Player_GetMask(play) == PLAYER_MASK_STONE)) {
EnBaguo_SetupRetreatUnderground(this);
} else if (this->timer == 0) {
this->timer = 100;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnBaguo_Idle;
this->actor.speed = 0.0f;
} else {
if (!this->bouncedFlag && (this->collider.base.atFlags & AT_BOUNCED)) {
this->zRollDirection ^= 1;
this->bouncedFlag = 1;
this->actor.speed = -7.0f;
}
Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f);
Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f);
Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 0.5f);
this->actor.world.rot.x += (s16)this->currentRotation.x;
if (this->currentRotation.z != 0.0f) {
if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) {
this->actor.world.rot.z += (s16)this->currentRotation.z;
} else {
this->actor.world.rot.z -= (s16)this->currentRotation.z;
}
}
Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG);
}
}
void EnBaguo_SetupRetreatUnderground(EnBaguo* this) {
this->action = NEJIRON_ACTION_RETREATING;
this->actionFunc = EnBaguo_RetreatUnderground;
this->actor.speed = 0.0f;
}
void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) {
this->actor.world.rot.y -= 0x1518;
this->actor.shape.rot.y = this->actor.world.rot.y;
if ((play->gameplayFrames % 8) == 0) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10,
8.0f, 500, 10, 1);
}
Math_ApproachF(&this->actor.shape.yOffset, -3000.0f, 100.0f, 500.0f);
Math_ApproachZeroF(&this->actor.shape.shadowScale, 0.3f, 5.0f);
if (this->actor.shape.yOffset < -2970.0f) {
this->actor.shape.yOffset = -3000.0f;
this->actor.draw = EnBaguo_DrawBody;
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_APPEAR);
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = EnBaguo_UndergroundIdle;
}
}
void EnBaguo_PostDetonation(EnBaguo* this, PlayState* play) {
if (this->timer == 0) {
Actor_Kill(&this->actor);
}
if (this->timer >= 26) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
}
void EnBaguo_CheckForDetonation(EnBaguo* this, PlayState* play) {
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
Vec3f accel = { 0.0f, 0.0f, 0.0f };
s32 i;
// In order to match, this variable must act as both a boolean to check if
// the Nejiron should forcibly explode and as a loop index.
i = false;
if (this->action != NEJIRON_ACTION_EXPLODING && this->action != NEJIRON_ACTION_RETREATING) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f))) {
// Force a detonation if we're off the ground and have fallen
// below our home position (e.g., we rolled off a ledge).
i = true;
}
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
(this->actor.depthInWater >= 40.0f)) {
// Force a detonation if we're too far below the water's surface.
i = true;
}
if ((this->collider.base.acFlags & AC_HIT) || i) {
this->collider.base.acFlags &= ~AC_HIT;
if (i || (this->actor.colChkInfo.damageEffect == NEJIRON_DMGEFF_KILL)) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8);
this->action = NEJIRON_ACTION_EXPLODING;
this->actor.speed = 0.0f;
this->actor.shape.shadowScale = 0.0f;
for (i = 0; i < ARRAY_COUNT(this->effects); i++) {
accel.x = (Rand_ZeroOne() - 0.5f) * 8.0f;
accel.y = -1.0f;
accel.z = (Rand_ZeroOne() - 0.5f) * 8.0f;
velocity.x = (Rand_ZeroOne() - 0.5f) * 14.0f;
velocity.y = Rand_ZeroOne() * 30.0f;
velocity.z = (Rand_ZeroOne() - 0.5f) * 14.0f;
EnBaguo_InitializeEffect(this, &this->actor.focus.pos, &velocity, &accel,
(Rand_ZeroFloat(1.0f) * 0.01f) + 0.003f, 90);
}
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_PARAMS(CLEAR_TAG_POP));
Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_DEAD);
this->timer = 30;
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.0f);
this->collider.elements->dim.scale = 3.0f;
this->collider.elements->info.toucher.damage = 8;
Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0xB0);
this->actionFunc = EnBaguo_PostDetonation;
}
}
}
}
void EnBaguo_Update(Actor* thisx, PlayState* play) {
EnBaguo* this = THIS;
Actor_SetFocus(&this->actor, 30.0f);
EnBaguo_UpdateEffects(this, play);
EnBaguo_CheckForDetonation(this, play);
this->actionFunc(this, play);
DECR(this->blinkTimer);
DECR(this->timer);
if ((this->action != NEJIRON_ACTION_EXPLODING) && (this->action != NEJIRON_ACTION_INACTIVE)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (this->action != NEJIRON_ACTION_EXPLODING) {
this->actor.shape.rot.x = this->actor.world.rot.x;
this->actor.shape.rot.z = this->actor.world.rot.z;
if (this->blinkTimer == 0) {
this->eyeIndex++;
if (this->eyeIndex >= 3) {
this->eyeIndex = 0;
this->blinkTimer = Rand_ZeroFloat(60.0f) + 20.0f;
}
}
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f,
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8 |
UPDBGCHECKINFO_FLAG_10);
if (this->action != NEJIRON_ACTION_INACTIVE) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
if (this->action != NEJIRON_ACTION_EXPLODING) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
}
}
void EnBaguo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnBaguo* this = THIS;
Collider_UpdateSpheres(limbIndex, &this->collider);
}
void EnBaguo_DrawBody(Actor* thisx, PlayState* play) {
static TexturePtr sEyeTextures[] = { &gNejironEyeOpenTex, &gNejironEyeHalfTex, &gNejironEyeClosedTex };
EnBaguo* this = THIS;
Gfx* gfx;
s32 eyeIndex;
void* virtualAddress;
OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
gfx = POLY_OPA_DISP;
eyeIndex = this->eyeIndex;
virtualAddress = Lib_SegmentedToVirtual(sEyeTextures[eyeIndex]);
gSPSegment(&gfx[0], 0x08, virtualAddress);
POLY_OPA_DISP = &gfx[1];
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnBaguo_PostLimbDraw,
&this->actor);
CLOSE_DISPS(play->state.gfxCtx);
EnBaguo_DrawEffects(this, play);
}
void EnBaguo_InitializeEffect(EnBaguo* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scale, s16 timer) {
s16 i;
NejironEffect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (!effect->isEnabled) {
effect->isEnabled = true;
effect->pos = *pos;
effect->velocity = *velocity;
effect->accel = *accel;
effect->scale = scale;
effect->timer = timer;
effect->rot.x = (s16)(s32)Rand_CenteredFloat(0x7530);
effect->rot.y = (s16)(s32)Rand_CenteredFloat(0x7530);
effect->rot.z = (s16)(s32)Rand_CenteredFloat(0x7530);
return;
}
}
}
void EnBaguo_UpdateEffects(EnBaguo* this, PlayState* play) {
s32 i;
NejironEffect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
effect->pos.x += effect->velocity.x;
effect->pos.y += effect->velocity.y;
effect->pos.z += effect->velocity.z;
effect->rot.x += 0xBB8;
effect->rot.y += 0xBB8;
effect->rot.z += 0xBB8;
effect->velocity.x += effect->accel.x;
effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z;
if (effect->pos.y < (this->actor.world.pos.y - 10.0f)) {
Math_ApproachZeroF(&effect->scale, 0.2f, 0.001f);
if (effect->scale <= 0.0001f) {
effect->timer = 0;
}
}
if (effect->timer != 0) {
effect->timer--;
} else {
effect->isEnabled = false;
}
}
}
}
void EnBaguo_DrawEffects(EnBaguo* this, PlayState* play) {
s16 i;
NejironEffect* effect = this->effects;
GraphicsContext* gfxCtx = play->state.gfxCtx;
OPEN_DISPS(gfxCtx);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_RotateXS(effect->rot.x, MTXMODE_APPLY);
Matrix_RotateYS(effect->rot.y, MTXMODE_APPLY);
Matrix_RotateZS(effect->rot.z, MTXMODE_APPLY);
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 255, 255, 255, 255);
gSPDisplayList(POLY_OPA_DISP++, gBoulderFragmentsDL);
}
}
CLOSE_DISPS(gfxCtx);
}
|
8898feda3c000626624973352ed679651acc1e1e
|
930e0924f9b423ad53dcafdcc45e791ce668eeee
|
/c_src/posix_mutex.c
|
533a3f18e8f7b8687cf7502cc69d8243257d5a57
|
[
"MIT"
] |
permissive
|
hamiltron/py-simple-audio
|
b55727c336da765d2ef925892cfdb5e262560641
|
e0c595c1c463cf52ecc7ea4ecde1b92dbe985e95
|
refs/heads/master
| 2023-01-14T13:41:37.234761
| 2021-11-28T01:53:54
| 2021-11-28T01:53:54
| 40,561,035
| 145
| 40
|
NOASSERTION
| 2022-12-28T01:34:26
| 2015-08-11T19:30:33
|
C
|
UTF-8
|
C
| false
| false
| 598
|
c
|
posix_mutex.c
|
/*
Simpleaudio Python Extension
Copyright (C) 2015, Joe Hamilton
MIT License (see LICENSE.txt)
*/
#include "simpleaudio.h"
#include <stdlib.h>
#include <pthread.h>
void* create_mutex() {
void* mutex;
mutex = PyMem_Malloc(sizeof(pthread_mutex_t));
pthread_mutex_init((pthread_mutex_t*)mutex, NULL);
return mutex;
}
void destroy_mutex(void* mutex) {
pthread_mutex_destroy((pthread_mutex_t*)mutex);
PyMem_Free(mutex);
}
void grab_mutex(void* mutex) {
pthread_mutex_lock((pthread_mutex_t*)mutex);
}
void release_mutex(void* mutex) {
pthread_mutex_unlock((pthread_mutex_t*)mutex);
}
|
d03c775049dc13fc8f1b675300a5f11680960239
|
84abfe6c290c599280c0190c7fb9cd9f3a7d8ac7
|
/util/terminalColor.h
|
10071de1df5f5163fe7b657730d7662b0f4086a8
|
[
"MIT"
] |
permissive
|
ThePhysicsGuys/Physics3D
|
fa86abafd541a71d1b1fe99c1157d3d7aaba7b31
|
37aed8811c07560e20670f9114f606a978440822
|
refs/heads/master
| 2023-06-22T14:09:09.888412
| 2022-12-22T00:46:00
| 2022-12-22T00:46:00
| 158,881,886
| 297
| 27
|
MIT
| 2023-06-10T21:20:56
| 2018-11-23T22:07:37
|
C++
|
UTF-8
|
C
| false
| false
| 497
|
h
|
terminalColor.h
|
#pragma once
enum class TerminalColor {
BLACK = 0,
DARK_BLUE = 1,
DARK_GREEN = 2,
AQUA = 3,
DARK_RED = 4,
PURPLE = 5,
DARK_YELLOW = 6,
LIGHT_GRAY = 7,
GRAY = 8,
BLUE = 9,
GREEN = 10,
CYAN = 11,
RED = 12,
MAGENTA = 13,
YELLOW = 14,
WHITE = 15,
};
struct TerminalColorPair {
TerminalColor foreground;
TerminalColor background;
};
void setColor(TerminalColor foreground);
void setColor(TerminalColor foreground, TerminalColor background);
void setColor(TerminalColorPair color);
|
ac350bec1e0ed0fa129b6412768474bfff942d5d
|
82faab1769348cfe2c4ab2d9e9ddcbacbd5d2702
|
/deps/dev/math.h
|
2cd486cc97b477c84db17c6b563c5b75ecb9da39
|
[
"MIT"
] |
permissive
|
hshindo/Merlin.jl
|
356e98a575e373229d2aeda119d6381602837782
|
5c13eafab1df4dc4a73e7bdc85d45d3e4990fd80
|
refs/heads/master
| 2020-04-03T22:07:16.844116
| 2018-11-02T04:31:00
| 2018-11-02T04:31:00
| 46,850,220
| 167
| 17
|
MIT
| 2018-11-02T04:31:01
| 2015-11-25T09:12:06
|
Julia
|
UTF-8
|
C
| false
| false
| 2,441
|
h
|
math.h
|
#include <math.h>
#include <stdint.h>
// Assumed IEEE754.
inline float exp_approx(float x) {
float exp_cst1 = float(((1<<8) - 1) * (1<<23));
float exp_cst2 = 0.f;
union { int i; float f; } xu, xu2;
float val = (1<<23) / log(2.f) * x + ((1<<7) - 1) * (1<<23);
val = val < exp_cst1 ? val : exp_cst1;
val = val > exp_cst2 ? val : exp_cst2;
int vali = (int)val;
xu.i = vali & 0x7F800000; // exponent part
xu2.i = (vali & 0x7FFFFF) | 0x3F800000; // 111... | coefficient
float b = xu2.f;
return
xu.f * (0.510397365625862338668154f + b *
(0.310670891004095530771135f + b *
(0.168143436463395944830000f + b *
(-2.88093587581985443087955e-3f + b *
1.3671023382430374383648148e-2f))));
}
inline double exp_approx(double x) {
double exp_cst1 = double(((1LL<<11) - 1LL) * (1LL<<52));
double exp_cst2 = 0.;
union { long long i; double f; } xu, xu2;
double val = (1LL<<52) / log(2.) * x + ((1LL<<10) - 1LL) * (1LL<<52);
val = val < exp_cst1 ? val : exp_cst1;
val = val > exp_cst2 ? val : exp_cst2;
long long vali = (long long)val;
xu.i = vali & 0x7FF0000000000000;
xu2.i = (vali & 0xFFFFFFFFFFFFF) | 0x3FF0000000000000;
double b = xu2.f;
return
xu.f * (0.510397365625862338668154 + b *
(0.310670891004095530771135 + b *
(0.168143436463395944830000 + b *
(-2.88093587581985443087955e-3 + b *
1.3671023382430374383648148e-2))));
}
inline float log_approx(float x) {
if (x <= 0.0f) return -(float)INFINITY;
union { float f; int i; } valu;
valu.f = x;
float e = valu.i >> 23;
valu.i = (valu.i & 0x7FFFFF) | 0x3F800000;
float f = valu.f;
// 89.970756366f = 127 * log(2) - constant term of polynomial (-1.94106443489)
return
f * (3.529304993f + f * (-2.461222105f +
f * (1.130626167f + f * (-0.288739945f +
f * 3.110401639e-2f))))
+ (-89.970756366f + 0.69314718055995f*e);
}
inline double log_approx(double x) {
if (x <= 0.0) return -(double)INFINITY;
union { double f; long long i; } valu;
valu.f = x;
double e = valu.i >> 52;
valu.i = (valu.i & 0xFFFFFFFFFFFFF) | 0x3FF0000000000000;
double f = valu.f;
// 711.030630148 = 1023 * log(2) - constant term of polynomial
return
f * (3.529304993 + f * (-2.461222105 +
f * (1.130626167 + f * (-0.288739945 +
f * 3.110401639e-2))))
+ (-711.030630148 + 0.69314718055995*e);
}
|
08acff6617af3be2a59cad032f6131e916ad0cbe
|
f9cc38a7c78446b73747580aacae124bb2826a58
|
/cmd/demo/usbip/usbip-win/userspace/src/usbip/usbip_vhci.h
|
e420efbf3b851b6301cbbf59b391362b3f0499a9
|
[
"GPL-2.0-only",
"MIT",
"GPL-3.0-only"
] |
permissive
|
bulwarkid/virtual-fido
|
dae4677d2051961c96d8f284cac7db9a8c5a45d3
|
c0256885902878809ea97dbe488d6937d75b5bc5
|
refs/heads/master
| 2023-08-09T22:09:58.891332
| 2023-07-24T22:08:36
| 2023-07-24T23:10:00
| 537,229,823
| 988
| 46
|
MIT
| 2023-07-17T21:08:29
| 2022-09-15T22:47:15
|
C
|
UTF-8
|
C
| false
| false
| 409
|
h
|
usbip_vhci.h
|
#ifndef __VHCI_DRIVER_H
#define __VHCI_DRIVER_H
#pragma
#include "usbip_vhci_api.h"
HANDLE usbip_vhci_driver_open(void);
void usbip_vhci_driver_close(HANDLE hdev);
int usbip_vhci_get_imported_devs(HANDLE hdev, pioctl_usbip_vhci_imported_dev_t *pidevs);
int usbip_vhci_attach_device(HANDLE hdev, pvhci_pluginfo_t pluginfo);
int usbip_vhci_detach_device(HANDLE hdev, int port);
#endif /* __VHCI_DRIVER_H */
|
3eca7b06540635f53798b79e106a81935a5c3d25
|
167c6226bc77c5daaedab007dfdad4377f588ef4
|
/cpp/ql/test/library-tests/variables/global/c.c
|
0db4e3bc3e05822cf5fac11b1647d4c2cc3d2f10
|
[
"LicenseRef-scancode-public-domain",
"MIT"
] |
permissive
|
github/codeql
|
1eebb449a34f774db9e881b52cb8f7a1b1a53612
|
d109637e2d7ab3b819812eb960c05cb31d9d2168
|
refs/heads/main
| 2023-08-20T11:32:39.162059
| 2023-08-18T14:33:32
| 2023-08-18T14:33:32
| 143,040,428
| 5,987
| 1,363
|
MIT
| 2023-09-14T19:36:50
| 2018-07-31T16:35:51
|
CodeQL
|
UTF-8
|
C
| false
| false
| 185
|
c
|
c.c
|
int js[] = { 1, 2, 3, 4 };
int ks[4] = { 1, 2, 3, 4 };
int ls[4] = { 1, 2, 3, 4 };
int iss[4][2] = { { 1, 2 }, { 3, 4 }, { 1, 2 }, { 3, 4 } };
typedef int int_alias;
int_alias i;
|
ed0c05aba574c496da59d9bb98c8494e50c561d0
|
1f399edf85d995443d01f66d77eca0723886d0ff
|
/devicemodel/hw/pci/virtio/virtio_net.c
|
89f04b2102e80acd892ddc6bd523c1bea2aa022e
|
[
"BSD-3-Clause"
] |
permissive
|
projectacrn/acrn-hypervisor
|
f9c5864d54929a5d2fa36b5e78c08f19b46b8f98
|
390740aa1b1e9d62c51f8e3afa0c29e07e43fa23
|
refs/heads/master
| 2023-08-18T05:07:01.310327
| 2023-08-11T07:49:36
| 2023-08-16T13:20:27
| 123,983,554
| 1,059
| 686
|
BSD-3-Clause
| 2023-09-14T09:51:10
| 2018-03-05T21:52:25
|
C
|
UTF-8
|
C
| false
| false
| 30,463
|
c
|
virtio_net.c
|
/*-
* Copyright (c) 2011 NetApp, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/uio.h>
#include <net/ethernet.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <openssl/md5.h>
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#include <openssl/evp.h>
#endif
#include <pthread.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <net/if.h>
#include <linux/if_tun.h>
#include <sys/socket.h>
#include <linux/vhost.h>
#include "dm.h"
#include "pci_core.h"
#include "mevent.h"
#include "virtio.h"
#include "vhost.h"
#include "dm_string.h"
#define VIRTIO_NET_RINGSZ 1024
#define VIRTIO_NET_MAXSEGS 256
/*
* Host capabilities. Note that we only offer a few of these.
*/
#define VIRTIO_NET_F_CSUM (1 << 0) /* host handles partial cksum */
#define VIRTIO_NET_F_GUEST_CSUM (1 << 1) /* guest handles partial cksum */
#define VIRTIO_NET_F_MAC (1 << 5) /* host supplies MAC */
#define VIRTIO_NET_F_GSO_DEPREC (1 << 6) /* deprecated: host handles GSO */
#define VIRTIO_NET_F_GUEST_TSO4 (1 << 7) /* guest can rcv TSOv4 */
#define VIRTIO_NET_F_GUEST_TSO6 (1 << 8) /* guest can rcv TSOv6 */
#define VIRTIO_NET_F_GUEST_ECN (1 << 9) /* guest can rcv TSO with ECN */
#define VIRTIO_NET_F_GUEST_UFO (1 << 10) /* guest can rcv UFO */
#define VIRTIO_NET_F_HOST_TSO4 (1 << 11) /* host can rcv TSOv4 */
#define VIRTIO_NET_F_HOST_TSO6 (1 << 12) /* host can rcv TSOv6 */
#define VIRTIO_NET_F_HOST_ECN (1 << 13) /* host can rcv TSO with ECN */
#define VIRTIO_NET_F_HOST_UFO (1 << 14) /* host can rcv UFO */
#define VIRTIO_NET_F_MRG_RXBUF (1 << 15) /* host can merge RX buffers */
#define VIRTIO_NET_F_STATUS (1 << 16) /* config status field available */
#define VIRTIO_NET_F_CTRL_VQ (1 << 17) /* control channel available */
#define VIRTIO_NET_F_CTRL_RX (1 << 18) /* control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN (1 << 19) /* control channel VLAN filtering */
#define VIRTIO_NET_F_GUEST_ANNOUNCE \
(1 << 21) /* guest can send gratuitous pkts */
#define VIRTIO_NET_S_HOSTCAPS \
(VIRTIO_NET_F_MAC | VIRTIO_NET_F_MRG_RXBUF | VIRTIO_NET_F_STATUS | \
(1 << VIRTIO_F_NOTIFY_ON_EMPTY) | (1 << VIRTIO_RING_F_INDIRECT_DESC))
#define VIRTIO_NET_S_VHOSTCAPS \
((1 << VIRTIO_F_NOTIFY_ON_EMPTY) | (1 << VIRTIO_RING_F_INDIRECT_DESC) | \
(1 << VIRTIO_RING_F_EVENT_IDX) | VIRTIO_NET_F_MRG_RXBUF | \
(1UL << VIRTIO_F_VERSION_1))
/* is address mcast/bcast? */
#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01)
/*
* PCI config-space "registers"
*/
struct virtio_net_config {
uint8_t mac[6];
uint16_t status;
} __attribute__((packed));
/*
* Queue definitions.
*/
#define VIRTIO_NET_RXQ 0
#define VIRTIO_NET_TXQ 1
#define VIRTIO_NET_CTLQ 2 /* NB: not yet supported */
#define VIRTIO_NET_MAXQ 3
/*
* Fixed network header size
*/
struct virtio_net_rxhdr {
uint8_t vrh_flags;
uint8_t vrh_gso_type;
uint16_t vrh_hdr_len;
uint16_t vrh_gso_size;
uint16_t vrh_csum_start;
uint16_t vrh_csum_offset;
uint16_t vrh_bufs;
} __attribute__((packed));
/*
* Debug printf
*/
static int virtio_net_debug;
#define DPRINTF(params) do { if (virtio_net_debug) pr_dbg params; } while (0)
#define WPRINTF(params) (pr_err params)
/*
* vhost device struct
*/
struct vhost_net {
struct vhost_dev vdev;
struct vhost_vq vqs[VIRTIO_NET_MAXQ - 1];
int tapfd;
bool vhost_started;
};
/*
* Per-device struct
*/
struct virtio_net {
struct virtio_base base;
struct virtio_vq_info queues[VIRTIO_NET_MAXQ - 1];
pthread_mutex_t mtx;
struct mevent *mevp;
int tapfd;
int rx_ready;
volatile int resetting; /* set and checked outside lock */
volatile int closing; /* stop the tx i/o thread */
uint64_t features; /* negotiated features */
struct virtio_net_config config;
pthread_mutex_t rx_mtx;
int rx_in_progress;
int rx_vhdrlen;
int rx_merge; /* merged rx bufs in use */
pthread_t tx_tid;
pthread_mutex_t tx_mtx;
pthread_cond_t tx_cond;
int tx_in_progress;
void (*virtio_net_rx)(struct virtio_net *net);
void (*virtio_net_tx)(struct virtio_net *net, struct iovec *iov,
int iovcnt, int len);
struct vhost_net *vhost_net;
bool use_vhost;
};
static void virtio_net_reset(void *vdev);
static void virtio_net_tx_stop(struct virtio_net *net);
static int virtio_net_cfgread(void *vdev, int offset, int size,
uint32_t *retval);
static int virtio_net_cfgwrite(void *vdev, int offset, int size,
uint32_t value);
static void virtio_net_neg_features(void *vdev, uint64_t negotiated_features);
static void virtio_net_set_status(void *vdev, uint64_t status);
static void virtio_net_teardown(void *param);
static struct vhost_net *vhost_net_init(struct virtio_base *base, int vhostfd,
int tapfd, int vq_idx);
static int vhost_net_deinit(struct vhost_net *vhost_net);
static int vhost_net_start(struct vhost_net *vhost_net);
static int vhost_net_stop(struct vhost_net *vhost_net);
static struct virtio_ops virtio_net_ops = {
"vtnet", /* our name */
VIRTIO_NET_MAXQ - 1, /* we currently support 2 virtqueues */
sizeof(struct virtio_net_config), /* config reg size */
virtio_net_reset, /* reset */
NULL, /* device-wide qnotify -- not used */
virtio_net_cfgread, /* read PCI config */
virtio_net_cfgwrite, /* write PCI config */
virtio_net_neg_features, /* apply negotiated features */
virtio_net_set_status, /* called on guest set status */
};
static int
vhost_kernel_net_set_backend(struct vhost_dev *vdev,
struct vhost_vring_file *file)
{
return vhost_kernel_ioctl(vdev, VHOST_NET_SET_BACKEND, file);
}
int
vhost_net_set_backend(struct vhost_dev *vdev, int backend_fd)
{
struct vhost_vring_file file;
int rc, i;
file.fd = backend_fd;
for (i = 0; i < vdev->nvqs; i++) {
file.index = i;
rc = vhost_kernel_net_set_backend(vdev, &file);
if (rc < 0)
goto fail;
}
return 0;
fail:
file.fd = -1;
while (--i >= 0) {
file.index = i;
vhost_kernel_net_set_backend(vdev, &file);
}
return -1;
}
static struct ether_addr *
ether_aton(const char *a, struct ether_addr *e)
{
unsigned int o0, o1, o2, o3, o4, o5;
char *cp;
if(!dm_strtoui(a, &cp, 16, &o0) &&
*cp == ':' &&
!dm_strtoui(cp + 1, &cp, 16, &o1) &&
*cp == ':' &&
!dm_strtoui(cp + 1, &cp, 16, &o2) &&
*cp == ':' &&
!dm_strtoui(cp + 1, &cp, 16, &o3) &&
*cp == ':' &&
!dm_strtoui(cp + 1, &cp, 16, &o4) &&
*cp == ':' &&
!dm_strtoui(cp + 1, &cp, 16, &o5)) {
e->ether_addr_octet[0] = o0;
e->ether_addr_octet[1] = o1;
e->ether_addr_octet[2] = o2;
e->ether_addr_octet[3] = o3;
e->ether_addr_octet[4] = o4;
e->ether_addr_octet[5] = o5;
}
else {
return NULL;
}
return e;
}
/*
* If the transmit thread is active then stall until it is done.
*/
static void
virtio_net_txwait(struct virtio_net *net)
{
pthread_mutex_lock(&net->tx_mtx);
while (net->tx_in_progress) {
pthread_mutex_unlock(&net->tx_mtx);
usleep(10000);
pthread_mutex_lock(&net->tx_mtx);
}
pthread_mutex_unlock(&net->tx_mtx);
}
/*
* If the receive thread is active then stall until it is done.
*/
static void
virtio_net_rxwait(struct virtio_net *net)
{
pthread_mutex_lock(&net->rx_mtx);
while (net->rx_in_progress) {
pthread_mutex_unlock(&net->rx_mtx);
usleep(10000);
pthread_mutex_lock(&net->rx_mtx);
}
pthread_mutex_unlock(&net->rx_mtx);
}
static void
virtio_net_reset(void *vdev)
{
struct virtio_net *net = vdev;
DPRINTF(("vtnet: device reset requested !\n"));
net->resetting = 1;
/*
* Wait for the transmit and receive threads to finish their
* processing.
*/
virtio_net_txwait(net);
virtio_net_rxwait(net);
net->rx_ready = 0;
net->rx_merge = 1;
net->rx_vhdrlen = sizeof(struct virtio_net_rxhdr);
/* now reset rings, MSI-X vectors, and negotiated capabilities */
virtio_reset_dev(&net->base);
net->resetting = 0;
net->closing = 0;
}
/*
* Send signal to tx I/O thread and wait till it exits
*/
static void
virtio_net_tx_stop(struct virtio_net *net)
{
void *jval;
pthread_mutex_lock(&net->tx_mtx);
net->closing = 1;
pthread_cond_broadcast(&net->tx_cond);
pthread_mutex_unlock(&net->tx_mtx);
pthread_join(net->tx_tid, &jval);
}
/*
* Called to send a buffer chain out to the tap device
*/
static void
virtio_net_tap_tx(struct virtio_net *net, struct iovec *iov, int iovcnt,
int len)
{
static char pad[60]; /* all zero bytes */
ssize_t ret;
if (net->tapfd == -1)
return;
/*
* If the length is < 60, pad out to that and add the
* extra zero'd segment to the iov. It is guaranteed that
* there is always an extra iov available by the caller.
*/
if (len < 60) {
iov[iovcnt].iov_base = pad;
iov[iovcnt].iov_len = 60 - len;
iovcnt++;
}
ret = writev(net->tapfd, iov, iovcnt);
(void)ret; /*avoid compiler warning*/
}
/*
* Called when there is read activity on the tap file descriptor.
* Each buffer posted by the guest is assumed to be able to contain
* an entire ethernet frame + rx header.
* MP note: the dummybuf is only used for discarding frames, so there
* is no need for it to be per-vtnet or locked.
*/
static uint8_t dummybuf[2048];
static inline struct iovec *
rx_iov_trim(struct iovec *iov, int *niov, int tlen)
{
struct iovec *riov;
/* XXX short-cut: assume first segment is >= tlen */
if (iov[0].iov_len < tlen) {
WPRINTF(("vtnet: rx_iov_trim: iov_len=%lu, tlen=%d\n", iov[0].iov_len, tlen));
return NULL;
}
iov[0].iov_len -= tlen;
if (iov[0].iov_len == 0) {
if (*niov <= 1) {
WPRINTF(("vtnet: rx_iov_trim: *niov=%d\n", *niov));
return NULL;
}
*niov -= 1;
riov = &iov[1];
} else {
iov[0].iov_base = (void *)((uintptr_t)iov[0].iov_base + tlen);
riov = &iov[0];
}
return riov;
}
static void
virtio_net_tap_rx(struct virtio_net *net)
{
struct iovec iov[VIRTIO_NET_MAXSEGS], *riov;
struct virtio_vq_info *vq;
void *vrx;
int len, n;
uint16_t idx;
ssize_t ret;
/*
* Should never be called without a valid tap fd
*/
if (net->tapfd == -1) {
WPRINTF(("vtnet: tapfd == -1\n"));
return;
}
/*
* But, will be called when the rx ring hasn't yet
* been set up or the guest is resetting the device.
*/
if (!net->rx_ready || net->resetting) {
/*
* Drop the packet and try later.
*/
ret = read(net->tapfd, dummybuf, sizeof(dummybuf));
(void)ret; /*avoid compiler warning*/
return;
}
/*
* Check for available rx buffers
*/
vq = &net->queues[VIRTIO_NET_RXQ];
if (!vq_has_descs(vq)) {
/*
* Drop the packet and try later. Interrupt on
* empty, if that's negotiated.
*/
ret = read(net->tapfd, dummybuf, sizeof(dummybuf));
(void)ret; /*avoid compiler warning*/
vq_endchains(vq, 1);
return;
}
do {
/*
* Get descriptor chain.
*/
n = vq_getchain(vq, &idx, iov, VIRTIO_NET_MAXSEGS, NULL);
if (n < 1 || n > VIRTIO_NET_MAXSEGS) {
WPRINTF(("vtnet: virtio_net_tap_rx: vq_getchain = %d\n", n));
return;
}
/*
* Get a pointer to the rx header, and use the
* data immediately following it for the packet buffer.
*/
vrx = iov[0].iov_base;
riov = rx_iov_trim(iov, &n, net->rx_vhdrlen);
if (riov == NULL)
return;
len = readv(net->tapfd, riov, n);
if (len < 0 && errno == EWOULDBLOCK) {
/*
* No more packets, but still some avail ring
* entries. Interrupt if needed/appropriate.
*/
vq_retchain(vq);
vq_endchains(vq, 0);
return;
}
/*
* The only valid field in the rx packet header is the
* number of buffers if merged rx bufs were negotiated.
*/
memset(vrx, 0, net->rx_vhdrlen);
if (net->rx_merge) {
struct virtio_net_rxhdr *vrxh;
vrxh = vrx;
vrxh->vrh_bufs = 1;
}
/*
* Release this chain and handle more chains.
*/
vq_relchain(vq, idx, len + net->rx_vhdrlen);
} while (vq_has_descs(vq));
/* Interrupt if needed, including for NOTIFY_ON_EMPTY. */
vq_endchains(vq, 1);
}
static void
virtio_net_rx_callback(int fd, enum ev_type type, void *param)
{
struct virtio_net *net = param;
pthread_mutex_lock(&net->rx_mtx);
net->rx_in_progress = 1;
net->virtio_net_rx(net);
net->rx_in_progress = 0;
pthread_mutex_unlock(&net->rx_mtx);
}
static void
virtio_net_ping_rxq(void *vdev, struct virtio_vq_info *vq)
{
struct virtio_net *net = vdev;
/*
* A qnotify means that the rx process can now begin
*/
if (net->rx_ready == 0) {
net->rx_ready = 1;
if (vq->used != NULL) {
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
}
}
}
static void
virtio_net_proctx(struct virtio_net *net, struct virtio_vq_info *vq)
{
struct iovec iov[VIRTIO_NET_MAXSEGS + 1];
int i, n;
int plen, tlen;
uint16_t idx;
/*
* Obtain chain of descriptors. The first one is
* really the header descriptor, so we need to sum
* up two lengths: packet length and transfer length.
*/
n = vq_getchain(vq, &idx, iov, VIRTIO_NET_MAXSEGS, NULL);
if (n < 1 || n > VIRTIO_NET_MAXSEGS) {
WPRINTF(("vtnet: virtio_net_proctx: vq_getchain = %d\n", n));
return;
}
plen = 0;
tlen = iov[0].iov_len;
for (i = 1; i < n; i++) {
plen += iov[i].iov_len;
tlen += iov[i].iov_len;
}
DPRINTF(("virtio: packet send, %d bytes, %d segs\n\r", plen, n));
net->virtio_net_tx(net, &iov[1], n - 1, plen);
/* chain is processed, release it and set tlen */
vq_relchain(vq, idx, tlen);
}
static void
virtio_net_ping_txq(void *vdev, struct virtio_vq_info *vq)
{
struct virtio_net *net = vdev;
/*
* Any ring entries to process?
*/
if (!vq_has_descs(vq))
return;
/* Signal the tx thread for processing */
pthread_mutex_lock(&net->tx_mtx);
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
if (net->tx_in_progress == 0)
pthread_cond_signal(&net->tx_cond);
pthread_mutex_unlock(&net->tx_mtx);
}
/*
* Thread which will handle processing of TX desc
*/
static void *
virtio_net_tx_thread(void *param)
{
struct virtio_net *net = param;
struct virtio_vq_info *vq = &net->queues[VIRTIO_NET_TXQ];
/*
* Let us wait till the tx queue pointers get initialised &
* first tx signaled
*/
pthread_mutex_lock(&net->tx_mtx);
while (!net->closing && !vq_ring_ready(vq))
pthread_cond_wait(&net->tx_cond, &net->tx_mtx);
if (net->closing) {
WPRINTF(("vtnet tx thread closing...\n"));
pthread_mutex_unlock(&net->tx_mtx);
return NULL;
}
for (;;) {
/* note - tx mutex is locked here */
net->tx_in_progress = 0;
/*
* Checking the avail ring here serves two purposes:
* - avoid vring processing due to spurious wakeups
* - catch missing notifications before acquiring tx_mtx
*/
while (net->resetting || !vq_has_descs(vq)) {
vq_clear_used_ring_flags(&net->base, vq);
/* memory barrier */
mb();
if (!net->resetting && vq_has_descs(vq))
break;
pthread_cond_wait(&net->tx_cond, &net->tx_mtx);
if (net->closing) {
WPRINTF(("vtnet tx thread closing...\n"));
pthread_mutex_unlock(&net->tx_mtx);
return NULL;
}
}
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
net->tx_in_progress = 1;
pthread_mutex_unlock(&net->tx_mtx);
do {
/*
* Run through entries, placing them into
* iovecs and sending when an end-of-packet
* is found
*/
virtio_net_proctx(net, vq);
} while (vq_has_descs(vq));
/*
* Generate an interrupt if needed.
*/
vq_endchains(vq, 1);
pthread_mutex_lock(&net->tx_mtx);
}
}
#ifdef notyet
static void
virtio_net_ping_ctlq(void *vdev, struct virtio_vq_info *vq)
{
DPRINTF(("vtnet: control qnotify!\n\r"));
}
#endif
static int
virtio_net_parsemac(char *mac_str, uint8_t *mac_addr)
{
struct ether_addr ether_addr;
struct ether_addr *ea;
char *tmpstr;
char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 };
tmpstr = strsep(&mac_str, "=");
ea = ðer_addr;
if ((mac_str != NULL) && (!strcmp(tmpstr, "mac"))) {
ea = ether_aton(mac_str, ea);
if (ea == NULL || ETHER_IS_MULTICAST(ea->ether_addr_octet) ||
memcmp(ea->ether_addr_octet, zero_addr, ETHER_ADDR_LEN)
== 0) {
pr_err("Invalid MAC %s\n", mac_str);
return -1;
}
memcpy(mac_addr, ea->ether_addr_octet, ETHER_ADDR_LEN);
}
return 0;
}
static int
virtio_net_get_ifindex(char *devname)
{
struct ifreq ifr;
int fd;
int ifindex = -1;
fd = socket(AF_UNIX, SOCK_DGRAM, 0);
if (fd < 0) {
WPRINTF(("%s: Unable to open control socket", __func__));
return ifindex;
}
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, devname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ - 1] = '\0';
if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) {
WPRINTF(("%s: Unable to get interface index on this platform\n", __func__));
} else {
ifindex = ifr.ifr_ifindex;
}
close(fd);
return ifindex;
}
static bool
virtio_net_is_macvtap(char *devname, int *ifindex)
{
char tempbuf[IFNAMSIZ];
int rc;
int ifidx;
ifidx = virtio_net_get_ifindex(devname);
if (ifidx < 0)
return false;
/*check if the char device exists*/
rc = snprintf(tempbuf, IFNAMSIZ, "/dev/tap%d", ifidx);
if (rc < 0 || rc >= IFNAMSIZ) {
WPRINTF(("Failed to check interface name %s\n", tempbuf));
return false;
}
if (access(tempbuf, F_OK) != 0)
return false;
*ifindex = ifidx;
return true;
}
static int
virtio_net_tap_open(char *devname)
{
char tbuf[IFNAMSIZ];
int tunfd, rc, macvtap_index;
struct ifreq ifr;
/*Check if tun/tap or macvtap interface is used */
if (virtio_net_is_macvtap(devname, &macvtap_index)) {
rc = snprintf(tbuf, IFNAMSIZ, "/dev/tap%d", macvtap_index);
} else {
rc = snprintf(tbuf, IFNAMSIZ, "%s", "/dev/net/tun");
}
if (rc < 0 || rc >= IFNAMSIZ) {
WPRINTF(("Failed to set interface name %s\n", tbuf));
return -1;
}
tunfd = open(tbuf, O_RDWR);
if (tunfd < 0) {
WPRINTF(("Failed to open interface %s\n", tbuf));
return -1;
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (*devname) {
strncpy(ifr.ifr_name, devname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ - 1] = '\0';
}
rc = ioctl(tunfd, TUNSETIFF, (void *)&ifr);
if (rc < 0) {
WPRINTF(("open of tap device %s failed: %d\n",
devname, errno));
close(tunfd);
return -1;
}
strncpy(devname, ifr.ifr_name, IFNAMSIZ);
return tunfd;
}
static void
virtio_net_tap_setup(struct virtio_net *net, char *devname)
{
char tbuf[IFNAMSIZ];
int vhost_fd = -1;
int rc;
rc = snprintf(tbuf, IFNAMSIZ, "%s", devname);
if (rc < 0 || rc >= IFNAMSIZ) /* give warning if error or truncation happens */
WPRINTF(("Failed to set tap device name %s\n", tbuf));
net->virtio_net_rx = virtio_net_tap_rx;
net->virtio_net_tx = virtio_net_tap_tx;
net->tapfd = virtio_net_tap_open(tbuf);
if (net->tapfd == -1) {
WPRINTF(("open of tap device %s failed\n", tbuf));
return;
}
DPRINTF(("open of tap device %s success!\n", tbuf));
/*
* Set non-blocking and register for read
* notifications with the event loop
*/
int opt = 1;
if (ioctl(net->tapfd, FIONBIO, &opt) < 0) {
WPRINTF(("tap device O_NONBLOCK failed\n"));
close(net->tapfd);
net->tapfd = -1;
}
if (net->use_vhost) {
vhost_fd = open("/dev/vhost-net", O_RDWR);
if (vhost_fd < 0)
WPRINTF(("open of vhost-net failed\n"));
else {
net->vhost_net = vhost_net_init(&net->base, vhost_fd,
net->tapfd, 0);
if (!net->vhost_net) {
WPRINTF(("vhost_net_init failed, fallback "
"to userspace virtio\n"));
close(vhost_fd);
vhost_fd = -1;
}
}
}
if (vhost_fd < 0) {
net->mevp = mevent_add(net->tapfd, EVF_READ,
virtio_net_rx_callback, net,
virtio_net_teardown, net);
if (net->mevp == NULL) {
WPRINTF(("Could not register event\n"));
close(net->tapfd);
net->tapfd = -1;
}
}
}
static int
virtio_net_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
unsigned char digest[16];
char nstr[80];
char tname[MAXCOMLEN + 1];
struct virtio_net *net = NULL;
char *devopts = NULL;
char *name = NULL;
char *type = NULL;
char *mac_seed = NULL;
char *tmp = NULL;
char *vtopts = NULL;
char *opt = NULL;
int mac_provided;
pthread_mutexattr_t attr;
int rc;
net = calloc(1, sizeof(struct virtio_net));
if (!net) {
WPRINTF(("virtio_net: calloc returns NULL\n"));
return -1;
}
/* init mutex attribute properly to avoid deadlock */
rc = pthread_mutexattr_init(&attr);
if (rc)
DPRINTF(("mutexattr init failed with erro %d!\n", rc));
rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if (rc)
DPRINTF(("virtio_net: mutexattr_settype failed with "
"error %d!\n", rc));
rc = pthread_mutex_init(&net->mtx, &attr);
if (rc)
DPRINTF(("virtio_net: pthread_mutex_init failed with "
"error %d!\n", rc));
/*
* Read the MAC address if specified
*/
mac_provided = 0;
net->vhost_net = NULL;
if (opts != NULL) {
int err;
devopts = vtopts = strdup(opts);
if (!devopts) {
WPRINTF(("virtio_net: strdup returns NULL\n"));
free(net);
return -1;
}
(void) strsep(&vtopts, ",");
while ((opt = strsep(&vtopts, ",")) != NULL) {
if (strcmp("vhost", opt) == 0)
net->use_vhost = true;
else if (!strncmp(opt, "mac=", 4)) {
err = virtio_net_parsemac(opt,
net->config.mac);
if (err != 0) {
free(devopts);
free(net);
return err;
}
mac_provided = 1;
}
}
}
virtio_linkup(&net->base, &virtio_net_ops, net, dev, net->queues,
net->use_vhost ? BACKEND_VHOST : BACKEND_VBSU);
net->base.mtx = &net->mtx;
net->base.device_caps = VIRTIO_NET_S_HOSTCAPS;
net->queues[VIRTIO_NET_RXQ].qsize = VIRTIO_NET_RINGSZ;
net->queues[VIRTIO_NET_RXQ].notify = virtio_net_ping_rxq;
net->queues[VIRTIO_NET_TXQ].qsize = VIRTIO_NET_RINGSZ;
net->queues[VIRTIO_NET_TXQ].notify = virtio_net_ping_txq;
#ifdef notyet
net->queues[VIRTIO_NET_CTLQ].qsize = VIRTIO_NET_RINGSZ;
net->queues[VIRTIO_NET_CTLQ].notify = virtio_net_ping_ctlq;
#endif
/*
* Attempt to open the tap device
*/
net->tapfd = -1;
if (!devopts) {
WPRINTF(("virtio_net: invalid optional argument\n"));
free(net);
return -1;
}
if (opts != NULL) {
vtopts = tmp = strdup(opts);
}
if ((tmp != NULL) && (strncmp(tmp, "tap", 3) == 0)) {
type = strsep(&tmp, "=");
name = strsep(&tmp, ",");
}
if ((tmp != NULL) && (strncmp(tmp, "mac_seed", 8) == 0)) {
strsep(&tmp, "=");
mac_seed = tmp;
}
if ((type != NULL) && (name != NULL)) {
if (strcmp(type, "tap") == 0) {
virtio_net_tap_setup(net, name);
}
}
/*
* The default MAC address is the standard NetApp OUI of 00-a0-98,
* followed by an MD5 of the PCI slot/func number and dev name
*/
if (!mac_provided) {
if (mac_seed != NULL) {
snprintf(nstr, sizeof(nstr), "%d-%d-%s", dev->slot,
dev->func, mac_seed);
} else {
snprintf(nstr, sizeof(nstr), "%d-%d", dev->slot,
dev->func);
}
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
EVP_DigestUpdate(mdctx, nstr, strnlen(nstr, sizeof(nstr)));
EVP_DigestFinal_ex(mdctx, digest, NULL);
EVP_MD_CTX_free(mdctx);
#else
MD5_CTX mdctx;
MD5_Init(&mdctx);
MD5_Update(&mdctx, nstr, strnlen(nstr, sizeof(nstr)));
MD5_Final(digest, &mdctx);
#endif
net->config.mac[0] = 0x00;
net->config.mac[1] = 0x16;
net->config.mac[2] = 0x3E;
net->config.mac[3] = digest[0];
net->config.mac[4] = digest[1];
net->config.mac[5] = digest[2];
}
free(vtopts);
free(devopts);
/* initialize config space */
pci_set_cfgdata16(dev, PCIR_DEVICE, VIRTIO_DEV_NET);
pci_set_cfgdata16(dev, PCIR_VENDOR, VIRTIO_VENDOR);
pci_set_cfgdata8(dev, PCIR_CLASS, PCIC_NETWORK);
pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_NET);
if (is_winvm == true)
pci_set_cfgdata16(dev, PCIR_SUBVEND_0, ORACLE_VENDOR_ID);
else
pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR);
/* Link is up if we managed to open tap device */
net->config.status = (opts == NULL || net->tapfd >= 0);
/* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */
if (virtio_interrupt_init(&net->base, virtio_uses_msix())) {
if (net)
free(net);
return -1;
}
/* use BAR 0 to map config regs in IO space */
virtio_set_io_bar(&net->base, 0);
net->resetting = 0;
net->closing = 0;
net->rx_merge = 1;
net->rx_vhdrlen = sizeof(struct virtio_net_rxhdr);
net->rx_in_progress = 0;
pthread_mutex_init(&net->rx_mtx, NULL);
/*
* Initialize tx semaphore & spawn TX processing thread.
* As of now, only one thread for TX desc processing is
* spawned.
*/
net->tx_in_progress = 0;
pthread_mutex_init(&net->tx_mtx, NULL);
pthread_cond_init(&net->tx_cond, NULL);
pthread_create(&net->tx_tid, NULL, virtio_net_tx_thread,
(void *)net);
snprintf(tname, sizeof(tname), "vtnet-%d:%d tx", dev->slot,
dev->func);
pthread_setname_np(net->tx_tid, tname);
return 0;
}
static int
virtio_net_cfgwrite(void *vdev, int offset, int size, uint32_t value)
{
struct virtio_net *net = vdev;
void *ptr;
if (offset < 6) {
if (offset + size > 6) {
DPRINTF(("vtnet: wrong params offset=%d, size=%d, ignore write mac address\n\r", offset, size));
return -1;
}
/*
* The driver is allowed to change the MAC address
*/
ptr = &net->config.mac[offset];
memcpy(ptr, &value, size);
} else {
/* silently ignore other writes */
DPRINTF(("vtnet: write to readonly reg %d\n\r", offset));
}
return 0;
}
static int
virtio_net_cfgread(void *vdev, int offset, int size, uint32_t *retval)
{
struct virtio_net *net = vdev;
void *ptr;
ptr = (uint8_t *)&net->config + offset;
memcpy(retval, ptr, size);
return 0;
}
static void
virtio_net_neg_features(void *vdev, uint64_t negotiated_features)
{
struct virtio_net *net = vdev;
net->features = negotiated_features;
if (!(net->features & VIRTIO_NET_F_MRG_RXBUF)) {
net->rx_merge = 0;
/* non-merge rx header is 2 bytes shorter */
net->rx_vhdrlen -= 2;
}
}
static void
virtio_net_set_status(void *vdev, uint64_t status)
{
struct virtio_net *net = vdev;
int rc;
if (!net->vhost_net)
return;
if (!net->vhost_net->vhost_started &&
(status & VIRTIO_CONFIG_S_DRIVER_OK)) {
if (net->mevp)
mevent_disable(net->mevp);
rc = vhost_net_start(net->vhost_net);
if (rc < 0) {
WPRINTF(("vhost_net_start failed\n"));
return;
}
} else if (net->vhost_net->vhost_started &&
((status & VIRTIO_CONFIG_S_DRIVER_OK) == 0)) {
rc = vhost_net_stop(net->vhost_net);
if (rc < 0)
WPRINTF(("vhost_net_stop failed\n"));
}
}
static void
virtio_net_teardown(void *param)
{
struct virtio_net *net;
net = (struct virtio_net *)param;
if (!net)
return;
if (net->tapfd >= 0) {
close(net->tapfd);
net->tapfd = -1;
} else
pr_err("net->tapfd is -1!\n");
virtio_reset_dev(&net->base);
free(net);
}
static void
virtio_net_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
struct virtio_net *net;
if (dev->arg) {
net = (struct virtio_net *) dev->arg;
virtio_net_tx_stop(net);
if (net->vhost_net) {
vhost_net_stop(net->vhost_net);
vhost_net_deinit(net->vhost_net);
free(net->vhost_net);
net->vhost_net = NULL;
}
if (net->mevp != NULL)
mevent_delete(net->mevp);
else
virtio_net_teardown(net);
DPRINTF(("%s: done\n", __func__));
} else
pr_err("%s: NULL!\n", __func__);
}
static struct vhost_net *
vhost_net_init(struct virtio_base *base, int vhostfd, int tapfd, int vq_idx)
{
struct vhost_net *vhost_net = NULL;
uint64_t vhost_features = VIRTIO_NET_S_VHOSTCAPS;
uint64_t vhost_ext_features = 1 << VHOST_NET_F_VIRTIO_NET_HDR;
uint32_t busyloop_timeout = 0;
int rc;
vhost_net = calloc(1, sizeof(struct vhost_net));
if (!vhost_net) {
WPRINTF(("vhost init out of memory\n"));
goto fail;
}
/* pre-init before calling vhost_dev_init */
vhost_net->vdev.nvqs = ARRAY_SIZE(vhost_net->vqs);
vhost_net->vdev.vqs = vhost_net->vqs;
vhost_net->tapfd = tapfd;
rc = vhost_dev_init(&vhost_net->vdev, base, vhostfd, vq_idx,
vhost_features, vhost_ext_features, busyloop_timeout);
if (rc < 0) {
WPRINTF(("vhost_dev_init failed\n"));
goto fail;
}
return vhost_net;
fail:
if (vhost_net)
free(vhost_net);
return NULL;
}
static int
vhost_net_deinit(struct vhost_net *vhost_net)
{
return vhost_dev_deinit(&vhost_net->vdev);
}
static int
vhost_net_start(struct vhost_net *vhost_net)
{
int rc;
if (vhost_net->vhost_started) {
WPRINTF(("vhost net already started\n"));
return 0;
}
rc = vhost_dev_start(&vhost_net->vdev);
if (rc < 0) {
WPRINTF(("vhost_dev_start failed\n"));
goto fail;
}
/* if the backend is the TAP */
if (vhost_net->tapfd > 0) {
rc = vhost_net_set_backend(&vhost_net->vdev,
vhost_net->tapfd);
if (rc < 0) {
WPRINTF(("vhost_net_set_backend failed\n"));
goto fail_set_backend;
}
}
vhost_net->vhost_started = true;
return 0;
fail_set_backend:
vhost_dev_stop(&vhost_net->vdev);
fail:
return -1;
}
static int
vhost_net_stop(struct vhost_net *vhost_net)
{
int rc;
if (!vhost_net->vhost_started) {
WPRINTF(("vhost net already stopped\n"));
return 0;
}
/* if the backend is the TAP */
if (vhost_net->tapfd > 0)
vhost_net_set_backend(&vhost_net->vdev, -1);
rc = vhost_dev_stop(&vhost_net->vdev);
if (rc < 0)
WPRINTF(("vhost_dev_stop failed\n"));
vhost_net->vhost_started = false;
return rc;
}
struct pci_vdev_ops pci_ops_virtio_net = {
.class_name = "virtio-net",
.vdev_init = virtio_net_init,
.vdev_deinit = virtio_net_deinit,
.vdev_barwrite = virtio_pci_write,
.vdev_barread = virtio_pci_read
};
DEFINE_PCI_DEVTYPE(pci_ops_virtio_net);
|
6627cca26b0241cc6c7b54260ad11ad9bc6e629e
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/devel/electron22/files/patch-gpu_command__buffer_tests_gl__test__utils.h
|
dd993b33380cedc4ffc202bfd7c7dd293e5a79e0
|
[
"BSD-3-Clause",
"BSD-2-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C
| false
| false
| 527
|
h
|
patch-gpu_command__buffer_tests_gl__test__utils.h
|
--- gpu/command_buffer/tests/gl_test_utils.h.orig 2022-07-22 17:30:31 UTC
+++ gpu/command_buffer/tests/gl_test_utils.h
@@ -122,7 +122,7 @@ class GpuCommandBufferTestEGL {
return gfx::HasExtension(gl_extensions_, extension);
}
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
// Create GLImageNativePixmap filled in with the given pixels.
scoped_refptr<gl::GLImageNativePixmap> CreateGLImageNativePixmap(
gfx::BufferFormat format,
|
e21edbc376790fd9c98c943beb2d603a19ac01ce
|
e73547787354afd9b717ea57fe8dd0695d161821
|
/src/world/dead/area_flo/flo_16/flo_16_0_header.c
|
043f97c0b05cea95a6b0db75930d74ad9782c2d1
|
[] |
no_license
|
pmret/papermario
|
8b514b19653cef8d6145e47499b3636b8c474a37
|
9774b26d93f1045dd2a67e502b6efc9599fb6c31
|
refs/heads/main
| 2023-08-31T07:09:48.951514
| 2023-08-21T18:07:08
| 2023-08-21T18:07:08
| 287,151,133
| 904
| 139
| null | 2023-09-14T02:44:23
| 2020-08-13T01:22:57
|
C
|
UTF-8
|
C
| false
| false
| 383
|
c
|
flo_16_0_header.c
|
#include "flo_16.h"
EntryList N(Entrances) = {
[flo_16_ENTRY_0] { -720.0, 0.0, 0.0, 90.0 },
[flo_16_ENTRY_1] { 710.0, 100.0, 0.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_16 },
};
|
a1d3a15c828db088371fe492e15586f77667927f
|
5a5bde743ddbcfa28dbd71dbd8fe1835010763df
|
/include/lm/core.h
|
999bc056992254401196ca02eb84b5d11a83763c
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
lightmetrica/lightmetrica-v3
|
fb85230c92dac12e754ca570cd54d45b5b6e457c
|
70601dbef13a513df032911d47f790791671a8e0
|
refs/heads/master
| 2021-10-29T08:13:40.140577
| 2021-10-22T10:50:39
| 2021-10-22T10:50:39
| 189,633,321
| 105
| 14
|
NOASSERTION
| 2021-10-20T14:34:34
| 2019-05-31T17:27:55
|
C++
|
UTF-8
|
C
| false
| false
| 282
|
h
|
core.h
|
/*
Lightmetrica - Copyright (c) 2019 Hisanari Otsu
Distributed under MIT license. See LICENSE file for details.
*/
#pragma once
// Includes core headers of Lightmetrica
#include "component.h"
#include "exception.h"
#include "json.h"
#include "logger.h"
#include "serial.h"
|
6b2b23ff12a79401ef1179361a009170e9e564bb
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/kern/bufq_readprio.c
|
e532d29ad633fe35d99fa981e75dd447d7b662b6
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 9,495
|
c
|
bufq_readprio.c
|
/* $NetBSD: bufq_readprio.c,v 1.16 2017/05/04 11:03:27 kamil Exp $ */
/* NetBSD: subr_disk.c,v 1.61 2004/09/25 03:30:44 thorpej Exp */
/*-
* Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bufq_readprio.c,v 1.16 2017/05/04 11:03:27 kamil Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/bufq.h>
#include <sys/bufq_impl.h>
#include <sys/kmem.h>
#include <sys/module.h>
/*
* Seek sort for disks.
*
* There are two queues. The first queue holds read requests; the second
* holds write requests. The read queue is first-come first-served; the
* write queue is sorted in ascendening block order.
* The read queue is processed first. After PRIO_READ_BURST consecutive
* read requests with non-empty write queue PRIO_WRITE_REQ requests from
* the write queue will be processed.
*/
#define PRIO_READ_BURST 48
#define PRIO_WRITE_REQ 16
struct bufq_prio {
TAILQ_HEAD(, buf) bq_read, bq_write; /* actual list of buffers */
struct buf *bq_write_next; /* next request in bq_write */
struct buf *bq_next; /* current request */
int bq_read_burst; /* # of consecutive reads */
};
static void bufq_readprio_init(struct bufq_state *);
static void bufq_prio_put(struct bufq_state *, struct buf *);
static struct buf *bufq_prio_get(struct bufq_state *, int);
BUFQ_DEFINE(readprio, 30, bufq_readprio_init);
static void
bufq_prio_put(struct bufq_state *bufq, struct buf *bp)
{
struct bufq_prio *prio = bufq_private(bufq);
struct buf *bq;
int sortby;
sortby = bufq->bq_flags & BUFQ_SORT_MASK;
/*
* If it's a read request append it to the list.
*/
if ((bp->b_flags & B_READ) == B_READ) {
TAILQ_INSERT_TAIL(&prio->bq_read, bp, b_actq);
return;
}
bq = TAILQ_FIRST(&prio->bq_write);
/*
* If the write list is empty, simply append it to the list.
*/
if (bq == NULL) {
TAILQ_INSERT_TAIL(&prio->bq_write, bp, b_actq);
prio->bq_write_next = bp;
return;
}
/*
* If we lie after the next request, insert after this request.
*/
if (buf_inorder(prio->bq_write_next, bp, sortby))
bq = prio->bq_write_next;
/*
* Search for the first request at a larger block number.
* We go before this request if it exists.
*/
while (bq != NULL && buf_inorder(bq, bp, sortby))
bq = TAILQ_NEXT(bq, b_actq);
if (bq != NULL)
TAILQ_INSERT_BEFORE(bq, bp, b_actq);
else
TAILQ_INSERT_TAIL(&prio->bq_write, bp, b_actq);
}
static struct buf *
bufq_prio_get(struct bufq_state *bufq, int remove)
{
struct bufq_prio *prio = bufq_private(bufq);
struct buf *bp;
/*
* If no current request, get next from the lists.
*/
if (prio->bq_next == NULL) {
/*
* If at least one list is empty, select the other.
*/
if (TAILQ_FIRST(&prio->bq_read) == NULL) {
prio->bq_next = prio->bq_write_next;
prio->bq_read_burst = 0;
} else if (prio->bq_write_next == NULL) {
bp = prio->bq_next = TAILQ_FIRST(&prio->bq_read);
prio->bq_read_burst = 0;
KASSERT((bp == NULL) ||
((bp->b_flags & B_READ) == B_READ));
} else {
/*
* Both list have requests. Select the read list up
* to PRIO_READ_BURST times, then select the write
* list PRIO_WRITE_REQ times.
*/
if (prio->bq_read_burst++ < PRIO_READ_BURST)
prio->bq_next = TAILQ_FIRST(&prio->bq_read);
else if (prio->bq_read_burst <
PRIO_READ_BURST + PRIO_WRITE_REQ)
prio->bq_next = prio->bq_write_next;
else {
prio->bq_next = TAILQ_FIRST(&prio->bq_read);
prio->bq_read_burst = 0;
}
}
}
bp = prio->bq_next;
if (bp != NULL && remove) {
if ((bp->b_flags & B_READ) == B_READ)
TAILQ_REMOVE(&prio->bq_read, bp, b_actq);
else {
/*
* Advance the write pointer before removing
* bp since it is actually prio->bq_write_next.
*/
prio->bq_write_next =
TAILQ_NEXT(prio->bq_write_next, b_actq);
TAILQ_REMOVE(&prio->bq_write, bp, b_actq);
if (prio->bq_write_next == NULL)
prio->bq_write_next =
TAILQ_FIRST(&prio->bq_write);
}
prio->bq_next = NULL;
}
return (bp);
}
static struct buf *
bufq_prio_cancel(struct bufq_state *bufq, struct buf *buf)
{
struct bufq_prio *prio = bufq_private(bufq);
struct buf *bq;
/* search read queue */
TAILQ_FOREACH(bq, &prio->bq_read, b_actq) {
if (bq == buf) {
TAILQ_REMOVE(&prio->bq_read, bq, b_actq);
/* force new section */
prio->bq_next = NULL;
return buf;
}
}
/* not found in read queue, search write queue */
TAILQ_FOREACH(bq, &prio->bq_write, b_actq) {
if (bq == buf) {
if (bq == prio->bq_write_next) {
/*
* Advance the write pointer before removing
* bp since it is actually prio->bq_write_next.
*/
prio->bq_write_next =
TAILQ_NEXT(prio->bq_write_next, b_actq);
TAILQ_REMOVE(&prio->bq_write, bq, b_actq);
if (prio->bq_write_next == NULL)
prio->bq_write_next =
TAILQ_FIRST(&prio->bq_write);
} else {
TAILQ_REMOVE(&prio->bq_write, bq, b_actq);
}
/* force new section */
prio->bq_next = NULL;
return buf;
}
}
/* still not found */
return NULL;
}
static void
bufq_prio_fini(struct bufq_state *bufq)
{
KASSERT(bufq->bq_private != NULL);
kmem_free(bufq->bq_private, sizeof(struct bufq_prio));
}
static void
bufq_readprio_init(struct bufq_state *bufq)
{
struct bufq_prio *prio;
bufq->bq_get = bufq_prio_get;
bufq->bq_put = bufq_prio_put;
bufq->bq_cancel = bufq_prio_cancel;
bufq->bq_fini = bufq_prio_fini;
bufq->bq_private = kmem_zalloc(sizeof(struct bufq_prio), KM_SLEEP);
prio = (struct bufq_prio *)bufq->bq_private;
TAILQ_INIT(&prio->bq_read);
TAILQ_INIT(&prio->bq_write);
}
MODULE(MODULE_CLASS_BUFQ, bufq_readprio, NULL);
static int
bufq_readprio_modcmd(modcmd_t cmd, void *opaque)
{
switch (cmd) {
case MODULE_CMD_INIT:
return bufq_register(&bufq_strat_readprio);
case MODULE_CMD_FINI:
return bufq_unregister(&bufq_strat_readprio);
default:
return ENOTTY;
}
}
|
c648829643a9ebd3f3692db5b7bfbb304c4c3d37
|
5c72e3dec37038e313beab6250acaa54b4b03b93
|
/vioserial/sys/Buffer.c
|
67af63faccda7daf1962d0ddedd1af2cd11a48bf
|
[
"BSD-3-Clause",
"GPL-1.0-or-later"
] |
permissive
|
virtio-win/kvm-guest-drivers-windows
|
eb29c92b6949d6bfb0ee8c70004e359180ee2398
|
19a79901f36aa552b85f8b4c3c9645ebe90d9ec5
|
refs/heads/master
| 2023-09-06T00:50:32.529282
| 2023-08-25T10:21:53
| 2023-08-31T07:30:16
| 2,524,933
| 1,424
| 294
|
BSD-3-Clause
| 2023-08-26T16:02:39
| 2011-10-06T09:06:41
|
C
|
UTF-8
|
C
| false
| false
| 10,676
|
c
|
Buffer.c
|
#include "precomp.h"
#include "vioser.h"
#if defined(EVENT_TRACING)
#include "Buffer.tmh"
#endif
// Number of descriptors that queue contains.
#define QUEUE_DESCRIPTORS 128
static BOOLEAN DmaWriteCallback(PVIRTIO_DMA_TRANSACTION_PARAMS params);
PPORT_BUFFER
VIOSerialAllocateSinglePageBuffer(
IN VirtIODevice *vdev,
IN ULONG id
)
{
PPORT_BUFFER buf;
ULONG buf_size = PAGE_SIZE;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s\n", __FUNCTION__);
buf = ExAllocatePoolUninitialized(
NonPagedPool,
sizeof(PORT_BUFFER),
VIOSERIAL_DRIVER_MEMORY_TAG
);
if (buf == NULL)
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING, "ExAllocatePoolUninitialized failed, %s::%d\n", __FUNCTION__, __LINE__);
return NULL;
}
buf->va_buf = VirtIOWdfDeviceAllocDmaMemory(vdev, buf_size, id);
if(buf->va_buf == NULL)
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING, "VirtIOWdfDeviceAllocDmaMemory failed, %s::%d\n", __FUNCTION__, __LINE__);
ExFreePoolWithTag(buf, VIOSERIAL_DRIVER_MEMORY_TAG);
return NULL;
}
buf->pa_buf = VirtIOWdfDeviceGetPhysicalAddress(vdev, buf->va_buf);
if (!buf->pa_buf.QuadPart) {
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING, "VirtIOWdfDeviceGetPhysicalAddress failed, %s::%d\n", __FUNCTION__, __LINE__);
VirtIOWdfDeviceFreeDmaMemory(vdev, buf->va_buf);
ExFreePoolWithTag(buf, VIOSERIAL_DRIVER_MEMORY_TAG);
return NULL;
}
buf->len = 0;
buf->offset = 0;
buf->size = buf_size;
buf->vdev = vdev;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
return buf;
}
size_t VIOSerialSendBuffers(IN PVIOSERIAL_PORT Port,
IN PWRITE_BUFFER_ENTRY Entry)
{
struct virtqueue *vq = GetOutQueue(Port);
VIRTIO_DMA_TRANSACTION_PARAMS params;
RtlZeroMemory(¶ms, sizeof(params));
params.allocationTag = VIOSERIAL_DRIVER_MEMORY_TAG;
params.param1 = Port;
params.param2 = Entry;
params.buffer = Entry->OriginalWriteBuffer;
params.size = (ULONG)Entry->OriginalWriteBufferSize;
return !!VirtIOWdfDeviceDmaTxAsync(vq->vdev, ¶ms, DmaWriteCallback);
}
BOOLEAN
DmaWriteCallback(PVIRTIO_DMA_TRANSACTION_PARAMS params)
{
PVIOSERIAL_PORT Port = params->param1;
NTSTATUS status = STATUS_INSUFFICIENT_RESOURCES;
PWRITE_BUFFER_ENTRY Entry = params->param2;
struct virtqueue *vq = GetOutQueue(Port);
struct VirtIOBufferDescriptor sg[QUEUE_DESCRIPTORS];
int prepared = 0, ret;
ULONG i = 0;
if (!params->sgList || params->sgList->NumberOfElements > QUEUE_DESCRIPTORS) {
TraceEvents(TRACE_LEVEL_ERROR, DBG_WRITE, "%s sgList problem\n", __FUNCTION__);
goto error;
}
for (i = 0; i < params->sgList->NumberOfElements; ++i)
{
sg[i].physAddr = params->sgList->Elements[i].Address;
sg[i].length = params->sgList->Elements[i].Length;
}
WdfSpinLockAcquire(Port->OutVqLock);
ret = virtqueue_add_buf(vq, sg, params->sgList->NumberOfElements, 0, Entry, NULL, 0);
if (ret >= 0)
{
prepared = virtqueue_kick_prepare(vq);
PushEntryList(&Port->WriteBuffersList, &Entry->ListEntry);
Entry->dmaTransaction = params->transaction;
}
else
{
Port->OutVqFull = TRUE;
TraceEvents(TRACE_LEVEL_ERROR, DBG_WRITE,
"Error adding buffer to queue (ret = %d)\n", ret);
WdfSpinLockRelease(Port->OutVqLock);
goto error;
}
WdfSpinLockRelease(Port->OutVqLock);
if (prepared)
{
// notify can run without the lock held
virtqueue_notify(vq);
}
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_WRITE, "<-- %s ok\n", __FUNCTION__);
return TRUE;
error:
VirtIOWdfDeviceDmaTxComplete(vq->vdev, params->transaction);
WdfRequestComplete(Entry->Request, status);
WdfObjectDelete(Entry->EntryHandle);
TraceEvents(TRACE_LEVEL_ERROR, DBG_WRITE, "<-- %s error\n", __FUNCTION__);
return FALSE;
}
VOID
VIOSerialFreeBuffer(
IN PPORT_BUFFER buf
)
{
ASSERT(buf);
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s buf = %p, buf->va_buf = %p\n", __FUNCTION__, buf, buf->va_buf);
if (buf->va_buf)
{
VirtIOWdfDeviceFreeDmaMemory(buf->vdev, buf->va_buf);
buf->va_buf = NULL;
}
ExFreePoolWithTag(buf, VIOSERIAL_DRIVER_MEMORY_TAG);
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
}
VOID VIOSerialProcessInputBuffers(IN PVIOSERIAL_PORT Port)
{
NTSTATUS status;
ULONG Read = 0;
WDFREQUEST Request = NULL;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s\n", __FUNCTION__);
WdfSpinLockAcquire(Port->InBufLock);
if (!Port->InBuf)
{
Port->InBuf = (PPORT_BUFFER)VIOSerialGetInBuf(Port);
}
if (!Port->GuestConnected)
{
VIOSerialDiscardPortDataLocked(Port);
}
if (Port->InBuf && Port->PendingReadRequest)
{
status = WdfRequestUnmarkCancelable(Port->PendingReadRequest);
if (status != STATUS_CANCELLED)
{
PVOID Buffer;
size_t Length;
status = WdfRequestRetrieveOutputBuffer(Port->PendingReadRequest, 0, &Buffer, &Length);
if (NT_SUCCESS(status))
{
Request = Port->PendingReadRequest;
Port->PendingReadRequest = NULL;
Read = (ULONG)VIOSerialFillReadBufLocked(Port, Buffer, Length);
}
else
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING,
"Failed to retrieve output buffer (Status: %x Request: %p).\n",
status, Request);
}
}
else
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_QUEUEING,
"Request %p was cancelled.\n", Request);
}
}
WdfSpinLockRelease(Port->InBufLock);
if (Request != NULL)
{
// no need to have the lock when completing the request
WdfRequestCompleteWithInformation(Request, STATUS_SUCCESS, Read);
}
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
}
BOOLEAN VIOSerialReclaimConsumedBuffers(IN PVIOSERIAL_PORT Port)
{
WDFREQUEST request;
SINGLE_LIST_ENTRY ReclaimedList = { NULL };
PSINGLE_LIST_ENTRY iter, last = &ReclaimedList;
PVOID buffer;
UINT len;
struct virtqueue *vq = GetOutQueue(Port);
BOOLEAN ret;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s\n", __FUNCTION__);
WdfSpinLockAcquire(Port->OutVqLock);
if (vq)
{
while ((buffer = virtqueue_get_buf(vq, &len)) != NULL)
{
iter = &Port->WriteBuffersList;
while (iter->Next != NULL)
{
PWRITE_BUFFER_ENTRY entry = CONTAINING_RECORD(iter->Next,
WRITE_BUFFER_ENTRY, ListEntry);
if (buffer == entry)
{
// remove from WriteBuffersList
iter->Next = entry->ListEntry.Next;
// append to ReclaimedList
last->Next = &entry->ListEntry;
last = last->Next;
last->Next = NULL;
}
else
{
iter = iter->Next;
}
};
Port->OutVqFull = FALSE;
}
}
ret = Port->OutVqFull;
WdfSpinLockRelease(Port->OutVqLock);
// no need to hold the lock to complete requests and free buffers
while ((iter = PopEntryList(&ReclaimedList)) != NULL)
{
PWRITE_BUFFER_ENTRY entry = CONTAINING_RECORD(iter,
WRITE_BUFFER_ENTRY, ListEntry);
if (vq != NULL && entry->dmaTransaction) {
VirtIOWdfDeviceDmaTxComplete(vq->vdev, entry->dmaTransaction);
}
request = entry->Request;
if (request != NULL)
{
WdfRequestCompleteWithInformation(request, STATUS_SUCCESS,
WdfRequestGetInformation(request));
}
WdfObjectDelete(entry->EntryHandle);
};
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s Full: %d\n",
__FUNCTION__, ret);
return ret;
}
// this procedure must be called with port InBuf spinlock held
SSIZE_T
VIOSerialFillReadBufLocked(
IN PVIOSERIAL_PORT port,
IN PVOID outbuf,
IN SIZE_T count
)
{
PPORT_BUFFER buf;
NTSTATUS status = STATUS_SUCCESS;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s\n", __FUNCTION__);
if (!count || !VIOSerialPortHasDataLocked(port))
return 0;
buf = port->InBuf;
count = min(count, buf->len - buf->offset);
RtlCopyMemory(outbuf, (PVOID)((LONG_PTR)buf->va_buf + buf->offset), count);
buf->offset += count;
if (buf->offset == buf->len)
{
port->InBuf = NULL;
status = VIOSerialAddInBuf(GetInQueue(port), buf);
if (!NT_SUCCESS(status))
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING, "%s::%d VIOSerialAddInBuf failed\n", __FUNCTION__, __LINE__);
}
}
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
return count;
}
NTSTATUS
VIOSerialAddInBuf(
IN struct virtqueue *vq,
IN PPORT_BUFFER buf)
{
NTSTATUS status = STATUS_SUCCESS;
struct VirtIOBufferDescriptor sg;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s buf = %p\n", __FUNCTION__, buf);
if (buf == NULL)
{
ASSERT(0);
return STATUS_INSUFFICIENT_RESOURCES;
}
if (vq == NULL)
{
ASSERT(0);
return STATUS_INSUFFICIENT_RESOURCES;
}
sg.physAddr = buf->pa_buf;
sg.length = buf->size;
if(0 > virtqueue_add_buf(vq, &sg, 0, 1, buf, NULL, 0))
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_QUEUEING, "<-- %s cannot add_buf\n", __FUNCTION__);
status = STATUS_INSUFFICIENT_RESOURCES;
}
virtqueue_kick(vq);
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
return status;
}
PVOID
VIOSerialGetInBuf(
IN PVIOSERIAL_PORT port
)
{
PPORT_BUFFER buf = NULL;
struct virtqueue *vq = GetInQueue(port);
UINT len;
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "--> %s\n", __FUNCTION__);
if (vq)
{
buf = virtqueue_get_buf(vq, &len);
if (buf)
{
buf->len = len;
buf->offset = 0;
}
}
TraceEvents(TRACE_LEVEL_VERBOSE, DBG_QUEUEING, "<-- %s\n", __FUNCTION__);
return buf;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.