Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile

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

@milesrout
milesrout / messiestever.cpp
Last active November 25, 2019 09:19
Officially The Messiest Code Ever
#include <map>
#include <list>
#include <string>
#include <iostream>
using namespace std;
enum struct token_type {
ID, // identifier
HEX, // hexidecimal integer
#include <cstdio>
#include <cstdint>
#include <string>
#include <boost/spirit/include/lex_lexertl.hpp>
#include <boost/spirit/include/qi.hpp>
namespace jupiter {
namespace lex = boost::spirit::lex;
namespace qi = boost::spirit::qi;
OS Interface:
It has a layered interface.
It needs to work on different platforms, such the TR3200, the DCPU-16 and the DCPU-16e.
Therefore it needs to split the following up:
User mode user processes (Layer 4)
User mode system processes (layer 3)
@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 Specification
Copyright 1985 Mojang
Version 1.7
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram
#define GL_GLEXT_PROTOTYPES
#include <GLFW/glfw3.h>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <fstream>
#include <iostream>
using namespace std;
template <typename T, typename = typename std::enable_if<std::is_floating_point<T>::value, void>::type>
constexpr T pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798;
int main()
{
float radiusf;
DCPU-16 Specification
Copyright 1985
Version 1.7
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram
* 8 registers (A, B, C, X, Y, Z, I, J)
* program counter (PC)
# Determine whether, in any state, the expected chosen prize is greater than the maximum prize
from itertools import combinations
from math import log, exp
cases = {1,10,100,1000}
maxprize = 200
s = set.union(*[set(combinations(cases, i)) for i in range(1, len(cases)+1)])
ss = sorted(s)