Skip to content

Instantly share code, notes, and snippets.

@ariscop
ariscop / memcpy.asm
Created March 2, 2023 13:09
rgbasm macro to unrolled loops
; unroll_loop_c N "loop body"
; unrolls to 2**N operations per loop using c as a the loop counter
; does not affect a, b, hl, de
; falls through on completion
MACRO unroll_loop_c
ASSERT FATAL, \1 > 0, "Must have depth > 0"
DEF BODY equs \2
for N, \1
: srl c
jr nc, :+
@ariscop
ariscop / decompress.asm
Created March 1, 2023 03:59
LZ3 decompressor for pokemon crystal, faster but larger and i plan on rewriting parts
MACRO ld_a_dei
ld a, [de]
inc de
ENDM
MACRO ld_hli_dei
ld a, [de]
ld [hli], a
inc de
ENDM
@ariscop
ariscop / ifr.txt
Created April 17, 2021 02:43
Dell G5 SE IFR Dump
UEFI Protocol Detected
--------------------------------------------------------------------------------
String Packages
--------------------------------------------------------------------------------
Offset: Language:
--------------------------------------------------------------------------------
0x1395AC en-US (0x0)
0x13A3C2 fr-FR (0x1)
@ariscop
ariscop / blueprint-storage.py
Created April 4, 2021 07:27
Partially reads blueprint-storage.dat, the file appear to be completely auto generated and its a chore to reverse engineer
#!/usr/bin/env python3
from pprint import pprint
from construct import *
class VersionStringAdapter(Adapter):
def _decode(self, obj, context, path):
return ".".join(map(str, obj))
Version = VersionStringAdapter(Int16ul[4])
@ariscop
ariscop / train_pathing_cost.gdb
Created March 4, 2021 03:13
awful gdb script to measure pathfinder cost by train in factorio
file factorio
set $train_id = (int)0
set $start = (unsigned long long)0
set $end = (unsigned long long)0
# for 1.1.26, linux build
break _ZN5Train11requestPathEPK4Rail13RailDirectionPK20InChainSignalSection
commands
@ariscop
ariscop / build.log
Created February 9, 2019 03:59
Building reactos with gcc 7.3
[91/9712] Performing configure step for 'host-tools'
-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
@ariscop
ariscop / with_macro.c
Created September 27, 2018 02:25
with macro in c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define with(_init, _fini) for(int _count = ((_init), 1); _count--; (_fini))
#define with_file(var, name, access) with(var = fopen(name, access), (var ? fclose(var) : 0 ))
void
test_macro(char *file)
From f114131ec986a3ff7f7668df1a31fb60daf980a6 Mon Sep 17 00:00:00 2001
From: Andrew Cook <ariscop@gmail.com>
Date: Sun, 11 Mar 2018 13:18:36 +1100
Subject: [PATCH] Reactos changes
---
Source/CMakeLists.txt | 12 ++
Source/CMakeVersionCompute.cmake | 1 +
Source/cmGeneratorTarget.h | 5 +-
Source/cmGlobalNinjaGenerator.cxx | 24 ++-
commit 09c06a2f457ec9557bcdf1809ecb4b50b2fb654a
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Fri Oct 27 22:18:01 2017 +0100
[CLANG-CL] Initial commit that allows us to compile ReactOS with clang-cl.
diff --git a/sdk/cmake/Platform/Windows-MSVC.cmake b/sdk/cmake/Platform/Windows-MSVC.cmake
index dc09c7479f2..5c3912cfeab 100644
--- a/sdk/cmake/Platform/Windows-MSVC.cmake
+++ b/sdk/cmake/Platform/Windows-MSVC.cmake
@ariscop
ariscop / script
Created October 2, 2015 02:32
Gdb script for logging backtraces when a function is called
set pagination off
set logging file gdb.txt
set logging on
break sendto_realops_snomask
commands
bt full
c
end