Skip to content

Commit 1610602

Browse files
committed
Merge branch 'dev'
2 parents fc61c99 + 3199973 commit 1610602

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+877
-1705
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Retro-Go 1.38 (2023-03-28)
2+
- GBC: Added support for MBC30 (For Pokemon Crystal romhacks)
3+
- Launcher: Added a new scroll behavior (Options -> Scroll mode)
4+
5+
16
# Retro-Go 1.37 (2022-12-30)
27
- SNES: Fixed controls menu labels
38
- GEN: Small performance improvement

base.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ macro(rg_setup_compile_options)
1313
message("Target: ${RG_TARGET}")
1414

1515
component_compile_options(
16-
-DRG_REPLACE_PRINTF_FUNCTIONS
1716
-D${RG_TARGET}
1817
-DRETRO_GO
1918
${ARGV}

components/retro-go/CMakeLists.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
set(COMPONENT_SRCDIRS ". fonts libs/netplay libs/lodepng")
22
set(COMPONENT_ADD_INCLUDEDIRS ". libs/netplay libs/lodepng")
3-
if($ENV{RG_ENABLE_NETWORKING})
4-
set(COMPONENT_REQUIRES "spi_flash fatfs nvs_flash esp_http_client app_update esp_adc_cal esp32 json")
5-
else()
6-
set(COMPONENT_REQUIRES "spi_flash fatfs app_update esp_adc_cal esp32 json")
7-
endif()
3+
4+
# esp-idf 4.1 - 4.4
5+
set(COMPONENT_REQUIRES "spi_flash fatfs app_update esp_adc_cal json nvs_flash esp_wifi esp_http_client")
6+
# esp-idf 5.0 -
7+
#set(COMPONENT_REQUIRES "spi_flash fatfs app_update esp_adc esp_timer json nvs_flash esp_wifi esp_http_client")
8+
89
register_component()
910

1011
# Small size is preferred because of the small cache and most things here aren't performance sensitive!
@@ -13,8 +14,8 @@ register_component()
1314
component_compile_options(
1415
-DLODEPNG_NO_COMPILE_ANCILLARY_CHUNKS
1516
-DLODEPNG_NO_COMPILE_ERROR_TEXT
16-
-DRG_REPLACE_PRINTF_FUNCTIONS
1717
-Os
18+
-Wno-unused-function
1819
)
1920
set_source_files_properties(
2021
rg_audio.c rg_display.c

components/retro-go/config.h

+4
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@
6868
#ifndef RG_GPIO_LED
6969
#define RG_GPIO_LED (-1)
7070
#endif
71+
72+
#ifndef RG_GAMEPAD_MAP
73+
#define RG_GAMEPAD_MAP {}
74+
#endif

components/retro-go/rg_audio.c

+17-22
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,25 @@
33

44
#include <stdlib.h>
55
#include <string.h>
6-
#include <unistd.h>
76

8-
#ifndef RG_TARGET_SDL2
7+
#ifdef RG_TARGET_SDL2
8+
#include <SDL2/SDL.h>
9+
#define CREATE_DEVICE_LOCK()
10+
#define ACQUIRE_DEVICE(timeout) (1)
11+
#define RELEASE_DEVICE()
12+
#else
913
#include <freertos/FreeRTOS.h>
1014
#include <freertos/semphr.h>
11-
#else
12-
#include <SDL2/SDL.h>
15+
#define CREATE_DEVICE_LOCK() audioDevLock = audioDevLock ?: xSemaphoreCreateMutex()
16+
#define ACQUIRE_DEVICE(timeout) \
17+
({ \
18+
int x = xSemaphoreTake(audioDevLock, timeout); \
19+
if (!x) \
20+
RG_LOGE("Failed to acquire lock!\n"); \
21+
x; \
22+
})
23+
#define RELEASE_DEVICE() xSemaphoreGive(audioDevLock)
24+
static SemaphoreHandle_t audioDevLock;
1325
#endif
1426

1527
#if RG_AUDIO_USE_INT_DAC || RG_AUDIO_USE_EXT_DAC
@@ -48,35 +60,18 @@ static const rg_audio_sink_t sinks[] = {
4860

4961
static rg_audio_t audio;
5062
static rg_audio_counters_t counters;
51-
52-
static SemaphoreHandle_t audioDevLock;
5363
static int64_t dummyBusyUntil = 0;
5464

5565
static const char *SETTING_OUTPUT = "AudioSink";
5666
static const char *SETTING_VOLUME = "Volume";
5767
static const char *SETTING_FILTER = "AudioFilter";
5868

59-
#ifndef RG_TARGET_SDL2
60-
#define ACQUIRE_DEVICE(timeout) \
61-
({ \
62-
int x = xSemaphoreTake(audioDevLock, timeout); \
63-
if (!x) \
64-
RG_LOGE("Failed to acquire lock!\n"); \
65-
x; \
66-
})
67-
#define RELEASE_DEVICE() xSemaphoreGive(audioDevLock);
68-
#else
69-
#define ACQUIRE_DEVICE(timeout) (1)
70-
#define RELEASE_DEVICE()
71-
#endif
7269

7370
void rg_audio_init(int sampleRate)
7471
{
7572
RG_ASSERT(audio.sink == NULL, "Audio sink already initialized!");
7673

77-
if (audioDevLock == NULL)
78-
audioDevLock = xSemaphoreCreateMutex();
79-
74+
CREATE_DEVICE_LOCK();
8075
ACQUIRE_DEVICE(1000);
8176

8277
int sinkType = (int)rg_settings_get_number(NS_GLOBAL, SETTING_OUTPUT, sinks[0].type);

0 commit comments

Comments
 (0)