Skip to content

Instantly share code, notes, and snippets.

Avatar
🧑‍💻
Writing gb-asm-tutorial

Eldred Habert ISSOtm

🧑‍💻
Writing gb-asm-tutorial
View GitHub Profile
@ISSOtm
ISSOtm / PKGBUILD
Last active Jan 8, 2022
Overhauled PKGBUILD for aseprite-git
View PKGBUILD
# Maintainer: Justin Wong <jusw85 at hotmail dot com>
# Contributor: Eldred Habert <me@eldred.fr>
# Contributor: Benoit Favre <benoit.favre@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Kamil Biduś <kamil.bidus@gmail.com>
# Discussion: https://bbs.archlinux.org/viewtopic.php?pid=1853334#p1853334
pkgname=aseprite-git
pkgver=1.3.beta7.r63.g8ec2fff44
@ISSOtm
ISSOtm / map_to_sym.awk
Created Sep 25, 2021
Awk script for generating a Game Boy SYM file from a RGBDS map file
View map_to_sym.awk
#!/usr/bin/awk -f
/^[^ \t]+[ \t]bank #([0-9]+):$/ {
bank = substr($3, 2)
sub(/:/, "", bank)
}
/^[ \t]*\$[0-9A-Fa-f]{4}[ \t]+=[ \t]+/ {
printf "%02x:%s %s\n", bank, substr($1, 2), $3
}
@ISSOtm
ISSOtm / maze.py
Created Sep 5, 2021
"Clever" assembly for NANDGame maze escape mission (not really Python, just for approximate syntax highlighting)
View maze.py
# Start of main loop
loop:
# Wait until everything is settled before doing anything
A = 0x600
D = A
wait_init:
A = 0x7FFF
# D has its bits get progressively cleared as exit conditions become true
# (since we're not instructing the robot to move, it won't suddenly start doing so)
@ISSOtm
ISSOtm / metasprite_defs.asm
Created Jul 29, 2021
Metasprite animation definition
View metasprite_defs.asm
MACRO nb_cels
REDEF NB_CELS equs "_NB_CELS\@"
db {NB_CELS}
DEF {NB_CELS} = 0
ENDM
MACRO cel
db (\1) ; Amount of frames to display this cel during
REDEF {NB_CELS} = {NB_CELS} + (\1)
dw (\2) ; Ptr to cel
ENDM
@ISSOtm
ISSOtm / u256.rs
Created May 24, 2021
Short, very incomplete implementation of u256 to showcase the use of `u128::overflowing_add`
View u256.rs
use std::fmt::{self, Display, Formatter};
use std::ops::Add;
#[derive(Debug, Clone)]
struct u256 {
lo: u128,
hi: u128,
}
impl Add<u256> for u256 {
@ISSOtm
ISSOtm / csvtomap.py
Last active May 22, 2021
CSV → Binary tilemap converter
View csvtomap.py
#!/usr/bin/env python3
import sys
def main(argv):
if len(argv) != 3:
print(f"Usage: {argv[0} -(0|1) file.csv", file=sys.stderr)
return 1
if argv[1] == "-0":
bounds = (-128, 127)
@ISSOtm
ISSOtm / seed_bruter.rs
Last active Apr 15, 2021
Invocation: `grep '^1' seeds.txt | ./seed_bruter`. Due to a BGB bug, you must copy it to the temp folder that this program creates...
View seed_bruter.rs
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 Apr 15, 2021
Seed bruteforcer for ZZAZZ's fools2021
View seeds.rs
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 / make.log
Created Mar 14, 2021
Log of building gb-boilerplate from scratch
View make.log
issotm@sheik-kitty ~/gb-boilerplate% make -dr [master|✔]
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Reading makefile 'project.mk' (search path) (no ~ expansion)...
@ISSOtm
ISSOtm / bestsci.i
Created Mar 10, 2021
INTERCAL program that prints "Arch is the best!" by transcoding ASCII on the fly. Uses C-INTERCAL I/O
View bestsci.i
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