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
@ISSOtm
ISSOtm / pal_fade_dmgbc.asm
Created September 19, 2020 14:37
Palette fader for CGB with support for DMG fading, too!
FadeDMGToWhite:
ld c, LOW(hBGP)
ld hl, wBGP
.fadeDMGPalToWhite
ld a, [hli]
ld b, 4
.fadeDMGColorToWhite
ld e, a
and $C0
{
"PD-KB401W": {
"typeNumber": "PD-KB401W",
"layoutType": 1,
"colorType": 0,
"series": 0,
"layoutTypeName": 1,
"postfix": "",
"isKeymapChangeable": true,
"firmTypeNumber": "AHHX01",
@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.

@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"]

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).

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
@mariotacke
mariotacke / README.md
Created March 7, 2017 04:36
Default nginx log format (combined) and grok pattern

NES emulator development guide

Overview of document

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 9, 2024 13:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@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()