(Resident Evil | Biohazard): Director's Cut - modo-lv/game-hacking GitHub Wiki

Memory addresses

Code

Code addresses contain assembly instructions, which may glitch if modified in emulators with Recompiler CPU setting (Interpreter recommended).

NTSC-U (R.E.) NTSC-J (Biohazard) Description
800122EC 800120CC 02 00 40 10 (beq v0,zero,2) Part of "enemy receiving attack" subroutine, checks whether the attack will connect with the "candidate" enemy currently being processed (v0 != 0), and if not, skips setting it as the target for further damage calculations etc. Patching 40 10 -> 00 24 turns the skip into a li zero,2 (a no-op), making the game always mark the enemy as hit, no matter where the shot actually went.
80012310 02 00 02 24 (li v0,2). Part of "enemy receiving attack" subroutine, sets the enemy status to "stagger" (2) if its life isn't below zero. Patching 02 -> 03 changes the status to "dead", making all enemies die from a single attack.
80012444 23 10 43 00 (subu v0,v0,v1). Part of received attack calculation for enemies, subtracts attack damage (v1) from the enemy's health (v0). Patching 43->42 makes the health subtract from itself, thus always ending up 0 and killing the enemy. This is the calculation address for Training mode.
8001246C Same as 80012444, but for Advanced mode.
80012484 Same as 80012444, but for Standard mode.
800189E4 05 00 00 11 (beq t0,zero,800189FC). Part of the save menu routine, checks if some (currently unclear) value is 0 and if yes, skips the Ink Ribbon spending subroutine. Patching the 3rd byte 00->08 compares the value to itself instead, thus never consuming a ribbon.
800189E8 2F 00 02 24 (_li v0,0x2F). Part of the save menu routine, sets the Target Item to 2F (Ink Ribbon), to be "spent" on save. Patching to 00 does avoid ribbon loss, however it will make the game look for the 00 byte in player's inventory and beyond (the limit for the search is set to 256 item slots in a row, and loops around if the item isn't found), and modify the byte and the one after it (which is where the amount of the item would be stored). This could potentially corrupt memory, so it's safer to modify 800189E4 instruction instead.
80018A8C 01 00 42 24 (addiu v0,v0,1) Part of the save menu routine, increases the save number after saving the game.
8002D588 8002E1F8 00 50 82 30 (andi v0,a0,5000). Button inputs (up/down) checked to determine whether to scroll the item list in the box.
8002D5B4 8002E220 Same as 8002D588, secondary check.
8002D66C 8002E30C EC 7F 31 A0 (sl s1,0x7FEC(at)) Sets the direction/distance for the next scroll. 1 when going to scroll down, FF when up.
8002D670 8002E310 01 00 45 24 (addiu a1,v0,1) Increments the box selection offset to point at the next item, when scrolling down.
800343B4 47 00 82 10 (beq a0,v0,800344D4). Part of the "spend item" subroutine, skips the whole thing if the Target Item is D ("Dum Dum Rounds", ammo type cut from the game). Patching the 82 byte to 84 will instead compare the Target Item to itself, thus always skipping the rest of the function and preventing item expenditure. Does not seem to apply to gun ammo.
80038664 09 00 40 04 (bltz v0,8003868c). Part of the typewriter activation subroutine, jumps to the rejection message if player has no ribbons. Patching 09->01 changes the target address to success, always showing the "use Ink Ribbon?" prompt and allowing access to save menu. The actual act of saving will lead to to a freeze (unless other modifications are made to prevent it), because the game will try to look for the ink ribbon forever (there's an infinite loop bug with the item finding code).
8003F574 80040654 FF FF 42 24 (addiu v0,v0,-1). Part of the "fire weapon" subroutine, changes the ammo amount when a gun is fired. Patching FFFF->0000 changes the -1 to 0, giving all guns infinite ammo (except flamethrower, which is processed by some other subroutine).

Data

Address (U/J) Type Description
80090518 Address 8003B040. Address of a routine that gets called every frame (while not in subscreens). Replacing the address will call that routine instead.
800B697C Byte Which character to show in the demo (autoplay).
800BA008 Address Address of the first inventory item slot. 800C8784 for Chris & Jill, 800C8794 for Rebecca.
800B7FEB Byte Item code of the item currently selected in the inventory.
U:800B7FF3 J:800B8713 Byte Player's inventory focus.
00: Map
02: File
04: Radio
06: Exit
08-18: Item slots 1-8, increasing by 2.
U:800B7FF0 J:800B8710 Byte When an item is activated, indicates what submenu is focused:
00: None, item not activated
01: Inventory submenu ("Use/Equip", "Check", "Combine")
02: Box inventory (when box open).
U:800B7FF4 J:800B8714 Byte Selected item sub-selection offset. 00-02 for normal inventory, 00-2F for item box.
800B82F8 Byte Controller connected (0) or not (FF).
800B82FA BShort Inverse buttons inputs ("max joker command").
800B82F9 Byte Controller type.
41: Gamepad (digital)
73: Analog (DualShock)
53: Analog joystick
23: NeGcon
63: GunCon
12: PlayStation mouse
800C3004 BInt Game mode & some loading flags.
00010000: "Advanced" /w double ammo
00020000: "Advanced"
00040000: "Training"
10000000: Demo (autoplay in the main menu)
20000000: Normal game ("Standard" mode by default, modified by respective flags).
800C51AC Byte Current health.
800C5299 Byte Maximum health Training/Standard/Advanced:
B4/8C/64: Chris
96/60/46: Jill
8C/58/40: Rebecca.
800C8456 Byte Player's interaction with a typewriter. Doesn't check for ribbons in inventory at any point, game freezes when trying to save if there aren't any.
0: No interaction (default)
1: Display message
2: Wait for player to respond yes/no.
3: Open the save screen (unless player answered "no")
4: Save complete/canceled, returning to game.
Setting it to any of the 1-3 values will trigger that event and continue through the rest.
800C8457 Byte Player's interaction with an item box.
0: No interaction (default).
1: Interaction triggered.
2: Box lid opening.
3: Box screen opening.
4: Inside box inventory screen.
Setting it to 1-3 will trigger the process and progress through the states ending with 4. Setting it to 4 directly does nothing (game clears it back to 0).
800C845B Byte Player's inventory screen.
0: Closed
1: Open (triggers opening).
800C8666 Byte Target Item. Internal storage for an item type that the game is looking for in the player's inventory.
  • Gets set to Ink Ribbon when player has clicked on a save slot in the save screen and the writing to memory card is about to start.
800C8667 Byte Total number of items (non-empty slots) in the player inventory.
800C8669 Byte Which character is being played as.
0: Chris (mansion & helipad roof)
1: Jill (mansion & helipad roof)
3: Rebecca
4: Chris (underground)
5: Jill (underground)
Switching characters takes effect after loading (going through a door), and can be glitchy, especially switching to Rebecca.
800C8680 BShort Player action input (buttons depend on mapping):
0001: Move forward
0002: Turn right
0004: Move backward
0008: Turn left
0010: Aim up
0020: Aim down
00C0: Interact/shoot
0100: Raise weapon
0200: Dash
0400: Spin item clockwise
0800: Spin item counter-clocwise
1000: Zoom item in
2000: Zoom item out
4000: Confirm
8000: Cancel
000C8682 BShort Once-per-press version of 800C8680 that disappears after a frame, effectively registering single presses but not continuous holding.
800C8688 Byte Save count (starts at 1 at new game, increases after saving/loading).
800C868B Byte Which scenario is being played: Chris (0) or Jill (1).
800C870C BByte Replay flags
02: Infinite Rocket Launcher unlocked
10: Special key unlocked (must be set for the door to become unlockable)
20: Infinite Colt Python unlocked
800C8724-800C8782 (Byte+Byte)[2F] Item box slots: type + amount.
800C8784-800C879B (Byte+Byte)* Inventory slots of the player. Each value consists of an item type, followed by item amount (ammo for weapons, uses for keys, etc.).
Slots 1-6: Chris's inventory
Slots 1-8: Jill's inventory
Slots 7-12: Rebecca's inventory.
800CF844 BShort Button inputs. Seems to be a cache for non-inverse inputs calculated from the inverse (800B82FA).
800CF848 BShort Once-per-press version of 800CF844 that disappears after a frame, effectively registering single presses but not continuous holding.
800CF84C BShort Button inputs.
800CF850 BShort Once-per-press button inputs, same as 000C8682.

Item types

  • 02: Beretta
  • 04: Colt Python (Dum Dum Rounds) (cut content, gets replaced in inventory by a handgun)
  • 07: Bazooka (Explosive Rounds)
  • 08: Bazooka (Acid Rounds)
  • 09: Bazooka (Flame Rounds)
  • 0B: Clip
  • 0D: Dum Dum Rounds (cut content)
  • 2F: Ink Ribbon

Binary overlays

RE loads parts of its code on the fly from the files in PSX/PROG2. Each file has a set address location where it needs to be placed in order to function correctly as part of the main code.

File Load address Data offset Data length
STAGE6.EXE 80105400 800 23800

GameShark codes

Item box anywhere

Press [L1]+[Triangle] to access the item chest in any room or other location.

  • [L1]/[Triangle] are the default buttons, will update accordingly if you change the in-game mapping for "Item L. Turn"/"Cancel".
D00C8680 8800 ; If [L1]+[Triangle] pressed
E00C8457 0000 ; And not in inventory
300C8457 0003 ; Trigger item box
Save without ribbons
  • If you have no ribbons, hold [L1] while interacting with a typewriter to save for free.
  • If you have ribbons but don't want to spend them, press [L1] while the save menu is open to save for free.
  • [L1] is the default button, will update accordingly if you change the in-game mapping for "Item L. Turn".
E00C8681 0008 ; If [Item left turn] ([L1] by default)
30038664 0001 ; Bypass ribbon checking
E0038664 0001 ; If ribbon checking bypassed
300189E6 0008 ; Bypass ribbon spending
E00C8456 0004 ; If save menu is closing
30038664 0009 ; (Re)set ribbon checking to normal
E0038664 0009 ; If ribbon checking normal
300189E6 0000 ; (Re)set ribbon spending to normal
Save anywhere

Press [L1]+[Square] to access a typewriter in any room.

  • IMPORTANT! Don't save in rooms if you have an item in your inventory that you can use on an object in that room (such as Slides on the Projector). The item is likely to disappear (game confuses save menu with using item on the object).
  • IMPORTANT! Saving in non-standard locations can cause glitches when you load the game. Use multiple slots and save just after entering a room, and be extra cautious around scripted events.
  • [L1]/[Square] are the default buttons, will update accordingly if you change the in-game mapping for "Item L. Turn"/"Dash".
D0090518 85FC ; If typewriter has been triggered
80090518 B040 ; Restore normal function
D00C8680 0A00 ; If [Item left turn]+[Dash] ([L1]+[Square] by default)
80090518 85FC ; Trigger typewriter
Freeze save count

Total number of saves does not increase when saving the game.

E00C8456 0003 ; If save menu opening
E0018A8C 0001 ; And save count increase enabled
210C8688 0001 ; Decrement save count
E00C8456 0003 ; If save menu opening
30018A8C 0000 ; Disable save count increase
E00C8456 0004 ; If save menu closing
E0018A8C 0000 ; And save count increase disabled
200C8688 0001 ; Increment save count
E00C8456 0004 ; If save menu closing
30018A8C 0001 ; Enable save count increase
Infinite health
C20C5299 0001 // Copy max health
800C51AC 0000 // to current
Guns don't spend ammo (except flamethrower)

NTSC-U:

DuckStation:

A703F570 FFFF0000 ; Disable ammo spending, restore when cheat is off

Universal:

D00CF844 0008 ; If [R1]
8003F570 0000 ; Disable ammo spending
D00CF844 0048 ; If [R1]+[X]
8003F570 0000 ; Disable ammo spending
D10CF844 0008 ; If not [R1]
D10CF844 0048 ; And not [R1]+[X]
8003F570 FFFF ; (Re)set ammo spending to normal

NTSC-J:

DuckStation:

A7040654 FFFF0000 ; Disable ammo spending, restore when cheat is off

Universal:

D00CF844 0008 ; If [R1]
80040654 0000 ; Disable ammo spending
D00CF844 0088 ; If [R1]+[Square]
80040654 0000 ; Disable ammo spending
D10CF844 0000 ; If [nothing]
80040654 FFFF ; (Re)set ammo spending to normal
Change item amount

Highlight an item in the inventory and press [L1]/[R1] to -1/+1 its amount (ammo in weapons, ink ribbon uses, etc.).

  • 255 + 1 will loop back to 0.

DuckStation:

C40C845B 00000000 ; If in inventory
51010000 000B7FF3 ; Store selection index in $00
51830000 000C877D ; Add inventory start address + 1 (- 8) to $00 so it becomes the exact address of selected item amount
51060001 00000000 ; Store the current item amount in $01
D00CF848 00000008 ; If [R1] (once per press)
51040100 00000001 ; Write $01+1 to ($00)
D00CF848 00000004 ; If [L1] (once per press)
51040100 000000FF ; Write $01-1 to ($00)
00000000 0000FFFF ;
Change item in box

Open item chest, select the first slot above the yellow line and press [L2]/[R2] to change the item in it.

  • IMPORTANT! This only changes the item, without affecting the amount/ammo/uses that each item can have. Use an amount modification cheat to fix this as needed.

DuckStation

NTSC-U:

C40C8457 00000003 ; If in box
C40B7FF0 00000001 ; And focus on box items
C40B7FF4 0000002E ; And last item selected
D00CF848 00000002 ; If [R2] (once per press)
200C8782 00000001 ; Increment type
D00CF848 00000001 ; If [L2] (once per press)
210C8782 00000001 ; Decrement type
E00C8782 000000FF ; If below zero
300C8782 0000004B ; Set to max
E30C8782 0000004B ; If out of bounds
300C8782 00000000 ; Set to 0
A702D588 50005003 ; Scroll down on L2/R2
A702D5B4 50005003 ; Scroll down on L2/R2
A702D66E A031A020 ; Set the visual scroll distance to nothing
A702D670 00010000 ; Prevent scroll movement
00000000 0000FFFF
C00CF84C 00000000 ; When buttons released
3202D588 00000003 ; Revert scrolling on L2/R2
3202D5B4 00000003 ; Revert scrolling on L2/R2
3002D66E 00000031 ; Reset the visual scroll distance to normal
3002D670 00000001 ; Restore scroll movement
E00B7FF0 00000001 ; If focus in inventory
E00B7FF4 0000002F ; And last item selected
300B7FF4 00000000 ; Select first item (require scrolling up next time, to trigger image updates)
00000000 0000FFFF

NTSC-J:

C40C8457 00000003 ; If in box
C40B8710 00000001 ; And focus on box items
C40B8714 0000002E ; And last slot selected
D00CF848 00000002 ; If [R2] (once per press)
200C8782 00000001 ; Increment type
D00CF848 00000001 ; If [L2] (once per press)
210C8782 00000001 ; Decrement type
E00C8782 000000FF ; If below zero
300C8782 0000004B ; Set to max
E30C8782 0000004B ; If out of bounds
300C8782 00000000 ; Set to 0
A702E1F8 50005003 ; Scroll down on L2/R2
A702E220 50005003 ; Scroll down on L2/R2
A702E30E A031A020 ; Set the visual scroll distance to nothing
A702E310 00010000 ; Prevent scroll movement
00000000 0000FFFF
C00CF84C 00000000 ; When buttons released
3202E1F8 00000003 ; Revert scrolling on L2/R2
3202E220 00000003 ; Revert scrolling on L2/R2
3002E30E 00000031 ; Reset the visual scroll distance to normal
3002E310 00000001 ; Restore scroll movement
E00B8710 00000001 ; If focus in inventory
E00B8714 0000002F ; And last box item selected
300B8714 00000000 ; Select first box item (require scrolling up next time, to trigger image updates)
00000000 0000FFFF
One-hit kills

DuckStation

NTSC-J (Biohazard)

A7012310 00020003

Hit anywhere

Attacks always connect with enemies no matter where they are. Still need to aim up/down for prone/flying enemies.

NTSC-J (Biohazard)

DuckStation

A70120CE 10402400 ; Replace "only if hit" check with "always"
⚠️ **GitHub.com Fallback** ⚠️