SwitchMenuItem

Toggles state of switch #3361 instead of switching ATB-mode in default menu. Also, closes menu when doing so if switch #3362 is ON.

Originally made and first released by Cherry.

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/3

Offsets

RPG2003
1.0.8.0
1.0.8.0
0045CE54h
0005C254h

Sourcecode

DATA__0045CE54h:
			dd 3361				; Switch #3361
DATA__0045CE58h:
			dd 3362				; Switch #3362
PROC__0045CE5Ch:
			PUSH EAX
			PUSH EDX
			PUSH ECX
			PUSH EBX
			MOV EBX, [004CDC7Ch]		; TLcfgSystem
			MOV EBX, [EBX]
			MOV EAX, EBX
			MOV EDX, [DATA__0045CE54h]	; 3361
			CALL PROC__0048B324h		; TLcfgSystem.GetSwitch
			XOR AL, 1			; Toggle ON/OFF
			MOV ECX, EAX
			MOV EAX, EBX
			MOV EDX, [DATA__0045CE54h]	; 3361
			CALL PROC__0048B33Ch		; TLcfgSystem.SetSwitch
			MOV EAX, [004CDD74h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+18h]
			CALL PROC__004AB8B4h
			MOV EAX, EBX
			MOV EDX, [DATA__0045CE58h]	; 3362
			CALL PROC__0048B324h		; TLcfgSystem.GetSwitch
			TEST AL, AL			; Check switch value
			JZ __0045CEB6
			MOV EAX, [004CDC60h]
			MOV EAX, [EAX]
			CALL PROC__004A1054h
__0045CEB6h:
			POP EBX
			POP ECX
			POP EDX
			POP EAX
			RET
PROC__0045CEBBh:
			PUSH EAX
			PUSH EDX
			PUSH ECX
			MOV EAX, [004CDC7Ch]		; TLcfgSystem
			MOV EAX, [EAX]
			MOV EDX, [DATA__0045CE54h]	; 3361
			CALL PROC__0048B324h		; TLcfgSystem.GetSwitch
			TEST AL, AL
			POP ECX
			POP EDX
			POP EAX
			RET

Bytes

210D0000 220D0000

50 52 51 53 8B1D7CDC4C00 8B1B 8BC3 8B1554CE4500 E8AFE40200
3401 8BC8 8BC3 8B1554CE4500 E8B6E40200
A174DD4C00 8B00 8B4018 E81FEA0400
8BC3 8B1558CE4500 E882E40200
84C0 0F84C0000000 A160DC4C00 8B00 E89E410400
5B 59 5A 58 C3

50 52 51 A17CDC4C00 8B00 8B1554CE4500 E854E40200
84C0 59 5A 58 C3

Segment 2/3

Offsets

RPG2003
1.0.8.0
1.0.8.0
004A0EFAh
000A02FAh

Sourcecode

			CALL PROC__0045CEBBh
			NOP
			NOP

Bytes

E8BCBFFBFF
90 90

Segment 3/3

Offsets

RPG2003
1.0.8.0
1.0.8.0
004A26BBh
000A1ABBh

Sourcecode

			CALL PROC__0045CE5Ch
			JMP __004A26D8h

Bytes

E89CA7FBFFEB
EB16