Skip to content

Instantly share code, notes, and snippets.

@wmcbrine
wmcbrine / saucer.bas
Created Aug 1, 2022
Saucer, a space duel (game for the CoCo)
View saucer.bas
10 CLS
20 CLEAR 50
30 M=RND(219)
40 N=RND(179)
50 V=0:W=0:SK=0
60 PMODE 4,1
70 SCREEN 1,1
80 PCLS
90 DIM A(14)
100 DIM Z(1)
@wmcbrine
wmcbrine / findtivos.py
Created Aug 1, 2022
Find TiVos on the LAN
View findtivos.py
#!/usr/bin/env python
# The way this is supposed to work is, we broadcast an announcement to
# port 2190, and wait for responses in kind. But that takes forever. The
# TiVo Connect Discovery spec says that machines should speed up their
# broadcast rate when they see a new machine on the network; in
# practice, it appears that TiVo Desktop does so, but real TiVo boxes
# don't -- they broadcast at ~65-second intervals, and don't change.
#
# However, they do respond _immediately_ with an HTTP request for a list
@wmcbrine
wmcbrine / chanmap.py
Created Aug 1, 2022
List virtual and physical channel numbers found by HDHomeRun
View chanmap.py
#!/usr/bin/env python
""" List virtual and physical channel numbers found by HDHomeRun """
import json
try:
from urllib import request as r # Python 3
except:
import urllib as r # Python 2
@wmcbrine
wmcbrine / zxtopbm.c
Created Jul 30, 2022
Convert Sinclair ZX Spectrum images to Portable Bitmap format
View zxtopbm.c
/* Convert Sinclair ZX Spectrum images to Portable Bitmap format
* by William McBrine <wmcbrine@gmail.com>
* October 16, 2005
* Placed in the public domain
*
* This does only a monochrome conversion -- color is more complex. I'll
* call that one "zxtoppm", when I write it.
*/
#include <stdio.h>
@wmcbrine
wmcbrine / rletopbm.c
Created Jul 30, 2022
Convert Compuserve RLE to Portable Bitmap format
View rletopbm.c
/* Convert Compuserve RLE images to Portable Bitmap format
* by William McBrine <wmcbrine@gmail.com>
* Placed in the public domain
*
* Version 2.0 - April 15, 2018
* - make P4 type of PBM instead of P1
* - only stop parsing on ESC or EOF
* - "medium" res are 96 lines
* Version 1.1 - October 16, 2005
* Version 1.0 - November 12, 2000