Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
DEAL WITH IT.

Cameron Kaiser classilla

🕶️
DEAL WITH IT.
View GitHub Profile
@classilla
classilla / no-reg-6502-bf.pl
Last active January 4, 2023 02:07
Minimal Brainf*ck compiler that turns BF into 6502 assembly but is Turing complete without A, X or Y. http://oldvcr.blogspot.com/2023/01/the-mos-6502-is-mostly-turing-complete.html
View no-reg-6502-bf.pl
#!/usr/bin/perl -s
#
# Takes BF, emits 6502 that only clobbers PC, S, and the N and V flags
# Requires an assembler (I recommend xa65)
#
# Cameron Kaiser
# Public domain
# http://oldvcr.blogspot.com/2023/01/the-mos-6502-is-mostly-turing-complete.html
#
View 1758610.diff
diff -r 3a74cc97e160 dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp Fri Apr 01 19:35:34 2022 +0000
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp Thu Apr 07 20:21:34 2022 -0700
@@ -809,17 +809,17 @@
if (!PrepareFrame()) {
NS_WARNING("FFmpeg decoder failed to allocate frame.");
return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
}
# ifdef MOZ_WAYLAND_USE_VAAPI
@classilla
classilla / wordle.s
Last active March 1, 2022 21:20
Sorta-Wordle for the MOS/Commodore KIM-1, in 100% 6502 assembly language. Just 1K! https://oldvcr.blogspot.com/2022/02/kimdle-sorta-wordle-for-kim-1.html
View wordle.s
.word $4200
* = $0200
; kimdle version 3
; guess letters a-f and 0 = o 1 = i 5 = s
; assembles into a KIMplement-compatible binary with xa65
; (C)2022 cameron kaiser
; all rights reserved
@classilla
classilla / gm1356.c
Created December 20, 2021 05:49
Linux code for reading a GM1356 USB-based decibel sound monitor. See https://oldvcr.blogspot.com/2021/12/monitoring-vintage-server-room-and.html
View gm1356.c
/*
(C)2020-1 Cameron Kaiser, ckaiser@floodgap.com
All rights reserved.
Distributed under the Floodgap Free Software License.
Credit to https://github.com/dobra-noc/gm1356/blob/master/PROTOCOL.md for the
original protocol description.
Linux:
@classilla
classilla / thum.c
Created December 20, 2021 05:49
OS X (10.4+) and Linux code for reading a THUM USB-based temperature/humidity monitor. See https://oldvcr.blogspot.com/2021/12/monitoring-vintage-server-room-and.html
View thum.c
/*
(C)2020-1 Cameron Kaiser, ckaiser@floodgap.com
All rights reserved.
Distributed under the Floodgap Free Software License.
Linux:
gcc -o thum thum.c -lhid -lusb
Mac OS X:
gcc -o thum thum.c -framework CoreFoundation -framework IOKit
@classilla
classilla / inetb.c
Created February 15, 2021 05:06
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 December 13, 2020 23:03
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 December 13, 2020 23:02
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 February 25, 2023 02:57
PGO fixes and livability improvements for LTO in Firefox on ppc64le Linux. Read web page first! -- https://www.talospace.com/2023/02/firefox-110-on-power.html
View firefox-pgo.diff
diff -r b22cb12f611c build/moz.configure/lto-pgo.configure
--- a/build/moz.configure/lto-pgo.configure Thu Oct 07 08:11:19 2021 +0000
+++ b/build/moz.configure/lto-pgo.configure Sun Oct 10 20:36:46 2021 -0700
@@ -81,17 +81,17 @@
@depends(c_compiler, pgo_profile_path, target_is_windows)
@imports("multiprocessing")
def pgo_flags(compiler, profdata, target_is_windows):
if compiler.type == "gcc":
return namespace(
@classilla
classilla / gzdoomdisplay.diff
Created October 5, 2020 04:25
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;