Skip to content

Instantly share code, notes, and snippets.

View devinacker's full-sized avatar

Devin Acker devinacker

View GitHub Profile
CTK-551 ROM dump (little endian):
https://revenant1.net/ctk551.bin
CTK-541 service manual (identical PCBs to CTK-551):
https://www.synthxl.com/wp-content/uploads/2020/04/Casio-CTK-541-Service-Manual.pdf
CPU: "Casio GT913F", 20-bit address bus, 16-bit data bus
Similar CTK models feature a uPD913 or uPD914, i.e. the GT913F is apparently a rebranded NEC chip.
Instruction set seems to be based on Hitachi H8/300, but with opcodes 5xxx-7xxx rearranged.
#!/usr/bin/env python3
"""
Doom map rect-to-polar "circularizer" - by Revenant
Inspired by a blog post by Ribbiks:
https://rbkz.blogspot.com/2020/05/circularizer-lua.html
"""
from sys import argv
// ==UserScript==
// @name Mastodon timeline thing
// @description keep timeline from automatically scrolling under mouse cursor
// @author @revenant@mastodon.social
// @version 0.1
// @include https://mastodon.social/*
// @run-at document-idle
// @namespace revenant.mastodon
// ==/UserScript==
.p816
.code
main:
sei
stz $4207 ; IRQ at H=0
stz $4208 ; (leave IRQ disable flag set so it only resumes after WAI)
lda #%00010000
sta $4200
wai
@devinacker
devinacker / exomizer-816.asm
Created July 10, 2018 01:13
WIP (sorta) Exomizer decruncher for SNES / 65c816 (with ca65)
.include "libSFX.i"
.feature force_range
.export Decrunch
/*
Exomizer (raw mode) decruncher for 65c816 / ca65.
by Devin Acker (Revenant/RSE), 2018
For use on SNES, and theoretically other 65c816-based platforms.
/*
Quick SDL2 wrapper for uPNG
d@revenant1.net
This code is public domain.
*/
// https://github.com/elanthis/upng
#include "upng/upng.h"
#include <SDL2/SDL.h>
@devinacker
devinacker / gist:7a038ceba2d5652b8b7816107f579c7f
Last active September 17, 2018 16:43
Ad blocker filters for keeping some of Twitter's obtrusive garbage off of your timeline
twitter.com##.moments
twitter.com##div[data-card2-type^="promo"]
twitter.com##div[data-component-context^="suggest_activity_tweet"]
twitter.com##div[data-component-context^="suggest_recycled_tweet_inline"]
from __future__ import print_function
import struct
from omg.util import *
class StructMeta(type):
@staticmethod
def _get(f):
# Get struct field or default value
def fn(self):
//; "Super Keftendo" 256-byte SNES intro source code
//; by Revenant
//; http://www.pouet.net/prod.php?which=70163
//; This is an attempt at implementing the "Kefrens bars" effect on the SNES, using less than
//; 256 bytes of ROM. The technique used here is to set up a 256-color line buffer using
//; Mode 7, then rendering a few pixels directly to CGRAM every scanline and resetting the
//; Y-scroll position to display the same buffer on every visible scanline as it is repeatedly
//; rendered to. Some more information about specific size optimizations are detailed later.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
const char *ui_template = \
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<ui version=\"4.0\">\n\
<class>%s</class>\n\
<widget class=\"%s\" name=\"%s\">\n\