Vagrant Story/Script Opcodes

From Data Crystal
< Vagrant Story
Revision as of 12:48, 12 December 2018 by Phonymike (talk | contribs) (added subpages)
Jump to navigation Jump to search

This is a sub-page of Vagrant Story.

This is a sub-page of Vagrant Story.

Script Opcodes

The games MPD files contain a Script section which controls not only the behavior of the games cut scenes but also some basic set up for displaying the room such as setting the Heads Up Display mode. This list of opcodes was extracted from the US version (SLUS-010.40) of BATTLE.PRG where the length of the opcodes can be found in an array of bytes located in RAM at offset 0x800E9C30. The pointers to the Opcode Functions follow directly after at location 0x800E9D30. The size of the opcodes are specified in bytes and includes the opcode itself as well as the parameters. There are some opcodes which have a length of 00 it is unknown whether these opcodes are invalid or take a variable number of parameters. In either case opcodes of length 00 have a function associated with them. The opcodes are decoded using a simple switch statement that can be found in RAM at offset 0x800BFCE8. Some opcodes address functions through a similar, though much smaller, table of function pointers found at offset 0x80069810.

Opcode No  Function Size Mnemonic

Opcode 00: 800b66a8 (01) nop()
Opcode 01: 800b66a8 (0a)
Opcode 02: 800b66a8 (03)
Opcode 03: 800b66a8 (03)
Opcode 04: 800b66a8 (04)
Opcode 05: 800b66a8 (12)
Opcode 06: 800b66a8 (0b)
Opcode 07: 800b66a8 (0b)
Opcode 08: 800b66a8 (26)
Opcode 09: 800b66a8 (00)
Opcode 0A: 800b66f4 (01)
Opcode 0B: 800b66a8 (01)
Opcode 0C: 800b6724 (01)
Opcode 0D: 800b6744 (03)
Opcode 0E: 800b6868 (03)
Opcode 0F: 800b68c4 (01)
Opcode 10: 800b6908 (0b) DialogShow(idDlg, Style, x,x, y, w, h, ?, ?, ?)
Opcode 11: 800b6ab0 (04) DialogText(idDlg, idText, ?)
Opcode 12: 800b6b74 (02) DialogHide(idDlg)
Opcode 13: 800b6d48 (09)
Opcode 14: 800b6f8c (02)
Opcode 15: 800b6fb0 (02)
Opcode 16: 800b6fd8 (04) SplashScreenChoose
Opcode 17: 800b7014 (06) SplashScreenLoad
Opcode 18: 800b70e8 (07) SplashScreenShow
Opcode 19: 800b71c4 (01) SplashScreenHide
Opcode 1A: 800b71f4 (01) SplashScreenFadeIn
Opcode 1B: 800b7218 (04)
Opcode 1C: 800b7398 (02)
Opcode 1D: 800b7358 (02)
Opcode 1E: 800b7428 (04)
Opcode 1F: 800b7490 (05)
Opcode 20: 800b7574 (09) ModelLoad(idChr, ?, idSHP, ?, ?, ?, ?, ?)
Opcode 21: 800b75f4 (06)
Opcode 22: 800b76a8 (06) ModelAnimate(idChr, ?, idAnim, ?, ?)
Opcode 23: 800b770c (05) ModelSetAnimations
Opcode 24: 800b77dc (07)
Opcode 25: 800b784c (09)
Opcode 26: 800b792c (0c) ModelPosition(idChr, ?, px,px, py,py, pz,pz, rx, ?, ?)
Opcode 27: 800b7a98 (07)
Opcode 28: 800b7b58 (0a) ModelMoveTo(idChr, x,x,x,x, y,y,y,y)
Opcode 29: 800b7c90 (07) ModelMoveTo2
Opcode 2A: 800b7d10 (07)
Opcode 2B: 800b7dc4 (06)
Opcode 2C: 800b7ef0 (06)
Opcode 2D: 800b7f84 (07)
Opcode 2E: 800b804c (0a)
Opcode 2F: 800b80b4 (03) ModeFree(idChr, ?)
Opcode 30: 800b810c (06) ModelLoadAnimationsEx
Opcode 31: 800b81a0 (06)
Opcode 32: 800b822c (06)
Opcode 33: 800b8290 (0b) ModelRotate
Opcode 34: 800b8360 (08)
Opcode 35: 800b83d4 (07)
Opcode 36: 800b8438 (07)
Opcode 37: 800b849c (05)
Opcode 38: 800b8510 (06) ModelLookAt
Opcode 39: 800b8590 (0a)
Opcode 3A: 800b860c (04) ModelLoadAnimations
Opcode 3B: 800b86e8 (01) WaitForFile
Opcode 3C: 800b8708 (02)
Opcode 3D: 800b8764 (02)
Opcode 3E: 800b8788 (0a) ModelIlluminate
Opcode 3F: 800b884c (04)
Opcode 40: 800b88d4 (06)
Opcode 41: 800b8a10 (06)
Opcode 42: 800b8b5c (03) ModelControlViaScript
Opcode 43: 800b66e4 (01)
Opcode 44: 800b66e4 (02) SetEngineMode
Opcode 45: 800b8b90 (03)
Opcode 46: 800b8bc4 (03)
Opcode 47: 800b8bf8 (04)
Opcode 48: 800b8c44 (01)
Opcode 49: 800b8c54 (03)
Opcode 4A: 800b8c7c (04)
Opcode 4B: 800b8d1c (03)
Opcode 4C: 800b8ce8 (03)
Opcode 4D: 800b66a8 (02)
Opcode 4E: 800b66a8 (01)
Opcode 4F: 800b66a8 (01)
Opcode 50: 800b8d50 (04) ModelControlViaBattleMode
Opcode 51: 800b8edc (04)
Opcode 52: 800b9170 (05)
Opcode 53: 800b91c4 (03)
Opcode 54: 800b91f0 (04) BattleOver
Opcode 55: 800b9230 (02)
Opcode 56: 800b9254 (03)
Opcode 57: 800b92a0 (04)
Opcode 58: 800b92d0 (02) SetHeadsUpDisplayMode(idMode)
Opcode 59: 800b92f4 (04)
Opcode 5A: 800b94d8 (07)
Opcode 5B: 800b9564 (04)
Opcode 5C: 800b9608 (07)
Opcode 5D: 800b9670 (04)
Opcode 5E: 800b96b0 (03)
Opcode 5F: 800b9724 (02)
Opcode 60: 800b9770 (03)
Opcode 61: 800b979c (03)
Opcode 62: 800b97e4 (02)
Opcode 63: 800b97f8 (01)
Opcode 64: 800b9818 (02)
Opcode 65: 800b983c (02)
Opcode 66: 800b9860 (03)
Opcode 67: 800b988c (05)
Opcode 68: 800b98c0 (0a) LoadRoom(idZone, idRoom, ?, ?, ?, ?, ?, ?, ?)
Opcode 69: 800b9a40 (04) LoadScene
Opcode 6A: 800b9a94 (04)
Opcode 6B: 800b9ac4 (02)
Opcode 6C: 800b9ae8 (04)
Opcode 6D: 800b9b18 (02) DisplayRoom
Opcode 6E: 800b9bf8 (01)
Opcode 6F: 800b9c18 (02)
Opcode 70: 800b9c58 (08) ModelColor
Opcode 71: 800b9d74 (04)
Opcode 72: 800b9db4 (03)
Opcode 73: 800b9f28 (02)
Opcode 74: 800b9f4c (02)
Opcode 75: 800b9f70 (01)
Opcode 76: 800b9f90 (01)
Opcode 77: 800b9fc0 (05)
Opcode 78: 800ba0e4 (02)
Opcode 79: 800ba194 (03)
Opcode 7A: 800ba108 (02)
Opcode 7B: 800ba218 (05)
Opcode 7C: 800ba264 (02)
Opcode 7D: 800ba288 (03)
Opcode 7E: 800ba2b4 (04)
Opcode 7F: 800b66a8 (01)
Opcode 80: 800ba2e0 (05) SoundEffects0
Opcode 81: 800ba35c (04)
Opcode 82: 800ba39c (05)
Opcode 83: 800ba3e4 (01)
Opcode 84: 800ba404 (03)
Opcode 85: 800ba444 (03) SoundEffects5
Opcode 86: 800ba470 (02) SoundEffects6
Opcode 87: 800ba494 (02)
Opcode 88: 800ba4c8 (02) SoundEffects8
Opcode 89: 800ba4ec (01)
Opcode 8A: 800b66a8 (00)
Opcode 8B: 800b66a8 (00)
Opcode 8C: 800b66a8 (00)
Opcode 8D: 800b66a8 (00)
Opcode 8E: 800b66a8 (00)
Opcode 8F: 800ba52c (05)
Opcode 90: 800ba588 (03) MusicLoad
Opcode 91: 800ba5b4 (02)
Opcode 92: 800ba5e8 (04) MusicPlay
Opcode 93: 800ba61c (03)
Opcode 94: 800ba650 (03)
Opcode 95: 800ba684 (03)
Opcode 96: 800ba6b8 (01)
Opcode 97: 800ba6e0 (02)
Opcode 98: 800ba72c (01)
Opcode 99: 800ba74c (02) AudioUnknown1
Opcode 9A: 800ba7bc (03)
Opcode 9B: 800ba800 (05)
Opcode 9C: 800ba848 (05)
Opcode 9D: 800ba774 (02) AudioSetPitch
Opcode 9E: 800ba798 (01) AudioUnknown2
Opcode 9F: 800ba890 (02)
Opcode A0: 800ba8bc (05)
Opcode A1: 800ba90c (02) SplashScreenEffects
Opcode A2: 800ba94c (02) CameraZoomIn
Opcode A3: 800baa04 (01)
Opcode A4: 800baa34 (01)
Opcode A5: 800baa58 (01)
Opcode A6: 800baacc (02)
Opcode A7: 800b66a8 (00)
Opcode A8: 800baaf0 (02)
Opcode A9: 800bab14 (02)
Opcode AA: 800babcc (05)
Opcode AB: 800b66a8 (00)
Opcode AC: 800b66a8 (00)
Opcode AD: 800b66a8 (00)
Opcode AE: 800b66a8 (00)
Opcode AF: 800b66a8 (00)
Opcode B0: 800b66a8 (00)
Opcode B1: 800bac38 (02)
Opcode B2: 800bac5c (08)
Opcode B3: 800bad78 (04)
Opcode B4: 800bade0 (07)
Opcode B5: 800bae74 (03)
Opcode B6: 800baea0 (07)
Opcode B7: 800bb028 (06)
Opcode B8: 800bb288 (01)
Opcode B9: 800bd6c4 (03)
Opcode BA: 800bd6c4 (02)
Opcode BB: 800bb2b8 (03)
Opcode BC: 800bb2e4 (01)
Opcode BD: 800bb304 (02)
Opcode BE: 800bb30c (01)
Opcode BF: 800bd6c4 (03)
Opcode C0: 800bc2e8 (07) CameraDirection
Opcode C1: 800bc2e8 (01) CameraSetAngle
Opcode C2: 800bc2e8 (03) CameraLookAt
Opcode C3: 800bc2e8 (03)
Opcode C4: 800bc2e8 (04) ModelAnimateObject
Opcode C5: 800bc2e8 (09)
Opcode C6: 800b66a8 (00)
Opcode C7: 800bc2e8 (0a)
Opcode C8: 800bc2e8 (0b)
Opcode C9: 800bc2e8 (02)
Opcode CA: 800bc2e8 (0a)
Opcode CB: 800bc2e8 (03)
Opcode CC: 800b66a8 (00)
Opcode CD: 800b66a8 (00)
Opcode CE: 800b66a8 (00)
Opcode CF: 800b66a8 (00)
Opcode D0: 800bc2e8 (07) CameraPosition
Opcode D1: 800bc2e8 (01) SetCameraPosition
Opcode D2: 800bc2e8 (03)
Opcode D3: 800bc2e8 (03)
Opcode D4: 800bc2e8 (04) CameraHeight
Opcode D5: 800bc2e8 (09)
Opcode D6: 800b66a8 (00)
Opcode D7: 800bc2e8 (0a)
Opcode D8: 800bc2e8 (0b)
Opcode D9: 800bc2e8 (02)
Opcode DA: 800bc2e8 (0a)
Opcode DB: 800bc2e8 (03)
Opcode DC: 800b66a8 (00)
Opcode DD: 800b66a8 (00)
Opcode DE: 800bb33c (02)
Opcode DF: 800bb35c (02)
Opcode E0: 800bb41c (02) CameraWait(?)
Opcode E1: 800bb450 (02)
Opcode E2: 800bd444 (06)
Opcode E3: 800bd444 (06)
Opcode E4: 800bd6c4 (05)
Opcode E5: 800bd6c4 (06)
Opcode E6: 800bd6c4 (05)
Opcode E7: 800bd6c4 (02)
Opcode E8: 800bb38c (03)
Opcode E9: 800bb3bc (03)
Opcode EA: 800bdc9c (04) CameraZoom
Opcode EB: 800bdc9c (04)
Opcode EC: 800bdc9c (04) CameraZoomScalar
Opcode ED: 800bd6c4 (05)
Opcode EE: 800bdc9c (00)
Opcode EF: 800bdc9c (06)
Opcode F0: 800bb474 (02) Wait(numFrames)
Opcode F1: 800bb4cc (02)
Opcode F2: 800bb668 (05)
Opcode F3: 800bb4f0 (02)
Opcode F4: 800bb504 (02)
Opcode F5: 800bb554 (04)
Opcode F6: 800bb5a4 (02)
Opcode F7: 800bb5ac (03)
Opcode F8: 800b66a8 (01)
Opcode F9: 800b66a8 (01)
Opcode FA: 800b66a8 (01)
Opcode FB: 800b66a8 (01)
Opcode FC: 800b66a8 (01)
Opcode FD: 800b66a8 (01)
Opcode FE: 800bb604 (01)
Opcode FF: 800bb604 (01) return()