Skip to content

Instantly share code, notes, and snippets.

@Frank-Buss
Frank-Buss / OlympicRings.hs
Created March 25, 2020 23:59
creates an olympic rings image and saves it as test.tga
-- creates an olympic rings image and saves it as test.tga
-- output: http://www.frank-buss.de/haskell/OlympicRings.png
import Data.Binary
-- image size
data Size =
Size
{ width :: Integer
, height :: Integer
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
private static System.Type[] types = {
typeof(Integer),
typeof(Long),
typeof(String)};
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
public void test(int ID)
{
System.Type types = {
typeof(Integer),
@Frank-Buss
Frank-Buss / test.cpp
Last active February 24, 2020 11:17
floating point tests with NTL lib
/*
To comppile it on Debian, first install the package libntl-dev:
sudo apt-get install libntl-dev
then you can compile and run it like this:
g++ test.cpp -lntl -o test ; ./test
output on my system:
mandelbrot calculation at point (-0.025, 0.643265)
#!/usr/bin/env python3
# This file is Copyright (c) 2019 Antti Lukats <[email protected]>
# This file is Copyright (c) 2019 msloniewski <[email protected]>
# License: BSD
import argparse
from migen import *
@Frank-Buss
Frank-Buss / counter.diff
Created November 25, 2019 23:33
cycle counter hack for X16 emulator
diff --git a/cpu/instructions.h b/cpu/instructions.h
index 09757cc..38dd1f1 100644
--- a/cpu/instructions.h
+++ b/cpu/instructions.h
@@ -505,3 +505,14 @@ static void tya() {
zerocalc(a);
signcalc(a);
}
+
+#include <inttypes.h>
@Frank-Buss
Frank-Buss / gameoflife.s
Created November 23, 2019 03:31
Game of Life implementation for Commander X16
; Game of Life implementation for Commander X16
; Copyright 2019 by Frank Buss
;
; compile with CC65 like this:
; cl65 --cpu 65c02 -t none -o gameoflife.prg gameoflife.s
VERA_ADDR_LO = $9f20
VERA_ADDR_MID = $9f21
VERA_ADDR_HI = $9f22
VERA_DATA0 = $9f23
@Frank-Buss
Frank-Buss / dmp2c.py
Last active October 25, 2019 11:43
converts a DefleMask DMP instrument file to a C array or binary file
#!/usr/bin/env python3
# Copyright (c) 2019, Frank Buss
# All rights reserved.
# based on a PHP script by Barry Yost
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
@Frank-Buss
Frank-Buss / logging.py
Created October 5, 2019 03:46
GPIB voltage logging with a Fluke 8842A
#!/usr/bin/python
# reads a voltage each 10 seconds and prints it
# sample output:
#
# instrument FLUKE,8842A,0,V3.0
# start Sat Oct 5 05:36:48 2019
#
# time voltage
# 0 4.191300
@Frank-Buss
Frank-Buss / snake.lua
Created September 26, 2019 11:13
Lua Player snake game
--[[
Snake, Copyright (c) 2005 Frank Buss <[email protected]> (aka Shine)
artworks by Gundrosen
coding by Shine
background music: "Stranglehold", composed by Jeroen Tel, (C) 1995 Maniacs of Noise
]]
-- default options
options = { speed = 2, level = "desert", music = "on", sound = "on" }