Skip to content

Instantly share code, notes, and snippets.

@CryZe
CryZe / auto-splitter.c
Last active June 11, 2022 12:33
Auto Splitter written in C
#include "asr/asr_helpers.h"
#include "asr/mini_libc.h"
ProcessId process = 0;
Address unity = 0;
uint8_t old_run_active = 0;
uint8_t old_timer_paused = 0;
typedef struct {
@CryZe
CryZe / asr.d.ts
Last active June 2, 2022 18:42
TypeScript Definition file for the new Auto Splitting Runtime
/**
* Sets the tick rate of the runtime. This influences the amount of times the
* `update` function is called per second.
*/
declare function setTickRate(ticksPerSecond: number): void;
/** Prints a log message for debugging purposes. */
declare function printMessage(message: unknown): void;
declare type Address = BigInt;
pub trait PopulateString {
fn populate(self, buf: &mut String);
fn as_str(&self) -> &str;
fn into_string(self) -> String {
let mut buf = String::new();
self.populate(&mut buf);
buf
}
}
@CryZe
CryZe / asl_abstraction.rs
Last active January 9, 2022 18:13
Slight abstraction layer for the new Auto Splitting runtime.
struct Eversleep {
time_info: Watcher<TimeInfo>,
}
impl<'a> AutoSplitter<'a> for Eversleep {
type Data = &'a Pair<TimeInfo>;
fn unhooked(&mut self) {
self.time_info.update(None);
}
@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