Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. Very quick guide on how to find out if starting new mission during another will be useful (works with III and VC).
  2.  
  3. Let's look into famous Cherry Poppers instapass. First of all, Sanny Builder is required. After decompling the script, you need to find "wait 0" instruction that corresponds to mission state. "wait 0" is needed in loops so that script will stop execution until next frame.
  4.  
  5. So, let's look at the beginning of "Hit the Courier". Look for "wait 0" commands. First few are easily connected to cutscenes. Then there are some of them that are in model loading loops. Finally, first real one is at offset 4074 ("COUNT2_4074"). "wait 0" instruction takes 4 bytes in memory ("01 00" = opcode, "04" - indicator of 1 byte parameter, "00" = 0), so when next time script is executed again, it will start at offset 4078.
  6.  
  7. Now important part: when new mission is started, any mission scripts are now run using new base, so in fact new mission will be executed twice, first instance as usual, from start, and the second - from saved position of the old script. So we now look for 4078 offset in "Distribution" script.
  8.  
  9. What do we see in japanese version? We see that at offset 4040 there is 00BA opcode and 'ICE_AT1' string. To be absoultely sure, we open hex editor, look for "BA00" hex code (opcodes are stored backwards) or in this case it is simplier to search for a string. And we see this sequence. So 4040 = BA, 4041 = 00, ..., 4074 = 01, 4045 = 00. So the opcode that is executed is 0001, which is suddenly "wait" with parameter of 2 byte size (because next byte is 05, which means "2 bytes"). Next two bytes (inverted) are 1770, which is hex for 6000. So it actually is a part of original script, not misaligned, because there is "wait 6000" command in original script. So game doesn't crash, and it even is part of script that rewards player, including asset counter.
  10.  
  11. Obviously it is not as easy as in this case. For example, Gone Fishing instapass ignores few "unknown" commands until it reaches real part (config files of Sanny Builder or any opcode database can be used to check if opcode exists). But I hope this very quick guide will be a bit useful for multiple missions starting. yesDuping
  12.  
  13. PS: Small table with parameter sizes (can be useful when checking SCM file with hex editor)
  14. 02, 03, 05 = 2 bytes
  15. 04 = 1 byte
  16. 01, 06 = 4 bytes
  17. any other = 0 bytes (parameter is not read, and unknown value will be used).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement