Skip to content

Instantly share code, notes, and snippets.

View joyrider3774's full-sized avatar

Willems Davy joyrider3774

View GitHub Profile
@joyrider3774
joyrider3774 / Playdate_DrawText_patterns
Last active August 17, 2023 16:05
Playdate DrawText using patterns
void drawTextColor(LCDBitmap* BitmapContext, LCDFont *font, const void* text, size_t len, PDStringEncoding encoding, int x, int y, LCDColor color, bool inverted)
{
//grab width & height of our to be rendered text
pd->graphics->pushContext(BitmapContext);
int h = pd->graphics->getFontHeight(font);
pd->graphics->setFont(font);
int w = pd->graphics->getTextWidth(font, text, len, encoding, 0);
//create new bitmap and fillrect with our color / pattern
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
RunWait, TaskKill.exe /F /IM EpicGamesLauncher.exe
Run, "com.epicgames.launcher://apps/56a31432931740cdb0112d237d7d65aa?action=launch&silent=true"
Process, Wait, PinballFX-Win64-Shipping.exe
Process, WaitClose, PinballFX-Win64-Shipping.exe
RunWait, TaskKill.exe /F /IM EpicGamesLauncher.exe
#SingleInstance Ignore
;get xinput.ahk from https://www.autohotkey.com/board/topic/35848-xinput-xbox-360-controller-api/
#include xinput.ahk
XInput_Init()
Loop {
Loop, 4 {
if State := XInput_GetState(A_Index-1) {
BACK := State.wButtons & XINPUT_GAMEPAD_BACK
$repourl = "https://arduboy.ried.cl/repo.json"
$romsdir = "./arduboy/roms"
$mediadir = "./arduboy/screenshots"
#emulation station destkop editon gamelist
$gameslist = "./arduboy/gamelist.xml"
if (!(Test-Path -Path $romsdir))
{
New-Item -ItemType Directory $romsdir
}
$repourl = "https://arduboy.ried.cl/repo.json"
$romsdir = "./arduboy/roms"
$mediadir = "./arduboy/screenshots"
#emulation station destkop editon gamelist
$gameslist = "./arduboy/gamelist.xml"
if (!(Test-Path -Path $romsdir))
{
New-Item -ItemType Directory $romsdir
}
@joyrider3774
joyrider3774 / QuitActiveWindow.ahk
Created October 7, 2021 02:32
XBox Controller autohotkey script to close or activate the active window (handy with games)
#SingleInstance Ignore
while (true)
{
;back + start -> quit active window
if ((getKeyState("joy7") && getKeyState("Joy8")) || (getKeyState("2joy7") && getKeyState("2Joy8")) || (getKeyState("3joy7") && getKeyState("3Joy8")))
{
WinClose A
sleep 900
}
;back + right stick click -> send esc