mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-04-25 07:27:53 -05:00
Better hide smaller errors caused by N3DSXL CC's firmware
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
This commit is contained in:
parent
b9c3405666
commit
d449b59892
|
|
@ -9,13 +9,14 @@
|
|||
// It may happen that a frame is lost.
|
||||
// This value prevents showing a black frame for that.
|
||||
// Shouldn't happen with recent updates, though...
|
||||
#define MAX_ALLOWED_BLANKS 1
|
||||
#define MAX_ALLOWED_NO_FRAME_TIME 0.120
|
||||
|
||||
#define FIX_PARTIAL_FIRST_FRAME_NUM 3
|
||||
|
||||
#define MAX_PACKET_SIZE_USB2 (1 << 9)
|
||||
#define EXTRA_DATA_BUFFER_USB_SIZE MAX_PACKET_SIZE_USB2
|
||||
#define EXTRA_DATA_BUFFER_FTD3XX_SIZE (1 << 10)
|
||||
#define ERROR_DATA_BUFFER_FTD3XX_SIZE (1 << 10)
|
||||
|
||||
#define FTD2_INTRA_PACKET_HEADER_SIZE 2
|
||||
#define MAX_PACKET_SIZE_FTD2 (MAX_PACKET_SIZE_USB2 - FTD2_INTRA_PACKET_HEADER_SIZE)
|
||||
|
|
@ -136,12 +137,14 @@ struct ALIGNED(16) PACKED FTD3_3DSCaptureReceived {
|
|||
RGB83DSVideoInputData video_in;
|
||||
uint16_t audio_data[N3DSXL_SAMPLES_IN];
|
||||
uint8_t unused_buffer[EXTRA_DATA_BUFFER_FTD3XX_SIZE];
|
||||
uint8_t error_buffer[ERROR_DATA_BUFFER_FTD3XX_SIZE];
|
||||
};
|
||||
|
||||
struct ALIGNED(16) PACKED FTD3_3DSCaptureReceived_3D {
|
||||
RGB83DSVideoInputData_3D video_in;
|
||||
uint16_t audio_data[N3DSXL_SAMPLES_IN];
|
||||
uint8_t unused_buffer[EXTRA_DATA_BUFFER_FTD3XX_SIZE];
|
||||
uint8_t error_buffer[ERROR_DATA_BUFFER_FTD3XX_SIZE];
|
||||
};
|
||||
|
||||
struct ALIGNED(16) PACKED USB3DSCaptureReceived {
|
||||
|
|
|
|||
|
|
@ -62,9 +62,21 @@ uint64_t ftd3_get_capture_size(CaptureData* capture_data) {
|
|||
return ftd3_get_capture_size(get_3d_enabled(&capture_data->status));
|
||||
}
|
||||
|
||||
static void early_data_output_update_exit(int inner_index, CaptureData* capture_data) {
|
||||
capture_data->data_buffers.ReleaseWriterBuffer(inner_index, false);
|
||||
}
|
||||
|
||||
void data_output_update(int inner_index, size_t read_data, CaptureData* capture_data, std::chrono::time_point<std::chrono::high_resolution_clock> &base_time, bool is_3d) {
|
||||
if(is_3d && (read_data < ftd3_get_video_in_size(is_3d)) && (read_data >= ftd3_get_video_in_size(false)))
|
||||
is_3d = false;
|
||||
|
||||
// Error detection for bad frames which may happen in some games...
|
||||
// Examples: Kirby Planet Robobot and M&L: Dream Team
|
||||
if(read_data > (ftd3_get_capture_size(is_3d) - ERROR_DATA_BUFFER_FTD3XX_SIZE))
|
||||
return early_data_output_update_exit(inner_index, capture_data);
|
||||
if(read_data < ftd3_get_video_in_size(is_3d))
|
||||
return early_data_output_update_exit(inner_index, capture_data);
|
||||
|
||||
const auto curr_time = std::chrono::high_resolution_clock::now();
|
||||
const std::chrono::duration<double> diff = curr_time - base_time;
|
||||
base_time = curr_time;
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ static void soundCall(AudioData *audio_data, CaptureData* capture_data) {
|
|||
audio.stop();
|
||||
default_sleep();
|
||||
}
|
||||
|
||||
|
||||
auto curr_time = std::chrono::high_resolution_clock::now();
|
||||
const std::chrono::duration<double> diff = curr_time - last_device_check_time;
|
||||
if(diff.count() >= TIME_AUDIO_DEVICE_CHECK) {
|
||||
|
|
@ -526,7 +526,8 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
frontend_data.display_data.force_disable_mouse = override_data.always_prevent_mouse_showing;
|
||||
frontend_data.reload = true;
|
||||
bool skip_io = false;
|
||||
int num_allowed_blanks = MAX_ALLOWED_BLANKS;
|
||||
const double max_time_no_frames_allowed = MAX_ALLOWED_NO_FRAME_TIME;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> last_valid_frame_time = std::chrono::high_resolution_clock::now();
|
||||
OutTextData out_text_data;
|
||||
int ret_val = 0;
|
||||
int poll_timeout = 0;
|
||||
|
|
@ -590,7 +591,7 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
if(is_connected != last_connected) {
|
||||
update_connected_specific_settings(&frontend_data, capture_data->status.device);
|
||||
no_data_consecutive = 0;
|
||||
num_allowed_blanks = MAX_ALLOWED_BLANKS;
|
||||
last_valid_frame_time = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
last_connected = is_connected;
|
||||
if(is_connected) {
|
||||
|
|
@ -613,16 +614,16 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
if(!conversion_success)
|
||||
UpdateOutText(out_text_data, "", "Video conversion failed...", TEXT_KIND_NORMAL);
|
||||
}
|
||||
num_allowed_blanks = MAX_ALLOWED_BLANKS;
|
||||
last_valid_frame_time = std::chrono::high_resolution_clock::now();
|
||||
no_data_consecutive = 0;
|
||||
data_processed = true;
|
||||
}
|
||||
capture_data->data_buffers.ReleaseReaderBuffer(CAPTURE_READER_VIDEO);
|
||||
}
|
||||
if(!data_processed) {
|
||||
if(num_allowed_blanks > 0)
|
||||
num_allowed_blanks--;
|
||||
else
|
||||
auto curr_time = std::chrono::high_resolution_clock::now();
|
||||
const std::chrono::duration<double> diff = curr_time - last_valid_frame_time;
|
||||
if(diff.count() > max_time_no_frames_allowed)
|
||||
blank_out = true;
|
||||
if(capture_data->status.cooldown_curr_in || (!capture_data->status.connected))
|
||||
blank_out = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user