Skip to content

Instantly share code, notes, and snippets.

@CryZe
CryZe / LiveSplitCore.cs
Last active April 29, 2017 21:54
LiveSplitCore.cs
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;
namespace LiveSplitCore
{
public class AttemptRef
{
internal IntPtr ptr;
@CryZe
CryZe / main.rs
Last active May 22, 2017 02:34
deadlock
extern crate parking_lot;
use parking_lot::RwLock;
use std::sync::Arc;
use std::thread::sleep;
use std::time::Duration;
use std::thread::spawn;
fn main() {
let a = Arc::new(RwLock::new(()));
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
@CryZe
CryZe / PainPointsLiveSplitOneTechnologies.md
Last active June 14, 2023 08:43
Pain Points of LiveSplit One's Technologies

Pain Points of LiveSplit One's Technologies

npm

Works pretty well, but not having a lock file and accidentally relying on packages that are in the node_modules folder, but are not present in the package.json, causes some occasional breakages here and there.

webpack

Does what it's supposed to do. I can't think of any issues with it.

React

Fits the state model of livesplit-core really nicely and is a really good fit for LiveSplit One for that reason. The performance isn't all too great though. But that's really only a problem due to the 30 FPS refresh rate. For any normal web page React should be just fine.

#!/usr/bin/env python3
# coding: utf-8
import sys, ctypes
from ctypes import c_char_p, c_void_p, c_int8, c_int16, c_int32, c_int64, c_uint8, c_uint16, c_uint32, c_uint64, c_size_t, c_float, c_double, c_bool, c_char, c_byte
prefix = {'win32': ''}.get(sys.platform, './lib')
extension = {'darwin': '.dylib', 'win32': '.dll'}.get(sys.platform, '.so')
livesplit_core_native = ctypes.cdll.LoadLibrary(prefix + "livesplit_core" + extension)
@CryZe
CryZe / executor.rs
Last active February 9, 2018 15:50
use futures::future::{Future, ExecuteError, Executor};
use futures::executor::{self, Notify, Spawn};
use futures::Async;
use std::result::Result as StdResult;
use std::cell::{Cell, RefCell};
struct SpawnedTask {
is_queued: Cell< bool >,
// TODO use Rc<SpawnedTask> instead ?
ref_count: Cell< usize >,
trait Imports {
}
trait Memory {
fn load8(&mut self, addr: usize) -> u8;
fn load16(&mut self, addr: usize) -> u16;
fn load32(&mut self, addr: usize) -> u32;
fn load64(&mut self, addr: usize) -> u64;
fn store8(&mut self, addr: usize, val: u8);
use byteorder::{ByteOrder, BE};
use goblin::archive::Archive;
use goblin::elf::{section_header, sym, Elf, Reloc};
use std::collections::{BTreeMap, BTreeSet};
fn symbols_referenced_in_section<F>(section_index: usize, elf: &Elf, mut f: F)
where
F: FnMut(usize),
{
if let Some(reloc_table) = reloc_table_for_section(section_index, elf) {
@CryZe
CryZe / libm.rs
Created May 4, 2018 02:35
libm.rs
This file has been truncated, but you can view the full file.
#![allow(
unreachable_code, dead_code, unused_assignments, unused_mut, unused_variables, non_snake_case,
non_upper_case_globals, unconditional_recursion, path_statements
)]
pub const PAGE_SIZE: usize = 64 << 10;
pub trait Imports {
type Memory: Memory;
fn __start(&mut self, context: &mut Context<Self::Memory>);
@CryZe
CryZe / Performance.md
Created May 11, 2018 15:43
Web Timer Performance Comparison

Performance

All (sorted by CPU Usage)

Timer FPS CPU Usage
websplit 10 FPS ~5%
LiveSplit One 10 FPS ~9%
nwsplit 10 FPS ~16%
LiveSplit One 30 FPS ~18%