Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
pro grammin'

Josh K Slipyx

💭
pro grammin'
View GitHub Profile
@Slipyx
Slipyx / oggplay.c
Last active Mar 18, 2021
Playing OGG music using stb_vorbis and OpenAL, with real-time control using ncurses. Based on code from: https://gist.github.com/Oddity0x0/965399
View oggplay.c
#include <AL/al.h>
#include <AL/alc.h>
#include <stdbool.h>
#include <stdio.h>
#include <time.h>
//#include <unistd.h>
#define STB_VORBIS_NO_PUSHDATA_API
#include "stb_vorbis.c"
@Slipyx
Slipyx / redshirt2.py
Created Sep 23, 2018
Python script for redshirt2 file encryption & decryption
View redshirt2.py
#!/usr/bin/python3 -tt
# redshirt2 file encryption & decryption
# reads and writes file contents from/to stdin & stdout
# algorithm adapted from dx9's php implementation.
# http://forums.introversion.co.uk/viewtopic.php?f=29&t=13803&start=60#p485984
#
# usage: ./redshirt2.py < infile > outfile
import sys
@Slipyx
Slipyx / Moved.md
Last active Mar 6, 2017
IRC bot development in Haxe
View Moved.md
@Slipyx
Slipyx / autoexec.cfg
Last active Mar 14, 2021
q2pro autoexec
View autoexec.cfg
seta vid_modelist "desktop 640x480@60 1024x768@60 1280x720@60"
seta vid_fullscreen "0"
seta vid_geometry "1280x720+80+0" //-2+128"
seta gl_shaders "1"
seta cl_adjustfov "1"
seta gl_dynamic "1"
seta gl_dlight_falloff "1"
seta cl_maxfps "60"
seta r_maxfps "0"
@Slipyx
Slipyx / mdchek.c
Last active Nov 18, 2020
A Sega Genesis/Megadrive ROM checksum validator.
View mdchek.c
/*
** A Sega Genesis/Megadrive ROM checksum validator.
** Reads existing checksum and then calculates the valid one.
** Attempts to fix if existing was not valid.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
@Slipyx
Slipyx / redshirt2.nut
Last active Mar 6, 2017
redshirt2 file decryption/encryption
View redshirt2.nut
// redshirt2 file decryption/encryption... in squirrel!
// reads and writes file contents using stdin/stdout.
// algorithm adapted from dx9's php implementation.
// http://forums.introversion.co.uk/viewtopic.php?f=29&t=13803&start=60#p485984
//
// usage: sq redshirt2.nut < infile.txt > outfile.txt
// the key to use for both decrypting and encrypting
// can be a byte array of any size
local thekey = [
@Slipyx
Slipyx / pad.c
Last active Aug 17, 2016
PS1 Psy-Q SDK LIBPAD example code for controller input. No analog or actuator use yet.
View pad.c
// Must manually link to LIBPAD.LIB for compiling
#include <LIBPAD.H>
// Pad terminal type masks. First four bits of padData[1]
#define PADTT_DIG 0x40 // 16 button controller (no analog)
#define PADTT_ANA 0x70 // Analog controller
// All 16 16bit button bit masks. Button state bit is 0 if pressed.
#define PADLeft 0x8000
#define PADDown 0x4000
@Slipyx
Slipyx / mtarcok.h
Last active Aug 29, 2015
MT19937 with improved initialization, optimization, and simplification.
View mtarcok.h
/*
MT19937 with initialization improved 2002/2/10.
Coded by Takuji Nishimura and Makoto Matsumoto.
Faster version using Shawn Cokus's optimization and
Matthe Bellew's simplification.
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
@Slipyx
Slipyx / slumod.c
Created Jun 7, 2014
Simple utility to extract all files from an Unreal umod file.
View slumod.c
// slumod
// simple utility to extract all files from an Unreal umod file
// only tested with UT99 umods
// reference: http://wiki.beyondunreal.com/Legacy:UMOD/File_Format
// doesn't preserve directories. extracts to same dir as executable
// umod file needs to be renamed to pack.umod and placed in same dir
// public domain
#include <stdio.h>
#include <stdlib.h>
@Slipyx
Slipyx / Sprite.cs
Created Feb 24, 2013
Simple sprite class for monogame/xna
View Sprite.cs
// ============================================================================
// Sprite.cs
//
// A XNA class that resembles a sprite. Has properties such as position, scale,
// and rotation that can be set. Calling Sprite.Draw( SpriteBatch ) will then
// call SpriteBatch.Draw and pass in each of the Sprites properties. Also
// contains helper methods like Move and Scale that will change the Sprite's
// properties using a delta that gets added to the previous property's value.
// ============================================================================