Skip to content

Instantly share code, notes, and snippets.

View yuriks's full-sized avatar

Yuri Kunde Schlesner yuriks

View GitHub Profile
@yuriks
yuriks / smart_patch_notes.txt
Last active January 27, 2025 22:15
SMART Hardcoded/fixed addresses
List of hardcoded address locations SMART reads/writes to:
Allocatable object respecting project free space settings aren't listed here,
only things with fixed locations.
(Lines without a colon/label are grouped with the *next* entry's description.
Entries starting with "R" are reads rather than writes.)
Bank $80
@yuriks
yuriks / split.py
Created November 30, 2024 15:45
Super Metroid ROM data splitter
#!/usr/bin/env python3
#
# Copyright (c) 2022 yuriks
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@yuriks
yuriks / eye_camera_ai.asm
Created August 16, 2023 18:50
Bank $A8 - Morph Ball eye disassembly
asar 1.90
lorom
dpbase 0
optimize dp always
optimize address ram
;;; RAM Variables
samus_collected_items = $7E09A4
@yuriks
yuriks / ips2asm.py
Created November 14, 2022 00:48
ips2asm.py
#!/usr/bin/env python3
#
# Copyright (c) 2022 Yuri Kunde Schlesner (yuriks)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# Search returns false positives if A isn't actually in ptrs
def create_search(f, table, label_prefix='.l'):
search_bits = len(table).bit_length()
def pad_label(s):
return (s + ':').ljust(len(label_prefix) + search_bits + 2)
def emit_search(prefix, sub_table):
f.write(pad_label(prefix))
if len(sub_table) == 1:
@yuriks
yuriks / room-mod.rs
Last active February 19, 2020 13:15
La-Mulana MSD parser using nom
mod parser;
// Actual range: 11 bits [0, 2048)
pub type TileIndex = u16;
#[derive(Debug)]
pub struct AnimatedTileFrame {
pub frames_wait: u8,
pub tile_index: TileIndex,
}
@yuriks
yuriks / wrap.py
Created March 12, 2019 23:54
Befunge-98 wrapping
dpx = 0
dpy = 0
bx1 = 0
bx2 = 180
by1 = 0
by2 = 909
if 0:
px_s = -2
py_s = 18
dpx = -1
mod decode;
use self::decode::DecodeInstruction;
use self::decode::DecodedArmInstruction;
use scheduler::GeneratorTask;
use scheduler::Task;
use system::AccessWidth;
use system::Bus;
use system::MemoryRequest;
use system::OperationType;
@yuriks
yuriks / main.rs
Created October 7, 2018 12:09
Advance (v1)
#![feature(macro_literal_matcher, min_const_fn)]
extern crate byteorder;
extern crate num;
extern crate sdl2;
use byteorder::ByteOrder;
use byteorder::LE;
use sdl2::event::Event;
use sdl2::keyboard::Scancode;
@yuriks
yuriks / main.c
Last active May 27, 2017 07:17
Quaternion Interpolation Test
#include <3ds.h>
#include <citro3d.h>
#include <string.h>
#include "vshader_shbin.h"
#define CLEAR_COLOR 0x68B0D8FF
#define DISPLAY_TRANSFER_FLAGS \
(GX_TRANSFER_FLIP_VERT(0) | GX_TRANSFER_OUT_TILED(0) | GX_TRANSFER_RAW_COPY(0) | \
GX_TRANSFER_IN_FORMAT(GX_TRANSFER_FMT_RGBA8) | GX_TRANSFER_OUT_FORMAT(GX_TRANSFER_FMT_RGB8) | \