Skip to content

Instantly share code, notes, and snippets.

@FrankBuss
FrankBuss / test.asm
Created Sep 8, 2019
ACME test for Command X16
View test.asm
; comppile with ACME (https://sourceforge.net/projects/acme-crossass/ )
; acme -f cbm -o test.prg test.asm
;
; then start in the emulator:
; x16emu -run test.prg
*=$0801
!byte $0b,$08,$01,$00,$9e,$32,$30,$36,$31,$00,$00,$00
@FrankBuss
FrankBuss / test.txt
Created Sep 8, 2019
Commander X16 speed test
View test.txt
VPOKE4,0,33
MON
A0400 SEI
LDA #$04
STA $9F20
LDA #$02
STA $9F21
LDA #$00
STA $9F22
STA $9F23
@FrankBuss
FrankBuss / smiley.bas
Created Sep 7, 2019
show a smiley sprite with Commander X16
View smiley.bas
10 REM ADDRESS 12:5
20 VPOKE 4, $800, 0
30 REM ADDRESS 16:13 (STARTING AT $10000) AND 8 BPP MODE
40 VPOKE 4, $801, $88
50 REM X COORDINATE 7:0
60 VPOKE 4, $802, 220
70 REM X COORDINATE 9:8
80 VPOKE 4, $803, 0
90 REM Y COORDINATE 7:0
100 VPOKE 4, $804, 55
View fmtest.py
#!/usr/bin/python3
import pyaudio
import numpy as np
import sys
import time
import math
p = pyaudio.PyAudio()
@FrankBuss
FrankBuss / beeps.py
Created Jun 14, 2019
create a sequence of beeps with configurable pauses
View beeps.py
#/usr/bin/python3
# play a sequence of beeps
# based on https://stackoverflow.com/a/27978895/3210924
import pyaudio
import numpy as np
from numpy import zeros
import sys
import time
@FrankBuss
FrankBuss / slowdown.lua
Created Jun 10, 2019
testing a slowdown Lua script for VCV Rack
View slowdown.lua
-- max buffer length in seconds
length = 10
addLabel(50, 125, "Input", 20)
addLabel(50, 165, "Trigger", 20)
addLabel(50, 205, "Delay", 20)
addLabel(190, 125, "Output", 20)
input = addInput(20, 120)
trigger = addInput(20, 160)
delay = addInput(20, 200)
@FrankBuss
FrankBuss / emulator.cpp
Last active Dec 19, 2019
RISC-V emulator (RV32I only) in one C++ file
View emulator.cpp
/*
See https://gitlab.com/nedopc/npc5/blob/master/emu-rv32i.c for the latest version, with more features and less bugs :-)
RISCV emulator for the RV32I architecture
based on TinyEMU by Fabrice Bellard, see https://bellard.org/tinyemu/
stripped down for RV32I only, all "gotos" removed, and fixed some bugs for the compliance test
by Frank Buss, 2018
Requires libelf-dev:
View blinky.c
// set these fuse bits to 0:
// CKDIV8, SUT0, CKSEL3, CKSEL2, and CKSEL0
// the CPU clock is 31250 Hz
#define F_CPU 31250
#include <avr/io.h>
#include <avr/power.h>
#include <util/delay.h>
View nand-table.py
# create a NAND lookup table
#!/usr/bin/python3
import sys
for i in xrange(256):
if i % 16 == 0:
sys.stdout.write(" .db ")
# PB1 input
View nand.asm
; ATTiny25 implementation of a NAND
; PB1 and PB2 is input, with pullups, and PB0 is output
; fuse settings: disable CKDIV8 for 8 MHz clock
start:
; set PB0 as output, all other pins as input
ldi r20, 1
out DDRB, r20
You can’t perform that action at this time.