Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View reidrac's full-sized avatar

Juan J. Martínez reidrac

View GitHub Profile
@reidrac
reidrac / zx7.s
Created January 4, 2020 17:46
ZX7 decompressor 6502
; vim: set ft=a65:ts=4:et
; ZX7 decompressor based on
; ZX7 data decompressor for Apple II
; by Peter Ferrie (peter.ferrie@gmail.com)
;
.CODE
; these two must be known by the user of the decompressor
di
; disable the firmware
im 1
ld hl, #0x38
ld (hl), #0xfb
inc hl
ld (hl), #0xc9
; put the stack as high as we can
ld sp, #0xc000
#!/bin/bash
ffmpeg -i $1 -r 10 -pix_fmt rgb24 $1.gif
convert -layers optimize-plus $1.gif $1-opt.gif
#!/bin/bash
#
# Check SDCC map files and calculate how much RAM you have left
#
# max_mem is top mem minus your code start, for example: 41179
#
set -e
if [ $# -ne 2 ]; then
@reidrac
reidrac / env.py
Last active January 7, 2019 11:36
#!/usr/bin/env python
"""
The env_file should have one KEY=VALUE per line and it can include spaces.
If the env_file is a JSON file (filename ends in .json), a list of dictionaries
is expected in the form:
[ { "name": "KEY", "value": "value" }, ... ]
@reidrac
reidrac / ascii8-2.md
Last active November 5, 2018 22:16
Using ASCII 8K mapper with 2KB of SRAM

This is for OpenMSX

OpenMSX won't detect this type of cart automatically, so you need to say the cart type with:

openmsx -carta game.rom -romtype ASCII8SRAM2

OpenMSX will create a file game.rom.SRAM to store 2KB of persistent memory (in Linux this is in $HOME/.openMSX/persistent/roms/game.rom).

Init and detect

$ apt-cache rdepends libssh-4
libssh-4
Reverse Depends:
libpam-x2go
cockpit-bridge
yafc
x2goclient
tmate
remmina-plugin-nx
openvas-nasl
di ;c000
in a,(0a8h) ;c001
and 0f3h ;c003
ld hl,04000h ;c005
ld c,004h ;c008
call sub_c04bh ;c00a
and 0cfh ;c00d
ld c,010h ;c00f
lc011h:
ld hl,08000h ;c011
#!/usr/bin/env python3
"""
We all have seen some memes about how long did it take to load games from tape
in the old 8-bit microcomputers. 30 minutes, lol. Well, not really (or at least
not for the speccy and the CPC; sorry, no C64 data).
This is not very scientific, as it doesn't take into account multi-load,
turbos, anti-copy, etc; but look at the times and you get the idea.
@reidrac
reidrac / gist:eec4d91e712c37ae217ec71ed27a2e60
Created February 6, 2018 12:12 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!