Skip to content

Instantly share code, notes, and snippets.

@JohnnyonFlame
JohnnyonFlame / stpw_ptbr.txt
Created March 9, 2021 02:00
Comma separated Portuguese Stopwords (Vírgula)
de, a, o, que, e, do, da, em, um, para, é, com, não, uma, os, no, se, na, por, mais, as, dos, como, mas, foi, ao, ele, das, tem, à, seu, sua, ou, ser, quando, muito, há, nos, já, está, eu, também, só, pelo, pela, até, isso, ela, entre, era, depois, sem, mesmo, aos, ter, seus, quem, nas, me, esse, eles, estão, você, tinha, foram, essa, num, nem, suas, meu, às, minha, têm, numa, pelos, elas, havia, seja, qual, será, nós, tenho, lhe, deles, essas, esses, pelas, este, fosse, dele, tu, te, vocês, vos, lhes, meus, minhas, teu, tua, teus, tuas, nosso, nossa, nossos, nossas, dela, delas, esta, estes, estas, aquele, aquela, aqueles, aquelas, isto, aquilo, estou, está, estamos, estão, estive, esteve, estivemos, estiveram, estava, estávamos, estavam, estivera, estivéramos, esteja, estejamos, estejam, estivesse, estivéssemos, estivessem, estiver, estivermos, estiverem, hei, há, havemos, hão, houve, houvemos, houveram, houvera, houvéramos, haja, hajamos, hajam, houvesse, houvéssemos, houvessem, houver, houvermos, houverem
@JohnnyonFlame
JohnnyonFlame / armhf.cmake
Created February 17, 2021 20:00
CMAKE Toolchain file for arm
# **********************************************************
# Copyright (c) 2014-2017 Google, Inc. All rights reserved.
# **********************************************************
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
@JohnnyonFlame
JohnnyonFlame / c5480aa622a2f5-gbm-stopgap.diff
Created January 19, 2021 18:20
A RenderDoc stopgap for the lack of X11 and Wayland on ArkOS
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ee30d4cb..ae9412bd0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,6 +178,7 @@ option(ENABLE_RENDERDOCCMD "Enable renderdoccmd" ON)
option(ENABLE_QRENDERDOC "Enable qrenderdoc" ON)
option(ENABLE_PYRENDERDOC "Enable renderdoc python modules" ON)
+option(ENABLE_GBM "Enable GBM context support" ON)
option(ENABLE_XLIB "Enable xlib windowing support" ON)
@JohnnyonFlame
JohnnyonFlame / ArkOS-cross-environment-hacks.md
Last active March 10, 2021 16:14
DON'T RUN THIS ON YOUR MAIN INSTALL - USE ISOLATED INSTANCES LIKE A CHROOT OR WSL INSTALL

This is a draft - no warranty, implied or otherwise. follow at your own risk.

Please, don't pull this off outside of an isolated chroot or wsl instance!
This is *guaranteed* to _wreck major havok_ on your install.
This assumes you're using WSL, adjust where necessary.
The state of Multi-Arch is terrible, I miss buildroot already.
Honestly, don't use this. Check out https://forum.odroid.com/viewtopic.php?p=306185#p306185

Download:

Ubuntu Eoan wsl rootfs

@JohnnyonFlame
JohnnyonFlame / ez64_od_builder.ipynb
Created October 24, 2020 20:56
Build Super Mario 64 easily
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JohnnyonFlame
JohnnyonFlame / shadertoy.glsl
Created October 18, 2020 02:22
[GLSL]: Hiding discontinuities in fract-repeated texture atlas mapped surfaces.
vec2 warpUV(vec2 uv) {
float a = iTime * 0.03;
uv *= mat2x2(cos(a),sin(a),-sin(a),cos(a));
uv = uv*(6. + 150.*pow(iMouse.x/iResolution.x,5.)) + iTime * 0.03;
uv = vec2(0.12, 0.12) * fract(uv) + vec2(0.1, 0.1);
return uv;
}
vec2 noWarpUV(vec2 uv) {
float a = iTime * 0.03;
@JohnnyonFlame
JohnnyonFlame / floatpack.c
Last active October 15, 2020 09:35
Pack int22 and int6 into the mantissa and exponent of a float
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#define BIAS 127
typedef union {
float f;
struct
{
unsigned int m: 23;
@JohnnyonFlame
JohnnyonFlame / n1_exp__nx__.cpp
Last active July 17, 2020 15:43
Integer taylor series approximation of 1-exp(-x)
static uint32_t angle = 0; // Final aiming angle
static int accel_frames = 0; // Number of frames with a direction pressed
static const int fract = 8; // Fixed point fractional part
static const int accel_ramp_frames = 24; // Number of frames to max acceleration
static const int accel_factor = 24; // Acceleration factor at maximum accel
static const int base_speed = 3 << fract; // Minimum aiming speed
// Determine number of acceleration frames to apply.
accel_frames = std::min(accel_frames, accel_ramp_frames);
@JohnnyonFlame
JohnnyonFlame / use_rec601.diff
Last active July 11, 2020 14:08
KMSDRM: REC601 color space
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index e384b19f..c752e9de 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -823,8 +823,16 @@ static void KMSDRM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
// Do nothing.
}
+#define F_TO_U16_16(val) ((Uint32)(val * (float)(1<<16)))
+static const Uint32 ymat[3][3] = {
@JohnnyonFlame
JohnnyonFlame / testsprite_tripleswizzle.c
Created July 1, 2020 12:01
An extension to SDL's "src/testsprite.c" to check SDL_TRIPLEBUF and SDL_SWIZZLEBGR support.
/* Simple program: Move N sprites around on the screen as fast as possible */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include "SDL.h"