--- a/StrRefDlg.cpp
+++ b/StrRefDlg.cpp
@@ -37,7 +37,7 @@
 void CStrRefDlg::DoDataExchange(CDataExchange* pDX)
 {
 	CDialog::DoDataExchange(pDX);
-  m_maxstr.Format("/ %d",tlk_headerinfo.entrynum);
+  m_maxstr.Format("/ %d",tlk_headerinfo[0].entrynum);
 	//{{AFX_DATA_MAP(CStrRefDlg)
 	DDX_Text(pDX, IDC_SOUND, m_sound);
 	DDV_MaxChars(pDX, m_sound, 8);
@@ -49,7 +49,7 @@
 	DDX_Control(pDX, IDC_SPIN, m_spin_control);
 	DDX_Control(pDX, IDC_STRREF, m_strref_control);
 	//}}AFX_DATA_MAP
-  m_spin_control.SetRange32(0,tlk_headerinfo.entrynum);
+  m_spin_control.SetRange32(0,tlk_headerinfo[0].entrynum);
 }
 
 BEGIN_MESSAGE_MAP(CStrRefDlg, CDialog)
@@ -87,7 +87,7 @@
   m_text=resolve_tlk_text(m_strref);
   m_sound=resolve_tlk_soundref(m_strref);
   strref="Edit TLK ";
-  if(global_changed) strref+="*";
+  if(global_changed[0]==true) strref+="*";
   SetWindowText(strref);
   UpdateData(UD_DISPLAY);
 }
@@ -107,14 +107,14 @@
     }
   }
 
-  if(tlk_headerinfo.entrynum==-1)
-  {
-    memcpy(tlk_headerinfo.signature,"TLK V1  ",8);
-    tlk_headerinfo.entrynum=0;
+  if(tlk_headerinfo[0].entrynum==-1)
+  {
+    memcpy(tlk_headerinfo[0].signature,"TLK V1  ",8);
+    tlk_headerinfo[0].entrynum=0;
     store_tlk_text(0,"<NO TEXT>");
     m_strref=1;
   }
-	if(m_strref>0 && m_strref<=tlk_headerinfo.entrynum) //allow = so we can add strings
+	if(m_strref>0 && m_strref<=tlk_headerinfo[0].entrynum) //allow = so we can add strings
   {
     m_strref=store_tlk_text(m_strref, m_text);
   }
@@ -139,7 +139,7 @@
     }
   }
 
-	if(m_strref>0 && m_strref<tlk_headerinfo.entrynum)
+	if(m_strref>0 && m_strref<tlk_headerinfo[0].entrynum)
   {
     m_strref=store_tlk_soundref(m_strref, m_sound);
   }
@@ -155,7 +155,7 @@
     }
   }
 
-	if(m_strref>0 && m_strref<tlk_headerinfo.entrynum)
+	if(m_strref>0 && m_strref<tlk_headerinfo[0].entrynum)
   {
     toggle_tlk_tag(m_strref);	
   }
@@ -244,15 +244,15 @@
   CString tmpstr;
   int tmpstart;
 
-  RetrieveResref(tmpstr,tlk_entries[idx].reference.soundref);
+  RetrieveResref(tmpstr,tlk_entries[0][idx].reference.soundref);
   tmpstart=tmpstr.Find(search);
   if(tmpstart!=-1)
   {
     if(mode)
     {
       tmpstr.Replace(search,replace);
-      StoreResref(tmpstr,tlk_entries[idx].reference.soundref);
-      global_changed=true;
+      StoreResref(tmpstr,tlk_entries[0][idx].reference.soundref);
+      global_changed[0]=true;
     }
     return true;
   }
