--- spal60sr\src\TSSGCtrl\SSGCtrl.original.cpp	Mon May 26 13:47:18 2003
+++ spal60sr\src\TSSGCtrl\SSGCtrl.cpp	Mon May 26 13:47:18 2003
@@ -23,6 +23,103 @@
 #include "SSBundleFloatCalc.h"
 #include "SSSplit.h"
 
+#define UNICODE_SUPPORT               1
+#define ADDRESS_NAMING_FEP_SUPPORT    1
+#define FIX_ADDRESS_NAMING_FROM_FLOAT 1
+#define ADDITIONAL_TAGS               1
+#define FIX_TOGGLE_BYTE_ARRAY         1
+#define ALLOCATE_SUPPORT              1
+#define FIX_GET_SSG_DATA_FILE         1
+#define FIX_REPEAT                    1
+#define FIX_REMOVE_SPACE              1
+#define FIX_BYTE_ARRAY_FIND           1
+#define ERRORSKIP_SUPPORT             1
+#define FIX_DGRID                     1
+#define ADDRESS_NAMING_FMT_SUPPORT    1
+#define IMAGE_SIZE                    1
+#define NOCACHED_MEMORY_LIST          1
+#define FORMAT_NAME_STRING            1
+#define FIX_DOUBLE_LIST               1
+#define COMMON_LIST                   1
+#define LIST_PARSER                   1
+#define FIX_FORMAT                    1
+
+#if defined(FIX_REPEAT) && FIX_REPEAT
+#include <stdlib.h>
+#ifndef _countof
+#define _countof(_Array) (sizeof(_Array) / sizeof((_Array)[0]))
+#endif
+#define RT_FORMAT 0x20
+#endif
+
+#if defined(FIX_BYTE_ARRAY_FIND) && FIX_BYTE_ARRAY_FIND
+#include <limits.h>
+#ifndef SIZE_MAX
+#ifdef _WIN64
+#define SIZE_MAX _UI64_MAX
+#else
+#define SIZE_MAX UINT_MAX
+#endif
+#endif
+#endif
+
+#if (defined(UNICODE_SUPPORT           ) && UNICODE_SUPPORT           ) || \
+    (defined(FIX_TOGGLE_BYTE_ARRAY     ) && FIX_TOGGLE_BYTE_ARRAY     ) || \
+    (defined(OPTIMIZE_STRINGDIVISION   ) && OPTIMIZE_STRINGDIVISION   ) || \
+    (defined(FIX_LOOP_BYTE_ARRAY       ) && FIX_LOOP_BYTE_ARRAY       ) || \
+    (defined(FIX_GET_SSG_DATA_FILE     ) && FIX_GET_SSG_DATA_FILE     ) || \
+    (defined(FIX_REPEAT                ) && FIX_REPEAT                ) || \
+    (defined(FIX_REMOVE_SPACE          ) && FIX_REMOVE_SPACE          ) || \
+    (defined(FIX_BYTE_ARRAY_FIND       ) && FIX_BYTE_ARRAY_FIND       ) || \
+    (defined(LOCAL_MEMORY_SUPPORT      ) && LOCAL_MEMORY_SUPPORT      ) || \
+    (defined(ADDRESS_NAMING_FMT_SUPPORT) && ADDRESS_NAMING_FMT_SUPPORT)
+#include "intrinsic.h"
+#endif
+
+#if (defined(UNICODE_SUPPORT) && UNICODE_SUPPORT) || (defined(FIX_PARSER) && FIX_PARSER)
+extern HANDLE hHeap;
+#endif
+
+#if defined(ADDITIONAL_TAGS) && ADDITIONAL_TAGS
+#include "AdditionalTags.cpp"
+
+#if defined(ALLOCATE_SUPPORT) && ALLOCATE_SUPPORT
+#ifndef TYPEDEF_PROCESSMEMORYBLOCK
+#define TYPEDEF_PROCESSMEMORYBLOCK
+typedef struct {
+	ULARGE_INTEGER Id;
+	LPVOID         MemoryBlock;
+} PROCESSMEMORYBLOCK, *PPROCESSMEMORYBLOCK;
+#endif
+
+extern size_t             nNumberOfProcessMemory;
+extern PROCESSMEMORYBLOCK *lpProcessMemory;
+#endif	// ALLOCATE_SUPPORT
+#endif	// ADDITIONAL_TAGS
+
+#if defined(ERRORSKIP_SUPPORT) && ERRORSKIP_SUPPORT
+#include "MainUnit.h"
+extern TMainForm *MainForm;
+#define AT_ERRORSKIP 0x2000
+#endif
+
+#if defined(FIX_DGRID) && FIX_DGRID
+#include "SSGSubjectProperty.h"
+#endif
+
+#if defined(IMAGE_SIZE) && IMAGE_SIZE
+extern LPDWORD lpdwImageSize;
+extern size_t  nNumberOfImageSize;
+#endif
+
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+DWORD RepeatDepth;
+#endif
+
+#if defined(FORMAT_NAME_STRING) && FORMAT_NAME_STRING
+#include <float.h>
+#endif
+
 //---------------------------------------------------------------------
 //Ƃ|
 //---------------------------------------------------------------------
@@ -96,6 +193,50 @@
  dataFileMap.clear();
  LockClear();
 
+#if defined(FIX_DGRID) && FIX_DGRID
+	ClearSubjectProperty();
+#endif
+
+#if defined(ALLOCATE_SUPPORT) && ALLOCATE_SUPPORT
+	if (lpProcessMemory)
+	{
+		if (nNumberOfProcessMemory)
+		{
+			HANDLE hProcess;
+			size_t i;
+
+			hProcess = processCtrl.Open(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION);
+			if (hProcess)
+			{
+				i = nNumberOfProcessMemory;
+				do
+				{
+					if (lpProcessMemory[--i].Protect && lpProcessMemory[i].Address)
+						VirtualFreeEx(hProcess, lpProcessMemory[i].Address, 0, MEM_RELEASE);
+				} while (i);
+				CloseHandle(hProcess);
+			}
+			i = nNumberOfProcessMemory;
+			do
+			{
+				if (!lpProcessMemory[--i].Protect && lpProcessMemory[i].Address)
+					HeapFree(hHeap, 0, lpProcessMemory[i].Address);
+			} while (i);
+			nNumberOfProcessMemory = 0;
+		}
+		HeapFree(hHeap, 0, lpProcessMemory);
+		lpProcessMemory = NULL;
+	}
+#endif
+
+#if defined(IMAGE_SIZE) && IMAGE_SIZE
+	nNumberOfImageSize = 0;
+	if (lpdwImageSize)
+	{
+		HeapFree(hHeap, 0, lpdwImageSize);
+		lpdwImageSize = NULL;
+	}
+#endif
 }
 //---------------------------------------------------------------------
 //uێĂ郍bN̉֐v
@@ -133,6 +274,9 @@
  stack<TSSDir*> ParentStack;
  ParentStack.push(rootSubject);
 
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+ RepeatDepth = 0;
+#endif
  EnumReadSSG(SSGFile, &ParentStack, NULL);
 
  attributeSelector.EndElementCheck();
@@ -146,8 +290,15 @@
 //	EΏۂADJt@C̏ꍇ́AADJElemɑΉ
 //	@TDialogAdjustmentAttributẽ|C^nĉBiȊONULLj
 //---------------------------------------------------------------------
+#if defined(FIX_PARSER) && FIX_PARSER
+#include "ReplaceDefine.c"
+#endif
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
 void TSSGCtrl::EnumReadSSG(vector<string> &SSGFile, stack<TSSDir*> *ParentStack,
 	TDialogAdjustmentAttribute *ADJElem)
