Skip to content

Commit

Permalink
emulators/yuzu: update to s20230518
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed May 20, 2023
1 parent 41870dd commit 50cc066
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 10 deletions.
6 changes: 3 additions & 3 deletions emulators/yuzu/Makefile
@@ -1,5 +1,5 @@
PORTNAME= yuzu
PORTVERSION= s20230517
PORTVERSION= s20230518
CATEGORIES= emulators wayland
.if make(makesum)
MASTER_SITES= https://api.yuzu-emu.org/gamedb/?dummy=/:gamedb
Expand Down Expand Up @@ -46,15 +46,15 @@ qt6_OPTIONS_EXCLUDE= QT5

USE_GITHUB= yes
GH_ACCOUNT= yuzu-emu
GH_TAGNAME= 9d4a2de72
GH_TAGNAME= 1e398e6c3
GH_TUPLE= yuzu-emu:mbedtls:v2.16.9-115-g8c88150ca:mbedtls/externals/mbedtls \
yuzu-emu:sirit:ab75463:sirit/externals/sirit \
KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-201-gc214f6f:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
MerryMage:dynarmic:6.4.7-2-g7da37803:dynarmic/externals/dynarmic \
arun11299:cpp-jwt:v1.4-14-ge12ef06:cpp_jwt/externals/cpp-jwt \
arsenm:sanitizers-cmake:aab6948:sanitizers_cmake/externals/cubeb/cmake/sanitizers-cmake \
benhoyt:inih:r52:inih/externals/inih/inih \
kinetiknz:cubeb:cubeb-0.2-1350-gf79e0cf:cubeb/externals/cubeb \
kinetiknz:cubeb:cubeb-0.2-1451-g2d817de:cubeb/externals/cubeb \
yhirose:cpp-httplib:v0.12.0-3-g6d963fb:cpp_httplib/externals/cpp-httplib

