Skip to content

Instantly share code, notes, and snippets.

## install required packages
# $ pip install numpy opencv-python
# import required packages
import numpy as np
import cv2
from tqdm.notebook import tqdm
# specify the input video file name
fileName = './2.mkv'
@sup39
sup39 / test-PatternSelector-Customized(NTSC-U).txt
Created November 5, 2022 10:03
Pattern Selector with Customized Appearance for NTSC-U
0403B6FC 497BD905
041441BC 496B4ED8
077F9000 000001B0
801F0000 3D00817F
6108916F 3D40817F
614A0024 3D80803B
618C6178 7C006040
41820048 3D80803B
618C3F88 7C006040
40820034 819F0004
C2279570 00000005
981A0260 3CE0817F
880700B3 2C000000
38000000 900700BC
4182000C B00700B2
900700B4 00000000
C227A298 00000005
3CA0817F 80C500B4
8003005C 7CC60214
38C60004 54C6003A
0424F324 7fe6fb78
0420675C 495F2A59
0424F32C 495A9D6D
077F9000 000002C0
3D208040 A1290D50
7C091800 4CA20020
3D008180 394892C0
A10892C0 7D294079
4D820020 892A0002
7C892214 548407BE
([x, z, x0, z0, x1, z1] = [
// (x, z)
1302.07495, 5962.14648,
// (x0, z0)
-6000, -33900,
// (x1, z1)
6200, 32700,
].map(Math.fround));
([dz, dx, dz0, dx0, dz1, dx1] = [z1-z0, x1-x0, z0-z, x0-x, z1-z, x1-x].map(Math.fround));
([dx0dz, mdx1dz] = [dx0*dz, -dx1*dz].map(Math.fround));
{
"watchList": [
{
"address": "8040A2A8",
"baseIndex": 0,
"label": "global QF",
"pointerOffsets": [
"5C"
],
"typeIndex": 2,
cdfs = ['34.30%', '65.17%', '83.69%', '92.95%', '97.12%', '98.87%', '99.57%', '99.84%', '99.94%', '99.98%', '99.99%']
ccdfs = ['100.00%', '65.70%', '34.83%', '16.31%', '7.05%', '2.88%', '1.13%', '0.43%', '0.16%', '0.06%', '0.02%', '0.01%']
invccdfs = ['1.000', '1.522', '2.871', '6.132', '14.19', '34.73', '88.56', '233.1', '628.8', '1731', '4846', '1.375万', '3.951万', '11.47万', '33.59万', '99.13万', '294.7万', '881.2万', '2650万', '8011万', '2.433億', '7.417億', '22.70億', '69.73億', '214.8億', '664.0億', '2058億', '6393億', '1.991兆', '6.215兆', '19.44兆', '60.92兆', '191.3兆', '601.6兆', '1895兆', '5981兆', '1.890京', '5.980京', '18.95京', '60.11京']
lvs = ['0.0', '0.6', '1.5', '2.6', '3.8', '5.1', '6.5', '7.9', '9.3', '11', '12', '14', '15', '17', '18', '20', '21', '23', '25', '26', '28', '29', '31', '33', '34', '36', '38', '39', '41', '42', '44', '46', '47', '49', '51', '52', '54', '56', '57', '59', '61', '62', '64', '66', '67', '69', '71', '72', '74', '76', '77', '79', '81', '83', '84', '86', '88', '89', '91', '93', '94', '96', '98
2440A2A8 80000000
297F0024 FFF00000
82200000 8040A39C
80000001 817F0008
82200002 8040A3A4
82200003 8040B370
86000003 000000A6
28400D50 00000001
8A000C01 00000000
8A000221 0000000C
@sup39
sup39 / show-rng-idx-diff.txt
Created July 22, 2022 22:00
Show the number of times that rand() is called on each frame
C20ED284 00000004
4E800021 3D80817F
618CA898 7D8803A6
38610058 4E800021
60000000 00000000
077FA800 00000128
3CC012E7 60C63A73
7CC331D6 54C6007E
38600000 38E00000
38800001 38A00000
#include <stdint.h>
uint32_t rng(uint32_t x);
uint32_t rnginv(uint32_t x);
#define mul4k1(a, b) (4*a*b+a+b)
#define d 275878811
#define bdinv 15530683
#define dbinv 317143667
#define qmask 0x7FFFFFFF