Skip to content

Instantly share code, notes, and snippets.

View AliceLR's full-sized avatar

Alice R. AliceLR

View GitHub Profile
<?php
// NOTE: this code doesn't cause the segmentation fault very often, but if e.g. a large script
// is included here the crash happens more often.
if ($_GET['progress']) { var_dump(uploadprogress_get_info(strval($_GET['progress']))); die(); }
if ($_POST['UPLOAD_IDENTIFIER']) { die("it worked."); }
$uID = floor(microtime(true) * rand(0,65535));
?>
./megazeux.exe C:/a/MegaZeux/_testcases/mzxtests/graphics video_output=glsl gl_scaling_shader=nearest window_resolution=1280,700
2.92e (draw 4 vertices + texcoord):
* speed 1: 4760
* speed 1 smzx: 4345
* logicow.mzx: 260
* abuse0.mzx: 121
initialize char vertices in C but don't send:
* speed 1: 4770
@AliceLR
AliceLR / farutil.c
Last active October 15, 2020 09:48
Farandole Composer pattern length vs. break byte
#if 0
gcc -O3 -g -Wall -Wextra -pedantic farutil.c -o farutil
exit
#endif
// NOTE: this currently breaks on big endian machines.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
$ ./mixer.exe
Output samples: 4800000
Function: exo_mixer
0: 48000Hz <- 48000Hz, vol=256, chn=1, mode=FLAT : 22435 us
1: 48000Hz <- 48000Hz, vol=256, chn=2, mode=FLAT : 22965 us
2: 48000Hz <- 48000Hz, vol=179, chn=1, mode=FLAT : 26772 us
3: 48000Hz <- 48000Hz, vol=179, chn=2, mode=FLAT : 29794 us
4: 48000Hz <- 44100Hz, vol=256, chn=1, mode=Nearest : 28849 us
5: 48000Hz <- 44100Hz, vol=256, chn=2, mode=Nearest : 27272 us
#if 0
g++ -O3 -g -Wall -Wextra anticlick.cpp -oanticlick
exit 0
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <vector>
--------------------------------------------------------------------------------------------------
Most likely already fixed in #406:
--------------------------------------------------------------------------------------------------
src/loaders/iff.c:192:7: runtime error: member access within null pointer of type 'struct iff_info'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/loaders/iff.c:192:7 in
src/loaders/iff.c:46:7: runtime error: member access within null pointer of type 'struct iff_info'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/loaders/iff.c:46:7 in
src/loaders/mdl_load.c:851:22: runtime error: signed integer overflow: -2130738945 + -2139062144 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/loaders/mdl_load.c:851:22 in
diff --git a/src/scan.c b/src/scan.c
index 23d1f5ae..039f0b86 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -54,9 +54,9 @@ static int scan_module(struct context_data *ctx, int ep, int chain)
int parm, gvol_memory, f1, f2, p1, p2, ord, ord2;
int row, last_row, break_row, row_count, row_count_total;
int orders_since_last_valid, any_valid;
- int gvl, bpm, speed, base_time, chn;
+ int gvl, bpm, speed, chn;
/* crc32c.c -- compute CRC-32C using the Intel crc32 instruction
* Copyright (C) 2013, 2021 Mark Adler
* Version 1.2 5 Jun 2021 Mark Adler
*/
/*
This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
#if 0
[ -z "$PREFIX" ] && [ "$MSYSTEM" = "MINGW64" ] && { PREFIX=/mingw64; TARGET=filematch64; }
[ -z "$PREFIX" ] && [ "$MSYSTEM" = "MINGW32" ] && { PREFIX=/mingw32; TARGET=filematch32; }
[ -z "$PREFIX" ] && { PREFIX=/usr; }
[ -z "$TARGET" ] && { TARGET=filematch; }
echo "PREFIX=$PREFIX"
echo "TARGET=$TARGET"
g++ -O3 -Wall -Wextra -I"$PREFIX/include" filematch.cpp -o"$TARGET" -L"$PREFIX/lib" -lz
exit 0
#endif
@AliceLR
AliceLR / bus.py
Last active September 22, 2021 12:44
#!/usr/bin/env python
import math
import random
totalnotes = 256;
def clamp(n,mn,mx):
return max(mn,min(mx,n));