Skip to content

Instantly share code, notes, and snippets.

#ifndef GUARD_GBA_MACRO_H
#define GUARD_GBA_MACRO_H
#define CPU_FILL(value, dest, size, bit) \
{ \
vu##bit tmp = (vu##bit)(value); \
CpuSet((void *)&tmp, \
dest, \
CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size)/(bit/8) & 0x1FFFFF)); \
}
@luckytyphlosion
luckytyphlosion / lz77_uncomp_wram.s
Created October 13, 2023 03:04
Faster LZ77UnCompWRAM
LZ77UnCompWRAMOptimized: @ 0x000010FC
push {r4, r5, r6, lr}
// read in data header in r5
// Data header (32bit)
// Bit 0-3 Reserved
// Bit 4-7 Compressed type (must be 1 for LZ77)
// Bit 8-31 Size of decompressed data
ldr r5, [r0], #4
// store decompressed size in r2
lsr r2, r5, #8
@luckytyphlosion
luckytyphlosion / unknown_room_rerolling.MD
Last active November 23, 2023 04:58
Slay the Spire unknown room re-rolling glitches.

Known conditions where an unknown room can be rerolled due to a save and quit

1. Unknown room directly after a shop room

Note that this applies regardless of whether the shop was from an unknown room or a shop room. This is because the game does not allow generating two shops in a row. The game checks this by checking if the current room is a shop, setting the shop chance to 0 if so, and then assigning the current room to the room generated by the ? room.

However, the game does not save the current room (instead setting it to an empty room upon loading), so if the player generates the room via loading the save, it will not set the shop chance to 0, altering the overall probabilities and potentially generating a different room.

2. Any shrine after a re-usable shrine

Below are the two types of shrine categories: One-time shrines (name from source code) and reusable shrines (unofficial name, source code calls it shrineList). One-time shrines can only be seen once in the entire run, and are kept tr

@luckytyphlosion
luckytyphlosion / aag_unlock_guide.MD
Last active August 27, 2023 19:36
Slay the Spire All Achievements Glitchless Complete Unlock Guide and Strategy

Slay the Spire All Achievements Unlock Tutorial

Note: all of this is in the context of a run that does the Ascension Climb with Watcher. The routing slightly varies with Ironclad as the Ascension Climb character.

In order to easily obtain certain achievements (more info: Achievements @ Slay the Spire Wiki) and also have nice relics for the entire run, certain unlocks must be achieved. Below describes the desirable unlocks for each character.

Ironclad

Ironclad wants his 1st unlocks (Heavy Blade, Spot Weakness, Limit Break) mainly to have Limit Break for Jaxxed (50+ Strength), but also Spot Weakness is a nice bonus and Heavy Blade is a desperation strength scaling pick.

Silent

The choice of Silent's unlocks have variability to them, depending on your preferences. Firstly, Silent more or less needs her 1st unlocks (Bane, Catalyst, Corpse Explosion) mainly to have Catalyst for Catalyst achievement (99+ poison on enemy), but also Corpse Explosi

@luckytyphlosion
luckytyphlosion / EurandomDX_folder_gen_explanation.MD
Last active May 28, 2023 01:38
EurandomDX_folder_gen_explanation

anyway, there are 3 categories

ranged chips, constrained chips, and nonattacking chips
and within each category there are three ranks
high, medium, and low
ranged chips are chips that you can basically hit from anywhere more or less or have a high AOE
this includes all the meta chips but also non-meta chips that still can hit relatively well
high, medium, and low corresponds to how well it hits + how much damage it does
so something like bblstar1 is still considered medium even though it does low damage since it can hit well
constrained chips are your swords, golmhit, tornado, gundels, and conditional chips like sumnblk and darkmech series\

Sword *
LongSwrd *
LongSwrd *
WideSwrd *
FireBrn2 S
FireBrn2 T
FireBrn2 U
AreaGrab *
AreaGrab *
GrabRvng Q
@luckytyphlosion
luckytyphlosion / compare_mach_bullet_flame_out.txt
Created December 11, 2022 15:35
Comparing Mach Bike, Bullet Bike, and Flame Runner times.
== Luigi Circuit ==
Spear (WR): 01:08.774 (vs Flame Runner: 0.615% faster, vs Mach Bike: 1.486% faster, vs Bullet Bike: 1.877% faster)
Flame Runner : 01:09.443 (vs Spear: 0.611% slower, vs Mach Bike: 0.865% faster, vs Bullet Bike: 1.255% faster)
Mach Bike : 01:10.390 (vs Spear: 1.464% slower, vs Flame Runner: 0.858% slower, vs Bullet Bike: 0.386% faster)
Bullet Bike : 01:10.816 (vs Spear: 1.843% slower, vs Flame Runner: 1.239% slower, vs Mach Bike: 0.384% slower)
== Moo Moo Meadows ==
Flame Runner (WR): 01:15.375 (vs Mach Bike: 1.374% faster, vs Bullet Bike: 2.182% faster)
Mach Bike : 01:16.960 (vs Flame Runner: 1.355% slower, vs Bullet Bike: 0.798% faster)
Bullet Bike : 01:17.893 (vs Flame Runner: 2.136% slower, vs Mach Bike: 0.791% slower)
This file has been truncated, but you can view the full file.
@luckytyphlosion
luckytyphlosion / gist:4444a94ad9e128a366b3e12cdda40ed2
Last active October 26, 2022 18:24
BN3 Blue All Chip Rarities and printChip behaviour.
This file has been truncated, but you can view the full file.
== Probably fine chips ==
Chip Cannon (0x1) has rarity 0 (0x0)
Chip HiCannon (0x2) has rarity 1 (0x1)
Chip M-Cannon (0x3) has rarity 2 (0x2)
Chip AirShot1 (0x4) has rarity 0 (0x0)
Chip AirShot2 (0x5) has rarity 1 (0x1)
Chip AirShot3 (0x6) has rarity 1 (0x1)
Chip LavaCan1 (0x7) has rarity 0 (0x0)
Chip LavaCan2 (0x8) has rarity 1 (0x1)
@luckytyphlosion
luckytyphlosion / all_radical_red_trainer_sets_3_02_no_mingrind.txt
Created August 4, 2022 22:33
Pokémon Radical Red 3.02 Trainer Data (Normal Mode, No Mingrind)
Anything without IVs means 0 IVs straight, not perfect IVs.
Used the same script to dump Pokémon Clover trainers. The internal trainer format is actually documented at Skeli's CFRU repository, but I didn't feel like writing a separate dumper, so I repurposed the Clover Lua script (link: https://github.com/luckytyphlosion/PokemonBizhawkLua/tree/radical-red) (tested with Bizhawk 2.8.2).
This dump applies to Normal Mode with Mingrind off.
Some trainer sets have random abilities on mons, which are denoted by "or" on the Ability line when applicable (e.g. Intimidate or Moxie)
The Pokémon levels of some trainers are dynamically determined based on the level of the Pokémon with the highest level in your party. A level of "Max Level" will set the enemy's level to your highest level, "Max Level - 1" to your highest level minus 1, and "Max Level - 2" to your highest level minus 2, and so on.