Skip to content

Instantly share code, notes, and snippets.

@t-mat
t-mat / mingw-gcc.bat
Last active September 16, 2026 21:56
mingw-gcc.bat
@setlocal enabledelayedexpansion & echo off
set "MINGW64_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/16.2.0-rt_v14-rev1/x86_64-16.2.0-release-win32-seh-ucrt-rt_v14-rev1.7z"
set "MINGW64_DIR=%~dp0.mingw64"
set "MINGW64_7Z_FILE=!MINGW64_DIR!\mingw64.7z"
set "MINGW64_GCC_EXE=!MINGW64_DIR!\mingw64\bin\gcc.exe"
if not exist "!MINGW64_DIR!" ( mkdir "!MINGW64_DIR!" )
if not exist "!MINGW64_DIR!" ( echo [%~nx0] FAIL : mkdir "!MINGW64_DIR!" & goto :ERROR )
@t-mat
t-mat / bison.bat
Last active September 13, 2026 06:05
bison.bat
@setlocal enabledelayedexpansion & echo off
set "BISON_VER=2.4.1"
set "BISON_BIN_URL=https://downloads.sourceforge.net/project/gnuwin32/bison/!BISON_VER!/bison-!BISON_VER!-bin.zip"
set "BISON_DEP_URL=https://downloads.sourceforge.net/project/gnuwin32/bison/!BISON_VER!/bison-!BISON_VER!-dep.zip"
set "BISON_DIR=%~dp0.bison"
set "BISON_BIN_ZIP_FILE=!BISON_DIR!\bison-bin.zip"
set "BISON_DEP_ZIP_FILE=!BISON_DIR!\bison-dep.zip"
set "BISON_EXE=!BISON_DIR!\bin\bison.exe"
@t-mat
t-mat / launch-ubuntu-26.04.cmd
Created April 27, 2026 02:58
Windows 11 batch file which automatically downloads, imports, invokes Ubuntu 26.04
@echo off
rem Windows 11 batch file which automatically downloads, imports, invokes Ubuntu 26.04
setlocal enabledelayedexpansion
set "UBUNTU_VER=26.04"
set "UBUNTU_COD=resolute"
set "UBUNTU_IMG=ubuntu-!UBUNTU_VER!-wsl-amd64.wsl"
set "UBUNTU_URL=https://releases.ubuntu.com/!UBUNTU_COD!/!UBUNTU_IMG!"
set "UBUNTU_NAM=public-documents-ubuntu-!UBUNTU_VER!"
set "UBUNTU_DIR=%PUBLIC%\Documents\!UBUNTU_NAM!"
@echo off
setlocal EnableDelayedExpansion
set "NUGET_DIR=%~dp0nuget"
set "DXC_DIR=!NUGET_DIR!\Microsoft.Direct3D.DXC\build\native\bin\x64"
set "DXC=!DXC_DIR!\dxc.exe"
REM --- Obtain nuget.exe ---
if not exist "!NUGET_DIR!" mkdir "!NUGET_DIR!"
if not exist "!NUGET_DIR!\nuget.exe" (
@t-mat
t-mat / isPowerOfTwo.cpp
Last active February 9, 2026 02:30
[C++20] isPowerOfTwo
#include <bit>
#include <concepts>
#include <stdio.h>
template <std::unsigned_integral T>
inline bool isPowerOfTwo(T x) {
return std::has_single_bit(x);
}
template <std::signed_integral T>
@t-mat
t-mat / aesni_generic.hpp
Created February 5, 2026 13:14
[C++]AES implementation mimicking x86 AES-NI instructions in software
// AES implementation mimicking x86 AES-NI instructions in software
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=aes
#ifndef AESNI_GENERIC_HPP_INCLUDED
# define AESNI_GENERIC_HPP_INCLUDED 1
# include <stdint.h>
namespace AesNiGeneric
{
namespace details
{
@t-mat
t-mat / build_gearmulator_with_vs2026.md
Created January 2, 2026 09:29
[Windows] Build gearmulator with Visual Studio 2026
cmd.exe
cd /d %PUBLIC%
git clone --recursive https://github.com/dsp56300/gearmulator.git
cd gearmulator
rmdir temp
cmake . -B %outdir% -G "Visual Studio 18 2026" -A x64 -Dgearmulator_BUILD_FX_PLUGIN=ON -DDSP56300_DEBUGGER=OFF
pushd %outdir%
cmake --build . --config Release
cmake -P ../../scripts/pack.cmake
@t-mat
t-mat / MouseReportRateTester.cpp
Last active November 29, 2025 10:09
[Windows] Mouse report rate tester
// Mouse report rate tester
#define WIN32_LEAN_AND_MEAN 1
#define UNICODE 1
#define NOMINMAX 1
#include <windows.h>
#include <hidusage.h>
#include <stdio.h>
#include <algorithm>
#include <chrono>
@t-mat
t-mat / import-ucrt.md
Last active November 7, 2025 12:45
Import Microsoft.Windows.SDK.CRTSource (MIT License)
cmd.exe
cd /d %PUBLIC%
rmdir /S /Q my-ucrt 1>nul 2>nul
mkdir       my-ucrt
cd          my-ucrt
curl -o ucrt.zip -L https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.CRTSource/10.0.22621.3
tar  xf ucrt.zip
del *.nuspec *.zip *.xml
@t-mat
t-mat / as-of-unity-6000-sv-vertexid-is-always-safe.md
Last active June 9, 2025 08:03
[Unity]Unity 6000 以降のモバイル、コンソール、PC 環境では常に SV_VertexID を使用可能

Unity 6000 以降のモバイル、コンソール、PC 環境では常に SV_VertexID を使用可能

まとめ

  • Unity 6000 以降では OpenGL ES2 のサポートが打ち切られている
  • OpenGL ES3 は SV_VertexID を使用可能
  • よって、Unity 6000 以降のモバイル、コンソール、PC 環境では常に SV_VertexID を使用可能

Unity 6000 以降では OpenGL ES2 のサポートは打ち切られている