Skip to content

Instantly share code, notes, and snippets.

View jblang's full-sized avatar

J.B. Langston jblang

View GitHub Profile
@jblang
jblang / mandel.asm
Last active March 7, 2024 13:31
Z80 Color Mandelbrot
;
; Compute a Mandelbrot set on a simple Z80 computer.
;
; From https://rosettacode.org/wiki/Mandelbrot_set#Z80_Assembly
; Adapted to CP/M and colorzied by J.B. Langston
; Latest version at https://gist.github.com/jblang/3b17598ccfa0f7e5cca79ad826a399a9
; Assemble with sjasm
;
; Porting this program to another Z80 platform should be easy and straight-
; forward: The only dependencies on my homebrew machine are the system-calls
@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 / rc2014.md
Last active January 20, 2024 14:57
RC2014 Links
@jblang
jblang / C64.md
Last active September 13, 2023 04:57
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.
@jblang
jblang / Advanced Graphics.bas
Created August 17, 2023 02:17
Advanced Graphics Techniques for Mac QuickBASIC
' Advanced Graphics Techniques--Part II by Bob Boothe
' 80 Microcomputing Magazine, May 1981, Page 119-142
' https://archive.org/details/80-microcomputing-magazine-1981-05/page/n121/mode/2up
' Converted to QuickBASIC for Mac by J.B. Langston, August 2023
w=WINDOW(2): h=WINDOW(3)
pi=3.14: xc=w/2: yc=h/2: sc=yc
CALL Poly18
CALL TheEye
CALL Moire
@jblang
jblang / 00-notes.md
Last active August 7, 2023 20:22
Heathkit H89 Survival Guide

H89 Survival Guide

This is a work-in-progress collection of notes I've been making as I'm exploring the Heathkit H89.

@jblang
jblang / a2apple30th.asm
Last active January 18, 2023 02:46
Apple 30th Anniversary
; Apple 30th Anniversary Tribute for Apple II by Dave Schmenk
; Original at https://www.applefritter.com/node/24600#comment-60100
; Disassembled, Commented, and ported to Apple II by J.B. Langston
; Assemble with `64tass -b -o a2apple30th.bin -L a2apple30th.lst`
KEYBD = $C000 ; keyboard register
STROBE = $C010 ; keyboard strobe register
PTR = $06 ; pointer to current image
* = $0C00
@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 / pcjr.md
Created June 5, 2019 12:57
IBM PCjr Resources
@jblang
jblang / a2advgraf.bas
Last active February 1, 2022 06:59
AppleSoft Advanced Graphics Techniques
1 REM Advanced Graphics Techniques--Part II by Bob Boothe
2 REM 80 Microcomputing Magazine, May 1981, Page 119-142
3 REM https://archive.org/details/80-microcomputing-magazine-1981-05/page/n121/mode/2up
4 REM Converted to AppleSoft by J.B. Langston, January 2022
10 HOME : HGR : HCOLOR= 3: POKE 49234,0
20 PI = 3.14:XC = 139:YC = 95:SC = YC
30 R1 = SC:R2 = SC:V = 18: GOSUB 100: GOSUB 2000
40 GOSUB 200: GOSUB 300: GOSUB 400: GOSUB 500: GOSUB 600
50 SD = 76:TD = 3:TM = 2: GOSUB 700
60 SD = 60:TD = 2:TM = 2: GOSUB 700