Skip to content

Instantly share code, notes, and snippets.

View Swyter's full-sized avatar
💭
¯\_(ツ)_/¯

Swyter Swyter

💭
¯\_(ツ)_/¯
View GitHub Profile
$ nm Sphinx.elf | grep @@GLIBC_ | sort -t@ -k3,3
U abort@@GLIBC_2.0
U abs@@GLIBC_2.0
U acosf@@GLIBC_2.0
U asinf@@GLIBC_2.0
U __assert_fail@@GLIBC_2.0
U atan2f@@GLIBC_2.0
U atanf@@GLIBC_2.0
U atol@@GLIBC_2.0
U chdir@@GLIBC_2.0
@Swyter
Swyter / CSHandler_gamescript.cc
Created April 3, 2018 01:40
Sphinx and the Cursed Mummy | Anubis state progression logic
int gButton
//*===============================================================================================
//* WaitSay - Used in OnContext to wait until the current message has be dismissed by the user
//*===============================================================================================
defproc WaitSay
int Said
Said = 0
while Said = 0
@Swyter
Swyter / gist:509e4a5bcc2743c63951a02a04cc01f0
Last active March 28, 2018 15:32
NGS Phantom SDL2 gamepad mappings
03000000790000000600000010010000,NGS Phantom---LNX,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Linux,
03000000790000000600000007010000,NGS Phantom---MAC,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
03000000790000000600000000000000,NGS Phantom---WIN,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
@Swyter
Swyter / CMakeLists.txt
Last active March 4, 2018 05:21
OpenAL Soft macOS CMakeLists.txt toolchain changes for minimum 10.6/i386+x86_64 universal binary compatibility
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Minimum OS X deployment version") # <- add this
set(CMAKE_OSX_ARCHITECTURES i386 x86_64 CACHE STRING "Minimum") # <- and this
PROJECT(OpenAL)
...
option(ALSOFT_EMBED_HRTF_DATA "Embed the HRTF data files (increases library footprint)" ON) # <- disabled by default
//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
// File: XLS Shared String Table pseudo-parser
// Authors: Swyter
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
@Swyter
Swyter / base_address_concept.c
Created July 8, 2017 16:52
Find if the calling function is from the main executable in Linux.
#include <stdlib.h>
#include <stdio.h>
#include <link.h>
extern char _init, _end;
size_t base_addr, base_end, reloc;
void test()
@Swyter
Swyter / gist:8d2e161958db9a4494c284d5a4d676cb
Last active June 4, 2017 23:08
Fix the «Error: repository has at least one unnamed head» issue with the Hg to Git converter by removing the previous merge with two parents and using a recreated repository by joining two different trees with no common history linearly.
Lifesaver answer from a knowledgeable Hg master:
https://stackoverflow.com/questions/19215571/add-a-parent-to-the-original-changeset-in-mercurial
We have:
A---B---C---D---E---F
X---Y---Z
We want:
@Swyter
Swyter / gist:09b7090590efe4cab3ff66cafd526f15
Last active August 26, 2022 12:58
NGS Phantom gamepad / PC TWIN SHOCK / Dragonrise / Generic Chinese chipset -- USB force feedback protocol
// IRP information: 0x00, Direction: FDO -> PDO
// URB bus id: 3
// Device address: 1
// Endpoint: 0x01, Direction: OUT
// URB transfer type: URB_INTERRUPT (0x01)
// Packet Data Length: 7
7-byte interrupt messages:
Leftover Capture Data: 51000000b60000
# S T A R W A R S C O N Q U E S T M O D U L E S Y S T E M
# / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
# By Taleworlds, HokieBT, MartinF and Swyter - Do not use/copy without permission
from header_common import *
from header_presentations import *
from header_mission_templates import *
from ID_meshes import *
from header_operations import *
from header_triggers import *
[quote author=Khamukkamu link=action=profile;u=178899 date=1487510167]
Thanks for your reply. Yea, i'm afraid of touching AI cause it can do so much harm.
I have another unrelated question, it is more of a 'programming' type of question, cause i really feel like this could be done better/more elegantly:
Goal: Don't let the scout camp spawn on water, mountains, river.
[spoiler][code]
(assign, ":terrain_check", 0), # Check if spawned camp is not in weird terrain
(try_for_range, ":iterate", 0, 10),