Skip to content

Instantly share code, notes, and snippets.

@CryZe
CryZe / auto_splitting_api_proposal.rs
Last active January 7, 2022 22:28
Proposal for the MVP of the auto splitting API.
#[repr(transparent)]
pub struct Address(pub u64);
#[repr(transparent)]
pub struct NonZeroAddress(pub NonZeroU64);
#[repr(transparent)]
pub struct ProcessId(NonZeroU64);
#[repr(transparent)]
#![feature(let_else)]
#![no_std]
use core::{fmt, mem};
use bytemuck::{Pod, Zeroable};
#[derive(Debug, Copy, Clone, Pod, Zeroable)]
#[repr(C)]
pub struct Header {
@CryZe
CryZe / float_max_survey.md
Last active March 24, 2024 21:13
Survey of Floating Point Implementations for Maximum

Survey of Floating Point Implementations for Maximum

Following some IEEE Standard

IEEE Std 754-2008 maxNum (NaN Absorb, 0 implementation defined)

  • C17 fmax
  • Rust f64::max
  • LLVM llvm.maxnum
  • ARM FMAXNM (either mode)
@CryZe
CryZe / LiveSplitOneInUnity.cs
Created April 18, 2021 17:43
LiveSplit One in Unity
using UnityEngine;
using LiveSplitCore;
using System;
using System.IO;
public class LS : MonoBehaviour
{
Timer timer;
Layout layout;
LayoutState layoutState;
@CryZe
CryZe / fontemon.rs
Last active March 19, 2021 21:01
fontemon.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::{
io::Cursor,
sync::{Arc, RwLock},
time::{Duration, Instant},
};
use minifb::{Key, KeyRepeat, ScaleMode, Window, WindowOptions};
use rustybuzz::UnicodeBuffer;
@CryZe
CryZe / LSO GBA.md
Last active February 11, 2021 16:08
@CryZe
CryZe / day01.rs
Last active December 1, 2020 14:43
Advent of Code 2020 - Day 1
use std::cmp::Ordering;
use anyhow::{bail, Context, Result};
use arrayvec::ArrayVec;
pub fn parse(input: &str) -> impl Iterator<Item = Result<usize>> + '_ {
input
.lines()
.map(|l| l.parse().context("Failed parsing one of the numbers."))
}
@CryZe
CryZe / paper_mario_damage.md
Last active June 14, 2023 08:42
Paper Mario Damage

Paper Mario Damage

Mario

Mario Damage
Base Damage 50 HP = 5
70 HP = 7
75 HP = 7
80 HP = 8
100 HP = 10
105 HP = 10
125 HP = 11
135 HP = 11
140 HP = 13
150 HP = 13
170 HP = 14
175 HP = 14
180 HP = 16
190 HP = 16
200 HP = 17
Hammer +5
Shiny Hammer +11
Golden Hammer +14
undefined4 dSeaFightGame_info_c_init(int this,int param_2,int param_3)
{
int y;
undefined *puVar1;
int x;
int iVar2;
x = 0;
y = 0;
11 I
146 was
15 not
62 alone
87 others
14 are
106 outside
2 the
150 Loop