Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block Sgeo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Sgeo / DNA.cpp
Created Aug 9, 2019
Source code for Langton's loops CA in MCell
View DNA.cpp
/* DNA.cpp
* This automata was designed by Christopher G. Langton at the University
* of Michigan, and is described in his article "Self-Reproduction in
* Cellular Automata", published in the book "Cellular Automata" in 1984.
* As described in the above article, this automata is "realistic" and
* "non-trivial", in the following ways:
* The reproduction is not simply due to the particular rules used in
View novfx1.c
#include <stdio.h>
#include <stdarg.h>
#include <dos.h>
#include <i86.h>
#include <conio.h>
#include "vfx1.h"
extern unsigned _psp;
unsigned __far *psp_pointer;
unsigned _get_memsize();
Created Jun 20, 2019
Part of convert.c in the i-Glasses SDK. Note that "raw" should be called "cooked". An emulator needs to reverse this math.
void rawToEulerInt(long rawMagneticX,long rawMagneticY,long rawMagneticZ,
long rawGravimetricX,long rawGravimetricY,
long * eulerYaw,long * eulerPitch,long * eulerRoll) {
vec3 rotMagnetic;
vec2 linGravimetric;
vec2 normRotMag;
sinCos pitch,roll;
if (!madeFilters) {
def prim(name, default, actions):
action_string = ", ".join(actions)
if default:
animate_string = ", animate me . 1 1 0"
animate_string = ""
print("create name %s%s; adone %s" % (name, animate_string, action_string))
def action_prim_mem(name, value):
action_string = "animate %s . 1 1 %s" % (name, ("0" if value else "2147483647"))
Sgeo / SDL_keycode.h
Last active Oct 1, 2018
vice32.js .. modifications off VICE 3.2 branch.
View SDL_keycode.h
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
Sgeo / library_sdl.js
Last active Sep 16, 2018
Custom library_sdl.js to fix SDL1 keycodes. Possible issues.
View library_sdl.js
//"use strict";
// See browser tests for examples (tests/, search for sdl_). Run with
// python tests/ browser
// Notes:
// SDL_VIDEORESIZE: This is sent when the canvas is resized. Note that the user
// cannot manually do so, so this is only sent when the
// program manually resizes it (emscripten_set_canvas_size
// or otherwise).
View vice.patch
Index: configure.proto
--- configure.proto (revision 35456)
+++ configure.proto (working copy)
@@ -2847,89 +2847,6 @@
dnl check for opengl libs.
- AC_MSG_CHECKING(whether we can use the GL library)
use std::marker::PhantomData;
use std::cell::Cell;
struct Scope<'s> {
num: Cell<usize>,
phantom: PhantomData<Cell<&'s mut ()>>,
//ms: Vec<&'s mut i32>, <-- useful trick for understanding lifetimes
impl<'s> Scope<'s> {
View Worlds 1-bit ALU prototype
Sequence: name=ALUSeq
SetInteger: name=SI00
Sequence: name=Seq.1
SetInteger: name=SI01
Sequence: name=Seq1.
SetInteger: name=SI10
Sequence: name=Seq.1-2
SetInteger: name=SI11
Sequence: name=Decoder
use std::any::TypeId;
use std::any::Any;
fn wrap<F: Fn()+Any>(closure: F) -> extern "C" fn() {
extern "C" fn wrapped<F: Any>() -> () {
println!("Haven't written this yet! TypeId: {:?}", TypeId::of::<F>());
println!("Storing closure {:?}", TypeId::of::<F>());
You can’t perform that action at this time.