	struct StreamRW
	{
+00		DWORD dwFilePos;
+04		DWORD dwFileSize;
+08		LPVOID pBuffer;
+0C		BYTE bUnknown;
+0D		BYTE bSemaphoreFlag;
+0E		WORD wUseFlag;
+10		DWORD dwReadRequest;
+14		HANDLE hSemaphore;
+18		HANDLE hFile;
+1C		struct OVERLAPPED
		{
+1C			ULONG_PTR Internal;
+20			ULONG_PTR InternalHigh;
+24			DWORD Offset;
+28			DWORD OffsetHigh;
+2C			HANDLE hEvent;
		} olStruct;
	};

8E3FE0	DWORD dwFileFlag;
8E3FE4	DWORD
8E3FE8	DWORD dwEnableOverlap;
8E3FEC	DWORD* pStreamIndex;
8E3FF0	DWORD dwReqStream;
8E3FF4	DWORD dwCurStream;
8E3FF8	DWORD dwMaxRW;
8E3FFC	StreamRW* pStreamRW;
8E4000	DWORD dwStreamThreadID;
8E4004	HANDLE hStreamSemaphore;
8E4008	HANDLE hStreamThreadHandle;
8E4010	HANDLE hStreamFile[32];
8E4098	CHAR cStreamFilePath[32][64];
8E4090	DWORD dwMaxSteam;
8E4898	HANDLE hCurStreamFile;
8E4CAC	LPVOID* ppBuffer;

406560	VOID $_StreamReaderThread
	{
		while (true)
		{
406578			WaitForSingleObject(hStreamSemaphore, INFINITE);
			_StreamIndex = (dwReqStream == dwCurStream) ? -1 : pStreamIndex[dwReqStream];
4065A7			pStreamRW[_StreamIndex].wUseFlag = 1;
4065AB			if (!pStreamRW[_StreamIndex].dwReadRequest)
			{
4065BE				if (dwEnableOverlap)
				{
4065C2					pStreamRW[_StreamIndex].olStruct.Offset = pStreamRW[_StreamIndex].dwFilePos * 2048;
4065D9					if (ReadFile(pStreamRW[_StreamIndex].hFile, pStreamRW[_StreamIndex].pBuffer, pStreamRW[_StreamIndex].dwFileSize * 2048, 0, &pStreamRW[_StreamIndex].olStruct))
					{
4065E0						pStreamRW[_StreamIndex].dwReadRequest = 0;
					} else
					{
4065E5						if (GetLastError() != ERROR_IO_PENDING)
						{
4065FE							pStreamRW[_StreamIndex].dwReadRequest = (GetOverlappedResult(pStreamRW[_StreamIndex].hFile, &pStreamRW[_StreamIndex].olStruct, pStreamRW[_StreamIndex].dwFileSize * 2048, TRUE)) ? 0 : -2;
						} else
						{
406610							pStreamRW[_StreamIndex].dwReadRequest = 0xFE;
						}
					}
				} else
				{
406620					SetFilePointer(pStreamRW[_StreamIndex].hFile, pStreamRW[_StreamIndex].dwFilePos * 2048, NULL, FILE_BEGIN);
4065D9					pStreamRW[_StreamIndex].dwReadRequest = (ReadFile(pStreamRW[_StreamIndex].hFile, pStreamRW[_StreamIndex].pBuffer, pStreamRW[_StreamIndex].dwFileSize * 2048, 0, NULL)) ? 0 : -2;
				}
			}
406653			if (dwReqStream != dwCurStream)
			{
406663				dwReqStream = (dwReqStream + 1) % dwMaxRW;
			}
406669			pStreamRW[_StreamIndex].dwFileSize = 0;
40666C			if (StreamRW[_StreamIndex].bSemaphoreFlag)
			{
406678				ReleaseSemaphore(StreamRW[_StreamIndex].hSemaphore, 1, NULL);
			}
40667E			StreamRW[_StreamIndex].wUseFlag = 0;
		}
	}

4067B0	BOOL $_openStream(LPCTSTR lpFileName, DWORD)
	{
		for (_FileIndex = 0; _FileIndex < 32; _FileIndex++)
		{
			if (!hStreamFile[_FileIndex]) break;
		}
1564AC5		SetLastError(0);
1564B20		hStreamFile[_FileIndex] = CreateFile(lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, dwFileFlag | FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS, NULL);
1564B32		if (hStreamFile[_FileIndex] == INVALID_HANDLE_VALUE) return FALSE;
		strcpy(cStreamFilePath[_FileIndex], lpFileName);
1564B55		return _FileIndex << 0x18;
	}

