Skip to content

Instantly share code, notes, and snippets.

@Measter
Measter / CustomStack.cs
Created August 23, 2012 11:30
Stack Implementation Tests
using System;
using System.Diagnostics;
namespace StackProper
{
class PStack<T>
{
public class Node
{
public Node Next;
@Measter
Measter / main.asm
Created November 3, 2012 07:47
Basic Memory Allocator on the DCPU
; --------------------------------------------
; Title: MemoryTest
; Author: Measter
; date: 02/11/2012
; Version:
; -------------------------------------------
set pc, start
.include memory.asm
private static IEnumerable<int> FindFirstNumPrimes( int limit )
{
List<int> primes = new List<int>( new[] { 2 } );
bool isPrime;
int i = 1;
while( primes.Count < limit )
{
i += 2;
isPrime = true;
@Measter
Measter / Program.cs
Last active December 17, 2015 22:39
Color Benchmark
using System;
using System.Diagnostics;
using System.Drawing;
namespace ColorTest
{
class Program
{
static void Main( string[] args )
{
@Measter
Measter / 32-bit.asm
Created August 17, 2013 18:38
32-bit Multiplication on DCPU-16
; Multiplies two 32-bit numbers. Big Endian.
; Input
; SP+3 : Left half of first value.
; SP+2 : Right half of first value.
; SP+1 : Left half of second value.
; SP+0 : Right half of second value.
; Output
; SP+1 : Right half of result.
; SP+0 : Left half of result.
@Measter
Measter / Pointer.cs
Created October 11, 2013 08:08
Abusing Operator Overloads.
using System;
namespace PointerTest
{
public struct Pointer
{
public static byte[] Memory = new byte[UInt16.MaxValue];
private readonly UInt16 m_address;
@Measter
Measter / main.asm
Last active December 26, 2015 12:18
CoreRL written on the DCPU-16.Requires the library at https://github.com/Measter/lib
; -----------------------
; Title: Core RL
; Author: Measter
; Date: 2013/10/25
;
; Based on Core: A Minimal Roguelike.
; http://http://roguelikeeducation.org/1.html
; -----------------------
; Revisions
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
namespace ConsoleTestApp
{
class Program
{
private static readonly Font TxtFont = new Font( FontFamily.GenericMonospace, 10 );
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
namespace ConsoleTestApp
{
public class Pyramid
{
@Measter
Measter / long_mulu.X68
Last active August 29, 2015 14:03
Unsigned Longword Multiplication on the M68k
*-----------------------------------------------------------
* Title : Unsigned Longword Multiplication.
* Written by : Stuart Haidon
* Date : 2014-06-22
*-----------------------------------------------------------
* Longword Unsigned Multiplication.
* Pre:
* +4 : Multiplicand.
* +0 : Multiplier.