@@ -278,59 +278,59 @@
   switch(mode)
   {
   case SR_SEARCH:
-    tmp2=tlk_entries[idx].text;
+    tmp2=tlk_entries[0][idx].text;
     if(match&1) // case insensitive trick
     {
       tmp2.MakeLower();
     }
     if(match&2) // full word trick
     {
-      tmp2=" "+tlk_entries[idx].text+" "; //in this
+      tmp2=" "+tlk_entries[0][idx].text+" "; //in this
     }
     if(tmp2.Find(srch) !=-1) found=true;
     break;
   case SR_REPLACE: case SR_ALL:
-    tmplen=tlk_entries[idx].text.GetLength();
+    tmplen=tlk_entries[0][idx].text.GetLength();
     if(match&2)
     {
-      tlk_entries[idx].text=" "+tlk_entries[idx].text+" ";
+      tlk_entries[0][idx].text=" "+tlk_entries[0][idx].text+" ";
     }
     if(match&1)
     {
-      tmp2=tlk_entries[idx].text;
+      tmp2=tlk_entries[0][idx].text;
       tmp2.MakeLower();
       tmpstart=tmp2.Find(srch);
       if(tmpstart==-1) ch=0;
       else
       {
-        tlk_entries[idx].text.Delete(tmpstart,len);
-        tlk_entries[idx].text.Insert(tmpstart,replace);
+        tlk_entries[0][idx].text.Delete(tmpstart,len);
+        tlk_entries[0][idx].text.Insert(tmpstart,replace);
         ch=true;        
       }
     }
     else
     {
-      ch=tlk_entries[idx].text.Replace(srch,replace);
+      ch=tlk_entries[0][idx].text.Replace(srch,replace);
     }
     if(match&2)
     {
-      tlk_entries[idx].text=tlk_entries[idx].text.Mid(1,tmplen);
+      tlk_entries[0][idx].text=tlk_entries[0][idx].text.Mid(1,tmplen);
     }
     if(ch)
     {
-      tlk_entries[idx].reference.length=tlk_entries[idx].text.GetLength();
-      if(!tlk_entries[idx].reference.length)
+      tlk_entries[0][idx].reference.length=tlk_entries[0][idx].text.GetLength();
+      if(!tlk_entries[0][idx].reference.length)
       {
-        if(tlk_entries[idx].reference.soundref[0]) tlk_entries[idx].reference.flags=2; //only sound reference
+        if(tlk_entries[0][idx].reference.soundref[0]) tlk_entries[0][idx].reference.flags=2; //only sound reference
         else
         {
-          tlk_entries[idx].reference.flags=0; //deleted entry
-          tlk_entries[idx].reference.pitch=0;
-          tlk_entries[idx].reference.volume=0;
-          memset(tlk_entries[idx].reference.soundref,0,sizeof(tlk_entries[idx].reference.soundref));
+          tlk_entries[0][idx].reference.flags=0; //deleted entry
+          tlk_entries[0][idx].reference.pitch=0;
+          tlk_entries[0][idx].reference.volume=0;
+          memset(tlk_entries[0][idx].reference.soundref,0,sizeof(resref_t));
         }         
       }
-      global_changed=true;
+      global_changed[0]=true;
       found=true;
     }
     break;
@@ -346,11 +346,11 @@
   CString what;
   
   idx=m_strref;
-  if(idx<0 || idx>=tlk_headerinfo.entrynum)
+  if(idx<0 || idx>=tlk_headerinfo[0].entrynum)
   {
     idx=0;
   }
-  if(!tlk_headerinfo.entrynum) return -1;
+  if(!tlk_headerinfo[0].entrynum) return -1;
   oldidx=idx;
 
   if(m_mode) //search for string
@@ -388,7 +388,7 @@
   {
     idx+=direction;
   }
-  while(direction<1? idx : idx<tlk_headerinfo.entrynum)
+  while(direction<1? idx : idx<tlk_headerinfo[0].entrynum)
   {
     if(perform_search_and_replace(idx,mode,match,search,replace,m_mode))
     {
@@ -418,7 +418,7 @@
     }
     else
     {
-      idx=tlk_headerinfo.entrynum-1;
+      idx=tlk_headerinfo[0].entrynum-1;
     }
     while(idx!=oldidx)
     {
@@ -477,10 +477,15 @@
 
 void CStrRefDlg::OnSave() 
 {
-	((CChitemDlg *) AfxGetMainWnd())->write_file_progress(tlkfilename);
-  if(global_changed)
-  {
-    MessageBox(tlkfilename+" wasn't saved, exit all other programs that might use it, and try again.","Warning",MB_ICONEXCLAMATION|MB_OK);
+	((CChitemDlg *) AfxGetMainWnd())->write_file_progress(0);
+  if(global_changed[0]==true)
+  {
+    MessageBox(((CChitemDlg *) AfxGetMainWnd())->GetTlkFileName(0)+" wasn't saved, exit all other programs that might use it, and try again.","Warning",MB_ICONEXCLAMATION|MB_OK);
+  }
+	((CChitemDlg *) AfxGetMainWnd())->write_file_progress(1);
+  if(global_changed[1]==true)
+  {
+    MessageBox(((CChitemDlg *) AfxGetMainWnd())->GetTlkFileName(1)+" wasn't saved, exit all other programs that might use it, and try again.","Warning",MB_ICONEXCLAMATION|MB_OK);
   }
   OnUpdateStrref();
 }
@@ -496,7 +501,7 @@
   CString tmpstr;
 
 	OnKillfocusStrref();
-  if(tlk_headerinfo.entrynum<1)
+  if(tlk_headerinfo[0].entrynum<1)
   {
     MessageBox("Can't truncate an empty file.","Warning",MB_OK);
     return;
@@ -504,7 +509,8 @@
   tmpstr.Format("Do you really want to remove all entries above #%ld.",m_strref);
   if(MessageBox(tmpstr,"Truncate",MB_YESNO)==IDYES)
   {
-    if(truncate_references(m_strref+1)) global_changed=true;
+    if(truncate_references(m_strref+1,0)) global_changed[0]=true;
+    if(truncate_references(m_strref+1,1)) global_changed[1]=true;
   	UpdateData(UD_DISPLAY);
   }
 }
@@ -514,7 +520,7 @@
 	massclear mscDlg;
 	
   OnKillfocusStrref();
-  mscDlg.SetRange(1,tlk_headerinfo.entrynum-1, m_strref);
+  mscDlg.SetRange(1,tlk_headerinfo[0].entrynum-1, m_strref);
   mscDlg.SetText("Clearing an interval of entries");  
   if(mscDlg.DoModal()==IDOK)
   {
@@ -530,7 +536,7 @@
 {
   CString old;
 
-	if(m_strref>tlk_headerinfo.entrynum)
+	if(m_strref>tlk_headerinfo[0].entrynum)
   {
     m_strref=0;
   }
@@ -548,28 +554,28 @@
   int chg;
 
   chg=0;
-  for(i=0;i<tlk_headerinfo.entrynum;i++)
+  for(i=0;i<tlk_headerinfo[0].entrynum;i++)
   {
     tmpref=resolve_tlk_soundref(i);
     if(tmpref.IsEmpty())
     {
-      tlk_entries[i].reference.pitch=tlk_entries[i].reference.volume=0;
-      if(tlk_entries[i].text.IsEmpty())
+      tlk_entries[0][i].reference.pitch=tlk_entries[0][i].reference.volume=0;
+      if(tlk_entries[0][i].text.IsEmpty())
       {
-        if(tlk_entries[i].reference.flags)
+        if(tlk_entries[0][i].reference.flags)
         {
           chg=1;
-          tlk_entries[i].reference.flags=0;
+          tlk_entries[0][i].reference.flags=0;
         }
       }
       continue;
     }
     else
     {
-      if(tlk_entries[i].reference.flags&2)
+      if(tlk_entries[0][i].reference.flags&2)
       {
         chg=1;
-        tlk_entries[i].reference.flags|=2;
+        tlk_entries[0][i].reference.flags|=2;
       }
     }
 
@@ -597,7 +603,7 @@
   int chg;
 
   chg=0;
-  for(i=0;i<tlk_headerinfo.entrynum;i++)
+  for(i=0;i<tlk_headerinfo[0].entrynum;i++)
   {
   }	
   if(!chg) MessageBox("No problem found!","Tlk editor",MB_OK);