Skip to content

Instantly share code, notes, and snippets.

View Zardoz89's full-sized avatar

Luis Panadero Guardeño Zardoz89

View GitHub Profile
@Zardoz89
Zardoz89 / plantillas razas
Last active August 29, 2015 14:13
Plantillas razas NSD20
Dotes
=====
Dote de Magia innata (2)
--------------------
El alma del personaje está estrechamente ligada a las energías arcanas, lo que les otorga cierto conocimiento innato de la magia. Pueden lanzar, como Aptitud sortílega, un conjuro de nivel 1 o dos conjuros de nivel 0 (a elegir durante la creación del personaje de entre la lista de conjuros).
Dote de Comunión con la Magia de la Ilusión (2)
--------------------
@Zardoz89
Zardoz89 / CPU datapath.md
Last active August 29, 2015 14:17
Other way for a CPU inspired on the TR3200

We could take a simple stage model like ARM Cortex-M3 , ie 3 stages model : Fetch, Decode and Execute.

Fetch only reads 4 bytes from RAM, to take the instruction and increases PC.

Decode, decodes an instruction and :

  • Fetch next 4 bytes without increasing the PC
  • If is prefix IF.cc, checks the condition and increases PC by 4.
    • If the condition is true, calls again the Decode stage using the fetch on Decode as instruction to be processed.
  • If the condition is false, don't call the Execute stage.
@Zardoz89
Zardoz89 / 1 CPU Datapath.md
Last active August 29, 2015 14:17
Changes to the next iteration of TR3200

We could take a simple stage model like ARM Cortex-M3 , ie 3 stages model : Fetch, Decode and Execute.

On Fetch stage :

  • Checks if there is a interrupt. If there are enabled and there is a interrupt handler for it, the CPU accepts it, initiating the interrupt sequence.
  • Reads 4 bytes from RAM
  • Increase PC by 4.

On Decode stage :

  • Decode instruction fetched on previus stage.
  • If the instruction have a long immediate value (M & L bits are 1)
/*-----------------------------------------------------
Author: <Zardoz>
Date: Fri May 31 15:53:33 2013
Description: BTC 1.6 audio codec player for uMicros
Original codec by Roman Black
Audio Codec description : http://www.romanblack.com/btc_alg.htm
-----------------------------------------------------*/
// NOTE : This output comes from RomamBlack BTc enconder that generates a MikroC
@Zardoz89
Zardoz89 / dm_leaky.py
Last active December 20, 2015 13:29
Delta Modulation with Leaky integrator
#!/usr/bin/env python3
import array
BYTES = 2 # N bytes arthimetic
MAX = 2 ** (BYTES * 8 - 1) - 1
MIN = - (2 ** (BYTES * 8 - 1)) + 1
CHUNK= 1024
@Zardoz89
Zardoz89 / btc.py
Last active December 20, 2015 20:49
Binary Time constant 1.0 codec and decoder example
#!/usr/bin/env python3
import array
BYTES = 2 # N bytes arthimetic
MAX = 2 ** (BYTES * 8 - 1) - 1
MIN = - (2 ** (BYTES * 8 - 1)) + 1
CHUNK= 1024
@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
@Zardoz89
Zardoz89 / DCPU-24.md
Last active February 12, 2018 09:22
Another CPU based on DCPU-16
layout title cat
default
DCPU-24 CPU
CPU

DCPU-24 Specification

Copyrights 1985 Mojang, Meisaka and zardoz of Trillek

Kubuntu 18.10 x64
CPU FX8370E
16GiB RAM
GPU RX580
@Zardoz89
Zardoz89 / div2.vim
Last active February 11, 2020 15:19
DIV2 syntax for VIM
" Vim syntax file
" Language: DIV2 language
" Maintainer: Luis Panadero Guardeño
" Latest Revision: 10-2-2020
if exists("b:current_syntax")
finish
endif
syn region divString matchgroup=divString start=+"+ end=+"+ oneline