Skip to content

Instantly share code, notes, and snippets.

View jblang's full-sized avatar

J.B. Langston jblang

View GitHub Profile
@jblang
jblang / config.properties
Last active August 29, 2015 14:10
PixelController configuration for SmartMatrix with TPM2 protocol support
#
# Copyright (C) 2011-2013 Michael Vogt <[email protected]>
#
# This file is part of PixelController.
#
# PixelController is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@jblang
jblang / tpm2.md
Last active January 25, 2024 17:00
TPM2 Protocol Description

TPM2 Protocol Implementation

Introduction

Frame data is transferred inside packets (similar to DMX, for example). A frame is an image representing a matrix or a light scene.

The packets start and end with one-byte characters. In between are a few control bytes followed by the payload. There is no set size for a payload; it is transmitted with each packet. This makes the protocol quite flexible. There are enough bytes in a single packet for an RGB matrix with 21,845 pixels, but if you just want to control an RGBW lamp, that only requires 9 bytes. The variable frame size means there is no overhead, allowing for maximum transfer speed.

TPM2 Packet Structure

@jblang
jblang / C64.md
Last active June 14, 2024 13:19
C64 Resources

Emulators

VICE is the best by such a commanding margin that you really needn't look elsewhere. Open source and has the largest community.

However, other options are:

  • CCS64, Lots of features, but I found it to be painfully slow. Shareware.
  • Hoxs64. Decent, but not as full-featured as VICE. The ML monitor seems nice.
  • Frodo is pretty outdated and the author admits as much.
  • micro64 seems promising but incomplete.
; kernal locations
CHRGET = $73 ; subroutine: get next basic text character
STATUS = $90 ; kernal i/o status word
STKEY = $91 ; flag: was stop key pressed
DFLTO = $9A ; default output device
MSGFLG = $9D ; flag: kernal message control
SAL = $AC ; pointer: starting address of load/screen scrolling
TAPE1 = $B2 ; pointer: start of tape buffer
FNLEN = $B7 ; length of current filename
;
; **** ZP FIELDS ****
;
f24 = $24
RESHO = $26
FRETOP = $33
CAS1 = $C0
CURCMD = $C1
CURCMDH = $C2
;
@jblang
jblang / hello.mac
Created August 31, 2017 23:44
Hello World for the PDP-1
hello
/ above: title line - was punched in human readable letters on paper tape
/ below: location specifier - told assembler what address to assemble to
100/
lup, lac i ptr / load ac from address stored in pointer
cli / clear io register
lu2, rcl 6s / rotate combined ac + io reg 6 bits to the left
/ left 6 bits in ac move into right 6 bits of io reg
tyo / type out character in 6 right-most bits of io reg
sza / skip next instr if accumulator is zero
@jblang
jblang / a_mind_is_born.asm
Created September 6, 2017 20:14
A Mind is Born by Linus Akesson
; A Mind is Born by Linus Akesson
; https://linusakesson.net/scene/a-mind-is-born/index.php
; transcribed to 64tass and further commented by J.B. Langston
; important locations after program is copied to zero page
vmptr = $cb ; video matrix
clock = $13 ; global clock lsb - indicates position within bar
clock_msb = $20 ; global clock msb - indicates bar of song
script = $21 ; poke table
@jblang
jblang / debooze.c
Created September 11, 2017 00:31
Decrunches programs crunched with ByteBoozer 1.1
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/stat.h>
#define MEMSIZ 64*1024
#define GETLOC 0x20
uint16_t get, put;
uint8_t cur, mem[MEMSIZ];
@jblang
jblang / hello.txt
Last active September 20, 2017 17:10
Running Hello World for PDP-1
C:\Users\jblang\Retro\DEC\PDP1>macro1 -s hello.mac
hello - pass 1
hello - pass 2
C:\Users\jblang\Retro\DEC\PDP1>pdp1
PDP-1 simulator V4.0-0 Beta git commit id: ea898b24
sim> att ptr hello.rim
sim> boot ptr
hello, world
@jblang
jblang / cpu_tb.v
Last active December 21, 2017 02:31
6502 testbench
module cpu_tb;
reg clk;
reg reset;
reg irq;
reg nmi;
reg rdy;
wire [15:0] addr;
wire [7:0] cpu_do;