Skip to content

Instantly share code, notes, and snippets.

Avatar

Pokechu22 Pokechu22

View GitHub Profile
View DatelHLE.md

Datel titles previously crashed when booting them with Dolphin's skip GameCube menu option was enabled. What exactly caused this crash?

Well, the original bug report from 7 years ago is titled "Datel AGP requires default exception handlers" (where AGP refers to Advance Game Port, but this issue applies to all Datel products), and its full text is this:

The game doesn't install exception handlers on boot like regular games that use the Nintendo SDK.
It instead relies on the handlers that the IPL install upon boot.
It does something odd that involves hitting the exception handlers that needs to be investigated.
Our non-IPL path doesn't install default handlers, but it may end up needing to do so at some point in order to properly support this game.
> Since we don't only install a couple exception handlers that only do an rfi the game doesn't continue very far in the boot process withou

@Pokechu22
Pokechu22 / Alpha.png
Last active May 17, 2022
Embossing demo (based on lesson08)
@Pokechu22
Pokechu22 / RS2_BumpMapping1.md
Last active May 4, 2022
Various notes about the bumpmapping effects in Star Wars Rogue Squadron II: Rogue Leader (and to a lesser extent Rogue Squadron III: Rebel Strike), along with various contemporary sources
View RS2_BumpMapping1.md

RS2 bump, Object 12. (object 11 is zfreeze-related, though I don't think it actually ends up mattering since object 12 doesn't use zfreeze)

CP register ARRAY_BASE Array Position (0)
Base address 01481980
CP register ARRAY_STRIDE Array Position (0)
Stride 0b
CP register ARRAY_BASE Array Color 0 (2)
Base address 01481984
CP register ARRAY_STRIDE Array Color 0 (2)
@Pokechu22
Pokechu22 / Rygar.md
Last active May 2, 2022
Rygar: The Battle of Argus bloom writeup
View Rygar.md

Rygar: The Battle of Argus (a port of the PS2 game Rygar: The Legendary Adventure) has a broken bloom effect. In Dolphin, the bloom effect results in the top-left part of the screen being drawn over the entire screen. If the top-left part of the screen is particularly bright, then the whole screen will end up being white.

This writeup analyzes the RygarBloom2.dff fifolog on issue 12763.

First bloom step

EFB copy 4, 5, and 6 are relevant; however, EFB copy 6 is only for restoring the previous screen state and can mostly be ignored. After those EFB copies is object 268, which handles combining the earlier EFB copies and is the start of the bloom logic. EFB copy 7 makes a copy of the area that was drawn to by object 268, which is used for further processing later on.

EFB copy 4 (00045a56)
@Pokechu22
Pokechu22 / PBR.md
Last active Feb 14, 2022
Pokémon Battle Revolution graphical glitch writeup
View PBR.md

Pokémon Battle Revolution had an issue where certain effects (those that distort the camera) caused the entire screen to shift slightly.

This writeup mainly analyzes the psycho cut fifolog (from issue 12629, though the actual issue is described in issue 11875).

How the effects render

All of the effects work using indirect textures. First, the game draws the main environment (see ZPBR_Psy_base_new.png and ZPBR_Rain_base_new.png). Then, it makes an EFB copy, and clears the screen (but not the depth buffer). It then draws a second effect, which will serve as an offset to the screen (see ZPBR_Psy_indirect.png and ZPBR_Rain_indirect.png). This might be drawn in 3D space (as with the energy pattern used by Psycho Cut) or it might be drawn in 2D

@Pokechu22
Pokechu22 / EASports.md
Last active Feb 14, 2022
Description of the pink rendering issue in EA Sports Active
View EASports.md

Preliminaries

The fifolog in question is ea-pink, downloadable here, which shows gameplay from EA Sports Active. There are several oddities with how this is rendered; for instance, it is rendered in two halves (vertically) and some objects are only rendered in one of the halves (this is best seen by using freelook), similar to nhl-slap (but that game does it to a greater extent). The game also renders a vignette (causing the edges of the image to be darker) and the hud after the broken effect. But it is that broken effect, resulting in everything being pink, that this document is about.

The broken effect is object 819 in that fifolog (numbered 842 with better-fifo-analyzer-part-3).

See https://gist.github.com/Pokechu22/f06db7a9f226d9b0c72507886d7a72ce for additional images as well a

@Pokechu22
Pokechu22 / Major Minor 1.md
Last active May 17, 2022
Messy Major Minor's Majestic March notes
View Major Minor 1.md

Major minor: at one point in the tutorial, the screen does get greyed out, even with Dolphin's broken rendering. That's a starting point to figure out why things broke.

EID 611 - the scissor region is over the screen in that case, but not in the others. Obj 232, which renders:

BP register BPMEM_SCISSOROFFSET
Scissor X offset: 171
Scissor Y offset: 171
View SkywardSwordMap.md

Preliminaries

The fifolog in question is ss-map, downloadable here. I will be discussing only the green part of the map, but all of the main parts of the map render the same way (with the main configuration happening in object 1). The objects in question are: 1: Brown (pathways); 2: dark brown (rocks?); 3: yellow (sand); 4: green (grass); 6: dark green (unknown, not much uses this); 6: grey (stone); 7: red (roof); 8: brown (roof). Object 9, water, has its own configuration which I haven't investigated, but the water seems to all be at the same elevation anyways.

The border shadows around the map are also dynamically generated; they use EFB copies. The relevant objects are currently numbered 16 and 17 as of Dolphin 5.0-14344, and their vertex data is at offsets 00047466 and 000476d5 respectively.

Texture coordinates

Relevant data
View CoordWrapTest.c
#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>