Skip to content

Instantly share code, notes, and snippets.

🕶
DEAL WITH IT.

Cameron Kaiser classilla

View GitHub Profile
@classilla
classilla / mame_gcc_workaround.diff
Created Dec 20, 2018
A workaround to allow compilation of recent versions of MAME with gcc on PowerPC, including ppc64 and ppc64le.
View mame_gcc_workaround.diff
diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h
index e0031ec2c38..5cb5f65e3ad 100644
--- a/3rdparty/bx/include/bx/platform.h
+++ b/3rdparty/bx/include/bx/platform.h
@@ -133,8 +133,14 @@
#endif //
#if BX_CPU_PPC
-# undef BX_CPU_ENDIAN_BIG
-# define BX_CPU_ENDIAN_BIG 1
@classilla
classilla / org.gnome.chrome_gnome_shell.json
Last active Dec 9, 2018
JSON native messaging descriptor for GNOME Shell Integration 3.30+ in Firefox (tested on Fedora 29/Firefox 63). Place in ~/.mozilla/native-messaging-hosts .
View org.gnome.chrome_gnome_shell.json
{
"name": "org.gnome.chrome_gnome_shell",
"description": "Native connector for extensions.gnome.org",
"path": "/usr/bin/chrome-gnome-shell",
"type": "stdio",
"allowed_extensions": [ "chrome-gnome-shell@gnome.org" ]
}
@classilla
classilla / hqemu-ppc-build.diff
Created Nov 18, 2018
Fix for hqemu-2.5.2 to build full system emulation on ppc64le.
View hqemu-ppc-build.diff
--- a/tcg/ppc/tcg.target.c 2018-11-17 14:51:38.523121046 -0800
+++ b/tcg/ppc/tcg-target.c 2018-11-17 17:00:01.991427542 -0800
@@ -1372,16 +1372,37 @@
[MO_LEUW] = helper_le_stw_mmu,
[MO_LEUL] = helper_le_stl_mmu,
[MO_LEQ] = helper_le_stq_mmu,
[MO_BEUW] = helper_be_stw_mmu,
[MO_BEUL] = helper_be_stl_mmu,
[MO_BEQ] = helper_be_stq_mmu,
};
@classilla
classilla / digits_of_pi.dc
Created Nov 18, 2018
Compute 50 digits of pi using the venerable old dc utility.
View digits_of_pi.dc
[K 1+k 0 1 1lxlx*+v--lx/sxlf 2*sflx .5<=]s=
[K 1+k 0 1 1lxlx*+v--lx/sxlf 2*sflx 0 .5->>]s>
[ltklxlc*ld/Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts. 3Q]s@
[lbls*sblcla*ldlb*+scldla*sdlcld/sglgle=@ lgsela 2+dsas. 1 1=?]s?
[0St0Ss0Sg0Sf0Se0Sd0Sc0Sb0SaSxlx 0=< Kst 1sflx .5<= lx 0 .5->> 0lx-lx*sslfsblfsc 1sd 1se 3dsas. 1 1=? Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts.0 1Q]sQ
50k
4 1lQx*ps.
@classilla
classilla / kvmppc_osx_base_patches.diff
Created Aug 25, 2018
Base patches for KVMPPC under kernel 4.17.x and earlier to enable OS X on POWER9.
View kvmppc_osx_base_patches.diff
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 97d4a112..2267e9b4 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -74,18 +74,21 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ "pthru_bad_aff", VCPU_STAT(pthru_bad_aff) },
{ NULL }
};
void kvmppc_unfixup_split_real(struct kvm_vcpu *vcpu)
@classilla
classilla / kvmppc_osx_bzero32_patcher.diff
Created Aug 25, 2018
Patch to apply to KVM-PR PPC sources for improved Mac OS X performance on machines with emulated dcbz.
View kvmppc_osx_bzero32_patcher.diff
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index ca160395..8f4ba2bc 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -23,16 +23,17 @@
#include <linux/export.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <asm/reg.h>
@classilla
classilla / doubletime.m
Created Jul 28, 2018
A variation of `doubledate.m` with synchronized time pickers and examples of limiting the time interval in a modal dialogue using undocumented methods in Mac OS X Tiger.
View doubletime.m
#import <Cocoa/Cocoa.h>
// (C)2018 Cameron Kaiser. BSD license.
// gcc -o doubletime doubletime.m -framework Cocoa
// 10.4 does not have an accessory view method for NSAlert, but we can
// simulate it with these undocumented methods.
@interface NSAlert(WithCustomStyle)
- (void)prepare;
- (id)buildAlertStyle:(int)fp8 title:(id)fp12 formattedMsg:(id)fp16 first:(id)fp20 second:(id)fp24 third:(id)fp28 oldStyle:(BOOL)fp32;
@classilla
classilla / doubledate.m
Created Jul 28, 2018
An expansion of `datepanel.m` that displays synchronized date pickers in a modal dialogue using undocumented methods in Mac OS X Tiger.
View doubledate.m
#import <Cocoa/Cocoa.h>
// (C)2018 Cameron Kaiser. BSD license.
// gcc -o doubledate doubledate.m -framework Cocoa
// 10.4 does not have an accessory view method for NSAlert, but we can
// simulate it with these undocumented methods.
@interface NSAlert(WithCustomStyle)
- (void)prepare;
- (id)buildAlertStyle:(int)fp8 title:(id)fp12 formattedMsg:(id)fp16 first:(id)fp20 second:(id)fp24 third:(id)fp28 oldStyle:(BOOL)fp32;
@classilla
classilla / datepanel.m
Created Jul 28, 2018
A simple modal date panel using undocumented methods in Mac OS X Tiger.
View datepanel.m
#import <Cocoa/Cocoa.h>
// (C)2018 Cameron Kaiser. BSD license.
// gcc -o datepanel datepanel.m -framework Cocoa
// 10.4 does not have an accessory view method for NSAlert, but we can
// simulate it with these undocumented methods.
@interface NSAlert(WithCustomStyle)
- (void)prepare;
- (id)buildAlertStyle:(int)fp8 title:(id)fp12 formattedMsg:(id)fp16 first:(id)fp20 second:(id)fp24 third:(id)fp28 oldStyle:(BOOL)fp32;
You can’t perform that action at this time.