Skip to content

Instantly share code, notes, and snippets.

font.base=$(font.monospace)
font.small=$(font.monospace)
font.comment=$(font.monospace)
font.text=$(font.monospace)
font.text.comment=$(font.monospace)
font.embedded.base=$(font.monospace)
font.embedded.comment=$(font.monospace)
font.vbs=$(font.monospace)
wrap=0
@leonkasovan
leonkasovan / rpi5_setup_dev.txt
Last active March 20, 2025 04:35
Setup Dev Environment for Raspberry Pi 5
wget https://go.dev/dl/go1.24.1.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.24.1.linux-arm64.tar.gz
sudo apt install apt-file fd-find scite
sudo apt-file update
# for building Ikemen
sudo apt install libwayland-dev libxkbcommon-dev libasound2-dev libssl-dev
sudo apt install fd-find
-- Lua script for verifying Ikemen's game assets
-- [email protected]
-- 20.10 Selasa, 01 Oktober 2024
path_sep = '/'
local f_validation = io.open("validation"..os.date("%Y%m%d_%H%M%S")..".txt", "w")
if f_validation == nil then
print("Error: Can not create validation.txt")
return
end
@leonkasovan
leonkasovan / is_keyboard.c
Last active December 27, 2024 11:09
Check device path is a valid keyboard
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/input.h>
#include <string.h>
// Function to check if the input device is a keyboard
int is_keyboard(const char *device_path) {
@leonkasovan
leonkasovan / recalbox_kmsdrm.log
Created December 25, 2024 05:24
recalbox_kmsdrm.log
drm-common.c:find_drm_device: drmGetDevices2
drm-common.c:find_drm_device: open /dev/dri/card0
drm-common.c:get_resources:find_drm_device: drmModeGetResources
drm-common.c:find_drm_device: drmFreeDevices
drm-common.c:find_drm_connector: drmModeGetConnector
drm-common.c:find_drm_connector: drmModeFreeConnector
drm-common.c:find_drm_connector: drmModeGetConnector
drm-common.c:init_drm: drmModeGetEncoder
drm-common.c:init_drm: drmModeFreeEncoder
drm-common.c:init_drm: drmModeGetEncoder
@leonkasovan
leonkasovan / KMSDRM_GLES_SwapWindow.c
Created December 8, 2024 22:16
KMSDRM_GLES_SwapWindow to be ported into GLFW
KMSDRM_GLES_SwapWindow;
a. KMSDRM_CreateSurfaces
b. KMSDRM_WaitPageflip
c. KMSDRM_gbm_surface_release_buffer
d. eglSwapBuffers
e. KMSDRM_gbm_surface_lock_front_buffer
f. KMSDRM_FBFromBO -> KMSDRM_drmModeAddFB
g. KMSDRM_drmModeSetCrtc OR KMSDRM_drmModePageFlip -> KMSDRM_WaitPageflip
@leonkasovan
leonkasovan / settings.json
Created November 30, 2024 14:48
Visual Code Recommend Default Setting
///C:/Users/Personal Komputer/AppData/Roaming/Code/User/settings.json
{
"editor.minimap.enabled": false,
"extensions.ignoreRecommendations": true,
"git.openRepositoryInParentFolders": "never",
"diffEditor.ignoreTrimWhitespace": true,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
@leonkasovan
leonkasovan / main.c
Created November 9, 2024 03:51
Command line tool to test shader compiler (using OpenGL + SDL2).
/*
Command line tool to test shader compiler (using OpenGL + SDL2).
Run it inside folder that contains shader files.
If filename consists "frag" then it treat as fragment shader.
If filename consists "vert" then it treat as vertex shader.
If filename consists "geo" then it treat as geometry shader.
Build:
gcc main.c -o compile_shader -lGL `sdl2-config --cflags --libs`
*/
@leonkasovan
leonkasovan / compile_shader.go
Created November 8, 2024 10:28
Compile OpenGL shader using GLFW
package main
import (
"fmt"
"io/ioutil"
"log"
"runtime"
"os"
"path/filepath"
"strings"
// #include <string>
#include <map>
std::map<std::string, int> scrapeId{
{"megadrive",1},
{"snes",4},
{"psx",57},
{"ps2",58}
};