4068F0	VOID $_startStreaming()
	{
4068F5		SetLastError(0);
		for (DWORD i = 0; i < dwMaxSteam; i++)
		{
406918			StreamRW[i].hSemaphore = CreateSemaphore(0, 0, 2, NULL);
		}
40693F		LocalAlloc(LMEM_ZEROINIT, dwMaxSteam * 4 + 4);
406974		hStreamSemaphore = CreateSemaphore(0, 0, 5, "CdStream");
4069C0		hStreamThreadHandle = CreateThread(0, 0x10000, 0x406560, 0, 4, &dwStreamThreadID);
	}

406A20	BOOL $_readStream(DWORD dwStreamIndex, LPVOID pBuffer, DWORD dwReadPos, DWORD dwReadSize)
	{
156C2D1		hCurStreamFile = dwReadPos << 0x18 + ;
156C2E4		SetLastError(0);
156C2EF		if ([8E3FE4])
		{
156C2FA			if (pStreamRW[dwStreamIndex].dwFileSize) return FALSE;
156C305			if (pStreamRW[dwStreamIndex].wUseFlag) return FALSE;
156C311			pStreamRW[dwStreamIndex].dwReadRequest = 0;
156C318			pStreamRW[dwStreamIndex].dwFilePos = dwReadPos & 0x00FFFFFF;
156C31A			pStreamRW[dwStreamIndex].dwFileSize = dwReadSize;
156C31D			pStreamRW[dwStreamIndex].pBuffer = pBuffer;
156C324			pStreamRW[dwStreamIndex].bSemaphoreFlag = 0;
156C33F			pStreamIndex[[8E3FE4]] = dwStreamIndex;
156C35A			dwCurStream = (dwCurStream + 1) % dwMaxRW;
156C378			if (ReleaseSemaphore(hStreamSemaphore, 1, NULL)) retun TRUE;
			return TRUE;
		} else
		{
		}
	}


40cba0

40774F
40CF34 // .col .ipl .txd
4E00FB // Audio
4E0182 // Audio

8E4CC9
66CC


	struct IMGHeader
	{
+00		
+04		
+08		DWORD dwFilePos;
+0C		DWORD dwFileSize;
+10		DWORD dwFileType;
	}

8E4CC0	IMGHeader imghStruct[];
946750	IMGHeader imghStructX[];
9654B4	IMGHeader* pIMGHeader = imghStruct;
A9B0C8	void* pModel[];

	find (, , , , , BYTE iFileType)
	{
408E20		int _local0;
408E20		int _local1;
408E20		int _local2;
		_local0 = -1;
		_local1 = -1;
		_local2 = -1;
		_register_edi0 = (&pIMGHeader[*(short*)(*(void**)0x8E4C58)] - imghStruct) / 0x14
		_register_ebp0 &pIMGHeader[pIMGHeader[*(short*)(*(void**)0x8E4C58)].00]
		if ((iFileType == 0) || (*(DWORD*)0x8E4BA0 == 0) || (pIMGHeader[*(short*)(*(void**)0x8E4C58)].06 != 0))
		{
			if (_register_edi0 < 20000)
			{
				_register_edx0 = imghStructX[pModel[_register_edx0].0A].dwFileType
				if ((_register_edx0 != 1) && (_register_edx0 != 3))
				{
					imghStruct[_register_edi0].06
					loadmodel(pModel[_register_edx0].0A + 20000)
				}
			} else
			if (_register_edi0 < 0x61A8)
			{
			}
		}


	}

40CBA0	sub_40CBA0()
	{
40CC75		sub_408E20(, 1);
	}

40CC75	sub_408E20(, 1);
	{
		GetLast
	}

	struct IMGFile
	{
+00		CHAR cPath[0x28];
+28		DWORD dwFlag;
+2C		DWORD dwFileIndex;
	}


8E48D8	IMGFile imgfStruct[8];

407610	DWORD _openImgFile (LPCTSTR lpFileName, DWORD dwFlag)
	{
		_register_edi0 = 0;
1567B83		for (_register_eax0 = &imgfStruct[0]; _register_eax0 < &imgfStruct[8]; _register_eax0 += 0x30)
		{
1567B88			if (*_register_eax0 == 0) break;
			_register_edi0++;
1567B91			if (_register_eax0 == &imgfStruct[8])
			{
1567B9B				return;
			}
		}
		strcpy(imgfStruct[_register_edi0].cPath, lpFileName);
1567BBF		imgfStruct[_register_edi0].dwFileIndex = $_openStream(lpFileName, dwFlag);
1567BD1		imgfStruct[_register_edi0].dwFlag = dwFlag;
	}

40F740	sub_40F740 ()
	{
1564973		if
	}
