Skip to content

Instantly share code, notes, and snippets.

@hikiko
hikiko / palset.asm
Created September 29, 2019 19:02
Asm/DOS: setting custom palette
; vi:filetype=nasm:
bits 16
; DOS loads COM programs at offset 100h (256) of the program segment
; therefore we need to let the assembler know, that everything should
; start from address 100h
org 100h
; video bios (10h) call 00h: set video mode
; ah: 00h, al: video mode number
mov ax, 13h ; mode 13h (320x200 8bpp)
@hikiko
hikiko / Makefile
Created September 29, 2019 19:01
Makefile for dosbox asm (nasm)
test.com: test.asm
%.com: %.asm
nasm -o $@ -f bin $<
.PHONY: clean
clean:
rm -f test.com
@hikiko
hikiko / main.rs
Created September 15, 2019 12:44
my helloworld in Rust (not proud)
extern crate sdl2;
extern crate gl;
extern crate image;
use sdl2::video::GLProfile;
use gl::types::*;
use image::GenericImageView;
static WIN_W : u32 = 800;
static WIN_H : u32 = 800;
@hikiko
hikiko / helloworld.asm
Last active July 26, 2019 19:24
ASM helloworld (nasm)
;32bit x86 code
[bits 32]
[section .text]
global _start
_start:
;linux specific
;interrupt 80hex for system calls
@hikiko
hikiko / nasm Makefile
Created July 24, 2019 20:03
nasm Makefile
obj = helloworld.o
bin = helloworld
$(bin): $(obj)
ld -m elf_i386 -o $@ $(obj)
%.o: %.asm
nasm -o $@ -f elf32 $<
.PHONY: clean
@hikiko
hikiko / checkerboard.shader_test.glsl
Created May 29, 2019 13:35
vkrunner test that generates a checkerboard pattern
[require]
fbsize 800 600
[vertex shader passthrough]
[fragment shader]
#version 450
float checkerboard(in vec2 uv)
{
vec2 pos = floor(uv);
@hikiko
hikiko / plasma.shader_test.glsl
Created May 6, 2019 18:37
A vkrunner shader test that renders a plasma
[require]
fbsize 800 600
[vertex shader passthrough]
[fragment shader]
#version 450
layout(location = 0) out vec4 out_color;
@hikiko
hikiko / tunnel.shader_test.glsl
Created May 6, 2019 17:18
A shader test for vkrunner that draws a voronoi tunnel.
[require]
fbsize 800 600
[vertex shader passthrough]
[fragment shader]
#version 450
layout(location = 0) out vec4 out_color;
@hikiko
hikiko / fractal.shader_test.glsl
Last active May 6, 2019 17:08
A vkrunner compatible shader test that renders a mandelbulb fractal (ray marching).
[require]
vulkan 1.1.3
fbsize 800 600
[vertex shader passthrough]
[fragment shader]
#version 450
#define T 0.001 //threshold
@hikiko
hikiko / require.shader_test.glsl
Created May 2, 2019 13:39
required.shader_test I use to experiment with the vkrunner version
[require]
vulkan 1.1.3
[vertex shader passthrough]
[fragment shader]
#version 430
layout(location = 0) out vec4 out_color;