Skip to content

Instantly share code, notes, and snippets.

View Pokechu22's full-sized avatar

Pokechu22 Pokechu22

View GitHub Profile
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <gccore.h>
#include <fat.h>
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <gccore.h>
#include <fat.h>
#include <time.h>
#include <sys/stat.h>
@Pokechu22
Pokechu22 / IndTest.c
Last active April 17, 2021 04:32
Dolphin Luigi's Mansion portrait indirect texture issue
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <gccore.h>
#include <fat.h>
#include <time.h>
#include <sys/stat.h>
@Pokechu22
Pokechu22 / Luigi1.md
Last active April 17, 2021 05:24
(Partically incorrect) notes while investigating the Luigi's Mansion portrait issue (https://bugs.dolphin-emu.org/issues/11462)

The painting texture for Luigi's Mansion in JMC's FIFO on frame 0 is object 373 and 374. Object 373 shows Mario, while Object 374 shows Bowser; a lot of the early objects are rendering either Mario or Bowser (and both are rendered, even though Bowser only shows up in the ending cutscene). This is presumably done by fading BPMEM_TEV_COLOR_RA's alpha from 0xff to 0 for object 373 and from 0 to 0xff for object 374; it is at 0 for 374 in the given frame in any case.

I dumped textures while using playing back the FIFO using the software renderer, and got tar364_stage0_map0_mip0.png, tar365_stage0_map0_mip0.png, and tar364_ind0_map1_mip0.png (and an identical copy as tar365_ind0_map1_mip0.png). Although that last file may appear invisible, it has contents; its

@Pokechu22
Pokechu22 / ARM_Starlet.slaspec
Last active April 18, 2024 22:36
Ghidra Starlet (Wii IOS) processor spec - place these files in Processors/ARM/data/languages
@define ENDIAN "big"
@define T_VARIANT ""
@define VERSION_5 ""
@define VERSION_5E ""
@include "ARM.sinc"
# Hacky because we can't define a new token for bits 5-15 since sleigh doesn't
# allow adding new fields to the instrArm token
ioscallnum: value is c0507 & c0811 & c1212 & c1313 & c1414=0 & c1515=0
@Pokechu22
Pokechu22 / DebugCubeExperiments.md
Last active June 10, 2021 04:36
Investigations into the Super Mario Sunshine debug cubes issue

This started as a random patch to Dolphin's software renderer that fixed the "debug cubes" in Super Mario Sunshine (issue 8059) without causing the bridge in a custom Mario Kart Wii track to disappear (issue 12379) or breaking the reflections in one Super Monkey Ball stage (issue 12366). The patch itself seems to be wrong on later testing, but I'm still using this gist to document my research here.

Note that this is mostly just personal notes, and there's no guarantee that anything is correct (much of this is speculation that I later prove wrong). I've avoided editing older comments to correct them, and there may be silly mistakes there that I've since found (usually noted in the next update).

@Pokechu22
Pokechu22 / NormalizeTest.c
Last active April 17, 2021 03:13
Dolphin normalization special case test - https://github.com/dolphin-emu/dolphin/pull/9315
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <gccore.h>
#include <ogc/tpl.h>
@Pokechu22
Pokechu22 / applyEntityCollision.java
Last active June 26, 2022 18:29
Minecraft entity collision logic (simplified)
public class Entity {
public void applyEntityCollision(Entity other) {
double dx = other.posX - this.posX;
double dz = other.posZ - this.posZ;
double largestDistance = Math.max(Math.abs(dx), Math.abs(dz));
if (largestDistance >= 0.01) {
double vx = dx / 20;
double vz = dz / 20;
if (largestDistance < 1) {
@Pokechu22
Pokechu22 / 15w51b_16w02a.diff
Last active July 12, 2020 03:09
1.8.9/1.9 BiomeGenBase
diff --git a/15w51b/aib.java b/16w02a/aic.java
index bf60267..204f2a6 100755
--- a/15w51b/aib.java
+++ b/16w02a/aic.java
@@ -1,278 +1,176 @@
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Collections;
import java.util.List;