Skip to content

Instantly share code, notes, and snippets.

View tom-seddon's full-sized avatar

Tom Seddon tom-seddon

View GitHub Profile
@tom-seddon
tom-seddon / x11.cpp
Created April 16, 2017 18:22
Some Xlib junk, vaguely along the lines of GetWindowPlacement/SetWindowPlacement
#include <shared/system.h>
#include "x11.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xinerama.h>
#include <string.h>
#include <shared/log.h>
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@tom-seddon
tom-seddon / tom-layout.el
Created March 13, 2017 13:23
how I set up my emacs windows
(defun tom-layout ()
(interactive)
(delete-other-windows)
(mmd-reset-major-mode-window-dedication)
(let (w)
(setq w (selected-window))
(split-window-horizontally)
(split-window-horizontally)
(other-window 1)
@tom-seddon
tom-seddon / gist:d1ccdb18e3c3d4a2c288a12c1993e4b2
Created January 12, 2017 13:26
State-based 6502 emulator snippet
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//
// Read/Absolute,X
//
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
static void T1_R_ABX(M6502 *);
static void T2_R_ABX(M6502 *);
@tom-seddon
tom-seddon / B.R62
Created July 28, 2016 23:22
BBC Micro split bitmap/linear addressing mode "demo"
10REM>B.R62
20ONERRORMODE7:REPORT:PRINT" at line ";ERL:END
30MODE7
40*TV255 1
50PROCASM
60:
70MODE2:MODE6:HIMEM=&5800
80*FX154 0
90*FX9 0
100*FX10 1
@tom-seddon
tom-seddon / B.ADDRS
Created July 28, 2016 23:00
BBC Micro 6845 address browser
10REM>B.ADDRS
20:
30ONERRORMODE7:REPORT:PRINT" at line ";ERL:END
40:
50MODE6:HIMEM=&2F00
60*FX154 0
70*FX9 0
80*FX10 1
90?&FE00=1:?&FE01=32
100PROCR(0,63)
@tom-seddon
tom-seddon / B.CHUNK2
Created July 28, 2016 00:40
Quick'n'dirty BBC Micro linear layout screen demo
10REM>B.CHUNK3
20:
30ONERRORMODE7:REPORT:PRINT" at line ";ERL:END
40:
50REM CLEAR MEMORY
60MODE2
70:
80MODE5
90:
100REM ENGAGE MODE 8
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace minitags
{
/// <summary>
/// ini file reader that can read from list of strings, which
/// unfortunately GetPrivateProfileString etc. won't.
@tom-seddon
tom-seddon / WindowPlacement.cs
Created June 16, 2015 23:30
GetWindowPlacement and SetWindowPlacement code
// This code is in the public domain.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace Utils
{
//////////////////////////////////////////////////////////////////////////
@tom-seddon
tom-seddon / gist:a57d04d01f34217d608a
Created June 8, 2015 17:08
Sequence Counter 245/4/16
@0
@1
MOV UP ACC
JNZ S
MOV -999 ACC
S:MOV ACC DOWN
@2
@tom-seddon
tom-seddon / gist:fab043ae910764a99605
Created June 8, 2015 17:03
Scatter Plot Viewer 564/9/83
@0
@1
MOV UP ACC#X
SWP
MOV UP ACC#Y
MOV UP DOWN
MOV ACC DOWN#Y
SWP