Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
DEAL WITH IT.

Cameron Kaiser classilla

🕶️
DEAL WITH IT.
View GitHub Profile
@classilla
classilla / inetb.c
Created Feb 15, 2021
inetb: a single-process multithreaded inetd for pre-BONE BeOS R5
View inetb.c
/* inetb: a single-process multithreaded inetd for pre-BONE BeOS R5
** Intel and PowerPC compatible
** MAKE BEBOXES GREAT AGAIN
**
** with Metrowerks:
** cc -O7 -o inetb inetb.c
** (debugging to stderr: cc -DDEBUG -o inetb inetb.c )
** (debugging to socket: cc -DSDEBUG -o inetb inetb.c )
** (you can do -DDEBUG -DSDEBUG together! it's fun!)
**
@classilla
classilla / d3d.s
Created Dec 13, 2020
Full anaglyph sprite demo for the C64 (assemble with xa65, LOAD and RUN). https://oldvcr.blogspot.com/2020/12/stereoscopic-computing-anaglyph-sprites.html
View d3d.s
; anaglyph sprite demo for the c64
; cameron kaiser 2020
; public domain
SPRITE = $0340
VALUE = $14
HVALUE = $fe
MODE = $15
.word $0801
@classilla
classilla / 3dspr.s
Created Dec 13, 2020
6502 assembly to take a value and create an interlaced square sprite of that size (assemble with xa65). https://oldvcr.blogspot.com/2020/12/stereoscopic-computing-anaglyph-sprites.html
View 3dspr.s
; given 0-21, create a sprite sized x by x, skipping every other line
; cameron kaiser 2020
; public domain
SA = $c000
SPRITE = $0340
* = SA
.word SA
@classilla
classilla / firefox-pgo.diff
Last active Feb 25, 2021
PGO fixes and livability improvements for LTO in Firefox on ppc64le Linux. Read web page first! -- https://www.talospace.com/2021/02/firefox-86-on-power-goes-pgo.html
View firefox-pgo.diff
diff -r f9301631e9e1 build/moz.configure/lto-pgo.configure
--- a/build/moz.configure/lto-pgo.configure Tue Feb 23 13:23:16 2021 +0000
+++ b/build/moz.configure/lto-pgo.configure Tue Feb 23 21:07:53 2021 -0800
@@ -82,17 +82,17 @@
@depends(c_compiler, pgo_profile_path, target_is_windows)
@imports("multiprocessing")
@imports(_from="__builtin__", _import="min")
def pgo_flags(compiler, profdata, target_is_windows):
if compiler.type == "gcc":
return namespace(
@classilla
classilla / gzdoomdisplay.diff
Created Oct 5, 2020
A tweak to always force GZDoom onto a secondary display (useful for 3D monitors). See https://oldvcr.blogspot.com/2020/10/stereoscopic-computing-converting-quake.html
View gzdoomdisplay.diff
--- sdlglvideo.cpp.OLD 2020-10-04 21:23:32.751041920 -0700
+++ sdlglvideo.cpp 2020-10-04 20:54:21.740470397 -0700
@@ -163,18 +163,19 @@
win_h = bounds.h * 8 / 10;
}
FString caption;
caption.Format(GAMENAME " %s (%s)", GetVersionString(), GetGitTime());
const uint32_t windowFlags = (win_maximized ? SDL_WINDOW_MAXIMIZED : 0) | SDL_WINDOW_RESIZABLE | extraFlags;
@classilla
classilla / quakespasm3d.diff
Created Oct 5, 2020
Convert Quakespasm to use interlaced R-L video for passive 3D monitors. See https://oldvcr.blogspot.com/2020/10/stereoscopic-computing-converting-quake.html
View quakespasm3d.diff
--- gl_rmain.c.OLD 2020-08-02 16:35:29.798497930 -0700
+++ gl_rmain.c 2020-10-03 23:32:00.309704966 -0700
@@ -77,16 +77,17 @@
cvar_t gl_affinemodels = {"gl_affinemodels","0",CVAR_NONE};
cvar_t gl_polyblend = {"gl_polyblend","1",CVAR_NONE};
cvar_t gl_flashblend = {"gl_flashblend","0",CVAR_ARCHIVE};
cvar_t gl_playermip = {"gl_playermip","0",CVAR_NONE};
cvar_t gl_nocolors = {"gl_nocolors","0",CVAR_NONE};
//johnfitz -- new cvars
@classilla
classilla / pnorex.pl
Created Jun 22, 2020
Perl script to extract partitions from OpenPOWER PNOR firmware images.
View pnorex.pl
#!/usr/bin/perl -s
# v1.0 by Cameron Kaiser, talospace@floodgap.com
# Public domain
# By default extract Skiboot and Petitboot.
# Say -parts=DIFFERENT,PARTS to extract, you know, different parts.
# We do not support obtaining the 'part' partition yet (you can just do
# that by truncating the rest of the file anyway).
# Specifying a part multiple times is considered undefined behaviour.
@classilla
classilla / qemu-pnv-kvm.diff
Created Jun 22, 2020
A desperate attempt to get PowerNV KVM acceleration working. See if you can triumph where I have failed.
View qemu-pnv-kvm.diff
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index c9cb6fa3..c1f43310 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -23,16 +23,17 @@
#include "qapi/error.h"
#include "sysemu/sysemu.h"
#include "sysemu/numa.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
@classilla
classilla / ipmifans.sh
Created Feb 10, 2020
BitBar and Argos-compatible shell script for getting system fan information over IPMI.
View ipmifans.sh
#!/usr/bin/env bash
IPMITOOL=/usr/bin/ipmitool
AWK=/usr/bin/awk
output=`$IPMITOOL sdr type fan | $AWK '{if($5=="ok")print $9}'`
echo -n $output | $AWK 'BEGIN{RS=" ";k=0} {if($1>k)k=$1} END{print k"rpm"}'
echo "---"
echo -n $output | $AWK 'BEGIN{RS=" ";ORS="rpm\n"} {if($1>0)print}'
@classilla
classilla / ppc64le_dosbox.diff
Created Jan 7, 2020
DOSBox for ppc64le. Place risc_ppc64le.h in src/cpu/core_dynrec and apply the diff. ./autogen.sh ; ./configure CFLAGS="-O3 -mcpu=power9" CXXFLAGS="-O3 -mcpu=power9" ; make -j24
View ppc64le_dosbox.diff
Index: configure.ac
===================================================================
--- configure.ac (revision 4296)
+++ configure.ac (working copy)
@@ -292,9 +292,16 @@
c_targetcpu="x86"
c_unalignedmemory=yes
;;
+ powerpc64le*)
+ AC_DEFINE(C_TARGETCPU,PPC64LE)