Skip to content

Instantly share code, notes, and snippets.

If MF_NEW_LEG is not set, then do nothing at all
If MF_TURN is not set, then just walk one step
If MF_TURN is set
we have reached a walk target (may not be the users requested destination)
If MF_IN_LEG is set, we have reached our final destination/target. Stop Actor Moving completely
If MF_IN_NOT is not set, we have reached the current target
Check the walk box number, is it the final destination walk box
Yes: Set the next walk destination to the X/Y the user clicked, set MF_IN_LEG… do calcMovementFactor
No: Get the next walkbox, check its flags, calculate the point we should walk to inside this box (towards the final destination), do calcMovementFactor
@segrax
segrax / Windows 7 Manual Installation
Last active June 9, 2016 21:28
Windows 7 manual installation
Overview
--------
Windows Setup has an issue when its booted from a Kingston USB3, setup refuses to allow installing to the hard drive
Instructions for installing Windows7
------------------------------------
Boot windows installation from USB drive
Press Shift+F10
@segrax
segrax / Amiga_Lemmings_Codes
Created December 22, 2015 06:47
Lemmings Codes
Fun:
Level6: DLCIJNLGCT
Level7: LCANLLDHCO
Level8: CINNLDLICJ
Level9: CEKHMDLJCO
Level10: MKHMDLCKCX
Level11: OJMLLBELCN
Level12: HMDLCINMCY
Level13: MDLCAKLNCS
@segrax
segrax / FreeBSD_ManualInstall
Last active July 6, 2017 21:43
FreeBSD manual install on zfs
mdconfig -a -t vnode -f FreeBSD-11.0-RELEASE-amd64-disc1.iso
mount -t cd9660 /dev/md0 /cdrom
zfs create pool/os
zfs create pool/os/fbsd11
export DESTDIR=/pool/os/fbsd11
cd /cdrom/usr/freebsd-dist
@segrax
segrax / ConvertSpriteData.php
Last active September 6, 2015 23:44
Convert structures of sprite data and change address to a relative address, instead of an absolute
<?php
/*
*
const sSpriteSheet* stru_8C358[] = {
{ 0x57F60, 0, 2, 0xE, 0x3480, 0 },
{ 0x57F62, 0, 2, 0xE, 0x3480, 0 },
{ 0x57F64, 0, 2, 0xE, 0x3480, 0 },
};
@segrax
segrax / BytesToSigned.php
Last active August 29, 2015 14:25
Take an array of bytes, and output a series of signed integers (16bit)
<?php
$data = array(
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
);
$final = array();
@segrax
segrax / X64 Memory Paging
Last active August 29, 2015 14:16
Calculating Indexs from a virtual address
PML4 Directory Ptr Page Directory Page Table Page Offset
x-xxxx-xxxx x-xxxx-xxxx x-xxxx-xxxx x-xxxx-xxxx XXXX-XXXX-XXXX
$address = 0xFF8000000000;
$pml4 = ($address & 0xFF8000000000) >> 39;
$pdp = ($address & 0x7FC0000000) >> 30;
$pd = ($address & 0x3FE00000) >> 21;
$pt = ($address & 0x1FF000) >> 12;
@segrax
segrax / x64_function_call_register_use
Last active August 29, 2015 14:16
x64 CPU Register function call usage
RAX temporary register; with variable arguments passes information about the number of vector registers used; 1st return register
RDI used to pass 1st argument to functions
RSI used to pass 2nd argument to functions
RDX used to pass 3rd argument to functions; 2nd return register
RCX used to pass 4th argument to functions
R8 used to pass 5th argument to functions
R9 used to pass 6th argument to functions
@segrax
segrax / MemorySegments
Last active August 29, 2015 14:12
Memory Segment Calculations
To calculate the segment of a memory address,
Memory Address >> 4 = Segment
-----------------------------
0xFFFF0 >> 4 = 0xFFFF
To calculate the memory address from a segment
Segment << 4 = Memory Address
@segrax
segrax / BSD Youtrack rc script
Last active January 22, 2023 00:12 — forked from artuomvproskunin/BSD Youtrack rc script
Youtrack Startup script
#!/bin/sh
# $FreeBSD: head/devel/youtrack/files/youtrack.in 329474 2013-10-05 16:11:37Z lwhsu $
#
# PROVIDE: youtrack
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for youtrack in /etc/rc.conf: