diff --git a/patches/ips/fast_mother_brain_cutscene.ips b/patches/ips/fast_mother_brain_cutscene.ips index c09de53cc..9b55f2ae3 100644 Binary files a/patches/ips/fast_mother_brain_cutscene.ips and b/patches/ips/fast_mother_brain_cutscene.ips differ diff --git a/patches/ips/mb_short_samus_standup.ips b/patches/ips/mb_short_samus_standup.ips new file mode 100644 index 000000000..919fa690e Binary files /dev/null and b/patches/ips/mb_short_samus_standup.ips differ diff --git a/patches/rom_map/Bank A9.txt b/patches/rom_map/Bank A9.txt index de12ee792..89f128a01 100644 --- a/patches/rom_map/Bank A9.txt +++ b/patches/rom_map/Bank A9.txt @@ -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] diff --git a/patches/src/fast_mother_brain_cutscene.asm b/patches/src/fast_mother_brain_cutscene.asm index 5093f6537..5786ea87e 100644 --- a/patches/src/fast_mother_brain_cutscene.asm +++ b/patches/src/fast_mother_brain_cutscene.asm @@ -1,5 +1,4 @@ lorom - ;;; Eliminate delay before Mother Brain rising: org $A98D73 @@ -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 \ No newline at end of file +.finish_samus: \ No newline at end of file diff --git a/patches/src/mb_short_samus_standup.asm b/patches/src/mb_short_samus_standup.asm new file mode 100644 index 000000000..e5dd4a95b --- /dev/null +++ b/patches/src/mb_short_samus_standup.asm @@ -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 \ No newline at end of file diff --git a/rust/maprando/src/patch.rs b/rust/maprando/src/patch.rs index 7313defed..6ec855d4a 100644 --- a/rust/maprando/src/patch.rs +++ b/rust/maprando/src/patch.rs @@ -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 => { @@ -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)?; @@ -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)?; @@ -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 @@ -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( @@ -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