Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MatPoliquin authored Jan 18, 2025
2 parents 65aaa37 + 445547f commit e0f64fc
Show file tree
Hide file tree
Showing 179 changed files with 3,426 additions and 3,060 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/01-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ body:
attributes:
label: Version/Commit
description: You can find this information under Information/System Information
placeholder: 1.19.1 (Git 0792144fe3)
placeholder: 1.20.0 (Git ab3b175)
validations:
required: true

Expand All @@ -56,8 +56,8 @@ body:
- type: dropdown
id: nigthly
attributes:
label: Check in the nightly version
description: This issue is reproducible with [nightly builds](https://buildbot.libretro.com/nightly/)?
label: Present in the nightly version
description: Is the issue reproducible with current [nightly builds](https://buildbot.libretro.com/nightly/)?
options:
- I don't know
- Yes, this is reproduced in the nightly build
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/MSYS2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI Windows (MSYS2)

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

permissions:
contents: read

jobs:
msys2-build-test:
strategy:
fail-fast: false
matrix:
sys: [MINGW64, UCRT64,CLANG64]
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: base-devel git
pacboy: >-
gettext:p
gobject-introspection:p
graphite2:p
p11-kit:p
qt6:p
qt6-3d:p
qt6-charts:p
qt6-datavis3d:p
qt6-imageformats:p
qt6-location:p
qt6-lottie:p
qt6-networkauth:p
qt6-quick3dphysics:p
qt6-quicktimeline:p
qt6-remoteobjects:p
qt6-scxml:p
qt6-sensors:p
qt6-serialbus:p
qt6-speech:p
qt6-tools:p
qt6-translations:p
qt6-virtualkeyboard:p
qt6-webchannel:p
qt6-websockets:p
x264:p
cc:p
- name: Configure and build RetroArch
shell: msys2 {0}
run: |
echo "Building RetroArch in ${{ matrix.sys }} environment"
./configure
make -j$(nproc)
- name: Collect DLLs and binaries
shell: msys2 {0}
run: |
echo "Collecting DLLs and binaries"
mkdir -p dist
cp retroarch.exe dist/
ldd retroarch.exe|grep $MINGW_PREFIX |awk '{print $3}'|xargs -I {} cp {} dist/
- name: Archive build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: retroarch-${{ matrix.sys }}
path: dist/
26 changes: 25 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2648,9 +2648,33 @@ ifeq ($(HAVE_ODROIDGO2), 1)
gfx/drivers/oga_gfx.o
endif


ifeq ($(HAVE_GAME_AI),1)
DEFINES += -DHAVE_GAME_AI
OBJ += ai/game_ai.o
endif

##################################
# Detect the operating system
UNAME := $(shell uname -s)

# Check if the system is MSYS2 (MINGW64 or MINGW32)
ifneq ($(findstring MINGW,$(UNAME)),)
$(info Detected MSYS2 environment)

NT_VERSION := $(shell \
echo '#include <windows.h>' > temp.c; \
echo '#ifdef _WIN32_WINNT' >> temp.c; \
echo '#define GET_MACRO_VALUE(x) #x' >> temp.c; \
echo '#define EXPAND_MACRO_VALUE(x) GET_MACRO_VALUE(x)' >> temp.c; \
echo '#pragma message("_WIN32_WINNT=" EXPAND_MACRO_VALUE(_WIN32_WINNT))' >> temp.c; \
echo '#endif' >> temp.c; \
$(CC) -c temp.c 2>&1 | sed -n 's/^.*_WIN32_WINNT=\(0x[0-9A-Fa-f]\+\).*/\1/p'; \
rm -f temp.c temp.o)

ifneq ($(NT_VERSION),)
ifeq ($(shell [ $$(( $(NT_VERSION) )) -gt $$(( 0x602 )) ] && echo true),true)
LIBS += -lxaudio2_9
endif
else
$(warning Windows NT version macro (_WIN32_WINNT) is not defined.)
endif
4 changes: 2 additions & 2 deletions Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ HAVE_CORE_INFO_CACHE = 1
HAVE_7ZIP = 1
HAVE_BSV_MOVIE = 1
HAVE_AL = 1
HAVE_CHD ?= 0

# WARNING -- READ BEFORE ENABLING
# The rwebaudio driver is known to have several audio bugs, such as
Expand Down Expand Up @@ -150,8 +151,7 @@ LDFLAGS += -s STACK_SIZE=131072

LDFLAGS += --extern-pre-js emscripten/pre.js

CFLAGS += -Wall -I. -Ilibretro-common/include -std=gnu99 #\
# -s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_take_screenshot']"
CFLAGS += -Wall -I. -Ilibretro-common/include -Ideps/7zip -std=gnu99

RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))

Expand Down
2 changes: 1 addition & 1 deletion audio/audio_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ typedef struct audio_driver
* Unless said otherwise with set_nonblock_state(), all writes
* are blocking, and it should block till it has written all frames.
*/
ssize_t (*write)(void *data, const void *buf, size_t size);
ssize_t (*write)(void *data, const void *buf, size_t len);

/**
* Temporarily pauses the audio driver.
Expand Down
4 changes: 0 additions & 4 deletions audio/common/mmdevice_common_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

/* Fix for MSYS2 increasing _WIN32_WINNT to 0x0603*/
#if defined(__MINGW32__) || defined(__MINGW64__)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN
#else
typedef enum EDataFlow EDataFlow;
Expand Down
13 changes: 5 additions & 8 deletions audio/common/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static void core_error_cb(void *data, uint32_t id, int seq, int res, const char
RARCH_ERR("[PipeWire]: error id:%u seq:%d res:%d (%s): %s\n",
id, seq, res, spa_strerror(res), message);

/* stop and exit the thread loop */
pw_thread_loop_stop(pw->thread_loop);
}

Expand All @@ -42,11 +41,9 @@ static void core_done_cb(void *data, uint32_t id, int seq)
retro_assert(id == PW_ID_CORE);

pw->last_seq = seq;

if (pw->pending_seq == seq)
{
/* stop and exit the thread loop */
pw_thread_loop_signal(pw->thread_loop, false);
}
}

static const struct pw_core_events core_events = {
Expand All @@ -55,7 +52,7 @@ static const struct pw_core_events core_events = {
.error = core_error_cb,
};

size_t calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels)
size_t pipewire_calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels)
{
uint32_t sample_size = 1;
switch (fmt)
Expand Down Expand Up @@ -85,7 +82,7 @@ size_t calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels)
return sample_size * nchannels;
}

void set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
void pipewire_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
{
memcpy(position, (uint32_t[SPA_AUDIO_MAX_CHANNELS]) { SPA_AUDIO_CHANNEL_UNKNOWN, },
sizeof(uint32_t) * SPA_AUDIO_MAX_CHANNELS);
Expand Down Expand Up @@ -114,7 +111,7 @@ void set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
}
}

void pipewire_wait_resync(pipewire_core_t *pw)
void pipewire_core_wait_resync(pipewire_core_t *pw)
{
retro_assert(pw);
pw->pending_seq = pw_core_sync(pw->core, PW_ID_CORE, pw->pending_seq);
Expand All @@ -127,7 +124,7 @@ void pipewire_wait_resync(pipewire_core_t *pw)
}
}

bool pipewire_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active)
bool pipewire_stream_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active)
{
enum pw_stream_state st;
const char *error;
Expand Down
15 changes: 7 additions & 8 deletions audio/common/pipewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,26 @@ typedef struct pipewire_core
{
struct pw_thread_loop *thread_loop;
struct pw_context *ctx;

struct pw_core *core;
struct spa_hook core_listener;
int last_seq, pending_seq;

struct pw_registry *registry;
struct spa_hook registry_listener;
struct pw_client *client;
struct spa_hook client_listener;

bool nonblock;
struct string_list *devicelist;
bool nonblock;
} pipewire_core_t;

size_t calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels);
size_t pipewire_calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels);

void set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS]);
void pipewire_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS]);

void pipewire_wait_resync(pipewire_core_t *pipewire);
bool pipewire_core_init(pipewire_core_t *pipewire, const char *loop_name);

bool pipewire_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active);
void pipewire_core_wait_resync(pipewire_core_t *pipewire);

bool pipewire_core_init(pipewire_core_t *pipewire, const char *loop_name);
bool pipewire_stream_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active);

#endif /* _RETROARCH_PIPEWIRE */
Loading

0 comments on commit e0f64fc

Please sign in to comment.