BGM&SE Pointer

When values of variables #3389~#3392 are 1000 or above, they're working as pointers for a BGM's fade-time, volume, pitch and panning (1000 gets subtracted when using), otherwise the properties that were configured will be used. The same goes for variables #3394~#3396 for an SE's volume, pitch and panning.

Originally made and first released by bugmenot.

RPG2000
1.00UNKNOWN2000-05-072000-06-192000-07-112000-11-132000-11-152000-12-27
1.07
2001-05-05
1.10
2003-03-27
1.50
2003-06-25
1.51/1.52
2015-07-05
1.60
2015-09-15
1.61
2017-09-14
1.62
RPG2003
1.00UNKNOWN1UNKNOWN21.0.2.1
1.0.2.1
1.0.3.0
1.0.4.0
1.0.5.0
1.0.5.0
1.0.6.0
1.0.6.0
1.0.7.0
1.0.7.0
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414

Segment 1/9

Offsets

RPG2000
2000-12-27
1.07
0047140Ch
0007080Ch
RPG2003
1.0.8.0
1.0.8.0
00493AACh
00092EACh

Sourcecode

			JMP __004715C4h
			JMP __00493C64h

Bytes

E9B3010000
E9B3010000

Segment 2/9

Offsets

RPG2000
2000-12-27
1.07
00471451h
00070851h
RPG2003
1.0.8.0
1.0.8.0
00493AE6h
00092EE6h

Sourcecode

			NOP
PROC__00471452h:
			PUSH ECX
			PUSH EBX
			MOV ECX, 3389				; BGM Variables Base
			CMP EDX, 0
			JE __00471462h
			MOV BL, 0
			JMP __0047146Fh
__00471462h:
			MOV BL, 1
			JMP __0047146Fh
PROC__00471466h:
			PUSH ECX
			PUSH EBX
			MOV ECX, 3394				; SE Variables Base
			MOV BL, 0
__0047146Fh:
			ADD ECX, EDX
			CALL PROC__0045E524h
			MOV EDX, [0049ABA4h]			; TLcfgSystem
			MOV EDX, [EDX]
			MOV EDX, [EDX+24h]
			CMP EDX, ECX
			JNC __00471488h
			POP EBX
			POP ECX
			RET
__00471488h:
			MOV EDX, ECX
			PUSH EAX
			MOV EAX, [0049ABA4h]			; TLcfgSystem
			MOV EAX, [EAX]
			CALL PROC__00469EE0h			; TLcfgSystem.GetVariable
			CMP EAX, 1000
			JGE __004714A2h
			POP EAX
			POP EBX
			POP ECX
			RET
__004714A2h:
			CMP BL, 1
			JNE __004714B2h
			MOV EBX, 1000
			SUB EAX, EBX
			MUL EBX
			JMP __004714B7h
__004714B2h:
			SUB EAX, 1000
__004714B7h:
			POP EDX
			POP EBX
			POP ECX
			RET
			NOP
PROC__00493AE7h:
			PUSH ECX
			PUSH EBX
			MOV ECX, 3389				; BGM Variables Base
			CMP EDX, 0
			JE __00493AF7h
			MOV BL, 0
			JMP __00493B04h
__00493AF7h:
			MOV BL, 1
			JMP __00493B04h
PROC__00493AFBh:
			PUSH ECX
			PUSH EBX
			MOV ECX, 3394				; SE Variables Base
			MOV BL, 0
__00493B04h:
			ADD ECX, EDX
			CALL PROC__0047967Ch
			MOV EDX, [004CDC7Ch]			; TLcfgSystem
			MOV EDX, [EDX]
			MOV EDX, [EDX+24h]
			CMP EDX, ECX
			JNC __00493B1Dh
			POP EBX
			POP ECX
			RET
__00493B1Dh:
			MOV EDX, ECX
			PUSH EAX
			MOV EAX, [004CDC7Ch]			; TLcfgSystem
			MOV EAX, [EAX]
			CALL PROC__0048B398h			; TLcfgSystem.GetVariable
			CMP EAX, 1000
			JGE __00493B37h
			POP EAX
			POP EBX
			POP ECX
			RET
