;---------------------------------------------------------------------
;Name:      Energy savings
;Version:	1.0
;Patch for:	Samsung SGH-X100 mobile phone
;Firmware: 	X100XEDG1
;Coded:		(c) 2006 by NeO_2kX
;Comment:	thanks to dav_av
;---------------------------------------------------------------------
;Place: 	Russia, Ryazan
;Mail to: 	NeO_2kX@SGH.RU
;IcQ:		301-987-405
;---------------------------------------------------------------------

.binid X100XEDG1
.thumb
.equ set1_0read_eeprom 			0x000C56F8
.equ lk_get_text 				0x002BE700
.equ _sprintf 					0x003E1710
.equ mcc_set_incoming_calls_als 0x007ED418
.equ mcc_org_menucolour 		0x009B12C0
.equ mcc_set_lcd_contrast 		0x007EDA88
.equ mcc_set_main_contrast 		0x007EDD98
.equ mcc_set_exit 				0x007EBDA8
.equ mcc_set_end 				0x007EBDF8

.equ time 0x001

.start 0x00128B30
dcd time

.start 0x00128D60
dcd time

.start 0x007ED388
	.mcc MCC_TRANSF 0 0 0 0 My_Menu

.start 0x00128D9A
	LDR R0, =My_Energy
	MOV PC, R0
.data


;Correct_Get_Default_Menu_Value_Func
.start 0x000ACDB4
	MOV	R0, #0x23
	BL	set1_0read_eeprom
	LDRB R0, [r0]
	LDR R1, =0x471
	ADD R0, R0, R1
	BL lk_get_text
	ADD R2, R0, #0
	ADD R0, R7, #0
	ADR	R1, ="%s"
	BL	_sprintf
LDR R0 =0x000ACE9E+1
BX R0

.start 0x007EDF58
My_Menu:
	.mcc MCC_INIT_RESTORE
	.mcc MCC_MENU 		0xA 0x422 	0x5 	0x42
	.mcc MCC_NAVIGSA 	0xA 0 0 	0x415 	mcc_set_incoming_calls_als 	0x422
	.mcc MCC_NAVIGA 	0xA 0 0 	0x415 	mcc_org_menucolour 			0x423
	.mcc MCC_NAVIGA 	0xA 0 0 	0x415 	mcc_set_lcd_contrast 		0x424
	.mcc MCC_NAVIGA 	0xA 0 0 	0x415 	mcc_set_main_contrast 		0x425
	.mcc MCC_NAVIGEA 	0xA 0 0 	0x415 	Enery_Menu 					0x426
	.mcc MCC_IF 		0x9 0x1 	0x1 	0 	mcc_set_exit
	.mcc MCC_ELSEIF 	0x9 0x1 	0x9 	0 	mcc_set_end
	.mcc MCC_RETMENU 	0x1

Enery_Menu:
	.mcc MCC_INIT_RESTORE
	.mcc MCC_TITLE 		0xA 0x426 	0x4
	.mcc MCC_MENU 		0xA 0x471 	0x2 	0x234
	.mcc MCC_ENAVIGSA 	0xA 0x9 	0   	0x446 	0x007EE2D8 	0x471
	.mcc MCC_ENAVIGEA 	0xA 0x9 	0x1 	0x446 	0x007EE318 	0x472
	.mcc MCC_IF 		0x9 0x1 	0x1 	0 		mcc_set_exit
	.mcc MCC_ELSEIF 	0x9 0x1 	0x9 	0 		mcc_set_end
	.mcc MCC_RETMENU 	0x1

.align 1
My_Energy:
	MOV	R0, #0x23
	BL	set1_0read_eeprom
	LDRB R0, [r0]
	CMP R0, #1
	BEQ Lcd_Off
	BL 0x00128DB4

Lcd_Off:
	BL 0x00128DAA

eng_string:
.string "Energy savings"

rus_string:
.string "Энергосбережение"

.replace 0x00A1F028 eng_string
.replace 0x00A35D30 rus_string


