Skip to content

Instantly share code, notes, and snippets.

View yuriks's full-sized avatar

Yuri Kunde Schlesner yuriks

View GitHub Profile
@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 / cross-eye.patch
Created August 18, 2015 05:12
Citra side-by-side cross-eye 3D
diff --git a/src/common/emu_window.cpp b/src/common/emu_window.cpp
index b69b05c..87b84a9 100644
--- a/src/common/emu_window.cpp
+++ b/src/common/emu_window.cpp
@@ -76,6 +76,7 @@ void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) {
}
EmuWindow::FramebufferLayout EmuWindow::FramebufferLayout::DefaultScreenLayout(unsigned width, unsigned height) {
+ width /= 2;
@yuriks
yuriks / ctr_resultcodes.py
Last active February 14, 2018 18:38
ctr_resultcodes.py
#!/usr/bin/python2
# Convert 3DS errors to readable format
# plutooo // yuriks
import sys
summaries = {
0: "Success",
1: "Nothing happened",
@yuriks
yuriks / Real-Time_Import_for_use_with_the_Rikaisama_Firefox_Extension.py
Created August 12, 2014 16:48
Count occurrences patch for Anki Rikai-sama Real-Time Import addon
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Christopher Brochtrup
#
# This file is part of Real-Time Import.
#
# Real-Time Import is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.