Skip to content

Instantly share code, notes, and snippets.

View Zardoz89's full-sized avatar

Luis Panadero Guardeño Zardoz89

View GitHub Profile
@rmmh
rmmh / DCPU16_cycle_count.md
Last active December 14, 2015 12:49
DCPU16 Cycle Count Proposal

Motivations

  • simplify cycle counting so it's easier to understand
  • make the time it takes to emulate 100kcycles more regular

Theory

Memory access has inconsistent costs currently. When decoding instructions it costs cycles, but things like [A] don't. For both a "real" DCPU and the emulator (assuming typical cache behavior), memory accesses are more expensive than register accesses.

@sybrandy
sybrandy / gist:5350590
Created April 10, 2013 00:10
This is an initial attempt to create a quickcheck library for D. It's not ready for distribution as I haven't used it much, but I wanted to get it out there for people to use if they want to.
/**
DQC - D QuickCheck
This is an attempt to create a version of QuickCheck for the D Programming
Language. This is an improvement over dashcheck as it has the following
features :
<ol>
<li>Better randomization of values.</li>
<li>Support for all basic D data types.</li>
anonymous
anonymous / gist:6443444
Created September 4, 2013 22:02
;KernelX
SET PC KernelInit
;Kernel Variables
:PromptStr DAT ">", 0 ;Null terminated even if only a single character.
:ShellRC DAT "autoexec", 0
:BatchMode DAT 0
:BatchAddress DAT 0
:DiskBufferPtr DAT 0x0000
:Zero DAT 0x0000 ;Useful for strcmp(zero, strOther) or something.
SPECIFICATIONS FOR DCPU/THRUSTER INTERFACE DRAFT 0.01
Name: UTI0001 - Universal Thruster Interface
ID: BFEC9661, verson: 0x0001
Manufacture: 0 (n/a)
0: NO_OF_SPEEDS
Writes the number of available speeds to the C register.
1: SET_SPEED
Reads the B register, and attempts to set the thruster to the specified
@Zardoz89
Zardoz89 / vimrc
Last active July 18, 2017 16:45
My vimrc for gvim
set nocompatible " Use Vim defaults (much better!)
filetype off " required!
if !has("unix")
" Vundle on Windows
set rtp+=~/vimfiles/bundle/Vundle.vim/
let path='~/vimfiles/bundle'
call vundle#begin(path)
set encoding=utf-8 " Fix ugly characters on menu and welcome screen
Specification of the IN8 (inate) 8-bit CPU
Registers
{ Named registers implemented by the IN8 CPU.
A, B - Accumulator
C, D, E - Scratch
H, L - Scratch, and memory access
IP - Special 16-bit instruction pointer
SP - Special 16-bit stack pointer
@AFulgens
AFulgens / MyBenchmark.java
Last active July 16, 2020 08:10
entrySet() vs. keySet()
package org.sample;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@Meisaka
Meisaka / DCPU-16N.txt
Last active February 9, 2021 18:30
DCPU redesigns
>>>>>>>>
DCPU-16N Instruction Set Architecture Specification
Copyrights 1984 Meisaka Yukara
Version 1.15
=================================== SUMMARY ====================================
* 16 bit CISC CPU design
* DCPU-16 compatibility functions
@Fishrock123
Fishrock123 / gulp.js
Last active August 1, 2021 11:19
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@kblomqvist
kblomqvist / githook-astyle.sh
Last active September 9, 2022 13:04
Git pre-commit hook to check C/C++ source file format using astyle (Artistic Style)
#!/bin/bash
# Installation:
# cd my_gitproject
# wget -O pre-commit.sh http://tinyurl.com/mkovs45
# ln -s ../../pre-commit.sh .git/hooks/pre-commit
# chmod +x pre-commit.sh
OPTIONS="-A8 -t8 --lineend=linux"
RETURN=0