Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile
@milesrout
milesrout / meeting.txt
Created December 23, 2016 01:08 — forked from Olical/meeting.txt
Trillek design meeting log 1
* Now talking on ##secretsecret123
<Wolfy87> So stealthy.
<mrout> Sooooo stealthy.
* ChemicalRascal (~ChemicaRa@203.28.248.95) has joined ##secretsecret123
<ChemicalRascal> Boo.
<Wolfy87> 3/5 or so. Not bad.
<mrout> Secret secret indeed.
<mrout> Not bad at all.
<Wolfy87> Are we really expecting anyone else?
<ChemicalRascal> DarkSpartan, Terry indicated that they were able to make the time, I think.

Trillek Engine C

GNU/Linux (Gcc and CLang) Windows (VStudio 2015)
Build Status Build status

Building

TEC requires cmake 3.1 and a few libraries GLFW3, GLM, ASIO, Protobuf, GLEW, Lua, Bullet and OpenAL.

If you do not have cmake 3.1 (try cmake -version), to install on Linux, use the same procedure that we do on Travis CI:

@milesrout
milesrout / functions.php
Created June 27, 2016 09:54
DON'T USE THIS I WROTE IT WHEN I WAS A CHILD AND AM STILL EMBARRASSED BUT IT'S MOSTLY PHP'S FAULT FOR BEING AWFUL
<?php
function dbConnect($type, $SQLdata) {
$sqlPassData = array('error' => true);
if($type == 'query') {
$sqlPassData = array( 'user' => $SQLdata['queryUsername'],
'pwd' => $SQLdata['queryPassword']);
} elseif ($type == 'admin') {
@milesrout
milesrout / # fdisk -l devsda;
Last active June 10, 2016 07:53 — forked from anonymous/# fdisk -l devsda;
# fdisk -l /dev/sda;
# fdisk -l /dev/sda
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2c6ee985
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
@milesrout
milesrout / named_func.py
Last active June 6, 2016 00:05 — forked from louisswarren/named_func.py
Functions with human-readable representations
import inspect
def named_func(f):
return type('named_func', (), {
'__call__': lambda s, *a, **k: f(*a, **k),
'__repr__': lambda s: inspect.getsource(f),
'__str__': lambda s: f.__name__,
'__name__': f.__name__,
'__doc__': f.__doc__,
})()
@milesrout
milesrout / 000-dcpu16e
Last active October 29, 2017 04:35 — forked from MadMockers/gist:6365941
DCPU-16e 1.3
DCPU-16e Specification
Version 1.3
=== SUMMARY ====================================================================
* 16 bit words
* 8 banks of 0x10000 words of ram, numbered 0-7
* 8 registers (A, B, C, X, Y, Z, I, J)
The built in firmware of the Trillek computer could:
1) Do a quick check of how much RAM the computer has.
2) Search for devices and store their info in RAM.
3) Set up a monitor and keyboard, getting by default the monitor and keyboard with the lowest slot number.
In future, it could try to get from NVRAM which monitor and keyboard to use.
4) Print basic information about the computer such as total RAM, CPU speed, number of devices found and
hardware info.
5) If there is a floppy drive with a floppy disk, try to boot from it. It there are many, it would use the
floppy drive with the lowest slot.
int wcsArrayAdd(wchar_t ***array, int *cur_size, wchar_t *item)
{
int new_size = (*cur_size) + 1;
size_t len = wcslen(item);
wchar_t *tmp1 = NULL;
wchar_t **tmp2 = NULL;
/* alloc memory for item */
tmp1 = malloc((len + 1) * sizeof(wchar_t));
if (tmp1 == NULL) {
return ERROR_MEMORY;
@milesrout
milesrout / DMA.txt
Last active August 29, 2015 14:00 — forked from Zardoz89/DMA.txt
There are two types of interaction between devices and memory:
- Passive read
- Copy from RAM to device
- Copy from device to RAM
Passive reads work by "watching" the data/address bus when the CPU (or
other device) is writing to the RAM. Could keep sync a device internal
memory/buffer respect the changes that happens in these memory
block. This is simply implemented, reading the desired RAM block with
VComputer.RAM(). If a device does passive read to keep sync his

DCPU-16 Firmware Proposal

A revised proposal based on this document.

The following are unofficial modifications to the specification that describe how the firmware should work.

The provided code assumes that the eventual disk drive specifications match the M35FD disk drive specifications from a technical standpoint.

Modified by Miles Rout () to use a more modern dialect of DCPU-16 asm, along with a slight