+#else
+void TSSGCtrl::EnumReadSSG(vector<string> &SSGFile, stack<TSSDir *> *ParentStack, TDialogAdjustmentAttribute *ADJElem, DWORD RepeatIndex/* = 0*/, DWORD ParentRepeat/* = MAXDWORD*/)
+#endif
 {
  set<string> ADJSubjectSet;		//ADJpڃZbg
  if(ADJElem!=NULL){
@@ -199,6 +350,15 @@
 		}
 
         SSGS->Setting(*this);
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+		TSSGSubjectProperty *prop = GetSubjectProperty(SSGS);
+		if (prop)
+		{
+			prop->RepeatDepth  = RepeatDepth;
+			prop->RepeatIndex  = RepeatIndex;
+			prop->ParentRepeat = ParentRepeat;
+		}
+#endif
 	}else if(tmpS=="[back"){
 		if( ParentStack->size()>1 ){
 			TDirAttribute NewAElem;
@@ -217,6 +377,9 @@
 		}
 	}else if(tmpS=="[replace"){
 		TReplaceAttribute *NewAElem = new TReplaceAttribute();
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(strD, LineS.c_str());
 
         vector<string> *tmpL;
@@ -229,12 +392,19 @@
 		attributeSelector.AddElement(NewAElem);
 
 		//ċA
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
 		EnumReadSSG(*tmpL, ParentStack, ADJElem);
+#else
+		EnumReadSSG(*tmpL, ParentStack, ADJElem, RepeatIndex, ParentRepeat);
+#endif
 		{//AĂ̂ŁA[replace]O
         	TReplaceAttribute AElem;
 			attributeSelector.EraseElement(&AElem);
         }
 	}else if(tmpS=="[size"){	//ANZXTCYw薽
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		long tmpI = TStringDivision::ToLongDef(LineS, -1);
 		if(tmpI>=0){
             //[size]t
@@ -243,6 +413,9 @@
 			attributeSelector.PushElement(NewAElem);
 		}
 	}else if(tmpS=="[adjustment"){	//[adjustment]t
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		TAdjustmentAttribute *NewAElem = TSSGCtrl::MakeAdjustmentClass(strD.Half(&LineS, ",", 0));
         if(NewAElem!=NULL){
 	        NewAElem->Setting(*this, LineS.c_str());
@@ -255,6 +428,9 @@
 		TCRCAdjustmentAttribute NewAElem; //␳ł΁Aǂł悢
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[funnel"){	//[funnel]t
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		TFunnelAttribute *NewAElem = new TFunnelAttribute();
 		NewAElem->Setting(LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
@@ -262,13 +438,64 @@
 		TFunnelAttribute NewAElem;
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[repeat"){	//JԂI
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
 		vector<string> tmpV( ReadSSRFile(LineS) );
 		if(!tmpV.empty()){
 			//݂̐ݒ(ReadStruct)pȂAWJt@C֍ċA
 			EnumReadSSG(tmpV, ParentStack, ADJElem);
 		}
+#else
+		vector<DWORD>  indices;
+		vector<string> tmpV(ReadSSRFile(LineS, indices));
+
+		if (!tmpV.empty())
+		{
+			if (!indices.empty())
+			{
+				DWORD                    parent;
+				TSSGSubjectProperty      *prop;
+				vector<string>           SSGFile;
+				vector<DWORD>::iterator  repeat;
+				vector<string>::iterator it;
+
+				prop = GrowSubjectProperty(&parent);
+				if (prop)
+				{
+					prop->RepeatDepth  = RepeatDepth;
+					prop->RepeatIndex  = RepeatIndex;
+					prop->ParentRepeat = ParentRepeat;
+				}
+				SSGFile.resize(tmpV.size() / indices.size());
+				RepeatDepth++;
+				repeat = indices.begin();
+				it = tmpV.begin();
+				do
+				{
+					vector<string>::iterator dest;
+
+					dest = SSGFile.begin();
+					do
+					{
+						*(dest++) = *(it++);
+					} while (dest != SSGFile.end());
+					EnumReadSSG(SSGFile, ParentStack, ADJElem, *(repeat++), parent);
+				} while (it < tmpV.end());
+				RepeatDepth--;
+			}
+			else
+			{
+				EnumReadSSG(tmpV, ParentStack, ADJElem, RepeatIndex, ParentRepeat);
+			}
+		}
+#endif
 	}else if(tmpS=="[io_fep"){	//[io_fep]t
 		TIO_FEPAttribute *NewAElem = new TIO_FEPAttribute(); //io_fep
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
         NewAElem->Setting(strD, LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
 	}else if(tmpS=="[/io_fep"){	//[io_fep]
@@ -276,6 +503,9 @@
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[e_with"){	//[e_with]t
 		TEndWithAttribute *NewAElem = new TEndWithAttribute(); //e_with
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
 	}else if(tmpS=="[/e_with"){	//[e_with]
@@ -283,6 +513,9 @@
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[enabled"){	//[enabled]t
 		TEnabledAttribute *NewAElem = new TEnabledAttribute(); //enabled
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(LineS.c_str());
 		attributeSelector.AddElement(NewAElem);
 	}else if(tmpS=="[/enabled"){	//[enabled]
@@ -290,6 +523,9 @@
 		attributeSelector.EraseElement(&NewAElem);
 	}else if(tmpS=="[adjust_check"){	//[adjust_check]t
 		TAdjustCheckAttribute *NewAElem = new TAdjustCheckAttribute();
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(strD, LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
 	}else if(tmpS=="[/adjust_check"){	//[adjust_check]
@@ -297,6 +533,9 @@
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[child_rw"){	//[child_rw]t
 		TChildRWAttribute *NewAElem = new TChildRWAttribute(); //child_rw
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(strD, LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
 	}else if(tmpS=="[/child_rw"){	//[child_rw]
@@ -304,6 +543,9 @@
 		attributeSelector.PopElement(&NewAElem);
 	}else if(tmpS=="[caution"){	//[caution]t
 		TCautionAttribute *NewAElem = new TCautionAttribute(); //caution
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		NewAElem->Setting(LineS.c_str());
 		attributeSelector.PushElement(NewAElem);
 	}else if(tmpS=="[/caution"){	//[caution]
@@ -317,11 +559,17 @@
 			if(*VIt=="[/involve]")break;
 			tmpV.push_back(*VIt);
 		}
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		FName += strD.Trim(LineS);
 		FName += ".ssl";
 		SetSSGDataFile(&tmpV, FName, true);
         if(VIt==VEnd) return;  //[/involve]݂Ȃ
 	}else if(tmpS=="[note"){
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		bool IsMemoWordWrap = (strD.Trim(LineS)=="wordwrap");
 
 		vector<string> tmpV;
@@ -338,15 +586,35 @@
 			ADJElem->SetMemo(tmpV);
 		}
         if(VIt==VEnd) return;  //[/note]݂Ȃ
+#if !defined(FIX_PARSER) || !FIX_PARSER
 	}else if(tmpS=="[process"){		processNameVec.push_back(LineS);
 	}else if(tmpS=="[title"){		script.SetDistinction("title"	, LineS.c_str());
 	}else if(tmpS=="[maker"){		script.SetDistinction("maker"	, LineS.c_str());
 	}else if(tmpS=="[creator"){		script.SetDistinction("creator"	, LineS.c_str());
 	}else if(tmpS=="[distinction"){		
+#else
+	} else if (tmpS == "[process") {
+		ReplaceDefine(&attributeSelector, &LineS);
+		processNameVec.push_back(LineS);
+	} else if (tmpS == "[title") {
+		ReplaceDefine(&attributeSelector, &LineS);
+		script.SetDistinction("title", LineS.c_str());
+	} else if (tmpS == "[maker") {
+		ReplaceDefine(&attributeSelector, &LineS);
+		script.SetDistinction("maker", LineS.c_str());
+	} else if (tmpS == "[creator") {
+		ReplaceDefine(&attributeSelector, &LineS);
+		script.SetDistinction("creator", LineS.c_str());
+	} else if (tmpS == "[distinction") {
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		tmpS = strD.Half(&LineS, "=", 0, strD::dtESCAPE|strD::etREPLACE|strD::etTRIM);
 		if(tmpS != "=") script.SetDistinction(tmpS.c_str(), LineS.c_str());
 	}else if(ADJSubjectSet.find(tmpS)!=ADJSubjectSetEnd){
 		TSSGSubject *SSGS;
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		if(tmpS=="[calc"){
 			tmpS = strD.Half(&LineS, ",", 1);
 			SSGS = new TSSCalc();
@@ -363,12 +631,29 @@
 		SSGS->Setting(*this);
         ParentStack->top()->GetChildVec()->push_back( SSGS );
         SSGS->SetAttribute( attributeSelector.GetNowAtteributeVec() );
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+		TSSGSubjectProperty *prop = GetSubjectProperty(SSGS);
+		if (prop)
+		{
+			prop->RepeatDepth  = RepeatDepth;
+			prop->RepeatIndex  = RepeatIndex;
+			prop->ParentRepeat = ParentRepeat;
+		}
+#endif
 	}else if(tmpS=="[val"){
 		if(ADJElem==NULL) continue;
+#if defined(FIX_PARSER) && FIX_PARSER
+		ReplaceDefine(&attributeSelector, &LineS);
+#endif
 		ADJElem->SetValStr( LineS.c_str() );
 	}else if(tmpS=="[/script"){
 		break;
 	}
+#if defined(ADDITIONAL_TAGS) && ADDITIONAL_TAGS
+	else{
+		AdditionalTags(this, ParentStack->top(), tmpS, LineS);
+	}
+#endif
  }
 
 }
@@ -489,6 +774,118 @@
 //	E܂xJĂȂt@CȂAJ܂B
 //	Egqɂ'.'܂߂
 //---------------------------------------------------------------------
+#if defined(FIX_GET_SSG_DATA_FILE) && FIX_GET_SSG_DATA_FILE
+void __stdcall FixGetSSGDataFile(string &FileName)
+{
+	char   *begin, *end;
+	size_t length;
+
+	// it do not checking multibyte,
+	// because space is not the lead and tail byte of codepage 932.
+
+	begin = FileName.begin();
+	while (__intrinsic_isspace_without_return(*begin))
+		begin++;
+	end = FileName.end() - 1;
+	while (end > begin && __intrinsic_isspace_without_return(*end))
+		end--;
+	if (++end == FileName.end() && begin == FileName.begin())
+		return;
+	length = end - begin;
+	if (begin != FileName.begin())
+		memcpy(begin, FileName.begin(), length);
+	FileName.resize(length);
+}
+//---------------------------------------------------------------------
+#endif
+#if defined(LOCAL_MEMORY_SUPPORT) && LOCAL_MEMORY_SUPPORT
+BOOL __fastcall TSSGCtrl_IsRemoteProcess(LPCSTR p)
+{
+	if (p)
+	{
+		char c = *(p++);
+		while (__intrinsic_isspace(c))
+			c = *(p++);
+		if (c == '_')
+			do
+			{
+				c = *(p++);
+			} while (__intrinsic_isspace(c));
+		if (c == 'L')
+		{
+			c = *p;
+			if (__intrinsic_isspace(c) || c == '{')
+				return FALSE;
+		}
+	}
+	return TRUE;
+}
+//---------------------------------------------------------------------
+HANDLE __stdcall TSSGCtrl_OpenProcess(TProcessCtrl *processCtrl, DWORD Mode, LPCSTR addressStr)
+{
+	return TSSGCtrl_IsRemoteProcess(addressStr) ?
+		processCtrl->Open(Mode) :
+		::GetCurrentProcess();
+}
+//---------------------------------------------------------------------
+unsigned long __stdcall TSSGCtrl_Read_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD *Address, vector<TProcessAccessElementBase*> &AEVec, const string &AddressStr)
+{
+	return _this->Read(SSGS, TSSGCtrl_IsRemoteProcess(AddressStr.c_str()) ? ProcessHandle : ::GetCurrentProcess(), Address, AEVec);
+}
+//---------------------------------------------------------------------
+unsigned long __stdcall TSSGCtrl_Write_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD *Address, vector<TProcessAccessElementBase*> &AEVec, const string &AddressStr)
+{
+	return _this->Write(SSGS, TSSGCtrl_IsRemoteProcess(AddressStr.c_str()) ? ProcessHandle : ::GetCurrentProcess(), Address, AEVec);
+}
+//---------------------------------------------------------------------
+long __stdcall TSSGCtrl_Compare_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD *Address, vector<TProcessAccessElementBase*> &AEVec, const string &AddressStr)
+{
+	return _this->Compare(SSGS, TSSGCtrl_IsRemoteProcess(AddressStr.c_str()) ? ProcessHandle : ::GetCurrentProcess(), Address, AEVec);
+}
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneRead_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr)
+{
+	return _this->OneRead(SSGS, TSSGCtrl_IsRemoteProcess(AddressStr.c_str()) ? ProcessHandle : ::GetCurrentProcess(), Address, Data, Size);
+}
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneWrite_with_CheckLocalMemory(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr)
+{
+	return _this->OneWrite(SSGS, TSSGCtrl_IsRemoteProcess(AddressStr.c_str()) ? ProcessHandle : ::GetCurrentProcess(), Address, Data, Size);
+}
+//---------------------------------------------------------------------
+#endif
+#if (defined(FIX_REPEAT) && FIX_REPEAT) || (defined(FIX_REMOVE_SPACE) && FIX_REMOVE_SPACE) || (defined(NOCACHED_MEMORY_LIST) && NOCACHED_MEMORY_LIST)
+#include "TrimString.c"
+#endif
+#if defined(NOCACHED_MEMORY_LIST) && NOCACHED_MEMORY_LIST
+BOOL __fastcall TSSGCtrl_GetSSGDataFile_CheckNocacheParam(vector<string> *tmpV)
+{
+	if (tmpV->size() >= 8)
+	{
+		char *p = (*tmpV)[7].begin();
+		while (__intrinsic_isspace(*p))
+			p++;
+		size_t length = (*tmpV)[7].end() - p;
+		if (length >= 7)
+		{
+			while (length >= 7 && __intrinsic_isspace(*(p + length - 1)))
+				length--;
+			if (length == 7 && *(LPDWORD)p == BSWAP32('noca') && *(LPWORD)(p + 4) == BSWAP16('ch') && *(p + 6) == 'e')
+				return TRUE;
+		}
+	}
+	return FALSE;
+}
+//---------------------------------------------------------------------
+void __cdecl TSSGCtrl_GetSSGDataFile_FixSetSSGDataFile(TSSGCtrl *_this, vector<string> *Data, const string& FileName, BOOL IsNocache)
+{
+	if (!IsNocache)
+		_this->SetSSGDataFile(Data, FileName, false);
+	else
+		(*_this->GetDataFileMap())[_this->strD.Lower(FileName)][""] = *Data;
+}
+//---------------------------------------------------------------------
+#endif
 vector<string> * TSSGCtrl::GetSSGDataFile(TSSGSubject *SSGS,
     string FName, string DefaultExt, string *CurrentDir)
 {
@@ -497,36 +894,96 @@
  string GroupName;
  map <string, map<string, vector<string> > >:: iterator  FNameIt;
  if(FName[0]=='_'){ //oXg
+#if defined(NOCACHED_MEMORY_LIST) && NOCACHED_MEMORY_LIST
+	BOOL IsNocache = FALSE;
+#endif
     vector<string> tmpV;
     while(1){
 	    strD.List(FName, "/", &tmpV);
+#if !defined(NOCACHED_MEMORY_LIST) || !NOCACHED_MEMORY_LIST
     	tmpV.resize(6);
+#else
+		IsNocache = TSSGCtrl_GetSSGDataFile_CheckNocacheParam(&tmpV);
+		tmpV.resize(7);
+#endif
 	    //_mem/0x400000/8/20/00/Error!
     	//_mem/AhX/ő啶/s/XebvTCY/I[oCg/G[̑ւ
 	    unsigned long Address, StrSize, RowSize, ReadSize, StepSize;
 		//IvV
 	    if(SSGS==NULL) SSGS = rootSubject;
     	Address = GetAddress(SSGS, tmpV[1]);
+#if !defined(FIX_DOUBLE_LIST) || !FIX_DOUBLE_LIST
         if(Address==0) break;   //AhXG[
+#else
+		if (Address == 0)
+		{
+			tmpV.clear();
+			break;
+		}
+#endif
 
+#if !defined(LIST_PARSER) || !LIST_PARSER
 	    StrSize = TStringDivision::ToULongDef(tmpV[2], 1);
     	RowSize = TStringDivision::ToULongDef(tmpV[3], 1);
     	StepSize= TStringDivision::ToULongDef(tmpV[4], 1);
+#else
+		if (!IsNocache)
+		{
+			StrSize = TStringDivision::ToULongDef(tmpV[2], 1);
+			RowSize = TStringDivision::ToULongDef(tmpV[3], 1);
+			StepSize = TStringDivision::ToULongDef(tmpV[4], 1);
+		}
+		else
+		{
+			StrSize = Parsing(SSGS, tmpV[2], 4, "List", Address, 0);
+			RowSize = Parsing(SSGS, tmpV[3], 4, "List", Address, 0);
+			StepSize = Parsing(SSGS, tmpV[4], 4, "List", Address, 0);
+		}
+#endif
 	    string EndWord = strD.Trim(tmpV[5]);
+#if defined(LOCAL_MEMORY_SUPPORT) && LOCAL_MEMORY_SUPPORT
+		TSmartHandle SHandle;
+#endif
     	{//G[̃ZbgirbreakꍇAʂƂĂꂪԂj
+#if defined(NOCACHED_MEMORY_LIST) && NOCACHED_MEMORY_LIST
+			TrimString(&tmpV[6]);
+#endif
     		string ErrorStr( tmpV[6] );
+#if defined(LOCAL_MEMORY_SUPPORT) && LOCAL_MEMORY_SUPPORT
+			if (StepSize != 0)
+				if ((SHandle = TSSGCtrl_OpenProcess(&processCtrl, PROCESS_VM_READ, tmpV[1].c_str())) == NULL)
+					StepSize = 0;
+#endif
 	    	tmpV.clear();
     		tmpV.push_back(ErrorStr);
 	    }
+#if !defined(FIX_DOUBLE_LIST) || !FIX_DOUBLE_LIST
 	    if(StepSize==0) break;	//TCYG[
+#else
+		if (StepSize == 0)
+		{
+			tmpV.clear();
+			break;
+		}
+#endif
 
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
     	TSmartHandle SHandle;
 	    if(( SHandle=processCtrl.Open(PROCESS_VM_READ) )==NULL)
 	    	break;
+#endif
 
 		unsigned long i;
     	if((EndWord=="num")||(EndWord=="num_big_e")){	//l
+#if !defined(FIX_DOUBLE_LIST) || !FIX_DOUBLE_LIST
     		if(StrSize>4) break;	//TCYG[
+#else
+			if (StrSize > 4)
+			{
+				tmpV.clear();
+				break;
+			}
+#endif
 
 			//1sPʂɐ؂o
    			tmpV.clear();
@@ -552,7 +1009,15 @@
 	    		}
 	    	}
 	    }else{	//ʏ핶
+#if !defined(FIX_DOUBLE_LIST) || !FIX_DOUBLE_LIST
     		if(StrSize>StepSize) break;	//TCYG[
+#else
+			if (StrSize > StepSize)
+			{
+				tmpV.clear();
+				break;
+			}
+#endif
 
    		 	string Val;
 	    	Val.resize(StrSize);
@@ -575,15 +1040,30 @@
 	    			Address += StepSize;
 		    	}
 			}else{	//I[w
+#if !defined(UNICODE_SUPPORT) || !UNICODE_SUPPORT
 				string EndCode( GetSimpleByteCode(SSGS, EndWord) );
+#else
+				string EndCode((EndWord != "unicode" ? GetSimpleByteCode(SSGS, EndWord) : string()));
+#endif
 				for(i=0; i<RowSize; i++){
 					//l
     				if(!TProcessCtrl::OneRead(SHandle, Address, SIt, StrSize) )
 	    			    break;
 
+#if !defined(UNICODE_SUPPORT) || !UNICODE_SUPPORT
 			    	memcpy(tmpC, SIt, StrSize);
+#else
+					if (!EndCode.empty())
+						memcpy(tmpC, SIt, StrSize);
+					else
+						WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)SIt, StrSize / 2, tmpC, StrSize, NULL, NULL);
+#endif
 		    	    {//I[`FbN
+#if !defined(UNICODE_SUPPORT) || !UNICODE_SUPPORT
     		    		unsigned long Pos = strD.Find((string&)(string)tmpC, EndCode);
+#else
+						unsigned long Pos = !EndCode.empty() ? strD.Find(string(tmpC), EndCode) : string::npos;
+#endif
 						if((size_t)Pos != string::npos) tmpC[Pos] = (char)NULL;
 		    	    }
 		    	    tmpV.push_back(tmpC);
@@ -595,7 +1075,11 @@
 		break;
     }
     //ꎞZbg(ǂݒ)
+#if !defined(NOCACHED_MEMORY_LIST) || !NOCACHED_MEMORY_LIST
 	SetSSGDataFile(&tmpV, FName, !GroupName.empty());
+#else
+	TSSGCtrl_GetSSGDataFile_FixSetSSGDataFile(this, &tmpV, FName, IsNocache);
+#endif
 	FNameIt = dataFileMap.find(strD.Lower(FName));
     if(FNameIt == dataFileMap.end())    //{蓾Ȃ
         return NULL;
@@ -606,6 +1090,9 @@
     CurDir = (CurrentDir==NULL)?scriptDir: *CurrentDir;
 
     FileName = strD.Half(&FName, "->", 0);
+#if defined(FIX_GET_SSG_DATA_FILE) && FIX_GET_SSG_DATA_FILE
+    FixGetSSGDataFile(FileName);
+#endif
     if(FileName == "->"){
    	    FileName  = strD.Lower(CurDir + FName +DefaultExt);
     }else{
@@ -638,6 +1125,10 @@
 //---------------------------------------------------------------------
 void TSSGCtrl::SetSSGDataFile(vector<string> *Data, const string& FileName, bool IsSSL)
 {
+#if defined(FIX_DOUBLE_LIST) && FIX_DOUBLE_LIST
+ if (Data->empty())
+	return;
+#endif
  map<string, vector<string> > tmpM;
  if(IsSSL){	
 	//O[v쐬
@@ -1115,21 +1606,49 @@
  for(; it!=End; it++){
 	it->first->Write(*This, it->second);
  }
-
- return 0;  //^C}[p
 }
 //---------------------------------------------------------------------
 //uSSRt@C͂֐v
 //---------------------------------------------------------------------
+#if defined(FIX_REPEAT) && FIX_REPEAT
+BOOL __stdcall TSSGCtrl_ReadSSRFile_CheckSignedParam(vector<string> *tmpV)
+{
+	if (tmpV->size() >= 5)
+	{
+		char *p = (*tmpV)[4].begin();
+		while (__intrinsic_isspace(*p))
+			p++;
+		size_t length = (*tmpV)[4].end() - p;
+		if (length >= 6)
+		{
+			while (__intrinsic_isspace(*(p + length - 1)) && --length >= 6);
+			if (length == 6 && *(LPDWORD)p == BSWAP32('sign') && *(LPWORD)(p + 4) == BSWAP16('ed'))
+				return TRUE;
+		}
+	}
+	return FALSE;
+}
+//---------------------------------------------------------------------
+#endif
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
 vector<string> TSSGCtrl::ReadSSRFile(string &Code)
+#else
+vector<string> TSSGCtrl::ReadSSRFile(string &Code, vector<DWORD> &Indices)
+#endif
 {
  unsigned long Begin, End, Step;
 
  vector<string> Dest;	//WJςSSGXNvgxN^
  vector<string> *File, *StepFile=NULL;
+#if defined(FIX_REPEAT) && FIX_REPEAT
+ BOOL signedLoop;
+#endif
  {
     vector<string> tmpV;
 	strD.List(Code, ",", &tmpV);
+#if defined(FIX_REPEAT) && FIX_REPEAT
+	signedLoop = TSSGCtrl_ReadSSRFile_CheckSignedParam(&tmpV);
+#endif
 	tmpV.resize(4,"_");
 	File = GetSSGDataFile(NULL, tmpV[0], ".SSR");
 	if(File==NULL) return Dest;
@@ -1153,17 +1672,68 @@
 
  //JԂ̉͊Bۂ̌JԂɓB
  if(StepFile==NULL){	//$Val̑ʂ͌Œ
+#if !defined(FIX_REPEAT) || !FIX_REPEAT
     Dest.reserve(FormatVec.size()*((End-Begin)/Step));
+#else
+	unsigned long count;
+	if (!signedLoop)
+	{
+		count = (End - Begin) / Step;
+	}
+	else
+	{
+		count = (long)(End - Begin) / (long)Step;
+		if ((long)count < 0)
+			count = -(long)count;
+	}
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
+	Dest.reserve(FormatVec.size() * count);
+#else
+	size_t n = FormatVec.size() * count;
+	Indices.reserve(n);
+	Dest.reserve(n);
+#endif
+#endif
 	unsigned long i;
+#if !defined(FIX_REPEAT) || !FIX_REPEAT
 	for(i=Begin; i<End; i+=Step) LoopSSRFile(FormatVec, Dest, i);
+#else
+	for (i = Begin; !signedLoop ? i < End : (long)Step >= 0 ? (long)i < (long)End : (long)i > (long)End; i += Step)
+	{
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+		Indices.push_back(i);
+#endif
+		LoopSSRFile(FormatVec, Dest, i);
+	}
+#endif
  }else{	//$Val̒l̓t@CŎw
+#if !defined(REPEAT_INDEX) || !REPEAT_INDEX
     Dest.reserve(FormatVec.size()*StepFile->size());
+#else
+	size_t n = FormatVec.size() * StepFile->size();
+	Indices.reserve(n);
+	Dest.reserve(n);
+#endif
     vector<string>::iterator
 	    VIt  = StepFile->begin(),
 	    VEnd = StepFile->end();
 	for(; VIt!=VEnd; VIt++){
 		if(VIt->empty()) continue;	//sȂXLbv
+#if !defined(FIX_PARSER) || !FIX_PARSER
 		LoopSSRFile(FormatVec, Dest, TStringDivision::ToULongDef(*VIt));
+#else
+		string tmpS = *VIt;
+		ReplaceDefine(&attributeSelector, &tmpS);
+		char *endptr;
+		unsigned long LoopVal = strtoul(tmpS.c_str(), &endptr, 0);
+		if (tmpS.c_str() != endptr)
+		{
+#if defined(REPEAT_INDEX) && REPEAT_INDEX
+			Indices.push_back(LoopVal);
+#endif
+			LoopSSRFile(FormatVec, Dest, LoopVal);
+		}
+#endif
 	}
  }
 
@@ -1172,6 +1742,37 @@
 //---------------------------------------------------------------------
 //uSSRt@C̑͊֐v
 //---------------------------------------------------------------------
+#if (defined(FIX_REPEAT) && FIX_REPEAT) || (defined(FIX_REMOVE_SPACE) && FIX_REMOVE_SPACE)
+string __stdcall TSSGCtrl_TrimString(const string &Src)
+{
+	string s(Src);
+	TrimString(&s);
+	return s;
+}
+//---------------------------------------------------------------------
+#endif
+#if defined(FIX_REPEAT) && FIX_REPEAT
+void __stdcall TSSGCtrl_EnumReadSSR_FormatPrefix(TStringDivision &strD, string &tmpS, list< pair<byte, string> > &LineList)
+{
+	LineList.push_back(pair<byte, string>(RT_FORMAT, TSSGCtrl_TrimString(strD.Half(&tmpS, ",").substr(1, string::npos))));
+	LineList.push_back(pair<byte, string>(RT_FORMAT, strD.Half(&tmpS, ",").substr(1, string::npos)));
+	char *begin = tmpS.begin();
+	while (__intrinsic_isspace(*begin))
+		begin++;
+	char *end = tmpS.end() - 1;
+	while (end > begin && __intrinsic_isspace(*end))
+		end--;
+	if (++end != tmpS.end() || begin != tmpS.begin())
+	{
+		size_t length = end - begin;
+		if (begin != tmpS.begin())
+			memcpy(tmpS.begin(), begin, length);
+		tmpS.resize(length);
+	}
+	LineList.push_back(pair<byte, string>(ssgCtrl::rtSTRING, tmpS));
+}
+//---------------------------------------------------------------------
+#endif
 void TSSGCtrl::EnumReadSSR(vector<string> &File,
 	vector< list< pair<byte, string> > > *FormatVec)
 {
@@ -1194,32 +1795,71 @@
 		LineList.push_back( pair<byte, string>(ssgCtrl::rtSTRING, *tmpVIt) );
 
 	for(++tmpVIt; tmpVIt!=tmpVEnd; tmpVIt++){
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
 		tmpS = strD.Half(tmpVIt, "!]", 0, strD::etTRIM);
+#else
+		tmpS = strD.Half(tmpVIt, "!]");
+		TrimString(&tmpS);
+#endif
 		if(tmpS.size()>1){	//ꂪUɂȂĂ̂ςȘbc
             switch(tmpS[0]){
             case '#':   //lAGfBA]
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
             	if(tmpS[1]=='L')
 				    LineList.push_back( pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtREVERSE_ENDIAN | ssgCtrl::rtDECIMAL, strD.Remove(tmpS, " ").substr(2,string::npos)) );
             	else
 				    LineList.push_back( pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtREVERSE_ENDIAN, strD.Remove(tmpS, " ").substr(1,string::npos)) );
+#else
+				if (tmpS[1] == 'L')
+					LineList.push_back(pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtREVERSE_ENDIAN | ssgCtrl::rtDECIMAL, TSSGCtrl_TrimString(tmpS).substr(2, string::npos)));
+				else
+					LineList.push_back(pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtREVERSE_ENDIAN, TSSGCtrl_TrimString(tmpS).substr(1, string::npos)));
+#endif
 				break;
             case 'L':
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
 				LineList.push_back( pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtDECIMAL, strD.Remove(tmpS, " ").substr(1,string::npos) ) );
+#else
+				LineList.push_back(pair<byte, string>(ssgCtrl::rtNUMBER | ssgCtrl::rtDECIMAL, TSSGCtrl_TrimString(tmpS).substr(1, string::npos)));
+#endif
 				break;
             case 'R':	//[hs[g
             	//[!R JԂ(Parsing), JԂ !]
             	//[!R ($Val/2), [ ! !]@Ƃ@[!R ($Val), +0x10:] !]
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
 				LineList.push_back( pair<byte, string>(ssgCtrl::rtWORD_REPEAT, 
 					strD.Remove( strD.Half(&tmpS,",").substr(1,string::npos), " ") ) );
 				LineList.push_back( pair<byte, string>(ssgCtrl::rtSTRING, strD.Remove(tmpS, " ")) );
+#else
+				LineList.push_back(pair<byte, string>(ssgCtrl::rtWORD_REPEAT,
+					TSSGCtrl_TrimString(strD.Half(&tmpS, ",").substr(1, string::npos))));
+				LineList.push_back(pair<byte, string>(ssgCtrl::rtSTRING, TSSGCtrl_TrimString(tmpS)));
+#endif
             	break;
+#if defined(FIX_REPEAT) && FIX_REPEAT
+			case 'F':
+				TSSGCtrl_EnumReadSSR_FormatPrefix(strD, tmpS, LineList);
+				break;
+#endif
+#if !defined(COMMON_LIST) || !COMMON_LIST
 			case '@':	//t@Cw肷邻ł
 				//,؂őOɂt@CvbV
     			LineList.push_back( pair<byte, string>(ssgCtrl::rtFILE,
 	    			strD.Half(&tmpS,",").substr(1,string::npos) ) );
 	    		//̂܂܉̏ցB
+#else
+			case '@':
+				tmpS.erase(0, 1);
+			case '+':
+			case '*':
+				LineList.push_back(pair<byte, string>(ssgCtrl::rtFILE, strD.Half(&tmpS, ",")));
+#endif
             default:	//l
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
 			    LineList.push_back( pair<byte, string>(ssgCtrl::rtNUMBER, strD.Remove(tmpS, " ")) );
+#else
+				LineList.push_back(pair<byte, string>(ssgCtrl::rtNUMBER, TSSGCtrl_TrimString(tmpS)));
+#endif
             }
 		}
 		if(!tmpVIt->empty())
@@ -1232,6 +1872,26 @@
 //---------------------------------------------------------------------
 //uSSRt@C̑͊֐v
 //---------------------------------------------------------------------
+#if defined(FIX_REPEAT) && FIX_REPEAT
+void __stdcall TSSGCtrl_LoopSSRFile_Format(TSSGCtrl *SSGCtrl, unsigned long LoopVal, list< pair<byte, string> >::iterator &VIt, string &tmpS, TSSGSubject &SSGS, long Type)
+{
+	if (Type == RT_FORMAT)
+	{
+		char buffer[256];
+		unsigned long Val;
+
+#if !defined(FIX_PARSER) || !FIX_PARSER
+		Val = SSGCtrl->Parsing(&SSGS, VIt->second, LoopVal);
+#else
+		Val = SSGCtrl->Parsing(&SSGS, VIt->second, 3, "Val", (ULONGLONG)LoopVal, 0);
+#endif
+		string &Word = (++VIt)->second;
+		_snprintf(buffer, _countof(buffer), Word.c_str(), Val);
+		tmpS += buffer;
+	}
+}
+//---------------------------------------------------------------------
+#endif
 void TSSGCtrl::LoopSSRFile(vector< list< pair<byte, string> > > &FormatVec,
 	vector<string> &Dest, unsigned long LoopVal)
 {
@@ -1250,7 +1910,11 @@
 		if(Type == ssgCtrl::rtSTRING){	//sϕ
 			tmpS += VIt->second;
 		}else if((Type & ssgCtrl::rtNUMBER)!=0){	//l
+#if !defined(FIX_PARSER) || !FIX_PARSER
 			unsigned long Val = Parsing(&SSGS, VIt->second, LoopVal);
+#else
+			unsigned long Val = Parsing(&SSGS, VIt->second, 3, "Val", (ULONGLONG)LoopVal, 0);
+#endif
 			unsigned long Mask = 0xFF000000, i;
 			for(i=4; i>1; i--){
 				if((Val&Mask)!=0) break;
@@ -1266,15 +1930,67 @@
 				tmpS += TStringDivision::ToString(Val, ("%0"+TStringDivision::ToString(i*2)+"X").c_str());
 		}else if(Type == ssgCtrl::rtFILE){	//t@Cw
 			//SSLgpȂꍇ̊gq́Au.lstv
+#if !defined(COMMON_LIST) || !COMMON_LIST
 			vector<string> *File = GetSSGDataFile(&SSGS, VIt->second, ".LST");
+#else
+			vector<string> *File;
+			char prefix;
+			{
+				string FileName(VIt->second);
+				prefix = *FileName.c_str();
+				if (prefix == '+' || prefix == '*')
+					FileName.erase(0, 1);
+				File = GetSSGDataFile(&SSGS, FileName, ".LST");
+			}
+#endif
 			if(File==NULL) break;
 
+#if !defined(FIX_PARSER) || !FIX_PARSER
 			unsigned long Index = Parsing(&SSGS, (++VIt)->second, LoopVal);
+#else
+			unsigned long Index = Parsing(&SSGS, (++VIt)->second, 3, "Val", (ULONGLONG)LoopVal, 0);
+#endif
+#if !defined(FIX_PARSER) || !FIX_PARSER
 			tmpS += File->at( Index% File->size() );	//ws̕
+#else
+			string Str = File->at(Index % File->size());
+			ReplaceDefine(&attributeSelector, &Str);
+#if defined(COMMON_LIST) && COMMON_LIST
+			if (prefix == '+')
+			{
+				char *p = Str.begin();
+				while (*p && *(p++) != '=');
+				while (__intrinsic_isspace(*p))
+					p++;
+				Str.erase(0, p - Str.begin());
+			}
+			else if (prefix == '*')
+			{
+				char *p = Str.begin();
+				while (*p && *p != '=')
+					p++;
+				if (*p)
+				{
+					while (--p >= Str.begin() && __intrinsic_isspace(*p));
+						p++;
+				}
+				Str.resize(p - Str.begin());
+			}
+#endif
+			tmpS += Str;
+#endif
 		}else if(Type == ssgCtrl::rtWORD_REPEAT){	//[hs[g
+#if !defined(FIX_PARSER) || !FIX_PARSER
 			unsigned long i, Count = Parsing(&SSGS, VIt->second, LoopVal);
+#else
+			unsigned long i, Count = Parsing(&SSGS, VIt->second, 3, "Val", (ULONGLONG)LoopVal, 0);
+#endif
 			string &Word = (++VIt)->second;
+#if !defined(FIX_REPEAT) || !FIX_REPEAT
 			if(Count==0) continue;
+			if ((long)Count <= 0)
+				continue;
+			Count = 1;
 			
 			string Str;
 			Str.reserve( Word.size()*Count );
@@ -1289,7 +2005,19 @@
                 list< pair<byte, string> >::iterator tmpVIt = VIt;
 				LineList.insert(++tmpVIt, tmpFormatVec.begin()->begin(), tmpFormatVec.begin()->end());
             }
+#else
+			if ((long)Count <= 0)
+				continue;
+			for (i = 0; i < Count; i++)
+				tmpS += Word;
+#endif
+		}
+#if defined(FIX_REPEAT) && FIX_REPEAT
+		else
+		{
+			TSSGCtrl_LoopSSRFile_Format(this, LoopVal, VIt, tmpS, SSGS, Type);
 		}
+#endif
 	}
 	Dest.push_back(tmpS);
 	tmpS="";
@@ -1589,12 +2317,307 @@
 //u̒leɓꂽ񏊓֐v
 //ESrcU'+'ŕƁAeX͂AʂĕԂ܂B
 //---------------------------------------------------------------------
+#if defined(FORMAT_NAME_STRING) && FORMAT_NAME_STRING
+static char * __fastcall FindDoubleChar(const char *p, const unsigned short w)
+{
+	char c;
+
+	for (; c = *p; p++)
+	{
+		if (!__intrinsic_isleadbyte(c))
+		{
+			if (c != '\\')
+			{
+				if (c == (char)w && p[1] == (char)(w >> 8))
+					break;
+			}
+			else
+			{
+				if (!(c = *(++p)))
+					break;
+				if (__intrinsic_isleadbyte(c))
+					if (!*(++p))
+						break;
+			}
+		}
+		else if (!*(++p))
+		{
+			break;
+		}
+	}
+	return (char *)p;
+}
+//---------------------------------------------------------------------
+static char * __fastcall FindDelimiter(const char *p, const char *end)
+{
+	size_t nest;
+
+	if (p >= end)
+		goto NOT_FOUND;
+	nest = 0;
+	do
+	{
+		switch (*p)
+		{
+		case '(':
+			nest++;
+			break;
+		case ')':
+			if (nest)
+				nest--;
+			break;
+		case ',':
+			if (nest)
+				break;
+			return (char *)p;
+		case '\\':
+			if (++p >= end)
+				goto NOT_FOUND;
+		default:
+			if (!__intrinsic_isleadbyte(*p) || ++p < end)
+				break;
+			goto NOT_FOUND;
+		}
+	} while (++p < end);
+NOT_FOUND:
+	return (char *)end;
+}
+//---------------------------------------------------------------------
+static char * __fastcall TrimLeft(const char *left)
+{
+	while (__intrinsic_isspace(*left))
+		left++;
+	return (char *)left;
+}
+//---------------------------------------------------------------------
+static char * __fastcall TrimRight(const char *left, const char *right)
+{
+	while (--right > left && __intrinsic_isspace(*right));
+	return (char *)++right;
+}
+//---------------------------------------------------------------------
+static void __fastcall UnescapeString(char *p, char *end)
+{
+	if (p >= end)
+		return;
+	do
+	{
+		char c = *p;
+		if (!__intrinsic_isleadbyte(c))
+		{
+			if (c != '\\')
+				continue;
+			memcpy(p, p + 1, (end--) - p);
+			if (p >= end)
+				break;
+			c = *p;
+			if (!__intrinsic_isleadbyte(c))
+				continue;
+		}
+		p++;
+	} while (++p < end);
+}
+//---------------------------------------------------------------------
+static char * __stdcall ReplaceString(string *s, char *destBegin, char *destEnd, const char *srcBegin, const char *srcEnd)
+{
+	size_t srcLength, destLength, diff, count;
+
+	srcLength = srcEnd - srcBegin;
+	destLength = destEnd - destBegin;
+	if (diff = srcLength - destLength)
+	{
+		count = s->end() - destEnd + 1;
+		if (srcLength > destLength)
+		{
+			destBegin -= (size_t)s->begin();
+			destEnd -= (size_t)s->begin();
+			s->resize(s->size() + diff);
+			destBegin += (size_t)s->begin();
+			destEnd += (size_t)s->begin();
+			memmove(destBegin + srcLength, destEnd, count);
+		}
+		else
+		{
+			memcpy(destBegin + srcLength, destEnd, count);
+			s->resize(s->size() + diff);
+		}
+		destEnd += diff;
+	}
+	memcpy(destBegin, srcBegin, srcLength);
+	return destEnd;
+}
+//---------------------------------------------------------------------
+static void __stdcall FormatNameString(TSSGCtrl *_this, TSSGSubject *SSGS, string *s)
+{
+	#define BRACKET_OPEN  BSWAP16('<#')
+	#define BRACKET_CLOSE BSWAP16('#>')
+
+	char stackBuffer[256];
+	char *bracketBegin;
+
+	bracketBegin = FindDoubleChar(s->begin(), BRACKET_OPEN);
+	while (*bracketBegin)
+	{
+		char    *bracketEnd, *valueBegin, *valueEnd, *formatBegin, *formatEnd, type;
+		BOOLEAN isFEP;
+
+		bracketEnd = FindDoubleChar(bracketBegin + 2, BRACKET_CLOSE);
+		if (!*bracketEnd)
+			break;
+		formatBegin = NULL;
+		type = '\0';
+		isFEP = FALSE;
+		do	/* do { ... } while (0); */
+		{
+			char *term, *fepBegin, *fepEnd;
+
+			valueBegin = TrimLeft(bracketBegin + 2);
+			valueEnd = TrimRight(valueBegin, bracketEnd);
+			bracketEnd += 2;
+			if (valueEnd == valueBegin)
+				break;
+			term = valueEnd;
+			formatBegin = FindDelimiter(valueBegin, term);
+			valueEnd = TrimRight(valueBegin, formatBegin);
+			if (formatBegin == term)
+				break;
+			formatBegin = TrimLeft(formatBegin + 1);
+			fepBegin = FindDelimiter(formatBegin, term);
+			formatEnd = TrimRight(formatBegin, fepBegin);
+			if (formatEnd != formatBegin)
+				type = *(formatEnd - 1);
+			if (fepBegin == term)
+				break;
+			fepBegin = TrimLeft(fepBegin + 1);
+			fepEnd = FindDelimiter(fepBegin, term);
+			if (fepEnd == fepBegin)
+				break;
+			fepEnd = TrimRight(fepBegin, fepEnd);
+			if (fepEnd - fepBegin != 3)
+				break;
+			if (fepBegin[0] != 'f' || fepBegin[1] != 'e' || fepBegin[2] != 'p')
+				break;
+			isFEP = TRUE;
+		} while (0);
+		switch (type)
+		{
+		case 'e': case 'E': case 'f': case 'g': case 'G': case 'a': case 'A':
+			{
+				double number;
+				UINT   length;
+				char   *buffer;
+
+				*valueEnd = '\0';
+				UnescapeString(valueBegin, valueEnd);
+				number = _this->ParsingDouble(SSGS, string(valueBegin, valueEnd), 0);
+				if (isFEP)
+					number = _this->CheckIO_FEPDouble(SSGS, number, FALSE);
+				if (formatBegin && !_isnan(number))
+					*formatEnd = '\0';
+				else
+					formatBegin = "%f";
+				length = _snprintf(stackBuffer, _countof(stackBuffer), formatBegin, number);
+				buffer = stackBuffer;
+				if (length >= _countof(stackBuffer))
+				{
+					if ((int)length >= 0)
+					{
+						UINT capacity;
+
+						if (buffer = (char *)HeapAlloc(hHeap, 0, capacity = length + 1))
+						{
+							if ((length = _snprintf(buffer, capacity, formatBegin, number)) >= capacity)
+								length = (int)length >= 0 ? capacity - 1 : 0;
+						}
+						else
+						{
+							buffer = stackBuffer;
+							length = _countof(stackBuffer) - 1;
+						}
+					}
+					else
+					{
+						length = 0;
+					}
+				}
+				bracketEnd = ReplaceString(s, bracketBegin, bracketEnd, buffer, buffer + length);
+				if (buffer != stackBuffer)
+					HeapFree(hHeap, 0, buffer);
+			}
+			break;
+		case 'n':
+			bracketEnd = ReplaceString(s, bracketBegin, bracketEnd, formatBegin, formatEnd);
+			break;
+		default:
+			{
+				DWORD number;
+				UINT  length;
+				char   *buffer;
+
+				*valueEnd = '\0';
+				UnescapeString(valueBegin, valueEnd);
+				number = _this->Parsing(SSGS, string(valueBegin, valueEnd), 0);
+				if (isFEP)
+					number = _this->CheckIO_FEP(SSGS, number, FALSE);
+				if (formatBegin && type)
+					*formatEnd = '\0';
+				else
+					formatBegin = "%d";
+				length = _snprintf(stackBuffer, _countof(stackBuffer), formatBegin, number);
+				buffer = stackBuffer;
+				if (length >= _countof(stackBuffer))
+				{
+					if ((int)length >= 0)
+					{
+						UINT capacity;
+
+						if (buffer = (char *)HeapAlloc(hHeap, 0, capacity = length + 1))
+						{
+							if ((length = _snprintf(buffer, capacity, formatBegin, number)) >= capacity)
+								length = (int)length >= 0 ? capacity - 1 : 0;
+						}
+						else
+						{
+							buffer = stackBuffer;
+							length = _countof(stackBuffer) - 1;
+						}
+					}
+					else
+					{
+						length = 0;
+					}
+				}
+				bracketEnd = ReplaceString(s, bracketBegin, bracketEnd, buffer, buffer + length);
+				if (buffer != stackBuffer)
+					HeapFree(hHeap, 0, buffer);
+			}
+			break;
+		}
+		bracketBegin = FindDoubleChar(bracketEnd, BRACKET_OPEN);
+	}
+
+	#undef BRACKET_OPEN
+	#undef BRACKET_CLOSE
+}
+//---------------------------------------------------------------------
+#endif
 string TSSGCtrl::GetNameString(TSSGSubject *SSGS, const string &NameStr)
 {
+#if !defined(FORMAT_NAME_STRING) && !FORMAT_NAME_STRING
  vector<string> tmpV;
  if( strD.List(NameStr, "'+'", &tmpV) <= 1){
 	return AddressNaming(SSGS, NameStr);
  }
+#else
+ string s(NameStr);
+ vector<string> tmpV;
+
+ FormatNameString(this, SSGS, &s);
+ if (strD.List(s, "'+'", &tmpV) <= 1)
+ {
+	return AddressNaming(SSGS, s);
+ }
+#endif
  
  vector<string>::iterator 
 	VIt  = tmpV.begin(),
@@ -1611,8 +2634,311 @@
  return JoinStr;
 }
 //---------------------------------------------------------------------
+#if defined(UNICODE_SUPPORT) && UNICODE_SUPPORT
+void __stdcall AddressNamingFromUnicode(unsigned long DataSize, char *tmpC)
+{
+#if 0
+	HANDLE hHeap = GetProcessHeap();
+	DWORD dwBytes = (DataSize + 2) & ~1UL;
+	LPWSTR lpWideCharStr = (LPWSTR)HeapAlloc(hHeap, 0, dwBytes);
+	if (lpWideCharStr != NULL)
+	{
+		memcpy(lpWideCharStr, tmpC, dwBytes - 2);
+		*(LPWSTR)((LPBYTE)lpWideCharStr + dwBytes - 2) = L'\0';
+		WideCharToMultiByte(CP_ACP, 0, lpWideCharStr, -1, tmpC, DataSize + 1, NULL, NULL);
+		HeapFree(hHeap, 0, lpWideCharStr);
+	}
+	else
+	{
+		*tmpC = '\0';
+	}
+#else
+	__asm
+	{
+//		push    esi
+//		push    edi
+		call    GetProcessHeap              // HANDLE hHeap = GetProcessHeap();
+		xor     ecx, ecx
+		mov     edi, dword ptr [DataSize]   // DWORD dwBytes = (DataSize + 2) & ~1UL;
+		push    ecx
+		push    ecx
+		push    eax
+		push    ecx
+		push    ecx
+		inc     edi
+		mov     esi, dword ptr [tmpC]
+		push    edi
+		push    esi
+		push    -1
+		push    ecx
+		push    ecx
+		inc     edi
+		push    ecx
+		push    edi                         // LPWSTR lpWideCharStr = (LPWSTR)HeapAlloc(hHeap, 0, dwBytes);
+		push    ecx
+		push    eax
+		call    HeapAlloc
+		test    eax, eax                    // if (lpWideCharStr != NULL)
+		jz      short L1                    // {
+		mov     ecx, edi                    //     memcpy(lpWideCharStr, tmpC, dwBytes - 2);
+		mov     edi, eax
+		shr     ecx, 1
+		mov     dword ptr [esp + 8], eax
+		dec     ecx
+		mov     dword ptr [esp + 40], eax
+		rep movsw
+		mov     word ptr [edi], cx          //     *(LPWSTR)((LPBYTE)lpWideCharStr + dwBytes - 2) = L'\0';
+		call    WideCharToMultiByte         //     WideCharToMultiByte(CP_ACP, 0, lpWideCharStr, -1, tmpC, DataSize + 1, NULL, NULL);
+		call    HeapFree                    //     HeapFree(hHeap, 0, lpWideCharStr);
+		jmp     short L2                    // }
+		                                    // else
+		                                    // {
+	L1:
+		add     esp, 44
+		mov     byte ptr [esi], al          //     *tmpC = '\0';
+		                                    // }
+	L2:
+//		pop     edi
+//		pop     esi
+//		ret     16
+	}
+#endif
+}
+#endif
+//---------------------------------------------------------------------
+#if defined(ADDRESS_NAMING_FEP_SUPPORT) && ADDRESS_NAMING_FEP_SUPPORT
+#include <float.h>
+void __stdcall AddressNamingFEPNumber(TSSGCtrl *SSGCtrl, TSSGSubject *SSGS, vector<string> &tmpV, unsigned long DataSize, char *tmpC)
+{
+	tmpV[3].clear();
+	if (!tmpV[5].empty())
+	{
+		switch (*tmpV[5].rbegin())
+		{
+		case 'e': case 'E': case 'f': case 'g': case 'G': case 'a': case 'A':
+			if (DataSize <= sizeof(double))
+			{
+				char   buf[256];
+				double Val;
+
+				Val =
+					DataSize == sizeof(double) ? *(double *)tmpC :
+					DataSize >= sizeof(float ) ? *(float  *)tmpC :
+					0;
+				Val = SSGCtrl->CheckIO_FEPDouble(SSGS, Val, false);
+				_snprintf(buf, _countof(buf), !_isnan(Val) ? tmpV[5].c_str() : "%f", Val);
+				tmpV[4] = buf;
+			}
+			break;
+		case 'n':
+			break;
+		default:
+			if (DataSize <= 4)
+			{
+				char          buf[256];
+				unsigned long Val;
+
+				Val =
+					DataSize == 4 ? *(LPDWORD)tmpC :
+					DataSize == 3 ? *(LPDWORD)tmpC & 0x00FFFFFF :
+					DataSize == 2 ? *(LPWORD )tmpC :
+					                *(LPBYTE )tmpC;
+				Val = SSGCtrl->CheckIO_FEP(SSGS, Val, false);
+				_snprintf(buf, _countof(buf), tmpV[5].c_str(), Val);
+				tmpV[4] = buf;
+			}
+			break;
+		}
+	}
+	*tmpC = '\0';
+}
+//---------------------------------------------------------------------
+void __stdcall AddressNamingFEPList(TSSGCtrl *SSGCtrl, TSSGSubject *SSGS, vector<string> &tmpV, unsigned long DataSize, char *tmpC)
+{
+	tmpV[3].clear();
+	if (DataSize <= 4 && !tmpV[5].empty())
+	{
+		vector<string> *vec;
+
+		vec = SSGCtrl->GetSSGDataFile(SSGS, tmpV[5], ".LST");
+		if (vec)
+		{
+			unsigned long index;
+			string        *src;
+			char          *endptr;
+			unsigned long value;
+
+			index =
+				DataSize == 4 ? *(LPDWORD)tmpC :
+				DataSize == 3 ? *(LPDWORD)tmpC & 0x00FFFFFF :
+				DataSize == 2 ? *(LPWORD )tmpC :
+				                *(LPBYTE )tmpC;
+			index = SSGCtrl->CheckIO_FEP(SSGS, index, false);
+			src = &tmpV[6];
+			if (!src->empty())
+			{
+				value = strtoul(src->c_str(), &endptr, 0);
+				if (!*endptr)
+					index -= value;
+			}
+			src = &tmpV[7];
+			if (!src->empty())
+			{
+				value = strtoul(src->c_str(), &endptr, 0);
+				if (value && !*endptr)
+					index /= value;
+			}
+			if (index < vec->size())
+			{
+				tmpV[4] = vec->at(index);
+				ReplaceDefineDynamic(SSGS, &tmpV[4]);
+			}
+		}
+	}
+	*tmpC = '\0';
+}
+//---------------------------------------------------------------------
+void __stdcall AddressNamingFEPFreeList(TSSGCtrl *SSGCtrl, TSSGSubject *SSGS, vector<string> &tmpV, unsigned long DataSize, char *tmpC)
+{
+	if (DataSize <= 4 && !tmpV[5].empty())
+	{
+		vector<string> *vec;
+
+		vec = SSGCtrl->GetSSGDataFile(SSGS, tmpV[5], ".LST");
+		if (vec)
+		{
+			unsigned long            index;
+			vector<string>::iterator it;
+
+			index =
+				DataSize == 4 ? *(LPDWORD)tmpC :
+				DataSize == 3 ? *(LPDWORD)tmpC & 0x00FFFFFF :
+				DataSize == 2 ? *(LPWORD )tmpC :
+				                *(LPBYTE )tmpC;
+			index = SSGCtrl->CheckIO_FEP(SSGS, index, false);
+			for (it = vec->begin(); it != vec->end(); it++)
+			{
+				char          *endptr;
+				unsigned long value;
+
+				tmpV[3] = *it;
+				ReplaceDefineDynamic(SSGS, &tmpV[3]);
+				string tmpS(SSGCtrl->strD.Half(&tmpV[3], "="));
+				if (tmpS.empty())
+					continue;
+				value = strtoul(tmpS.c_str(), &endptr, 0);
+				if (*endptr)
+					continue;
+				if (index != value)
+					continue;
+				tmpV[4] = tmpV[3];
+				break;
+			}
+		}
+	}
+	tmpV[3].clear();
+	*tmpC = '\0';
+}
+#endif
+//---------------------------------------------------------------------
+#if (defined(UNICODE_SUPPORT) && UNICODE_SUPPORT) || (defined(ADDRESS_NAMING_FEP_SUPPORT) && ADDRESS_NAMING_FEP_SUPPORT)
+void __stdcall AddressNamingAdditionalType(TSSGCtrl *SSGCtrl, TSSGSubject *SSGS, vector<string> &tmpV, unsigned long DataSize, char *tmpC)
+{
+	const char *p = tmpV[3].c_str();
+	switch (tmpV[3].length())
+	{
+	case 7:
+#if defined(UNICODE_SUPPORT) && UNICODE_SUPPORT
+		if (*(LPDWORD)p == BSWAP32('unic'))
+		{
+			if (*(LPDWORD)(p + 4) != BSWAP32('ode\0'))
+				break;
+			tmpV[3].clear();
+			AddressNamingFromUnicode(DataSize, tmpC);
+			break;
+		}
+#endif
+#if !defined(ADDRESS_NAMING_FEP_SUPPORT) || !ADDRESS_NAMING_FEP_SUPPORT
+		break;
+#else
+		if (*(LPDWORD)p != BSWAP32('fep_'))
+			break;
+		if (*(LPDWORD)(p + 4) != BSWAP32('num\0'))
+			break;
+		AddressNamingFEPNumber(SSGCtrl, SSGS, tmpV, DataSize, tmpC);
+		break;
+	case 8:
+		if (*(LPDWORD)p != BSWAP32('fep_'))
+			break;
+		if (*(LPDWORD)(p + 4) != BSWAP32('list'))
+			break;
+		AddressNamingFEPList(SSGCtrl, SSGS, tmpV, DataSize, tmpC);
+		break;
+	case 13:
+		if (*(LPDWORD)p != BSWAP32('fep_'))
+			break;
+		if (*(LPDWORD)(p + 4) != BSWAP32('free'))
+			break;
+		if (*(LPDWORD)(p + 8) != BSWAP32('_lis'))
+			break;
+		if (p[12] != 't')
+			break;
+		AddressNamingFEPFreeList(SSGCtrl, SSGS, tmpV, DataSize, tmpC);
+		break;
+#endif
+	}
+}
+#endif
+//---------------------------------------------------------------------
 //u̒leɓꂽ񏊓֐v
 //---------------------------------------------------------------------
+#if defined(ADDRESS_NAMING_FMT_SUPPORT) && ADDRESS_NAMING_FMT_SUPPORT
+BOOLEAN __stdcall TSSGCtrl_AddressNaming_OneRead(const string *NameStr, HANDLE SHandle, DWORD Address, char *tmpC, DWORD DataSize)
+{
+	do	/* do { ... } while (0); */
+	{
+		const char *p;
+
+		p = NameStr->begin();
+		while (__intrinsic_isspace(*p))
+			p++;
+		if (*p == '_')
+		{
+			p++;
+			while (__intrinsic_isspace(*p))
+				p++;
+			if (p[0] == 'v' && p[1] == 'a' && p[2] == 'l')
+			{
+				p += 3;
+				while (__intrinsic_isspace(*p))
+					p++;
+				if (*p == ',')
+					break;
+			}
+		}
+		return Address && TProcessCtrl::OneRead(SHandle, Address, tmpC, DataSize);
+	} while (0);
+	switch (DataSize)
+	{
+	case 4:
+		*(LPDWORD)tmpC = Address;
+		break;
+	case 3:
+		*(LPDWORD)tmpC = Address & 0x00FFFFFF;
+		break;
+	case 2:
+		*(LPWORD)tmpC = (WORD)Address;
+		break;
+	case 1:
+		*(LPBYTE)tmpC = (BYTE)Address;
+		break;
+	default:
+		return FALSE;
+	}
+	return TRUE;
+}
+//---------------------------------------------------------------------
+#endif
 string TSSGCtrl::AddressNaming(TSSGSubject *SSGS, const string &NameStr)
 {
  string tmpS( strD.Trim(NameStr) );
@@ -1625,7 +2951,13 @@
 	//"@t@C->test"Ȃ
 	vector<string> *tmpV = GetSSGDataFile(SSGS, tmpS.substr(1,string::npos), ".CHN");
 	if(tmpV==NULL) return "";	//t@C݂܂
+#if !defined(FIX_PARSER) || !FIX_PARSER
 	return GetNameString(SSGS, strD.Join("", *tmpV)); }
+#else
+	tmpS = strD.Join("", *tmpV);
+	ReplaceDefineDynamic(SSGS, &tmpS);
+	return GetNameString(SSGS, tmpS); }
+#endif
  default:
     return strD.Remove(tmpS, NULL, strD::etREPLACE);
  }
@@ -1641,18 +2973,28 @@
  unsigned long DataSize;
  {//f[^
 	unsigned long Address = GetAddress(SSGS, tmpV[1]);
+#if !defined(ADDRESS_NAMING_FMT_SUPPORT) || !ADDRESS_NAMING_FMT_SUPPORT
     if(Address==0) return tmpV[4];
+#endif
 	DataSize = TStringDivision::ToULongDef(tmpV[2]);
 	if(DataSize==0) return tmpV[4];
 
 	TSmartHandle SHandle;
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
 	if(( SHandle=processCtrl.Open(PROCESS_VM_READ) )==NULL)
+#else
+	if ((SHandle = TSSGCtrl_OpenProcess(&processCtrl, PROCESS_VM_READ, tmpV[1].c_str())) == NULL)
+#endif
 		return tmpV[4];	//vZX̃I[vG[
 
     tmpC = new char[DataSize+1];
     tmpC[DataSize]=(char)NULL;
 
+#if !defined(ADDRESS_NAMING_FMT_SUPPORT) || !ADDRESS_NAMING_FMT_SUPPORT
 	if(!TProcessCtrl::OneRead(SHandle, Address, tmpC, DataSize)){
+#else
+	if (!TSSGCtrl_AddressNaming_OneRead(&NameStr, SHandle, Address, tmpC, DataSize)) {
+#endif
         delete[] tmpC;
  		return tmpV[4]; //G[ȂtmpV[4]Ԃ
 	}
@@ -1673,7 +3015,15 @@
 		//"_mem,0x430000,4,list,Error,t@C, , "
 		Index = (Index-TStringDivision::ToULongDef(tmpV[6]))/TStringDivision::ToULongDef(tmpV[7],1);
 		if(Index < List->size())
+#if !defined(FIX_PARSER) || !FIX_PARSER
 			return List->at(Index);
+#else
+		{
+			tmpS = List->at(Index);
+			ReplaceDefineDynamic(SSGS, &tmpS);
+			return tmpS;
+		}
+#endif
 	}else if(tmpV[3]=="free_list"){	//t[Xg
 		//"_mem,0x430000,8,\(00),Error, lstt@C"
 		string tmpS;
@@ -1683,6 +3033,9 @@
 		for(; VIt!=VEnd; VIt++){
 			//Xgt@ĆuIndex=v`ŗ
 			tmpS = *VIt;
+#if defined(FIX_PARSER) && FIX_PARSER
+			ByteArrayReplaceDefine(SSGS, &tmpS);
+#endif
 			if(Index!= TStringDivision::ToULongDef( strD.Half(&tmpS,"=") ))
 				continue;
 			return tmpS;
@@ -1699,6 +3052,7 @@
 
 	string Ret;
 	switch(*tmpV[5].rbegin()){//[tmpV[5].size()-1]){
+#if !defined(FIX_FORMAT) || !FIX_FORMAT
 	case 'd': case 'i': case 'o': case 'u': case 'x': case 'X':{
 		if(DataSize>4){
 			Ret=tmpV[4];	break;
@@ -1708,19 +3062,52 @@
 		Ret = TStringDivision::ToString(Val, tmpV[5].c_str());
 		break;}
 	case 'e': case 'E': case 'f': case 'g': case 'G':{
+#else
+	case 'e': case 'E': case 'f': case 'g': case 'G': case 'a': case 'A': {
+#endif
 		if(DataSize>8){
 			Ret=tmpV[4];	break;
 		}
+#if !defined(FIX_ADDRESS_NAMING_FROM_FLOAT) || !FIX_ADDRESS_NAMING_FROM_FLOAT
 		double Val = 0;
 		memcpy(&Val, tmpC, DataSize);	//lƌȂ
 		Ret = TStringDivision::ToString(Val, tmpV[5].c_str());
+#else
+		double Val =
+			DataSize >= sizeof(double) ? *(double *)tmpC :
+			DataSize >= sizeof(float ) ? *(float  *)tmpC :
+			0;
+		Ret = TStringDivision::ToStringDouble(Val, tmpV[5].c_str());
+#endif
 		break;}
+#if !defined(FIX_FORMAT) || !FIX_FORMAT
 	default:
 		Ret=tmpV[4]; //G[ȂtmpV[4]Ԃ
+#else
+	case 'n':
+		Ret = tmpV[4];
+		break;
+	default:
+		if (DataSize > 4)
+		{
+			Ret = tmpV[4];
+		}
+		else
+		{
+			unsigned long Val = 0;
+			memcpy(&Val, tmpC, DataSize);
+			Ret = TStringDivision::ToString(Val, tmpV[5].c_str());
+		}
+		break;
+#endif
 	}
 	delete[] tmpC;
 	return Ret;
  }
+#if (defined(UNICODE_SUPPORT) && UNICODE_SUPPORT) || (defined(ADDRESS_NAMING_FEP_SUPPORT) && ADDRESS_NAMING_FEP_SUPPORT)
+ else
+	AddressNamingAdditionalType(this, SSGS, tmpV, DataSize, tmpC);
+#endif
 
  string Data;
  Data = tmpC;
@@ -1764,12 +3151,309 @@
 //---------------------------------------------------------------------
 //uoCg񕶎񂩂vector<TProcessAccessElementBase*>𐶐֐v
 //---------------------------------------------------------------------
+#if defined(FIX_LOOP_BYTE_ARRAY) && FIX_LOOP_BYTE_ARRAY
+void __stdcall TSSGCtrl_StrToProcessAccessElementVec_FixLoopByteArray(
+	TSSGCtrl                          *SSGCtrl,
+	TSSGSubject                       *SSGS,
+	string                            &Code,
+	TProcessAccessElementBase         *NowAE,
+	unsigned long                     PosEnd,
+	unsigned long                     PosSep,
+	unsigned long                     FillSize,
+	list<TProcessAccessElementBase *> &CodeList)
+{
+	const char *find = NULL;
+	const char *p = Code.c_str() + PosSep + 2;
+	const char *end = Code.c_str() + PosEnd;
+	if (p + 4 < end)
+	{
+		end -= 4;
+		do
+		{
+			if (*(LPDWORD)p != /*BSWAP32('$Rel')*/'leR$' || !__intrinsic_isascii(*(p + 4)) || __intrinsic__iscsym(*(p + 4)))
+			{
+				if (!__intrinsic_isleadbyte(*p))
+					p++;
+				else
+					p += 2;
+			}
+			else
+			{
+				find = p;
+				break;
+			}
+		} while (p < end);
+	}
+	if (find == NULL)
+	{
+		vector<TProcessAccessElementBase *> LoopVec(SSGCtrl->StrToProcessAccessElementVec(SSGS, Code.substr(PosSep + 2, PosEnd - (PosSep + 2))));
+		((TProcessAccessElementLoop*)NowAE)->MakeLoopSet(FillSize, LoopVec, true);
+	}
+	else if (FillSize != 0)
+	{
+		string LoopCode = Code.substr(PosSep + 2, PosEnd - (PosSep + 2));
+		DWORD Rel = 0;
+		for (; ; )
+		{
+			vector<TProcessAccessElementBase *> LoopVec(SSGCtrl->StrToProcessAccessElementVec(SSGS, LoopCode, Rel));
+			for (vector<TProcessAccessElementBase *>::iterator it = LoopVec.begin(); it != LoopVec.end(); it++)
+			{
+				DWORD NextRel = Rel + (*it)->GetSize(true);
+				if (NextRel < FillSize)
+				{
+					Rel = NextRel;
+					CodeList.push_back(*it);
+				}
+				else
+				{
+					if (NextRel != FillSize)
+						(*it)->SetSize(FillSize - Rel, true);
+					CodeList.push_back(*it);
+					return;
+				}
+			}
+		}
+	}
+}
+//---------------------------------------------------------------------
+#endif
+#if defined(FIX_REMOVE_SPACE) && FIX_REMOVE_SPACE
+void __stdcall TSSGCtrl_ByteArrayRemoveSpace(string &Code)
+{
+	char *p1, *end;
+
+	TrimString(&Code);
+	p1 = Code.begin();
+	end = Code.end();
+	while (p1 < end)
+	{
+		char ch;
+
+		ch = *p1;
+		if (!__intrinsic_isleadbyte(ch))
+		{
+			if (__intrinsic_isspace(ch))
+			{
+				char *p2;
+
+				p2 = p1 + 1;
+				while (__intrinsic_isspace(*p2))
+					p2++;
+				memcpy(p1, p2, end - p2);
+				*(end -= p2 - p1) = '\0';
+				continue;
+			}
+			if (ch == '$')
+			{
+				p1 += 2;
+				for (; ; )
+				{
+					if (p1 >= end)
+						goto OUTER_BREAK;
+					ch = *p1;
+					if (!__intrinsic_isleadbyte(ch))
+					{
+						p1++;
+						if (ch != '$' || *p1 != '$')
+							continue;
+						else
+							break;
+					}
+					else
+						p1 += 2;
+				}
+			}
+			p1++;
+		}
+		else
+			p1 += 2;
+	}
+OUTER_BREAK:
+	if (end != Code.end())
+		Code.resize(end - Code.begin());
+}
+//---------------------------------------------------------------------
+#endif
+#if defined(FIX_BYTE_ARRAY_FIND) && FIX_BYTE_ARRAY_FIND
+LPCSTR __stdcall TSSGCtrl_ByteArraySkipReplacementType(LPCSTR SrcIt, LPCSTR SrcEnd, unsigned long Option)
+{
+	SrcIt++;
+	for (; ; )
+	{
+		char ch;
+
+		ch = *(SrcIt++);
+		if (SrcIt >= SrcEnd)
+			break;
+		if (!__intrinsic_isleadbyte(ch))
+		{
+			if (ch != '\\')
+			{
+				if (ch != '$' || *SrcIt != '$')
+					continue;
+				SrcIt++;
+				break;
+			}
+			if (!(Option & strD::dtESCAPE))
+				continue;
+			ch = *SrcIt;
+			if (__intrinsic_isleadbyte(ch))
+				SrcIt++;
+		}
+		SrcIt++;
+	}
+	return SrcIt;
+}
+//---------------------------------------------------------------------
+#define TokenLength 2
+size_t __stdcall TSSGCtrl_ByteArrayFind(const string &Src, const char Token[TokenLength], unsigned long FromIndex, unsigned long ToIndex, unsigned long Option)
+{
+	size_t SrcLength;
+	LPCSTR SrcIt, SrcEnd;
+
+	if (FromIndex == ToIndex)
+		return SIZE_MAX;
+
+	SrcLength = Src.length();
+
+	if (SrcLength < TokenLength)
+		return SIZE_MAX;
+
+	if (SrcLength < ToIndex || SrcLength < ToIndex + TokenLength)
+		ToIndex = SrcLength - TokenLength + 1;
+
+	SrcIt = Src.c_str() + FromIndex;
+	SrcEnd = Src.c_str() + ToIndex;
+
+	while (SrcIt < SrcEnd)
+	{
+		char ch;
+
+		ch = *(SrcIt++);
+		if (!__intrinsic_isleadbyte(ch))
+		{
+			size_t NCount;
+
+			switch (ch)
+			{
+			case '*':
+				ch = *SrcIt;
+				if (Token[0] == '*' && Token[1] == ch)
+					goto TOKEN_FOUND;
+				switch (ch)
+				{
+				case '<':
+				case '[':
+				case '{':
+					goto NEST_START_TAG1;
+				default:
+					continue;
+				}
+			case '<':
+				if (*SrcIt != '_')
+					continue;
+			NEST_START_TAG1:
+				NCount = 1;
+				SrcIt++;
+				for (; ; )
+				{
+					ch = *(SrcIt++);
+					if (SrcIt >= SrcEnd)
+						goto FAILED;
+					if (!__intrinsic_isleadbyte(ch))
+					{
+						switch (ch)
+						{
+						case '*':
+							switch (*SrcIt)
+							{
+							case '<':
+							case '[':
+							case '{':
+								goto NEST_START_TAG2;
+							case '>':
+							case ']':
+							case '}':
+								goto NEST_END_TAG;
+							default:
+								continue;
+							}
+						case '<':
+							if (*SrcIt != '_')
+								continue;
+						NEST_START_TAG2:
+							NCount++;
+							SrcIt++;
+							continue;
+						case '_':
+							if (*SrcIt != '>')
+								continue;
+						NEST_END_TAG:
+							if (--NCount == 0)
+								goto NESTED_BREAK;
+							SrcIt++;
+							continue;
+						case '$':
+							SrcIt = TSSGCtrl_ByteArraySkipReplacementType(SrcIt, SrcEnd, Option);
+							if (SrcIt < SrcEnd)
+								continue;
+							else
+								goto FAILED;
+						case '\\':
+							if (!(Option & strD::dtESCAPE))
+								continue;
+							ch = *SrcIt;
+							if (__intrinsic_isleadbyte(ch))
+								SrcIt++;
+							break;
+						default:
+							continue;
+						}
+					}
+					SrcIt++;
+				}
+			NESTED_BREAK:
+				continue;
+			case '$':
+				SrcIt = TSSGCtrl_ByteArraySkipReplacementType(SrcIt, SrcEnd, Option);
+				continue;
+			case '\\':
+				if (!(Option & strD::dtESCAPE))
+					continue;
+				ch = *SrcIt;
+				if (__intrinsic_isleadbyte(ch))
+					SrcIt++;
+				break;
+			default:
+				if (Token[0] == ch && Token[1] == *SrcIt)
+				{
+			TOKEN_FOUND:
+					return SrcIt - Src.c_str() - 1;
+				}
+				continue;
+			}
+		}
+		SrcIt++;
+	}
+FAILED:
+	return SIZE_MAX;
+}
+#undef TokenLength
+//---------------------------------------------------------------------
+#endif
+#if !defined(FIX_LOOP_BYTE_ARRAY) || !FIX_LOOP_BYTE_ARRAY
 vector<TProcessAccessElementBase*> TSSGCtrl::StrToProcessAccessElementVec(
 	TSSGSubject *SSGS, string Code)
+#else
+vector<TProcessAccessElementBase *> TSSGCtrl::StrToProcessAccessElementVec(TSSGSubject *SSGS, string Code, unsigned long Rel)
+#endif
 {
 
  Code = strD.Trim(Code);
  if(Code.empty()) return vector<TProcessAccessElementBase*>();
+#if defined(FIX_PARSER) && FIX_PARSER
+ ByteArrayReplaceDefine(SSGS, &Code);
+#endif
  if(Code[0] == 's'){	//`
 	TProcessAccessElementData *NowAE= new TProcessAccessElementData();
 	vector<byte> *DataV = NowAE->GetData();
@@ -1779,10 +3463,23 @@
 		SIt  = Code.begin()+1,
 		SEnd = Code.end();
 	for(; SIt!=SEnd; SIt++){
+#if !defined(OPTIMIZE_STRINGDIVISION) || !OPTIMIZE_STRINGDIVISION
 		if( ((byte)*SIt != '\\')||(strD.IsHeadByte(Code,SIt)!=0) ){
 			DataV->push_back( (byte)*SIt );
 			continue;
 		}
+#else
+		if (*SIt != '\\')
+		{
+			if (__intrinsic_isleadbyte(*SIt))
+			{
+				DataV->push_back((byte)*SIt);
+				SIt++;
+			}
+			DataV->push_back((byte)*SIt);
+			continue;
+		}
+#endif
 		if((++SIt)==SEnd) break;
 
 		if((byte)*SIt=='\\'){
@@ -1808,7 +3505,11 @@
  list<TProcessAccessElementBase*> CodeList;
 
 
+#if !defined(FIX_REMOVE_SPACE) || !FIX_REMOVE_SPACE
  Code = strD.Remove(Code," ");
+#else
+ TSSGCtrl_ByteArrayRemoveSpace(Code);
+#endif
 
  string tmpS;
  //vfȂ̂ŁAAf[^ɂȂȂTProcessAccessElementBasehNXȂȂłǂB
@@ -1847,13 +3548,25 @@
 			strD.SetDividOption(&NewNestStartTag, &NewNestEndTag);
 
 			//*{ C2DD00 :: FFDDFF :: DD00DD *}
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosEndIf = strD.Find(Code, NewNestEndTag, i+2, string::npos, strD::dtNEST);
+#else
+			unsigned long PosEndIf = TSSGCtrl_ByteArrayFind(Code, NewNestEndTag.c_str(), i + 2, string::npos, 0);
+#endif
 			if((size_t)PosEndIf==string::npos) break;	//ΉEND_IFȂI
 
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosTrue  = strD.Find(Code, "::", i+2, PosEndIf, strD::dtNEST+strD::dtESCAPE);
+#else
+			unsigned long PosTrue = TSSGCtrl_ByteArrayFind(Code, "::", i + 2, PosEndIf, strD::dtESCAPE);
+#endif
 			if((size_t)PosTrue==string::npos) break;	//Ή^̏ȂI
 			
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosFalse = strD.Find(Code, "::", PosTrue+2, PosEndIf , strD::dtNEST+strD::dtESCAPE);
+#else
+			unsigned long PosFalse = TSSGCtrl_ByteArrayFind(Code, "::", PosTrue + 2, PosEndIf, strD::dtESCAPE);
+#endif
 			strD.SetDividOption(&OldNestStartTag, &OldNestEndTag);  //ɖ߂
 
 			((TProcessAccessElementIf*)NowAE)->SetConditionVec(	//̉͂
@@ -1919,21 +3632,41 @@
 			strD.SetDividOption(&NewNestStartTag, &NewNestEndTag);
 
 			//*[ 0x40 :: FFDDFF *]
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosEnd = strD.Find(Code, NewNestEndTag, i+2, string::npos, strD::dtNEST);
+#else
+			unsigned long PosEnd = TSSGCtrl_ByteArrayFind(Code, NewNestEndTag.c_str(), i + 2, string::npos, 0);
+#endif
 			if((size_t)PosEnd==string::npos) break;	//ΉENDȂI
 
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosSep  = strD.Find(Code, "::", i+2, PosEnd, strD::dtNEST+strD::dtESCAPE);
+#else
+			unsigned long PosSep = TSSGCtrl_ByteArrayFind(Code, "::", i + 2, PosEnd, strD::dtESCAPE);
+#endif
 			if((size_t)PosSep==string::npos) break;	//Ή鏈oCg񂪂ȂI
 			
 			strD.SetDividOption(&OldNestStartTag, &OldNestEndTag);  //ɖ߂
 			
 			//tBTCY̓AhXŋLq
 			unsigned long FillSize = GetAddress(SSGS, Code.substr(i+2, PosSep-(i+2)) );
+#if !defined(FIX_LOOP_BYTE_ARRAY) || !FIX_LOOP_BYTE_ARRAY
 			vector<TProcessAccessElementBase *> LoopVec(	//[ṽoCg
 				StrToProcessAccessElementVec(SSGS, Code.substr(PosSep+2, PosEnd-(PosSep+2))) );
 			
 			//[vf[^̐ݒ
 			((TProcessAccessElementLoop*)NowAE)->MakeLoopSet( FillSize, LoopVec, true );
+#else
+			TSSGCtrl_StrToProcessAccessElementVec_FixLoopByteArray(
+				this,
+				SSGS,
+				Code,
+				NowAE,
+				PosEnd,
+				PosSep,
+				FillSize,
+				CodeList);
+#endif
 			i = PosEnd;	//ߏI[܂œǂݔ΂
 			break;}
 		}
@@ -1943,7 +3676,11 @@
 		if((size_t)PosEnd==string::npos) break;
 
 		//AhXR[fBO𔲂oĉ
+#if !defined(FIX_LOOP_BYTE_ARRAY) || !FIX_LOOP_BYTE_ARRAY
 		unsigned long Val = Parsing(SSGS, (string)Code.substr(i+2, PosEnd-(i+2)), 0);
+#else
+		unsigned long Val = Parsing(SSGS, (string)Code.substr(i + 2, PosEnd - (i + 2)), 3, "Rel", (ULONGLONG)Rel, 0);
+#endif
 
 		vector<byte> Data;
 		switch(Code[i+1]){	//oCg̒lɕϊ邩ŐU蕪
@@ -1983,10 +3720,18 @@
 			strD.SetDividOption(&NewNestStartTag, &NewNestEndTag);
 
 			//<_ A020 :: FFCC _>	}XNf[^::f[^
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosEnd = strD.Find(Code, NewNestEndTag, i+2, string::npos, strD::dtNEST);
+#else
+			unsigned long PosEnd = TSSGCtrl_ByteArrayFind(Code, NewNestEndTag.c_str(), i + 2, string::npos, 0);
+#endif
 			if((size_t)PosEnd==string::npos) break;	//ΉENDȂI
 
+#if !defined(FIX_BYTE_ARRAY_FIND) || !FIX_BYTE_ARRAY_FIND
 			unsigned long PosSep  = strD.Find(Code, "::", i+2, PosEnd, strD::dtNEST+strD::dtESCAPE);
+#else
+			unsigned long PosSep = TSSGCtrl_ByteArrayFind(Code, "::", i + 2, PosEnd, strD::dtESCAPE);
+#endif
 			if((size_t)PosSep==string::npos) break;	//Ή鏈oCg񂪂ȂI
 			
 			strD.SetDividOption(&OldNestStartTag, &OldNestEndTag);  //ɖ߂
@@ -2087,9 +3832,72 @@
     string OnCode, string &OffCode, bool IsOn,
     unsigned long StartAddress, unsigned long OffsetAddress)
 {
+#if !defined(FIX_TOGGLE_BYTE_ARRAY) || !FIX_TOGGLE_BYTE_ARRAY
  string AddressStr( strD.Half(&OnCode, "-", 0, strD::dtESCAPE) );
  if(AddressStr=="-")	//JԂȂ
 	return StrToProcessAccessElementVec(SSGS, (IsOn)? OnCode: OffCode );
+#else
+	LPCSTR lpFind, lpSrc, lpPtr;
+	char   ch;
+
+	lpFind = NULL;
+	lpSrc = OnCode.c_str();
+	for (lpPtr = lpSrc; (ch = *lpPtr) != '\0'; lpPtr++)
+	{
+		if (!__intrinsic_isleadbyte(ch))
+		{
+			if (ch == '-')
+			{
+				lpFind = lpPtr;
+				break;
+			}
+			if (ch == '$')
+			{
+				ch = *(lpPtr + 1);
+				if ((BYTE)ch < (BYTE)'1' || (BYTE)ch > (BYTE)'4')
+					continue;
+				lpPtr++;
+				while ((ch = *(++lpPtr)) != '\0')
+				{
+					if (!__intrinsic_isleadbyte(ch))
+					{
+						if (ch == '$')
+						{
+							if (*(lpPtr + 1) == '$')
+								break;
+							else
+								continue;
+						}
+						if (ch != '\\')
+							continue;
+						if ((ch = *(++lpPtr)) == '\0')
+							break;
+						if (!__intrinsic_isleadbyte(ch))
+							continue;
+					}
+					if ((ch = *(++lpPtr)) == '\0')
+						break;
+				}
+				if (ch != '\0')
+					continue;
+				else
+					break;
+			}
+			if (ch != '\\')
+				continue;
+			if ((ch = *(++lpPtr)) == '\0')
+				break;
+			if (!__intrinsic_isleadbyte(ch))
+				continue;
+		}
+		if (*(++lpPtr) == '\0')
+			break;
+	}
+	if (lpFind == NULL)
+		return StrToProcessAccessElementVec(SSGS, IsOn ? OnCode : OffCode);
+	string AddressStr(lpSrc, lpFind - lpSrc);
+	OnCode = lpFind + 1;
+#endif
 
  vector<TProcessAccessElementBase*> LoopVec( StrToProcessAccessElementVec(SSGS, (IsOn)? OnCode: OffCode) );
 
@@ -2130,7 +3938,13 @@
  unsigned long i=0, End=List->size();
  for(; i<End; i++){
 	if(List->at(i).empty()) continue;
+#if !defined(FIX_PARSER) || !FIX_PARSER
 	strD.List(List->at(i), ",", &tmpV);
+#else
+	string Src(List->at(i));
+	ReplaceDefineDynamic(SSGS, &Src);
+	strD.List(Src, ",", &tmpV);
+#endif
 	tmpV.resize(3);
 
 	Address = GetAddress(SSGS, tmpV[1]);
@@ -2143,7 +3957,11 @@
 		CompareVec = MakeDataCode(SSGS, tmpV[2], string(""), true, Address,0);
 	}else{
 		//ʂU(0)ȂȀ
+#if !defined(FIX_PARSER) || !FIX_PARSER
 		if( Parsing(SSGS, tmpV[0], Val) == 0 ) continue;
+#else
+		if (Parsing(SSGS, tmpV[0], 3, "Val", (ULONGLONG)Val, 0) == 0) continue;
+#endif
 
 		CompareVec = MakeDataCode(SSGS, tmpV[2], string(""), true, Address,0);
 		i=End;	//A܂
@@ -2152,7 +3970,12 @@
 	if(CompareVec.GetData()->empty()) continue;
 
 	//t@lCg
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
 	if(Write(SSGS, SHandle, &Address, *CompareVec.GetData())!=0) return false;
+#else
+	if (Write(SSGS, TSSGCtrl_IsRemoteProcess(tmpV[1].c_str()) ? (HANDLE)SHandle : ::GetCurrentProcess(), &Address, *CompareVec.GetData()) != 0)
+		return false;
+#endif
  }
 
  return true;
@@ -2167,7 +3990,11 @@
  TIO_FEPAttribute *tmpAE = (TIO_FEPAttribute *)GetAttribute(SSGS, ssgCtrl::atIO_FEP);
  if(tmpAE==NULL) return Val;
 
+#if !defined(FIX_PARSER) || !FIX_PARSER
  return Parsing(SSGS, (string)((IsInput)?tmpAE->GetInputCode(): tmpAE->GetOutputCode()), Val);
+#else
+ return Parsing(SSGS, (string)((IsInput) ? tmpAE->GetInputCode() : tmpAE->GetOutputCode()), 3, "Val", (ULONGLONG)Val, 0);
+#endif
 }
 //---------------------------------------------------------------------
 double TSSGCtrl::CheckIO_FEPDouble(TSSGSubject *SSGS, double Val, bool IsInput)
@@ -2181,8 +4008,14 @@
 //u[enabled]`FbNALȍڂǂ𔻒肷֐v
 //	E[enabled]͑iKpȂ̂ŁAێׂĂ􂢏oă`FbN܂B
 //---------------------------------------------------------------------
+#if !defined(SUBJECT_STATUS) || !SUBJECT_STATUS
 bool TSSGCtrl::IsEnabled(TSSGSubject *SSGS)
 {
+#else
+bool TSSGCtrl::IsEnabled(TSSGSubject *SSGS, BOOLEAN evaluateAtRead/* = FALSE*/)
+{
+ SSGS->evaluateAtRead = evaluateAtRead;
+#endif
  vector<TSSGAttributeElement *> *AttrV = SSGS->GetAttribute();
  if(AttrV==NULL) return true;
 
@@ -2220,6 +4053,9 @@
 //---------------------------------------------------------------------
 //uSrcAUt|[hL@ɂƉ͂֐v
 //---------------------------------------------------------------------
+#if defined(FIX_PARSER) && FIX_PARSER
+#include "Parsing.c"
+#else
 unsigned long TSSGCtrl::Parsing(TSSGSubject *SSGS, const string &Src, unsigned long Val)
 {
  vector<string> tmpV, SentenceVec;
@@ -2461,14 +4297,28 @@
 
  return Operand.top();
 }
+#endif
 //---------------------------------------------------------------------
 //uvZX̃I[v֐v
 //---------------------------------------------------------------------
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
 HANDLE TSSGCtrl::Open(TSSGSubject *SSGS, DWORD Mode)
+#else
+HANDLE TSSGCtrl::Open(TSSGSubject *SSGS, DWORD Mode, LPCSTR addressStr/* = NULL*/)
+#endif
 {
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
  if(ssgActionListner==NULL) return processCtrl.Open(Mode);
+#else
+ if (ssgActionListner == NULL)
+	return TSSGCtrl_OpenProcess(&processCtrl, Mode, addressStr);
+#endif
 
+#if !defined(LOCAL_MEMORY_SUPPORT) || !LOCAL_MEMORY_SUPPORT
  HANDLE Handle = processCtrl.Open(Mode);
+#else
+ HANDLE Handle = TSSGCtrl_OpenProcess(&processCtrl, Mode, addressStr);
+#endif
  if(Handle==NULL){
 	ssgActionListner->OnProcessOpenError(SSGS);
 	return NULL;
@@ -2509,6 +4359,16 @@
 	ssgActionListner->OnSubjectWriteSuccess(SSGS, OldAddress);
     return 0;
  }
+#if defined(ERRORSKIP_SUPPORT) && ERRORSKIP_SUPPORT
+#define AT_ERRORSKIP 0x2000
+ if (GetAttribute(SSGS, AT_ERRORSKIP))
+ {
+	if (MainForm->GetUserMode() == 3)
+		return 0;
+	Ret = 0;
+ }
+#undef AT_ERRORSKIP
+#endif
  ssgActionListner->OnSubjectWriteError(SSGS, OldAddress);
  return Ret;
 }
@@ -2545,6 +4405,33 @@
  ssgActionListner->OnSubjectReadError(SSGS, Address);
  return false;
 }
+#if defined(IO_FEP_SUPPORT) && IO_FEP_SUPPORT
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneRead_with_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size)
+{
+	if (!_this->OneRead(SSGS, ProcessHandle, Address, Data, Size))
+		return FALSE;
+	if (TSSGSubject_IsFEP(SSGS))
+		*(LPDWORD)Data = _this->CheckIO_FEP(SSGS, *(LPDWORD)Data, false);
+	return TRUE;
+}
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneRead_with_CheckLocalMemory_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr)
+{
+	if (TSSGCtrl_OneRead_with_CheckLocalMemory(_this, SSGS, ProcessHandle, Address, Data, Size, AddressStr))
+	{
+		if (TSSGSubject_IsFEP(SSGS))
+		{
+			*(LPDWORD)Data = _this->CheckIO_FEP(SSGS, *(LPDWORD)Data, false);
+		}
+		return TRUE;
+	}
+	else
+	{
+		return FALSE;
+	}
+}
+#endif
 //---------------------------------------------------------------------
 //uvZX̊ȈՃCg֐v
 //---------------------------------------------------------------------
@@ -2560,6 +4447,22 @@
  ssgActionListner->OnSubjectWriteError(SSGS, Address);
  return false;
 }
+#if defined(IO_FEP_SUPPORT) && IO_FEP_SUPPORT
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneWrite_with_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size)
+{
+	if (TSSGSubject_IsFEP(SSGS))
+		*(LPDWORD)Data = _this->CheckIO_FEP(SSGS, *(LPDWORD)Data, true);
+	return _this->OneWrite(SSGS, ProcessHandle, Address, Data, Size);
+}
+//---------------------------------------------------------------------
+BOOLEAN __stdcall TSSGCtrl_OneWrite_with_CheckLocalMemory_CheckIO_FEP(TSSGCtrl *_this, TSSGSubject *SSGS, HANDLE ProcessHandle, DWORD Address, LPVOID Data, DWORD Size, const string &AddressStr)
+{
+	if (TSSGSubject_IsFEP(SSGS))
+		*(LPDWORD)Data = _this->CheckIO_FEP(SSGS, *(LPDWORD)Data, true);
+	return TSSGCtrl_OneWrite_with_CheckLocalMemory(_this, SSGS, ProcessHandle, Address, Data, Size, AddressStr);
+}
+#endif
 //---------------------------------------------------------------------
 //uvZX̊ȈՔr֐v
 //---------------------------------------------------------------------
