Skip to content

Instantly share code, notes, and snippets.

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

Charles Taylor charlesastaylor

🏠
Working from home
View GitHub Profile
@charlesastaylor
charlesastaylor / RAD_Linker.jai
Last active May 31, 2025 14:30
Jai metaprogram plugin for linking with RAD Linker
//
// Metaprogram plugin for linking with RAD Linker - https://github.com/EpicGamesExt/raddebugger.
//
// Usage: `jai my_program.jai +RAD_Linker`. The link command is also exposed to be used in custom metaprogram.
//
// By default we expect to find radlink.exe in your path. When using the plugin you can provide a custom path with the
// -path option. When using run_rad_link_command from another metaprogram this can be overriden with the linker_path parameter.
// Or you can always just edit this file to your path!
LINKER_PATH :: "radlink.exe";
@charlesastaylor
charlesastaylor / arm64_drawing.jai
Created May 25, 2025 21:16
A silly example of using inline arm assembler
//
// Do some drawing with assembly! A small host program, that sets up graphics and memory then calls update_and_render
// which is implemented with inline assembly to do whatever it's heart desires.
//
// @TODO(Charles): Do something more interesting than the scrolling noise!
#if IS_CROSS_COMPILING {
#run,host {
#import "Basic";
;
; Doom Fire!
; Reference - https://fabiensanglard.net/doom_fire_psx/index.html
;
; @TODO:
; - Maybe fix wrapping of flames? Not sure if its flame buffer or screen buffer or how even, but it def wraps!
;
BITS 64
;RIP relative addressing by default. The other option is ABS. But if use ABS I get link errors. :shrug:
@charlesastaylor
charlesastaylor / -sna86.asm
Last active June 15, 2025 19:16
8086 assembly snake game!
; -------------------------------------------------------------------
; Sna86.
; An 8086 simulator snake!
; -------------------------------------------------------------------
;
; Assembly program intended to run in an 8086 simulator with functionaliy equal* to one made for homeworks
; up to Part 1 Episode 10 of the Peformance-Aware Programming Series (https://www.computerenhance.com/)
; by Casey Muratori. Demo - https://youtu.be/s_S4-QHeFMc.
;
; * mov, add, sub, cmp, je and jne was the target instructions. However I also added loop for convenience,