Skip to content

Instantly share code, notes, and snippets.

View jdiez17's full-sized avatar

José Manuel Díez jdiez17

View GitHub Profile
var sys = require("sys"),
net = require("net"), exec = require('child_process');
var debug = 4;
//var client = net.createConnection(8000);
var __curr_process;
var client = net.createConnection(8000, "moodle.jdiez.me");
client.setEncoding("UTF8");
DCPU Debugging Symbols Standard
===============================
Version 1.0, by the DCPU Toolchain team.
Definitions
-----------
[uint8_t] -> An unsigned 8-bit word
[uint16_t] -> " " 16-bit word.
[uint32_t] -> " " 32-bit word.
@jdiez17
jdiez17 / gist:3157677
Created July 22, 2012 00:18
4x4x4 cube driver
#include <avr/pgmspace.h>
#define LAYER_TIME 3333
#define LAYER_BITS 16
#define FRAME_TIME 20
PROGMEM prog_uchar drip[] =
{
/* snip */
};
DT_PATH=$(HOME)/DCPUToolchain
CC=$(DT_PATH)/dtcc/dtcc
ASM=$(DT_PATH)/dtasm/dtasm
LD=$(DT_PATH)/dtld/dtld
EMU=$(DT_PATH)/dtemu/dtemu
STDLIB=$(DT_PATH)/stdlib-c/stdlib.dlib16
KERNEL=$(DT_PATH)/kernel/stubsys.dkrn16
JUMP=$(DT_PATH)/kernel/stubsys.djmp16
INCLUDE=${DT_PATH}/stdlib-c/include
void sped3_setup(void* pointer, unsigned int count)
{
__asm
{
SET PUSH, Y ; Preserve stack pointer
.IMPORT _stubapi_locate_device
SET A, 0x42ba ; Set the SPED3 ID (0x42babf3c)
SET B, 0xbf3c
JSR [_stubapi_locate_device] ; Call the locate_device system function
void sped3_rotate(unsigned int alpha)
{
__asm
{
SET PUSH, Y
.IMPORT _stubapi_locate_device
SET A, 0x42ba
SET B, 0xbf3c
JSR [_stubapi_locate_device]
void nop()
{
__asm
{
SET PC, PC
}
}
void rotate()
{
unsigned int idx = 0;
void* vertices = 0x5000;
/* top */
vertices[idx++] = 0x0000;
vertices[idx++] = 0x02ff;
vertices[idx++] = 0xff00;
vertices[idx++] = 0x02ff;
#include <ext/screen.h>
void main()
{
sped3_setup(vertices, 8);
eputs("Setup done!", 0, 0);
eputs("Rotation angle: ", 0, 2);
while(1)
{
#!/usr/bin/env python
import sys, requests
if __name__ == '__main__':
text = sys.stdin.readlines()
url = requests.post("http://paste.pm/post", {'content': text}).text
print "http://paste.pm" + url