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 July 19, 2024 14:56
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)
BA742 CN WuDi V7
TW CD-877
Nurian X90
2010-2012 Arm Arm926EJ-S NXP i.MX233 DDR SDRAM 32MiB microSD 1 1I?Pt35/48/62-1 (354862)
BA743 TW CD-631(2)
KR BK-200
CN WN-7/WuDi V7+
NA CD-882
2012 Arm Arm1176JZF-S Telechip TCC8902 DDR2 SDRAM 256MiB SD 1 ?
BA754 TW CD-888
CN WuDi V10(+)
2012 Arm ? ? ? ? ? ?
CA106 HK 638TW CD-222 2009 Arm Arm7TDMI (?) Winbond/Nuvoton W55SA7101 SDRAM 8MiB None
@dogtopus
dogtopus / nand.c
Created March 2, 2024 08:52
Besta RTOS NAND dumper
#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