Skip to content

RT1#1

Open
magicseb wants to merge 10000 commits intomagicseb:masterfrom
libretro:master
Open

RT1#1
magicseb wants to merge 10000 commits intomagicseb:masterfrom
libretro:master

Conversation

@magicseb
Copy link
Owner

@magicseb magicseb commented Nov 5, 2019

No description provided.

PoloniumRain and others added 29 commits January 27, 2026 04:47
* Fixed menu system displaying incorrectly in HDR on D3D11, D3D12 and Vulkan

* Fixed the menu in D3D11 and D3D12 when using HDR native shader's

Vulkan still has issues

* Fixed Vulkan driver HDR menu when we're using a HDR native shader 

Removed redundant constant buffer

* Fix for HDR when using presets that use scale_type
This patch implements functionality (safe-shutdown, reset) to Lakka for
Raspberry Pi devices using various RetroFlags cases for various
Raspberry Pi models.

Additional guards added to makefile to make sure that make options
specific to Lakka are only used with Lakka.

Co-authored-by: Shigeaki Asai <y-asai.0816@docomonet.jp>
Co-authored-by: hunterk <hunter_kaller@yahoo.com>
Co-authored-by: PoloniumRain <poloniumrain@users.noreply.github.com>
warmenhoven and others added 30 commits March 8, 2026 12:33
1. Early-exit in the borders draw loop (ozone_draw_entries)
2. Deduplicated gfx_display_set_alpha calls in the borders loop
3. Early-exit in the icons+text draw loop (ozone_draw_entries)
4. Sidebar console tab culling (ozone_draw_sidebar)
5. Eliminated redundant menu_entry_get calls in ozone_compute_entries_position
1) input_joypad_axis — Removed the redundant (1.0f / 0x7fff) * val * sensitivity round-trip through normalized
2) input_joypad_analog_button — Hoisted joypad_info->joy_idx into a local joy_idx
3) input_state_wrap axis comparison — Replaced two /0x8000 float divisions (one per joypad) with a single precomputed inv_0x8000 = 1.0f / 0x8000 multiplied in.
4) Analog-to-digital mapping loop — The inner (float)ret_axis / 0x7fff was computed up to 4 times per axis value (once per direction comparison). Now it's computed once as norm
5) input_state_internal - expression hoisted Hoisted into a single kb_blocked bool in an enclosing scope block.
6) input_keys_pressed — Same flag check was evaluated 3–4 times across the function body plus once per iteration of the meta-key for loop. Hoisted into a single kb_blocked local
7) input_keyboard_event accessibility path — Eliminated a malloc(2) + free() call per keypress for a 2-byte string
1. Eliminated massive calloc over-allocation for uints settings (biggest win)
2. Replaced all 7 sizeof-based size calculations with compile-time constants
3. Fixed strdup memory leak in populate_settings_array
- new_file[32768] — downsized to PATH_MAX_LENGTH
- win32_clip_window — WINDOWINFO was heap-allocated with malloc for no reason.
Changed to stack variable with correct sizeof(WINDOWINFO)
- DragQueryFileW - Correct size argument now
- win32_meta_key_to_name — returns NULL for unmapped keys, but strlen was called on its return value unconditionally. Added a NULL guard
- win32_get_refresh_rate — removed GetVersionEx (deprecated since Vista, absent in some SDKs) since the whole block is already #if-gated on Win7+. Also fixed a missing Denominator != 0 guard before the division
- win32_get_metrics — previously opened and released a HDC once per case branch (5 separate GetDC/ReleaseDC round-trips). Now opens one HDC, queries what's needed, and releases it once
- win32_get_refresh_rate — the two GetModuleHandle("user32.dll") calls (one per function pointer) each hit a hash-table lookup. Combined them so user32 is retrieved once only when either pointer is missing
- win32_load_content_from_gui — the if/else block around DialogBoxParam was identical in both branches (the only difference was showing the mouse cursor). Deduplicated into a single dialog call with conditional cursor show/hide around it
- pick_core_proc — removed shadowed const core_info_t *info variables and redundant &array[i]-to-pointer casts
- win32_resize_after_display_change — abs() on monitor RECT deltas is unnecessary (right ≥ left always); removed the call
* Float division replaced with integer multiply (dinput_joypad_inl.h —
* Rumble destroy loop deduplicated (dinput_joypad_inl.h)
* Duplicated axis switch eliminated (dinput_joypad_inl.h)
* Fixed: POV centered-sentinel not guarded (dinput_joypad_inl.h)
* lZ never zeroed in poll (dinput_joypad_excl.h)
* Rumble strong/weak index inverted (dinput_joypad_inl.h)
* port_idx bounds-check after array dereference (dinput_joypad_inl.h
* TCHAR* cast breaks Unicode builds (dinput_joypad_excl.h)
- Fix 1: wasapi_error — thread-safe per-call buffer instead of static
- Fix 2: wasapi_is_format_suitable — remove double negation
- Fix 3: wasapi_init_client_ex — clarify confusing AUDCLNT_E_UNSUPPORTED_FORMAT guard
- Fix 4: wasapi_write_avail — fix unit mismatch (padding is frames, not bytes)
- Fix 5: wasapi_microphone_read — remove dead if (mic->exclusive) branch duplication
- Fix 6: wasapi_free — w->device is never NULLed before free(w), but w->client and w->device are used in cleanup after free in the error path. Audit the ordering in wasapi_free.
- Fix 7: Performance — wasapi_write flag check uses > 0 comparisons on bitmask, simplify to direct mask test throughout
- Fix 8: Performance — wasapi_init flag check > 0 and wasapi_alive
- Fix 9: Performance — wasapi_write_avail exclusive path also has redundant > 0
* string_split / string_split_noalloc — pre-count tokens and pre-allocate the elem array in one shot, eliminating repeated realloc doublings (the biggest win for typical split-heavy workloads).
* string_list_append — grow check happens before strdup, so a failed realloc doesn't waste a malloc+free cycle on the string copy.
* new function string_list_append_n - and remove static function from archive_file
1. config_file_parse_line key parsing — Saves 1 malloc + up to N reallocs per config line
2. config_file_extract_value empty value — Saves 1 byte per empty-value entry.
3. config_file_load_internal deferred alloc — Saves 1 malloc + 1 free for every blank line, empty line, and comment line in a config file.
4. config_file_from_string_internal deferred alloc — Same saving as #3 but for the string-parsing path. Same magnitude.
5. config_file_add_child_list tail — No memory saving, but avoids an O(n) linked-list walk per #include merge by using the already-tracked tail pointer. Also eliminates duplicated readonly-loop code.
6. config_file_write stack setvbuf — Saves 1 calloc(16384) + 1 free per config write. That's 16 KB of heap allocation eliminated on every save, replaced with a stack-local buffer that costs zero allocator overhead.
7. strtol instead of strtod — No memory saving; avoids unnecessary FPU work when parsing integer arrays.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.