Skip to content

Instantly share code, notes, and snippets.

@psyke83
psyke83 / gist:ea5d9b241332b3b4ade75d4def17f140
Created October 28, 2019 20:32
sdl2 modesetting example
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 3fe4dfb..f1d35fb 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -350,6 +350,7 @@ KMSDRM_VideoInit(_THIS)
SDL_bool found;
int ret = 0;
char *devname;
+ const char *mode_override;
SDL_VideoData *vdata = ((SDL_VideoData *)_this->driverdata);
@psyke83
psyke83 / kodi.sh.patch
Created September 15, 2019 15:34
pipplware kodi rpi3 fkms
pi@rpi4:~ $ diff -u /usr/bin/kodi kodi
--- a/usr/bin/kodi 2019-09-15 01:00:18.000000000 +0100
+++ b/usr/bin/kodi 2019-09-15 16:33:44.862844226 +0100
@@ -65,12 +65,20 @@
sleep 1
}
+is_fkms() {
+ if grep -q okay /proc/device-tree/soc/v3d@7ec00000/status 2> /dev/null || grep -q okay /proc/device-tree/soc/firmwarekms@7e600000/status 2> /dev/null ; then
+ return 0
@psyke83
psyke83 / libretro.c.patch
Created July 10, 2019 20:44
lr-mupen64plus-next depth workaround for rpi
diff --git a/libretro/libretro.c b/libretro/libretro.c
index 24f5ed1..9153e77 100644
--- a/libretro/libretro.c
+++ b/libretro/libretro.c
@@ -167,7 +167,7 @@ static void setup_variables(void)
{ CORE_NAME "-rspmode",
"RSP Mode; HLE" },
{ CORE_NAME "-43screensize",
- "4:3 Resolution; 320x240|640x480|960x720|1280x960|1440x1080|1600x1200|1920x1440|2240x1680|2560x1920|2880x2160|3200x2400|3520x2640|3840x2880" },
+ "4:3 Resolution; 368x276|320x240|640x480|960x720|1280x960|1440x1080|1600x1200|1920x1440|2240x1680|2560x1920|2880x2160|3200x2400|3520x2640|3840x2880" },
@psyke83
psyke83 / nativeResFactor-float.patch
Last active July 11, 2019 08:44
nativeResFactor -> float
diff --git a/GLideN64/src/Config.cpp b/GLideN64/src/Config.cpp
index 1282cf7..d870b46 100644
--- a/GLideN64/src/Config.cpp
+++ b/GLideN64/src/Config.cpp
@@ -62,7 +62,7 @@ void Config::resetToDefaults()
frameBufferEmulation.forceDepthBufferClear = 0;
frameBufferEmulation.aspect = a43;
frameBufferEmulation.bufferSwapMode = bsOnVerticalInterrupt;
- frameBufferEmulation.nativeResFactor = 0;
+ frameBufferEmulation.nativeResFactor = 1.15f;
@psyke83
psyke83 / switchfix.bat
Created May 14, 2019 10:35
2200g switchable graphics fix
@echo off
SETLOCAL
SET Integrated_GPU="PCI\VEN_1002&DEV_15DD&SUBSYS_15DD1002&REV_C8"
SET Dedicated_GPU_PCIERoot="@PCI\VEN_1022&DEV_15D3&SUBSYS_14531022&REV_00\3&11583659&0&09"
pushd "%~dp0"
devcon disable %Dedicated_GPU_PCIERoot%
devcon disable %Integrated_GPU%
devcon enable %Integrated_GPU%
@psyke83
psyke83 / gist:68d41bd9112b462a4d348156dc2f038b
Last active December 30, 2017 21:57
github .tar.gz fallback
diff --git a/scriptmodules/helpers.sh b/scriptmodules/helpers.sh
index e916b771..e1e4311c 100644
--- a/scriptmodules/helpers.sh
+++ b/scriptmodules/helpers.sh
@@ -351,6 +351,27 @@ function gitPullOrClone() {
[[ "$branch" != "master" ]] && git+=" --branch $branch"
echo "$git \"$repo\" \"$dir\""
runCmd $git "$repo" "$dir"
+ if [[ "$?" -eq 128 && "$repo" == *github* ]]; then
+ echo "Pull/clone failed - attempting .tar.gz fallback..."
diff --git a/cores/dynamic_dummy.c b/cores/dynamic_dummy.c
index 7e8594793..054f6b515 100644
--- a/cores/dynamic_dummy.c
+++ b/cores/dynamic_dummy.c
@@ -126,7 +126,8 @@ void libretro_dummy_retro_reset(void)
void libretro_dummy_retro_run(void)
{
dummy_input_poll_cb();
- dummy_video_cb(frame_buf, 320, 240, 640);
+ if (frame_buf)
@psyke83
psyke83 / dlnaclientprofiles.xml
Created April 1, 2016 19:18 — forked from rense/dlnaclientprofiles.xml
Samsung SMT-G7400 (UPC Horizon) DLNA client profile for Plex Media Server
<?xml version="1.0" encoding="utf-8"?>
<Clients>
<Client name="UPC Horizon">
<!-- Samsung SMT-G7400, the UPC Horizon -->
<!-- Author: Rense VanderHoek -->
<!-- DLNA Test Certificate: http://certification.dlna.org/certs/REG47816707.pdf -->
<Identification>
<Header name="User-Agent" substring="Linux/2.6.35 UPnP/1.0 NDS_MHF DLNADOC/1.50"/>
<DeviceDescription type="urn:schemas-upnp-org:device:MediaServer:1">
<FriendlyName substring="UPC Horizon"/>
@psyke83
psyke83 / openhardwaremonitor.patch
Created August 9, 2015 02:05
OpenHardwareMonitor - workaround for incorrect 511C temperature sensor reading on ATI M7 R260
--- Hardware/ATI/ATIGPU.cs 2015-08-05 04:31:55.561100679 +0100
+++ Hardware/ATI/ATIGPU.cs 2015-08-05 05:01:28.975189988 +0100
@@ -102,7 +102,7 @@
public override void Update() {
ADLTemperature adlt = new ADLTemperature();
if (ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt)
- == ADL.ADL_OK)
+ == ADL.ADL_OK && adlt.Temperature < 511000)
{
temperature.Value = 0.001f * adlt.Temperature;
@psyke83
psyke83 / restart.sh
Last active January 14, 2017 00:21
openwrt wl-842n ag71xx workaround
#!/bin/sh
trigger="eth1: tx timeout"
if [ "$1" = "force" ]; then
lastbuffer=""
else
lastbuffer=$(dmesg | grep "$trigger" | tail -n1)
fi
while true; do