USES= cmake:testing elfctl localbase:ldflags pkgconfig sdl ssl
Expand Down
14 changes: 7 additions & 7 deletions emulators/yuzu/distinfo
@@ -1,8 +1,8 @@
TIMESTAMP = 1684351143
SHA256 (yuzu-s20230517/compatibility_list.json) = 382db629d6b060af722a27dfa9cd6bb60ac16a7544c58322f63aa1be4c0c0fac
SIZE (yuzu-s20230517/compatibility_list.json) = 1801327
SHA256 (yuzu-emu-yuzu-s20230517-9d4a2de72_GH0.tar.gz) = aa5121560c8be5f5e8f4f68cfff7cad75d75f9d24e722ef2980da9919331d507
SIZE (yuzu-emu-yuzu-s20230517-9d4a2de72_GH0.tar.gz) = 5632953
TIMESTAMP = 1684458638
SHA256 (yuzu-s20230518/compatibility_list.json) = 382db629d6b060af722a27dfa9cd6bb60ac16a7544c58322f63aa1be4c0c0fac
SIZE (yuzu-s20230518/compatibility_list.json) = 1801327
SHA256 (yuzu-emu-yuzu-s20230518-1e398e6c3_GH0.tar.gz) = c4609040bda4c889153b0f2ae822d21a674db470adc8f18fbd640de4134acddd
SIZE (yuzu-emu-yuzu-s20230518-1e398e6c3_GH0.tar.gz) = 5633001
SHA256 (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 8cd6d075b4da0ad5fb995eb37390e2e6088be8d41ab1cdfc7e7e4256bd991450
SIZE (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 2679189
SHA256 (yuzu-emu-sirit-ab75463_GH0.tar.gz) = 6b61e265be182b7a78075fc1b98ccf80fd33008343205dd0e22a10a439c45319
Expand All @@ -17,8 +17,8 @@ SHA256 (arsenm-sanitizers-cmake-aab6948_GH0.tar.gz) = d9009e17948aff769a6f6e16b5
SIZE (arsenm-sanitizers-cmake-aab6948_GH0.tar.gz) = 7240
SHA256 (benhoyt-inih-r52_GH0.tar.gz) = 439cff9ce9a8afc52d08772ac3e93b3cecd79c7707f871fb4534fb3a48201880
SIZE (benhoyt-inih-r52_GH0.tar.gz) = 16808
SHA256 (kinetiknz-cubeb-cubeb-0.2-1350-gf79e0cf_GH0.tar.gz) = 8629757290774a34ed3fcd53b6491e9ccc96231018406c58c493f336b3ced908
SIZE (kinetiknz-cubeb-cubeb-0.2-1350-gf79e0cf_GH0.tar.gz) = 220847
SHA256 (kinetiknz-cubeb-cubeb-0.2-1451-g2d817de_GH0.tar.gz) = e7aa2182c2bbb272a069323dcddd7904ba13a969102c5f7a3f3c0472572db1d4
SIZE (kinetiknz-cubeb-cubeb-0.2-1451-g2d817de_GH0.tar.gz) = 228366
SHA256 (yhirose-cpp-httplib-v0.12.0-3-g6d963fb_GH0.tar.gz) = f64f5c3494196a032be5bc93c81a87bd7e0fbc1b541cab113fce1a4473b4078d
SIZE (yhirose-cpp-httplib-v0.12.0-3-g6d963fb_GH0.tar.gz) = 637612
SHA256 (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271
Expand Down
112 changes: 112 additions & 0 deletions emulators/yuzu/files/patch-cubeb-revert
@@ -0,0 +1,112 @@
Revert https://github.com/mozilla/cubeb/commit/0846b39f1fdc
until https://github.com/mozilla/cubeb/issues/746

--- externals/cubeb/src/cubeb_sndio.c.orig 2023-05-02 14:18:52 UTC
+++ externals/cubeb/src/cubeb_sndio.c
@@ -68,7 +68,7 @@ struct cubeb_stream {
struct sio_hdl * hdl; /* link us to sndio */
int mode; /* bitmap of SIO_{PLAY,REC} */
int active; /* cubec_start() called */
- int conv; /* need float->s24 conversion */
+ int conv; /* need float->s16 conversion */
unsigned char * rbuf; /* rec data consumed from here */
unsigned char * pbuf; /* play data is prepared here */
unsigned int nfr; /* number of frames in ibuf and obuf */
@@ -99,33 +99,33 @@ static void
}

static void
-float_to_s24(void * ptr, long nsamp, float volume)
+float_to_s16(void * ptr, long nsamp, float volume)
{
- int32_t * dst = ptr;
+ int16_t * dst = ptr;
float * src = ptr;
- float mult = volume * 8388608;
+ float mult = volume * 32768;
int s;

while (nsamp-- > 0) {
s = lrintf(*(src++) * mult);
- if (s < -8388608)
- s = -8388608;
- else if (s > 8388607)
- s = 8388607;
+ if (s < -32768)
+ s = -32768;
+ else if (s > 32767)
+ s = 32767;
*(dst++) = s;
}
}

static void
-s24_to_float(void * ptr, long nsamp)
+s16_to_float(void * ptr, long nsamp)
{
- int32_t * src = ptr;
+ int16_t * src = ptr;
float * dst = ptr;

src += nsamp;
dst += nsamp;
while (nsamp-- > 0)
- *(--dst) = (1. / 8388608) * *(--src);
+ *(--dst) = (1. / 32768) * *(--src);
}

static const char *
@@ -213,7 +213,7 @@ sndio_mainloop(void * arg)
}

if ((s->mode & SIO_REC) && s->conv)
- s24_to_float(s->rbuf, s->nfr * s->rchan);
+ s16_to_float(s->rbuf, s->nfr * s->rchan);

/* invoke call-back, it returns less that s->nfr if done */
pthread_mutex_unlock(&s->mtx);
@@ -244,7 +244,7 @@ sndio_mainloop(void * arg)

if (s->mode & SIO_PLAY) {
if (s->conv)
- float_to_s24(s->pbuf, nfr * s->pchan, s->volume);
+ float_to_s16(s->pbuf, nfr * s->pchan, s->volume);
else
s16_setvol(s->pbuf, nfr * s->pchan, s->volume);
}
@@ -429,25 +429,21 @@ sndio_stream_init(cubeb * context, cubeb_stream ** str
}
WRAP(sio_initpar)(&wpar);
wpar.sig = 1;
+ wpar.bits = 16;
switch (format) {
case CUBEB_SAMPLE_S16LE:
wpar.le = 1;
- wpar.bits = 16;
break;
case CUBEB_SAMPLE_S16BE:
wpar.le = 0;
- wpar.bits = 16;
break;
case CUBEB_SAMPLE_FLOAT32NE:
wpar.le = SIO_LE_NATIVE;
- wpar.bits = 24;
- wpar.msb = 0;
break;
default:
DPR("sndio_stream_init() unsupported format\n");
goto err;
}
- wpar.bps = SIO_BPS(wpar.bits);
wpar.rate = rate;
if (s->mode & SIO_REC)
wpar.rchan = input_stream_params->channels;
@@ -459,8 +455,6 @@ sndio_stream_init(cubeb * context, cubeb_stream ** str
goto err;
}
if (rpar.bits != wpar.bits || rpar.le != wpar.le || rpar.sig != wpar.sig ||
- rpar.bps != wpar.bps ||
- (wpar.bits < 8 * wpar.bps && rpar.msb != wpar.msb) ||
rpar.rate != wpar.rate ||
((s->mode & SIO_REC) && rpar.rchan != wpar.rchan) ||
((s->mode & SIO_PLAY) && rpar.pchan != wpar.pchan)) {

0 comments on commit 50cc066

Please sign in to comment.