Skip to content

Instantly share code, notes, and snippets.

@wmcbrine
wmcbrine / saucer.bas
Created August 1, 2022 03:20
Saucer, a space duel (game for the CoCo)
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 August 1, 2022 02:17
Find TiVos on the LAN
#!/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 August 1, 2022 02:07
List virtual and physical channel numbers found by HDHomeRun
#!/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 July 30, 2022 13:27
Convert Sinclair ZX Spectrum images to Portable Bitmap format
/* 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 July 30, 2022 13:20
Convert Compuserve RLE to Portable Bitmap format
/* 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