Skip to content

Instantly share code, notes, and snippets.

@sup39
sup39 / show-pollution-degree.txt
Last active July 21, 2022 18:05
汚れの量を表示するコード。TPollutionManager::getPollutionDegree(gpPollution) https://twitter.com/sup39x1207/status/1550165477090988032
$汚れの量を表示(初期版) (2022/07/22) [サポミク]
04206898 495F3B69
077FA400 00000076
9421FFF0 7C0802A6
90010014 93E1000C
7C7F1B78 4CC63182
4A83AE11 3D208041
8069A5A8 4A9F5295
7C691B78 3D008180
3908A470 38E0FFFF
C22069D0 00000015
38610E90 3D808003
618C5228 7D8803A6
4E800021 818D98B8
816D97E8 A12C0096
814B0058 554A07BE
C02C0010 C04C0014
C06C0018 C08C00B0
C0AC00A8 38600010
388000B4 38A00014
@sup39
sup39 / InstantLevelSelect.txt
Last active July 22, 2022 21:01
Press LevelSelect button+B+D-Pad Up to trigger InstantLevelSelect. For SkipStageIntro, press R+D-Pad Up to enable, and R+D-Pad Down to disable.
$Instant Level Select (2022/07/22) [sup39]
C20EAFA0 00000042
3C608040 A0A30D50
70A50308 28050208
40A201F8 4800003D
00141516 0017181D
34000090 2F2E3020
32293328 2A1F3A3C
371E213A 0E2C3900
00010507 08090200
import boundaryInfoListRaw from './boundaries.json';
type Tuple<T, Length> = [T, ...T[]] & {length: Length};
export type SurfaceBoundary = Tuple<number, 4>;
export type SurfaceBoundaryInfo = {[mem: string]: SurfaceBoundary};
export class Float32 {
private farr: Float32Array
private iarr: Uint32Array
constructor(value: any) {
@sup39
sup39 / LevelSelect-Extra.txt
Last active May 16, 2022 07:57
Lightweight Level Select + [X+Z]PinnaPark(1/3/5/6/7/8/1 Shine) + [Y+Z]SirenaHotel(2/3/4/5/7/8). SGT does not restart properly on level selecting. The stick CD when entering Sirena hotel/casino should be handled properly now.
C20FA114 00000036
48000049 00141516
0017181D 34000010
2F002E00 30002000
32002900 33002800
2A001F00 3A013C00
371E213A 0E2C3900
00010507 08090200
29CBC0D0 52EE0000
29380070 4E6E0001
@sup39
sup39 / QFT-ResultOnly.txt
Last active May 6, 2022 23:52
QFT but only shows when you collect a shine
C20ECE44 00000005
981A0260 3CE0817F
880700B3 2C000000
38000000 900700BC
4182000C B00700B2
900700B4 00000000
C20EFA30 00000005
3CA0817F A00500B2
2C000000 40820014
800500B4 80C3005C
@sup39
sup39 / SMS-DrawController.c
Created April 26, 2022 05:54
Source code of DrawController. Compiled Gecko code (no rect): https://gist.github.com/sup39/f78ee3d991e20c58891eb08767743acd
#include <sms.h>
extern uint16_t jmaSinTableSize;
extern int jmaSinShift;
extern float *jmaSinTable, *jmaCosTable;
#define scale 0.1f
// #define bgColor 0x3f
float mtx[3][4] = {
scale, 0, 0, 210,
0, scale, 0, 464-8-1100*scale,
@sup39
sup39 / Mirror-GMSJ01.txt
Last active April 25, 2022 06:12
Mirror mode code for NTSC-J 1.0. This code is translated from the NTSC-U code (made by JoshuaMK), and is not fully tested. https://twitter.com/sup39x1207/status/1518354572498333697
$ Mirror Mode (v0.1.1, 2022/04/25) [sup39, JoshuaMK]
040003E0 BF800000
040003E4 3F800000
040003E8 3F800000
C2353310 0000000E
7C0802A6 90010004
9421FFE0 BFA10008
7C7D1B78 7C9E2378
3FE08000 63FF03E0
C03F0000 C05F0004
@sup39
sup39 / zmenu.c
Last active April 21, 2022 11:07
C implementation of Z menu, including Fast text and PAS display toggle.
#include "sms.h"
void drawText(int x, int y, int fontSize, uint32_t colorTop, uint32_t colorBot, const char *fmt, ...); // 0x817f0238
extern uint32_t enFlag; // &enFlag = 0x817f0024;
extern uint32_t cursor; // &cursor = 0x817f8800;
#define optcnt 2
static char *labels[optcnt] = {
"Fast text",
"PAS display",
@sup39
sup39 / LevelSelect.s
Last active May 1, 2022 10:08
WIP shorter Level Select for SMS. TODO: (1) Y and Z restart (2) SGT flag
# TODO versions
.set mPadButton__10JUTGamePad, 0x80400D80
.set flagManager__r13, -0x6830
# registers
.set r817F, 3
.set rC, 4
.set rBtn, 5
.set rIdx, 7
.set rAns, 8