__00493B37h:
			CMP BL, 1
			JNE __00493B47h
			MOV EBX, 1000
			SUB EAX, EBX
			MUL EBX
			JMP __00493B4Ch
__00493B47h:
			SUB EAX, 1000
__00493B4Ch:
			POP EDX
			POP EBX
			POP ECX
			RET

Bytes

90 51 53 B93D0D0000 83FA00 7404
B300 EB0D
B301 EB09
51 53 B9420D0000 B300 01D1 E8AED0FEFF
8B15A4AB4900 8B12 8B5224 39 CA 7303
5B 59 C3

89CA 50 A1A4AB4900 8B00 E8498AFFFF
3DE8030000 7D04
58 5B 59 C3

80FB01 750B
BBE8030000 29D8 F7E3 EB05
2DE8030000 5A 5B 59 C3
90 51 53 B93D0D0000 83FA00 7404
B300 EB0D
B301 EB09
51 53 B9420D0000 B300 01D1 E8715BFEFF
8B157CDC4C00 8B12 8B5224 39 CA 7303
5B 59 C3

89CA 50 A17CDC4C00 8B00 E86C78FFFF
3DE8030000 7D04
58 5B 59 C3

80FB01 750B
BBE8030000 29D8 F7E3 EB05
2DE8030000 5A 5B 59 C3

Segment 3/9

Offsets

RPG2000
2000-12-27
1.07
00488E32h
00088232h
RPG2003
1.0.8.0
1.0.8.0
004AFDEAh
000AF1EAh

Sourcecode

			CALL PROC__00471452h			; Check Variable for BGM FadeTime
			CALL PROC__00493AE7h			; Check Variable for BGM FadeTime

Bytes

E81B86FEFF
E8F83CFEFF

Segment 4/9

Offsets

RPG2000
2000-12-27
1.07
00488E44h
00088244h
RPG2003
1.0.8.0
1.0.8.0
004AFDFCh
000AF1FCh

Sourcecode

			CALL PROC__00471452h			; Check Variable for BGM Volume
			CALL PROC__00493AE7h			; Check Variable for BGM Volume

Bytes

E80986FEFF
E8E63CFEFF

Segment 5/9

Offsets

RPG2000
2000-12-27
1.07
00488E56h
00088256h
RPG2003
1.0.8.0
1.0.8.0
004AFE0Eh
000AF20Eh

Sourcecode

			CALL PROC__00471452h			; Check Variable for BGM Pitch
			CALL PROC__00493AE7h			; Check Variable for BGM Pitch

Bytes

E8F785FEFF
E8D43CFEFF

Segment 6/9

Offsets

RPG2000
2000-12-27
1.07
00488E68h
00088268h
RPG2003
1.0.8.0
1.0.8.0
004AFE20h
000AF220h

Sourcecode

			CALL PROC__00471452h			; Check Variable for BGM Panning
			CALL PROC__00493AE7h			; Check Variable for BGM Panning

Bytes

E8E585FEFF
E8C23CFEFF

Segment 7/9

Offsets

RPG2000
2000-12-27
1.07
00488F3Eh
0008833Eh
RPG2003
1.0.8.0
1.0.8.0
004AFEF6h
000AF2F6h

Sourcecode

			CALL PROC__00471466h			; Check Variable for SE Volume
			CALL PROC__00493AFBh			; Check Variable for SE Volume

Bytes

E82385FEFF
E8003CFEFF

Segment 8/9

Offsets

RPG2000
2000-12-27
1.07
00488F50h
00088F50h
RPG2003
1.0.8.0
1.0.8.0
004AFF08h
000AF308h

Sourcecode

			CALL PROC__00471466h			; Check Variable for SE Pitch
			CALL PROC__00493AFBh			; Check Variable for SE Pitch

Bytes

E81185FEFF
E8EE3BFEFF

Segment 9/9

Offsets

RPG2000
2000-12-27
1.07
00488F62h
00088F62h
RPG2003
1.0.8.0
1.0.8.0
004AFF1Ah
000AF31Ah

Sourcecode

			CALL PROC__00471466h			; Check Variable for SE Panning
			CALL PROC__00493AFBh			; Check Variable for SE Panning

Bytes

E8FF84FEFF
E8DC3BFEFF