BH/RECV/X SCD SCRIPTING

cbnj
stalker
Posts: 293

BH/RECV/X SCD SCRIPTING

Post by cbnj »

This first post contain a list of opcodes ive found in cv game so far, ill update it often as i keep experimenting whit it.

After a brief introduction about how to disassemble the room scripts ill start to put examples about how to write and implement the opcodes for actual gameplay.

‐-----------------------------------------------
Kapdap guithub page contain lots of opcodes for cv game, altough is based in ps2 the opcodes major remain as if were DC ones so you can use them too :) dont forget to thank to Kapdap for such nice work and be so gentle to share it to all of us! https://github.com/kapdap/re-cvx-tools/ ... ripting.md
---------------------------‐---------------------

2000 Derender players
3A00 ????
4000 Look at Target followed by 000000 for input target xyz cordenates.
9500 Play BGM last 2 bits select song, range 00 to 78 hex for both discs.
CB00 Albinoid gas trap setup
CD00 Jump to main menu
CE00 Set 1st person view
CE01 Set 3rd person view
CF00 Set battle mode inventory
A000 Force map screen
6500 diables player input
A100 Reduces health gradually while you are in the room, stops reaching danger status.
A200 renders ligther flame on claire rigth hand
A201 renders ligther flame on claire left forearm
A202 renders ligther flame on claire on head
A300 Attaches room first item to claire feet (ID 0)
A400 Triggers climb up stairs animation
A410 stuck claire visual body to 0,0,0, you can move around whit physical invisible body, permanent.
A401 step sound + claire turn around and walk if the next bits are modified, probably a "GOTO" opcode
A402 same as A401 this continues untill A405
A600 Play BGM last 2 bits select song 00-78
A700 Play BGM last 2 bits select song 00-78
CB01 5 minutes until detonation
CB02 5 minutes until detonation + countdown voice last 10 seconds
0503 Set enemy
0507 Set item
0403 check enemy
0404 check item
0D enemy checker/linker
0E item picked up cheker
081900008900 swap to claire normal
081901008900 swap to claire umbrella
8901 swap to chris
8902 swap to steve
8903 swap to wesker
D300 go to results screen (mg and bg)
2A00nn00 switch to camera number nn
33000000001E
36000000001E fade in/out + RGBA + time
050A1B000000 xx00 give item xx to player trough menu.
Last edited by cbnj on Sun Jan 21, 2024 6:04 am, edited 24 times in total.

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

DE - CODE VERONICA

Follow me along this interesting process to unveil what lies behind the events of rockford Island from a diferent point of view, not trough the eyes of Claire, Chris, Steve or Wesker, not even trough the eyes of DIJ, but trough the eyes of a 1999 programmer, discover how they created the magic to bring the game assets to life and the diverse tricks to make it work out and recieve that so much wanted payment check. ;)
Thats is one of the many goals this post will try to achive!

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

LEARNING TO SPLIT THE SCRIPT

To successfully write the script for the game we should first learn to read it, every opcode have a specific length and specific starting and ending bytes, knowing this values we can then separate the code into sentences we can understand an thus we can mofy them to our liking.

Extract R0_5530.RDX whit RDXTool

Open subfile R0_5530.bin_4_01.yxy in your favorite hex editor.

This is how a basic battle mode room script looks like:
GAME SCRIPT: RECV US DISC 1
ROOM: R0_5530
Attachments
RDXTool_v1.1.zip
(4.03 MiB) Downloaded 44 times
R0_5530.bin_4_01.zip
(292 Bytes) Downloaded 40 times
EXAMPLE_CODE.jpg
Last edited by cbnj on Sun Jan 21, 2024 6:23 am, edited 8 times in total.

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

The first part of every script is a pointer table, this table sends you to the diferent areas of the script, each one controlling a diferent aspect of the room.
The pointer table ends at the offset the first pointer takes you and is there where the room opcodes starts.

The pointer table for this script ends at offset 8 as this is where the first pointer takes you, from offset 8 and beyond everything you will find are opcodes (instructions for the game to execute), and everithing before offset 8 are pointers.
Attachments
Pointers table
Pointers table
Last edited by cbnj on Fri Jan 19, 2024 9:38 pm, edited 3 times in total.

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

SPLTTING THE OPCODES INTO FUNCTIONS

Checking the second pointer in the table list you will see this sends you to the offset 3E, this marks the start of the second "function" of the script, everything before this point and up to offset 8 belongs to function one, and since there are no more pointers in the pointers table everything after this point belongs to the second function.
Attachments
SECOND_POINTER.jpg
FIRST_FUNCTION.jpg
SECOND_FUNCTION.jpg
Last edited by cbnj on Fri Jan 19, 2024 9:40 pm, edited 1 time in total.

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

SPLITTING FUNCTIONS INTO SINGLE INSTRUCTIONS

Now that we know where every function starts and ends, lets copy them to a txt file for easier manipulation and start to dissasemble it respecting the pointer table to keep a ordered structure.

Here i copied the pointer table and added a mark to each function to know where it starts, you can leave a empty line bewteen them if you preffer or write a tittle on top of each line in a way you indentify them, thats is enterelly up to you.
Attachments
COPIED_FUNCTIONS.jpg

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

Now that the code is expossed in this way you can notice there are clear areas where the code seems to repeat but contain sligths changes in it, are this similarities what we look for to know where to start to split the single instructions and assing them a specific meaning for each one.
Attachments
SIMILARITIES1.jpg
SIMILARITIES2.jpg

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

Now that we discover this similarities lets start to group this values removing each space between them and insolate each one in a single line.

The code starts to make some sence now but apparently the similarities are not more present, the code looks again like just bunch of random numbers...
Attachments
SPLITTING_SIMILARITIES.jpg
Last edited by cbnj on Wed Jan 17, 2024 10:27 am, edited 1 time in total.

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

You ever heard "the eagle sees more than what a pigeon does because the eagle fly higher" no? Well you will need to become an eagle and look at the code in a higher scale than just single small lines of code as a pigeon would do, this time we will look for complete "sentences" of code to be similar and if you analyze the rest of the code in this way you will discover there still are similarities, one of the next line starts whit 011E040A and furter more we can find another 011E040A, one of them is followed by a 17000100 and the other by a 17000200, then both are followed by a 86070000 and the rest of numbers seems to follow along, so lets split at that point and compare the values to see if we can find some matchs.
Attachments
011E040A_1.jpg
011E040A_2.jpg

cbnj
stalker
Posts: 293

Re: BH/RECV/X SCD SCRIPTING

Post by cbnj »

Now that we split at the start of the second 11E040A value we can see both lines are identical exept for some minor changes, exactly as what happened whit the previous lines we sorted out, but this time in a higher scale, we can see both lines end whit a value 0300 and similarities stop again so the next logical step is to split there after the second 0300 of our newly creat lines and analyze the rest of the code.
Attachments
011E040A_COMP.jpg

  • Similar Topics
    Replies
    Views
    Last post