Skip to content

Instantly share code, notes, and snippets.

View cbmeeks's full-sized avatar
🏠
Working from home

cbmeeks cbmeeks

🏠
Working from home
View GitHub Profile
@cbmeeks
cbmeeks / propeller_colors.spin
Created January 8, 2016 18:42
Propeller Color Values
{{
──────────────────────────────────────────────
Color Encoding Table
──────────────────────────────────────────────
C3 - C0 = Chroma Phase Shift
M = Modulation Enable
L2 - L0 = Luma Value
──────────────────────────────────────────────
Bit Encoding
Signal C3 C2 C1 C0 M L2 L1 L0
@cbmeeks
cbmeeks / _optimization.java
Last active December 10, 2015 17:23
Optimization
@Theme("demo")
public class OptimizationUI extends UI {
private static final long serialVersionUID = 8621351077936927377L;
@Override
public void init(VaadinRequest request) {
String str = "<table width=\"100%\"><tr><td width=\"600px\"></td><td></td></tr>";
@cbmeeks
cbmeeks / zx_spectrum_vram_calc.js
Last active June 3, 2017 06:54
ZX Spectrum Pixel Address Calculator
var addr = function(L, C, R) {
return 16384 + 2048 * Math.floor(L / 8) + 32 * (L - 8 * Math.floor(L / 8)) + 256 * R + C;
};
@cbmeeks
cbmeeks / ULA_TEST_1.spin
Created October 16, 2015 13:02
ZX Spectrum ULA Driver for Parallax Propeller
CON
_CLKMODE = xtal2 + pll8x
_XINFREQ = 10_000_000 + 0000
VAR
BYTE Screen[6912]
OBJ
@cbmeeks
cbmeeks / toggle.spin
Last active October 14, 2015 15:51
PASM Toggle Bit
DAT
org 0
entry mov dira, #1 'set P0 as output
:loop mov count, delay 'setup delay
xor outa, #1 'invert P0
:here djnz count, #:here 'delay
jmp #:loop
count long 0
delay long 80,000,000 '1s delay (current clock speed 80MHz)
@cbmeeks
cbmeeks / ntsc.spin
Last active October 14, 2015 04:03
Minimal NTSC
CON
_CLKMODE = RCSlow ' Start prop in RCSlow mode internal crystal
PUB main
clkset(%01101000, 12_000_000) ' Set internal oscillator to RCFast and set PLL to start
waitcnt(cnt + 120_000) ' wait approx 10ms at 12mhz for PLL to 'warm up'
@cbmeeks
cbmeeks / ntsc.spin
Created October 11, 2015 05:54
Minimal NTSC Template for Propeller -- NON Interlace (262 lines)
CON
_CLKMODE = RCSlow ' Start prop in RCSlow mode internal crystal
PUB main
clkset(%01101000, 12_000_000) ' Set internal oscillator to RCFast and set PLL to start
waitcnt(cnt+120_000) ' wait approx 10ms at 12mhz for PLL to 'warm up'
clkset( %01101111, 80_000_000 ) ' 80MHz (5MHz PLLx16)
coginit( COGID, @cogstart, @cogstart )
@cbmeeks
cbmeeks / swapGH.js
Created July 9, 2015 13:21
Swap the README.md and file list in GitHub repos
$('#readme').insertBefore('.file-navigation');
@cbmeeks
cbmeeks / vga.spin
Created March 28, 2015 03:07
VGA Driver
''********************************************
''* VGA 128x96 64-Color Bitmap Driver v1.0 *
''* Author: Andy Schenk *
''* See end of file for terms of use. *
''********************************************
''* based on Chip Gracey's 512x384 Bitmap driver
''
'' This object generates a 128x96 pixel bitmap, signaled as 1024x768 VGA.
'' Each pixel is one byte, so the entire bitmap requires 12 kbytes,
'' Pixel memory is arranged left-to-right then top-to-bottom.
@cbmeeks
cbmeeks / custom.css
Created December 23, 2014 14:52
Static button using Materialize
.right-buttons {
bottom: 0;
margin-bottom: 20px;
position: fixed;
right: 0;
}