Skip to content

Instantly share code, notes, and snippets.

@triplefox
triplefox / allocation_death.go
Created March 5, 2019 19:10
Test case for go-glfw dying due to memory allocation
// allocation_death.go
package main
import (
_ "image"
"github.com/go-gl/gl/v4.1-core/gl"
"github.com/go-gl/glfw/v3.2/glfw"
)
const Builder = @import("std").build.Builder;
const builtin = @import("builtin");
pub fn build(b: *Builder) void {
const exe = b.addExecutable("romlua", "romlua.zig");
exe.addCSourceFile("lua-5.3.5/src/lapi.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lauxlib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lbaselib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lbitlib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lcode.c",[][]const u8{"-std=c99"});
In file included from C:\zig\romlua\lua-5.3.5\src\lapi.c:16:
In file included from C:\zig\romlua\lua-5.3.5\src/lua.h:13:
C:\zig\zig-windows-x86_64-0.4.0+6b36b756\lib\zig\include\stddef.h:62:23: error: typedef redefinition with different
types ('unsigned long' vs 'unsigned int')
typedef __SIZE_TYPE__ size_t;
^
C:\zig\zig-windows-x86_64-0.4.0+6b36b756\lib\zig\libc\include\generic-musl\bits/alltypes.h:88:24: note: previous
definition is here
typedef unsigned _Addr size_t;
^
@triplefox
triplefox / parallax.bas
Created June 9, 2024 21:54
Parallax scrolltext example
10 VDU 22, 132 : REM DOUBLE BUFFERED 640X240
20 VDU 26
30 VDU 23, 0, &C0, 0
40 VDU 23, 0, &C1, 0
50 VDU 23, 16, &51, &51 : REM MAKE TEXT CURSOR NOT WRAP OR SCROLL
400 VDU 5 : REM USE PLOT POSITION
405 DV = 1 / (240 * (3.14159) * 2)
410 X1 = 0
450 X0 = 0
460 X1 = (X1 + 1)