Mega Man 4: MM4 deRNG Nintendo Entertainment System

  • ~
  • Share
This is a MegaMan/Rockman patcher/randomizer to modify the major boss-related RNG. This could be used to make for better head-to-head races. The mod specifically allows customization/removal of the following:

- Drill man: drill events, including the initial one
- Dust man: suck events
- Skull man: skull shield delay
- Square machine: 1/2/3-pass
- Met Man: open/close durations
- Tako Trash: Fireball/bomb attack
- Dr. Wily: Spawn location customization (by row); duration of hitbox and respawn delay

You can fully customize to your liking or generate randomized/blind ROMs:

https://jeboo.github.io/mm4_derng/

The readme has the code and brief descriptions of the RNG for those interested.
The title screen has been modified (replaced 'WORD') to show the patch/version.

The included patch gives the easiest options possible for all bosses. Please note MegaMan and Rockman require unique patches due to slight differences.

RNG in MM4 is dictated by 4 bytes @ $E4-E7 that are changed with each frame. In addition, there are certain points (i.e., boss fights) in the game that internally modify the bytes
to prevent timing attacks. Manipulation is not feasible outside of a TAS, so we must modify specific code segments to alter the use of RNG.

1. Dust man: Suck event has a 1/4 chance.
0xAD28
LDY #$03
BNE $AD34
DEC $0468,X
BNE $AD4C
JSR $B71E ; RNG
LDA $AE42,Y ; 14 15 14 13 15 14 14 14 13 15 13 14 14 13 13 15 14 13 15 14 13 14 15 13
JSR $F446 ; 15 = suck, 6/24; 13 = dust shot, 14 = jump
LDA $0558,X
AND #$03
TAY
LDA $AE5A,Y
STA $0588,X
LDA $AE5E,Y
STA $05A0,X
RTS

********************************************************************************************************************************

2. Skull man: Skull shield can vary from 0.5 - 4.25s.
0xA8B2
LDA $E4
ADC $E6
STA $E6 ; update RNG byte 3
AND #$07
TAY ; Delay table for skull shield:
LDA $AA5C,Y ; 40 FF A0 20 FF 70 30 5A
STA $0468,X
LDA #$E4
STA $0588,X
LDA #$A8
STA $05A0,X
RTS

********************************************************************************************************************************

3. Drill man: Primary action table is 3 options, 2A/2F/30. Dive(2A) starts a timer of 210f (3.5s) once he disappears underground. Your x-coord is queried at 30f (0.5s) before he reappears.
0xB045
LDA #$B8
STA $EF
LDY #$01 ; hardcoded initial dive
BNE $B055 ; skip RNG
DEC $0468,X
BNE $B06D
JSR $B71E ; RNG
LDA $B28F,Y ; 2F 2A 2F 30 2A 2F 30 2F 30 2A 30 2F 30 2A 2A 30 2F 2A 2A 30 2F 2F 2A 2A
JSR $F446 ; 2A = dive (9/24 chance), 2F = jump, 30 = bombs
LDA $0558,X
AND #$03
TAY
LDA $B2A7,Y
STA $0588,X
LDA $B2AB,Y
STA $05A0,X
RTS

********************************************************************************************************************************

4. Square machine: Odds of a 1-1 pass are 1/64.
0xBB94
LDA $E4
ADC $E6
STA $E6 ; update RNG byte 3
AND #$07
TAY ; Pass table:
LDA $BD4F,Y ; 00 01 01 01 02 02 02 02
STA $0468,X ; 1 = 1/8, 2 = 3/8, 3 = 4/8
LDY $0468,X
LDA $BD49,Y
STA $03A8,X
LDA $BD4C,Y
STA $03C0,X
RTS

********************************************************************************************************************************

5. Met Man: Open/close duration

0xA127
LDA $E4
ADC $E5 ; update RNG byte 2
STA $E4
AND #$01
TAY ; Open duration
LDA $A354,Y ; Look-up table: 3C 78
STA $0468,X ; Either 1 or 2s

0xA26F
LDA $E4
ADC $E5 ; update RNG byte 2
STA $E4
AND #$01
TAY ; Close duration
LDA $A352,Y ; Look-up table: B4 F0
STA $0468,X ; Either 3 or 4s

********************************************************************************************************************************

6. Tako Trash: Fireball/bomb

0xA52B
LDA $E4
ADC $E6 ; update RNG byte 3
STA $E6 ; 50/50 chance
AND #$01 ; change #$01 to 00 for fireball, FF for bomb
BNE $A559

********************************************************************************************************************************

7. Dr. Wily: Spawn location, hitbox duration, respawn delay

Spawn location

0xB529
LDA $E4
ADC $E5 ; update RNG byte 2
STA $E4
AND #$0F
TAY
LDA $B8AA,Y ; Spawn location table: 01 00 01 07 02 06 03 05 04 03 05 02 06 01 07
ASL A
TAY
LDA $B890,Y ; Load YX coords based on above value:
STA $0378,X ; YX pairs: 48 54 40 84 30 D4 70 44 88 7C 70 BC D0 34 C0 B4
LDA $B891,Y
STA $0330,X

Hitbox duration / Respawn delay

0xB5D8
LDA $E4
AND #$01
TAY
LDA $B912,Y ; Hitbox duration table: 3C 5A
STA $0468,X ; 1 or 1.5s
LDA $E5
AND #$01
TAY
LDA $B914,Y ; Respawn delay table: 3C 96
STA $0480,X ; 1 or 2.5s

********************************************************************************************************************************

v1: Initial release.
v2: Added support for Met Man, Tako Trash, Dr. Wily. Added javascript randomizer for customization:
https://jeboo.github.io/mm4_derng/

Database match: Mega Man 4 (USA)
Database: No-Intro: Nintendo Entertainment System (v. 20180803-121122)
File SHA-1: 2AE9A049DAFC8C7577584B4B9256F7EF8932B29C
File CRC32: ADBD4E48
ROM SHA-1: 673A888C468ABE33FB0B3F063C6837DD21D5D32B
ROM CRC32: 2BC67AA8

Database match: Rockman 4 - Aratanaru Yabou!! (Japan)
Database: No-Intro: Nintendo Entertainment System (v. 20180803-121122)
File SHA-1: C33C6FA5B0A5B010AF6B38CBD22252A595500A5A
File CRC32: 771A9138
ROM SHA-1: 83F5EA60D6E6489EC0E5AF4B938D2D1C8FD24DD5
ROM CRC32: F161A5D8
Time to Beat
Main Story 3h 0m
Main + Extras 3h 30m
Speedrun Avg 0h 58m
Release Date
Aug 24, 2020
4 years ago
Similar Games
Popular Nintendo Entertainment System Games

Play Mega Man 4: MM4 deRNG Game

Experience Mega Man 4: MM4 deRNG Game (USA) online exclusivly at PastGames.net. Get Mega Man 4: MM4 deRNG ROM and use it with an emulator of your choice. Mega Man 4: MM4 deRNG can be played on PC, Mac, iOS and Android using our high quality downloads. PastGames is Americas #1 choice for Retro Games like Mega Man 4: MM4 deRNG.