Skip to content

Instantly share code, notes, and snippets.

View devinacker's full-sized avatar

Devin Acker devinacker

View GitHub Profile
map(lambda i:"DEHUMANIZE YOURSELF AND FACE TO FIZZBUZZ"[-8+4*(i%3>0):][4*(i%3*i%5>0):4+4*(i%5==0)].rjust(1,chr(48+i%10)).rjust(2,chr(48+i/10)), range(1, 100))
MMC3 on the left, MMC5 on the right
mapper init ($FFF1):
PRG: makes $8000-9FFF swappable and $C000-DFFF fixed,
CHR: sets up 2x2kb lower and 4x1kb upper
(probably only PRG part matters here; this should probably be replaced with
an entire MMC5 init routine somewhere else, which may also set up the CHR-ROM
bank setup that is normally asserted when selecting banks on the MMC3,
as well as PRG-RAM and other stuff)
@devinacker
devinacker / bch2obj.go
Last active August 29, 2015 14:06 — forked from magical/bch2obj.go
package main
import (
"bytes"
"encoding/binary"
"flag"
"fmt"
"io"
"io/ioutil"
"math"
@devinacker
devinacker / TX2.cs
Last active August 29, 2015 14:24
paint.net plugin for Nippon Ichi Software .tx2 images
/* this is unfinished */
using System;
using System.Windows.Forms;
using PaintDotNet;
using System.Drawing;
public class TX2FileType : FileType {
public TX2FileType() : base ("TX2", FileTypeFlags.SupportsLoading,
/* compile as C++11 */
#include <QApplication>
#include <QPushButton>
#include <QSlider>
#include <QLabel>
#include <QLayout>
int main(int argc, char *argv[])
@devinacker
devinacker / mmd.cpp
Last active June 23, 2023 06:57
.mmd to .mid converter
/*
MMD to MIDI (SMF) converter
(c) 2015 by Devin Acker <d@revenant1.net>
No sysex, no tempo slides, but it loops Touhou music!
Licensed under WTFPL:
http://www.wtfpl.net/txt/copying/
*/
Argonaut/Anthrox
AF C8 F0 D0 FB 5D D5 00 01 C8 ?? B0 03 D5 00 02 3D D0 F3 END
AF C8 F0 D0 FB 5D D5 00 01 D5 00 02 C8 ?? B0 03 D5 00 03 3D D0 F0 END
Atelier_Double
FC D0 02 AB ?? 78 08 ?? D0 F4 END
E4 ?? F0 ?? EB ?? E5 ?? ?? CF 60 85 ?? ?? C5 ?? ?? 90 END
(Atelier_Double_v1)
FC D0 02 AB ?? 78 08 ?? D0 F4 E8 00 ?? F5 END
#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\
//; "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.
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):