Difference between revisions of "42484156"

From SimsWiki
Jump to: navigation, search
(Syncronized with BHAV article)
m (Update, etc)
Line 1: Line 1:
{{OldWikiEntry}}
+
=42484156 (BHAV)=
====""SimAntics"" Behavioural Function====
+
This resource contains the [[SimAntics]] subroutines.
  
__All BHAVs have a similar basic format:__
+
==Format==
64 - Filename (null terminated)
+
;64 bytes
12 - Header
+
:File name (null terminated)
''var'' - Instruction 1
+
;12 bytes
''var'' - Instruction 2
+
:(see [[42484156#Header Format|Header Format]] below)
''var'' - Instruction n
+
;''for each entry''
...
+
;variable
 +
:(see [[42484156#Entry Format|Entry Format]] below)
  
__Each header also uses a similar format:__
+
===Header Format===
2 - signature (0x8000 through 0x8009)
+
;WORD
2 - count (number of instructions in file)
+
:Signature (0x8000 through 0x8009)
1 - tree type (deprecated)
+
;WORD
1 - args (number of Parameters passed to the subroutine)
+
:Number of instructions in subroutine
1 - locals (number of local variables used in the subroutine)
+
;Byte
1 - header flag (deprecated)
+
:tree type (deprecated)
4 - Tree Version # (signed integer)
+
;Byte
 +
:Number of parameters passed to the subroutine
 +
;Byte
 +
:Number of local variables used in the subroutine
 +
;Byte
 +
:Header flag (depreciated)
 +
;DWORD
 +
:Tree version number (signed integer)
  
 +
===Entry Format===
 +
The signature defines the structure of the each instruction.
  
The signature also defines the structure of the individual
+
====8000, 8001 & 8002====
instructions, as follows:
+
(instruction length: 12 bytes)
8000, 8001 & 8002 (instruction length: 12 bytes)
+
;WORD
- 2 - Function/OpCode
+
:Function/OpCode
- 1 - Goto on True
+
;Byte
- 1 - Goto on False
+
:Goto on true
- 8 - Operands
+
;Byte
*  8003 & 8004 (instruction length: 20 bytes)
+
:Goto on false
- 2 - Function/OpCode
+
;8 bytes
- 1 - Goto on True
+
:Operands
- 1 - Goto on False
+
- 16 - Operands
+
*  8005 & 8006 (instruction length: 21 bytes)
+
- 2 - Function/OpCode
+
- 1 - Goto on True
+
- 1 - Goto on False
+
- 1 - Node Version (Flag - 0x00 or 0x01)
+
- 16 - Operands
+
*  8007 & 8008 (instruction length: 23 bytes)
+
- 2 - Function/OpCode
+
- 2 - Goto on True
+
- 2 - Goto on False
+
- 1 - Node Version (Flag - 0x00 or 0x01)
+
- 16 - Operands
+
*  8009 (instruction length: 24 bytes)
+
- 2 - Function/OpCode
+
- 2 - Goto on True
+
- 2 - Goto on False
+
- 1 - Node Version (Flag - 0x00 or 0x01)
+
- 16 - Operands
+
- 1 - Cacheflags
+
  
Notes:
+
====8003 & 8004====
The 1-byte Goto statements in 8001-8006 appear to be the same as
+
(instruction length: 20 bytes)
  was used in TS1: 0xFD as Error, 0xFE as True, and 0xFF as False.
+
;WORD
 +
:Function/OpCode
 +
;Byte
 +
:Goto on true
 +
;Byte
 +
:Goto on false
 +
;16 bytes
 +
:Operands
  
The 2-byte Goto statements in 8007 appear to be using
+
====8005 & 8006====
  0xFFFC as Error, 0xFFFD as True, and 0xFFFE as False.
+
(instruction length: 21 bytes)
 +
;WORD
 +
:Function/OpCode
 +
;Byte
 +
:Goto on True
 +
;Byte
 +
:Goto on False
 +
;Byte
 +
:Node version (Flag - 0x00 or 0x01)
 +
;16 bytes
 +
:Operands
  
The 8007 format can contain more than 256 seperate instructions,
+
====8007 & 8008====
  thus the use of 2-byte Goto statements.
+
(instruction length: 23 bytes)
 +
;WORD
 +
:Function/OpCode
 +
;WORD
 +
:Goto on true
 +
;WORD
 +
:Goto on false
 +
;Byte
 +
:Node version (Flag - 0x00 or 0x01)
 +
;16 bytes
 +
:Operands
 +
====8009====
 +
(instruction length: 24 bytes)
 +
;WORD
 +
:Function/OpCode
 +
;WORD
 +
:Goto on true
 +
;WORD
 +
:Goto on false
 +
;Byte
 +
:Node version (Flag - 0x00 or 0x01)
 +
;16 bytes
 +
:Operands
 +
;Byte
 +
:Cache flags
  
Number of each signature type (0x8000 - 0x8007) contained in objects.package:
+
====Notes====
0x8000 - 1
+
The 1-byte Goto statements in 8001-8006 appear to use the same codes as was used in [[The Sims 1]]: *0xFD as Error
0x8001 - 2
+
*0xFE as True
0x8002 - 25
+
*0xFF as False.
0x8003 - 75
+
 
0x8004 - 4
+
The 2-byte Goto statements in 8007-8009 use these Goto codes:
0x8005 - 285
+
*0xFFFC as Error
0x8006 - 1,357
+
*0xFFFD as True
0x8007 - 15,507
+
*0xFFFE as False.
 +
 
 +
The 8007-8009 formats can contain more than 256 seperate instructions, thus the use of 2-byte Goto statements.
 +
 
 +
==Notes==
 +
Number of each signature type (0x8000 - 0x8007) contained in (original) objects.package:
 +
*0x8000 - 1
 +
*0x8001 - 2
 +
*0x8002 - 25
 +
*0x8003 - 75
 +
*0x8004 - 4
 +
*0x8005 - 285
 +
*0x8006 - 1,357
 +
*0x8007 - 15,507
 +
*0x8008 & 0x8009 introduced later
 +
 
 +
{{OldWikiEntryCleaned}}
  
 
[[Category:Modding]]
 
[[Category:Modding]]
 
[[Category:InternalFormats]]
 
[[Category:InternalFormats]]

Revision as of 01:51, 12 July 2006

Contents

42484156 (BHAV)

This resource contains the SimAntics subroutines.

Format

64 bytes
File name (null terminated)
12 bytes
(see Header Format below)
for each entry
variable
(see Entry Format below)

Header Format

WORD
Signature (0x8000 through 0x8009)
WORD
Number of instructions in subroutine
Byte
tree type (deprecated)
Byte
Number of parameters passed to the subroutine
Byte
Number of local variables used in the subroutine
Byte
Header flag (depreciated)
DWORD
Tree version number (signed integer)

Entry Format

The signature defines the structure of the each instruction.

8000, 8001 & 8002

(instruction length: 12 bytes)

WORD
Function/OpCode
Byte
Goto on true
Byte
Goto on false
8 bytes
Operands

8003 & 8004

(instruction length: 20 bytes)

WORD
Function/OpCode
Byte
Goto on true
Byte
Goto on false
16 bytes
Operands

8005 & 8006

(instruction length: 21 bytes)

WORD
Function/OpCode
Byte
Goto on True
Byte
Goto on False
Byte
Node version (Flag - 0x00 or 0x01)
16 bytes
Operands

8007 & 8008

(instruction length: 23 bytes)

WORD
Function/OpCode
WORD
Goto on true
WORD
Goto on false
Byte
Node version (Flag - 0x00 or 0x01)
16 bytes
Operands

8009

(instruction length: 24 bytes)

WORD
Function/OpCode
WORD
Goto on true
WORD
Goto on false
Byte
Node version (Flag - 0x00 or 0x01)
16 bytes
Operands
Byte
Cache flags

Notes

The 1-byte Goto statements in 8001-8006 appear to use the same codes as was used in The Sims 1: *0xFD as Error

  • 0xFE as True
  • 0xFF as False.

The 2-byte Goto statements in 8007-8009 use these Goto codes:

  • 0xFFFC as Error
  • 0xFFFD as True
  • 0xFFFE as False.

The 8007-8009 formats can contain more than 256 seperate instructions, thus the use of 2-byte Goto statements.

Notes

Number of each signature type (0x8000 - 0x8007) contained in (original) objects.package:

  • 0x8000 - 1
  • 0x8001 - 2
  • 0x8002 - 25
  • 0x8003 - 75
  • 0x8004 - 4
  • 0x8005 - 285
  • 0x8006 - 1,357
  • 0x8007 - 15,507
  • 0x8008 & 0x8009 introduced later

This article is imported from the old MTS2 wiki. It's original page, with comments, can be found at http://old_wiki.modthesims2.com/42484156

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox