Skip to content

Instantly share code, notes, and snippets.

View Langerz82's full-sized avatar

Joshua L Langerz82

View GitHub Profile
@Langerz82
Langerz82 / advmame.sh
Created September 17, 2022 05:13
EmuELEC - advmame.sh - Test for vertical sync fixes
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)
. /etc/profile
CONFIG_DIR="/emuelec/configs/advmame"
export DISPLAY=:0
@Langerz82
Langerz82 / setres.sh
Created September 15, 2022 18:54
setres - latest
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2022-present Joshua L (https://github.com/Langerz82)
# Read the video output mode and set it for emuelec to avoid video flicking.
# This file sets the hdmi output and frame buffer to the argument in pixel width.
@Langerz82
Langerz82 / isValidPath.js
Last active July 26, 2022 02:19
JavaScript - Node function - isValidPath: Checks a two-dimensional array ex: [[x1,y1],[x2,y2]] for validity against a collision map.
// TODO - Grid axis is not being checked properly.
isValidPath: function (grid, path) {
// Check collision from an axis, n1 to n2, n3 is for the other axis.
var c1to2on3 = function (n1,n2,n3,axis) {
log.info("c1to2on3 - n1:"+n1+",n2:"+n2+",n3:"+n3);
var isDec = (n3 % 1 == 0);
var n1f = Math.floor(n1), n2c = Math.ceil(n2);
var i1 = Math.min(n1f,n2c), i2 = Math.max(n1f,n2c);
if (n1f != n2c) {
var n3f=Math.floor(n3), n3c=Math.ceil(n3);
@Langerz82
Langerz82 / findEasyPath.js
Last active July 25, 2022 23:27
findEasyPath - Tries to see if Manhatten Distance paths have no collision.
// Tries to see if Manhatten Distance paths have no collision.
// @param grid - A two-dimensional array containing the y-axis and x-axis in that order.
// @param start - A single array of the start coordinate start[0]=x, start[1]=y.
// @param start - A single array of the end coordinate end[0]=x, end[1]=y.
//
var findEasyPath = function (grid, start, end) {
var ts = G_TILESIZE; // 16 units in each grid coordinate.
var sx, sy, ex, ey;
@Langerz82
Langerz82 / setres.sh
Last active September 24, 2022 09:32
EmuELEC - Set resolution file.
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2022-present Joshua L (https://github.com/Langerz82)
# Read the video output mode and set it for emuelec to avoid video flicking.
# This file sets the hdmi output and frame buffer to the argument in pixel width.
# Allowed argument example ./setres.sh 1080p60hz <-- For height 1080 pixels.
@Langerz82
Langerz82 / setres.sh
Last active April 23, 2022 23:51
setres.sh with fbfix.
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)
# Read the video output mode and set it for emuelec to avoid video flicking.
# This file sets the hdmi output and frame buffer to the argument in pixel width.
# Allowed argument example ./setres.sh 1080p60hz <-- For height 1080 pixels.
@Langerz82
Langerz82 / Dolphin.ini
Created February 14, 2022 07:04
EmuELEC - Flycast emulation config file, Dolphin emulation config files. Flycast (/storage/.config/flycast/emu.cfg) , Dolphin (/storage/.config/emuelec/configs/dolphin-emu/Dolphin.ini, and /storage/.config/emuelec/configs/dolphin-emu/GFX.ini)
[DSP]
DSPThread = True
Backend = ALSA
[General]
ShowLag = False
ShowFrameCount = False
ISOPaths = 0
WirelessMac =
GDBSocket =
GDBPort = -1
check_guid() {
JSI="$1"
DEVICE_GUID="$2"
#echo "DEVICE_GUID=$DEVICE_GUID"
#v=${DEVICE_GUID:0:8}
#part1=$(echo ${v:6:2}${v:4:2}${v:2:2}${v:0:2}) # Bus, generally not needed
v=${DEVICE_GUID:8:8}
part2=$(echo ${v:6:2}${v:4:2}${v:2:2}${v:0:2}) # Vendor
v=${DEVICE_GUID:16:8}
@Langerz82
Langerz82 / ee_advmame_joycfg.diff
Last active January 13, 2022 06:41
EmuELEC - Advmame - Jostick Button Config
diff --git a/packages/sx05re/emuelec/bin/set_advmame_joy.sh b/packages/sx05re/emuelec/bin/set_advmame_joy.sh
index 7fa5e23965..10521f7785 100755
--- a/packages/sx05re/emuelec/bin/set_advmame_joy.sh
+++ b/packages/sx05re/emuelec/bin/set_advmame_joy.sh
@@ -14,6 +14,7 @@ PAD_FOUND=0
EE_DEV="js0"
GPFILE=""
GAMEPAD=""
+ROMNAME="$1"
@Langerz82
Langerz82 / newworld_templuck.js
Last active December 16, 2021 17:25
New World - Temp Luck System - Psuedocode (Javascript).
var baseTempLuck = 50;
var maxTempLuck = 100;
var TempLuckPerLevel = 5;
var eliteTempLuckMod = 2;
Number.prototype.clamp = function(min, max) {
return Math.min(Math.max(this, min), max);
};