into device label EC0 code_regex PLSV,\s+16, replace_matched begin SV00,8,SV01,8, end;
into device label EC0 code_regex B0VL,\s+16, replace_matched begin VL00,8,VL01,8, end;
into device label EC0 code_regex B0CR,\s+16, replace_matched begin CR00,8,CR01,8, end;
into device label EC0 code_regex B0RC,\s+16, replace_matched begin RC00,8,RC01,8, end;
into device label EC0 code_regex B0FC,\s+16, replace_matched begin FC00,8,FC01,8, end;
into device label EC0 code_regex B0CC,\s+16, replace_matched begin CC00,8,CC01,8, end;
into device label EC0 code_regex B0DC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label EC0 code_regex B0DV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label EC0 code_regex B1VL,\s+16, replace_matched begin VL10,8,VL11,8, end;
into device label EC0 code_regex B1CR,\s+16, replace_matched begin CR10,8,CR11,8, end;
into device label EC0 code_regex B1RC,\s+16, replace_matched begin RC10,8,RC11,8, end;
into device label EC0 code_regex B1FC,\s+16, replace_matched begin FC10,8,FC11,8, end;
into device label EC0 code_regex B1CC,\s+16, replace_matched begin CC10,8,CC11,8, end;
into device label EC0 code_regex B1DC,\s+16, replace_matched begin DC10,8,DC11,8, end;
into device label EC0 code_regex B1DV,\s+16, replace_matched begin DV10,8,DV11,8, end;
into device label EC0 code_regex B0AH,\s+16, replace_matched begin AH00,8,AH01,8, end;
into device label EC0 code_regex B1AH,\s+16, replace_matched begin AH10,8,AH11,8, end;
# fix 16-bit methods
#. B0VL to VL00,8,VL01,8
into method label BVO1 code_regex \(B0VL, replaceall_matched begin (B1B2(VL00,VL01), end;
#. B0CR to CR00,8,CR01,8
into method label BCR1 code_regex \(B0CR, replaceall_matched begin (B1B2(CR00,CR01), end;
#. B0RC to RC00,8,RC01,8
into method label BRC1 code_regex \(B0RC, replaceall_matched begin (B1B2(RC00,RC01), end;
into method label FBIF code_regex \(\^\^SBRG.EC0.B0RC, replaceall_matched begin (B1B2(^^SBRG.EC0.RC00,^^SBRG.EC0.RC01), end;
#. B0FC to FC00,8,FC01,8
into method label BIF2 code_regex \(B0FC, replaceall_matched begin (B1B2(FC00,FC01), end;
#. B0CC to CC00,8,CC01,8
into method label FBIF code_regex \(\^\^SBRG.EC0.B0CC, replaceall_matched begin (B1B2(^^SBRG.EC0.CC00,^^SBRG.EC0.CC01), end;
#. B0DC to DC00,8,DC01,8
into method label BIF1 code_regex \(B0DC, replaceall_matched begin (B1B2(DC00,DC01), end;
#. B0DV to DV00,8,DV01,8
into method label BIF4 code_regex \(B0DV, replaceall_matched begin (B1B2(DV00,DV01), end;
#. B1VL to VL10,8,VL11,8
into method label BVO2 code_regex \(B1VL, replaceall_matched begin (B1B2(VL10,VL11), end;
#. B1CR to CR10,8,CR11,8
into method label BCR2 code_regex \(B1CR, replaceall_matched begin (B1B2(CR10,CR11), end;
#. B1RC to RC10,8,RC11,8
into method label BRC2 code_regex \(B1RC, replaceall_matched begin (B1B2(RC10,RC11), end;
into method label FBIF code_regex \(\^\^SBRG.EC0.B1RC, replaceall_matched begin (B1B2(^^SBRG.EC0.RC10,^^SBRG.EC0.RC11), end;
#. B1FC to FC10,8,FC11,8
into method label BIX2 code_regex \(B1FC, replaceall_matched begin (B1B2(FC10,FC11), end;
#. B1CC to CC10,8,CC11,8
into method label FBIF code_regex \(\^\^SBRG.EC0.B1CC, replaceall_matched begin (B1B2(^^SBRG.EC0.CC10,^^SBRG.EC0.CC11), end;
#. B1DC to DC10,8,DC11,8
into method label BIX1 code_regex \(B1DC, replaceall_matched begin (B1B2(DC10,DC11), end;
#. B1DV to DV10,8,DV11,8
into method label BIX4 code_regex \(B1DV, replaceall_matched begin (B1B2(DV10,DV11), end;
#now the writes
#. B0AH to AH00,8,AH01,8
into method label _BTP code_regex Store\s+\(Arg0,\s+\^\^SBRG\.EC0\.B0AH\) replace_matched begin Store(Arg0, ^^SBRG.EC0.AH00) Store(ShiftRight(Arg0, 8), ^^SBRG.EC0.AH01) end;
into method label _BTP code_regex Store\s+\(0x05,\s+\^\^SBRG\.EC0\.B0AH\) replace_matched begin Store(0x05, ^^SBRG.EC0.AH00) Store(ShiftRight(0x05, 8), ^^SBRG.EC0.AH01) end;
#. B1AH to AH10,8,AH11,8
into method label _BTP code_regex Store\s+\(Arg0,\s+\^\^SBRG\.EC0\.B1AH\) replace_matched begin Store(Arg0, ^^SBRG.EC0.AH10) Store(ShiftRight(Arg0, 8), ^^SBRG.EC0.AH11) end;
into method label _BTP code_regex Store\s+\(0x05,\s+\^\^SBRG\.EC0\.B1AH\) replace_matched begin Store(0x05, ^^SBRG.EC0.AH10) Store(ShiftRight(0x05, 8), ^^SBRG.EC0.AH11) end;
# 32-bit EC registers to 8-bit
#. SMFV to MFV0,8,MFV1,8,MFV2,8,MFV3,8
#. B0SN to SN00,8,SN01,8,SN02,8,SN03,8
into device label EC0 code_regex SMFV,\s+32 replace_matched begin MFV0,8,MFV1,8,MFV2,8,MFV3,8 end;
into device label EC0 code_regex B0SN,\s+32 replace_matched begin SN00,8,SN01,8,SN02,8,SN03,8 end;
# fix 32-bit methods
#. SMFV to SMF0,8,SMF1,8,SMF2,8,SMF3,8
into method label _HRV code_regex \(\^\^\^SBRG\.EC0\.SMFV, replaceall_matched begin (B1B4(^^^SBRG.EC0.MFV0,^^^SBRG.EC0.MFV1,^^^SBRG.EC0.MFV2,^^^SBRG.EC0.MFV3), end;
#. B0SN to BSN0,8,BSN1,8,BSN2,8,BSN3,8
into method label FBIF code_regex \(\^\^SBRG\.EC0\.B0SN, replaceall_matched begin (B1B4(^^SBRG.EC0.SN00,^^SBRG.EC0.SN01,^^SBRG.EC0.SN02,^^SBRG.EC0.SN03), end;
# supporting math /偏移量
#. Offset (0x53),
#. B0TP, 16, //53
#. VL00,8,VL01,8, //55
#. CR00,8,CR01,8, //57
#. B0AC, 16, //59
#. B0ME, 16, //5b
#. B0RS, 16, //5d
#. RC00,8,RC01,8, //5f
#. FC00,8,FC01,8, //61
#. B0MC, 16, //63
#. B0MV, 16, //65
#. B0ST, 16, //67
#. CC00,8,CC01,8, //69
#. DC00,8,DC01,8, //6b
#. DV00,8,DV01,8, //6d
#. B0SI, 16, //6f
#. SN00,8,SN01,8,SN02,8,SN03,8, //71
#. B0MN, 96, //75
#. B0DN, 64, //81
#. B0CM, 48, //89
# 48-bit EC registers to 8-bit
into device label EC0 code_regex (B0CM,)\s+(48) replace_matched begin BXCM,%2,//%1%2 end;
# fix 48-bit methods
into method label FBIF code_regex \^\^SBRG.EC0.B0CM replaceall_matched begin ^^SBRG.EC0.RECB(0x89,48) end;
# 64-bit EC registers to 8-bit
into device label EC0 code_regex (B0DN,)\s+(64) replace_matched begin BXDN,%2,//%1%2 end;
# fix 64-bit methods
into method label FBIF code_regex \^\^SBRG.EC0.B0DN replaceall_matched begin ^^SBRG.EC0.RECB(0x81,64) end;
# 96-bit EC registers to 8-bit
into device label EC0 code_regex (B0MN,)\s+(96) replace_matched begin BXMN,%2,//%1%2 end;
# fix 96-bit methods
into method label FBIF code_regex \^\^SBRG.EC0.B0MN replaceall_matched begin ^^SBRG.EC0.RECB(0x75,96) end;
# deal with the Mutex problem /修复电量补丁后,有获取的电池状态显示为0%的情况
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;