Skip to content

Instantly share code, notes, and snippets.

View dogtopus's full-sized avatar
🦄
Unicorn!

dogtopus

🦄
Unicorn!
View GitHub Profile
@dogtopus
dogtopus / bitting.scad
Created October 29, 2024 04:05
Parametric bitting profile (incomplete)
include <MCAD/units.scad>
/* [Key parameters] */
// The type of the key.
Key_Type = "sc1"; // [kw1: Kwikset KW1, sc1: Schlage SC1, american_5: American 5-pin, american_6: American 6-pin]
// An array of numbers that represent the cuts on the bitting, usually from the shoulder of the key to the tip. The exact meaning of this option depends on the key type.
Bitting_Code = [3, 4, 2, 5, 1, 0];
// End of customizer variables.
/* [Hidden] */
@dogtopus
dogtopus / prepare_test.sh
Created July 19, 2024 15:55
Muteki toolchain testbench
#!/bin/bash
arm-none-bestaeabi-gcc -Wall -g -O2 test.c -o test.elf -lmutekix && elf2bestape test.elf
@dogtopus
dogtopus / besta.md
Last active April 18, 2025 03:01
Besta device list
Board # SKU Release year (est. range) CPU Type Architecture SoC RAM Card type Slots Battery type Note
BA110 TW CD-123
CN CD-580(+)
2009-2012 Arm Arm7TDMI (?) Winbond/Nuvoton W55SA7101 SDRAM 8MiB None None LR03 (AAA) x2 CN CD-580+ is technically BA110L (L probably stands for Light, which corresponds to the added screen backlight capability)
BA358, CA358, KA358 CN WN-10
TW CD-952/CD-956
KR BK-500
2018 Arm Arm926EJ-S Nuvoton N32926U1DN DDR2 SDRAM 64MiB (on SoC) microSD 1 1ICPt42/50/80-1 (425080) Has an H.264 block that's worth looking into.
BA735, CA735 TW CD-858 pro "Big mac"
NA/SG/MY CD-628 pro
HK 9800 (?)
2006-2007 TLCS-900 TLCS-900/H1 (?) Toshiba "T5BX1A" SDRAM 8MiB SD 2 Casio NP-20
BA742, CA742 CN WuDi V7TW CD-877 2010-2012 Arm Arm926EJ-S NXP i.MX233 D
@dogtopus
dogtopus / nand.c
Last active January 12, 2025 06:48
Besta RTOS NAND dumper. Note that most boards I came across don't have proper support for the nand_* API so this likely wouldn't work as expected on boards other than BA110L, BA742 and KA745C.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <muteki/ui/event.h>
#include <muteki/ui/canvas.h>
#include <muteki/errno.h>
#include <muteki/ftl.h>
@dogtopus
dogtopus / flycode.py
Last active February 12, 2024 23:45
I hate eye strains
import itertools
def encode(s: str, encoding: str = 'utf-8', ntet: int = 8, flip: int = 0) -> str:
if ntet < flip:
raise ValueError('ntet must be less than flip.')
if ntet == 8 and flip == 0:
header = ''
elif ntet != 8 and flip == 0:
@dogtopus
dogtopus / _md_card_fighter.md
Created January 5, 2024 22:31
Random notes about M&D cards and their format

M&D Card System (梦龙刷卡机) Notes

Barcode format legend

Format:
0: Thin bar
1: Thick bar
A: Short form of prologue sequence (see each format for the exact pattern)
Z: Short form of epilogue sequence (see each format for the exact pattern)
@dogtopus
dogtopus / fdo2003_keygen.py
Last active April 30, 2023 19:06
Keygen for the Japanese retail release of Frane: Dragons' Odyssey (2003) (aka: Lost Memory Of Angel Story FraneIII -緋蒼の幻想曲-)
# Keygen for the Japanese retail release of Frane: Dragons' Odyssey (2003)
# For educational purpose only. I take no responsibility for what you will do with it.
#
# Also to EXE-Create:
# Quoting from GabeN: Piracy is a service issue. If FDO (2019) on Steam was actually half
# decent and wasn't having an allegedly dodgy localization and a lot of features from FDO (2003)
# removed (voice acting, mouse control and FMV cutscenes to name a few), this thing simply won't
# exist.
import argparse
@dogtopus
dogtopus / font_test.c
Created March 5, 2023 23:12
Besta RTOS font rendering API test
#include <stdbool.h>
#include <muteki/common.h>
#include <muteki/ui/canvas.h>
#include <muteki/ui/event.h>
const UTF16 i_can_eat_glass_w[] = u"我能吞下玻璃而不伤身体。";
void redraw(int font_type) {
ClearScreen(0);
@dogtopus
dogtopus / imx233_mem.c
Created March 5, 2023 23:06
Besta RTOS i.MX233 memory info+dumper
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <muteki/ui/event.h>
#include <muteki/ui/canvas.h>
#include <muteki/file.h>
#include <mutekix/console.h>
@dogtopus
dogtopus / mfd2flipper.py
Created February 24, 2023 19:49
Raw Mifare Classic dump to Flipper NFC file v3
import itertools
import pathlib
import sys
FLIPPER_HEADER_CONST = '''
Filetype: Flipper NFC device
Version: 3
# Nfc device type can be UID, Mifare Ultralight, Mifare Classic
Device type: Mifare Classic
# UID, ATQA and SAK are common for all formats