Skip to content

Instantly share code, notes, and snippets.

@weirddan455
weirddan455 / crash.txt
Created January 25, 2025 21:05
Dosbox Staging Cmake Crash
date time |
2025-01-25 15:03:34.954 | arguments: ./dosbox
2025-01-25 15:03:34.954 | Current dir: /home/daniel/code/dosbox-staging/build/release
2025-01-25 15:03:34.954 | stderr verbosity: 0
2025-01-25 15:03:34.954 | -----------------------------------
2025-01-25 15:03:34.954 | dosbox-staging version 0.83.0-alpha ()
2025-01-25 15:03:34.954 | ---
2025-01-25 15:03:34.954 | LOG: Loguru version 2.1.0 initialised
2025-01-25 15:03:34.957 | CONFIG: Loaded primary config file '/home/daniel/.config/dosbox/dosbox-staging.conf'
2025-01-25 15:03:34.957 | LOCALE: Using internal English language messages (detected from 'LANG=en_US.UTF-8')
@weirddan455
weirddan455 / open-delete.asm
Created January 5, 2025 06:46
Read after delete DOS test
org 100h
section .text
; open file
mov ah, 3dh
mov al, 0h
lea dx, [file_name]
int 21h
jc open_error_fn
@weirddan455
weirddan455 / main.rs
Created December 17, 2024 19:44
Advent of Code Day 15 Part 2 (not working)
use std::ops::{Add, AddAssign};
#[derive(Clone, Copy)]
enum Direction {
Up,
Down,
Left,
Right
}
@weirddan455
weirddan455 / main.rs
Created December 7, 2024 11:39
Advent of Code Day 7 Part 2
struct Equation {
result: u64,
ops: Box<[u64]>
}
fn parse_input() -> Vec<Equation> {
let mut eqs = Vec::new();
for line in std::fs::read_to_string("input").unwrap().lines() {
let (r, o) = line.split_once(':').unwrap();
let result: u64 = r.parse().unwrap();
@weirddan455
weirddan455 / quest15.rs
Created November 23, 2024 10:57
Everybody Codes Quest 15 Part 3
use std::collections::{HashSet, VecDeque};
const WALL: u8 = 128;
const EMPTY: u8 = 64;
const POS_MASK: u64 = 0x00000000ffffffff;
const HERB_MASK: u64 = 0xffffffff00000000;
struct Grid {
width: u64,
@weirddan455
weirddan455 / main.rs
Created July 7, 2024 14:45
Advent of Code 2023 Day 14 Part 2
struct Grid {
width: usize,
height: usize,
data: Vec<u8>
}
fn get_grid() -> Grid {
let mut grid = Grid {
width: 0,
height: 0,
@weirddan455
weirddan455 / main.rs
Last active June 27, 2024 13:49
Advent of Code 2023 Day 5 Part 2
#[derive(Default)]
struct Map {
dst: u64,
src: u64,
range: u64
}
#[derive(Default)]
struct Seed {
start: u64,
@weirddan455
weirddan455 / part1.c
Created December 28, 2022 15:41
Advent of Code Day 24 Part 1
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#define BLIZZARD_LEFT 1
@weirddan455
weirddan455 / day25.c
Created December 28, 2022 00:12
Advent of Code Day 25
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
static long read_digit(char c)
{
switch (c) {
case '-':
return -1;
@weirddan455
weirddan455 / part2.c
Created December 19, 2022 09:45
Advent of Code Day 18 Part 2
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define EMPTY 0
#define LAVA 1
#define WATER 2
#define BOUNDS 3