Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified patches/ips/fast_mother_brain_cutscene.ips
Binary file not shown.
Binary file added patches/ips/mb_short_samus_standup.ips
Binary file not shown.
2 changes: 1 addition & 1 deletion patches/rom_map/Bank A9.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FB70 - FB91: ; escape_items.asm
FC00 - FC40: ; escape.asm
FD00 - FD11: ; fast_mother_brain_cutscene.asm
FD00 - FD11: ; mb_short_samus_standup.asm
FD40 - FD94: ; escape_autosave.asm
FE00 - FF46: ; fix_dust_torizo.asm
FF50 - FFFF: [FREE]
17 changes: 2 additions & 15 deletions patches/src/fast_mother_brain_cutscene.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
lorom

;;; Eliminate delay before Mother Brain rising:

org $A98D73
Expand Down Expand Up @@ -64,18 +63,6 @@ mb_phase_2_end_decide:
STA $0FA8 ;} Mother Brain's body function = $B8EB (firing rainbow beam)
.done:
RTS ; Return
warnpc $A9BB1A
assert pc() <= $A9BB1A
org $A9BB1A
.finish_samus:

;; Hook to make Samus stand up before escape (in "Short" Mother Brain fight mode)

org $A9FD00
LDA #$0017 ;\ Make Samus stand up
JSL $90F084 ;/
LDA #$0000 ;\
JSL $808FC1 ;/ Queue music stop
; LDA #$B173 ; Run hi-jacked instruction
LDA #$B1D5
RTS
warnpc $A9FD40
.finish_samus:
17 changes: 17 additions & 0 deletions patches/src/mb_short_samus_standup.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
arch snes.cpu
lorom

!bank_a9_freespace_start = $a9fd00 ; this address is referenced in patch.rs fn apply_mother_brain_fight_patches
!bank_a9_freeespace_end = $a9fd40

;; Hook to make Samus stand up before escape (in "Short" Mother Brain fight mode)

org !bank_a9_freespace_start
lda #$0017 ;\ Make Samus stand up
jsl $90f084 ;/
lda #$0000 ;\
jsl $808fc1 ;/ Queue music stop
lda #$b1d5
rts

assert pc() <= !bank_a9_freeespace_end
49 changes: 31 additions & 18 deletions rust/maprando/src/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@ impl Patcher<'_> {
patches.push("fix_hyper_slowlock");
}

if self.settings.quality_of_life_settings.mother_brain_fight == MotherBrainFight::Short {
patches.push("mb_short_samus_standup");
}

match self.settings.objective_settings.objective_screen {
ObjectiveScreen::Disabled => {}
ObjectiveScreen::Enabled => {
Expand Down Expand Up @@ -1664,6 +1668,10 @@ impl Patcher<'_> {
}

fn apply_mother_brain_fight_patches(&mut self) -> Result<()> {
let fast_cutscenes = self
.settings
.quality_of_life_settings
.fast_mother_brain_cutscene;
if self.settings.quality_of_life_settings.supers_double {
// Make Supers do double damage to Mother Brain:
self.rom.write_u8(snes2pc(0xB4F1D5), 0x84)?;
Expand All @@ -1674,13 +1682,20 @@ impl Patcher<'_> {
// See fast_mother_brain_cutscene.asm patch for baseline changes to speed up cutscenes.
}
MotherBrainFight::Short => {
// Make Mother Brain 1 finish faster:
for addr in &[0x897D, 0x89AF, 0x89E1, 0x8A09, 0x8A31, 0x8A63, 0x8A95] {
self.rom.write_u16(snes2pc(0xA90000 + addr), 0x10)?; // cut delay in half for tubes to fall
if fast_cutscenes {
// Make Mother Brain 1 finish faster:
// cut delay in half for tubes to fall
for addr in &[0x897D, 0x89AF, 0x89E1, 0x8A09, 0x8A31, 0x8A63, 0x8A95] {
self.rom.write_u16(snes2pc(0xA90000 + addr), 0x10)?;
}
// Skip the slow movement to the right when MB2 is preparing to finish Samus off
self.rom.write_n(snes2pc(0xA9BB24), &[0xEA; 3])?;
}

// Skip the slow movement to the right when MB2 is preparing to finish Samus off
self.rom.write_n(snes2pc(0xA9BB24), &[0xEA; 3])?;
// Silence the music and make Samus stand up when Mother Brain starts to fade to corpse
self.rom.write_n(
snes2pc(0xA9B1BE),
&[0x20, 0x00, 0xFD], // JSR 0xFD00 (must match address in mb_short_samus_standup.asm)
)?;

// After finishing Samus off (down to 100 energy or lower), skip to Mother Brain exploding:
self.rom.write_u16(snes2pc(0xA9BD9E), 0xAEE1)?;
Expand All @@ -1698,12 +1713,6 @@ impl Patcher<'_> {
],
)?;

// Silence the music and make Samus stand up when Mother Brain starts to fade to corpse
self.rom.write_n(
snes2pc(0xA9B1BE),
&[0x20, 0x00, 0xFD], // JSR 0xFD00 (must match address in fast_mother_brain_cutscene.asm)
)?;

if self.settings.quality_of_life_settings.escape_movement_items
|| self
.settings
Expand All @@ -1715,11 +1724,17 @@ impl Patcher<'_> {
}
}
MotherBrainFight::Skip => {
// Make Mother Brain 1 finish faster:
for addr in &[0x897D, 0x89AF, 0x89E1, 0x8A09, 0x8A31, 0x8A63, 0x8A95] {
self.rom.write_u16(snes2pc(0xA90000 + addr), 0x10)?; // cut delay in half for tubes to fall
if fast_cutscenes {
// Make Mother Brain 1 finish faster:
// cut delay in half for tubes to fall
for addr in &[0x897D, 0x89AF, 0x89E1, 0x8A09, 0x8A31, 0x8A63, 0x8A95] {
self.rom.write_u16(snes2pc(0xA90000 + addr), 0x10)?;
}
// skip MB moving forward, drooling, exploding
self.rom.write_u16(snes2pc(0xA9AF07), 0xB115)?;
// accelerate fade to gray (which wouldn't have an effect here except for a delay)
self.rom.write_u16(snes2pc(0xA9B19F), 1)?;
}

// Skip MB2 and MB3:
self.rom.write_u16(snes2pc(0xA98D80), 0xAEE1)?;
self.rom.write_n(
Expand All @@ -1731,8 +1746,6 @@ impl Patcher<'_> {
0xEA, 0xEA, // nop : nop
],
)?;
self.rom.write_u16(snes2pc(0xA9AF07), 0xB115)?; // skip MB moving forward, drooling, exploding
self.rom.write_u16(snes2pc(0xA9B19F), 1)?; // accelerate fade to gray (which wouldn't have an effect here except for a delay)

if self.settings.quality_of_life_settings.escape_movement_items
|| self
Expand Down
Loading