Skip to content

Instantly share code, notes, and snippets.

View classilla's full-sized avatar
🕶️
DEAL WITH IT.

Cameron Kaiser classilla

🕶️
DEAL WITH IT.
View GitHub Profile
@classilla
classilla / datepanel.m
Created July 28, 2018 17:01
A simple modal date panel using undocumented methods in Mac OS X Tiger.
#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;
@classilla
classilla / doubledate.m
Created July 28, 2018 17:03
An expansion of `datepanel.m` that displays synchronized date pickers in a modal dialogue using undocumented methods in Mac OS X Tiger.
#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 / doubletime.m
Created July 28, 2018 17:09
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.
#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 / hqemu-ppc-build.diff
Created November 18, 2018 01:03
Fix for hqemu-2.5.2 to build full system emulation on ppc64le.
--- 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 / org.gnome.chrome_gnome_shell.json
Last active December 9, 2018 04:41
JSON native messaging descriptor for GNOME Shell Integration 3.30+ in Firefox (tested on Fedora 29/Firefox 63). Place in ~/.mozilla/native-messaging-hosts .
{
"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 / mame_gcc_workaround.diff
Created December 20, 2018 13:39
A workaround to allow compilation of recent versions of MAME with gcc on PowerPC, including ppc64 and ppc64le.
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 / lamevsx.diff
Created July 27, 2019 02:57
Enable SSE intrinsic acceleration with VMX/VSX for LAME 3.100 on ppc64le (configure with CFLAGS="-O3 -mcpu=power9 -DNO_WARN_X86_INTRINSICS" ./configure)
diff --git a/configure b/configure
index 52dbf02..1354f27 100755
--- a/configure
+++ b/configure
@@ -17226,16 +17226,28 @@ powerpc)
# use internal knowledge of the IEEE 754 layout
$as_echo "#define TAKEHIRO_IEEE754_HACK 1" >>confdefs.h
@classilla
classilla / microwatt-wait-instruction.diff
Created September 15, 2019 03:05
Example of adding a "wait" instruction to Microwatt, the VHDL OpenPOWER ISA core.
diff --git a/core.vhdl b/core.vhdl
index d34bf71..60c8cdf 100644
--- a/core.vhdl
+++ b/core.vhdl
@@ -17,17 +17,18 @@ entity core is
wishbone_insn_in : in wishbone_slave_out;
wishbone_insn_out : out wishbone_master_out;
wishbone_data_in : in wishbone_slave_out;
wishbone_data_out : out wishbone_master_out;
@classilla
classilla / jitlab1.c
Created January 7, 2020 05:46
Simple ppc64/ppc64le generated machine code example
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <linux/memfd.h>
uint32_t* jitcode;
@classilla
classilla / jitlab2.c
Created January 7, 2020 05:47
Simple ppc64/ppc64le generated machine code example that's a little more complicated
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <linux/memfd.h>
uint32_t* jitcode;