└── src ├── XmlToIdc ├── XmlToIdc.exe ├── obj │ └── x86 │ │ └── Debug │ │ └── XmlToIdc.exe └── Properties │ └── AssemblyInfo.cs ├── MakeXmlDef ├── MakeXmlDef.exe ├── MakeXmlDef.userprefs ├── MakeXmlDef.sln └── MakeXmlDef │ ├── Properties │ └── AssemblyInfo.cs │ ├── MakeXmlDef.csproj │ └── MakeXmlDef.cs ├── RR2EcuFlash ├── RR2EcuFlash.exe ├── RR2EcuFlash │ ├── AssemblyInfo.cs │ └── Main.cs └── Make_ECUFlash_def.pl ├── Definitions ├── upload.html ├── update_logger.pl └── UpdateLoggerFromXmlForEcuId.php └── IDA ├── ida.idc ├── Convert16bitOperand.idc ├── WalkTheRom.idc ├── Format16bitTABLE.idc ├── MakeTablePointers.idc ├── Format_SH_VectorTable.idc └── Format16bitROM.idc /src/XmlToIdc/XmlToIdc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschultzca/DefinitionTools/HEAD/src/XmlToIdc/XmlToIdc.exe -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschultzca/DefinitionTools/HEAD/src/MakeXmlDef/MakeXmlDef.exe -------------------------------------------------------------------------------- /src/RR2EcuFlash/RR2EcuFlash.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschultzca/DefinitionTools/HEAD/src/RR2EcuFlash/RR2EcuFlash.exe -------------------------------------------------------------------------------- /src/XmlToIdc/obj/x86/Debug/XmlToIdc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschultzca/DefinitionTools/HEAD/src/XmlToIdc/obj/x86/Debug/XmlToIdc.exe -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef.userprefs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Definitions/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | RR Logger XML Import Tool 4 | 5 | 6 | 7 | 8 | 9 |
11 | 12 |
13 | 14 |
15 | 16 |
17 | Test 18 | Commit 19 |
20 |
21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeXmlDef", "MakeXmlDef\MakeXmlDef.csproj", "{31512E83-07B9-4D70-AD6D-9C8387EEF835}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {31512E83-07B9-4D70-AD6D-9C8387EEF835}.Debug|x86.ActiveCfg = Debug|x86 13 | {31512E83-07B9-4D70-AD6D-9C8387EEF835}.Debug|x86.Build.0 = Debug|x86 14 | {31512E83-07B9-4D70-AD6D-9C8387EEF835}.Release|x86.ActiveCfg = Release|x86 15 | {31512E83-07B9-4D70-AD6D-9C8387EEF835}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(MonoDevelopProperties) = preSolution 18 | StartupItem = MakeXmlDef\MakeXmlDef.csproj 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MakeXmlDef")] 9 | [assembly: AssemblyDescription("Create a ECU def from a template and IDA names/address info.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("dschultz")] 12 | [assembly: AssemblyProduct("MakeXmlDef")] 13 | [assembly: AssemblyCopyright("Copyright © dschultz 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b7d6d26b-1509-47d9-b0aa-fe46aa94109f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.3.1.*")] 36 | [assembly: AssemblyFileVersion("0.3.1.0")] 37 | -------------------------------------------------------------------------------- /src/XmlToIdc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XmlToIdc")] 9 | [assembly: AssemblyDescription("Convert RomRaider XML definition data to IDA naming scripts")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("NSFW")] 12 | [assembly: AssemblyProduct("XmlToIdc")] 13 | [assembly: AssemblyCopyright("Copyright © 2015 NSFW@romraider.forum and Dale C. Schultz")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1f7256d3-481c-4b0a-9393-877c7530a955")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.2.8.*")] 36 | [assembly: AssemblyFileVersion("1.2.8.0")] 37 | -------------------------------------------------------------------------------- /src/RR2EcuFlash/RR2EcuFlash/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("RR2EcuFlash")] 9 | [assembly: AssemblyDescription("Convert a RomRaider Editor definition to an EcuFlash definition")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Dale C. Schultz")] 12 | [assembly: AssemblyProduct("RR2EcuFlash")] 13 | [assembly: AssemblyCopyright("Copyright © 2012 - Dale C. Schultz")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1f7256d3-481c-4b0a-9393-877c7530a559")] 24 | 25 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 26 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 27 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 28 | 29 | [assembly: AssemblyVersion("1.0.0.*")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // The following attributes are used to specify the signing key for the assembly, 33 | // if desired. See the Mono documentation for more information about signing. 34 | 35 | //[assembly: AssemblyDelaySign(false)] 36 | //[assembly: AssemblyKeyFile("")] 37 | 38 | -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef/MakeXmlDef.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 10.0.0 7 | 2.0 8 | {31512E83-07B9-4D70-AD6D-9C8387EEF835} 9 | Exe 10 | MakeXmlDef 11 | MakeXmlDef 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug 18 | DEBUG; 19 | prompt 20 | 4 21 | x86 22 | true 23 | 24 | 25 | full 26 | true 27 | bin\Release 28 | prompt 29 | 4 30 | x86 31 | true 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/IDA/ida.idc: -------------------------------------------------------------------------------- 1 | // 2 | // This file is automatically executed when IDA is started. 3 | // You can define your own IDC functions and assign hotkeys to them. 4 | // 5 | // You may add your frequently used functions here and they will 6 | // be always available. 7 | // 8 | // 9 | #include 10 | 11 | static main(void) { 12 | 13 | // 14 | // This function is executed when IDA is started. 15 | 16 | AddHotkey("Ctrl-Alt-B", "myMakeByte"); 17 | AddHotkey("Ctrl-Alt-W", "myMakeWord"); 18 | AddHotkey("Ctrl-Alt-D", "myMakeDword"); 19 | AddHotkey("Ctrl-Alt-F", "myMakeFloat"); 20 | } 21 | 22 | /* 23 | * Copyright (C) 2012 Dale C. Schultz 24 | * RomRaider member ID: dschultz 25 | * 26 | * You are free to use this script and the finctions: 27 | * myMakeByte 28 | * myMakeWord 29 | * myMakeDword 30 | * myMakeFloat 31 | * for any purpose, but please keep 32 | * notice of where it came from! 33 | * 34 | */ 35 | //----------------------------------------------------------------------- 36 | // Format the selected range of addresses or at the cursor position as BYTE 37 | static myMakeByte(void) { 38 | auto addrFrom, addrTo; 39 | if ((SelStart() == BADADDR) || (SelEnd() == BADADDR)) { 40 | addrFrom = here; 41 | addrTo = addrFrom + 1; 42 | } 43 | else { 44 | addrFrom = SelStart(); 45 | addrTo = SelEnd(); 46 | } 47 | while (addrFrom < addrTo) { 48 | MakeUnknown(addrFrom, 1, DOUNK_SIMPLE); 49 | MakeByte(addrFrom); 50 | addrFrom = addrFrom+1; 51 | } 52 | } 53 | 54 | //----------------------------------------------------------------------- 55 | // Format the selected range of addresses or at the cursor position as WORD 56 | static myMakeWord(void) { 57 | auto addrFrom, addrTo; 58 | if ((SelStart() == BADADDR) || (SelEnd() == BADADDR)) { 59 | addrFrom = here; 60 | addrTo = addrFrom + 1; 61 | } 62 | else { 63 | addrFrom = SelStart(); 64 | addrTo = SelEnd(); 65 | } 66 | while (addrFrom < addrTo) { 67 | MakeUnknown(addrFrom, 2, DOUNK_SIMPLE); 68 | MakeWord(addrFrom); 69 | addrFrom = addrFrom+2; 70 | } 71 | } 72 | //----------------------------------------------------------------------- 73 | // Format the selected range of addresses or at the cursor position as DOUBLE WORD 74 | static myMakeDword(void) { 75 | auto addrFrom, addrTo; 76 | if ((SelStart() == BADADDR) || (SelEnd() == BADADDR)) { 77 | addrFrom = here; 78 | addrTo = addrFrom + 1; 79 | } 80 | else { 81 | addrFrom = SelStart(); 82 | addrTo = SelEnd(); 83 | } 84 | while (addrFrom < addrTo) { 85 | MakeUnknown(addrFrom, 4, DOUNK_SIMPLE); 86 | MakeDword(addrFrom); 87 | addrFrom = addrFrom+4; 88 | } 89 | } 90 | 91 | //----------------------------------------------------------------------- 92 | // Format the selected range of addresses or at the cursor position as FLOAT 93 | static myMakeFloat(void) { 94 | auto addrFrom, addrTo; 95 | if ((SelStart() == BADADDR) || (SelEnd() == BADADDR)) { 96 | addrFrom = here; 97 | addrTo = addrFrom + 1; 98 | } 99 | else { 100 | addrFrom = SelStart(); 101 | addrTo = SelEnd(); 102 | } 103 | while (addrFrom < addrTo) { 104 | MakeUnknown(addrFrom, 4, DOUNK_SIMPLE); 105 | MakeFloat(addrFrom); 106 | addrFrom = addrFrom+4; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/IDA/Convert16bitOperand.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 4 9 | * Date : 2013-12-09 10 | * 11 | * This script attempts to convert immediate and indirect references to 12 | * offsets if the value is greater than 0x00FF. 13 | * This script REQUIRES that Segments are create prior to its use. 14 | * Use the IDA scipt Format16BitROM.idc to achieve this. The 15 | * DATA segment to be referenced must have a base paragraph set to the 16 | * offest value >> 8. i.e.: offset 0x20000, segment base: 0x2000 17 | * 18 | * Offest creation can be started in four ways. 19 | * 1) run the script at the screen cursor position to convert one instruction entry, but beware of item 2) 20 | * 2) place the screen cursor at the beginning of a function to convert the entire function start to end 21 | * 3) select a screen range and convert the selected range 22 | * 4) place the screen cursor at 0x0000 to convert the entire segment, NOT ADVISED 23 | * NOTE: if you need to remove an offset from an instruction, press Alt-F1 and delete the operand info 24 | * in the Operand text field and press OK. 25 | * 26 | * If you wish to make this script available via an IDA hotkey you will need to modify your ida.idc script. 27 | * Add the line: #include 28 | * at the top of the file. 29 | * Then add this line to the main() section of ida.idc 30 | * AddHotkey("F4", "Convert16bitOperand"); 31 | * 32 | */ 33 | 34 | #include 35 | // uncomment the next line if you are using hotkeys, then comment out the static main() line 36 | //static Convert16bitOperand() { 37 | static main() { 38 | auto proc, currAddr, endAddr, opType, segReg, op1, op2, newOp1, xAddrStr, xAddr, opTypeStr; 39 | proc = get_processor_name(); 40 | if (proc != "6816") { 41 | Message(form("%s processor not supported by Convert16bitOperand() function\n", proc)); 42 | return; 43 | } 44 | if (SegByName("RAM") == BADADDR) { 45 | Warning("This ROM is not segmented properly for use by the Convert16bitOperand() function"); 46 | return; 47 | } 48 | currAddr = here; 49 | if (currAddr == 0x0) { 50 | currAddr = Word(0x2); 51 | endAddr = SegEnd(currAddr); 52 | } 53 | else if (GetFunctionAttr(currAddr, FUNCATTR_START) == currAddr) { 54 | endAddr = GetFunctionAttr(currAddr, FUNCATTR_END); 55 | } 56 | else if ((SelStart() == BADADDR) || (SelEnd() == BADADDR)) { 57 | currAddr = here; 58 | endAddr = currAddr + 1; 59 | } 60 | else { 61 | currAddr = SelStart(); 62 | endAddr = SelEnd(); 63 | } 64 | // walk the selected range and convert referecnes 65 | while (currAddr < endAddr) { 66 | opType = GetOpType(currAddr, 0); 67 | opTypeStr = ""; 68 | if ((opType == o_displ) || (opType == o_imm)) { 69 | op2 = ""; 70 | segReg = -1; 71 | op1 = GetOpnd(currAddr, 0); 72 | if (strstr(op1, "X") != BADADDR) { 73 | op2 = "X"; 74 | segReg = GetReg(currAddr,"XK"); 75 | } 76 | if (strstr(op1, "Y") != BADADDR) { 77 | op2 = "Y"; 78 | segReg = GetReg(currAddr,"YK"); 79 | } 80 | if (strstr(op1, "Z") != BADADDR) { 81 | op2 = "Z"; 82 | segReg = GetReg(currAddr,"ZK"); 83 | } 84 | if (strstr(GetMnem(currAddr), "ldx") != BADADDR) { 85 | op2 = "X"; 86 | segReg = GetReg(currAddr,"XK"); 87 | } 88 | if (strstr(GetMnem(currAddr), "ldy") != BADADDR) { 89 | op2 = "Y"; 90 | segReg = GetReg(currAddr,"YK"); 91 | } 92 | if (strstr(GetMnem(currAddr), "ldz") != BADADDR) { 93 | op2 = "Z"; 94 | segReg = GetReg(currAddr,"ZK"); 95 | } 96 | if (op2 != "" && segReg != BADADDR) { 97 | if (opType == o_displ) { 98 | OpAlt(currAddr, 0, ""); 99 | OpOff(MK_FP("ROM", currAddr), 0, segReg << 16); 100 | opTypeStr = "register"; 101 | } 102 | if (opType == o_imm && (GetOperandValue(currAddr, 0) > 0x00FF)) { 103 | OpAlt(currAddr, 0, ""); 104 | OpOffEx(MK_FP("ROM", currAddr), 0, REF_OFF32, -1, segReg << 16, 0); 105 | opTypeStr = "immediate"; 106 | } 107 | newOp1 = GetOpnd(currAddr, 0); 108 | xAddrStr = substr(newOp1 , 0, strstr(newOp1, ",")); 109 | xAddr = LocByName(xAddrStr); 110 | add_dref(currAddr, xAddr, dr_I); 111 | Message(form("At %s converting %s reference using I%s with base 0x%X, referencing location %s\n", atoa(currAddr), opTypeStr, op2, segReg << 16, xAddrStr)); 112 | } 113 | } 114 | currAddr = currAddr + 2; 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /src/RR2EcuFlash/Make_ECUFlash_def.pl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2010+ Dale C. Schultz 3 | # RomRaider member ID: dschultz 4 | # 5 | # You are free to use this script for any purpose, but please keep 6 | # notice of where it came from! 7 | # 8 | # Use this script to convert the RomRaider Editor definition to an ECUFlash definition. 9 | # Then update the ECUFlash ROM ID info. 10 | # 11 | # Caveats: This script expects only one ROM definition in the file 12 | # excluding the tag. Basically take the RR ECU def of interest 13 | # and copy it to an XML format of a typical EcuFlash def, start/ending 14 | # with only the and included elements. 15 | # 16 | unless ($ARGV[0]) { 17 | print "Input file missing...\n"; 18 | print "Usage: $0 \n"; 19 | exit 1; 20 | } 21 | 22 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 23 | $mDate = sprintf("%04d-%02d-%02d", $year+=1900, $mon+=1, $mday); 24 | 25 | use XML::TreeBuilder; 26 | my $tree = XML::TreeBuilder->new(); 27 | 28 | $tree->parse_file($ARGV[0]); 29 | $xmlid = $tree->find_by_tag_name('xmlid')->as_text; 30 | $address = $tree->find_by_tag_name('internalidaddress')->as_text; 31 | $ecuid = $tree->find_by_tag_name('ecuid')->as_text; 32 | $year = $tree->find_by_tag_name('year')->as_text; 33 | $market = $tree->find_by_tag_name('market')->as_text; 34 | $model = $tree->find_by_tag_name('model')->as_text; 35 | $submodel = $tree->find_by_tag_name('submodel')->as_text; 36 | $trans = $tree->find_by_tag_name('transmission')->as_text; 37 | $flash = $tree->find_by_tag_name('flashmethod')->as_text; 38 | 39 | open (OUTPUT, ">${xmlid}.xml") || die "Could not open output file to write. $!\n"; 40 | 41 | # 42 | #
43 | #
44 | #
45 | print OUTPUT < 47 | 68 | PREAMBLE 69 | print OUTPUT "\n"; 70 | print OUTPUT " \n"; 71 | print OUTPUT " ${xmlid}\n"; 72 | print OUTPUT " ${address}\n"; 73 | print OUTPUT " ${xmlid}\n"; 74 | print OUTPUT " ${ecuid}\n"; 75 | print OUTPUT " ${year}\n"; 76 | print OUTPUT " ${market}\n"; 77 | print OUTPUT " Subaru\n"; 78 | print OUTPUT " ${model}\n"; 79 | print OUTPUT " ${submodel}\n"; 80 | print OUTPUT " ${trans}\n"; 81 | print OUTPUT " SH7058\n"; 82 | print OUTPUT " ${flash}\n"; 83 | print OUTPUT " subarudbw\n"; 84 | print OUTPUT " \n"; 85 | print OUTPUT " 32BITBASE\n"; 86 | foreach my $rom ($tree->find_by_tag_name('table')){ 87 | $TableName = $rom->attr_get_i('name'); 88 | next if ($TableName eq "Checksum Fix"); 89 | $TableName = "Fuel Pump Duty" if ($TableName eq "Fuel Pump Duty Cycle"); 90 | $TableName =~ s/ $/__/; 91 | $TableName =~ s/ $/_/; 92 | $TableAddress = $rom->attr_get_i('storageaddress'); 93 | $TableAddress =~ s/^0x//; 94 | $TableType = $rom->find_by_tag_name('table')->attr_get_i('type'); 95 | $TableType =~ s/^X Axis$/X/; 96 | $TableType =~ s/^Y Axis$/Y/; 97 | $TableXsize = $rom->attr_get_i('sizex'); 98 | $TableYsize = $rom->attr_get_i('sizey'); 99 | if (!$TableType) { 100 | if (!$LastTable) { 101 | } 102 | elsif ($LastTable eq "data") { 103 | print OUTPUT " />\n"; 104 | } 105 | else { 106 | print OUTPUT ">\n"; 107 | } 108 | print OUTPUT ' \n" . '
\n" . '
\n \n\n"; 131 | close OUTPUT; 132 | -------------------------------------------------------------------------------- /src/IDA/WalkTheRom.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 2 9 | */ 10 | 11 | #include 12 | static main() { 13 | auto currAddr, currName, fout, textOut, namesArray, xSize, ySize, xSizeAr, ySizeAr, lastAddr; 14 | namesArray = GetArrayId("myNAMES"); 15 | DeleteArray(namesArray); 16 | namesArray = CreateArray("myNAMES"); 17 | xSizeAr = GetArrayId("myXSIZE"); 18 | DeleteArray(xSizeAr); 19 | xSizeAr = CreateArray("myXSIZE"); 20 | ySizeAr = GetArrayId("myYSIZE"); 21 | DeleteArray(ySizeAr); 22 | ySizeAr = CreateArray("myYSIZE"); 23 | 24 | // walk the ROM and list the names and addresses 25 | currAddr = 0x00000000; 26 | lastAddr = SegEnd(currAddr); 27 | while (currAddr < lastAddr) { 28 | currName = Name(currAddr); 29 | if (currName != "") { 30 | if ( 31 | strstr(currName, "dword_") == -1 && 32 | strstr(currName, "off_") == -1 && 33 | strstr(currName, "byte_") == -1 && 34 | strstr(currName, "word_") == -1 && 35 | strstr(currName, "flt_") == -1 && 36 | strstr(currName, "loc_") == -1 && 37 | strstr(currName, "unk_") == -1 && 38 | strstr(currName, "sub_") == -1 && 39 | strstr(currName, "_Axis") == -1) { 40 | if (strstr(currName, "Table_") == 0) { 41 | // 1 axis table with no data conversion values, undefined data type 42 | // Table Definition is 12 bytes long 43 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 44 | (Word(currAddr+2) == 0x0000)) { 45 | currAddr = Get2dTable(currAddr, 11); 46 | } 47 | // 1 axis table with data conversion values and defined data type 48 | // Table Definition is 20 bytes long 49 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 50 | ((Word(currAddr+2) == 0x0400) || (Word(currAddr+2) == 0x0800)) && 51 | !((Word(currAddr+14) == 0x0400) || (Word(currAddr+14) == 0x0800))) { 52 | currAddr = Get2dTable(currAddr, 19); 53 | } 54 | // 1 axis table with no data conversion values and defined data type 55 | // Table Definition is 12 bytes long 56 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 57 | ((Word(currAddr+2) == 0x0400) || (Word(currAddr+2) == 0x0800)) && 58 | ((Word(currAddr+14) == 0x0400) || (Word(currAddr+14) == 0x0800))) { 59 | currAddr = Get2dTable(currAddr, 11); 60 | } 61 | // 2 axis table with no data conversion values, undefined data type 62 | // Table Definition is 20 bytes long 63 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 64 | ((Word(currAddr+2) > 0) && (Word(currAddr+2) < 256)) && 65 | (Dword(currAddr+16) == 0x00000000)) { 66 | currAddr = Get3dTable(currAddr, 19); 67 | } 68 | // 2 axis table with data conversion values and defined data type 69 | // Table Definition is 28 bytes long 70 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 71 | ((Word(currAddr+2) > 0) && (Word(currAddr+2) < 256)) && 72 | ((Dword(currAddr+16) == 0x04000000) || (Dword(currAddr+16) == 0x08000000))) { 73 | currAddr = Get3dTable(currAddr, 27); 74 | } 75 | } 76 | else { 77 | Message(currName + " " + form("%08s",ltoa(currAddr, 16)) + "\n"); 78 | SetHashLong(namesArray, currName, currAddr); 79 | } 80 | } 81 | } 82 | currAddr = currAddr + 1; 83 | } 84 | fout = fopen("addresses.txt", "w"); 85 | textOut = GetFirstHashKey(namesArray); 86 | while (textOut != GetLastHashKey(namesArray)) { 87 | writestr(fout, textOut + " " + form("%08s",ltoa(GetHashLong(namesArray, textOut), 16))); 88 | xSize = GetHashLong(xSizeAr, textOut); 89 | if (xSize != 0) { 90 | writestr(fout, " " + form("%d",ltoa(xSize, 10))); 91 | } 92 | ySize = GetHashLong(ySizeAr, textOut); 93 | if (ySize != 0) { 94 | writestr(fout, " " + form("%d",ltoa(ySize, 10))); 95 | } 96 | writestr(fout, "\n"); 97 | textOut = GetNextHashKey(namesArray, textOut); 98 | } 99 | fclose(fout); 100 | DeleteArray(namesArray); 101 | DeleteArray(xSizeAr); 102 | DeleteArray(ySizeAr); 103 | } 104 | 105 | static Get2dTable(currAddr, defSize) { 106 | auto arrayId, axisAddr, axisName, dataAddr, dataLength, dataName, sizeId; 107 | arrayId = GetArrayId("myNAMES"); 108 | sizeId = GetArrayId("myYSIZE"); 109 | dataLength = Word(currAddr); 110 | axisAddr = Dword(currAddr+4); 111 | dataAddr = Dword(currAddr+8); 112 | dataName = substr(Name(currAddr),6,-1); 113 | axisName = dataName + "_Y_Axis"; 114 | MakeNameEx(axisAddr, axisName, SN_CHECK); 115 | MakeNameEx(dataAddr, dataName, SN_CHECK); 116 | Message(dataName + " " + form("%08s",ltoa(dataAddr, 16)) + " " + form("%d", dataLength,10) + "\n"); 117 | SetHashLong(arrayId, dataName, dataAddr); 118 | SetHashLong(sizeId, dataName, dataLength); 119 | Message(axisName + " " + form("%08s",ltoa(axisAddr, 16)) + "\n"); 120 | SetHashLong(arrayId, axisName, axisAddr); 121 | currAddr = currAddr + defSize; 122 | return currAddr; 123 | } 124 | 125 | static Get3dTable(currAddr, defSize) { 126 | auto arrayId, axisXAddr, axisXName, axisYAddr, axisYName, dataYLength, dataXLength, dataAddr, dataName, xSizeId, ySizeId; 127 | arrayId = GetArrayId("myNAMES"); 128 | xSizeId = GetArrayId("myXSIZE"); 129 | ySizeId = GetArrayId("myYSIZE"); 130 | dataXLength = Word(currAddr); 131 | dataYLength = Word(currAddr+2); 132 | axisXAddr = Dword(currAddr+4); 133 | axisYAddr = Dword(currAddr+8); 134 | dataAddr = Dword(currAddr+12); 135 | dataName = substr(Name(currAddr),6,-1); 136 | axisXName = dataName + "_X_Axis"; 137 | axisYName = dataName + "_Y_Axis"; 138 | MakeNameEx(axisXAddr, axisXName, SN_CHECK); 139 | MakeNameEx(axisYAddr, axisYName, SN_CHECK); 140 | MakeNameEx(dataAddr, dataName, SN_CHECK); 141 | Message(dataName + " " + form("%08s",ltoa(dataAddr, 16)) + " " + form("%d", dataXLength,10) + " " + form("%d", dataYLength,10) + "\n"); 142 | SetHashLong(arrayId, dataName, dataAddr); 143 | SetHashLong(xSizeId, dataName, dataXLength); 144 | SetHashLong(ySizeId, dataName, dataYLength); 145 | Message(axisXName + " " + form("%08s",ltoa(axisXAddr, 16)) + "\n"); 146 | SetHashLong(arrayId, axisXName, axisXAddr); 147 | Message(axisYName + " " + form("%08s",ltoa(axisYAddr, 16)) + "\n"); 148 | SetHashLong(arrayId, axisYName, axisYAddr); 149 | currAddr = currAddr + defSize; 150 | return currAddr; 151 | } 152 | -------------------------------------------------------------------------------- /src/IDA/Format16bitTABLE.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 1 9 | * Date : 2013-12-14 10 | * 11 | * This script is used to format tables in a 16bit ROM. 12 | * 13 | Layout of a 2D table: 14 | --------------------- 15 | axis values 16 | axis length - 1 (i.e.: 0 based) 17 | type (this is the byte refereneced in subroutines, i.e.: Table_) 18 | data values 19 | When reading the map: 20 | idxY = table map type byte (function assumes yk=2). 21 | regB (byte) or regD (word) = axis (depending on data type). 22 | 23 | 24 | Layout of a 3D table: 25 | --------------------- 26 | y-axis values 27 | y-axis length - 1 (i.e.: 0 based) 28 | x-axis values 29 | x-axis length - 1 (i.e.: 0 based) 30 | type (this is the byte refereneced in subroutines, i.e.: Table_) 31 | data values 32 | When reading the map: 33 | idxY = table map type byte 16-bit offset 34 | regB (byte) or regD (word) = x-axis (depending on data type) 35 | regE = y-axis 36 | 37 | 38 | Layout of a 2D series: 39 | ---------------------- 40 | axis step 41 | axis start 42 | number of data items - 1 (i.e.: 0 based) 43 | type (this is the byte refereneced in subroutines, i.e.: Table_) 44 | data values 45 | 46 | 47 | Layout of a 3D series: 48 | ---------------------- 49 | y-axis step 50 | y-axis start 51 | x-axis series length - 1 (i.e.: 0 based) 52 | x-axis step 53 | x-axis start 54 | x-axis series length - 1 (i.e.: 0 based) 55 | type (this is the byte refereneced in subroutines, i.e.: Table_) 56 | data values 57 | 58 | Type byte - bit definition: 59 | 7--4-2-0 60 | 00000000 61 | ||||||||- bit 0: 0 = byte, 1 = word (X or single axis data type) 62 | |||||||- 63 | ||||||- bit 2: 0 = byte, 1 = word (Y or dual axis data type) 64 | |||||- 65 | ||||- bit 4: 0 = byte, 1 = word (data values) 66 | |||- 67 | ||- 68 | |- bit7: 0 = Table, 1 = Series 69 | 70 | */ 71 | 72 | #include 73 | 74 | static main() { 75 | auto ync, axisInfo, dim, typeByte, fAxisType, sAxisType, dataType, data, storageType, xStart, xStep, yStart, yStep; 76 | ync = AskYN(0, "Format as 3D table?"); // -1:cancel,0-no,1-ok 77 | if (ync == -1) { return 0;} 78 | 79 | axisInfo = GetArrayId("AXIS_INFO"); 80 | DeleteArray(axisInfo); 81 | axisInfo = CreateArray("AXIS_INFO"); 82 | MakeByte(here); 83 | typeByte = Byte(here); 84 | 85 | // Determine data type of first axis 86 | if (typeByte & 0x01) 87 | { 88 | fAxisType = 2; 89 | } 90 | else 91 | { 92 | fAxisType = 1; 93 | } 94 | 95 | // Determine data type of second axis 96 | if (typeByte & 0x04) 97 | { 98 | sAxisType = 2; 99 | } 100 | else 101 | { 102 | sAxisType = 1; 103 | } 104 | 105 | // Determine data type of data elements 106 | if (typeByte & 0x10) 107 | { 108 | dataType = 2; 109 | } 110 | else 111 | { 112 | dataType = 1; 113 | } 114 | 115 | // Determine if this is a Table or Series 116 | if (typeByte & 0x80) 117 | { 118 | storageType = 1; 119 | } 120 | else 121 | { 122 | storageType = 0; 123 | } 124 | 125 | if (storageType == 0) 126 | { 127 | Message(form("Table at ROM:0x%X", here)); 128 | if (GetTrueName(here) == "" || 129 | GetTrueName(here) == form("byte_%X", here)) 130 | { 131 | MakeNameEx(here, form("Table_%X", here), SN_NOWARN); 132 | } 133 | SetArrayLong(axisInfo, 0, 0); 134 | SetArrayLong(axisInfo, 2, 1); 135 | FormatAxis(here, fAxisType, sAxisType, 1); 136 | if (ync == 1 ) 137 | { 138 | FormatAxis(here, fAxisType, sAxisType, 2); 139 | } 140 | FormatData(here, dataType); 141 | } 142 | else if (storageType == 1) 143 | { 144 | Message(form("Series at ROM:0x%X", here)); 145 | if (GetTrueName(here) == "" || 146 | GetTrueName(here) == form("byte_%X", here)) 147 | { 148 | MakeNameEx(here, form("Series_%X", here), SN_NOWARN); 149 | } 150 | SetArrayLong(axisInfo, 0, 1); 151 | SetArrayLong(axisInfo, 2, 1); 152 | FormatSeries(here, fAxisType, sAxisType, 1); 153 | if (ync == 1 ) 154 | { 155 | FormatSeries(here, fAxisType, sAxisType, 2); 156 | } 157 | FormatData(here, dataType); 158 | } 159 | DeleteArray(axisInfo); 160 | } 161 | 162 | static FormatAxis(currAddr, fAxisType, sAxisType, axisCnt) 163 | { 164 | auto axisInfo, label, axisSize, startAddr, endAddr, axisType, type; 165 | axisInfo = GetArrayId("AXIS_INFO"); 166 | label = form("Table_%X_axis%d", currAddr, axisCnt); 167 | if (axisCnt == 1) 168 | { 169 | axisSize = Byte(currAddr - 1) + 1; 170 | MakeByte(currAddr - 1); 171 | startAddr = currAddr - 1 - (fAxisType * axisSize); 172 | endAddr = startAddr + (fAxisType * axisSize); 173 | axisType = fAxisType; 174 | SetArrayLong(axisInfo, 1, axisSize); 175 | } 176 | if (axisCnt == 2) 177 | { 178 | axisSize = Byte(currAddr - 1) + 1; 179 | currAddr = currAddr - 1 - (fAxisType * axisSize); 180 | axisSize = Byte(currAddr - 1) + 1; 181 | MakeByte(currAddr - 1); 182 | startAddr = currAddr - 1 - (sAxisType * axisSize); 183 | endAddr = startAddr + (sAxisType * axisSize); 184 | axisType = sAxisType; 185 | SetArrayLong(axisInfo, 2, axisSize); 186 | } 187 | 188 | if (axisType == 1) 189 | { 190 | type = "uint8"; 191 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + axisType) 192 | { 193 | MakeUnknown(currAddr, axisType, DOUNK_SIMPLE); 194 | MakeByte(currAddr); 195 | } 196 | } 197 | if (axisType == 2) 198 | { 199 | type = "uint16"; 200 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + axisType) 201 | { 202 | MakeUnknown(currAddr, axisType, DOUNK_SIMPLE); 203 | MakeWord(currAddr); 204 | } 205 | } 206 | if (GetTrueName(startAddr) == "") 207 | { 208 | MakeNameEx(startAddr, label, SN_NOWARN); 209 | } 210 | Message(form(", axis-%d %s, size: %d at ROM:0x%X", axisCnt, type, axisSize, startAddr)); 211 | } 212 | 213 | static FormatSeries(currAddr, fAxisType, sAxisType, axisCnt) 214 | { 215 | auto axisInfo, label, axisSize, startAddr, endAddr, axisType, type; 216 | axisInfo = GetArrayId("AXIS_INFO"); 217 | label = form("Series_%X_axis%d_step", currAddr, axisCnt); 218 | if (axisCnt == 1) 219 | { 220 | axisSize = Byte(currAddr - 1) + 1; 221 | MakeByte(currAddr - 1); 222 | startAddr = currAddr - 1 - (fAxisType * 2); 223 | endAddr = startAddr + (fAxisType * 2); 224 | axisType = fAxisType; 225 | SetArrayLong(axisInfo, 1, axisSize); 226 | } 227 | if (axisCnt == 2) 228 | { 229 | axisSize = Byte(currAddr - 1) + 1; 230 | currAddr = currAddr - 1 - (fAxisType * 2); 231 | axisSize = Byte(currAddr - 1) + 1; 232 | MakeByte(currAddr - 1); 233 | startAddr = currAddr - 1 - (sAxisType * 2); 234 | endAddr = startAddr + (sAxisType * 2); 235 | axisType = sAxisType; 236 | SetArrayLong(axisInfo, 2, axisSize); 237 | } 238 | 239 | if (axisType == 1) 240 | { 241 | type = "uint8"; 242 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + axisType) 243 | { 244 | MakeUnknown(currAddr, axisType, DOUNK_SIMPLE); 245 | MakeByte(currAddr); 246 | } 247 | } 248 | if (axisType == 2) 249 | { 250 | type = "uint16"; 251 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + axisType) 252 | { 253 | MakeUnknown(currAddr, axisType, DOUNK_SIMPLE); 254 | MakeWord(currAddr); 255 | } 256 | } 257 | if (GetTrueName(startAddr) == "") 258 | { 259 | MakeNameEx(startAddr, label, SN_NOWARN); 260 | } 261 | Message(form(", axis-%d %s, size: %d at ROM:0x%X", axisCnt, type, axisSize, startAddr)); 262 | } 263 | 264 | static FormatData(currAddr, dataType) 265 | { 266 | auto axisInfo, format, label, fAxisSize, sAxisSize, startAddr, endAddr, type; 267 | axisInfo = GetArrayId("AXIS_INFO"); 268 | label = "Table"; 269 | format = GetArrayElement(AR_LONG, axisInfo, 0); 270 | if (format == 1) 271 | { 272 | label = "Series"; 273 | } 274 | label = form("%s_%X_data", label, currAddr); 275 | fAxisSize = GetArrayElement(AR_LONG, axisInfo, 1); 276 | sAxisSize = GetArrayElement(AR_LONG, axisInfo, 2); 277 | startAddr = currAddr + 1; 278 | endAddr = startAddr + (fAxisSize * sAxisSize * dataType); 279 | 280 | if (dataType == 1) 281 | { 282 | type = "uint8"; 283 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + dataType) 284 | { 285 | MakeUnknown(currAddr, dataType, DOUNK_SIMPLE); 286 | MakeByte(currAddr); 287 | } 288 | } 289 | if (dataType == 2) 290 | { 291 | type = "uint16"; 292 | for (currAddr = startAddr; currAddr < endAddr; currAddr = currAddr + dataType) 293 | { 294 | MakeUnknown(currAddr, dataType, DOUNK_SIMPLE); 295 | MakeWord(currAddr); 296 | } 297 | } 298 | SetArrayFormat(startAddr, 0, fAxisSize, 0); 299 | if (sAxisSize > 1) 300 | { 301 | MakeArray(startAddr, (fAxisSize * sAxisSize * dataType)); 302 | } 303 | if (GetTrueName(startAddr) == "") 304 | { 305 | MakeNameEx(startAddr, label, SN_NOWARN); 306 | } 307 | Message(form(", data %s at ROM:0x%X\n", type, startAddr)); 308 | } -------------------------------------------------------------------------------- /src/Definitions/update_logger.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright (C) 2014 Dale C. Schultz 4 | # RomRaider member ID: dschultz 5 | # 6 | # You are free to use this source for any purpose, but please keep 7 | # notice of where it came from! 8 | # 9 | # 10 | # Purpose 11 | # Reads from IDC dump file to update MySQL Logger definitions tables. 12 | # Version: 8 13 | # Update: Feb. 06/2014 14 | #------------------------------------------------------------------------------------------ 15 | 16 | use File::Basename; 17 | unless ($ARGV[0]) 18 | { 19 | print "Input file missing...\n"; 20 | print "Usage: logger_update.pl \n"; 21 | exit 1; 22 | } 23 | $param_file = $ARGV[0]; 24 | if ($ARGV[1] eq "-commit") {$commit = 1}; 25 | 26 | # get the list of stat files 27 | open (INPUT, "$param_file") || die "Could not open file $param_file : $!\n"; 28 | $param_file = basename($param_file); 29 | $param_file =~ s/\.txt//; 30 | $ecuid = uc($param_file); 31 | use DBI; 32 | 33 | # create a handle and connect to the statistics database 34 | $dbh = DBI->connect ( 35 | 'DBI:mysql:database=definitions;host=localhost', 36 | 'xxxx','xxxx',{AutoCommit=>1, RaiseError=>0, PrintError=>0}) 37 | or die "$0: Couldn't connect to database"; 38 | 39 | &get_db_version; 40 | &get_ecuparam_id; 41 | $add_ecuid = 0; 42 | $add_addr = 0; 43 | $change_addr = 0; 44 | $add_entry = 0; 45 | 46 | print "Current Database Version: $db_id ($db_version)\n"; 47 | #check if we have the ECU ID already 48 | $ecuid_serial = get_ecu_id($ecuid); 49 | if ($ecuid_serial) 50 | { 51 | print "ECU ID $ecuid ($ecuid_serial) exists.\n"; 52 | $update = "Updated ECU ID: $ecuid extended parameters \n"; 53 | } 54 | else 55 | { 56 | print "ECU ID $ecuid is not defined.\n"; 57 | if ($commit) 58 | { 59 | $ecuid_serial = new_ecuid_entry($ecuid); 60 | $update = "Added ECU ID: $ecuid to extended parameters\n"; 61 | print "+ COMMIT: ECU ID $ecuid ($ecuid_serial) added.\n\n"; 62 | } 63 | else 64 | { 65 | print "+ TEST: ECU ID $ecuid will be added.\n\n"; 66 | } 67 | $add_ecuid++; 68 | } 69 | $count = 0; 70 | $count1 = 0; 71 | foreach $line () 72 | { 73 | $bit = ''; 74 | $count++; 75 | if ($line =~ /^\#/) 76 | { 77 | $count--; 78 | next; 79 | } 80 | @values = split(/\s+/, $line); # line format expected: Extended Paramter ID RAM Address [ bit] 81 | if ($#values > 2) # line contains two or three values 82 | { 83 | print "WARNING: Line $count invalid number of parameters, line skipped.\n"; 84 | $warn++; 85 | next; 86 | } 87 | @extname = split(/_/, $values[0]); # split first argument to extract the ID from the last element 88 | $extid = $extname[$#extname]; # get last element 89 | $extid =~ s/^E//; # clean last element up so we have digits only 90 | if (length($values[1]) > 6) 91 | { 92 | $values[1] =~ s/.*(\w{6,6}$)/\1/; # make the address six bytes long 93 | } 94 | $addr = $values[1]; 95 | if ($#values == 2) # line contains three values, get bit 96 | { 97 | $bit = $values[2]; 98 | } 99 | # check if we have the Extended Parameter id already 100 | if (!$ecuparam_id{$extid}) 101 | { 102 | print "WARNING: Extended parameter $extid is not a known ID.\n"; 103 | $warn++; 104 | next; 105 | } 106 | 107 | # default length of data expected for this Extended Parameter id 108 | $deft_len = $ecuparam_len{$ecuparam_id{$extid}}; 109 | 110 | # check that the bit value is appropriate for the length 111 | $address_id = ''; 112 | if (($deft_len == 1 && $bit >= 0 && $bit <= 7 ) || 113 | ($deft_len == 2 && $bit >= 0 && $bit <= 15) || 114 | ($deft_len == 4 && $bit >= 0 && $bit <= 31)) 115 | { 116 | $address_id = get_address_id($addr, $deft_len, $bit); 117 | } 118 | else 119 | { 120 | print "WARNING: Incompatible bit value passed for parameter address length, length:$deft_len, bit:$bit\n"; 121 | $warn++; 122 | } 123 | 124 | # check if we have the RAM address/length/bit id already 125 | $address_id = get_address_id($addr, $deft_len, $bit); 126 | if ($address_id) 127 | { 128 | print "Address $addr/$deft_len/$bit ($address_id) exists.\n\n"; 129 | } 130 | else 131 | { 132 | print "Address $addr/$deft_len/$bit is not defined.\n"; 133 | if ($commit) 134 | { 135 | $address_id = new_addr_entry($addr, $deft_len, $bit); 136 | print "+ COMMIT: Address $addr/$deft_len/$bit ($address_id) added.\n\n"; 137 | } 138 | else 139 | { 140 | print "+ TEST: Address $addr/$deft_len/$bit will be added.\n\n"; 141 | } 142 | $add_addr++; 143 | } 144 | # check to see if the parameter entry exists and if the address_id matches or not. 145 | # If they don't match then UPDATE rather than INSERT the entry 146 | ($param_rel_id, $address_serial) = get_relation_id($ecuid_serial, $ecuparam_id{$extid}); 147 | if ($param_rel_id) 148 | { 149 | if ($address_serial == $address_id) 150 | { 151 | print "E${extid} - Parameter combination Address entry matches ($address_serial), no change.\n\n"; 152 | } 153 | else 154 | { 155 | if ($commit) 156 | { 157 | update_unique_entry($param_rel_id, $address_id); 158 | print "~ COMMIT: E${extid} - Parameter combination Address entry ($address_serial) "; 159 | print "changed to $address_id.\n\n"; 160 | $update = $update."Changed address/length/bit entry for ECU ID $ecuid for extended parameter E${extid}\n"; 161 | } 162 | else 163 | { 164 | print "* TEST: E${extid} - Parameter combination Address entry ($address_serial) "; 165 | if ($address_id) 166 | { 167 | print "will change to $address_id.\n\n"; 168 | } 169 | else 170 | { 171 | print "will be updated.\n\n"; 172 | } 173 | } 174 | $change_addr++; 175 | } 176 | } 177 | else 178 | { 179 | print "E${extid} - Parameter combination is not defined.\n"; 180 | if ($commit) 181 | { 182 | $param_rel_id = new_unique_entry($ecuid_serial, $ecuparam_id{$extid}, $address_id); 183 | print "+ COMMIT: E${extid} - unique entry ($param_rel_id) added.\n\n"; 184 | } 185 | else 186 | { 187 | print "+ TEST: E${extid} - will be added.\n\n"; 188 | } 189 | $add_entry++; 190 | } 191 | $count1++; 192 | } 193 | print "$count1 of $count lines evaluated.\n"; 194 | if ($warn) 195 | { 196 | print "$warn WARNING(S)\n"; 197 | } 198 | if ($commit) 199 | { 200 | &update_version; 201 | &get_db_version; 202 | print "COMMIT: New Database version is $db_id ($db_version)\n"; 203 | print "Changes:\n$update\n"; 204 | } 205 | elsif ($warn) 206 | { 207 | print "!--> Correct input file and test again <--!\n"; 208 | } 209 | else 210 | { 211 | print "TEST complete, run with commit to add entries to database.\n"; 212 | } 213 | print "Summary:\n"; 214 | print "\tECU ID added: $add_ecuid\n" if ($add_ecuid); 215 | print "\tAddresses added: $add_addr\n" if ($add_addr); 216 | print "\tParameter Combo Addresses changed: $change_addr\n" if ($change_addr); 217 | print "\tEntries added: $add_entry\n" if ($add_entry); 218 | print "\tNo changes\n" if (!$add_ecuid && !$add_addr && !$change_addr && !$add_entry); 219 | 220 | THE_END: 221 | $dbh->do("FLUSH TABLES"); 222 | $dbh->disconnect; 223 | exit; 224 | 225 | # --- SUBROIUTINES --- 226 | 227 | sub get_db_version { 228 | # get database version 229 | my $id, $version; 230 | 231 | my $sql = qq(SELECT id, version FROM version ORDER BY id DESC LIMIT 1); 232 | my $sth = $dbh->prepare($sql); 233 | $sth->execute; 234 | $sth->bind_columns(\$id, \$version); 235 | while ($sth->fetch) { 236 | $db_id=$id; 237 | $db_version=$version; 238 | } 239 | } 240 | 241 | sub get_ecuparam_id { 242 | # create an array for all of the extended parameters 243 | my $serial, $id, $length; 244 | 245 | my $sql = qq(SELECT serial, id, length FROM ecuparam); 246 | my $sth = $dbh->prepare($sql); 247 | $sth->execute; 248 | $sth->bind_columns(\$serial, \$id, \$length); 249 | while ($sth->fetch) { 250 | $ecuparam_id{$id}=$serial; 251 | $ecuparam_len{$serial}=$length; 252 | } 253 | } 254 | 255 | sub get_address_id { 256 | # return the id of the passed address/length/bit 257 | my $serial; 258 | my $address = shift; 259 | my $length = shift; 260 | my $bit = shift; 261 | 262 | if ($bit eq '') 263 | { 264 | $bit = " IS NULL"; 265 | } 266 | elsif ($bit >= 0 && $bit <= 31) 267 | { 268 | $bit = "='" . $bit . "'"; 269 | } 270 | else 271 | { 272 | report_error("Invalid address bit value passed, value:$bit"); 273 | } 274 | my $sql = qq[SELECT serial FROM address where address='$address' and length='$length' and bit$bit]; 275 | my $sth = $dbh->prepare($sql); 276 | $sth->execute; 277 | $sth->bind_columns(\$serial); 278 | my $count = 0; 279 | while ($sth->fetch) { 280 | $count++; 281 | } 282 | report_error("More than one address/length/bit combo found in database") if ($count > 1); 283 | return $serial; 284 | } 285 | 286 | sub get_ecu_id { 287 | # get serial number for the ECU ID 288 | my $ecuid = shift; 289 | my $serial; 290 | 291 | my $sql = qq(SELECT serial FROM ecuid where ecuid='$ecuid'); 292 | my $sth = $dbh->prepare($sql); 293 | $sth->execute; 294 | $sth->bind_columns(\$serial); 295 | my $count = 0; 296 | while ($sth->fetch) { 297 | $count++; 298 | } 299 | report_error("More than one ECU ID found in database") if ($count > 1); 300 | return $serial; 301 | } 302 | 303 | sub get_relation_id { 304 | # get the serial number for the ECU ID, Extended Parameter, Address combo 305 | my $ecuid_id = shift; 306 | my $param_id = shift; 307 | my $serial, $address_serial; 308 | 309 | my $sql = qq[SELECT serial,addressid from ecuparam_rel 310 | WHERE ecuparamid='$param_id' 311 | AND ecuidid='$ecuid_id']; 312 | my $sth = $dbh->prepare($sql); 313 | $sth->execute; 314 | $sth->bind_columns(\$serial, \$address_serial); 315 | my $count = 0; 316 | while ($sth->fetch) { 317 | $count++; 318 | } 319 | report_error("More than one ECU ID/Parameter/Address combo found in database") if ($count > 1); 320 | return ($serial, $address_serial); 321 | } 322 | 323 | sub update_unique_entry { 324 | # Update Address ID entry for an exisitng parameter 325 | my $serial = shift; 326 | my $addr_id = shift; 327 | 328 | my $sql = qq[UPDATE ecuparam_rel SET addressid = '$addr_id' WHERE serial = '$serial']; 329 | my $sth = $dbh->prepare($sql); 330 | $sth->execute; 331 | } 332 | 333 | sub update_version { 334 | # update version of database 335 | # vserion = YYYYMMDD_hhmmss 336 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 337 | $year += 1900; 338 | $version = sprintf("%04d%02d%02d_%02d%02d%02d", $year, ++$mon, $mday, $hour, $min, $sec); 339 | $update =~ s/\n$//; 340 | my $sql_version_in = qq[INSERT INTO `version` (`version`, `update`) VALUES ('$version', '$update')]; 341 | my $sth = $dbh->prepare($sql_version_in); 342 | $sth->execute; 343 | } 344 | 345 | sub new_ecuid_entry { 346 | # create a new entry in the database for the current ECU ID as we have 347 | # not seen it before. 348 | 349 | my $ecuid = shift; # ECU ID pasted to subroutine 350 | 351 | my $sql_ecuid_in = qq[INSERT INTO ecuid (ecuid) VALUES ('$ecuid')]; 352 | my $sth = $dbh->prepare($sql_ecuid_in); 353 | $sth->execute; 354 | return $sth->{mysql_insertid}; 355 | } 356 | 357 | sub new_addr_entry { 358 | # create a new entry in the database for the current address as we have 359 | # not seen it before. 360 | 361 | my $address = shift; # RAM address pasted to subroutine 362 | my $addr_len = shift; # length of data to retrieve at address pasted to subroutine 363 | my $addr_bit = shift; # bit to isolate at address pasted to subroutine 364 | 365 | if ($addr_bit eq '') 366 | { 367 | $addr_bit = "NULL"; 368 | } 369 | elsif ($addr_bit >= 0 && $addr_bit <= 31) 370 | { 371 | $addr_bit = "'$addr_bit'"; 372 | } 373 | else 374 | { 375 | report_error("Invalid address bit value passed, value:$addr_bit"); 376 | } 377 | 378 | my $sql_addr_in = qq[INSERT INTO address (address,length,bit) VALUES ('$address','$addr_len',$addr_bit)]; 379 | my $sth = $dbh->prepare($sql_addr_in); 380 | $sth->execute; 381 | return $sth->{mysql_insertid}; 382 | } 383 | 384 | sub new_unique_entry { 385 | # create a new entry in the database for the current Extended Parameter as we have 386 | # not seen it before. 387 | 388 | my $ecuid_id = shift; # ECU ID pasted to subroutine 389 | my $extparamid_id = shift; # Extended parameter pasted to subroutine 390 | my $address_id = shift; # RAM address pasted to subroutine 391 | my $serial = shift; 392 | 393 | # now we can insert the new Extended Parameter relation info into the table 394 | my $sql_ecuparamrel_in = qq[INSERT INTO 395 | ecuparam_rel (ecuparamid, ecuidid, addressid) 396 | VALUES ('$extparamid_id', '$ecuid_id', '$address_id')]; 397 | my $sth = $dbh->prepare($sql_ecuparamrel_in); 398 | $sth->execute; 399 | return $sth->{mysql_insertid}; 400 | } 401 | 402 | sub report_error { 403 | my $message = shift; 404 | print "ERROR: $message\n"; 405 | $dbh->do("FLUSH TABLES"); 406 | $dbh->disconnect; 407 | exit; 408 | } 409 | -------------------------------------------------------------------------------- /src/MakeXmlDef/MakeXmlDef/MakeXmlDef.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this source for any purpose, but please keep 6 | * notice of where it came from! 7 | */ 8 | using System; 9 | using System.IO; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using System.Linq; 13 | using System.Text; 14 | using System.Xml; 15 | using System.Xml.XPath; 16 | using System.Text.RegularExpressions; 17 | 18 | namespace MakeXmlDef 19 | { 20 | class MakeXmlDef 21 | { 22 | private static Hashtable addrTable = new Hashtable(); 23 | private static Hashtable sizexTable = new Hashtable(); 24 | private static Hashtable sizeyTable = new Hashtable(); 25 | private static HashSet names = new HashSet(); 26 | 27 | static void Main(string[] args) 28 | { 29 | if (args.Length == 0) 30 | { 31 | Usage(); 32 | return; 33 | } 34 | 35 | // read the address file into a hash table for key lookups on table/axis name 36 | string line; 37 | try 38 | { 39 | StreamReader file = new StreamReader(args[1]); 40 | string pattern = @"\s+"; 41 | while ((line = file.ReadLine()) != null) 42 | { 43 | string[] result = Regex.Split(line, pattern); 44 | if (result.Length == 4 && !addrTable.Contains(result[0])) // 3D Table with X & Y size 45 | { 46 | addrTable.Add(result[0], result[1]); 47 | sizexTable.Add(result[0], result[2]); 48 | sizeyTable.Add(result[0], result[3]); 49 | } 50 | if (result.Length == 3 && !addrTable.Contains(result[0])) // 2D Table with Y size 51 | { 52 | addrTable.Add(result[0], result[1]); 53 | sizeyTable.Add(result[0], result[2]); 54 | } 55 | if (result.Length == 2 && !addrTable.Contains(result[0])) // 1D Table no size 56 | { 57 | addrTable.Add(result[0], result[1]); 58 | } 59 | } 60 | file.Close(); 61 | } 62 | catch (Exception e) 63 | { 64 | Console.WriteLine("Could not read address file. " + e); 65 | return; 66 | } 67 | if (addrTable.Count == 0) 68 | { 69 | Console.WriteLine("The address file " + args[1] + "contained no valid entries."); 70 | return; 71 | } 72 | 73 | XmlDocument doc = new XmlDocument(); 74 | try 75 | { 76 | doc.Load(args[0]); 77 | } 78 | catch (Exception e) 79 | { 80 | Console.WriteLine("Could not read template file. " + e); 81 | return; 82 | } 83 | 84 | string path = "/roms/rom/table"; 85 | XmlNodeList nodeList = doc.SelectNodes(path); // all table Nodes of the template file 86 | Console.WriteLine("Table size change summary (changes over base):"); 87 | 88 | foreach (XmlNode node in nodeList) 89 | { 90 | if ((node.NodeType == XmlNodeType.Element) && node.Name == "table") 91 | { 92 | XmlAttributeCollection attrList = node.Attributes; // attributes of current table element 93 | string name = attrList["name"].Value; // table name which will be "cleaned" to match IDA names 94 | string rawName = name; // table name from table element 95 | name = ConvertName(name); // convert the name to match IDA names 96 | string storageAddress = "undef"; 97 | if (addrTable.Contains(name) && attrList["storageaddress"] != null) 98 | { 99 | storageAddress = addrTable[name].ToString(); 100 | attrList["storageaddress"].Value = Convert.ToInt32(storageAddress , 16).ToString("X"); 101 | //Console.WriteLine(name + " = " + attrList["storageaddress"].Value); 102 | 103 | string path1 = "/roms/rom/table[@name='" + rawName + "']"; 104 | XmlNodeList tableList = doc.SelectNodes(path1); // all table nodes of template file that match this rawName 105 | //Console.WriteLine("Search for: " + path1 + " found: " + tableList.Count); 106 | foreach (XmlNode tableNode in tableList) 107 | { 108 | if ((tableNode.NodeType == XmlNodeType.Element) && tableNode.Name == "table") 109 | { 110 | string status = "Updated"; 111 | XmlAttributeCollection tableAttrList = tableNode.Attributes; 112 | if (tableAttrList["storageaddress"] == null && // this is the entry in the 32BITBASE rom section 113 | tableAttrList["sizex"] != null && 114 | sizexTable.Contains(name) 115 | ) 116 | { 117 | // Is the default X size different than the IDA table X size 118 | if (tableAttrList["sizex"].Value != sizexTable[name].ToString()) // yes 119 | { 120 | // Is there an X size attribute in our template 121 | if (attrList["sizex"] == null) // no 122 | { 123 | XmlAttribute newAttr = doc.CreateAttribute("sizex"); 124 | newAttr.Value = sizexTable[name].ToString(); 125 | node.Attributes.Append(newAttr); 126 | status = "Added "; 127 | } 128 | else // yes 129 | { 130 | attrList["sizex"].Value = sizexTable[name].ToString(); 131 | } 132 | Console.WriteLine( 133 | string.Format("{3} X size: {0,2} -> {1,2} Table Name: '{2}'", tableAttrList["sizex"].Value, sizexTable[name].ToString(), tableAttrList["name"].Value, status) 134 | ); 135 | } 136 | else // no 137 | { 138 | // Is there an X size attribute in our template 139 | if (attrList["sizex"] != null) // yes 140 | { 141 | // remove the unneeded attribute 142 | status = "Removed"; 143 | Console.WriteLine( 144 | string.Format("{2} X size: {1,2} from Table Name: '{0}'", tableAttrList["name"].Value, attrList["sizex"].Value, status) 145 | ); 146 | node.Attributes.Remove(attrList["sizex"]); 147 | } 148 | } 149 | } 150 | // Is the default Y size different than the IDA table Y size 151 | if (tableAttrList["storageaddress"] == null && 152 | tableAttrList["sizey"] != null && 153 | sizeyTable.Contains(name) 154 | ) 155 | { 156 | if (tableAttrList["sizey"].Value != sizeyTable[name].ToString()) 157 | { 158 | if (attrList["sizey"] == null) 159 | { 160 | XmlAttribute newAttr = doc.CreateAttribute("sizey"); 161 | newAttr.Value = sizeyTable[name].ToString(); 162 | node.Attributes.Append(newAttr); 163 | status = "Added "; 164 | } 165 | else 166 | { 167 | attrList["sizey"].Value = sizeyTable[name].ToString(); 168 | } 169 | Console.WriteLine( 170 | string.Format("{3} Y size: {0,2} -> {1,2} Table Name: '{2}'", tableAttrList["sizey"].Value, sizeyTable[name].ToString(), tableAttrList["name"].Value, status) 171 | ); 172 | } 173 | else 174 | { 175 | // Is there an Y size attribute in our template 176 | if (attrList["sizey"] != null) // yes 177 | { 178 | // remove the unneeded attribute 179 | status = "Removed"; 180 | Console.WriteLine( 181 | string.Format("{2} Y size: {1,2} from Table Name: '{0}'", tableAttrList["name"].Value, attrList["sizey"].Value, status) 182 | ); 183 | node.Attributes.Remove(attrList["sizey"]); 184 | } 185 | } 186 | } 187 | } 188 | } 189 | if (node.HasChildNodes) // thesee are the axis entries for the current table element 190 | { 191 | XmlNodeList childNodes = node.ChildNodes; 192 | foreach (XmlNode child in childNodes) 193 | { 194 | if ((child.NodeType == XmlNodeType.Element) && child.Name == "table") 195 | { 196 | XmlAttributeCollection cattrList = child.Attributes; 197 | string axis = cattrList["type"].Value; 198 | axis = ConvertName(name + "_" + axis); 199 | if (addrTable.Contains(axis)) 200 | { 201 | cattrList["storageaddress"].Value = Convert.ToInt32(addrTable[axis].ToString() , 16).ToString("X"); 202 | } 203 | //Console.WriteLine(axis + " = " + cattrList["storageaddress"].Value); 204 | } 205 | } 206 | } 207 | } 208 | } 209 | } 210 | try 211 | { 212 | doc.Save(args[2]); 213 | } 214 | catch (Exception e) 215 | { 216 | Console.WriteLine("Could not write output file. " + e); 217 | return; 218 | } 219 | } 220 | 221 | private static string ConvertName(string original) 222 | { 223 | original = original.Replace(")(", "_"); 224 | 225 | StringBuilder builder = new StringBuilder(original.Length); 226 | foreach (char c in original) 227 | { 228 | if (char.IsLetterOrDigit(c)) 229 | { 230 | builder.Append(c); 231 | continue; 232 | } 233 | 234 | if (c == '_') 235 | { 236 | builder.Append(c); 237 | continue; 238 | } 239 | 240 | if (char.IsWhiteSpace(c)) 241 | { 242 | builder.Append('_'); 243 | continue; 244 | } 245 | 246 | if (c == '*') 247 | { 248 | builder.Append("Ext"); 249 | continue; 250 | } 251 | } 252 | 253 | // Make sure the name is unique 254 | string name = builder.ToString(); 255 | while (names.Contains(name)) 256 | { 257 | name = name + "_"; 258 | } 259 | names.Add(name); 260 | 261 | return name; 262 | } 263 | 264 | private static void Usage() 265 | { 266 | Console.WriteLine("MakeXmlDef Usage:"); 267 | Console.WriteLine("MakeXmlDef.exe "); 268 | Console.WriteLine(); 269 | Console.WriteLine("Where is an XML file that will be used as a template to modify."); 270 | Console.WriteLine(" is a text file containing Table names and Addresses from"); 271 | Console.WriteLine(" the IDA Names Window."); 272 | Console.WriteLine(" is the file to save the output to."); 273 | } 274 | } 275 | } 276 | -------------------------------------------------------------------------------- /src/Definitions/UpdateLoggerFromXmlForEcuId.php: -------------------------------------------------------------------------------- 1 | alert('" . $message . "\\nTerminating script.')"; 42 | exit; 43 | } 44 | 45 | function DbGetVersion($con) 46 | { 47 | $sql_version = "SELECT * FROM version ORDER BY id DESC LIMIT 1"; 48 | if (!$result = mysqli_query($con, $sql_version)) 49 | { 50 | ReportError("Error retrieving DB version:" . mysqli_error($con), $con); 51 | } 52 | if (mysqli_num_rows($result) > 1) 53 | { 54 | ReportError("More than one version entry retrieved, count:" . mysqli_num_rows($result), $con); 55 | } 56 | $row = mysqli_fetch_array($result, MYSQLI_ASSOC); 57 | return array($row['id'], $row['version'], $row['update']); 58 | } 59 | 60 | function DbGetEcuIdSerial($con, $ecuid) 61 | { 62 | $sql_version = "SELECT serial FROM ecuid where ecuid='" . $ecuid . "';"; 63 | if (!$result = mysqli_query($con, $sql_version)) 64 | { 65 | ReportError("Error retrieving ECU ID:" . mysqli_error($con), $con); 66 | } 67 | if (mysqli_num_rows($result) > 1) 68 | { 69 | ReportError("More than one ECU ID entry retrieved, count:" . mysqli_num_rows($result), $con); 70 | } 71 | $row = mysqli_fetch_array($result, MYSQLI_ASSOC); 72 | return $row['serial']; 73 | } 74 | 75 | function DbAddEcuId($con, $ecuid) 76 | { 77 | $sql_addr_ecuid = "INSERT INTO ecuid (ecuid) VALUES ('" . $ecuid . "');"; 78 | if (!mysqli_query($con, $sql_addr_ecuid)) 79 | { 80 | ReportError("Error adding ecuid:" . mysqli_error($con), $con); 81 | } 82 | return mysqli_insert_id($con); 83 | } 84 | 85 | function DbAddAddress($con, $addr, $length, $bit) 86 | { 87 | if (is_null($bit)) 88 | { 89 | $bit = "NULL"; 90 | } 91 | else 92 | { 93 | $bit = "'" . $bit . "'"; 94 | } 95 | $sql_addr_add = "INSERT INTO address (address,length,bit) VALUES ('" . $addr . "','" . $length . "'," . $bit . ");"; 96 | if (!mysqli_query($con, $sql_addr_add)) 97 | { 98 | ReportError("Error adding address:" . mysqli_error($con), $con); 99 | } 100 | return mysqli_insert_id($con); 101 | } 102 | 103 | function DbUpdateEcuParamRel($con, $ecuparam_rel_serial, $address_serial) 104 | { 105 | $sql_addrid_update = "UPDATE ecuparam_rel SET addressid='". $address_serial ."' WHERE serial='". $ecuparam_rel_serial ."';"; 106 | if (!mysqli_query($con, $sql_addrid_update)) 107 | { 108 | ReportError("Error updating address serial:" . mysqli_error($con), $con); 109 | } 110 | return; 111 | } 112 | 113 | function DbAddEcuParamRel($con, $ecuid_serial, $ecuparam_serial, $address_serial) 114 | { 115 | $sql_addrid_add = "INSERT INTO ecuparam_rel (ecuparamid,ecuidid,addressid) VALUES ('" . $ecuparam_serial . "','" . $ecuid_serial . "','" . $address_serial . "');"; 116 | if (!mysqli_query($con, $sql_addrid_add)) 117 | { 118 | ReportError("Error adding ECU Parameter Relation:" . mysqli_error($con), $con); 119 | } 120 | return mysqli_insert_id($con); 121 | } 122 | 123 | function DbUpdateVersion($con, $message) 124 | { 125 | date_default_timezone_set('America/New_York'); 126 | $version = date("Ymd_His"); 127 | $message = rtrim($message); 128 | $sql_version_update = "INSERT INTO `version` (`id`,`version`,`update`) VALUES (NULL,'" . $version . "','" . $message . "');"; 129 | if (!mysqli_query($con, $sql_version_update)) 130 | { 131 | ReportError("Error inserting version:" . mysqli_error($con), $con); 132 | } 133 | return; 134 | } 135 | 136 | $ecuid = NULL; 137 | $operation = NULL; 138 | $commit = NULL; 139 | $allowedExts = array("txt", "xml"); 140 | $temp = explode(".", $_FILES["file"]["name"]); 141 | $extension = end($temp); 142 | 143 | echo ""; 144 | echo ""; 145 | echo "RR Logger XML Import Tool"; 146 | echo ""; 147 | echo ""; 148 | echo ""; 149 | echo ""; 150 | 151 | if ((($_FILES["file"]["type"] == "text/plain") 152 | || ($_FILES["file"]["type"] == "text/xml")) 153 | && ($_FILES["file"]["size"] < 3000000) 154 | && in_array($extension, $allowedExts)) 155 | { 156 | if ($_FILES["file"]["error"] > 0) 157 | { 158 | ReportError("Return Code: " . $_FILES["file"]["error"], NULL); 159 | } 160 | else 161 | { 162 | echo "Upload: " . $_FILES["file"]["name"] . "
"; 163 | echo "Type: " . $_FILES["file"]["type"] . "
"; 164 | printf("Size: %.3f kB
", ($_FILES["file"]["size"] / 1024)); 165 | echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
"; 166 | } 167 | } 168 | else 169 | { 170 | ReportError("Invalid file", NULL); 171 | } 172 | 173 | if ($_SERVER["REQUEST_METHOD"] == "POST") 174 | { 175 | $ecuid = TestInput($_POST["ecuid"]); 176 | $operation = TestInput($_POST["operation"]); 177 | } 178 | else 179 | { 180 | ReportError("Invalid method", NULL); 181 | } 182 | if ($ecuid == '' || is_null($ecuid)) 183 | { 184 | ReportError("ECU ID must be specified", NULL); 185 | } 186 | echo "Operation: " . $operation . "
"; 187 | if ($operation == "Commit") $commit = 1; 188 | 189 | $con = mysqli_connect("localhost","XXXX","XXXX","definitions"); 190 | if (mysqli_connect_errno()) 191 | { 192 | echo "Failed to connect to MySQL: " . mysqli_connect_error() . ""; 193 | return; 194 | } 195 | 196 | $version = DbGetVersion($con); 197 | echo "DB version: " . $version[0] . " (" . $version[1] . ")
"; 198 | 199 | // Query database for the ECU ID, get serial number if found otherwise insert new ECU ID and get serial number 200 | $ecuid_serial = DbGetEcuIdSerial($con, $ecuid); 201 | $update = NULL; 202 | $changed = 0; 203 | if ($ecuid_serial) 204 | { 205 | echo "ECU ID: " . $ecuid . " found with serial = " . $ecuid_serial . "

"; 206 | $update = "Updated ECU ID: " . $ecuid . " extended parameters\n"; 207 | } 208 | else 209 | { 210 | echo "ECU ID: " . $ecuid . " not found in database

"; 211 | if ($commit) 212 | { 213 | $ecuid_serial = DbAddEcuId($con, $ecuid); 214 | echo "
COMMIT: ECU ID, new serial = " . $ecuid_serial; 215 | $update = "Added ECU ID: " . $ecuid . " to extended parameters\n"; 216 | $changed++; 217 | } 218 | else 219 | { 220 | echo "
TEST: New ECU ID will be added"; 221 | } 222 | } 223 | 224 | $xml=simplexml_load_file($_FILES["file"]["tmp_name"]); 225 | // query XML for all defined Extended parameter id attributes for this ECU ID 226 | $parameter_ids = $xml->xpath("/logger/protocols/protocol[@id='SSM']/ecuparams/ecuparam[ecu[contains(@id, '". $ecuid . "')]]/@id"); 227 | 228 | $addresses = array(); 229 | echo ""; 230 | foreach ($parameter_ids as $id) 231 | { 232 | // query XML for all defined address attribute values using the Extended parameter id and ECU ID 233 | $address = $xml->xpath("/logger/protocols/protocol[@id='SSM']/ecuparams/ecuparam[@id='". (string)$id . "']/ecu[contains(@id, '". $ecuid . "')]/address"); 234 | 235 | // query XML for the name attribute of this Extended parameter id 236 | $name = $xml->xpath("/logger/protocols/protocol[@id='SSM']/ecuparams/ecuparam[@id='". (string)$id . "']/@name"); 237 | 238 | foreach ($address as $addr) 239 | { 240 | $bit_value = NULL; 241 | $db_addr = str_replace("0x0", "", $addr); 242 | $db_addr = str_replace("0x", "", $db_addr); 243 | // query XML for the bit attribute for this address and Extended parameter id and ECU ID 244 | $bit = $xml->xpath("/logger/protocols/protocol[@id='SSM']/ecuparams/ecuparam[@id='". (string)$id . "']/ecu[contains(@id, '". $ecuid . "')][address='" . (string)$addr . "']/address/@bit"); 245 | 246 | if (count($bit) > 0) 247 | { 248 | $bit_value = "
" . (string)$bit[0]; 249 | } 250 | echo "
E_" . ConvertName((string)$name[0]). "_" . (string)$id . "" . $addr . $bit_value; 251 | 252 | // Query database for the Extended parameter ID to get the serial number and data storage length 253 | $query_ecuparam = "SELECT serial, length FROM ecuparam where id='" . str_replace("E", "", (string)$id) . "';"; 254 | $result = mysqli_query($con, $query_ecuparam); 255 | if (mysqli_num_rows($result) > 1) 256 | { 257 | ReportError("More than one parameter ID " . (string)$id . " entry retrieved, count:" . mysqli_num_rows($result), $con); 258 | } 259 | elseif (mysqli_num_rows($result) != 1) 260 | { 261 | echo "
Parameter : " . (string)$id . " not defined in database, skipping.
"; 262 | continue; 263 | } 264 | $row = mysqli_fetch_array($result, MYSQLI_ASSOC); 265 | $ecuparam_serial = $row['serial']; 266 | $data_length = $row['length']; 267 | $bit_defined = NULL; 268 | if (count($bit) == 1) 269 | { 270 | $bit_defined = (string)$bit[0]; 271 | if (is_null($data_length)) 272 | { 273 | $length = 1; 274 | } 275 | else 276 | { 277 | $length = $data_length; 278 | } 279 | if (($length == 1 && $bit_defined >= 0 && $bit_defined <= 7 ) || 280 | ($length == 2 && $bit_defined >= 0 && $bit_defined <= 15) || 281 | ($length == 4 && $bit_defined >= 0 && $bit_defined <= 31)) 282 | { 283 | $query_str = "SELECT serial FROM address where address='" . $db_addr . 284 | "' and length='" . $data_length . "' and bit='" . $bit_defined . "';"; 285 | } 286 | else 287 | { 288 | ReportError("Incompatible bit value passed for parameter address length, length:" . $length . ", bit:" . $bit_defined, $con); 289 | } 290 | } 291 | else 292 | { 293 | $query_str = "SELECT serial FROM address where address='" . $db_addr . 294 | "' and length='" . $data_length . "' and bit IS NULL;"; 295 | } 296 | 297 | // Query database for the address/length/bit combo, get serial number if found otherwise 298 | // insert new address/length/bit combo and get serial number 299 | mysqli_free_result($result); 300 | $result = mysqli_query($con, $query_str); 301 | $row = mysqli_fetch_array($result, MYSQLI_ASSOC); 302 | if (mysqli_num_rows($result) > 1) 303 | { 304 | ReportError("More than one address " . $addr . " entry retrieved, count:" . mysqli_num_rows($result), $con); 305 | } 306 | $address_serial = NULL; 307 | if ($row['serial']) 308 | { 309 | $address_serial = $row['serial']; 310 | //echo "
address serial = " . $address_serial; 311 | } 312 | else 313 | { 314 | if ($commit) 315 | { 316 | echo "
address/length/bit combo not defined:" . $addr . "/" . $data_length . "/" . $bit_defined; 317 | $address_serial = DbAddAddress($con, $db_addr, $data_length, $bit_defined); 318 | echo "
COMMIT: address/length/bit combo new serial = " . $address_serial; 319 | $changed++; 320 | } 321 | else 322 | { 323 | echo "
TEST: address/length/bit combo not defined, will be added"; 324 | } 325 | } 326 | 327 | // Query database for the ECU ID/parameter/address combo, get serial number if found. 328 | // If the combo exists, check to see if the address serial is the same as what we have 329 | // determined above. If it is not then update the current address serial entry. 330 | // If the combo does not exist, insert new ECU ID/parameter/address combo and get serial number 331 | mysqli_free_result($result); 332 | $query_ecuparam_rel = "SELECT * FROM ecuparam_rel where ecuparamid='" . $ecuparam_serial . 333 | "' and ecuidid='" . $ecuid_serial . "';"; 334 | $result = mysqli_query($con, $query_ecuparam_rel); 335 | $row = mysqli_fetch_array($result, MYSQLI_ASSOC); 336 | if (mysqli_num_rows($result) > 1) 337 | { 338 | ReportError("More than one ECU parameter relation " . $ecuparam_serial . 339 | "/" . $ecuid_serial . " entry retrieved, count:" . mysqli_num_rows($result), $con); 340 | } 341 | $ecuparam_rel_serial = NULL; 342 | $ecuparam_rel_addr_serial = NULL; 343 | if ($row['serial']) 344 | { 345 | $ecuparam_rel_serial = $row['serial']; 346 | $ecuparam_rel_addr_serial = $row['addressid']; 347 | if ($ecuparam_rel_addr_serial == $address_serial) 348 | { 349 | echo "
Address serials match: " . $ecuparam_rel_addr_serial . " == " . $address_serial; 350 | } 351 | else 352 | { 353 | if ($commit) 354 | { 355 | echo "
COMMIT: Address serials do not match: " . $ecuparam_rel_addr_serial . " != " . $address_serial . ", updated"; 356 | DbUpdateEcuParamRel($con, $ecuparam_rel_serial, $address_serial); 357 | $update = $update . "Changed address/length/bit entry for ECU ID " . $ecuid . " for extended parameter " . (string)$id . "\n"; 358 | $changed++; 359 | } 360 | else 361 | { 362 | echo "
TEST: Address serials do not match and will be updated"; 363 | } 364 | } 365 | } 366 | else 367 | { 368 | if ($commit) 369 | { 370 | echo "
ECU ID/parameter/address combo not defined: " . $ecuid_serial . "/" . $ecuparam_serial . "/" . $address_serial; 371 | $ecuparam_rel_serial = DbAddEcuParamRel($con, $ecuid_serial, $ecuparam_serial, $address_serial); 372 | echo "
COMMIT: Inserted ECU ID/parameter/address combo new serial = " . $ecuparam_rel_serial; 373 | $changed++; 374 | } 375 | else 376 | { 377 | echo "
TEST: ECU ID/parameter/address combo not defined, will be added"; 378 | } 379 | } 380 | } 381 | if (array_key_exists((string)$id, $addresses)) 382 | { 383 | $addresses[(string)$id]++; 384 | } 385 | else 386 | { 387 | $addresses[(string)$id] = 1; 388 | } 389 | } 390 | echo "

"; 391 | if ($changed) 392 | { 393 | DbUpdateVersion($con, $update); 394 | $version = DbGetVersion($con); 395 | echo "DB version: " . $version[0] . " (" . $version[1] . ")
"; 396 | } 397 | else 398 | { 399 | echo "Test complete
"; 400 | } 401 | mysqli_close($con); 402 | 403 | $warn = NULL; 404 | foreach($addresses as $id => $id_count) 405 | { 406 | if ($id_count > 1) 407 | { 408 | echo "---WARNING:---
"; 409 | echo "id = " . $id . ", Seen = " . $id_count; 410 | echo "
"; 411 | $warn++; 412 | } 413 | } 414 | if ($warn) ReportError("Warnings present", NULL); 415 | echo ""; 416 | ?> 417 | -------------------------------------------------------------------------------- /src/RR2EcuFlash/RR2EcuFlash/Main.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this source for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Purpose: 9 | * to convert a RomRaider Editor definition to an EcuFlash definition 10 | */ 11 | 12 | using System; 13 | using System.Text; 14 | using System.Windows.Forms; 15 | using System.IO; 16 | using System.Xml; 17 | using System.Xml.XPath; 18 | using System.Collections.Generic; 19 | using System.Text.RegularExpressions; 20 | using System.Reflection; 21 | 22 | namespace RR2EcuFlash 23 | { 24 | class MainClass 25 | { 26 | private static HashSet stateNames = new HashSet(); 27 | 28 | public static void Main (string[] args) 29 | { 30 | if (args.Length != 2) 31 | { 32 | Usage(); 33 | return; 34 | } 35 | ConvertDef(args); 36 | } 37 | 38 | private static void ConvertDef(string[] args) 39 | { 40 | string filename = args[0]; 41 | string calId = args[1]; 42 | 43 | if (!File.Exists(filename)) 44 | { 45 | MessageBox.Show("'" + filename + "' was not found. Check your path and spelling.", 46 | "Error - File Missing", 47 | MessageBoxButtons.OK, 48 | MessageBoxIcon.Exclamation, 49 | MessageBoxDefaultButton.Button1); 50 | return; 51 | } 52 | 53 | using (Stream stream = File.OpenRead(filename)) 54 | { 55 | IDictionary romidElements = new Dictionary(); 56 | romidElements.Add("rombase",""); 57 | romidElements.Add("xmlid",""); 58 | romidElements.Add("internalidaddress",""); 59 | romidElements.Add("internalidstring",""); 60 | romidElements.Add("caseid",""); 61 | romidElements.Add("ecuid",""); 62 | romidElements.Add("year",""); 63 | romidElements.Add("market",""); 64 | romidElements.Add("make",""); 65 | romidElements.Add("model",""); 66 | romidElements.Add("submodel",""); 67 | romidElements.Add("transmission",""); 68 | romidElements.Add("memmodel",""); 69 | romidElements.Add("flashmethod",""); 70 | romidElements.Add("obsolete",""); 71 | XPathDocument doc = new XPathDocument(stream); 72 | XPathNavigator nav = doc.CreateNavigator(); 73 | string path = "/roms/rom/romid[xmlid='" + calId + "']"; 74 | string currentTable = ""; 75 | 76 | XPathNodeIterator iter = nav.Select(path); 77 | iter.MoveNext(); 78 | nav = iter.Current; // this is the romid element 79 | 80 | // read through all of the child elements of romid 81 | if (nav.HasChildren) 82 | { 83 | nav.MoveToFirstChild(); 84 | do 85 | { 86 | switch (nav.Name) 87 | { 88 | case "xmlid": 89 | romidElements["xmlid"] = nav.InnerXml; 90 | break; 91 | case "internalidaddress": 92 | romidElements["internalidaddress"] = nav.InnerXml; 93 | break; 94 | case "internalidstring": 95 | romidElements["internalidstring"] = nav.InnerXml; 96 | break; 97 | case "caseid": 98 | romidElements["caseid"] = nav.InnerXml; 99 | break; 100 | case "ecuid": 101 | romidElements["ecuid"] = nav.InnerXml; 102 | break; 103 | case "year": 104 | romidElements["year"] = nav.InnerXml; 105 | break; 106 | case "market": 107 | romidElements["market"] = nav.InnerXml; 108 | break; 109 | case "make": 110 | romidElements["make"] = nav.InnerXml; 111 | break; 112 | case "model": 113 | romidElements["model"] = nav.InnerXml; 114 | break; 115 | case "submodel": 116 | romidElements["submodel"] = nav.InnerXml; 117 | break; 118 | case "transmission": 119 | romidElements["transmission"] = nav.InnerXml; 120 | break; 121 | case "memmodel": 122 | romidElements["memmodel"] = nav.InnerXml; 123 | break; 124 | case "flashmethod": 125 | romidElements["flashmethod"] = nav.InnerXml; 126 | break; 127 | case "obsolete": 128 | romidElements["obsolete"] = nav.InnerXml; 129 | break; 130 | } 131 | } 132 | while (nav.MoveToNext()); 133 | } 134 | 135 | if (string.IsNullOrEmpty(romidElements["xmlid"])) 136 | { 137 | MessageBox.Show("Could not find definition for " + calId, 138 | "Error - Definition not found", 139 | MessageBoxButtons.OK, 140 | MessageBoxIcon.Exclamation, 141 | MessageBoxDefaultButton.Button1); 142 | return; 143 | } 144 | 145 | // get the inherited base ROM ID 146 | do 147 | { 148 | nav.MoveToParent(); 149 | } 150 | while (nav.Name != "rom"); 151 | if (nav.HasAttributes) 152 | { 153 | romidElements["rombase"] = nav.GetAttribute("base", ""); 154 | } 155 | string outFilename = romidElements["xmlid"].ToUpper() + ".xml"; 156 | StreamWriter outfile = new StreamWriter(outFilename, false); 157 | 158 | string preamble = MakePreamble(romidElements["xmlid"]); 159 | outfile.Write(preamble); 160 | string romId = MakeRomId(romidElements); 161 | outfile.Write(romId); 162 | 163 | nav = iter.Current; // positioned at rom element 164 | nav.MoveToFirstChild(); // this is the first child element of rom (i.e.: romid) 165 | if (nav.HasChildren) 166 | { 167 | do 168 | { 169 | if (nav.Name.Equals("romid")) continue; 170 | if (nav.Name.Equals("table")) 171 | { 172 | string name = ""; 173 | string dataAddr = ""; 174 | string xSize = ""; 175 | string ySize = ""; 176 | string type = ""; 177 | string axisAddr = ""; 178 | if (nav.HasAttributes) 179 | { 180 | name = nav.GetAttribute("name",""); 181 | currentTable = name; 182 | if (name.Equals("Checksum Fix")) continue; 183 | if (name.Equals("Fuel Pump Duty Cycle")) 184 | { 185 | name = "Fuel Pump Duty"; 186 | } 187 | name = Regex.Replace(name, @" $", "__"); 188 | name = Regex.Replace(name, @" $", "_"); 189 | 190 | dataAddr = nav.GetAttribute("storageaddress",""); 191 | dataAddr = Regex.Replace(dataAddr, @"^0x", ""); 192 | dataAddr = dataAddr.ToLower(); 193 | 194 | xSize = nav.GetAttribute("sizex",""); 195 | ySize = nav.GetAttribute("sizey",""); 196 | } 197 | string table = ""; 198 | 199 | if (nav.HasChildren) 200 | { 201 | table = string.Format(" ", 202 | name, 203 | dataAddr); 204 | outfile.WriteLine(table); 205 | 206 | nav.MoveToFirstChild(); // move to first child (i.e.: table axis element) 207 | do 208 | { 209 | if (nav.Name.Equals("state")) 210 | { 211 | AddStateTable(currentTable); 212 | outfile.WriteLine("-- Need to define scaling element and create scaling attribute for this table --"); 213 | } 214 | else 215 | { 216 | string elements = ""; 217 | if (nav.HasAttributes) 218 | { 219 | type = nav.GetAttribute("type",""); 220 | type = Regex.Replace(type, @"^X Axis$", "X"); 221 | type = Regex.Replace(type, @"^Y Axis$", "Y"); 222 | 223 | axisAddr = nav.GetAttribute("storageaddress",""); 224 | axisAddr = Regex.Replace(axisAddr, @"^0x", ""); 225 | axisAddr = axisAddr.ToLower(); 226 | 227 | if (type.Equals("X")) 228 | { 229 | if (!string.IsNullOrEmpty(xSize)) 230 | { 231 | elements = string.Format("elements=\"{0}\" ", xSize); 232 | } 233 | } 234 | else 235 | { 236 | if (!string.IsNullOrEmpty(ySize)) 237 | { 238 | elements = string.Format("elements=\"{0}\" ", ySize); 239 | } 240 | } 241 | table = string.Format("
", 242 | type, 243 | axisAddr, 244 | elements); 245 | outfile.WriteLine(table); 246 | } 247 | } 248 | } 249 | while (nav.MoveToNext()); // move to next table axis element 250 | 251 | nav.MoveToParent(); // move back to parent table element 252 | outfile.WriteLine("
"); 253 | } 254 | else if (!nav.HasChildren && 255 | (!string.IsNullOrEmpty(xSize) || !string.IsNullOrEmpty(ySize))) 256 | { 257 | table = string.Format(" ", 258 | name, 259 | dataAddr); 260 | outfile.WriteLine(table); 261 | 262 | if (!string.IsNullOrEmpty(xSize)) 263 | { 264 | table = string.Format("
", xSize); 265 | outfile.WriteLine(table); 266 | } 267 | if (!string.IsNullOrEmpty(ySize)) 268 | { 269 | table = string.Format("
", ySize); 270 | outfile.WriteLine(table); 271 | } 272 | outfile.WriteLine("
"); 273 | } 274 | else 275 | { 276 | table = string.Format(" ", 277 | name, 278 | dataAddr); 279 | outfile.WriteLine(table); 280 | } 281 | } 282 | } 283 | while (nav.MoveToNext()); // move to next table element 284 | } 285 | if (stateNames.Count > 0) 286 | { 287 | outfile.WriteLine(""); 288 | MessageBox.Show("Found " + stateNames.Count + " state elements, you will need to create them manually " + 289 | "from the current and BASE def info and fix up the table entries that use " + 290 | "them. Tables affected will now be listed on the command line.", 291 | "Warning - Definition is not complete", 292 | MessageBoxButtons.OK, 293 | MessageBoxIcon.Exclamation, 294 | MessageBoxDefaultButton.Button1); 295 | 296 | Console.WriteLine(); 297 | Console.WriteLine("Table names that require scaling definitions to be defined from the BASE and current def:"); 298 | foreach (string sn in stateNames) 299 | { 300 | Console.WriteLine(sn); 301 | } 302 | } 303 | else 304 | { 305 | outfile.WriteLine(""); 306 | } 307 | outfile.Close(); 308 | } 309 | } 310 | 311 | private static string MakePreamble(string xmlId) 312 | { 313 | string writeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss %K"); 314 | string version = " This file was gernerated by RR2EcuFlash version: " + 315 | Assembly.GetExecutingAssembly().GetName().Version; 316 | StringBuilder builder = new StringBuilder(); 317 | builder.AppendLine(""); 318 | builder.AppendLine(""); 341 | return builder.ToString(); 342 | } 343 | 344 | private static string MakeRomId(IDictionary elements) 345 | { 346 | string value = ""; 347 | StringBuilder builder = new StringBuilder(); 348 | builder.AppendLine(""); 349 | builder.AppendLine(" "); 350 | foreach (var pair in elements) 351 | { 352 | string tag = pair.Key; 353 | string text = pair.Value; 354 | if (tag.Equals("rombase")) continue; 355 | if (!string.IsNullOrEmpty(text)) 356 | { 357 | builder.AppendLine(" <" + tag + ">" + text + ""); 358 | if (tag.Equals("memmodel") && text.StartsWith("SH705")) 359 | { 360 | builder.AppendLine(" subarudbw"); 361 | } 362 | } 363 | } 364 | builder.AppendLine(" "); 365 | if (elements.TryGetValue("rombase", out value)) 366 | { 367 | builder.AppendLine(" " + elements["rombase"] + ""); 368 | } 369 | return builder.ToString(); 370 | } 371 | 372 | private static void AddStateTable(string name) 373 | { 374 | if(name.Length > 0) 375 | { 376 | if (!stateNames.Contains(name)) 377 | { 378 | stateNames.Add(name); 379 | } 380 | } 381 | } 382 | 383 | private static void Usage() 384 | { 385 | StringBuilder builder = new StringBuilder(); 386 | builder.AppendLine("RR2EcuFlash.exe "); 387 | builder.AppendLine(); 388 | MessageBox.Show(builder.ToString(), "RR2EcuFlash Usage Help"); 389 | } 390 | } 391 | } 392 | -------------------------------------------------------------------------------- /src/IDA/MakeTablePointers.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 5 9 | * Date : 2012-11-18 10 | * 11 | * To use this script you must locate the bounds of the map table 12 | * definitions in the ROM. For a 32bit ROM this is in the 0x82000 13 | * to 0x83000 area. Locate the ending of these definitions and copy 14 | * the address. Move the cursor to beginning and start the script. 15 | * Paste in the end address when requested. 16 | * Check for warnings at the end of the script. A rom_def.xml file 17 | * will be written to the directory where the ROM is located. This 18 | * file can be used with RomRaider Editor to view the RAW formatted 19 | * tables. 20 | */ 21 | 22 | #include 23 | static main() { 24 | auto currAddr, endAddr, lastAddr, globals, fout, size, maxSize, calIdAddr, calId, ync, nextTable; 25 | calIdAddr = Word(SegEnd(0) - 2); 26 | calId = GetString(calIdAddr, 8, ASCSTR_C); 27 | ync = AskYN(1,calId + ", is this the correct CAL ID?"); // -1:cancel,0-no,1-ok 28 | if (ync == -1) { return 0;} 29 | if (ync == 0 ) { 30 | calIdAddr = AskAddr(0x2000,"Enter the address where the CAL ID is stored,\n typically 2000, 2004 400C:"); 31 | calId = GetString(calIdAddr, 8, ASCSTR_C); 32 | } 33 | globals = GetArrayId("myGlobals"); 34 | DeleteArray(globals); 35 | globals = CreateArray("myGlobals"); 36 | fout = fopen("rom_def.xml", "w"); 37 | SetArrayLong(globals, 0, fout); 38 | writestr(fout, "\n\n \n " + calId + "\n " + ltoa(calIdAddr, 16) + "\n"); 39 | writestr(fout, " " + calId + "\n 0123456789\n 05\n"); 40 | writestr(fout, " USDM\n Subaru\n CarModel\n 2.5\n"); 41 | writestr(fout, " MT\n SH7058\n sti05\n"); 42 | writestr(fout, " 1024kb\n \n"); 43 | currAddr = AskAddr(0,"Enter a start address or leave at 0 to use the current cursor position:"); 44 | endAddr = AskAddr(0,"Enter end address:"); 45 | 46 | if (currAddr == 0){ 47 | currAddr = here; 48 | } 49 | nextTable = currAddr; 50 | while (currAddr <= endAddr) { 51 | // 1 axis table with no data conversion values, undefined data type 52 | // Table Definition is 12 bytes long with the format: 53 | // word = axis length 54 | // word = data storage type 55 | // dword = axis address 56 | //dword = data address 57 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 58 | (Word(currAddr+2) == 0x0000) && 59 | (((Word(currAddr+12) > 0) && (Word(currAddr+12) < 256)) && 60 | ((Word(currAddr+14) >= 0) && (Word(currAddr+14) < 4097)))) { 61 | nextTable = nextTable + 12; 62 | lastAddr = currAddr; 63 | currAddr = Make2dRawTable(currAddr); 64 | size = currAddr+1-lastAddr; 65 | Message("Table 2D, size:" + form("%d", size) + ", data:raw, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 66 | lastAddr = currAddr+1; 67 | } 68 | // 1 axis table with data conversion values and defined data type 69 | // Table Definition is 20 bytes long with the format: 70 | // word = axis length 71 | // word = data storage type 72 | // dword = axis address 73 | // dword = data address 74 | // float = data multiplier 75 | // float = data additive 76 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 77 | ((Word(currAddr+2) == 0x0400) || (Word(currAddr+2) == 0x0800) || 78 | (Word(currAddr+2) == 0x0C00) || (Word(currAddr+2) == 0x1000)) && 79 | (((Word(currAddr+20) > 0) && (Word(currAddr+20) < 256)) && 80 | ((Word(currAddr+22) >= 0) && (Word(currAddr+22) < 4097)))) { 81 | nextTable = nextTable + 20; 82 | lastAddr = currAddr; 83 | currAddr = Make2dUintTable(currAddr); 84 | size = currAddr+1-lastAddr; 85 | Message("Table 2D, size:" + form("%d", size) + ", data:int, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 86 | lastAddr = currAddr+1; 87 | } 88 | // 1 axis table with no data conversion values and defined data type 89 | // Table Definition is 12 bytes long with the format: 90 | // word = axis length 91 | // word = data storage type 92 | // dword = axis address 93 | // dword = data address 94 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 95 | ((Word(currAddr+2) == 0x0400) || (Word(currAddr+2) == 0x0800) || 96 | (Word(currAddr+2) == 0x0C00) || (Word(currAddr+2) == 0x1000)) && 97 | (((Word(currAddr+12) > 0) && (Word(currAddr+12) < 256)) && 98 | ((Word(currAddr+14) >= 0) && (Word(currAddr+14) < 4097)))) { 99 | nextTable = nextTable + 12; 100 | lastAddr = currAddr; 101 | currAddr = Make2dUintTableNoConv(currAddr); 102 | size = currAddr+1-lastAddr; 103 | Message("Table 2D, size:" + form("%d", size) + ", data:int, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 104 | lastAddr = currAddr+1; 105 | } 106 | // 2 axis table with no data conversion values, defined data type 107 | // Table Definition is 20 bytes long with the format: 108 | // word = X axis length 109 | // word = Y axis length 110 | // dword = X axis address 111 | // dword = Y axis address 112 | // dword = data address 113 | // word = data storage type 114 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 115 | ((Word(currAddr+2) > 0) && (Word(currAddr+2) < 256)) && 116 | ((Dword(currAddr+16) == 0x04000000) || (Dword(currAddr+16) == 0x08000000) || 117 | (Dword(currAddr+16) == 0x0C000000) || (Dword(currAddr+16) == 0x10000000)) && 118 | (((Word(currAddr+20) > 0) && (Word(currAddr+20) < 256)) && 119 | ((Word(currAddr+22) >= 0) && (Word(currAddr+22) < 4097)))) { 120 | nextTable = nextTable + 20; 121 | lastAddr = currAddr; 122 | currAddr = Make3dUintTableNoConv(currAddr); 123 | size = currAddr+1-lastAddr; 124 | Message("Table 3D, size:" + form("%d", size) + ", data:int, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 125 | lastAddr = currAddr+1; 126 | } 127 | // 2 axis table with no data conversion values, undefined data type 128 | // Table Definition is 20 bytes long with the format: 129 | // word = X axis length 130 | // word = Y axis length 131 | // dword = X axis address 132 | // dword = Y axis address 133 | // dword = data address 134 | // word = data storage type 135 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 136 | ((Word(currAddr+2) > 0) && (Word(currAddr+2) < 256)) && 137 | (Dword(currAddr+16) == 0x00000000) && 138 | (((Word(currAddr+20) > 0) && (Word(currAddr+20) < 256)) && 139 | ((Word(currAddr+22) >= 0) && (Word(currAddr+22) < 4097)))) { 140 | nextTable = nextTable + 20; 141 | lastAddr = currAddr; 142 | currAddr = Make3dRawTable(currAddr); 143 | size = currAddr+1-lastAddr; 144 | Message("Table 3D, size:" + form("%d", size) + ", data:raw, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 145 | lastAddr = currAddr+1; 146 | } 147 | // 2 axis table with data conversion values and defined data type 148 | // Table Definition is 28 bytes long with the format: 149 | // word = X axis length 150 | // word = Y axis length 151 | // dword = X axis address 152 | // dword = Y axis address 153 | // dword = data address 154 | // word = data storage type 155 | // float = data multiplier 156 | // float = data additive 157 | if (((Word(currAddr) > 0) && (Word(currAddr) < 256)) && 158 | ((Word(currAddr+2) > 0) && (Word(currAddr+2) < 256)) && 159 | ((Dword(currAddr+16) == 0x04000000) || (Dword(currAddr+16) == 0x08000000) || 160 | (Dword(currAddr+16) == 0x0C000000) || (Dword(currAddr+16) == 0x10000000)) && 161 | (((Word(currAddr+28) > 0) && (Word(currAddr+28) < 256)) && 162 | ((Word(currAddr+30) >= 0) && (Word(currAddr+30) < 4097)))) { 163 | nextTable = nextTable + 28; 164 | lastAddr = currAddr; 165 | currAddr = Make3dUintTable(currAddr); 166 | size = currAddr+1-lastAddr; 167 | Message("Table 3D, size:" + form("%d", size) + ", data:int, ROM:0x" + ltoa(lastAddr, 16) + ", " + GetArrayElement(AR_STR, globals, 1)); 168 | lastAddr = currAddr+1; 169 | } 170 | if (size > maxSize) { 171 | maxSize = size; 172 | } 173 | // Message("Next table expected at ROM:0x" + ltoa(lastAddr, 16) + "\n"); 174 | SetArrayString(globals, 1, "\n"); 175 | currAddr = currAddr+1; 176 | } 177 | writestr(fout, "\n\n"); 178 | fclose(fout); 179 | DeleteArray(globals); 180 | if (maxSize > 28) { 181 | Message("WARNING: Table definitions found that are greater than 28 bytes long. These tables need attention\n"); 182 | } 183 | else { 184 | Message("Finished, no warnings BUT the last table may not have been defined.\n You should double check it. ROM:0x" + ltoa(lastAddr, 16) + "\n"); 185 | } 186 | } 187 | 188 | static Make2dRawTable(currAddr) { 189 | auto axisAddr, dataAddr, dataLength, dataType, dataAlign, x, fMin, fMax, fNum, fNumNext; 190 | fMin = 0 - 66000.1; 191 | fMax = 66000.; 192 | MakeUnknown(currAddr, 12, DOUNK_SIMPLE); 193 | MakeWord(currAddr); // length 194 | dataLength = Word(currAddr); 195 | currAddr = currAddr+2; 196 | MakeWord(currAddr); // no data conversion 197 | currAddr = currAddr+2; 198 | MakeDword(currAddr); // axis address 199 | axisAddr = Dword(currAddr); 200 | currAddr = currAddr+4; 201 | MakeDword(currAddr); // data address 202 | dataAddr = Dword(currAddr); 203 | currAddr = currAddr+3; 204 | FormatTableAxis(axisAddr, dataLength); 205 | dataAlign = dataLength % 0x2; 206 | if (DfirstB((dataAddr + (dataLength + dataAlign))) != BADADDR) { 207 | dataType = 0x04; 208 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 209 | } 210 | else if (DfirstB(dataAddr + ((dataLength + dataAlign)*2)) != BADADDR) { 211 | dataType = 0x08; 212 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 213 | } 214 | else if (DfirstB(dataAddr + (dataLength*4)) != BADADDR) { 215 | fNum = GetFpNum(dataAddr,4); 216 | fNumNext = GetFpNum(dataAddr+4,4); 217 | if ((fNum >= fMin && fNum <= fMax && fNumNext >= fMin && fNumNext <= fMax) || Dword(dataAddr) == 0) { 218 | dataType = "float"; 219 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 220 | } 221 | else { 222 | dataType = "float"; 223 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 224 | } 225 | } 226 | Print2dTable(axisAddr, dataAddr, dataLength, dataType, 1, 0); 227 | return currAddr; 228 | } 229 | 230 | static Make2dUintTable(currAddr) { 231 | auto axisAddr, dataAddr, dataLength, dataType, dataM, dataA; 232 | MakeUnknown(currAddr, 20, DOUNK_SIMPLE); 233 | MakeWord(currAddr); // length 234 | dataLength = Word(currAddr); 235 | currAddr = currAddr+2; 236 | MakeWord(currAddr); // data type and conversion 237 | dataType = Byte(currAddr); 238 | currAddr = currAddr+2; 239 | MakeDword(currAddr); // axis address 240 | axisAddr = Dword(currAddr); 241 | currAddr = currAddr+4; 242 | MakeDword(currAddr); // data addreess 243 | dataAddr = Dword(currAddr); 244 | currAddr = currAddr+4; 245 | MakeFloat(currAddr); // multiplier 246 | dataM = GetFpNum(currAddr,4); 247 | currAddr = currAddr+4; 248 | MakeFloat(currAddr); // additive 249 | dataA = GetFpNum(currAddr,4); 250 | currAddr = currAddr+3; 251 | FormatTableAxis(axisAddr, dataLength); 252 | FormatTableData(dataAddr, dataLength, dataM, dataA, dataType); 253 | Print2dTable(axisAddr, dataAddr, dataLength, dataType, dataM, dataA); 254 | return currAddr; 255 | } 256 | 257 | static Make2dUintTableNoConv(currAddr) { 258 | auto axisAddr, dataAddr, dataLength, dataType; 259 | MakeUnknown(currAddr, 12, DOUNK_SIMPLE); 260 | MakeWord(currAddr); // length 261 | dataLength = Word(currAddr); 262 | currAddr = currAddr+2; 263 | MakeWord(currAddr); // data type and conversion 264 | dataType = Byte(currAddr); 265 | currAddr = currAddr+2; 266 | MakeDword(currAddr); // axis address 267 | axisAddr = Dword(currAddr); 268 | currAddr = currAddr+4; 269 | MakeDword(currAddr); // data addreess 270 | dataAddr = Dword(currAddr); 271 | currAddr = currAddr+3; 272 | FormatTableAxis(axisAddr, dataLength); 273 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 274 | Print2dTable(axisAddr, dataAddr, dataLength, dataType, 1, 0); 275 | return currAddr; 276 | } 277 | 278 | static Make3dRawTable(currAddr) { 279 | auto axisYAddr, dataYLength, axisXAddr, dataXLength, dataAddr, dataLength, dataAlign, dataType, fMin, fMax, fNum, fNumNext; 280 | fMin = 0 - 66000.1; 281 | fMax = 66000.1; 282 | MakeUnknown(currAddr, 20, DOUNK_SIMPLE); 283 | MakeWord(currAddr); // X length 284 | dataXLength = Word(currAddr); 285 | currAddr = currAddr+2; 286 | MakeWord(currAddr); // Y Length 287 | dataYLength = Word(currAddr); 288 | currAddr = currAddr+2; 289 | MakeDword(currAddr); // X axis address 290 | axisXAddr = Dword(currAddr); 291 | currAddr = currAddr+4; 292 | MakeDword(currAddr); // Y axis address 293 | axisYAddr = Dword(currAddr); 294 | currAddr = currAddr+4; 295 | MakeDword(currAddr); // data address 296 | dataAddr = Dword(currAddr); 297 | currAddr = currAddr+4; 298 | MakeDword(currAddr); // no data conversion 299 | currAddr = currAddr+3; 300 | FormatTableAxis(axisYAddr, dataYLength); 301 | FormatTableAxis(axisXAddr, dataXLength); 302 | dataLength = dataXLength * dataYLength; 303 | if (dataLength > 0x4) { 304 | dataAlign = dataLength % 0x2; 305 | } 306 | else { 307 | if (dataLength%0x4 == 0) dataAlign = 0; 308 | if (dataLength%0x4 == 1) dataAlign = 3; 309 | if (dataLength%0x4 == 2) dataAlign = 2; 310 | if (dataLength%0x4 == 3) dataAlign = 1; 311 | } 312 | if (DfirstB((dataAddr + (dataLength + dataAlign))) != BADADDR) { 313 | dataType = 0x04; 314 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 315 | } 316 | else if (DfirstB(dataAddr + ((dataLength + dataAlign)*2)) != BADADDR) { 317 | dataType = 0x08; 318 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 319 | } 320 | else if (DfirstB(dataAddr + (dataLength*4)) != BADADDR) { 321 | fNum = GetFpNum(dataAddr,4); 322 | fNumNext = GetFpNum(dataAddr+4,4); 323 | if ((fNum >= fMin && fNum <= fMax && fNumNext >= fMin && fNumNext <= fMax) || Dword(dataAddr) == 0) { 324 | dataType = "float"; 325 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 326 | } 327 | else { 328 | dataType = "float"; 329 | FormatTableData(dataAddr, dataLength, 1, 0, dataType); 330 | } 331 | } 332 | Print3dTable(axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, 1, 0); 333 | return currAddr; 334 | } 335 | 336 | static Make3dUintTable(currAddr) { 337 | auto axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, dataM, dataA; 338 | MakeUnknown(currAddr, 28, DOUNK_SIMPLE); 339 | MakeWord(currAddr); // X length 340 | dataXLength = Word(currAddr); 341 | currAddr = currAddr+2; 342 | MakeWord(currAddr); // Y Length 343 | dataYLength = Word(currAddr); 344 | currAddr = currAddr+2; 345 | MakeDword(currAddr); // X axis address 346 | axisXAddr = Dword(currAddr); 347 | currAddr = currAddr+4; 348 | MakeDword(currAddr); // Y axis address 349 | axisYAddr = Dword(currAddr); 350 | currAddr = currAddr+4; 351 | MakeDword(currAddr); // data address 352 | dataAddr = Dword(currAddr); 353 | currAddr = currAddr+4; 354 | MakeDword(currAddr); // data type 355 | dataType = Byte(currAddr); 356 | currAddr = currAddr+4; 357 | MakeFloat(currAddr); // multiplier 358 | dataM = GetFpNum(currAddr,4); 359 | currAddr = currAddr+4; 360 | MakeFloat(currAddr); // additive 361 | dataA = GetFpNum(currAddr,4); 362 | currAddr = currAddr+3; 363 | FormatTableAxis(axisYAddr, dataYLength); 364 | FormatTableAxis(axisXAddr, dataXLength); 365 | FormatTableData(dataAddr, dataYLength*dataXLength, dataM, dataA, dataType); 366 | Print3dTable(axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, dataM, dataA); 367 | return currAddr; 368 | } 369 | 370 | static Make3dUintTableNoConv(currAddr) { 371 | auto axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, dataM, dataA; 372 | MakeUnknown(currAddr, 20, DOUNK_SIMPLE); 373 | MakeWord(currAddr); // X length 374 | dataXLength = Word(currAddr); 375 | currAddr = currAddr+2; 376 | MakeWord(currAddr); // Y Length 377 | dataYLength = Word(currAddr); 378 | currAddr = currAddr+2; 379 | MakeDword(currAddr); // X axis address 380 | axisXAddr = Dword(currAddr); 381 | currAddr = currAddr+4; 382 | MakeDword(currAddr); // Y axis address 383 | axisYAddr = Dword(currAddr); 384 | currAddr = currAddr+4; 385 | MakeDword(currAddr); // data address 386 | dataAddr = Dword(currAddr); 387 | currAddr = currAddr+4; 388 | MakeDword(currAddr); // data type 389 | dataType = Byte(currAddr); 390 | currAddr = currAddr+3; 391 | FormatTableAxis(axisYAddr, dataYLength); 392 | FormatTableAxis(axisXAddr, dataXLength); 393 | FormatTableData(dataAddr, dataYLength*dataXLength, 1, 0, dataType); 394 | Print3dTable(axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, 1, 0); 395 | return currAddr; 396 | } 397 | 398 | static FormatTableAxis(axisAddr, myLength) { 399 | auto i; 400 | for ( i=0; i < myLength*4; i=i+4 ) { 401 | MakeUnknown(axisAddr+i, 4, DOUNK_SIMPLE); 402 | MakeFloat(axisAddr+i); 403 | } 404 | } 405 | 406 | static FormatTableData(dataAddr, dataLength, dataM, dataA, dataType) { 407 | auto i, x, da, arrayId, msg; 408 | arrayId = GetArrayId("myGlobals"); 409 | da = dataAddr; 410 | if ((dataType == 0x04) || (dataType == 0x0C)) { // byte data size 411 | x = 1; 412 | for ( i=0; i < dataLength*x; i=i+x ) { 413 | MakeUnknown(dataAddr+i, x, DOUNK_SIMPLE); 414 | MakeByte(dataAddr+i); 415 | if ((dataType == 0x0C) && 416 | ((Byte(dataAddr+i) & 0x80) == 0x80)) { // is most sig bit set? 417 | MakeRptCmt((dataAddr+i), "= " + form("%1.3f",(float((Byte(dataAddr+i)-0x100)) * dataM + dataA))); 418 | } 419 | else { 420 | MakeRptCmt((dataAddr+i), "= " + form("%1.3f",(float(Byte(dataAddr+i)) * dataM + dataA))); 421 | } 422 | } 423 | SetArrayString(arrayId, 1, "formatted 8bit data at 0x" + ltoa(da, 16) + "\n"); 424 | } 425 | if ((dataType == 0x08) || (dataType == 0x10)) { // word data size 426 | x = 2; 427 | for ( i=0; i < dataLength*x; i=i+x ) { 428 | MakeUnknown(dataAddr+i, x, DOUNK_SIMPLE); 429 | MakeWord(dataAddr+i); 430 | if ((dataType == 0x10) && 431 | ((Word(dataAddr+i) & 0x8000) == 0x8000)) { // is most sig bit set? 432 | MakeRptCmt((dataAddr+i), "= " + form("%1.3f",(float((Word(dataAddr+i)-0x10000)) * dataM + dataA))); 433 | } 434 | else { 435 | MakeRptCmt((dataAddr+i), "= " + form("%1.3f",(float(Word(dataAddr+i)) * dataM + dataA))); 436 | } 437 | } 438 | SetArrayString(arrayId, 1, "formatted 16bit data at 0x" + ltoa(da, 16) + "\n"); 439 | } 440 | if (dataType == "dword") { 441 | x = 4; 442 | for ( i=0; i < dataLength*x; i=i+x ) { 443 | MakeUnknown(dataAddr+i, x, DOUNK_SIMPLE); 444 | MakeDword(dataAddr+i); 445 | MakeRptCmt((dataAddr+i), "= " + form("%1.3f",(float(Dword(dataAddr+i)) * dataM + dataA))); 446 | } 447 | SetArrayString(arrayId, 1, "formatted dword data at 0x" + ltoa(da, 16) + "\n"); 448 | } 449 | if (dataType == "float") { 450 | x = 4; 451 | for ( i=0; i < dataLength*x; i=i+x ) { 452 | MakeUnknown(dataAddr+i, x, DOUNK_SIMPLE); 453 | MakeFloat(dataAddr+i); 454 | MakeRptCmt((dataAddr+i), ""); 455 | } 456 | SetArrayString(arrayId, 1, "formatted float data at 0x" + ltoa(da, 16) + "\n"); 457 | } 458 | } 459 | 460 | static Print2dTable(axisAddr, dataAddr, dataLength, dataType, dataM, dataA) { 461 | auto arrayId, dataStr; 462 | arrayId = GetArrayId("myGlobals"); 463 | if (dataType == "raw") { 464 | dataType = "uint8"; 465 | dataStr = "unkn data type"; 466 | } 467 | if (dataType == "dword") { 468 | dataType = "int32"; 469 | dataStr = "int32"; 470 | } 471 | if (dataType == "float") { 472 | dataStr = dataType; 473 | } 474 | if (dataType == 0x04) { 475 | dataType = "uint8"; 476 | dataStr = dataType; 477 | } 478 | if (dataType == 0x08) { 479 | dataType = "uint16"; 480 | dataStr = dataType; 481 | } 482 | if (dataType == 0x0C) { 483 | dataType = "int8"; 484 | dataStr = dataType; 485 | } 486 | if (dataType == 0x10) { 487 | dataType = "int16"; 488 | dataStr = dataType; 489 | } 490 | if (dataType == "") { 491 | dataType = "uint8"; 492 | dataStr = "unkn data type"; 493 | } 494 | dataLength = form("%d", dataLength); 495 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 496 | "
\n"); 497 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 498 | "\t\n"); 499 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 500 | "\t
\n"); 501 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 502 | "\t\t\n"); 503 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 504 | "\t
\n\tno description\n
\n"); 505 | } 506 | 507 | static Print3dTable(axisYAddr, dataYLength, axisXAddr, dataAddr, dataXLength, dataType, dataM, dataA) { 508 | auto arrayId, dataStr; 509 | arrayId = GetArrayId("myGlobals"); 510 | if (dataType == "raw") { 511 | dataType = "uint8"; 512 | dataStr = "unkn data type"; 513 | } 514 | if (dataType == "dword") { 515 | dataType = "int32"; 516 | dataStr = "int32"; 517 | } 518 | if (dataType == "float") { 519 | dataStr = dataType; 520 | } 521 | if (dataType == 0x04) { 522 | dataType = "uint8"; 523 | dataStr = dataType; 524 | } 525 | if (dataType == 0x08) { 526 | dataType = "uint16"; 527 | dataStr = dataType; 528 | } 529 | if (dataType == 0x0C) { 530 | dataType = "int8"; 531 | dataStr = dataType; 532 | } 533 | if (dataType == 0x10) { 534 | dataType = "int16"; 535 | dataStr = dataType; 536 | } 537 | if (dataType == "") { 538 | dataType = "uint8"; 539 | dataStr = "unkn data type"; 540 | } 541 | dataYLength = form("%d", dataYLength); 542 | dataXLength = form("%d", dataXLength); 543 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 544 | "\n"); 545 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 546 | "\t\n"); 547 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 548 | "\t
\n"); 549 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 550 | "\t\t\n\t
\n"); 551 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 552 | "\t\n"); 553 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 554 | "\t\t\n"); 555 | writestr(GetArrayElement(AR_LONG, arrayId, 0), 556 | "\t
\n\tno description\n\n"); 557 | } 558 | 559 | static CreateExpression(dataM, dataA) { 560 | auto fromByte, toByte, negate; 561 | negate = 0.0 - 1.0; 562 | if (form("%1.8f",dataM) == "1.0" && form("%1.8f",dataA) == "0.0") { 563 | fromByte = "expression=\"x"; 564 | toByte = "to_byte=\"x"; 565 | } 566 | else if (form("%1.8f",dataM) == "1.0" && dataA < 0.0) { 567 | fromByte = "expression=\"x" + form("%1.8f",dataA); 568 | toByte = "to_byte=\"x+" + form("%1.8f",(dataA * negate)); 569 | } 570 | else if (form("%1.8f",dataM) != "1.0" && dataA < 0.0) { 571 | fromByte = "expression=\"(x*" + form("%1.8f",dataM) + ")" + form("%1.8f",dataA); 572 | toByte = "to_byte=\"(x+" + form("%1.8f",(dataA * negate)) + ")/" + form("%1.8f",dataM); 573 | } 574 | else if (form("%1.8f",dataM) != "1.0" && form("%1.8f",dataA) == "0.0") { 575 | fromByte = "expression=\"x*" + form("%1.8f",dataM); 576 | toByte = "to_byte=\"x/" + form("%1.8f",dataM); 577 | } 578 | else { 579 | fromByte = "expression=\"(x*" + form("%1.8f",dataM) + ")+" + form("%1.8f",dataA); 580 | toByte = "to_byte=\"(x-" + form("%1.8f",dataA) + ")/" + form("%1.8f",dataM); 581 | } 582 | return fromByte + "\" " + toByte; 583 | } 584 | -------------------------------------------------------------------------------- /src/IDA/Format_SH_VectorTable.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 2 9 | * Date : 2014-01-11 10 | * 11 | * This script is used to format and name the SH705x Vector Table. 12 | * To use the script place the cursor at the Vector Table base address. 13 | * Typically SH7055 this is at 0x0007FC50 14 | * Typically SH7058 this is at 0x000FFC50 15 | * Typically SH72531 this is at 0x0013F600 16 | * 17 | */ 18 | 19 | #include 20 | 21 | static main() { 22 | auto vnArray, PC, SP, currAddr, ync, vbAddr, i, a, procName, subName; 23 | ync = AskYN(-1, "Format, mark and name the Vector Table?"); // -1:cancel,0-no,1-ok 24 | if (ync != 1) { 25 | Message("Aborting ROM formating at user request\n"); 26 | return 0; 27 | } 28 | 29 | vnArray = GetArrayId("VNARRAY"); 30 | DeleteArray(vnArray); 31 | procName = GetProcessorName(); 32 | if (procName == "SH4B") { 33 | CreateVectorNameArraySH4B(); 34 | Message("Formating for SH4B processor\n"); 35 | } 36 | else if (procName == "SH2A") { 37 | CreateVectorNameArraySH2A(); 38 | Message("Formating for SH2A processor\n"); 39 | } 40 | else { 41 | Message(form("Unknown processor: %s, format cancelled\n", procName)); 42 | return 0; 43 | } 44 | vnArray = GetArrayId("VNARRAY"); 45 | 46 | vbAddr = here; 47 | MakeName(here, "VectorAddr_Base"); 48 | for (i = GetFirstIndex(AR_STR, vnArray); i != BADADDR; i = GetNextIndex(AR_STR, vnArray, i)) { 49 | currAddr = vbAddr + (4 * i); 50 | a = GetArrayElement(AR_STR, vnArray, i); 51 | MakeUnknown(currAddr, 4, DOUNK_SIMPLE); 52 | MakeDword(currAddr); 53 | subName = substr(GetTrueName(currAddr), 0, 3); 54 | if (subName == "sub" || subName == "loc" || subName == "") MakeName(currAddr, form("Ptr_%s",a)); 55 | MakeUnknown(Dword(currAddr), 4, DOUNK_SIMPLE); 56 | MakeFunction(Dword(currAddr), BADADDR); 57 | subName = substr(GetTrueName(Dword(currAddr)), 0, 3); 58 | if (subName == "sub" || subName == "loc" || subName == "") MakeName(Dword(currAddr), a); 59 | } 60 | MakeDword(0x0); 61 | PC = Dword(0x0); 62 | MakeRptCmt(0x0, form("PwrOn RESET Initial PC = 0x%X", PC)); 63 | MakeName(0x0, "PwrOn_RESET"); 64 | MakeName(PC, "IntrRESET"); 65 | MakeDword(0x4); 66 | SP = Dword(0x4); 67 | MakeRptCmt(0x4, form("PwrOn RESET Initial SP = 0x%X", SP)); 68 | MakeName(0x4, "Initial_SP"); 69 | MakeDword(SP); 70 | MakeName(SP, "STACKBASE"); 71 | if (procName == "SH4B") { 72 | PC = Dword(0x8); 73 | MakeDword(0x8); 74 | MakeRptCmt(0x8, form("Manual RESET Initial PC = 0x%X", PC)); 75 | MakeName(0x8, "Manual_RESET"); 76 | MakeDword(0xC); 77 | SP = Dword(0xC); 78 | MakeRptCmt(0xC, form("Manual RESET Initial SP = 0x%X", SP)); 79 | MakeFunction(PC, BADADDR); 80 | for (i = 0x10; i < 0x40; i = i + 4) { 81 | MakeUnknown(i, 4, DOUNK_SIMPLE); 82 | MakeDword(i); 83 | } 84 | } 85 | else if (procName == "SH2A") { 86 | for (i = 0x08; i < 0x60; i = i + 4) { 87 | MakeUnknown(i, 4, DOUNK_SIMPLE); 88 | MakeDword(i); 89 | } 90 | } 91 | } 92 | 93 | static GetProcessorName(void) { 94 | auto i, name, chr; 95 | 96 | name = ""; 97 | for (i = 0; i < 8; i++) { 98 | chr = GetCharPrm(INF_PROCNAME + i); 99 | if (chr == 0) break; 100 | name = name + chr; 101 | } 102 | return name; 103 | } 104 | 105 | static CreateVectorNameArraySH4B() { 106 | auto vnArray; 107 | vnArray = CreateArray("VNARRAY"); 108 | SetArrayString(vnArray, 0, "IntrPwrOn_RESET"); 109 | SetArrayString(vnArray, 4, "Intr_Gnrl_Illegal_Inst"); 110 | SetArrayString(vnArray, 5, "Intr_Reserved0"); 111 | SetArrayString(vnArray, 6, "Intr_Slot_llegal_Inst"); 112 | SetArrayString(vnArray, 7, "Intr_Reserved1"); 113 | SetArrayString(vnArray, 8, "Intr_Reserved2"); 114 | SetArrayString(vnArray, 9, "Intr_CPU"); 115 | SetArrayString(vnArray, 10, "Intr_DMAC"); 116 | SetArrayString(vnArray, 11, "Intr_NMI_Priority16"); 117 | SetArrayString(vnArray, 12, "Intr_UBC_Priority15"); 118 | SetArrayString(vnArray, 14, "Intr_HUDI_Priority15"); 119 | SetArrayString(vnArray, 64, "Intr_IRQ0_IPRA_b15_12"); 120 | SetArrayString(vnArray, 65, "Intr_IRQ1_IPRA_b11_8"); 121 | SetArrayString(vnArray, 66, "Intr_IRQ2_IPRA_b7_4"); 122 | SetArrayString(vnArray, 67, "Intr_IRQ3_IPRA_b3_0"); 123 | SetArrayString(vnArray, 68, "Intr_IRQ4_IPRB_b15_12"); 124 | SetArrayString(vnArray, 69, "Intr_IRQ5_IPRB_b11_8"); 125 | SetArrayString(vnArray, 70, "Intr_IRQ6_IPRB_b7_4"); 126 | SetArrayString(vnArray, 71, "Intr_IRQ7_IPRB_b3_0"); 127 | SetArrayString(vnArray, 72, "Intr_DMAC0_DEI0_IPRC_b15_12_p1"); 128 | SetArrayString(vnArray, 74, "Intr_DMAC1_DEI1_IPRC_b15_12_p2"); 129 | SetArrayString(vnArray, 76, "Intr_DMAC2_DEI2_IPRC_b11_8_p1"); 130 | SetArrayString(vnArray, 78, "Intr_DMAC3_DEI3_IPRC_b11_8_p2"); 131 | SetArrayString(vnArray, 80, "Intr_ATU01_ITV1_IPRC_b7_4"); 132 | SetArrayString(vnArray, 81, "Intr_ATU01_ITV2A_IPRC_b7_4"); 133 | SetArrayString(vnArray, 82, "Intr_ATU01_ITV2B_IPRC_b7_4"); 134 | SetArrayString(vnArray, 84, "Intr_ATU02_ICI0A_IPRC_b3_0_p1"); 135 | SetArrayString(vnArray, 86, "Intr_ATU02_ICI0B_IPRC_b3_0_p2"); 136 | SetArrayString(vnArray, 88, "Intr_ATU03_ICI0C_IPRD_b15_12_p1"); 137 | SetArrayString(vnArray, 90, "Intr_ATU03_ICI0D_IPRD_b15_12_p2"); 138 | SetArrayString(vnArray, 92, "Intr_ATU04_OVI0_IPRD_b11_8"); 139 | SetArrayString(vnArray, 96, "Intr_ATU11_IMI1A_CMI1_IPRD_b7_4_p1"); 140 | SetArrayString(vnArray, 97, "Intr_ATU11_IMI1B_IPRD_b7_4_p2"); 141 | SetArrayString(vnArray, 98, "Intr_ATU11_IMI1C_IPRD_b7_4_p3"); 142 | SetArrayString(vnArray, 99, "Intr_ATU11_IMI1D_IPRD_b7_4_p4"); 143 | SetArrayString(vnArray, 100, "Intr_ATU12_IMI1E_IPRD_b3_0_p1"); 144 | SetArrayString(vnArray, 101, "Intr_ATU12_IMI1F_IPRD_b3_0_p2"); 145 | SetArrayString(vnArray, 102, "Intr_ATU12_IMI1G_IPRD_b3_0_p3"); 146 | SetArrayString(vnArray, 103, "Intr_ATU12_IMI1H_IPRD_b3_0_p4"); 147 | SetArrayString(vnArray, 104, "Intr_ATU13_OVI1A_OVI1B_IPRE_b15_12"); 148 | SetArrayString(vnArray, 108, "Intr_ATU21_IMI2A_CMI2A_IPRE_b11_8_p1"); 149 | SetArrayString(vnArray, 109, "Intr_ATU21_IMI2B_CMI2B_IPRE_b11_8_p2"); 150 | SetArrayString(vnArray, 110, "Intr_ATU21_IMI2C_CMI2C_IPRE_b11_8_p3"); 151 | SetArrayString(vnArray, 111, "Intr_ATU21_IMI2D_CMI2D_IPRE_b11_8_p4"); 152 | SetArrayString(vnArray, 112, "Intr_ATU22_IMI2E_CMI2E_IPRE_b7_4_p1"); 153 | SetArrayString(vnArray, 113, "Intr_ATU22_IMI2F_CMI2F_IPRE_b7_4_p2"); 154 | SetArrayString(vnArray, 114, "Intr_ATU22_IMI2G_CMI2G_IPRE_b7_4_p3"); 155 | SetArrayString(vnArray, 115, "Intr_ATU22_IMI2H_CMI2H_IPRE_b7_4_p4"); 156 | SetArrayString(vnArray, 116, "Intr_ATU23_OVI2A_OVI2B_IPRE_b3_0"); 157 | SetArrayString(vnArray, 120, "Intr_ATU31_IMI3A_IPRF_b15_12_p1"); 158 | SetArrayString(vnArray, 121, "Intr_ATU31_IMI3B_IPRF_b15_12_p2"); 159 | SetArrayString(vnArray, 122, "Intr_ATU31_IMI3C_IPRF_b15_12_p3"); 160 | SetArrayString(vnArray, 123, "Intr_ATU31_IMI3D_IPRF_b15_12_p4"); 161 | SetArrayString(vnArray, 124, "Intr_ATU32_OVI3_IPRF_b11_8"); 162 | SetArrayString(vnArray, 128, "Intr_ATU41_IMI4A_IPRF_b7_4_p1"); 163 | SetArrayString(vnArray, 129, "Intr_ATU41_IMI4B_IPRF_b7_4_p2"); 164 | SetArrayString(vnArray, 130, "Intr_ATU41_IMI4C_IPRF_b7_4_p3"); 165 | SetArrayString(vnArray, 131, "Intr_ATU41_IMI4D_IPRF_b7_4_p4"); 166 | SetArrayString(vnArray, 132, "Intr_ATU42_OVI4_IPRF_b3_0"); 167 | SetArrayString(vnArray, 136, "Intr_ATU51_IMI5A_IPRG_b15_12_p1"); 168 | SetArrayString(vnArray, 137, "Intr_ATU51_IMI5B_IPRG_b15_12_p2"); 169 | SetArrayString(vnArray, 138, "Intr_ATU51_IMI5C_IPRG_b15_12_p3"); 170 | SetArrayString(vnArray, 139, "Intr_ATU51_IMI5D_IPRG_b15_12_p4"); 171 | SetArrayString(vnArray, 140, "Intr_ATU52_OVI5_IPRG_b11_8"); 172 | SetArrayString(vnArray, 144, "Intr_ATU6_CMI6A_IPRG_b7_4_p1"); 173 | SetArrayString(vnArray, 145, "Intr_ATU6_CMI6B_IPRG_b7_4_p2"); 174 | SetArrayString(vnArray, 146, "Intr_ATU6_CMI6C_IPRG_b7_4_p3"); 175 | SetArrayString(vnArray, 147, "Intr_ATU6_CMI6D_IPRG_b7_4_p4"); 176 | SetArrayString(vnArray, 148, "Intr_ATU7_CMI7A_IPRG_b3_0_p1"); 177 | SetArrayString(vnArray, 149, "Intr_ATU7_CMI7B_IPRG_b3_0_p2"); 178 | SetArrayString(vnArray, 150, "Intr_ATU7_CMI7C_IPRG_b3_0_p3"); 179 | SetArrayString(vnArray, 151, "Intr_ATU7_CMI7D_IPRG_b3_0_p4"); 180 | SetArrayString(vnArray, 152, "Intr_ATU81_OSI8A_IPRH_b15_12_p1"); 181 | SetArrayString(vnArray, 153, "Intr_ATU81_OSI8B_IPRH_b15_12_p2"); 182 | SetArrayString(vnArray, 154, "Intr_ATU81_OSI8C_IPRH_b15_12_p3"); 183 | SetArrayString(vnArray, 155, "Intr_ATU81_OSI8D_IPRH_b15_12_p4"); 184 | SetArrayString(vnArray, 156, "Intr_ATU82_OSI8E_IPRH_b11_8_p1"); 185 | SetArrayString(vnArray, 157, "Intr_ATU82_OSI8F_IPRH_b11_8_p2"); 186 | SetArrayString(vnArray, 158, "Intr_ATU82_OSI8G_IPRH_b11_8_p3"); 187 | SetArrayString(vnArray, 159, "Intr_ATU82_OSI8H_IPRH_b11_8_p4"); 188 | SetArrayString(vnArray, 160, "Intr_ATU83_OSI8I_IPRH_b7_4_p1"); 189 | SetArrayString(vnArray, 161, "Intr_ATU83_OSI8J_IPRH_b7_4_p2"); 190 | SetArrayString(vnArray, 162, "Intr_ATU83_OSI8K_IPRH_b7_4_p3"); 191 | SetArrayString(vnArray, 163, "Intr_ATU83_OSI8L_IPRH_b7_4_p4"); 192 | SetArrayString(vnArray, 164, "Intr_ATU84_OSI8M_IPRH_b3_0_p1"); 193 | SetArrayString(vnArray, 165, "Intr_ATU84_OSI8N_IPRH_b3_0_p2"); 194 | SetArrayString(vnArray, 166, "Intr_ATU84_OSI8O_IPRH_b3_0_p3"); 195 | SetArrayString(vnArray, 167, "Intr_ATU84_OSI8P_IPRH_b3_0_p4"); 196 | SetArrayString(vnArray, 168, "Intr_ATU91_CMI9A_IPRI_b15_12_p1"); 197 | SetArrayString(vnArray, 169, "Intr_ATU91_CMI9B_IPRI_b15_12_p2"); 198 | SetArrayString(vnArray, 170, "Intr_ATU91_CMI9C_IPRI_b15_12_p3"); 199 | SetArrayString(vnArray, 171, "Intr_ATU91_CMI9D_IPRI_b15_12_p4"); 200 | SetArrayString(vnArray, 172, "Intr_ATU92_CMI9E_IPRI_b11_8_p1"); 201 | SetArrayString(vnArray, 174, "Intr_ATU92_CMI9F_IPRI_b11_8_p2"); 202 | SetArrayString(vnArray, 176, "Intr_ATU101_CMI10A_IPRI_b7_4_p1"); 203 | SetArrayString(vnArray, 178, "Intr_ATU101_CMI10B_IPRI_b7_4_p2"); 204 | SetArrayString(vnArray, 180, "Intr_ATU102_ICI10A_CMI10G_IPRI_b3_0"); 205 | SetArrayString(vnArray, 184, "Intr_ATU11_IMI11A_IPRJ_b15_12_p1"); 206 | SetArrayString(vnArray, 186, "Intr_ATU11_IMI11B_IPRJ_b15_12_p2"); 207 | SetArrayString(vnArray, 187, "Intr_ATU11_OVI11_IPRJ_b15_12_p3"); 208 | SetArrayString(vnArray, 188, "Intr_CMT0_CMTI0_IPRJ_b11_8_p1"); 209 | SetArrayString(vnArray, 189, "Intr_MTAD0_ADT0_IPRJ_b11_8_p2"); 210 | SetArrayString(vnArray, 190, "Intr_AD0_ADI0_IPRJ_b11_8_p3"); 211 | SetArrayString(vnArray, 192, "Intr_CMT1_CMTI1_IPRJ_b7_4_p1"); 212 | SetArrayString(vnArray, 193, "Intr_MTAD1_ADT1_IPRJ_b7_4_p2"); 213 | SetArrayString(vnArray, 194, "Intr_AD1_ADI1_IPRJ_b7_4_p3"); 214 | SetArrayString(vnArray, 196, "Intr_AD2_ADI2_IPRJ_b3_0"); 215 | SetArrayString(vnArray, 200, "Intr_SCI0_ERI0_IPRK_b15_12_p1"); 216 | SetArrayString(vnArray, 201, "Intr_SCI0_RXI0_IPRK_b15_12_p2"); 217 | SetArrayString(vnArray, 202, "Intr_SCI0_TXI0_IPRK_b15_12_p3"); 218 | SetArrayString(vnArray, 203, "Intr_SCI0_TEI0_IPRK_b15_12_p4"); 219 | SetArrayString(vnArray, 204, "Intr_SCI1_ERI1_IPRK_b11_8_p1"); 220 | SetArrayString(vnArray, 205, "Intr_SCI1_RXI1_IPRK_b11_8_p2"); 221 | SetArrayString(vnArray, 206, "Intr_SCI1_TXI1_IPRK_b11_8_p3"); 222 | SetArrayString(vnArray, 207, "Intr_SCI1_TEI1_IPRK_b11_8_p4"); 223 | SetArrayString(vnArray, 208, "Intr_SCI2_ERI2_IPRK_b7_4_p1"); 224 | SetArrayString(vnArray, 209, "Intr_SCI2_RXI2_IPRK_b7_4_p2"); 225 | SetArrayString(vnArray, 210, "Intr_SCI2_TXI2_IPRK_b7_4_p3"); 226 | SetArrayString(vnArray, 211, "Intr_SCI2_TEI2_IPRK_b7_4_p4"); 227 | SetArrayString(vnArray, 212, "Intr_SCI3_ERI3_IPRK_b3_0_p1"); 228 | SetArrayString(vnArray, 213, "Intr_SCI3_RXI3_IPRK_b3_0_p2"); 229 | SetArrayString(vnArray, 214, "Intr_SCI3_TXI3_IPRK_b3_0_p3"); 230 | SetArrayString(vnArray, 215, "Intr_SCI3_TEI3_IPRK_b3_0_p4"); 231 | SetArrayString(vnArray, 216, "Intr_SCI4_ERI4_IPRL_b15_12_p1"); 232 | SetArrayString(vnArray, 217, "Intr_SCI4_RXI4_IPRL_b15_12_p2"); 233 | SetArrayString(vnArray, 218, "Intr_SCI4_TXI4_IPRL_b15_12_p3"); 234 | SetArrayString(vnArray, 219, "Intr_SCI4_TEI4_IPRL_b15_12_p4"); 235 | SetArrayString(vnArray, 220, "Intr_HCAN0_ERS0_IPRL_b11_8_p1"); 236 | SetArrayString(vnArray, 221, "Intr_HCAN0_OVR0_IPRL_b11_8_p2"); 237 | SetArrayString(vnArray, 222, "Intr_HCAN0_RM0_IPRL_b11_8_p3"); 238 | SetArrayString(vnArray, 223, "Intr_HCAN0_SLE0_IPRL_b11_8_p4"); 239 | SetArrayString(vnArray, 224, "Intr_WDT_ITI_IPRL_b7_4"); 240 | SetArrayString(vnArray, 228, "Intr_HCAN1_ERS1_IPRL_b3_0_p1"); 241 | SetArrayString(vnArray, 229, "Intr_HCAN1_OVR1_IPRL_b3_0_p2"); 242 | SetArrayString(vnArray, 230, "Intr_HCAN1_RM1_IPRL_b3_0_p3"); 243 | SetArrayString(vnArray, 231, "Intr_HCAN1_SLE1_IPRL_b3_0_p4"); 244 | } 245 | 246 | static CreateVectorNameArraySH2A() { 247 | auto vnArray; 248 | vnArray = CreateArray("VNARRAY"); 249 | SetArrayString(vnArray, 0, "IntrPwrOn_RESET"); 250 | SetArrayString(vnArray, 2, "Intr_Reserved2"); 251 | SetArrayString(vnArray, 3, "Intr_Reserved3"); 252 | SetArrayString(vnArray, 4, "Intr_Gnrl_Illegal_Inst"); 253 | SetArrayString(vnArray, 5, "Intr_Reserved5"); 254 | SetArrayString(vnArray, 6, "Intr_Slot_llegal_Inst"); 255 | SetArrayString(vnArray, 7, "Intr_Reserved7"); 256 | SetArrayString(vnArray, 8, "Intr_Reserved8"); 257 | SetArrayString(vnArray, 9, "Intr_Address_Error"); 258 | SetArrayString(vnArray, 10, "Intr_DMAC_Error"); 259 | SetArrayString(vnArray, 11, "Intr_NMI"); 260 | SetArrayString(vnArray, 12, "Intr_UBC"); 261 | SetArrayString(vnArray, 13, "Intr_FPU_exception"); 262 | SetArrayString(vnArray, 14, "Intr_Reserved14"); 263 | SetArrayString(vnArray, 15, "Intr_Bank_overflow"); 264 | SetArrayString(vnArray, 16, "Intr_Bank_underflow"); 265 | SetArrayString(vnArray, 17, "Intr_Integer_Division_by_zero"); 266 | SetArrayString(vnArray, 18, "Intr_Integer_Division_overflow"); 267 | SetArrayString(vnArray, 19, "Intr_Reserved19"); 268 | SetArrayString(vnArray, 20, "Intr_Reserved20"); 269 | SetArrayString(vnArray, 21, "Intr_Reserved21"); 270 | SetArrayString(vnArray, 22, "Intr_Reserved22"); 271 | SetArrayString(vnArray, 23, "Intr_Reserved23"); 272 | SetArrayString(vnArray, 24, "Intr_Reserved24"); 273 | SetArrayString(vnArray, 25, "Intr_Reserved25"); 274 | SetArrayString(vnArray, 26, "Intr_Reserved26"); 275 | SetArrayString(vnArray, 27, "Intr_Reserved27"); 276 | SetArrayString(vnArray, 28, "Intr_Reserved28"); 277 | SetArrayString(vnArray, 29, "Intr_Reserved29"); 278 | SetArrayString(vnArray, 30, "Intr_Reserved30"); 279 | SetArrayString(vnArray, 31, "Intr_Reserved31"); 280 | SetArrayString(vnArray, 32, "Intr_Trap_instruction_uv32"); 281 | SetArrayString(vnArray, 33, "Intr_Trap_instruction_uv33"); 282 | SetArrayString(vnArray, 34, "Intr_Trap_instruction_uv34"); 283 | SetArrayString(vnArray, 35, "Intr_Trap_instruction_uv35"); 284 | SetArrayString(vnArray, 36, "Intr_Trap_instruction_uv36"); 285 | SetArrayString(vnArray, 37, "Intr_Trap_instruction_uv37"); 286 | SetArrayString(vnArray, 38, "Intr_Trap_instruction_uv38"); 287 | SetArrayString(vnArray, 39, "Intr_Trap_instruction_uv39"); 288 | SetArrayString(vnArray, 40, "Intr_Trap_instruction_uv40"); 289 | SetArrayString(vnArray, 41, "Intr_Trap_instruction_uv41"); 290 | SetArrayString(vnArray, 42, "Intr_Trap_instruction_uv42"); 291 | SetArrayString(vnArray, 43, "Intr_Trap_instruction_uv43"); 292 | SetArrayString(vnArray, 44, "Intr_Trap_instruction_uv44"); 293 | SetArrayString(vnArray, 45, "Intr_Trap_instruction_uv45"); 294 | SetArrayString(vnArray, 46, "Intr_Trap_instruction_uv46"); 295 | SetArrayString(vnArray, 47, "Intr_Trap_instruction_uv47"); 296 | SetArrayString(vnArray, 48, "Intr_Trap_instruction_uv48"); 297 | SetArrayString(vnArray, 49, "Intr_Trap_instruction_uv49"); 298 | SetArrayString(vnArray, 50, "Intr_Trap_instruction_uv50"); 299 | SetArrayString(vnArray, 51, "Intr_Trap_instruction_uv51"); 300 | SetArrayString(vnArray, 52, "Intr_Trap_instruction_uv52"); 301 | SetArrayString(vnArray, 53, "Intr_Trap_instruction_uv53"); 302 | SetArrayString(vnArray, 54, "Intr_Trap_instruction_uv54"); 303 | SetArrayString(vnArray, 55, "Intr_Trap_instruction_uv55"); 304 | SetArrayString(vnArray, 56, "Intr_Trap_instruction_uv56"); 305 | SetArrayString(vnArray, 57, "Intr_Trap_instruction_uv57"); 306 | SetArrayString(vnArray, 58, "Intr_Trap_instruction_uv58"); 307 | SetArrayString(vnArray, 59, "Intr_Trap_instruction_uv59"); 308 | SetArrayString(vnArray, 60, "Intr_Trap_instruction_uv60"); 309 | SetArrayString(vnArray, 61, "Intr_Trap_instruction_uv61"); 310 | SetArrayString(vnArray, 62, "Intr_Trap_instruction_uv62"); 311 | SetArrayString(vnArray, 63, "Intr_Trap_instruction_uv63"); 312 | SetArrayString(vnArray, 64, "Intr_IRQ0_IPR01_b15_12"); 313 | SetArrayString(vnArray, 65, "Intr_IRQ1_IPR01_b11_8"); 314 | SetArrayString(vnArray, 66, "Intr_IRQ2_IPR01_b7_4"); 315 | SetArrayString(vnArray, 67, "Intr_IRQ3_IPR01_b3_0"); 316 | SetArrayString(vnArray, 79, "Intr_RAME"); 317 | SetArrayString(vnArray, 82, "Intr_FIFE"); 318 | SetArrayString(vnArray, 93, "Intr_SINT15"); 319 | SetArrayString(vnArray, 94, "Intr_SINT14"); 320 | SetArrayString(vnArray, 95, "Intr_SINT13"); 321 | SetArrayString(vnArray, 96, "Intr_SINT12"); 322 | SetArrayString(vnArray, 97, "Intr_SINT11"); 323 | SetArrayString(vnArray, 98, "Intr_SINT10"); 324 | SetArrayString(vnArray, 99, "Intr_SINT9"); 325 | SetArrayString(vnArray, 100, "Intr_SINT8"); 326 | SetArrayString(vnArray, 101, "Intr_SINT7"); 327 | SetArrayString(vnArray, 102, "Intr_SINT6"); 328 | SetArrayString(vnArray, 105, "Intr_SINT3"); 329 | SetArrayString(vnArray, 106, "Intr_SINT2"); 330 | SetArrayString(vnArray, 107, "Intr_SINT1"); 331 | SetArrayString(vnArray, 108, "Intr_DMAC0_DEI0_IPR03_b15_12_p1"); 332 | SetArrayString(vnArray, 109, "Intr_DMAC0_HEI0_p2"); 333 | SetArrayString(vnArray, 112, "Intr_DMAC1_DEI1_IPR03_b11_8_p1"); 334 | SetArrayString(vnArray, 113, "Intr_DMAC1_HEI1_p2"); 335 | SetArrayString(vnArray, 116, "Intr_DMAC2_DEI2_IPR03_b7_4_p1"); 336 | SetArrayString(vnArray, 117, "Intr_DMAC2_HEI2_p2"); 337 | SetArrayString(vnArray, 120, "Intr_DMAC3_DEI3_IPR03_b3_0_p1"); 338 | SetArrayString(vnArray, 121, "Intr_DMAC3_HEI3_p2"); 339 | SetArrayString(vnArray, 124, "Intr_DMAC4_DEI4_IPR04_b15_12_p1"); 340 | SetArrayString(vnArray, 125, "Intr_DMAC4_HEI4_p2"); 341 | SetArrayString(vnArray, 128, "Intr_DMAC5_DEI5_IPR04_b11_8_p1"); 342 | SetArrayString(vnArray, 129, "Intr_DMAC5_HEI5_p2"); 343 | SetArrayString(vnArray, 132, "Intr_DMAC6_DEI6_IPR04_b7_4_p1"); 344 | SetArrayString(vnArray, 133, "Intr_DMAC6_HEI6_p2"); 345 | SetArrayString(vnArray, 136, "Intr_DMAC7_DEI7_IPR04_b3_0_p1"); 346 | SetArrayString(vnArray, 137, "Intr_DMAC7_HEI7_p2"); 347 | SetArrayString(vnArray, 140, "Intr_CMI0_IPR05_b15_12"); 348 | SetArrayString(vnArray, 144, "Intr_CMI1_IPR05_b11_8"); 349 | SetArrayString(vnArray, 148, "Intr_ITI_IPR05_b3_0"); 350 | SetArrayString(vnArray, 152, "Intr_ICIA0_IPR06_b15_12_p1"); 351 | SetArrayString(vnArray, 153, "Intr_ICIA1_p2"); 352 | SetArrayString(vnArray, 156, "Intr_ICIA2_IPR06_b11_8_p1"); 353 | SetArrayString(vnArray, 157, "Intr_ICIA3_p2"); 354 | SetArrayString(vnArray, 164, "Intr_OVIA_IPR06_b3_0_p"); 355 | SetArrayString(vnArray, 168, "Intr_CMIB0_IPR07_b15_12_p1"); 356 | SetArrayString(vnArray, 169, "Intr_CMIB1_p2"); 357 | SetArrayString(vnArray, 172, "Intr_CMIB6_IPR07_b11_8_p1"); 358 | SetArrayString(vnArray, 173, "Intr_ICIB0_p2"); 359 | SetArrayString(vnArray, 176, "Intr_ATU_C0_IMIC00_IPR07_b7_4_p1"); 360 | SetArrayString(vnArray, 177, "Intr_ATU_C0_IMIC01_p2"); 361 | SetArrayString(vnArray, 178, "Intr_ATU_C0_IMIC02_p3"); 362 | SetArrayString(vnArray, 179, "Intr_ATU_C0_IMIC03_p4"); 363 | SetArrayString(vnArray, 180, "Intr_ATU_C0_OVIC0_IPR07_b3_0"); 364 | SetArrayString(vnArray, 184, "Intr_ATU_C1_IMIC10_IPR08_b15_12_p1"); 365 | SetArrayString(vnArray, 185, "Intr_ATU_C1_IMIC11_p2"); 366 | SetArrayString(vnArray, 186, "Intr_ATU_C1_IMIC12_p3"); 367 | SetArrayString(vnArray, 187, "Intr_ATU_C1_IMIC13_p4"); 368 | SetArrayString(vnArray, 188, "Intr_ATU_C1_OVIC1_IPR08_b11_8"); 369 | SetArrayString(vnArray, 192, "Intr_ATU_C2_IMIC20_IPR08_b7_4_p1"); 370 | SetArrayString(vnArray, 193, "Intr_ATU_C2_IMIC21_p2"); 371 | SetArrayString(vnArray, 194, "Intr_ATU_C2_IMIC22_p3"); 372 | SetArrayString(vnArray, 195, "Intr_ATU_C2_IMIC23_p4"); 373 | SetArrayString(vnArray, 196, "Intr_ATU_C2_OVIC2_IPR08_b3_0"); 374 | SetArrayString(vnArray, 200, "Intr_ATU_C3_IMIC30_IPR09_b15_12_p1"); 375 | SetArrayString(vnArray, 201, "Intr_ATU_C3_IMIC31_p2"); 376 | SetArrayString(vnArray, 202, "Intr_ATU_C3_IMIC32_p3"); 377 | SetArrayString(vnArray, 203, "Intr_ATU_C3_IMIC33_p4"); 378 | SetArrayString(vnArray, 204, "Intr_ATU_C3_OVIC3_IPR09_b11_8"); 379 | SetArrayString(vnArray, 208, "Intr_ATU_C4_IMIC40_IPR09_b7_4_p1"); 380 | SetArrayString(vnArray, 209, "Intr_ATU_C4_IMIC41_p2"); 381 | SetArrayString(vnArray, 210, "Intr_ATU_C4_IMIC42_p3"); 382 | SetArrayString(vnArray, 211, "Intr_ATU_C4_IMIC43_p4"); 383 | SetArrayString(vnArray, 212, "Intr_ATU_C4_OVIC4_IPR09_b3_0"); 384 | SetArrayString(vnArray, 216, "Intr_ATU_D0_CMID00_IPR10_b15_12_p1"); 385 | SetArrayString(vnArray, 217, "Intr_ATU_D0_CMID01_p2"); 386 | SetArrayString(vnArray, 218, "Intr_ATU_D0_CMID02_p3"); 387 | SetArrayString(vnArray, 219, "Intr_ATU_D0_CMID03_p4"); 388 | SetArrayString(vnArray, 220, "Intr_ATU_D0_OVI1D0_IPR10_b11_8_p1"); 389 | SetArrayString(vnArray, 221, "Intr_ATU_D0_OVI2D0_p2"); 390 | SetArrayString(vnArray, 224, "Intr_ATU_D0_UDID00_IPR10_b7_4_p1"); 391 | SetArrayString(vnArray, 225, "Intr_ATU_D0_UDID01_p2"); 392 | SetArrayString(vnArray, 226, "Intr_ATU_D0_UDID02_p3"); 393 | SetArrayString(vnArray, 227, "Intr_ATU_D0_UDID03_p4"); 394 | SetArrayString(vnArray, 228, "Intr_ATU_D1_CMID10_IPR10_b3_0_p1"); 395 | SetArrayString(vnArray, 229, "Intr_ATU_D1_CMID11_p2"); 396 | SetArrayString(vnArray, 230, "Intr_ATU_D1_CMID12_p3"); 397 | SetArrayString(vnArray, 231, "Intr_ATU_D1_CMID13_p4"); 398 | SetArrayString(vnArray, 232, "Intr_ATU_D1_OVI1D1_IPR11_b15_12_p1"); 399 | SetArrayString(vnArray, 233, "Intr_ATU_D1_OVI2D1_p2"); 400 | SetArrayString(vnArray, 236, "Intr_ATU_D1_UDID10_IPR11_b11_8_p1"); 401 | SetArrayString(vnArray, 237, "Intr_ATU_D1_UDID11_p2"); 402 | SetArrayString(vnArray, 238, "Intr_ATU_D1_UDID12_p3"); 403 | SetArrayString(vnArray, 239, "Intr_ATU_D1_UDID13_p4"); 404 | SetArrayString(vnArray, 240, "Intr_ATU_D2_CMID20_IPR11_b7_4_p1"); 405 | SetArrayString(vnArray, 241, "Intr_ATU_D2_CMID21_p2"); 406 | SetArrayString(vnArray, 242, "Intr_ATU_D2_CMID22_p3"); 407 | SetArrayString(vnArray, 243, "Intr_ATU_D2_CMID23_p4"); 408 | SetArrayString(vnArray, 244, "Intr_ATU_D2_OVI1D2_IPR11_b3_0_p1"); 409 | SetArrayString(vnArray, 245, "Intr_ATU_D2_OVI2D2_p2"); 410 | SetArrayString(vnArray, 248, "Intr_ATU_D2_UDID20_IPR12_b15_12_p1"); 411 | SetArrayString(vnArray, 249, "Intr_ATU_D2_UDID21_p2"); 412 | SetArrayString(vnArray, 250, "Intr_ATU_D2_UDID22_p3"); 413 | SetArrayString(vnArray, 251, "Intr_ATU_D2_UDID23_p4"); 414 | SetArrayString(vnArray, 252, "Intr_ATU_D3_CMID30_IPR12_b11_8_p1"); 415 | SetArrayString(vnArray, 253, "Intr_ATU_D3_CMID31_p2"); 416 | SetArrayString(vnArray, 254, "Intr_ATU_D3_CMID32_p3"); 417 | SetArrayString(vnArray, 255, "Intr_ATU_D3_CMID33_p4"); 418 | SetArrayString(vnArray, 256, "Intr_ATU_D3_OVI1D3_IPR12_b7_4_p1"); 419 | SetArrayString(vnArray, 257, "Intr_ATU_D3_OVI2D3_p2"); 420 | SetArrayString(vnArray, 260, "Intr_ATU_D3_UDID30_IPR12_b3_0_p1"); 421 | SetArrayString(vnArray, 261, "Intr_ATU_D3_UDID31_p2"); 422 | SetArrayString(vnArray, 262, "Intr_ATU_D3_UDID32_p3"); 423 | SetArrayString(vnArray, 263, "Intr_ATU_D3_UDID33_p4"); 424 | SetArrayString(vnArray, 288, "Intr_ATU_E0_CMIE00_IPR14_b7_4_p1"); 425 | SetArrayString(vnArray, 289, "Intr_ATU_E0_CMIE01_p2"); 426 | SetArrayString(vnArray, 290, "Intr_ATU_E0_CMIE02_p3"); 427 | SetArrayString(vnArray, 291, "Intr_ATU_E0_CMIE03_p4"); 428 | SetArrayString(vnArray, 292, "Intr_ATU_E1_CMIE10_IPR14_b3_0_p1"); 429 | SetArrayString(vnArray, 293, "Intr_ATU_E1_CMIE11_p2"); 430 | SetArrayString(vnArray, 294, "Intr_ATU_E1_CMIE12_p3"); 431 | SetArrayString(vnArray, 295, "Intr_ATU_E1_CMIE13_p4"); 432 | SetArrayString(vnArray, 296, "Intr_ATU_E2_CMIE20_IPR15_b15_12_p1"); 433 | SetArrayString(vnArray, 297, "Intr_ATU_E2_CMIE21_p2"); 434 | SetArrayString(vnArray, 298, "Intr_ATU_E2_CMIE22_p3"); 435 | SetArrayString(vnArray, 299, "Intr_ATU_E2_CMIE23_p4"); 436 | SetArrayString(vnArray, 300, "Intr_ATU_E3_CMIE30_IPR15_b11_8_p1"); 437 | SetArrayString(vnArray, 301, "Intr_ATU_E3_CMIE31_p2"); 438 | SetArrayString(vnArray, 302, "Intr_ATU_E3_CMIE32_p3"); 439 | SetArrayString(vnArray, 303, "Intr_ATU_E3_CMIE33_p4"); 440 | SetArrayString(vnArray, 304, "Intr_ATU_E4_CMIE40_IPR15_b7_4_p1"); 441 | SetArrayString(vnArray, 305, "Intr_ATU_E4_CMIE41_p2"); 442 | SetArrayString(vnArray, 306, "Intr_ATU_E4_CMIE42_p3"); 443 | SetArrayString(vnArray, 307, "Intr_ATU_E4_CMIE43_p4"); 444 | SetArrayString(vnArray, 312, "Intr_ATU_F_ICIF0_IPR16_b15_12_p1"); 445 | SetArrayString(vnArray, 313, "Intr_ATU_F_ICIF1_p2"); 446 | SetArrayString(vnArray, 314, "Intr_ATU_F_ICIF2_p3"); 447 | SetArrayString(vnArray, 315, "Intr_ATU_F_ICIF3_p4"); 448 | SetArrayString(vnArray, 316, "Intr_ATU_F_ICIF4_IPR16_b11_8_p1"); 449 | SetArrayString(vnArray, 317, "Intr_ATU_F_ICIF5_p2"); 450 | SetArrayString(vnArray, 318, "Intr_ATU_F_ICIF6_p3"); 451 | SetArrayString(vnArray, 319, "Intr_ATU_F_ICIF7_p4"); 452 | SetArrayString(vnArray, 320, "Intr_ATU_F_ICIF8_IPR16_b7_4_p1"); 453 | SetArrayString(vnArray, 321, "Intr_ATU_F_ICIF9_p2"); 454 | SetArrayString(vnArray, 322, "Intr_ATU_F_ICIF10_p3"); 455 | SetArrayString(vnArray, 323, "Intr_ATU_F_ICIF11_p4"); 456 | SetArrayString(vnArray, 324, "Intr_ATU_F_ICIF12_IPR16_b3_0_p1"); 457 | SetArrayString(vnArray, 325, "Intr_ATU_F_ICIF13_p2"); 458 | SetArrayString(vnArray, 326, "Intr_ATU_F_ICIF14_p3"); 459 | SetArrayString(vnArray, 327, "Intr_ATU_F_ICIF15_p4"); 460 | SetArrayString(vnArray, 328, "Intr_ATU_F_ICIF16_IPR17_b15_12_p1"); 461 | SetArrayString(vnArray, 329, "Intr_ATU_F_ICIF17_p2"); 462 | SetArrayString(vnArray, 330, "Intr_ATU_F_ICIF18_p3"); 463 | SetArrayString(vnArray, 331, "Intr_ATU_F_ICIF19_p4"); 464 | SetArrayString(vnArray, 340, "Intr_ATU_F_OVIF0_IPR18_b15_12_p1"); 465 | SetArrayString(vnArray, 341, "Intr_ATU_F_OVIF1_p2"); 466 | SetArrayString(vnArray, 342, "Intr_ATU_F_OVIF2_p3"); 467 | SetArrayString(vnArray, 343, "Intr_ATU_F_OVIF3_p4"); 468 | SetArrayString(vnArray, 344, "Intr_ATU_F_OVIF4_IPR18_b11_8_p1"); 469 | SetArrayString(vnArray, 345, "Intr_ATU_F_OVIF5_p2"); 470 | SetArrayString(vnArray, 346, "Intr_ATU_F_OVIF6_p3"); 471 | SetArrayString(vnArray, 347, "Intr_ATU_F_OVIF7_p4"); 472 | SetArrayString(vnArray, 348, "Intr_ATU_F_OVIF8_IPR18_b7_4_p1"); 473 | SetArrayString(vnArray, 349, "Intr_ATU_F_OVIF9_p2"); 474 | SetArrayString(vnArray, 350, "Intr_ATU_F_OVIF10_p3"); 475 | SetArrayString(vnArray, 351, "Intr_ATU_F_OVIF11_p4"); 476 | SetArrayString(vnArray, 352, "Intr_ATU_F_OVIF12_IPR18_b3_0_p1"); 477 | SetArrayString(vnArray, 353, "Intr_ATU_F_OVIF13_p2"); 478 | SetArrayString(vnArray, 354, "Intr_ATU_F_OVIF14_p3"); 479 | SetArrayString(vnArray, 355, "Intr_ATU_F_OVIF15_p4"); 480 | SetArrayString(vnArray, 356, "Intr_ATU_F_OVIF16_IPR19_b15_12_p1"); 481 | SetArrayString(vnArray, 357, "Intr_ATU_F_OVIF17_p2"); 482 | SetArrayString(vnArray, 358, "Intr_ATU_F_OVIF18_p3"); 483 | SetArrayString(vnArray, 359, "Intr_ATU_F_OVIF19_p4"); 484 | SetArrayString(vnArray, 368, "Intr_ATU_F_CMIG0_IPR20_b15_12_p1"); 485 | SetArrayString(vnArray, 369, "Intr_ATU_F_CMIG1_p2"); 486 | SetArrayString(vnArray, 370, "Intr_ATU_F_CMIG2_p3"); 487 | SetArrayString(vnArray, 371, "Intr_ATU_F_CMIG3_p4"); 488 | SetArrayString(vnArray, 372, "Intr_ATU_F_CMIG4_IPR20_b11_8_p1"); 489 | SetArrayString(vnArray, 373, "Intr_ATU_F_CMIG5_p2"); 490 | SetArrayString(vnArray, 376, "Intr_ATU_H_CMIH_IPR20_b7_4"); 491 | SetArrayString(vnArray, 380, "Intr_ATU_J_DFIJ0_IPR21_b15_12_p1"); 492 | SetArrayString(vnArray, 381, "Intr_ATU_J_DFIJ1_p2"); 493 | SetArrayString(vnArray, 384, "Intr_ATU_J_OVIJ0_IPR21_b11_8_p1"); 494 | SetArrayString(vnArray, 385, "Intr_ATU_J_OVIJ1_p2"); 495 | SetArrayString(vnArray, 388, "Intr_ATU_J_DOVIJ0_IPR21_b7_4_p1"); 496 | SetArrayString(vnArray, 389, "Intr_ATU_J_DOVIJ1_p2"); 497 | SetArrayString(vnArray, 392, "Intr_ADC_ADI0_IPR22_b15_12"); 498 | SetArrayString(vnArray, 396, "Intr_ADC_ADI1_IPR22_b11_8"); 499 | SetArrayString(vnArray, 400, "Intr_ADC_ADID0_IPR22_b7_4_p1"); 500 | SetArrayString(vnArray, 401, "Intr_ADC_ADID1_p2"); 501 | SetArrayString(vnArray, 402, "Intr_ADC_ADID2_p3"); 502 | SetArrayString(vnArray, 403, "Intr_ADC_ADID3_p4"); 503 | SetArrayString(vnArray, 404, "Intr_ADC_ADID4_IPR22_b3_0_p1"); 504 | SetArrayString(vnArray, 405, "Intr_ADC_ADID5_p2"); 505 | SetArrayString(vnArray, 406, "Intr_ADC_ADID6_p3"); 506 | SetArrayString(vnArray, 407, "Intr_ADC_ADID7_p4"); 507 | SetArrayString(vnArray, 408, "Intr_ADC_ADID8_IPR23_b15_12_p1"); 508 | SetArrayString(vnArray, 409, "Intr_ADC_ADID9_p2"); 509 | SetArrayString(vnArray, 410, "Intr_ADC_ADID10_p3"); 510 | SetArrayString(vnArray, 411, "Intr_ADC_ADID11_IPR23_b15_12_p4"); 511 | SetArrayString(vnArray, 412, "Intr_ADC_ADID12_IPR23_b11_8_p1"); 512 | SetArrayString(vnArray, 413, "Intr_ADC_ADID13_p2"); 513 | SetArrayString(vnArray, 414, "Intr_ADC_ADID14_p3"); 514 | SetArrayString(vnArray, 415, "Intr_ADC_ADID15_p4"); 515 | SetArrayString(vnArray, 416, "Intr_ADC_ADID40_IPR23_b7_4"); 516 | SetArrayString(vnArray, 417, "Intr_ADC_ADID41_IPR23_b3_0"); 517 | SetArrayString(vnArray, 418, "Intr_ADC_ADID42_IPR24_b15_12"); 518 | SetArrayString(vnArray, 419, "Intr_ADC_ADID43_IPR24_b11_8"); 519 | SetArrayString(vnArray, 420, "Intr_ADC_ADID44_IPR24_b7_4"); 520 | SetArrayString(vnArray, 421, "Intr_ADC_ADID45_IPR24_b3_0"); 521 | SetArrayString(vnArray, 422, "Intr_ADC_ADID46_IPR25_b15_12"); 522 | SetArrayString(vnArray, 423, "Intr_ADC_ADID47_IPR25_b11_8"); 523 | SetArrayString(vnArray, 424, "Intr_SCI_A_ERIA_IPR26_b15_12_p1"); 524 | SetArrayString(vnArray, 425, "Intr_SCI_A_RXIA_p2"); 525 | SetArrayString(vnArray, 426, "Intr_SCI_A_TXIA_p3"); 526 | SetArrayString(vnArray, 427, "Intr_SCI_A_TEIA_p4"); 527 | SetArrayString(vnArray, 428, "Intr_SCI_B_ERIB_IPR26_b11_8_p1"); 528 | SetArrayString(vnArray, 429, "Intr_SCI_B_RXIB_p2"); 529 | SetArrayString(vnArray, 430, "Intr_SCI_B_TXIB_p3"); 530 | SetArrayString(vnArray, 431, "Intr_SCI_B_TEIB_p4"); 531 | SetArrayString(vnArray, 432, "Intr_SCI_C_ERIC_IPR26_b7_4_p1"); 532 | SetArrayString(vnArray, 433, "Intr_SCI_C_RXIC_p2"); 533 | SetArrayString(vnArray, 434, "Intr_SCI_C_TXIC_p3"); 534 | SetArrayString(vnArray, 435, "Intr_SCI_C_TEIC_p4"); 535 | SetArrayString(vnArray, 444, "Intr_RSPI_A_SPEIA_IPR27_b11_8_p1"); 536 | SetArrayString(vnArray, 445, "Intr_RSPI_A_SPRIA_p2"); 537 | SetArrayString(vnArray, 446, "Intr_RSPI_A_SPTIA_p3"); 538 | SetArrayString(vnArray, 448, "Intr_RSPI_B_SPEIB_IPR27_b7_4_p1"); 539 | SetArrayString(vnArray, 449, "Intr_RSPI_B_SPRIB_p2"); 540 | SetArrayString(vnArray, 450, "Intr_RSPI_B_SPTIB_p3"); 541 | SetArrayString(vnArray, 456, "Intr_RCAN_A_ERSA_IPR28_b15_12_p1"); 542 | SetArrayString(vnArray, 457, "Intr_RCAN_A_OVRA_p2"); 543 | SetArrayString(vnArray, 458, "Intr_RCAN_A_RMA0_p3"); 544 | SetArrayString(vnArray, 459, "Intr_RCAN_A_RMA1_p4"); 545 | SetArrayString(vnArray, 460, "Intr_RCAN_A_SLEA_p5"); 546 | SetArrayString(vnArray, 461, "Intr_RCAN_A_MBEA_p6"); 547 | SetArrayString(vnArray, 464, "Intr_RCAN_B_ERSB_IPR28_b11_8_p1"); 548 | SetArrayString(vnArray, 465, "Intr_RCAN_B_OVRB_p2"); 549 | SetArrayString(vnArray, 466, "Intr_RCAN_B_RMB0_p3"); 550 | SetArrayString(vnArray, 467, "Intr_RCAN_B_RMB1_p4"); 551 | SetArrayString(vnArray, 468, "Intr_RCAN_B_SLEB_p5"); 552 | SetArrayString(vnArray, 469, "Intr_RCAN_B_MBEB_p6"); 553 | SetArrayString(vnArray, 488, "Intr_ADMAC_TE74_IPR29_b15_12_p1"); 554 | } -------------------------------------------------------------------------------- /src/IDA/Format16bitROM.idc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Dale C. Schultz 3 | * RomRaider member ID: dschultz 4 | * 5 | * You are free to use this script for any purpose, but please keep 6 | * notice of where it came from! 7 | * 8 | * Version: 3 9 | * Date : 2012-12-16 10 | * 11 | * This script is used to initialize a 16bit ROM. 12 | * To use the script open a 16bit ROM in IDA, either 160kB or 192kB is supported. 13 | * Set the processor type to 6816 and accept the default ROM dialog. 14 | * Then run this IDA script. 15 | * This script must be used to prepare a 16 bit ROM for use with the Convert16bitOperand.idc script. 16 | * 17 | * NOTE: USING THIS SCRIPT ON AN EXISTING DEFINED ROM WILL CAUSE LOSS OF ALL YOUR NAMING AND COMMENTING. 18 | */ 19 | 20 | #include 21 | 22 | static main() { 23 | auto vcArray, vnArray, vxArray, calId, ZK, SK, PK, SP, PC, addr0, loadSize, rc, result, currAddr, ync; 24 | ync = AskYN(-1, "WARNING: USING THIS SCRIPT ON AN EXISTING ROM DEFINITION WILL CAUSE LOSS OF ALL YOUR NAMING AND COMMENTING.\nProduce a Database Dump IDC file if you wish to save your work for re-import.\nContinue with ROM formatting?"); // -1:cancel,0-no,1-ok 25 | if (ync != 1) { 26 | Message("Aborting ROM formating at user request\n"); 27 | return 0; 28 | } 29 | vnArray = GetArrayId("VNARRAY"); 30 | DeleteArray(vnArray); 31 | vcArray = GetArrayId("VCARRAY"); 32 | DeleteArray(vcArray); 33 | vxArray = GetArrayId("VXARRAY"); 34 | DeleteArray(vxArray); 35 | CreateVectorCommentArray(); 36 | vcArray = GetArrayId("VCARRAY"); 37 | CreateVectorNameArray(); 38 | vnArray = GetArrayId("VNARRAY"); 39 | vxArray = CreateArray("VXARRAY"); 40 | 41 | loadSize = SegEnd(0x0); 42 | SetPrcsr("6816"); 43 | calId = GetString(0x200, 8, ASCSTR_C); 44 | addr0 = Word(0x0); 45 | PK = addr0 & 0x000F; 46 | SK = (addr0 >> 4) & 0x000F; 47 | ZK = (addr0 >> 8) & 0x000F; 48 | SegCreate(0x0,0x200,0,0,2,2); 49 | SegRename(0x0,"VECTOR"); 50 | SegClass (0x0,"DATA"); 51 | SegDefReg(0x0,"EK",0x0); 52 | SegDefReg(0x0,"XK",0x0); 53 | SegDefReg(0x0,"YK",0x0); 54 | SegDefReg(0x0,"ZK",ZK); 55 | SegDefReg(0x0,"ds",0x1); 56 | SetSegmentType(0x0,3); 57 | SegCreate(0x200,0X20000,0,0,2,2); 58 | SegRename(0x200,"ROM"); 59 | SegClass (0x200,"CODE"); 60 | SegDefReg(0x200,"EK",0x2); 61 | SegDefReg(0x200,"XK",0x0); 62 | SegDefReg(0x200,"YK",0x2); 63 | SegDefReg(0x200,"ZK",ZK); 64 | SegDefReg(0x200,"ds",0x2); 65 | SetSegmentType(0x200,2); 66 | 67 | if (loadSize == 0x30000) { 68 | SegCreate(0x28000,0x30000,0x2000,0,2,2); 69 | SegRename(0x28000,"DATA"); 70 | SegClass (0x28000,"CODE"); 71 | SegDefReg(0x28000,"EK",0x0); 72 | SegDefReg(0x28000,"XK",0x0); 73 | SegDefReg(0x28000,"YK",0x2); 74 | SegDefReg(0x28000,"ZK",ZK); 75 | SegDefReg(0x28000,"ds",0x4); 76 | SetSegmentType(0x28000,3); 77 | result = "Loaded 192kB ROM\n"; 78 | rc = 0; 79 | } 80 | else if (loadSize == 0x28000) { 81 | SegCreate(0x20000,0x28000,0x2000,0,2,2); 82 | SegRename(0x20000,"ROM"); 83 | SegClass (0x20000,"CODE"); 84 | SegDefReg(0x20000,"EK",0x0); 85 | SegDefReg(0x20000,"XK",0x0); 86 | SegDefReg(0x20000,"YK",0x0); 87 | SegDefReg(0x20000,"ZK",ZK); 88 | SegDefReg(0x20000,"ds",0x3); 89 | SetSegmentType(0x20000,3); 90 | rc = MoveSegm(0x20000, 0x28000, 0); 91 | if (rc == 0) { 92 | Message("ROM segment moved\n"); 93 | result = "Loaded 160kB ROM\n"; 94 | } 95 | else { 96 | Message(form("ROM segment move failed, error: %d\n"), rc); 97 | } 98 | } 99 | if (rc == 0) { 100 | SegCreate(0x20000,0x28000,0x2000,0,2,2); 101 | SegRename(0x20000,"RAM"); 102 | SegClass (0x20000,"DATA"); 103 | SegDefReg(0x20000,"EK",0x0); 104 | SegDefReg(0x20000,"XK",0x0); 105 | SegDefReg(0x20000,"YK",0x0); 106 | SegDefReg(0x20000,"ZK",ZK); 107 | SegDefReg(0x20000,"ds",0x3); 108 | SetSegmentType(0x20000,3); 109 | SegCreate(0xF0000,0x100000,0xF000,0,2,2); 110 | SegRename(0xF0000,"IMB"); 111 | SegClass (0xF0000,"DATA"); 112 | SegDefReg(0xF0000,"EK",0x0); 113 | SegDefReg(0xF0000,"XK",0x0); 114 | SegDefReg(0xF0000,"YK",0x0); 115 | SegDefReg(0xF0000,"ZK",ZK); 116 | SegDefReg(0xF0000,"ds",0x5); 117 | SetSegmentType(0xF0000,3); 118 | LowVoids(0x100); 119 | HighVoids(0x20000); 120 | } 121 | Message(result); 122 | MakeWord(0x0); 123 | MakeRptCmt(0x0, form("RESET Initial ZK = %d, SK = %d, PK = %d", ZK, SK, PK)); 124 | MakeName(0x0, "RESET"); 125 | PC = Word(0x2); 126 | MakeWord(0x2); 127 | MakeRptCmt(0x2, form("RESET Initial PC = 0x%X", (PK << 16) + PC)); 128 | SP = Word(0x4); 129 | MakeWord(0x4); 130 | MakeRptCmt(0x4, form("RESET Initial SP = 0x%X", (SK << 16) + SP)); 131 | MakeWord(0x6); 132 | MakeRptCmt(0x6, "RESET Initial IZ"); 133 | 134 | SetShortPrm(INF_AF, AF_FINAL|GetShortPrm(INF_AF)); 135 | SetShortPrm(INF_AF, ~AF_ASCII&GetShortPrm(INF_AF)); 136 | SetShortPrm(INF_AF2, ~AF2_CHKUNI&GetShortPrm(INF_AF2)); 137 | SetShortPrm(INF_BINPREF, 6); 138 | MakeFunction(PC, BADADDR); 139 | 140 | currAddr = 0x0008; 141 | while (currAddr < 0x0200) { 142 | MakeWord(currAddr); 143 | MakeRptCmt(currAddr, GetArrayElement(AR_STR, vcArray, currAddr)); 144 | MakeName(currAddr, GetArrayElement(AR_STR, vnArray, currAddr)); 145 | MakeFunction(Word(currAddr), BADADDR); 146 | if (!GetArrayElement(AR_LONG, vxArray, Word(currAddr))) { 147 | MakeName(Word(currAddr), "Intr" + GetArrayElement(AR_STR, vnArray, currAddr)); 148 | SetArrayLong(vxArray, Word(currAddr), 1); 149 | } 150 | currAddr = currAddr + 2; 151 | } 152 | } 153 | 154 | static CreateVectorCommentArray() { 155 | auto vcArray; 156 | vcArray = CreateArray("VCARRAY"); 157 | SetArrayString(vcArray, 0x0008, "BREAKPOINT"); 158 | SetArrayString(vcArray, 0x000A, "BUS ERROR"); 159 | SetArrayString(vcArray, 0x000C, "SOFTWARE INTERRUPT"); 160 | SetArrayString(vcArray, 0x000E, "ILLEGAL INSTRUCTION"); 161 | SetArrayString(vcArray, 0x0010, "DIVISION BY ZERO"); 162 | SetArrayString(vcArray, 0x0012, "UNASSIGNED, RESERVED"); 163 | SetArrayString(vcArray, 0x0014, "UNASSIGNED, RESERVED"); 164 | SetArrayString(vcArray, 0x0016, "UNASSIGNED, RESERVED"); 165 | SetArrayString(vcArray, 0x0018, "UNASSIGNED, RESERVED"); 166 | SetArrayString(vcArray, 0x001A, "UNASSIGNED, RESERVED"); 167 | SetArrayString(vcArray, 0x001C, "UNASSIGNED, RESERVED"); 168 | SetArrayString(vcArray, 0x001E, "UNINITIALIZED INTERRUPT"); 169 | SetArrayString(vcArray, 0x0020, "UNASSIGNED, RESERVED"); 170 | SetArrayString(vcArray, 0x0022, "LEVEL 1 INTERRUPT AUTOVECTOR"); 171 | SetArrayString(vcArray, 0x0024, "LEVEL 2 INTERRUPT AUTOVECTOR"); 172 | SetArrayString(vcArray, 0x0026, "LEVEL 3 INTERRUPT AUTOVECTOR"); 173 | SetArrayString(vcArray, 0x0028, "LEVEL 4 INTERRUPT AUTOVECTOR"); 174 | SetArrayString(vcArray, 0x002A, "LEVEL 5 INTERRUPT AUTOVECTOR"); 175 | SetArrayString(vcArray, 0x002C, "LEVEL 6 INTERRUPT AUTOVECTOR"); 176 | SetArrayString(vcArray, 0x002E, "LEVEL 7 INTERRUPT AUTOVECTOR"); 177 | SetArrayString(vcArray, 0x0030, "SPURIOUS INTERRUPT"); 178 | SetArrayString(vcArray, 0x0032, "UNASSIGNED, RESERVED"); 179 | SetArrayString(vcArray, 0x0034, "UNASSIGNED, RESERVED"); 180 | SetArrayString(vcArray, 0x0036, "UNASSIGNED, RESERVED"); 181 | SetArrayString(vcArray, 0x0038, "UNASSIGNED, RESERVED"); 182 | SetArrayString(vcArray, 0x003A, "UNASSIGNED, RESERVED"); 183 | SetArrayString(vcArray, 0x003C, "UNASSIGNED, RESERVED"); 184 | SetArrayString(vcArray, 0x003E, "UNASSIGNED, RESERVED"); 185 | SetArrayString(vcArray, 0x0040, "UNASSIGNED, RESERVED"); 186 | SetArrayString(vcArray, 0x0042, "UNASSIGNED, RESERVED"); 187 | SetArrayString(vcArray, 0x0044, "UNASSIGNED, RESERVED"); 188 | SetArrayString(vcArray, 0x0046, "UNASSIGNED, RESERVED"); 189 | SetArrayString(vcArray, 0x0048, "UNASSIGNED, RESERVED"); 190 | SetArrayString(vcArray, 0x004A, "UNASSIGNED, RESERVED"); 191 | SetArrayString(vcArray, 0x004C, "UNASSIGNED, RESERVED"); 192 | SetArrayString(vcArray, 0x004E, "UNASSIGNED, RESERVED"); 193 | SetArrayString(vcArray, 0x0050, "UNASSIGNED, RESERVED"); 194 | SetArrayString(vcArray, 0x0052, "UNASSIGNED, RESERVED"); 195 | SetArrayString(vcArray, 0x0054, "UNASSIGNED, RESERVED"); 196 | SetArrayString(vcArray, 0x0056, "UNASSIGNED, RESERVED"); 197 | SetArrayString(vcArray, 0x0058, "UNASSIGNED, RESERVED"); 198 | SetArrayString(vcArray, 0x005A, "UNASSIGNED, RESERVED"); 199 | SetArrayString(vcArray, 0x005C, "UNASSIGNED, RESERVED"); 200 | SetArrayString(vcArray, 0x005E, "UNASSIGNED, RESERVED"); 201 | SetArrayString(vcArray, 0x0060, "UNASSIGNED, RESERVED"); 202 | SetArrayString(vcArray, 0x0062, "UNASSIGNED, RESERVED"); 203 | SetArrayString(vcArray, 0x0064, "UNASSIGNED, RESERVED"); 204 | SetArrayString(vcArray, 0x0066, "UNASSIGNED, RESERVED"); 205 | SetArrayString(vcArray, 0x0068, "UNASSIGNED, RESERVED"); 206 | SetArrayString(vcArray, 0x006A, "UNASSIGNED, RESERVED"); 207 | SetArrayString(vcArray, 0x006C, "UNASSIGNED, RESERVED"); 208 | SetArrayString(vcArray, 0x006E, "UNASSIGNED, RESERVED"); 209 | SetArrayString(vcArray, 0x0070, "USER-DEFINED INTERRUPTS"); 210 | SetArrayString(vcArray, 0x0072, "USER-DEFINED INTERRUPTS"); 211 | SetArrayString(vcArray, 0x0074, "USER-DEFINED INTERRUPTS"); 212 | SetArrayString(vcArray, 0x0076, "USER-DEFINED INTERRUPTS"); 213 | SetArrayString(vcArray, 0x0078, "USER-DEFINED INTERRUPTS"); 214 | SetArrayString(vcArray, 0x007A, "USER-DEFINED INTERRUPTS"); 215 | SetArrayString(vcArray, 0x007C, "USER-DEFINED INTERRUPTS"); 216 | SetArrayString(vcArray, 0x007E, "USER-DEFINED INTERRUPTS"); 217 | SetArrayString(vcArray, 0x0080, "USER-DEFINED INTERRUPTS"); 218 | SetArrayString(vcArray, 0x0082, "USER-DEFINED INTERRUPTS"); 219 | SetArrayString(vcArray, 0x0084, "USER-DEFINED INTERRUPTS"); 220 | SetArrayString(vcArray, 0x0086, "USER-DEFINED INTERRUPTS"); 221 | SetArrayString(vcArray, 0x0088, "USER-DEFINED INTERRUPTS"); 222 | SetArrayString(vcArray, 0x008A, "USER-DEFINED INTERRUPTS"); 223 | SetArrayString(vcArray, 0x008C, "USER-DEFINED INTERRUPTS"); 224 | SetArrayString(vcArray, 0x008E, "USER-DEFINED INTERRUPTS"); 225 | SetArrayString(vcArray, 0x0090, "USER-DEFINED INTERRUPTS"); 226 | SetArrayString(vcArray, 0x0092, "USER-DEFINED INTERRUPTS"); 227 | SetArrayString(vcArray, 0x0094, "USER-DEFINED INTERRUPTS"); 228 | SetArrayString(vcArray, 0x0096, "USER-DEFINED INTERRUPTS"); 229 | SetArrayString(vcArray, 0x0098, "USER-DEFINED INTERRUPTS"); 230 | SetArrayString(vcArray, 0x009A, "USER-DEFINED INTERRUPTS"); 231 | SetArrayString(vcArray, 0x009C, "USER-DEFINED INTERRUPTS"); 232 | SetArrayString(vcArray, 0x009E, "USER-DEFINED INTERRUPTS"); 233 | SetArrayString(vcArray, 0x00A0, "USER-DEFINED INTERRUPTS"); 234 | SetArrayString(vcArray, 0x00A2, "USER-DEFINED INTERRUPTS"); 235 | SetArrayString(vcArray, 0x00A4, "USER-DEFINED INTERRUPTS"); 236 | SetArrayString(vcArray, 0x00A6, "USER-DEFINED INTERRUPTS"); 237 | SetArrayString(vcArray, 0x00A8, "USER-DEFINED INTERRUPTS"); 238 | SetArrayString(vcArray, 0x00AA, "USER-DEFINED INTERRUPTS"); 239 | SetArrayString(vcArray, 0x00AC, "USER-DEFINED INTERRUPTS"); 240 | SetArrayString(vcArray, 0x00AE, "USER-DEFINED INTERRUPTS"); 241 | SetArrayString(vcArray, 0x00B0, "USER-DEFINED INTERRUPTS"); 242 | SetArrayString(vcArray, 0x00B2, "USER-DEFINED INTERRUPTS"); 243 | SetArrayString(vcArray, 0x00B4, "USER-DEFINED INTERRUPTS"); 244 | SetArrayString(vcArray, 0x00B6, "USER-DEFINED INTERRUPTS"); 245 | SetArrayString(vcArray, 0x00B8, "USER-DEFINED INTERRUPTS"); 246 | SetArrayString(vcArray, 0x00BA, "USER-DEFINED INTERRUPTS"); 247 | SetArrayString(vcArray, 0x00BC, "USER-DEFINED INTERRUPTS"); 248 | SetArrayString(vcArray, 0x00BE, "USER-DEFINED INTERRUPTS"); 249 | SetArrayString(vcArray, 0x00C0, "USER-DEFINED INTERRUPTS"); 250 | SetArrayString(vcArray, 0x00C2, "USER-DEFINED INTERRUPTS"); 251 | SetArrayString(vcArray, 0x00C4, "USER-DEFINED INTERRUPTS"); 252 | SetArrayString(vcArray, 0x00C6, "USER-DEFINED INTERRUPTS"); 253 | SetArrayString(vcArray, 0x00C8, "USER-DEFINED INTERRUPTS"); 254 | SetArrayString(vcArray, 0x00CA, "USER-DEFINED INTERRUPTS"); 255 | SetArrayString(vcArray, 0x00CC, "USER-DEFINED INTERRUPTS"); 256 | SetArrayString(vcArray, 0x00CE, "USER-DEFINED INTERRUPTS"); 257 | SetArrayString(vcArray, 0x00D0, "USER-DEFINED INTERRUPTS"); 258 | SetArrayString(vcArray, 0x00D2, "USER-DEFINED INTERRUPTS"); 259 | SetArrayString(vcArray, 0x00D4, "USER-DEFINED INTERRUPTS"); 260 | SetArrayString(vcArray, 0x00D6, "USER-DEFINED INTERRUPTS"); 261 | SetArrayString(vcArray, 0x00D8, "USER-DEFINED INTERRUPTS"); 262 | SetArrayString(vcArray, 0x00DA, "USER-DEFINED INTERRUPTS"); 263 | SetArrayString(vcArray, 0x00DC, "USER-DEFINED INTERRUPTS"); 264 | SetArrayString(vcArray, 0x00DE, "USER-DEFINED INTERRUPTS"); 265 | SetArrayString(vcArray, 0x00E0, "USER-DEFINED INTERRUPTS"); 266 | SetArrayString(vcArray, 0x00E2, "USER-DEFINED INTERRUPTS"); 267 | SetArrayString(vcArray, 0x00E4, "USER-DEFINED INTERRUPTS"); 268 | SetArrayString(vcArray, 0x00E6, "USER-DEFINED INTERRUPTS"); 269 | SetArrayString(vcArray, 0x00E8, "USER-DEFINED INTERRUPTS"); 270 | SetArrayString(vcArray, 0x00EA, "USER-DEFINED INTERRUPTS"); 271 | SetArrayString(vcArray, 0x00EC, "USER-DEFINED INTERRUPTS"); 272 | SetArrayString(vcArray, 0x00EE, "USER-DEFINED INTERRUPTS"); 273 | SetArrayString(vcArray, 0x00F0, "USER-DEFINED INTERRUPTS"); 274 | SetArrayString(vcArray, 0x00F2, "USER-DEFINED INTERRUPTS"); 275 | SetArrayString(vcArray, 0x00F4, "USER-DEFINED INTERRUPTS"); 276 | SetArrayString(vcArray, 0x00F6, "USER-DEFINED INTERRUPTS"); 277 | SetArrayString(vcArray, 0x00F8, "USER-DEFINED INTERRUPTS"); 278 | SetArrayString(vcArray, 0x00FA, "USER-DEFINED INTERRUPTS"); 279 | SetArrayString(vcArray, 0x00FC, "USER-DEFINED INTERRUPTS"); 280 | SetArrayString(vcArray, 0x00FE, "USER-DEFINED INTERRUPTS"); 281 | SetArrayString(vcArray, 0x0100, "USER-DEFINED INTERRUPTS"); 282 | SetArrayString(vcArray, 0x0102, "USER-DEFINED INTERRUPTS"); 283 | SetArrayString(vcArray, 0x0104, "USER-DEFINED INTERRUPTS"); 284 | SetArrayString(vcArray, 0x0106, "USER-DEFINED INTERRUPTS"); 285 | SetArrayString(vcArray, 0x0108, "USER-DEFINED INTERRUPTS"); 286 | SetArrayString(vcArray, 0x010A, "USER-DEFINED INTERRUPTS"); 287 | SetArrayString(vcArray, 0x010C, "USER-DEFINED INTERRUPTS"); 288 | SetArrayString(vcArray, 0x010E, "USER-DEFINED INTERRUPTS"); 289 | SetArrayString(vcArray, 0x0110, "USER-DEFINED INTERRUPTS"); 290 | SetArrayString(vcArray, 0x0112, "USER-DEFINED INTERRUPTS"); 291 | SetArrayString(vcArray, 0x0114, "USER-DEFINED INTERRUPTS"); 292 | SetArrayString(vcArray, 0x0116, "USER-DEFINED INTERRUPTS"); 293 | SetArrayString(vcArray, 0x0118, "USER-DEFINED INTERRUPTS"); 294 | SetArrayString(vcArray, 0x011A, "USER-DEFINED INTERRUPTS"); 295 | SetArrayString(vcArray, 0x011C, "USER-DEFINED INTERRUPTS"); 296 | SetArrayString(vcArray, 0x011E, "USER-DEFINED INTERRUPTS"); 297 | SetArrayString(vcArray, 0x0120, "USER-DEFINED INTERRUPTS"); 298 | SetArrayString(vcArray, 0x0122, "USER-DEFINED INTERRUPTS"); 299 | SetArrayString(vcArray, 0x0124, "USER-DEFINED INTERRUPTS"); 300 | SetArrayString(vcArray, 0x0126, "USER-DEFINED INTERRUPTS"); 301 | SetArrayString(vcArray, 0x0128, "USER-DEFINED INTERRUPTS"); 302 | SetArrayString(vcArray, 0x012A, "USER-DEFINED INTERRUPTS"); 303 | SetArrayString(vcArray, 0x012C, "USER-DEFINED INTERRUPTS"); 304 | SetArrayString(vcArray, 0x012E, "USER-DEFINED INTERRUPTS"); 305 | SetArrayString(vcArray, 0x0130, "USER-DEFINED INTERRUPTS"); 306 | SetArrayString(vcArray, 0x0132, "USER-DEFINED INTERRUPTS"); 307 | SetArrayString(vcArray, 0x0134, "USER-DEFINED INTERRUPTS"); 308 | SetArrayString(vcArray, 0x0136, "USER-DEFINED INTERRUPTS"); 309 | SetArrayString(vcArray, 0x0138, "USER-DEFINED INTERRUPTS"); 310 | SetArrayString(vcArray, 0x013A, "USER-DEFINED INTERRUPTS"); 311 | SetArrayString(vcArray, 0x013C, "USER-DEFINED INTERRUPTS"); 312 | SetArrayString(vcArray, 0x013E, "USER-DEFINED INTERRUPTS"); 313 | SetArrayString(vcArray, 0x0140, "USER-DEFINED INTERRUPTS"); 314 | SetArrayString(vcArray, 0x0142, "USER-DEFINED INTERRUPTS"); 315 | SetArrayString(vcArray, 0x0144, "USER-DEFINED INTERRUPTS"); 316 | SetArrayString(vcArray, 0x0146, "USER-DEFINED INTERRUPTS"); 317 | SetArrayString(vcArray, 0x0148, "USER-DEFINED INTERRUPTS"); 318 | SetArrayString(vcArray, 0x014A, "USER-DEFINED INTERRUPTS"); 319 | SetArrayString(vcArray, 0x014C, "USER-DEFINED INTERRUPTS"); 320 | SetArrayString(vcArray, 0x014E, "USER-DEFINED INTERRUPTS"); 321 | SetArrayString(vcArray, 0x0150, "USER-DEFINED INTERRUPTS"); 322 | SetArrayString(vcArray, 0x0152, "USER-DEFINED INTERRUPTS"); 323 | SetArrayString(vcArray, 0x0154, "USER-DEFINED INTERRUPTS"); 324 | SetArrayString(vcArray, 0x0156, "USER-DEFINED INTERRUPTS"); 325 | SetArrayString(vcArray, 0x0158, "USER-DEFINED INTERRUPTS"); 326 | SetArrayString(vcArray, 0x015A, "USER-DEFINED INTERRUPTS"); 327 | SetArrayString(vcArray, 0x015C, "USER-DEFINED INTERRUPTS"); 328 | SetArrayString(vcArray, 0x015E, "USER-DEFINED INTERRUPTS"); 329 | SetArrayString(vcArray, 0x0160, "USER-DEFINED INTERRUPTS"); 330 | SetArrayString(vcArray, 0x0162, "USER-DEFINED INTERRUPTS"); 331 | SetArrayString(vcArray, 0x0164, "USER-DEFINED INTERRUPTS"); 332 | SetArrayString(vcArray, 0x0166, "USER-DEFINED INTERRUPTS"); 333 | SetArrayString(vcArray, 0x0168, "USER-DEFINED INTERRUPTS"); 334 | SetArrayString(vcArray, 0x016A, "USER-DEFINED INTERRUPTS"); 335 | SetArrayString(vcArray, 0x016C, "USER-DEFINED INTERRUPTS"); 336 | SetArrayString(vcArray, 0x016E, "USER-DEFINED INTERRUPTS"); 337 | SetArrayString(vcArray, 0x0170, "USER-DEFINED INTERRUPTS"); 338 | SetArrayString(vcArray, 0x0172, "USER-DEFINED INTERRUPTS"); 339 | SetArrayString(vcArray, 0x0174, "USER-DEFINED INTERRUPTS"); 340 | SetArrayString(vcArray, 0x0176, "USER-DEFINED INTERRUPTS"); 341 | SetArrayString(vcArray, 0x0178, "USER-DEFINED INTERRUPTS"); 342 | SetArrayString(vcArray, 0x017A, "USER-DEFINED INTERRUPTS"); 343 | SetArrayString(vcArray, 0x017C, "USER-DEFINED INTERRUPTS"); 344 | SetArrayString(vcArray, 0x017E, "USER-DEFINED INTERRUPTS"); 345 | SetArrayString(vcArray, 0x0180, "USER-DEFINED INTERRUPTS"); 346 | SetArrayString(vcArray, 0x0182, "USER-DEFINED INTERRUPTS"); 347 | SetArrayString(vcArray, 0x0184, "USER-DEFINED INTERRUPTS"); 348 | SetArrayString(vcArray, 0x0186, "USER-DEFINED INTERRUPTS"); 349 | SetArrayString(vcArray, 0x0188, "USER-DEFINED INTERRUPTS"); 350 | SetArrayString(vcArray, 0x018A, "USER-DEFINED INTERRUPTS"); 351 | SetArrayString(vcArray, 0x018C, "USER-DEFINED INTERRUPTS"); 352 | SetArrayString(vcArray, 0x018E, "USER-DEFINED INTERRUPTS"); 353 | SetArrayString(vcArray, 0x0190, "USER-DEFINED INTERRUPTS"); 354 | SetArrayString(vcArray, 0x0192, "USER-DEFINED INTERRUPTS"); 355 | SetArrayString(vcArray, 0x0194, "USER-DEFINED INTERRUPTS"); 356 | SetArrayString(vcArray, 0x0196, "USER-DEFINED INTERRUPTS"); 357 | SetArrayString(vcArray, 0x0198, "USER-DEFINED INTERRUPTS"); 358 | SetArrayString(vcArray, 0x019A, "USER-DEFINED INTERRUPTS"); 359 | SetArrayString(vcArray, 0x019C, "USER-DEFINED INTERRUPTS"); 360 | SetArrayString(vcArray, 0x019E, "USER-DEFINED INTERRUPTS"); 361 | SetArrayString(vcArray, 0x01A0, "USER-DEFINED INTERRUPTS"); 362 | SetArrayString(vcArray, 0x01A2, "USER-DEFINED INTERRUPTS"); 363 | SetArrayString(vcArray, 0x01A4, "USER-DEFINED INTERRUPTS"); 364 | SetArrayString(vcArray, 0x01A6, "USER-DEFINED INTERRUPTS"); 365 | SetArrayString(vcArray, 0x01A8, "USER-DEFINED INTERRUPTS"); 366 | SetArrayString(vcArray, 0x01AA, "USER-DEFINED INTERRUPTS"); 367 | SetArrayString(vcArray, 0x01AC, "USER-DEFINED INTERRUPTS"); 368 | SetArrayString(vcArray, 0x01AE, "USER-DEFINED INTERRUPTS"); 369 | SetArrayString(vcArray, 0x01B0, "USER-DEFINED INTERRUPTS"); 370 | SetArrayString(vcArray, 0x01B2, "USER-DEFINED INTERRUPTS"); 371 | SetArrayString(vcArray, 0x01B4, "USER-DEFINED INTERRUPTS"); 372 | SetArrayString(vcArray, 0x01B6, "USER-DEFINED INTERRUPTS"); 373 | SetArrayString(vcArray, 0x01B8, "USER-DEFINED INTERRUPTS"); 374 | SetArrayString(vcArray, 0x01BA, "USER-DEFINED INTERRUPTS"); 375 | SetArrayString(vcArray, 0x01BC, "USER-DEFINED INTERRUPTS"); 376 | SetArrayString(vcArray, 0x01BE, "USER-DEFINED INTERRUPTS"); 377 | SetArrayString(vcArray, 0x01C0, "USER-DEFINED INTERRUPTS"); 378 | SetArrayString(vcArray, 0x01C2, "USER-DEFINED INTERRUPTS"); 379 | SetArrayString(vcArray, 0x01C4, "USER-DEFINED INTERRUPTS"); 380 | SetArrayString(vcArray, 0x01C6, "USER-DEFINED INTERRUPTS"); 381 | SetArrayString(vcArray, 0x01C8, "USER-DEFINED INTERRUPTS"); 382 | SetArrayString(vcArray, 0x01CA, "USER-DEFINED INTERRUPTS"); 383 | SetArrayString(vcArray, 0x01CC, "USER-DEFINED INTERRUPTS"); 384 | SetArrayString(vcArray, 0x01CE, "USER-DEFINED INTERRUPTS"); 385 | SetArrayString(vcArray, 0x01D0, "USER-DEFINED INTERRUPTS"); 386 | SetArrayString(vcArray, 0x01D2, "USER-DEFINED INTERRUPTS"); 387 | SetArrayString(vcArray, 0x01D4, "USER-DEFINED INTERRUPTS"); 388 | SetArrayString(vcArray, 0x01D6, "USER-DEFINED INTERRUPTS"); 389 | SetArrayString(vcArray, 0x01D8, "USER-DEFINED INTERRUPTS"); 390 | SetArrayString(vcArray, 0x01DA, "USER-DEFINED INTERRUPTS"); 391 | SetArrayString(vcArray, 0x01DC, "USER-DEFINED INTERRUPTS"); 392 | SetArrayString(vcArray, 0x01DE, "USER-DEFINED INTERRUPTS"); 393 | SetArrayString(vcArray, 0x01E0, "USER-DEFINED INTERRUPTS"); 394 | SetArrayString(vcArray, 0x01E2, "USER-DEFINED INTERRUPTS"); 395 | SetArrayString(vcArray, 0x01E4, "USER-DEFINED INTERRUPTS"); 396 | SetArrayString(vcArray, 0x01E6, "USER-DEFINED INTERRUPTS"); 397 | SetArrayString(vcArray, 0x01E8, "USER-DEFINED INTERRUPTS"); 398 | SetArrayString(vcArray, 0x01EA, "USER-DEFINED INTERRUPTS"); 399 | SetArrayString(vcArray, 0x01EC, "USER-DEFINED INTERRUPTS"); 400 | SetArrayString(vcArray, 0x01EE, "USER-DEFINED INTERRUPTS"); 401 | SetArrayString(vcArray, 0x01F0, "USER-DEFINED INTERRUPTS"); 402 | SetArrayString(vcArray, 0x01F2, "USER-DEFINED INTERRUPTS"); 403 | SetArrayString(vcArray, 0x01F4, "USER-DEFINED INTERRUPTS"); 404 | SetArrayString(vcArray, 0x01F6, "USER-DEFINED INTERRUPTS"); 405 | SetArrayString(vcArray, 0x01F8, "USER-DEFINED INTERRUPTS"); 406 | SetArrayString(vcArray, 0x01FA, "USER-DEFINED INTERRUPTS"); 407 | SetArrayString(vcArray, 0x01FC, "USER-DEFINED INTERRUPTS"); 408 | SetArrayString(vcArray, 0x01FE, "USER-DEFINED INTERRUPTS"); 409 | } 410 | static CreateVectorNameArray() { 411 | auto vnArray; 412 | vnArray = CreateArray("VNARRAY"); 413 | SetArrayString(vnArray, 0x0008, "Vec4_BKPT"); 414 | SetArrayString(vnArray, 0x000A, "Vec5_BERR"); 415 | SetArrayString(vnArray, 0x000C, "Vec6_SWI"); 416 | SetArrayString(vnArray, 0x000E, "Vec7_ILLINSRT"); 417 | SetArrayString(vnArray, 0x0010, "Vec8_DIVBY0"); 418 | SetArrayString(vnArray, 0x0012, "Vec9_rsrvd"); 419 | SetArrayString(vnArray, 0x0014, "VecA_rsrvd"); 420 | SetArrayString(vnArray, 0x0016, "VecB_rsrvd"); 421 | SetArrayString(vnArray, 0x0018, "VecC_rsrvd"); 422 | SetArrayString(vnArray, 0x001A, "VecD_rsrvd"); 423 | SetArrayString(vnArray, 0x001C, "VecE_rsrvd"); 424 | SetArrayString(vnArray, 0x001E, "VecF_UNINITINT"); 425 | SetArrayString(vnArray, 0x0020, "Vec10_rsrvd"); 426 | SetArrayString(vnArray, 0x0022, "Vec11_Lvl1"); 427 | SetArrayString(vnArray, 0x0024, "Vec12_Lvl2"); 428 | SetArrayString(vnArray, 0x0026, "Vec13_Lvl3"); 429 | SetArrayString(vnArray, 0x0028, "Vec14_Lvl4"); 430 | SetArrayString(vnArray, 0x002A, "Vec15_Lvl5"); 431 | SetArrayString(vnArray, 0x002C, "Vec16_Lvl6"); 432 | SetArrayString(vnArray, 0x002E, "Vec17_Lvl7"); 433 | SetArrayString(vnArray, 0x0030, "Vec18_SPUR"); 434 | SetArrayString(vnArray, 0x0032, "Vec19_rsrvd"); 435 | SetArrayString(vnArray, 0x0034, "Vec1A_rsrvd"); 436 | SetArrayString(vnArray, 0x0036, "Vec1B_rsrvd"); 437 | SetArrayString(vnArray, 0x0038, "Vec1C_rsrvd"); 438 | SetArrayString(vnArray, 0x003A, "Vec1D_rsrvd"); 439 | SetArrayString(vnArray, 0x003C, "Vec1E_rsrvd"); 440 | SetArrayString(vnArray, 0x003E, "Vec1F_rsrvd"); 441 | SetArrayString(vnArray, 0x0040, "Vec20_rsrvd"); 442 | SetArrayString(vnArray, 0x0042, "Vec21_rsrvd"); 443 | SetArrayString(vnArray, 0x0044, "Vec22_rsrvd"); 444 | SetArrayString(vnArray, 0x0046, "Vec23_rsrvd"); 445 | SetArrayString(vnArray, 0x0048, "Vec24_rsrvd"); 446 | SetArrayString(vnArray, 0x004A, "Vec25_rsrvd"); 447 | SetArrayString(vnArray, 0x004C, "Vec26_rsrvd"); 448 | SetArrayString(vnArray, 0x004E, "Vec27_rsrvd"); 449 | SetArrayString(vnArray, 0x0050, "Vec28_rsrvd"); 450 | SetArrayString(vnArray, 0x0052, "Vec29_rsrvd"); 451 | SetArrayString(vnArray, 0x0054, "Vec2A_rsrvd"); 452 | SetArrayString(vnArray, 0x0056, "Vec2B_rsrvd"); 453 | SetArrayString(vnArray, 0x0058, "Vec2C_rsrvd"); 454 | SetArrayString(vnArray, 0x005A, "Vec2D_rsrvd"); 455 | SetArrayString(vnArray, 0x005C, "Vec2E_rsrvd"); 456 | SetArrayString(vnArray, 0x005E, "Vec2F_rsrvd"); 457 | SetArrayString(vnArray, 0x0060, "Vec30_rsrvd"); 458 | SetArrayString(vnArray, 0x0062, "Vec31_rsrvd"); 459 | SetArrayString(vnArray, 0x0064, "Vec32_rsrvd"); 460 | SetArrayString(vnArray, 0x0066, "Vec33_rsrvd"); 461 | SetArrayString(vnArray, 0x0068, "Vec34_rsrvd"); 462 | SetArrayString(vnArray, 0x006A, "Vec35_rsrvd"); 463 | SetArrayString(vnArray, 0x006C, "Vec36_rsrvd"); 464 | SetArrayString(vnArray, 0x006E, "Vec37_rsrvd"); 465 | SetArrayString(vnArray, 0x0070, "Vec38_user"); 466 | SetArrayString(vnArray, 0x0072, "Vec39_user"); 467 | SetArrayString(vnArray, 0x0074, "Vec3A_user"); 468 | SetArrayString(vnArray, 0x0076, "Vec3B_user"); 469 | SetArrayString(vnArray, 0x0078, "Vec3C_user"); 470 | SetArrayString(vnArray, 0x007A, "Vec3D_user"); 471 | SetArrayString(vnArray, 0x007C, "Vec3E_user"); 472 | SetArrayString(vnArray, 0x007E, "Vec3F_user"); 473 | SetArrayString(vnArray, 0x0080, "Vec40_user"); 474 | SetArrayString(vnArray, 0x0082, "Vec41_user"); 475 | SetArrayString(vnArray, 0x0084, "Vec42_user"); 476 | SetArrayString(vnArray, 0x0086, "Vec43_user"); 477 | SetArrayString(vnArray, 0x0088, "Vec44_user"); 478 | SetArrayString(vnArray, 0x008A, "Vec45_user"); 479 | SetArrayString(vnArray, 0x008C, "Vec46_user"); 480 | SetArrayString(vnArray, 0x008E, "Vec47_user"); 481 | SetArrayString(vnArray, 0x0090, "Vec48_user"); 482 | SetArrayString(vnArray, 0x0092, "Vec49_user"); 483 | SetArrayString(vnArray, 0x0094, "Vec4A_user"); 484 | SetArrayString(vnArray, 0x0096, "Vec4B_user"); 485 | SetArrayString(vnArray, 0x0098, "Vec4C_user"); 486 | SetArrayString(vnArray, 0x009A, "Vec4D_user"); 487 | SetArrayString(vnArray, 0x009C, "Vec4E_user"); 488 | SetArrayString(vnArray, 0x009E, "Vec4F_user"); 489 | SetArrayString(vnArray, 0x00A0, "Vec50_user"); 490 | SetArrayString(vnArray, 0x00A2, "Vec51_user"); 491 | SetArrayString(vnArray, 0x00A4, "Vec52_user"); 492 | SetArrayString(vnArray, 0x00A6, "Vec53_user"); 493 | SetArrayString(vnArray, 0x00A8, "Vec54_user"); 494 | SetArrayString(vnArray, 0x00AA, "Vec55_user"); 495 | SetArrayString(vnArray, 0x00AC, "Vec56_user"); 496 | SetArrayString(vnArray, 0x00AE, "Vec57_user"); 497 | SetArrayString(vnArray, 0x00B0, "Vec58_user"); 498 | SetArrayString(vnArray, 0x00B2, "Vec59_user"); 499 | SetArrayString(vnArray, 0x00B4, "Vec5A_user"); 500 | SetArrayString(vnArray, 0x00B6, "Vec5B_user"); 501 | SetArrayString(vnArray, 0x00B8, "Vec5C_user"); 502 | SetArrayString(vnArray, 0x00BA, "Vec5D_user"); 503 | SetArrayString(vnArray, 0x00BC, "Vec5E_user"); 504 | SetArrayString(vnArray, 0x00BE, "Vec5F_user"); 505 | SetArrayString(vnArray, 0x00C0, "Vec60_user"); 506 | SetArrayString(vnArray, 0x00C2, "Vec61_user"); 507 | SetArrayString(vnArray, 0x00C4, "Vec62_user"); 508 | SetArrayString(vnArray, 0x00C6, "Vec63_user"); 509 | SetArrayString(vnArray, 0x00C8, "Vec64_user"); 510 | SetArrayString(vnArray, 0x00CA, "Vec65_user"); 511 | SetArrayString(vnArray, 0x00CC, "Vec66_user"); 512 | SetArrayString(vnArray, 0x00CE, "Vec67_user"); 513 | SetArrayString(vnArray, 0x00D0, "Vec68_user"); 514 | SetArrayString(vnArray, 0x00D2, "Vec69_user"); 515 | SetArrayString(vnArray, 0x00D4, "Vec6A_user"); 516 | SetArrayString(vnArray, 0x00D6, "Vec6B_user"); 517 | SetArrayString(vnArray, 0x00D8, "Vec6C_user"); 518 | SetArrayString(vnArray, 0x00DA, "Vec6D_user"); 519 | SetArrayString(vnArray, 0x00DC, "Vec6E_user"); 520 | SetArrayString(vnArray, 0x00DE, "Vec6F_user"); 521 | SetArrayString(vnArray, 0x00E0, "Vec70_user"); 522 | SetArrayString(vnArray, 0x00E2, "Vec71_user"); 523 | SetArrayString(vnArray, 0x00E4, "Vec72_user"); 524 | SetArrayString(vnArray, 0x00E6, "Vec73_user"); 525 | SetArrayString(vnArray, 0x00E8, "Vec74_user"); 526 | SetArrayString(vnArray, 0x00EA, "Vec75_user"); 527 | SetArrayString(vnArray, 0x00EC, "Vec76_user"); 528 | SetArrayString(vnArray, 0x00EE, "Vec77_user"); 529 | SetArrayString(vnArray, 0x00F0, "Vec78_user"); 530 | SetArrayString(vnArray, 0x00F2, "Vec79_user"); 531 | SetArrayString(vnArray, 0x00F4, "Vec7A_user"); 532 | SetArrayString(vnArray, 0x00F6, "Vec7B_user"); 533 | SetArrayString(vnArray, 0x00F8, "Vec7C_user"); 534 | SetArrayString(vnArray, 0x00FA, "Vec7D_user"); 535 | SetArrayString(vnArray, 0x00FC, "Vec7E_user"); 536 | SetArrayString(vnArray, 0x00FE, "Vec7F_user"); 537 | SetArrayString(vnArray, 0x0100, "Vec80_user"); 538 | SetArrayString(vnArray, 0x0102, "Vec81_user"); 539 | SetArrayString(vnArray, 0x0104, "Vec82_user"); 540 | SetArrayString(vnArray, 0x0106, "Vec83_user"); 541 | SetArrayString(vnArray, 0x0108, "Vec84_user"); 542 | SetArrayString(vnArray, 0x010A, "Vec85_user"); 543 | SetArrayString(vnArray, 0x010C, "Vec86_user"); 544 | SetArrayString(vnArray, 0x010E, "Vec87_user"); 545 | SetArrayString(vnArray, 0x0110, "Vec88_user"); 546 | SetArrayString(vnArray, 0x0112, "Vec89_user"); 547 | SetArrayString(vnArray, 0x0114, "Vec8A_user"); 548 | SetArrayString(vnArray, 0x0116, "Vec8B_user"); 549 | SetArrayString(vnArray, 0x0118, "Vec8C_user"); 550 | SetArrayString(vnArray, 0x011A, "Vec8D_user"); 551 | SetArrayString(vnArray, 0x011C, "Vec8E_user"); 552 | SetArrayString(vnArray, 0x011E, "Vec8F_user"); 553 | SetArrayString(vnArray, 0x0120, "Vec90_user"); 554 | SetArrayString(vnArray, 0x0122, "Vec91_user"); 555 | SetArrayString(vnArray, 0x0124, "Vec92_user"); 556 | SetArrayString(vnArray, 0x0126, "Vec93_user"); 557 | SetArrayString(vnArray, 0x0128, "Vec94_user"); 558 | SetArrayString(vnArray, 0x012A, "Vec95_user"); 559 | SetArrayString(vnArray, 0x012C, "Vec96_user"); 560 | SetArrayString(vnArray, 0x012E, "Vec97_user"); 561 | SetArrayString(vnArray, 0x0130, "Vec98_user"); 562 | SetArrayString(vnArray, 0x0132, "Vec99_user"); 563 | SetArrayString(vnArray, 0x0134, "Vec9A_user"); 564 | SetArrayString(vnArray, 0x0136, "Vec9B_user"); 565 | SetArrayString(vnArray, 0x0138, "Vec9C_user"); 566 | SetArrayString(vnArray, 0x013A, "Vec9D_user"); 567 | SetArrayString(vnArray, 0x013C, "Vec9E_user"); 568 | SetArrayString(vnArray, 0x013E, "Vec9F_user"); 569 | SetArrayString(vnArray, 0x0140, "VecA0_user"); 570 | SetArrayString(vnArray, 0x0142, "VecA1_user"); 571 | SetArrayString(vnArray, 0x0144, "VecA2_user"); 572 | SetArrayString(vnArray, 0x0146, "VecA3_user"); 573 | SetArrayString(vnArray, 0x0148, "VecA4_user"); 574 | SetArrayString(vnArray, 0x014A, "VecA5_user"); 575 | SetArrayString(vnArray, 0x014C, "VecA6_user"); 576 | SetArrayString(vnArray, 0x014E, "VecA7_user"); 577 | SetArrayString(vnArray, 0x0150, "VecA8_user"); 578 | SetArrayString(vnArray, 0x0152, "VecA9_user"); 579 | SetArrayString(vnArray, 0x0154, "VecAA_user"); 580 | SetArrayString(vnArray, 0x0156, "VecAB_user"); 581 | SetArrayString(vnArray, 0x0158, "VecAC_user"); 582 | SetArrayString(vnArray, 0x015A, "VecAD_user"); 583 | SetArrayString(vnArray, 0x015C, "VecAE_user"); 584 | SetArrayString(vnArray, 0x015E, "VecAF_user"); 585 | SetArrayString(vnArray, 0x0160, "VecB0_user"); 586 | SetArrayString(vnArray, 0x0162, "VecB1_user"); 587 | SetArrayString(vnArray, 0x0164, "VecB2_user"); 588 | SetArrayString(vnArray, 0x0166, "VecB3_user"); 589 | SetArrayString(vnArray, 0x0168, "VecB4_user"); 590 | SetArrayString(vnArray, 0x016A, "VecB5_user"); 591 | SetArrayString(vnArray, 0x016C, "VecB6_user"); 592 | SetArrayString(vnArray, 0x016E, "VecB7_user"); 593 | SetArrayString(vnArray, 0x0170, "VecB8_user"); 594 | SetArrayString(vnArray, 0x0172, "VecB9_user"); 595 | SetArrayString(vnArray, 0x0174, "VecBA_user"); 596 | SetArrayString(vnArray, 0x0176, "VecBB_user"); 597 | SetArrayString(vnArray, 0x0178, "VecBC_user"); 598 | SetArrayString(vnArray, 0x017A, "VecBD_user"); 599 | SetArrayString(vnArray, 0x017C, "VecBE_user"); 600 | SetArrayString(vnArray, 0x017E, "VecBF_user"); 601 | SetArrayString(vnArray, 0x0180, "VecC0_user"); 602 | SetArrayString(vnArray, 0x0182, "VecC1_user"); 603 | SetArrayString(vnArray, 0x0184, "VecC2_user"); 604 | SetArrayString(vnArray, 0x0186, "VecC3_user"); 605 | SetArrayString(vnArray, 0x0188, "VecC4_user"); 606 | SetArrayString(vnArray, 0x018A, "VecC5_user"); 607 | SetArrayString(vnArray, 0x018C, "VecC6_user"); 608 | SetArrayString(vnArray, 0x018E, "VecC7_user"); 609 | SetArrayString(vnArray, 0x0190, "VecC8_user"); 610 | SetArrayString(vnArray, 0x0192, "VecC9_user"); 611 | SetArrayString(vnArray, 0x0194, "VecCA_user"); 612 | SetArrayString(vnArray, 0x0196, "VecCB_user"); 613 | SetArrayString(vnArray, 0x0198, "VecCC_user"); 614 | SetArrayString(vnArray, 0x019A, "VecCD_user"); 615 | SetArrayString(vnArray, 0x019C, "VecCE_user"); 616 | SetArrayString(vnArray, 0x019E, "VecCF_user"); 617 | SetArrayString(vnArray, 0x01A0, "VecD0_user"); 618 | SetArrayString(vnArray, 0x01A2, "VecD1_user"); 619 | SetArrayString(vnArray, 0x01A4, "VecD2_user"); 620 | SetArrayString(vnArray, 0x01A6, "VecD3_user"); 621 | SetArrayString(vnArray, 0x01A8, "VecD4_user"); 622 | SetArrayString(vnArray, 0x01AA, "VecD5_user"); 623 | SetArrayString(vnArray, 0x01AC, "VecD6_user"); 624 | SetArrayString(vnArray, 0x01AE, "VecD7_user"); 625 | SetArrayString(vnArray, 0x01B0, "VecD8_user"); 626 | SetArrayString(vnArray, 0x01B2, "VecD9_user"); 627 | SetArrayString(vnArray, 0x01B4, "VecDA_user"); 628 | SetArrayString(vnArray, 0x01B6, "VecDB_user"); 629 | SetArrayString(vnArray, 0x01B8, "VecDC_user"); 630 | SetArrayString(vnArray, 0x01BA, "VecDD_user"); 631 | SetArrayString(vnArray, 0x01BC, "VecDE_user"); 632 | SetArrayString(vnArray, 0x01BE, "VecDF_user"); 633 | SetArrayString(vnArray, 0x01C0, "VecE0_user"); 634 | SetArrayString(vnArray, 0x01C2, "VecE1_user"); 635 | SetArrayString(vnArray, 0x01C4, "VecE2_user"); 636 | SetArrayString(vnArray, 0x01C6, "VecE3_user"); 637 | SetArrayString(vnArray, 0x01C8, "VecE4_user"); 638 | SetArrayString(vnArray, 0x01CA, "VecE5_user"); 639 | SetArrayString(vnArray, 0x01CC, "VecE6_user"); 640 | SetArrayString(vnArray, 0x01CE, "VecE7_user"); 641 | SetArrayString(vnArray, 0x01D0, "VecE8_user"); 642 | SetArrayString(vnArray, 0x01D2, "VecE9_user"); 643 | SetArrayString(vnArray, 0x01D4, "VecEA_user"); 644 | SetArrayString(vnArray, 0x01D6, "VecEB_user"); 645 | SetArrayString(vnArray, 0x01D8, "VecEC_user"); 646 | SetArrayString(vnArray, 0x01DA, "VecED_user"); 647 | SetArrayString(vnArray, 0x01DC, "VecEE_user"); 648 | SetArrayString(vnArray, 0x01DE, "VecEF_user"); 649 | SetArrayString(vnArray, 0x01E0, "VecF0_user"); 650 | SetArrayString(vnArray, 0x01E2, "VecF1_user"); 651 | SetArrayString(vnArray, 0x01E4, "VecF2_user"); 652 | SetArrayString(vnArray, 0x01E6, "VecF3_user"); 653 | SetArrayString(vnArray, 0x01E8, "VecF4_user"); 654 | SetArrayString(vnArray, 0x01EA, "VecF5_user"); 655 | SetArrayString(vnArray, 0x01EC, "VecF6_user"); 656 | SetArrayString(vnArray, 0x01EE, "VecF7_user"); 657 | SetArrayString(vnArray, 0x01F0, "VecF8_user"); 658 | SetArrayString(vnArray, 0x01F2, "VecF9_user"); 659 | SetArrayString(vnArray, 0x01F4, "VecFA_user"); 660 | SetArrayString(vnArray, 0x01F6, "VecFB_user"); 661 | SetArrayString(vnArray, 0x01F8, "VecFC_user"); 662 | SetArrayString(vnArray, 0x01FA, "VecFD_user"); 663 | SetArrayString(vnArray, 0x01FC, "VecFE_user"); 664 | SetArrayString(vnArray, 0x01FE, "VecFF_user"); 665 | } 666 | --------------------------------------------------------------------------------