Skip to content

Instantly share code, notes, and snippets.

Avatar
Working from home

Juan J. Martínez reidrac

Working from home
View GitHub Profile
@reidrac
reidrac / zx7.s
Created Jan 4, 2020
ZX7 decompressor 6502
View zx7.s
; 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
View disable-firmware-cpc.z80
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
View make-gif.sh
#!/bin/bash
ffmpeg -i $1 -r 10 -pix_fmt rgb24 $1.gif
convert -layers optimize-plus $1.gif $1-opt.gif
View checksize.sh
#!/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
View env.py
#!/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 Nov 5, 2018
Using ASCII 8K mapper with 2KB of SRAM
View ascii8-2.md

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

View redeps on libssh
$ apt-cache rdepends libssh-4
libssh-4
Reverse Depends:
libpam-x2go
cockpit-bridge
yafc
x2goclient
tmate
remmina-plugin-nx
openvas-nasl
View ark-loader.s
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
View tapelen.py
#!/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 Feb 6, 2018 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
View gist:eec4d91e712c37ae217ec71ed27a2e60
$ 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!