Skip to content

Instantly share code, notes, and snippets.

View Altazimuth's full-sized avatar

Max Waine (Nightdive Studios) Altazimuth

View GitHub Profile
@Altazimuth
Altazimuth / pws.cpp
Created August 9, 2020 19:15
SSEE pws.cpp
//
// System Shock Enhanced Edition
//
// Copyright (C) 2015-2018 Night Dive Studios, LLC.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
@Altazimuth
Altazimuth / as_callfunc_arm64_msvc.asm
Created July 19, 2020 17:16
arm64Func(const asQWORD *args, int paramSize, asFUNCTION_t func)
ALIGN 8
arm64Func PROC
stp fp, lr, [sp,#-0x30]!
mov fp, sp
str x19, [sp,#0x18] ; arg table
str w20, [sp,#0x10] ; arg size (in bytes)
str x21, [sp,#0x20] ; function address
mov w22, #0
; If 0 args jump to end. If >=8 we can skip dynamic jump
@Altazimuth
Altazimuth / EEPostBuildEvent.bat
Created January 13, 2020 16:38
Eternity Engine Post-build Event Batch Script
rem Grab SDL2/mixer/net DLLs
copy /Y "$(SDL2_0)\lib\$(PlatformTarget)\SDL2.dll" "$(OutDir)SDL2.dll"
copy /Y "$(SDLNET2_0)\lib\$(PlatformTarget)\SDL2_net.dll" "$(OutDir)SDL2_net.dll"
if not %25ERRORLEVEL%25 == 0 (
echo "Copying of the SDL2 or SDL2-net DLL failed."
exit 1
)
robocopy "$(SDLMIXER2_0)\lib\$(PlatformTarget)" "$(OutDir)." *.dll /xo /it
if %25ERRORLEVEL%25 gtr 8 (
echo "Copy of SDL2-mixer DLLs failed."

Keybase proof

I hereby claim:

  • I am altazimuth on github.
  • I am altazimuth (https://keybase.io/altazimuth) on keybase.
  • I have a public key ASAf0yXk2ynw6V_KDetupK6OwAtabJqPZjt0HK4ooTtkDgo

To claim this, I am signing this object:

@Altazimuth
Altazimuth / Power
Last active December 23, 2015 18:39
long int pow(long int num, long int exp)
if(exp)
return num * pow(num, exp-1);
else
return 1;
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(int argc, char **argv)
{
int currno, curroct, ip, octet;
char *ipstr;
argv++;
*ipstr = *argv;
@Altazimuth
Altazimuth / gist:6325495
Last active December 21, 2015 15:19
Bork
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(int argc, char **argv)
{
argv++;
int currno, curroct, ip, octet;
for(curroct = 0; curroct < 4; curroct++){
for(currno = 0; currno < 2 || **argv != '.' || currno > strlen(*argv); currno++, *argv++){
octet += atoi(**argv) * pow(10, (2 - currno));