Skip to content

Instantly share code, notes, and snippets.

View tobiasvl's full-sized avatar
🦀
Learning Rust

Tobias V. Langhoff tobiasvl

🦀
Learning Rust
View GitHub Profile
@fredrikhl
fredrikhl / prepare-commit-msg
Last active August 29, 2015 14:00
Cerebrum commit msg hook
#!/bin/sh
#
# branch -> remove /path/to/branch
tag=$( git symbolic-ref HEAD \
| awk -F'/' '{print $NF}' \
| sed 's/^[Cc][Rr][Bb]-\([0-9]\+\)/CRB-\1/' \
)
[ -n "$tag" ] && echo "$tag" >> $1
#!/bin/bash
function list {
for branch in `git branch --remote | awk '{print $1}'`; do
last=`git log $branch | grep Author | head -1 | awk '{print $NF}'`
echo $last $branch
done
}
list | sort
There are many small errors or discrepancies in the docs listed above, unfortunately I don't know if/how those docs are maintained so I'm going to list the errors I've found here for now:
RLCA instruction: various sources disagree on whether the Z flag should be modified by the operation. After some research I'm pretty sure it shouldn't be modified (the Z80 processor for instance does not modify Z).
HALT instruction: when this instruction is executed while interrupts are disabled in the CPU (for instance by a DI instruction) the CPU will still be awoken by any interrupt enabled in the IE register, however the interrupt handler will not be run and the control will be given back to the code that called the HALT. Be careful that the instruction following an HALT is glitchy but that's well documented.
ADD SP,N (opcode 0xe8) and LDHL SP,N (opcode 0xf8): the values of the carry and halfcarry are computed on the low 8bits.
RLCA, RLA, RRCA, RRA instructions: the flags are described wrong in the CP

For the clock times within this section, if a single value is given, it represents the number of clock cycles in single-speed (4.194304 MHz) mode (e.g. a nop is 4 clocks), while the number of clocks in double-speed mode is both unknown and unassumed. If two values are given, they represent first the clocks in single-speed mode and second the clocks in double-speed (8.388608 MHz) mode (e.g. a nop is 4/4 clocks; an HDMA transfer is 32/64 clocks).

Scanline Timing

A single scanline is 456/908 clocks.

By AntonioND's tests in section 8, Mode 2 (OAM search) consistently takes 80/160 clocks.

By Kevtris' tests, Mode 3 (data transfer) takes 173.5 clocks at a minimum (clocks in double-speed mode unknown since this involves non-CPU communication).

@shaneriley
shaneriley / move_demo.p8
Last active May 22, 2018 20:14
PICO-8 Movement Demo
pico-8 cartridge // http://www.pico-8.com
version 4
__lua__
player = {}
player.x = 5
player.y = 5
player.sprite = 0
player.speed = 2
function move()
<?php
$audit = file_get_contents('audit.txt');
$audit = split("\n", $audit);
$data = Array();
for ($i=0; $i!=count($audit); $i++) {
$line = $audit[$i];
$datatype = substr($line, 0, 1);
switch ($datatype) {
case '-':
$day = substr($line, 3, 10);
@bboe
bboe / comment_loop_test.py
Last active June 7, 2021 06:26
Python Reddit API Comment Loop Test
#!/usr/bin/env python3
import logging
import sys
import time
import praw
def configure_logging():
logger = logging.getLogger("praw")
@ISSOtm
ISSOtm / to_c_or_not_to_c.md
Last active June 22, 2021 12:02
Writeup discussing programming toolchains, coding practices, and languages, for GB and GBC dev.

This document is now at https://gbdev.io/guides/tools.html, please go there instead. It's kept here to avoid breaking links and to preserve history.

Previous versions can be checked out by selecting the "Revisions" tab, and selecting "View file" in the three-dot drop-down menu.

@seungwon0
seungwon0 / Whatthecommit
Created January 30, 2011 02:56
Random commit message generator
#! /bin/sh
#
# whatthecommit - Random commit message generator
#
# Show random commit message from http://whatthecommit.com/.
#
# Seungwon Jeong <seungwon0@gmail.com>
#
# Copyright 2011 by Seungwon Jeong
@pyar6329
pyar6329 / hhkb_layout.txt
Created January 24, 2018 23:32
Happy Hacking Keyboard layout raw data (http://www.keyboard-layout-editor.com/)
["esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=","|\n\\","~\n`"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"Delete"],
[{w:1.75},"Ctrl","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Return"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:1.75},"Shift","Fn"],
[{x:1.25,w:1.25},"Option",{w:1.25},"⌘",{a:7,w:6.25},"",{a:4,w:1.25},"⌘",{w:1.25},"Option"]