Skip to content

Instantly share code, notes, and snippets.

View ketsuban's full-sized avatar

Thomas Winwood ketsuban

View GitHub Profile
@ketsuban
ketsuban / file listing.txt
Created June 21, 2025 19:45
Some filenames and their offsets in Yu-Gi-Oh! Ultimate Masters - World Championship Tournament 2006
deck/LV1_kuriboh.ydc 00000000
deck/LV1_kuriboh.ydc 00000060
deck/LV1_pikeru.ydc 000000C0
deck/LV1_pikeru.ydc 00000120
deck/LV1_sukego.ydc 00000180
deck/LV1_sukego.ydc 000001E0
deck/LV1_waito.ydc 00000240
deck/LV1_waito.ydc 000002A0
deck/LV1_watapon.ydc 00000300
deck/LV1_watapon.ydc 00000360
@ketsuban
ketsuban / checksum.rs
Created June 21, 2025 19:44
Rust code for decrypting the banlist passwords in Yu-Gi-Oh! Ultimate Masters - World Championship Tournament 2006
use std::collections::HashMap;
use std::sync::LazyLock;
// const CHARSET: &str = "ABCDEFGHJKLMNPQRTUVWXYZacdefghijkmnprstuvwxyz23478&#!?+-÷=%@★●▲■";
// static MAPPING: LazyLock<HashMap<char, u8>> = LazyLock::new(|| {
// let mut map = HashMap::new();
// // Each character is converted into a 6-bit value from 0 to 63.
// for (i, ch) in CHARSET.chars().enumerate() {
// map.insert(ch, i);
// }
@ketsuban
ketsuban / entry.s
Created March 2, 2025 10:56
Sega Megadrive initialisation code formatted for GNU as
| skip reinitialising hardware after a soft reset
tst.l (0xA10008).l
bne.s 1f
tst.w (0xA1000C).l
1: bne.s 2f
| load register values for initialisation
lea .Ltable(%pc), %a5
movem.w (%a5)+, %d5-%d7
movem.l (%a5)+, %a0-%a4
@ketsuban
ketsuban / linker.ld
Created December 13, 2021 11:08
Linker script for a Rust executable crate targeting the GBA
ENTRY(__start)
/*
* The GBA has two sections of work RAM: internal and external. Internal work
* RAM is essentially instantaneous to access and sits on a 32-bit bus, so it's
* suitable for ARM code. External work RAM has a delay of two clock cycles and
* sits on a 16-bit bus.
*/
MEMORY {
rom (rx) : ORIGIN = 0x08000000, LENGTH = 32M
@ketsuban
ketsuban / functions.cfg
Created November 30, 2021 03:54
Half-finished functions.cfg for running gbadisasm on Yu-Gi-Oh: World Championship Tournament 2006
arm_func 0x80000fc IntrMain
thumb_func 0x8014398 sub_8014398
thumb_func 0x80143f0 sub_80143f0
thumb_func 0x8014470 sub_8014470
thumb_func 0x8014480 sub_8014480
thumb_func 0x80144e8 sub_80144e8
thumb_func 0x801455c sub_801455c
thumb_func 0x80145bc sub_80145bc
thumb_func 0x8014600 sub_8014600
thumb_func 0x8014638 sub_8014638
@ketsuban
ketsuban / filenames.txt
Created July 8, 2021 07:30
Yu-Gi-Oh! Ultimate Masters - World Championship Tournament unique file names
inc/nitro/fx_mtx22.h
inc/nitro/g2_oam.h
inc/nnsys/g2d/fmt/g2d_Anim_data.h
inc/nnsys/g2d/fmt/g2d_Cell_data.h
inc/nnsys/g2d/load/g2d_NAN_load.h
inc/nnsys/g2d/g2d_Image.h
inc/nnsys/g2d/g2d_Animation_inline.h
inc/nnsys/g2d/g2d_CellAnimation.h
inc/nnsys/g2d/g2d_SRTControl.h
nnsys/g2d/g2di_OamUtil.h
@ketsuban
ketsuban / main.c
Created October 12, 2020 16:32
The sum total of my progress decompiling Advance Wars
#include "hardware.h"
#include "types.h"
struct sub_807AEE0_arg1 {
u8 _bytepad1;
u8 field1;
u8 _bytepad2;
u8 _bytepad3;
u32 _longpad1;
u32 _longpad2;
@ketsuban
ketsuban / main.c
Created September 18, 2020 19:56
Yu-Gi-Oh! Ultimate Masters - World Championship Tournament 2006's AgbMain function
u8 dat_2000000;
u16 dat_200AF10;
void (*dat_2029EA0)(u32, u8 *, u16);
void sub_80F48F8(void (*)(void));
void sub_80F4B94(void);
void sub_80F4C14(void);
void sub_80F9BE4(u32);
u32 sub_80F9C40(void);
void sub_80FBAD0(void);

Keybase proof

I hereby claim:

  • I am ketsuban on github.
  • I am ketsuban (https://keybase.io/ketsuban) on keybase.
  • I have a public key ASBMMSOWA5veoN9WZHxE87y-2HyNrk-5cd-I_D4vRhWsAQo

To claim this, I am signing this object:

@ketsuban
ketsuban / ideas.md
Last active December 25, 2023 22:59
Things I'd like to have a go at but don't really know where to start
  1. Star Trek: The Next Generation: A Final Unity game engine recreation

    I like this game, but right now if you own it and want to play it you need to set up DOSbox, and that's lame. All its data files seem to be stored in a single directory on the CD, so an executable which can read those would be very cool.

    Prior art: There's an okay resource for file formats but its focus is on data dumping, so there's no documentation that I can find on which files constitute behaviour and how they're arranged. There's also this unfinished attempt to implement the game in ScummVM, but since it's written in C++ it's basically gibberish and the impetus to finish it dissolved when DOSbox gained support for the original.

  2. Magic: the Gathering simulator

Magic is fun[citation needed], but playing it online sucks. Wizards of the Coast has actually put effort into a couple pieces of software that simulate the effect o