Skip to content

Instantly share code, notes, and snippets.

View ISSOtm's full-sized avatar
🦀
Rewriting RGBDS... In Rust!

Eldred Habert ISSOtm

🦀
Rewriting RGBDS... In Rust!
View GitHub Profile
@ISSOtm
ISSOtm / seed_bruter.rs
Last active April 15, 2021 16:05
Invocation: `grep '^1' seeds.txt | ./seed_bruter`. Due to a BGB bug, you must copy it to the temp folder that this program creates...
use std::convert::{TryFrom, TryInto};
use std::env::{self, Args};
use std::fs::{self, File};
use std::io::{self, BufRead, BufReader, BufWriter, Read, Stdin, Write};
use std::path::PathBuf;
use std::process::{self, Command, Stdio};
use std::thread;
use std::time::Duration;
const NB_CHILDREN: usize = 8;
@ISSOtm
ISSOtm / seeds.rs
Last active April 15, 2021 16:01
Seed bruteforcer for ZZAZZ's fools2021
use std::collections::HashSet;
use std::convert::TryInto;
use std::ops::Deref;
use std::sync::{Arc, Mutex};
use std::thread;
const NB_THREADS: usize = 8;
fn main() {
let mut seeds = Arc::new(Mutex::new(HashSet::new()));
@ISSOtm
ISSOtm / bestsci.i
Created March 10, 2021 21:11
INTERCAL program that prints "Arch is the best!" by transcoding ASCII on the fly. Uses C-INTERCAL I/O
PLEASE NOTE THAT THIS WAS MADE FOR C-INTERCAL
PLEASE DO .10 <- #18
PLEASE DO ,10 <- .10
PLEASE DO ,11 <- .10
DO NOT BE AFRAID, THESE ARE ASCII NUMBERS, NOT "TURING TAPE"
DO ,10SUB#1 <- #65
DO ,10SUB#2 <- #114
DO ,10SUB#3 <- #99
DO ,10SUB#4 <- #104
@ISSOtm
ISSOtm / Makefile
Last active February 20, 2021 23:39
CRC self-test code for Game Boy
$(BINDIR)/game.gb: $(SRCDIR)/tools/crcify.py $(OBJS)
@$(MKDIR) -p $(@D)
$(RGBLINK) $(LDFLAGS) -o $@ $(OBJS)
$(RGBFIX) $(FIXFLAGS) $@
$(RGBASM) $(ASFLAGS) -D'BANK_BYTE=$$'$$(xxd -s 0x148 -l 1 -p $@) -o $(OBJDIR)/crc.o $(SRCDIR)/crc.asm
$(RGBLINK) $(LDFLAGS) -o $@ $(OBJS) \
&& $(RGBFIX) $(FIXFLAGS) $@ \
&& $(PY) $< $@ \
&& $(RGBFIX) $(FIXFLAGS) $@
@ISSOtm
ISSOtm / subnet.py
Created October 9, 2020 21:49
Python script to print info about an IPv4 subnet mask
#!/usr/bin/env python3
import itertools
import sys
if len(sys.argv) < 2:
print(f"Usage: {argv[0]} <subnet mask>\n\tSubnet mask must be in dotted decimal form.", file=sys.stderr)
exit(1)
@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
@ISSOtm
ISSOtm / pal_fade.asm
Created August 21, 2020 19:36
Palette fader for GBC
INCLUDE "defines.asm"
SECTION "Palette buffer fading", ROM0
; Applies fade to both palette buffers
;
FadePaletteBuffers::
ld hl, wFadeSteps
dec [hl]
@ISSOtm
ISSOtm / set_data.s
Created April 15, 2020 21:29
Optimized GBDK lib funcs
.include "global.s"
.globl .copy_vram
;; BANKED: checked
.area _BASE
_set_bkg_data::
_set_win_data::
ld d, #0x90
@ISSOtm
ISSOtm / popslide.asm
Created April 10, 2020 08:00
Sample from a VBlank handler to transfer tiles using "popslide"
push de
ld [wSP], sp
ldh a, [hVRAMCopySrc]
ld l, a
ldh a, [hVRAMCopySrc+1]
ld h, a
ld sp, hl
ldh a, [hVRAMCopyDest]
ld l, a
ldh a, [hVRAMCopyDest+1]
@ISSOtm
ISSOtm / vblank_copy.asm
Created March 31, 2020 17:59
Help me code golf this pls
jr z, .noVRAMTransfer ; This JR is out of range
ld c, a
ldh a, [hConsoleType]
and a
jr z, .GDMA
ld [wSP], sp
ldh a, [hVRAMCopySrc]
ld l, a
ldh a, [hVRAMCopySrc+1]
ld h, a