[Avida-cvs] [Avida2-svn] r362 - in branches/brysonda: Avida2.xcodeproj source/main source/viewer

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Tue Oct 25 06:30:14 PDT 2005


Author: brysonda
Date: 2005-10-25 09:05:04 -0400 (Tue, 25 Oct 2005)
New Revision: 362

Modified:
   branches/brysonda/Avida2.xcodeproj/project.pbxproj
   branches/brysonda/source/main/primitive.cc
   branches/brysonda/source/viewer/CMakeLists.txt
   branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.cc
   branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.h
   branches/brysonda/source/viewer/cBarScreen.cc
   branches/brysonda/source/viewer/cBarScreen.h
   branches/brysonda/source/viewer/cBaseTextWindow.h
   branches/brysonda/source/viewer/cEnvironmentScreen.cc
   branches/brysonda/source/viewer/cEnvironmentScreen.h
   branches/brysonda/source/viewer/cHistScreen.cc
   branches/brysonda/source/viewer/cHistScreen.h
   branches/brysonda/source/viewer/cMapScreen.cc
   branches/brysonda/source/viewer/cMapScreen.h
   branches/brysonda/source/viewer/cMenuWindow.cc
   branches/brysonda/source/viewer/cMenuWindow.h
   branches/brysonda/source/viewer/cOptionsScreen.cc
   branches/brysonda/source/viewer/cOptionsScreen.h
   branches/brysonda/source/viewer/cScreen.cc
   branches/brysonda/source/viewer/cScreen.h
   branches/brysonda/source/viewer/cStatsScreen.cc
   branches/brysonda/source/viewer/cStatsScreen.h
   branches/brysonda/source/viewer/cSymbolUtil.cc
   branches/brysonda/source/viewer/cSymbolUtil.h
   branches/brysonda/source/viewer/cTextWindow.cc
   branches/brysonda/source/viewer/cTextWindow.h
   branches/brysonda/source/viewer/cView.cc
   branches/brysonda/source/viewer/cView.h
   branches/brysonda/source/viewer/cViewInfo.cc
   branches/brysonda/source/viewer/cViewInfo.h
   branches/brysonda/source/viewer/cZoomScreen.cc
   branches/brysonda/source/viewer/cZoomScreen.h
   branches/brysonda/source/viewer/viewer.cc
Log:
(n)curses viewer now works with the restructured avida.  There is still a good deal of cruft, but it is functional.  I have also added in support for the new SMT CPU into the text viewer.  The only caveat with SMT support is that memory space viewing is not currently supported beyond the genome memory space.  Also, I have fixed a bug in the ZoomScreen view that is most likely present in the trunk as well.  When viewing a cell without an organism in it, the zoom screen would crash if you attempted to change zoom views.  It now checks for a valid organism before attempting to get and cast the Hardware object.

Modified: branches/brysonda/Avida2.xcodeproj/project.pbxproj
===================================================================
--- branches/brysonda/Avida2.xcodeproj/project.pbxproj	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/Avida2.xcodeproj/project.pbxproj	2005-10-25 13:05:04 UTC (rev 362)
@@ -55,36 +55,19 @@
 		7040D36E09095E5900AA820F /* cAvidaDriver_Analyze.cc in Sources */ = {isa = PBXBuildFile; fileRef = 702D4EF908DA5341007BA469 /* cAvidaDriver_Analyze.cc */; };
 		7040D3A6090964D100AA820F /* cMxCodeArray.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865808F4974300FC65FE /* cMxCodeArray.cc */; };
 		704866D3090B51310048600A /* cAvidaDriver_TextPopViewer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B3090B51310048600A /* cAvidaDriver_TextPopViewer.cc */; };
-		704866D4090B51310048600A /* cAvidaDriver_TextPopViewer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866B4090B51310048600A /* cAvidaDriver_TextPopViewer.h */; };
 		704866D5090B51310048600A /* cBarScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B5090B51310048600A /* cBarScreen.cc */; };
-		704866D6090B51310048600A /* cBarScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866B6090B51310048600A /* cBarScreen.h */; };
-		704866D7090B51310048600A /* cBaseTextWindow.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866B7090B51310048600A /* cBaseTextWindow.h */; };
 		704866D8090B51310048600A /* cEnvironmentScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B8090B51310048600A /* cEnvironmentScreen.cc */; };
-		704866D9090B51310048600A /* cEnvironmentScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866B9090B51310048600A /* cEnvironmentScreen.h */; };
 		704866DA090B51310048600A /* cHistScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866BA090B51310048600A /* cHistScreen.cc */; };
-		704866DB090B51310048600A /* cHistScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866BB090B51310048600A /* cHistScreen.h */; };
-		704866DC090B51310048600A /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866BC090B51310048600A /* CMakeLists.txt */; };
 		704866DD090B51310048600A /* cMapScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866BD090B51310048600A /* cMapScreen.cc */; };
-		704866DE090B51310048600A /* cMapScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866BE090B51310048600A /* cMapScreen.h */; };
 		704866DF090B51310048600A /* cMenuWindow.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866BF090B51310048600A /* cMenuWindow.cc */; };
-		704866E0090B51310048600A /* cMenuWindow.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866C0090B51310048600A /* cMenuWindow.h */; };
 		704866E1090B51310048600A /* cOptionsScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866C1090B51310048600A /* cOptionsScreen.cc */; };
-		704866E2090B51310048600A /* cOptionsScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866C2090B51310048600A /* cOptionsScreen.h */; };
 		704866E3090B51310048600A /* cScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866C3090B51310048600A /* cScreen.cc */; };
-		704866E4090B51310048600A /* cScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866C4090B51310048600A /* cScreen.h */; };
 		704866E5090B51310048600A /* cStatsScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866C5090B51310048600A /* cStatsScreen.cc */; };
-		704866E6090B51310048600A /* cStatsScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866C6090B51310048600A /* cStatsScreen.h */; };
 		704866E7090B51310048600A /* cSymbolUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866C7090B51310048600A /* cSymbolUtil.cc */; };
-		704866E8090B51310048600A /* cSymbolUtil.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866C8090B51310048600A /* cSymbolUtil.h */; };
 		704866E9090B51310048600A /* cTextWindow.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866C9090B51310048600A /* cTextWindow.cc */; };
-		704866EA090B51310048600A /* cTextWindow.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866CA090B51310048600A /* cTextWindow.h */; };
 		704866EB090B51310048600A /* cView.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866CB090B51310048600A /* cView.cc */; };
-		704866EC090B51310048600A /* cView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866CC090B51310048600A /* cView.h */; };
 		704866ED090B51310048600A /* cViewInfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866CD090B51310048600A /* cViewInfo.cc */; };
-		704866EE090B51310048600A /* cViewInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866CE090B51310048600A /* cViewInfo.h */; };
 		704866EF090B51310048600A /* cZoomScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866CF090B51310048600A /* cZoomScreen.cc */; };
-		704866F0090B51310048600A /* cZoomScreen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866D0090B51310048600A /* cZoomScreen.h */; };
-		704866F1090B51310048600A /* key_chart in CopyFiles */ = {isa = PBXBuildFile; fileRef = 704866D1090B51310048600A /* key_chart */; };
 		704866F2090B51310048600A /* viewer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866D2090B51310048600A /* viewer.cc */; };
 		70486BA00826722F009328F0 /* analyze.cfg in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC3114B0762539E008F7A48 /* analyze.cfg */; };
 		70486BA10826722F009328F0 /* environment.cfg in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311800762539F008F7A48 /* environment.cfg */; };
@@ -356,23 +339,6 @@
 				70C5BC6609059A970028A785 /* cWorld.h in CopyFiles */,
 				70C5BD6E0905CE5F0028A785 /* cHardwareManager.h in CopyFiles */,
 				7040CF1F0906A52E00AA820F /* cEventManager.h in CopyFiles */,
-				704866D4090B51310048600A /* cAvidaDriver_TextPopViewer.h in CopyFiles */,
-				704866D6090B51310048600A /* cBarScreen.h in CopyFiles */,
-				704866D7090B51310048600A /* cBaseTextWindow.h in CopyFiles */,
-				704866D9090B51310048600A /* cEnvironmentScreen.h in CopyFiles */,
-				704866DB090B51310048600A /* cHistScreen.h in CopyFiles */,
-				704866DC090B51310048600A /* CMakeLists.txt in CopyFiles */,
-				704866DE090B51310048600A /* cMapScreen.h in CopyFiles */,
-				704866E0090B51310048600A /* cMenuWindow.h in CopyFiles */,
-				704866E2090B51310048600A /* cOptionsScreen.h in CopyFiles */,
-				704866E4090B51310048600A /* cScreen.h in CopyFiles */,
-				704866E6090B51310048600A /* cStatsScreen.h in CopyFiles */,
-				704866E8090B51310048600A /* cSymbolUtil.h in CopyFiles */,
-				704866EA090B51310048600A /* cTextWindow.h in CopyFiles */,
-				704866EC090B51310048600A /* cView.h in CopyFiles */,
-				704866EE090B51310048600A /* cViewInfo.h in CopyFiles */,
-				704866F0090B51310048600A /* cZoomScreen.h in CopyFiles */,
-				704866F1090B51310048600A /* key_chart in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: branches/brysonda/source/main/primitive.cc
===================================================================
--- branches/brysonda/source/main/primitive.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/main/primitive.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -11,10 +11,8 @@
 #include "avida.h"
 #include "cAvidaConfig.h"
 #include "cAvidaDriver_Analyze.h"
-#include "cAvidaDriver_Base.h"
 #include "cAvidaDriver_Population.h"
 #include "cWorld.h"
-#include "defs.h"
 
 using namespace std;
 

Modified: branches/brysonda/source/viewer/CMakeLists.txt
===================================================================
--- branches/brysonda/source/viewer/CMakeLists.txt	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/CMakeLists.txt	2005-10-25 13:05:04 UTC (rev 362)
@@ -7,25 +7,26 @@
   )
 
   SET(libviewer_SOURCES
-    ansi.cc
-    bar_screen.cc
-    environment_screen.cc
-    hist_screen.cc
-    map_screen.cc
-    menu.cc
-    ncurses.cc
-    options_screen.cc
-    stats_screen.cc
-    symbol_util.cc
-    text_screen.cc
-    view.cc
-    zoom_screen.cc
+    cAvidaDriver_TextPopViewer.cc
+    cBarScreen.cc
+    cEnvironmentScreen.cc
+    cHistScreen.cc
+    cMapScreen.cc
+    cMenuWindow.cc
+    cOptionsScreen.cc
+    cScreen.cc
+    cStatsScreen.cc
+    cSymbolUtil.cc
+    cTextWindow.cc
+    cView.cc
+    cViewInfo.cc
+    cZoomScreen.cc
   )
   ADD_LIBRARY(viewer ${libviewer_SOURCES})
 
-  ADD_EXECUTABLE(AvidaConsole viewer.cc)
+  ADD_EXECUTABLE(viewer viewer.cc)
   IF(WIN32)
-    TARGET_LINK_LIBRARIES(AvidaConsole
+    TARGET_LINK_LIBRARIES(viewer
       viewer
       main
       cpu
@@ -36,7 +37,7 @@
       ${NCURSES_LIBRARY}
     )
   ELSE(WIN32)
-    TARGET_LINK_LIBRARIES(AvidaConsole
+    TARGET_LINK_LIBRARIES(viewer
       viewer
       main
       cpu
@@ -50,5 +51,5 @@
   ENDIF(WIN32)
   LINK_DIRECTORIES(${ALL_LIB_DIRS} ${THIRDPARTY_BLD_DIR}/trio)
 
-  INSTALL_TARGETS(/work AvidaConsole)
+  INSTALL_TARGETS(/work viewer)
 ENDIF(AVD_GUI_NCURSES)

Modified: branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.cc
===================================================================
--- branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,79 +5,25 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEWER_HH
-#include "viewer.hh"
-#endif
+#include "cAvidaDriver_TextPopViewer.h"
 
-#ifndef CONFIG_HH
-#include "cConfig.h"
-#endif
-#ifndef ENVIRONMENT_HH
-#include "cEnvironment.h"
-#endif
-#ifndef POPULATION_HH
 #include "cPopulation.h"
-#endif
-#ifndef VIEW_HH
-#include "../viewers/view.hh"          // class cView
-#endif
+#include "cView.h"
+#include "cWorld.h"
 
+#include <iostream>
 
 using namespace std;
 
-
-int main(int argc, char * argv[])
-{
-  // Catch Interrupt making sure to close appropriately
-  signal(SIGINT, ExitAvida);
-
-  // output copyright message
-  cout << AvidaVersion() << endl;
-  cout << "----------------------------------------------------------------------" << endl;
-  cout << "Copyright (C) 1999-2005 Michigan State University." << endl;
-  cout << "Copyright (C) 1993-2003 California Institute of Technology." << endl << endl;
-  
-  cout << "Avida comes with ABSOLUTELY NO WARRANTY." << endl;
-  cout << "This is free software, and you are welcome to redistribute it" << endl;
-  cout << "under certain conditions. See file COPYING for details." << endl << endl;
-  
-  // Initialize the configuration data...
-  cConfig::InitGroupList();
-  cConfig::Setup(argc, argv);
-  cConfig::SetupMS();
-
-  cEnvironment environment;
-  cPopulationInterface test_interface;
-
-  SetupAvida(environment, test_interface);
-
-  if (cConfig::GetAnalyzeMode() == true) {
-    cAvidaDriver_Base::main_driver = new cAvidaDriver_Analyze();
-  }
-  else {
-    cAvidaDriver_Base::main_driver = new cAvidaDriver_TextPopViewer(environment);
-  }
-
-  cAvidaDriver_Base::main_driver->Run();
-
-  // Exit Nicely
-  ExitAvida(0);
-}
-
-
-////////////////////////////////
-//  cAvidaDriver_TextPopViewer
-////////////////////////////////
-
 cAvidaDriver_TextPopViewer::
-cAvidaDriver_TextPopViewer(cEnvironment & environment)
-  : cAvidaDriver_Population(environment)
+cAvidaDriver_TextPopViewer(cWorld* world)
+  : cAvidaDriver_Population(world)
   , viewer(NULL)
 {
   cout << "Initializing Text Viewer... " << flush;
 
-  viewer = new cView(*population);
-  viewer->SetViewMode(cConfig::GetViewMode());
+  viewer = new cView(world);
+  viewer->SetViewMode(world->GetConfig().VIEW_MODE.Get());
 
   cout << " ...done" << endl;
 }
@@ -89,27 +35,25 @@
 
 void cAvidaDriver_TextPopViewer::ProcessOrganisms()
 {
-  //  cout << "DEBUG: Running Update w/ Viewer" << endl;
-
   // Process the update.
-  const int UD_size = cConfig::GetAveTimeslice()*population->GetNumOrganisms();
+  const int UD_size = m_world->GetConfig().AVE_TIME_SLICE.Get() * m_world->GetPopulation().GetNumOrganisms();
   const double step_size = 1.0 / (double) UD_size;
 
   // Are we stepping through an organism?
   if (viewer->GetStepOrganism() != -1) {  // Yes we are!
     // Keep the viewer informed about the organism we are stepping through...
     for (int i = 0; i < UD_size; i++) {
-      const int next_id = population->ScheduleOrganism();
+      const int next_id = m_world->GetPopulation().ScheduleOrganism();
       if (next_id == viewer->GetStepOrganism()) viewer->NotifyUpdate();
-      population->ProcessStep(step_size, next_id);
+      m_world->GetPopulation().ProcessStep(step_size, next_id);
     }
   }
   else {
-    for (int i = 0; i < UD_size; i++) population->ProcessStep(step_size);
+    for (int i = 0; i < UD_size; i++) m_world->GetPopulation().ProcessStep(step_size);
   }
 
   // end of update stats...
-  population->CalcUpdateStats();
+  m_world->GetPopulation().CalcUpdateStats();
 
   // Setup the viewer for the new update.
   if (viewer->GetStepOrganism() == -1) NotifyUpdate();

Modified: branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.h
===================================================================
--- branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cAvidaDriver_TextPopViewer.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,20 +5,10 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEWERS_HH
-#define VIEWERS_HH
+#ifndef cAvidaDriver_TextPopViewer_h
+#define cAvidaDriver_TextPopViewer_h
 
-#ifndef avida_h
-#include "avida.h"
-#endif
-
-#ifndef AVIDA_DRIVER_ANALYZE_HH
-#include "cAvidaDriver_Analyze.h"
-#endif
-#ifndef AVIDA_DRIVER_BASE_HH
-#include "cAvidaDriver_Base.h"
-#endif
-#ifndef AVIDA_DRIVER_POPULATION_HH
+#ifndef cAvidaDriver_Population_h
 #include "cAvidaDriver_Population.h"
 #endif
 
@@ -26,9 +16,9 @@
 
 class cAvidaDriver_TextPopViewer : public cAvidaDriver_Population {
 protected:
-  cView * viewer;
+  cView* viewer;
 public:
-  cAvidaDriver_TextPopViewer(cEnvironment & environment);
+  cAvidaDriver_TextPopViewer(cWorld* world);
   ~cAvidaDriver_TextPopViewer();
 
   virtual void ProcessOrganisms();

Modified: branches/brysonda/source/viewer/cBarScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cBarScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cBarScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,20 +5,14 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
+#include "cBarScreen.h"
+
 #include "cPopulation.h"
 #include "cStats.h"
 #include "cEnvironment.h"
 
-#include "bar_screen.hh"
-
-
 using namespace std;
 
-
-///////////////////
-// The Bar Screen
-///////////////////
-
 void cBarScreen::Draw()
 {
   SetBoldColor(COLOR_WHITE);

Modified: branches/brysonda/source/viewer/cBarScreen.h
===================================================================
--- branches/brysonda/source/viewer/cBarScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cBarScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,19 +5,24 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_BAR_SCREEN_HH
-#define VIEW_BAR_SCREEN_HH
+#ifndef cBarScreen_h
+#define cBarScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
+#ifndef cString_h
+#include "cString.h"
+#endif
 
 class cBarScreen : public cScreen {
 protected:
-  cPopulation & population;
+  cPopulation& population;
   cString prog_name;
 public:
   cBarScreen(int y_size, int x_size, int y_start, int x_start,
 	     cViewInfo & in_info, const cString & in_name,
-	     cPopulation & in_pop) :
+	     cPopulation& in_pop) :
     cScreen(y_size, x_size, y_start, x_start, in_info),
     population(in_pop),
     prog_name(in_name) { ; }

Modified: branches/brysonda/source/viewer/cBaseTextWindow.h
===================================================================
--- branches/brysonda/source/viewer/cBaseTextWindow.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cBaseTextWindow.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,14 +5,15 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_TEXT_WINDOW_HH
-#define VIEW_TEXT_WINDOW_HH
+#ifndef cBaseTextWindow_h
+#define cBaseTextWindow_h
 
 #include <assert.h>
+
+#ifndef cTools_h
 #include "cTools.h"
+#endif
 
-// class cTextWindow;
-
 #define MAX_SUB_WINDOWS 4
 
 class cCoords {
@@ -128,7 +129,7 @@
   virtual void Print(int in_y, int in_x, chtype ch) = 0;
   virtual void Print(const char * fmt, ...) = 0;
   virtual void Print(int in_y, int in_x, const char * fmt, ...) = 0;
-  inline void PrintBinary(int in_y, int in_x, UINT value) {
+  inline void PrintBinary(int in_y, int in_x, unsigned int value) {
     for (int i = 0; i < 32; i++) {
       if ((value >> i) & 1) Print(in_y, in_x+31-i, '1');
       else Print(in_y, in_x+31-i, '0');

Modified: branches/brysonda/source/viewer/cEnvironmentScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cEnvironmentScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cEnvironmentScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,31 +5,22 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "cConfig.h"
+#include "cEnvironmentScreen.h"
+
 #include "cEnvironment.h"
 #include "cGenebank.h"
 #include "cGenotype.h"
 #include "cPopulation.h"
-#ifndef REACTION_HH
 #include "cReaction.h"
-#endif
-#ifndef REACTION_PROCESS_HH
 #include "cReactionProcess.h"
-#endif
-#ifndef RESOURCE_HH
 #include "cResource.h"
-#endif
 #include "cSpecies.h"
 #include "cStats.h"
 #include "cPopulationCell.h"
 #include "cOrganism.h"
 
-#include "environment_screen.hh"
-
-
 using namespace std;
 
-
 void cEnvironmentScreen::Draw()
 {
   SetBoldColor(COLOR_WHITE);

Modified: branches/brysonda/source/viewer/cEnvironmentScreen.h
===================================================================
--- branches/brysonda/source/viewer/cEnvironmentScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cEnvironmentScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,10 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_ENVIRONMENT_SCREEN_HH
-#define VIEW_ENVIRONMENT_SCREEN_HH
+#ifndef cEnvironmentScreen_h
+#define cEnvironmentScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
 
 class cEnvironmentScreen : public cScreen {
 protected:
@@ -16,9 +18,7 @@
   int mode;
   int res_selection;
   int rxn_selection;
-  //int task_offset;
-  //int task_rows;
-  //int task_cols;
+
   static const int ENVIRONMENT_MODE_RESOURCE = 0;
   static const int ENVIRONMENT_MODE_REACTION = 1;
 

Modified: branches/brysonda/source/viewer/cHistScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cHistScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cHistScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -11,7 +11,7 @@
 #include "cGenotype.h"
 #include "cSpecies.h"
 
-#include "hist_screen.hh"
+#include "cHistScreen.h"
 
 
 using namespace std;

Modified: branches/brysonda/source/viewer/cHistScreen.h
===================================================================
--- branches/brysonda/source/viewer/cHistScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cHistScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,10 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_HIST_SCREEN_HH
-#define VIEW_HIST_SCREEN_HH
+#ifndef cHistScreen_h
+#define cHistScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
 
 class cGenotype;
 class cSpecies;

Modified: branches/brysonda/source/viewer/cMapScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cMapScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cMapScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,22 +5,16 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include <fstream>
+#include "cMapScreen.h"
 
 #include "cGenotype.h"
 #include "cPopulation.h"
 #include "cPopulationCell.h"
 
-#include "map_screen.hh"
+#include <fstream>
 
-
 using namespace std;
 
-
-///////////////////
-// The Map Screen
-///////////////////
-
 cMapScreen::cMapScreen(int _y_size, int _x_size, int _y_start,
       int _x_start, cViewInfo & in_info, cPopulation & in_pop) :
   cScreen(_y_size, _x_size, _y_start, _x_start, in_info),

Modified: branches/brysonda/source/viewer/cMapScreen.h
===================================================================
--- branches/brysonda/source/viewer/cMapScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cMapScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,10 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_MAP_SCREEN_HH
-#define VIEW_MAP_SCREEN_HH
+#ifndef cMapScreen_h
+#define cMapScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
 
 #define	AVIDA_MAP_X_SPACING 2
 

Modified: branches/brysonda/source/viewer/cMenuWindow.cc
===================================================================
--- branches/brysonda/source/viewer/cMenuWindow.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cMenuWindow.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,9 +5,8 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "menu.hh"
+#include "cMenuWindow.h"
 
-
 using namespace std;
 
 

Modified: branches/brysonda/source/viewer/cMenuWindow.h
===================================================================
--- branches/brysonda/source/viewer/cMenuWindow.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cMenuWindow.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,14 +5,16 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_MENU_HH
-#define VIEW_MENU_HH
+#ifndef cMenuWindow_h
+#define cMenuWindow_h
 
+#ifndef cString_h
 #include "cString.h"
+#endif
+#ifndef cTextWindow_h
+#include "cTextWindow.h"
+#endif
 
-#include "ncurses.hh"
-#include "ansi.hh"
-
 class cMenuWindow {
 private:
   cTextWindow * window;

Modified: branches/brysonda/source/viewer/cOptionsScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cOptionsScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cOptionsScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,19 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "cConfig.h"
+#include "cOptionsScreen.h"
+
 #include "cPopulation.h"
 
-#include "options_screen.hh"
-
-
 using namespace std;
 
-
-///////////////////////
-//  The Basic Options
-///////////////////////
-
 void cOptionsScreen::Draw()
 {
   // Options - Used: ABCEIMOPQRSVWZ
@@ -86,17 +79,17 @@
   Box(0, Height() - 5, Width(), 5);
 
   SetBoldColor(COLOR_CYAN);
-  Print(5, 15, "%d", cConfig::GetMaxUpdates());
+  Print(5, 15, "%d", info.GetConfig().MAX_UPDATES.Get());
   Print(6, 15, "%dx%d", info.GetPopulation().GetWorldX(),
 	info.GetPopulation().GetWorldY());
-  Print(7, 15, "%d", g_random.GetSeed());
-  Print(8, 15, "%d", cConfig::GetThreshold());
+  Print(7, 15, "%d", info.GetRandom().GetSeed());
+  Print(8, 15, "%d", info.GetConfig().THRESHOLD.Get());
 
-  Print(11, 15, "%s", cConfig::GetInstFilename()());
-  Print(12, 15, "%s", cConfig::GetEnvironmentFilename()());
-  Print(13, 15, "%s", cConfig::GetEventFilename()());
+  Print(11, 15, "%s", info.GetConfig().INST_SET.Get()());
+  Print(12, 15, "%s", info.GetConfig().ENVIRONMENT_FILE.Get()());
+  Print(13, 15, "%s", info.GetConfig().EVENT_FILE.Get()());
 
-  switch(cConfig::GetSlicingMethod()) {
+  switch(info.GetConfig().SLICING_METHOD.Get()) {
   case SLICE_CONSTANT:
     Print(1, 55, "Constant");
     break;
@@ -108,7 +101,7 @@
     break;
   }
 
-  switch(cConfig::GetTaskMeritMethod()) {
+  switch(info.GetConfig().TASK_MERIT_METHOD.Get()) {
     case TASK_MERIT_NONE:
       Print(2, 55, "No Task Bonuses");
       break;
@@ -117,7 +110,7 @@
       break;
   }
 
-  switch(cConfig::GetSizeMeritMethod()) {
+  switch(info.GetConfig().SIZE_MERIT_METHOD.Get()) {
   case SIZE_MERIT_OFF:
     Print(3, 55, "Off");
     break;
@@ -135,7 +128,7 @@
     break;
   }
 
-  switch(cConfig::GetBirthMethod()) {
+  switch(info.GetConfig().BIRTH_METHOD.Get()) {
   case POSITION_CHILD_AGE:
     Print(4, 55, "Replace max age");
     break;
@@ -150,13 +143,13 @@
     break;
   }
 
-  Print(5, 55, "%d", cConfig::GetAveTimeslice());
+  Print(5, 55, "%d", info.GetConfig().AVE_TIME_SLICE.Get());
 
-  Print(7, 52, "%.3f", cConfig::GetPointMutProb());
-  Print(8, 52, "%.3f", cConfig::GetCopyMutProb());
-  Print(9, 52, "%.3f", cConfig::GetDivideMutProb());
-  Print(9, 62, "%.3f", cConfig::GetDivideInsProb());
-  Print(9, 72, "%.3f", cConfig::GetDivideDelProb());
+  Print(7, 52, "%.3f", info.GetConfig().POINT_MUT_PROB.Get());
+  Print(8, 52, "%.3f", info.GetConfig().COPY_MUT_PROB.Get());
+  Print(9, 52, "%.3f", info.GetConfig().DIVIDE_MUT_PROB.Get());
+  Print(9, 62, "%.3f", info.GetConfig().DIVIDE_INS_PROB.Get());
+  Print(9, 72, "%.3f", info.GetConfig().DIVIDE_DEL_PROB.Get());
 
   SetColor(COLOR_WHITE);
 

Modified: branches/brysonda/source/viewer/cOptionsScreen.h
===================================================================
--- branches/brysonda/source/viewer/cOptionsScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cOptionsScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,10 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_OPTIONS_SCREEN_HH
-#define VIEW_OPTIONS_SCREEN_HH
+#ifndef cOptionsScreen_h
+#define cOptionsScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
 
 class cOptionsScreen : public cScreen {
 protected:

Modified: branches/brysonda/source/viewer/cScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,20 +5,3 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include <fstream>
-
-#include "cSpecies.h"
-#include "cGenotype.h"
-#include "cGenebank.h"
-#include "cInjectGenotype.h"
-#include "cInjectGenebank.h"
-#include "cPopulation.h"
-#include "cPopulationCell.h"
-#include "cOrganism.h"
-
-#include "symbol_util.hh"
-#include "text_screen.hh"
-
-
-using namespace std;
-

Modified: branches/brysonda/source/viewer/cScreen.h
===================================================================
--- branches/brysonda/source/viewer/cScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,17 +5,25 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_TEXT_SCREEN_HH
-#define VIEW_TEXT_SCREEN_HH
+#ifndef cScreen_h
+#define cScreen_h
 
-
+#ifndef cInstSet_h
+#include "cInstSet.h"
+#endif
+#ifndef cMerit_h
 #include "cMerit.h"
-#include "cInstSet.h"
+#endif
+#ifndef cTextWindow_h
+#include "cTextWindow.h"
+#endif
+#ifndef cViewInfo_h
+#include "cViewInfo.h"
+#endif
+#ifndef defs_h
 #include "defs.h"
+#endif
 
-#include "ncurses.hh"
-#include "ansi.hh"
-
 class cEnvironment;
 class cSpecies;
 class cGenotype;
@@ -54,7 +62,7 @@
 
 class cScreen : public cTextWindow {
 protected:
-  cViewInfo & info;
+  cViewInfo& info;
 
   inline void SetSymbolColor(char color);
   inline void PrintMerit(int in_y, int in_x, cMerit in_merit);

Modified: branches/brysonda/source/viewer/cStatsScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cStatsScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cStatsScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,21 +5,16 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "cConfig.h"
+#include "cStatsScreen.h"
+
 #include "cEnvironment.h"
 #include "cGenebank.h"
 #include "cGenotype.h"
 #include "cPopulation.h"
 #include "cSpecies.h"
 #include "cStats.h"
-
-#ifndef TASK_ENTRY_HH
 #include "cTaskEntry.h"
-#endif
 
-#include "stats_screen.hh"
-
-
 using namespace std;
 
 
@@ -63,10 +58,10 @@
 
   int task_num = task_offset;
   const cTaskLib & task_lib = population.GetEnvironment().GetTaskLib();
-  for (int col_id = 3; task_num < cConfig::GetNumTasks(); col_id += 20) {
+  for (int col_id = 3; task_num < info.GetWorld().GetNumTasks(); col_id += 20) {
     if (col_id + 16 > Width()) break;
     for (int row_id = 15;
-	 row_id < 15 + task_rows && task_num < cConfig::GetNumTasks();
+	 row_id < 15 + task_rows && task_num < info.GetWorld().GetNumTasks();
 	 row_id++) {
       Print(row_id, col_id, ".........:");
       Print(row_id, col_id, "%s", task_lib.GetTask(task_num).GetName()());
@@ -78,7 +73,7 @@
 
   Box(0, 14, Width(), task_rows + 2);
 
-  if (task_num < cConfig::GetNumTasks() || task_offset != 0) {
+  if (task_num < info.GetWorld().GetNumTasks() || task_offset != 0) {
     SetBoldColor(COLOR_WHITE);
     Print(15 + task_rows, Width() - 20, " [<-] More [->] ");
     SetBoldColor(COLOR_CYAN);
@@ -144,7 +139,7 @@
   if (stats.GetAveMerit() == 0) {
     Print(10, 66, "0.0");
   } else {
-    Print(10, 63, "%6.3f", ((double) cConfig::GetAveTimeslice()) * best_gen->GetFitness() / stats.GetAveMerit());
+    Print(10, 63, "%6.3f", ((double) info.GetConfig().AVE_TIME_SLICE.Get()) * best_gen->GetFitness() / stats.GetAveMerit());
   }
   Print(11, 63, "%6d", best_gen->GetDepth());
   // Print(12, 63, "");
@@ -164,7 +159,7 @@
 		     ((double) stats.GetNumDeaths()) /
 		     ((double) stats.GetNumGenotypes()));
   if (stats.GetAveMerit() != 0) {
-    Print(10, 71, "%7.3f", ((double) cConfig::GetAveTimeslice()) * stats.GetAveFitness() / stats.GetAveMerit());
+    Print(10, 71, "%7.3f", ((double) info.GetConfig().AVE_TIME_SLICE.Get()) * stats.GetAveFitness() / stats.GetAveMerit());
   } else {
     Print(10, 71, "%7.3f", 0.0);
   }
@@ -173,10 +168,10 @@
 
   // This section needs to be changed to work with new task_lib @TCC
   int task_num = task_offset;
-  for (int col_id = 14; task_num < cConfig::GetNumTasks(); col_id += 20) {
+  for (int col_id = 14; task_num < info.GetWorld().GetNumTasks(); col_id += 20) {
     if (col_id + 5 > Width()) break;
     for (int row_id = 15;
-	 row_id < 15 + task_rows && task_num < cConfig::GetNumTasks();
+	 row_id < 15 + task_rows && task_num < info.GetWorld().GetNumTasks();
 	 row_id++) {
       Print(row_id, col_id, "%4d", stats.GetTaskLastCount(task_num));
       task_num++;
@@ -200,7 +195,7 @@
     break;
   case '6':
   case KEY_RIGHT:
-    if (task_rows * task_cols + task_offset < cConfig::GetNumTasks()) {
+    if (task_rows * task_cols + task_offset < info.GetWorld().GetNumTasks()) {
       task_offset += 5;
       Draw();
     }

Modified: branches/brysonda/source/viewer/cStatsScreen.h
===================================================================
--- branches/brysonda/source/viewer/cStatsScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cStatsScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,10 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_STATS_SCREEN_HH
-#define VIEW_STATS_SCREEN_HH
+#ifndef cStatsScreen_h
+#define cStatsScreen_h
 
-#include "text_screen.hh"
+#ifndef cScreen_h
+#include "cScreen.h"
+#endif
 
 class cStatsScreen : public cScreen {
 protected:

Modified: branches/brysonda/source/viewer/cSymbolUtil.cc
===================================================================
--- branches/brysonda/source/viewer/cSymbolUtil.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cSymbolUtil.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,15 +5,14 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
+#include "cSymbolUtil.h"
+
 #include <fstream>
 
-#include "symbol_util.hh"
-
 #include "cGenotype.h"
 #include "cOrganism.h"
 #include "cPopulationCell.h"
 #include "cSpecies.h"
-#include "cConfig.h"
 #include "cHardwareBase.h"
 #include "cHardware4Stack.h"
 #include "cHardwareCPU.h"
@@ -108,17 +107,9 @@
 char cSymbolUtil::GetThreadSymbol(const cPopulationCell & cell)
 {
   if (cell.IsOccupied() == false) return ' ';
-//  const cOrganism & organism = *(cell.GetOrganism());
-
-//    int thread_count = organism->GetHardware()->GetNumThreads();
-//    if (thread_count < 0) return '-';
-//    if (thread_count < 10) return (char) ('0' + thread_count);
-//    if (thread_count < 20) return 'X';
-//    if (thread_count < 80) return 'L';
-//    if (thread_count < 200) return 'C';
-  //const cHardwareBase * hardware; 
+  const int hw_type = static_cast<cHardwareBase*>(&cell.GetOrganism()->GetHardware())->GetType();
   int num_threads;
-  switch (cConfig::GetHardwareType())
+  switch (hw_type)
   {
     case HARDWARE_TYPE_CPU_ORIGINAL:
       num_threads = ((cHardwareCPU &) cell.GetOrganism()->GetHardware()).GetNumThreads();
@@ -130,6 +121,7 @@
       num_threads = static_cast<cHardwareSMT&>(cell.GetOrganism()->GetHardware()).GetNumThreads();
       return (char) ('0' + num_threads);
   }
+  return '0';
 }
 
 char cSymbolUtil::GetLineageSymbol(const cPopulationCell & cell)

Modified: branches/brysonda/source/viewer/cSymbolUtil.h
===================================================================
--- branches/brysonda/source/viewer/cSymbolUtil.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cSymbolUtil.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,8 +5,8 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef SYMBOL_UTIL_HH
-#define SYMBOL_UTIL_HH
+#ifndef cSymbolUtil_h
+#define cSymbolUtil_h
 
 class cPopulationCell;
 
@@ -20,7 +20,7 @@
   static char GetBreedSymbol(    const cPopulationCell & cell );
   static char GetParasiteSymbol( const cPopulationCell & cell );
   static char GetMutSymbol(      const cPopulationCell & cell );
-  static char GetThreadSymbol(   const cPopulationCell & cell );
+  static char GetThreadSymbol(const cPopulationCell & cell);
   static char GetLineageSymbol(  const cPopulationCell & cell );
 };
 

Modified: branches/brysonda/source/viewer/cTextWindow.cc
===================================================================
--- branches/brysonda/source/viewer/cTextWindow.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cTextWindow.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,18 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "ncurses.hh"
+#include "cTextWindow.h"
 
 #include <stdlib.h>
 
-
 using namespace std;
 
-
-////////////////////
-//  cTextWindow
-////////////////////
-
 void cTextWindow::NoDelay() {
   nodelay(stdscr, 1);       // Don't wait for input if no key is pressed.
 }

Modified: branches/brysonda/source/viewer/cTextWindow.h
===================================================================
--- branches/brysonda/source/viewer/cTextWindow.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cTextWindow.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,22 +5,24 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_NCURSES_HH
-#define VIEW_NCURSES_HH
+#ifndef cTextWindow_h
+#define cTextWindow_h
 
 #ifdef HAVE_NCURSES_H
 #include <ncurses.h>
+#undef OK
 #else
 #include <curses.h>
+#undef OK
 #endif
 
+#ifndef cBaseTextWindow_h
+#include "cBaseTextWindow.h"
+#endif
+
 #include <signal.h>
-
-#include "text_window.hh"
 #include <cstdarg>
-using namespace std;
 
-
 // All colors are defines except black on black:
 #define COLOR_OFF    8
 

Modified: branches/brysonda/source/viewer/cView.cc
===================================================================
--- branches/brysonda/source/viewer/cView.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cView.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,60 +5,49 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include <fstream>
+#include "cView.h"
 
-#ifndef ENVIRONMENT_HH
 #include "cEnvironment.h"
-#endif
 #include "cGenotype.h"
 #include "cOrganism.h"
 #include "cPhenotype.h"
 #include "cPopulation.h"
 #include "cPopulationCell.h"
 #include "cStats.h"
-
 #include "cTestUtil.h"
 #include "cHardwareBase.h"
 
-#include "view.hh"
-#include "menu.hh"
+#include "cMenuWindow.h"
+#include "cTextWindow.h"
+#include "cBarScreen.h"
+#include "cMapScreen.h"
+#include "cStatsScreen.h"
+#include "cHistScreen.h"
+#include "cOptionsScreen.h"
+#include "cZoomScreen.h"
+#include "cEnvironmentScreen.h"
 
-#include "ncurses.hh"
-#include "ansi.hh"
+#include <fstream>
 
-#include "bar_screen.hh"
-#include "map_screen.hh"
-#include "stats_screen.hh"
-#include "hist_screen.hh"
-#include "options_screen.hh"
-#include "zoom_screen.hh"
-#include "environment_screen.hh"
-
-
 using namespace std;
 
-
 cTextWindow * cView::base_window = NULL;
-cScreen * cView::cur_screen = NULL;
-cBarScreen * cView::bar_screen = NULL;
+cScreen* cView::cur_screen = NULL;
+cBarScreen* cView::bar_screen = NULL;
 
-//////////////////
-//  cView
-//////////////////
 
-cView::cView(cPopulation & in_population) :
-  info( in_population )
+cView::cView(cWorld* world) : info(world)
 {
   Setup("Avida");
 
-  map_screen     = new cMapScreen     (0,0,3,0,info, in_population);
-  stats_screen   = new cStatsScreen   (0,0,3,0,info, in_population);
-  hist_screen    = new cHistScreen    (0,0,3,0,info, in_population);
+  map_screen     = new cMapScreen     (0,0,3,0,info, world->GetPopulation());
+  stats_screen   = new cStatsScreen   (0,0,3,0,info, world->GetPopulation());
+  hist_screen    = new cHistScreen    (0,0,3,0,info, world->GetPopulation());
   options_screen = new cOptionsScreen (0,0,3,0,info);
-  zoom_screen    = new cZoomScreen    (0,0,3,0,info, in_population);
-  environment_screen = new cEnvironmentScreen (0,0,3,0,info, in_population);
+  zoom_screen    = new cZoomScreen    (0,0,3,0,info, world->GetPopulation());
+  environment_screen = new cEnvironmentScreen (0,0,3,0,info, world->GetPopulation());
 
-  info.SetActiveCell( &( in_population.GetCell(0) ) );
+  info.SetActiveCell( &( world->GetPopulation().GetCell(0) ) );
 }
 
 cView::~cView()
@@ -334,7 +323,7 @@
 
   if (cur_screen) cur_screen->Print(20, 0, "Extracting %s...", gen_name());
 
-  cTestUtil::PrintGenome(cur_gen->GetGenome(), gen_name);
+  cTestUtil::PrintGenome(&info.GetWorld(), cur_gen->GetGenome(), gen_name);
 
   if (cur_screen) {
     cur_screen->Print(20, 24, "Done.");

Modified: branches/brysonda/source/viewer/cView.h
===================================================================
--- branches/brysonda/source/viewer/cView.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cView.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,9 +5,12 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_HH
-#define VIEW_HH
+#ifndef cView_h
+#define cView_h
 
+#ifndef cViewInfo_h
+#include "cViewInfo.h"
+#endif
 
 #define MODE_BLANK   0
 #define MODE_MAP     1
@@ -17,8 +20,7 @@
 #define MODE_ZOOM    5
 #define MODE_ENVIRONMENT 6
 
-#include "text_screen.hh"
-
+class cScreen;
 class cTextWindow;
 class cBarScreen;
 class cMapScreen;
@@ -27,6 +29,7 @@
 class cOptionsScreen;
 class cZoomScreen;
 class cEnvironmentScreen;
+class cWorld;
 
 class cView {
 private:
@@ -60,7 +63,7 @@
   // Map navigation
   void NavigateMapWindow();
 public:
-  cView(cPopulation & in_population);
+  cView(cWorld* world);
   virtual ~cView();
 
   void Setup(const cString & in_name);

Modified: branches/brysonda/source/viewer/cViewInfo.cc
===================================================================
--- branches/brysonda/source/viewer/cViewInfo.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cViewInfo.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,6 +5,8 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
+#include "cViewInfo.h"
+
 #include <fstream>
 
 #include "cSpecies.h"
@@ -16,14 +18,14 @@
 #include "cPopulationCell.h"
 #include "cOrganism.h"
 
-#include "symbol_util.hh"
-#include "text_screen.hh"
+#include "cSymbolUtil.h"
+#include "cScreen.h"
 
 
 using namespace std;
 
 
-cViewInfo::cViewInfo(cPopulation & in_population) : population(in_population)
+cViewInfo::cViewInfo(cWorld* world) : m_world(world), alt_inst_set(world)
 {
   active_cell = NULL;
   pause_level = PAUSE_OFF;
@@ -125,16 +127,16 @@
     break;
   }
 
-  const int num_cells = population.GetSize();
+  const int num_cells = m_world->GetPopulation().GetSize();
   map.Resize(num_cells);
   color_map.Resize(num_cells);
 
   for (int i = 0; i < num_cells; i++) {
     if (map_method == 0) map[i] = 0;
-    else map[i] = (*map_method)(population.GetCell(i));
+    else map[i] = (*map_method)(m_world->GetPopulation().GetCell(i));
 
     if (color_method == 0) color_map[i] = 0;
-    else color_map[i] = (*color_method)(population.GetCell(i));
+    else color_map[i] = (*color_method)(m_world->GetPopulation().GetCell(i));
   }
 
 }
@@ -200,7 +202,7 @@
 
 cGenebank & cViewInfo::GetGenebank()
 {
-  return population.GetGenebank();
+  return m_world->GetPopulation().GetGenebank();
 }
 
 cGenotype * cViewInfo::GetActiveGenotype()

Modified: branches/brysonda/source/viewer/cViewInfo.h
===================================================================
--- branches/brysonda/source/viewer/cViewInfo.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cViewInfo.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,16 +5,14 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_TEXT_SCREEN_HH
-#define VIEW_TEXT_SCREEN_HH
+#ifndef cViewInfo_h
+#define cViewInfo_h
 
-
 #include "cMerit.h"
 #include "cInstSet.h"
 #include "defs.h"
+#include "cTextWindow.h"
 
-#include "ncurses.hh"
-#include "ansi.hh"
 
 class cEnvironment;
 class cSpecies;
@@ -52,10 +50,11 @@
 #define MAP_AGE       11
 #define NUM_MAP_MODES 12
 
+#include "cWorld.h"
 
 class cViewInfo {
 private:
-  cPopulation & population;
+  cWorld* m_world;
   cPopulationCell * active_cell;
 
   int pause_level;
@@ -83,7 +82,7 @@
   void AddSpeciesChart(cSpecies * in_species);
   void AddInjectGenChart(cInjectGenotype * in_gen);
 public:
-  cViewInfo(cPopulation & in_population);
+  cViewInfo(cWorld* world);
   ~cViewInfo() { ; }
 
   void UpdateSymbols();
@@ -100,7 +99,10 @@
   void DisEngageStepMode();
 
   cGenebank & GetGenebank();
-  cPopulation & GetPopulation() { return population; }
+  cPopulation & GetPopulation() { return m_world->GetPopulation(); }
+  cAvidaConfig& GetConfig() { return m_world->GetConfig(); }
+  cRandom& GetRandom() { return m_world->GetRandom(); }
+  cWorld& GetWorld() { return *m_world; }
 
   int GetNumSymbols() { return NUM_SYMBOLS; }
   cGenotype * GetGenotype(int index) { return genotype_chart[index]; }

Modified: branches/brysonda/source/viewer/cZoomScreen.cc
===================================================================
--- branches/brysonda/source/viewer/cZoomScreen.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cZoomScreen.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,34 +5,28 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef ENVIRONMENT_HH
+#include "cZoomScreen.h"
+
 #include "cEnvironment.h"
-#endif
 #include "functions.h"
 
-#include "cConfig.h"
 #include "cGenebank.h"
 #include "cGenotype.h"
 #include "cOrganism.h"
 #include "cPhenotype.h"
 #include "cPopulation.h"
 #include "cPopulationCell.h"
-#ifndef STRING_UTIL_HH
 #include "cStringUtil.h"
-#endif
-#ifndef TASK_ENTRY_HH
 #include "cTaskEntry.h"
-#endif
 
 #include "cHardwareCPU.h"
 #include "cHardware4Stack.h"
+#include "cHardwareSMT.h"
 
-#include "zoom_screen.hh"
+#include "cView.h"
+#include "cMenuWindow.h"
 
-#include "view.hh"
-#include "menu.hh"
 
-
 using namespace std;
 
 
@@ -41,8 +35,8 @@
 /////////////////////
 
 cZoomScreen::cZoomScreen(int y_size, int x_size, int y_start, int x_start,
-			 cViewInfo & in_info, cPopulation & in_pop)
-  : cScreen(y_size, x_size, y_start, x_start, in_info), population(in_pop)
+                         cViewInfo & in_info, cPopulation & in_pop)
+: cScreen(y_size, x_size, y_start, x_start, in_info), population(in_pop)
 {
   memory_offset = 0;
   parasite_zoom = false;
@@ -55,7 +49,7 @@
   cur_stack=0;
   cur_mem_space=0;
   cur_view_thread=0;
-
+  
   //map_mode = MAP_BASIC;
   mini_center_id = 0;
   map_x_size = population.GetWorldX();
@@ -68,7 +62,7 @@
 void cZoomScreen::Draw()
 {
   // Draw the options block which is on all screens.
-
+  
   SetBoldColor(COLOR_WHITE);
   Print(OPTIONS_Y, OPTIONS_X, "[<]                [>]");
   if (info.GetPauseLevel()) {
@@ -80,7 +74,7 @@
     Print(OPTIONS_Y+3, OPTIONS_X+2, "             ");
     Print(OPTIONS_Y+4, OPTIONS_X+2, "                 ");
   }
-
+  
   SetBoldColor(COLOR_CYAN);
   Print(OPTIONS_Y, OPTIONS_X+1, "<");
   Print(OPTIONS_Y, OPTIONS_X+20, ">");
@@ -91,19 +85,21 @@
   } else {
     Print(OPTIONS_Y+2, OPTIONS_X+3, "P");
   }
-
+  
   // Redirect to the proper Draw() method.
-
+  
   if (mode == ZOOM_MODE_CPU)
-    {
-      if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL) 
-	DrawCPU_Original();
-      if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK) 
-	DrawCPU_4Stack();
-    }
+  {
+    if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_ORIGINAL) 
+      DrawCPU_Original();
+    if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_4STACK) 
+      DrawCPU_4Stack();
+    if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT) 
+      DrawCPU_SMT();
+  }
   else if (mode == ZOOM_MODE_STATS) DrawStats();
   else if (mode == ZOOM_MODE_GENOTYPE) DrawGenotype();
-
+  
   Update();
   Refresh();
 }
@@ -111,13 +107,13 @@
 void cZoomScreen::DrawStats()
 {
   // Creature Status
-
+  
   SetBoldColor(COLOR_WHITE);
-
+  
   Print(1, 0, "GenotypeID:");
   Print(2, 0, "Geno Name.:");
   Print(3, 0, "Species.ID:");
-
+  
   Print(5, 0, "Fitness...:");
   Print(6, 0, "Gestation.:");
   Print(7, 0, "CPU Speed.:");
@@ -125,55 +121,63 @@
   Print(9, 0, "GenomeSize:");
   Print(10, 0, "Mem Size..:");
   Print(11, 0, "Faults....:");
-
+  
   Print(1,  27, "Location..:");
-
+  
   Print(4,  27, "Generation:");
   Print(5,  27, "Age.......:");
   Print(6,  27, "Executed..:");
   Print(7,  27, "LastDivide:");
   Print(8,  27, "Offspring.:");
-
+  
   Print(10, 27, "Thread:");
   Print(11, 27, "IP....:");
-
-  if(cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL)
-    {
-      Print(12, 27, "AX....:");
-      Print(13, 27, "BX....:");
-      Print(14, 27, "CX....:");
-      Print(15, 27, "Stack.:");
-      Print(16, 27, "---- Memory ----");
-    }
-  else if(cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK)
-    {
-      Print(12, 27, "Stack AX:");
-      Print(13, 27, "Stack BX:");
-      Print(14, 27, "Stack CX:");
-      Print(15, 27, "Stack DX:");
-      Print(16, 27, "---- Memory ----");
-    }
-
+  
+  if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_ORIGINAL)
+  {
+    Print(12, 27, "AX....:");
+    Print(13, 27, "BX....:");
+    Print(14, 27, "CX....:");
+    Print(15, 27, "Stack.:");
+    Print(16, 27, "---- Memory ----");
+  }
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_4STACK)
+  {
+    Print(12, 27, "Stack AX:");
+    Print(13, 27, "Stack BX:");
+    Print(14, 27, "Stack CX:");
+    Print(15, 27, "Stack DX:");
+    Print(16, 27, "---- Memory ----");
+  }
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT)
+  {
+    Print(12, 27, "Stack AX:");
+    Print(13, 27, "Stack BX:");
+    Print(14, 27, "Stack CX:");
+    Print(15, 27, "Stack DX:");
+    Print(16, 27, "---- Memory ----");
+  }
+  
   Print(CPU_FLAGS_Y, CPU_FLAGS_X, "---- Flags ----");
-
+  
   // --== Options ==--
   SetBoldColor(COLOR_YELLOW);
   Print(OPTIONS_Y, OPTIONS_X+4, "CPU Stats Zoom");
-
+  
   // --== Tasks ==--
   SetColor(COLOR_WHITE);
   Box(TASK_X, TASK_Y, 30, Height()-TASK_Y);
-
-
+  
+  
   int task_num = task_offset;
   int col_num = 0;
   const cTaskLib & task_lib = population.GetEnvironment().GetTaskLib();
   for (int cur_col = TASK_X + 2;
-       task_num < cConfig::GetNumTasks();
+       task_num < info.GetWorld().GetNumTasks();
        cur_col += 14) {
     for (int cur_row = TASK_Y + 1;
-	 cur_row < Height() - 1 && task_num < cConfig::GetNumTasks();
-	 cur_row++) {
+         cur_row < Height() - 1 && task_num < info.GetWorld().GetNumTasks();
+         cur_row++) {
       Print(cur_row, cur_col, "........:");
       Print(cur_row, cur_col, "%s", task_lib.GetTask(task_num).GetName()());
       task_num++;
@@ -181,8 +185,8 @@
     col_num++;
     if (col_num == 2) break;
   }
-
-  if (task_num < cConfig::GetNumTasks() || task_offset != 0) {
+  
+  if (task_num < info.GetWorld().GetNumTasks() || task_offset != 0) {
     SetBoldColor(COLOR_WHITE);
     Print(Height()-1, Width() - 23, " [<-] More [->] ");
     SetBoldColor(COLOR_CYAN);
@@ -194,94 +198,94 @@
 void cZoomScreen::DrawCPU_Original()
 {
   SetColor(COLOR_WHITE);
-
+  
   // --== Registers ==--
   Box(REG_X, REG_Y, 19, 7);
   Print(REG_Y + 1, REG_X + 2, "Registers");
   HLine(REG_Y + 2, REG_X, 19);
-
+  
   SetBoldColor(COLOR_WHITE);
   Print(REG_Y + 3, REG_X + 2, "AX:");
   Print(REG_Y + 4, REG_X + 2, "BX:");
   Print(REG_Y + 5, REG_X + 2, "CX:");
   SetColor(COLOR_WHITE);
-
+  
   // --== Inputs ==--
   Box(INPUT_X, INPUT_Y, 16, 7);
   Print(INPUT_Y + 1, INPUT_X + 2, "Inputs");
   HLine(INPUT_Y + 2, INPUT_X, 16);
-
+  
   // --== Mini-Map ==--
   Box(MINI_MAP_X, MINI_MAP_Y, 17, 3);
   Print(MINI_MAP_Y + 1, MINI_MAP_X + 2, "Mini-Map");
   // HLine(MINI_MAP_Y + 2, MINI_MAP_X, 19);
-
+  
   SetBoldColor(COLOR_WHITE);
   Print(MINI_MAP_Y + 11, MINI_MAP_X,  "[-]           [+]");
   SetBoldColor(COLOR_CYAN);
   Print(MINI_MAP_Y + 11, MINI_MAP_X + 1,  '-');
   Print(MINI_MAP_Y + 11, MINI_MAP_X + 15, '+');
   SetColor(COLOR_WHITE);
-
+  
   // --== Memory ==--
   Box(MEMORY_X, MEMORY_Y, 36, 5 + MEMORY_PRE_SIZE + MEMORY_POST_SIZE);
   Print(MEMORY_Y + 1, MEMORY_X + 2,  "Memory:");
   HLine(MEMORY_Y + 2, MEMORY_X, 36);
-
+  
   // --== Stack ==--
   Box(STACK_X, STACK_Y, 15, 7);
   HLine(STACK_Y + 2, STACK_X, 15);
-
+  
   // --== Options ==--
   SetBoldColor(COLOR_YELLOW);
   Print(OPTIONS_Y, OPTIONS_X+4,    "Component Zoom");
   SetBoldColor(COLOR_WHITE);
-
+  
   Print(OPTIONS_Y+6, OPTIONS_X+2, "[E]dit Component");
   Print(OPTIONS_Y+7, OPTIONS_X+2, "[V]iew Component");
-  if(cConfig::GetMaxCPUThreads() >1)
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
     Print(OPTIONS_Y+8, OPTIONS_X+2, "Next [T]hread");
   Print(OPTIONS_Y+9, OPTIONS_X+2, "[TAB] Shift Active");
-
+  
   if (info.GetPauseLevel()) {
     Print(OPTIONS_Y+10, OPTIONS_X+2, "[Arrows] Scroll");
   } else {
     Print(OPTIONS_Y+10, OPTIONS_X+2, "               ");
   }
-
-
+  
+  
   SetBoldColor(COLOR_CYAN);
   Print(OPTIONS_Y+6, OPTIONS_X+3, "E");
   Print(OPTIONS_Y+7, OPTIONS_X+3, "V");
-  if(cConfig::GetMaxCPUThreads() >1)
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
     Print(OPTIONS_Y+8, OPTIONS_X+8, "T");
   Print(OPTIONS_Y+9, OPTIONS_X+3, "TAB");
-
+  
   if (info.GetPauseLevel()) {
     Print(OPTIONS_Y+10, OPTIONS_X+3, "Arrows");
   }
-
+  
   // Highlight the active section...
   SetActiveSection(active_section);
-
+  
   // Add on a bunch of special characters to smooth the view out...
   Print(INPUT_Y,     INPUT_X, CHAR_TTEE);
   Print(INPUT_Y + 2, INPUT_X, CHAR_PLUS);
   Print(INPUT_Y + 6, INPUT_X, CHAR_BTEE);
-
+  
   Print(STACK_Y,     STACK_X, CHAR_TTEE);
   Print(STACK_Y + 2, STACK_X, CHAR_PLUS);
   Print(STACK_Y + 6, STACK_X, CHAR_BTEE);
-
-
+  
+  
   // A few stats on this screen...
-
+  
   SetBoldColor(COLOR_WHITE);
-
+  
   Print(13, 52, "Location.....:");
   Print(14, 52, "Genotype ID..:");
   Print(15, 52, "Genotype Name:");
-
+  
   Print(17, 52, "Faults.......:");
   Print(18, 52, "Offspring....:");
   Print(19, 52, "Thread.......:");
@@ -290,57 +294,57 @@
 void cZoomScreen::DrawCPU_4Stack()
 {
   SetColor(COLOR_WHITE);
-
+  
   // --== Registers ==--
   Box(REG_X, REG_Y-1, 19, 8);
   Print(REG_Y, REG_X + 2, "Stacks:");
   HLine(REG_Y + 1, REG_X, 19);
-
+  
   SetBoldColor(COLOR_WHITE);
   Print(REG_Y + 2, REG_X + 2, "AX:");
   Print(REG_Y + 3, REG_X + 2, "BX:");
   Print(REG_Y + 4, REG_X + 2, "CX:");
   Print(REG_Y + 5, REG_X + 2, "DX:");
   SetColor(COLOR_WHITE);
-
+  
   // --== Inputs ==--
   Box(INPUT_X, INPUT_Y-1, 16, 8);
   Print(INPUT_Y, INPUT_X + 2, "Inputs:");
   HLine(INPUT_Y+1, INPUT_X, 16);
-
+  
   // --== Mini-Map ==--
   Box(MINI_MAP_X, MINI_MAP_Y, 17, 3);
   Print(MINI_MAP_Y + 1, MINI_MAP_X + 2, "Mini-Map");
   //HLine(MINI_MAP_Y + 2, MINI_MAP_X, 19);
-
+  
   SetBoldColor(COLOR_WHITE);
   Print(MINI_MAP_Y + 11, MINI_MAP_X,  "[ ]           [ ]");
   SetBoldColor(COLOR_CYAN);
   Print(MINI_MAP_Y + 11, MINI_MAP_X + 1,  '-');
   Print(MINI_MAP_Y + 11, MINI_MAP_X + 15, '+');
   SetColor(COLOR_WHITE);
-
+  
   // --== Memory ==--
   Box(MEMORY_X, MEMORY_Y, 36, 5 + MEMORY_PRE_SIZE + MEMORY_POST_SIZE);
   Print(MEMORY_Y + 1, MEMORY_X + 2,  "Memory Space");
   HLine(MEMORY_Y + 2, MEMORY_X, 36);
-
+  
   // --== Stack ==--
   Box(STACK_X, STACK_Y-1, 15, 8);
   HLine(STACK_Y + 1, STACK_X, 15);
-
+  
   // --== Options ==--
   SetBoldColor(COLOR_YELLOW);
   Print(OPTIONS_Y, OPTIONS_X+4,    "Component Zoom");
   SetBoldColor(COLOR_WHITE);
-
+  
   //Print(OPTIONS_Y+6, OPTIONS_X+2, "[E]dit Component");
   //Print(OPTIONS_Y+7, OPTIONS_X+2, "[V]iew Component");
   Print(OPTIONS_Y+5, OPTIONS_X+2, "Next Stac[K]");
-  if(cConfig::GetMaxCPUThreads() >1)
-  Print(OPTIONS_Y+6, OPTIONS_X+2, "Next [T]hread");
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
+    Print(OPTIONS_Y+6, OPTIONS_X+2, "Next [T]hread");
   //Print(OPTIONS_Y+9, OPTIONS_X+2, "[TAB] Shift Active");
-
+  
   if (info.GetPauseLevel()) {
     Print(OPTIONS_Y+7, OPTIONS_X+2, "[UP, DOWN]");
     Print(OPTIONS_Y+8, OPTIONS_X+2, "Scroll Instruction");
@@ -352,39 +356,142 @@
     Print(OPTIONS_Y+9, OPTIONS_X+2, "               ");
     Print(OPTIONS_Y+10, OPTIONS_X+2, "                 ");
   }
-
-
+  
+  
   SetBoldColor(COLOR_CYAN);
   Print(OPTIONS_Y+5, OPTIONS_X+12, "K");
-  if(cConfig::GetMaxCPUThreads() >1)
-  Print(OPTIONS_Y+6, OPTIONS_X+8, "T");
-
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
+    Print(OPTIONS_Y+6, OPTIONS_X+8, "T");
+  
   if (info.GetPauseLevel()) {
     Print(OPTIONS_Y+7, OPTIONS_X+3, "UP, DOWN");
     Print(OPTIONS_Y+9, OPTIONS_X+3, "LEFT, RIGHT");
   }
-
+  
   // Highlight the active section...
   SetActiveSection(active_section);
-
+  
   // Add on a bunch of special characters to smooth the view out...
   Print(INPUT_Y - 1, INPUT_X, CHAR_TTEE);
   Print(INPUT_Y + 1, INPUT_X, CHAR_PLUS);
   Print(INPUT_Y + 6, INPUT_X, CHAR_BTEE);
-
+  
   Print(STACK_Y - 1, STACK_X, CHAR_TTEE);
   Print(STACK_Y + 1, STACK_X, CHAR_PLUS);
   Print(STACK_Y + 6, STACK_X, CHAR_BTEE);
-
-
+  
+  
   // A few stats on this screen...
+  
+  SetBoldColor(COLOR_WHITE);
+  
+  Print(13, 52, "Location.....:");
+  Print(14, 52, "Genotype ID..:");
+  Print(15, 52, "Genotype Name:");
+  
+  Print(17, 52, "Faults.......:");
+  Print(18, 52, "Offspring....:");
+  Print(19, 52, "Thread.......:");
+}
 
+void cZoomScreen::DrawCPU_SMT()
+{
+  SetColor(COLOR_WHITE);
+  
+  // --== Registers ==--
+  Box(REG_X, REG_Y-1, 19, 8);
+  Print(REG_Y, REG_X + 2, "Stacks:");
+  HLine(REG_Y + 1, REG_X, 19);
+  
   SetBoldColor(COLOR_WHITE);
-
+  Print(REG_Y + 2, REG_X + 2, "AX:");
+  Print(REG_Y + 3, REG_X + 2, "BX:");
+  Print(REG_Y + 4, REG_X + 2, "CX:");
+  Print(REG_Y + 5, REG_X + 2, "DX:");
+  SetColor(COLOR_WHITE);
+  
+  // --== Inputs ==--
+  Box(INPUT_X, INPUT_Y-1, 16, 8);
+  Print(INPUT_Y, INPUT_X + 2, "Inputs:");
+  HLine(INPUT_Y+1, INPUT_X, 16);
+  
+  // --== Mini-Map ==--
+  Box(MINI_MAP_X, MINI_MAP_Y, 17, 3);
+  Print(MINI_MAP_Y + 1, MINI_MAP_X + 2, "Mini-Map");
+  //HLine(MINI_MAP_Y + 2, MINI_MAP_X, 19);
+  
+  SetBoldColor(COLOR_WHITE);
+  Print(MINI_MAP_Y + 11, MINI_MAP_X,  "[ ]           [ ]");
+  SetBoldColor(COLOR_CYAN);
+  Print(MINI_MAP_Y + 11, MINI_MAP_X + 1,  '-');
+  Print(MINI_MAP_Y + 11, MINI_MAP_X + 15, '+');
+  SetColor(COLOR_WHITE);
+  
+  // --== Memory ==--
+  Box(MEMORY_X, MEMORY_Y, 36, 5 + MEMORY_PRE_SIZE + MEMORY_POST_SIZE);
+  Print(MEMORY_Y + 1, MEMORY_X + 2,  "Memory Space");
+  HLine(MEMORY_Y + 2, MEMORY_X, 36);
+  
+  // --== Stack ==--
+  Box(STACK_X, STACK_Y-1, 15, 8);
+  HLine(STACK_Y + 1, STACK_X, 15);
+  
+  // --== Options ==--
+  SetBoldColor(COLOR_YELLOW);
+  Print(OPTIONS_Y, OPTIONS_X+4,    "Component Zoom");
+  SetBoldColor(COLOR_WHITE);
+  
+  //Print(OPTIONS_Y+6, OPTIONS_X+2, "[E]dit Component");
+  //Print(OPTIONS_Y+7, OPTIONS_X+2, "[V]iew Component");
+  Print(OPTIONS_Y+5, OPTIONS_X+2, "Next Stac[K]");
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
+    Print(OPTIONS_Y+6, OPTIONS_X+2, "Next [T]hread");
+  //Print(OPTIONS_Y+9, OPTIONS_X+2, "[TAB] Shift Active");
+  
+  if (info.GetPauseLevel()) {
+    Print(OPTIONS_Y+7, OPTIONS_X+2, "[UP, DOWN]");
+    Print(OPTIONS_Y+8, OPTIONS_X+2, "Scroll Instruction");
+    Print(OPTIONS_Y+9, OPTIONS_X+2, "[LEFT, RIGHT]");
+    Print(OPTIONS_Y+10, OPTIONS_X+2, "Change Mem Space");
+  } else {
+    Print(OPTIONS_Y+7, OPTIONS_X+2, "               ");
+    Print(OPTIONS_Y+8, OPTIONS_X+2, "                  ");
+    Print(OPTIONS_Y+9, OPTIONS_X+2, "               ");
+    Print(OPTIONS_Y+10, OPTIONS_X+2, "                 ");
+  }
+  
+  
+  SetBoldColor(COLOR_CYAN);
+  Print(OPTIONS_Y+5, OPTIONS_X+12, "K");
+  if(info.GetConfig().MAX_CPU_THREADS.Get() >1)
+    Print(OPTIONS_Y+6, OPTIONS_X+8, "T");
+  
+  if (info.GetPauseLevel()) {
+    Print(OPTIONS_Y+7, OPTIONS_X+3, "UP, DOWN");
+    Print(OPTIONS_Y+9, OPTIONS_X+3, "LEFT, RIGHT");
+  }
+  
+  // Highlight the active section...
+  SetActiveSection(active_section);
+  
+  // Add on a bunch of special characters to smooth the view out...
+  Print(INPUT_Y - 1, INPUT_X, CHAR_TTEE);
+  Print(INPUT_Y + 1, INPUT_X, CHAR_PLUS);
+  Print(INPUT_Y + 6, INPUT_X, CHAR_BTEE);
+  
+  Print(STACK_Y - 1, STACK_X, CHAR_TTEE);
+  Print(STACK_Y + 1, STACK_X, CHAR_PLUS);
+  Print(STACK_Y + 6, STACK_X, CHAR_BTEE);
+  
+  
+  // A few stats on this screen...
+  
+  SetBoldColor(COLOR_WHITE);
+  
   Print(13, 52, "Location.....:");
   Print(14, 52, "Genotype ID..:");
   Print(15, 52, "Genotype Name:");
-
+  
   Print(17, 52, "Faults.......:");
   Print(18, 52, "Offspring....:");
   Print(19, 52, "Thread.......:");
@@ -394,37 +501,37 @@
 {
   SetBoldColor(COLOR_YELLOW);
   Print(OPTIONS_Y, OPTIONS_X + 4, "Genotype Zoom");
-
+  
   // Genotype status.
-
+  
   SetBoldColor(COLOR_WHITE);
-
+  
   Print(1, 0, "GenotypeID:");
   Print(2, 0, "Geno Name.:");
   Print(3, 0, "Species ID:");
-
+  
   Print(5, 0, "Abundance.:");
   Print(6, 0, "Length....:");
   Print(7, 0, "CopyLength:");
   Print(8, 0, "Exe Length:");
-
+  
   Print(10, 0, "Fitness...:");
   Print(11, 0, "Gestation.:");
   Print(12, 0, "Merit.....:");
   Print(13, 0, "ReproRate.:");
-
+  
   Print(1, 27, "Update Born:");
   Print(2, 27, "Parent ID..:");
   Print(3, 27, "Parent Dist:");
   Print(4, 27, "Gene Depth.:");
-
+  
   Print(6, 27,  "-- This Update --");
   Print(7, 27,  "Deaths.....:");
   Print(8, 27,  "Divides....:");
   Print(9, 27,  "Breed True.:");
   Print(10, 27, "Breed In...:");
   Print(11, 27, "Breed Out..:");
-
+  
   Print(13, 27, "-- Totals --");
   Print(14, 27, "Abundance..:");
   Print(15, 27, "Divides....:");
@@ -437,12 +544,12 @@
 {
   if (info.GetActiveCell() == NULL ||
       info.GetActiveCell()->IsOccupied() == false) return;
-
+  
   cHardwareBase & hardware = info.GetActiveCell()->GetOrganism()->GetHardware();
   if(mode == ZOOM_MODE_CPU) UpdateCPU(hardware);
   else if (mode == ZOOM_MODE_STATS) UpdateStats(hardware);
   else if (mode == ZOOM_MODE_GENOTYPE) UpdateGenotype();
-
+  
   Refresh();
 }
 
@@ -450,207 +557,249 @@
 {
   if (info.GetActiveCell() == NULL ||
       info.GetActiveCell()->IsOccupied() == false) return;
-
+  
   cGenotype * genotype = info.GetActiveGenotype();
   cPhenotype & phenotype = info.GetActiveCell()->GetOrganism()->GetPhenotype();
-
+  
   //cHardwareBase & hardware =
   //  info.GetActiveCell()->GetOrganism()->GetHardware();
-
+  
   SetBoldColor(COLOR_CYAN);
-
+  
   // if there is an Active Genotype name AND it is not empty, show it
   Print(1, 12, "%9d", info.GetActiveGenotypeID());
   Print(2, 12, "%s", info.GetActiveName()());
-
+  
   if (info.GetActiveSpecies())
     Print(3, 12, "%9d", info.GetActiveSpeciesID());
   else
     Print(3, 15, "(none) ");
-
+  
   const cMerit cur_merit(phenotype.GetCurBonus());
-
+  
   PrintFitness(5, 14, phenotype.GetFitness());
   Print(6, 15, "%6d ", phenotype.GetGestationTime());
   PrintMerit(7, 14, phenotype.GetMerit());
   PrintMerit(8, 14, cur_merit);
   Print(9, 15, "%6d ", genotype ? genotype->GetLength() : 0);
   Print(10, 15, "%6d ", hardware.GetMemory().GetSize());
-
+  
   Print(11, 15, "%6d ", phenotype.GetCurNumErrors());
-
+  
   Print(4, 39, "%9d ", phenotype.GetGeneration());
   Print(5, 39, "%9d ", phenotype.GetAge());
   Print(6, 39, "%9d ", phenotype.GetTimeUsed());
   Print(7, 39, "%9d ", phenotype.GetGestationStart());
   Print(8, 39, "%9d ", phenotype.GetNumDivides());
-
+  
   if (info.GetThreadLock() != -1) Print(10, 36, "LOCKED");
   else Print(10, 36, "      ");
   
-  if(cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL)
+  if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_ORIGINAL)
     UpdateStats_CPU(hardware);
-
-  if(cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK)
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_4STACK)
     UpdateStats_4Stack(hardware);
-
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT)
+    UpdateStats_SMT(hardware);
+  
   if (phenotype.ParentTrue()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 2, CPU_FLAGS_X + 1, "Parent True");
-
+  
   if (phenotype.IsInjected()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 3, CPU_FLAGS_X + 1, "Injected");
-
+  
   if (phenotype.IsParasite()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 4, CPU_FLAGS_X + 1, "Parasite");
-
+  
   if (phenotype.IsMutated()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 5, CPU_FLAGS_X + 1, "Mutated");
-
+  
   if (phenotype.IsModified()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 6, CPU_FLAGS_X + 1, "Modified");
-
+  
   SetColor(COLOR_WHITE);
-
+  
   if (info.GetPauseLevel() && info.GetActiveCell() && phenotype.IsParasite()) {
     if (parasite_zoom == true) Print(17, 12, "[X] Host Code    ");
     else Print(17, 12, "[X] Parasite Code");
   }
-
+  
   // Place the task information onto the screen.
   SetColor(COLOR_CYAN);
-
+  
   int task_num = task_offset;
   int col_num = 0;
   for (int cur_col = TASK_X + 12;
-       task_num < cConfig::GetNumTasks();
+       task_num < info.GetWorld().GetNumTasks();
        cur_col += 14) {
     for (int cur_row = TASK_Y + 1;
-	 cur_row <= Height() - 2 && task_num < cConfig::GetNumTasks();
-	 cur_row++) {
+         cur_row <= Height() - 2 && task_num < info.GetWorld().GetNumTasks();
+         cur_row++) {
       if (col_num < 2) {
-	Print(cur_row, cur_col, "%2d", phenotype.GetCurTaskCount()[task_num]);
+        Print(cur_row, cur_col, "%2d", phenotype.GetCurTaskCount()[task_num]);
       }
       task_num++;
     }
     col_num++;
   }
-
-
-
+  
+  
+  
   if (info.GetActiveCell() == NULL) {
     info.SetActiveCell( &(population.GetCell(0)) );
   }
   SetBoldColor(COLOR_WHITE);
-
+  
   // Figure out which CPU we're pointing at (useful for watching parasites)
   Print(2, 27, "Facing....:");
-
+  
   // Show the location of the CPU we are looking at.
   SetBoldColor(COLOR_CYAN);
   Print(1, 40, "[%2d, %2d] ",
-	info.GetActiveID() % population.GetWorldX(),
-	info.GetActiveID() / population.GetWorldY());
-
+        info.GetActiveID() % population.GetWorldX(),
+        info.GetActiveID() / population.GetWorldY());
+  
   // Now show the location of the CPU we are facing.
   int id = info.GetActiveCell()->ConnectionList().GetFirst()->GetID();
   Print(2, 40, "[%2d, %2d] ",
-	id % population.GetWorldX(), id / population.GetWorldY());
-
+        id % population.GetWorldX(), id / population.GetWorldY());
   
-
+  
+  
 }
 
 void cZoomScreen::UpdateStats_CPU(cHardwareBase & hardware)
 {
   cHardwareCPU & hardwareCPU = (cHardwareCPU &) hardware;
-
+  
   Print(10, 43, "%2d/%2d", hardwareCPU.GetCurThread() + 1,
-	hardwareCPU.GetNumThreads());
-
+        hardwareCPU.GetNumThreads());
+  
   Print(12, 34, "%14d", hardwareCPU.Register(0));
   Print(13, 34, "%14d", hardwareCPU.Register(1));
   Print(14, 34, "%14d", hardwareCPU.Register(2));
   Print(15, 34, "%14d", hardwareCPU.GetStack(0));
-
+  
   cHeadCPU inst_ptr(hardwareCPU.IP());
-   const cInstSet & inst_set = hardwareCPU.GetInstSet();
+  const cInstSet & inst_set = hardwareCPU.GetInstSet();
   
   for (int pos = 0; pos < 3; pos++) {
     // Clear the line
     Print(17+pos, 29, "                    ");
     if (inst_ptr.InMemory() == false) continue;
     if (pos == 1) SetColor(COLOR_CYAN);
-
+    
     // Draw the current instruction.
-      Print(17+pos, 29, "%s",	inst_set.GetName(inst_ptr.GetInst())());
+    Print(17+pos, 29, "%s",	inst_set.GetName(inst_ptr.GetInst())());
     inst_ptr.Advance();
   }
-
+  
   // Flags...
   if (hardwareCPU.GetMalActive()) SetBoldColor(COLOR_CYAN);
   else SetColor(COLOR_CYAN);
   Print(CPU_FLAGS_Y + 1, CPU_FLAGS_X + 1, "Mem Allocated");
- 
+  
   // And print the IP.
   const cHeadCPU & active_inst_ptr = hardwareCPU.IP();
   // @CAO assume no parasites for now.
   int cur_id = info.GetActiveCell()->GetID();
   //active_inst_ptr.GetCurHardware()->GetOrganism()->GetEnvironment()->GetID();
   Print(11, 36, "%12s", cStringUtil::Stringf("[%2d,%2d] : %2d",
-	cur_id % population.GetWorldX(), cur_id / population.GetWorldX(),
-	active_inst_ptr.GetPosition())() );
+                                             cur_id % population.GetWorldX(), cur_id / population.GetWorldX(),
+                                             active_inst_ptr.GetPosition())() );
 }
 
 void cZoomScreen::UpdateStats_4Stack(cHardwareBase & hardware)
 {
   cHardware4Stack & hardware4Stack = (cHardware4Stack &) hardware;
+  
+  Print(10, 43, "%2d/%2d", hardware4Stack.GetCurThread() + 1,
+        hardware4Stack.GetNumThreads());
+  
+  Print(12, 34, "%14d", hardware4Stack.Stack(0).Top());
+  Print(13, 34, "%14d", hardware4Stack.Stack(1).Top());
+  Print(14, 34, "%14d", hardware4Stack.Stack(2).Top());
+  Print(15, 34, "%14d", hardware4Stack.Stack(3).Top());
+  
+  cHeadMultiMem inst_ptr(hardware4Stack.IP());
+  const cInstSet & inst_set = hardware4Stack.GetInstSet();
+  
+  for (int pos = 0; pos < 3; pos++) {
+    // Clear the line
+    Print(17+pos, 29, "                    ");
+    if (inst_ptr.InMemory() == false) continue;
+    if (pos == 1) SetColor(COLOR_CYAN);
+    
+    // Draw the current instruction.
+    Print(17+pos, 29, "%s",	inst_set.GetName(inst_ptr.GetInst())());
+    inst_ptr.Advance();
+  }
+  
+  // Flags...
+  //if (hardwareCPU.GetMalActive()) SetBoldColor(COLOR_CYAN);
+  //else SetColor(COLOR_CYAN);
+  //Print(CPU_FLAGS_Y + 1, CPU_FLAGS_X + 1, "Mem Allocated");
+  
+  // And print the IP.
+  const cHeadMultiMem & active_inst_ptr = hardware4Stack.IP();
+  // @CAO assume no parasites for now.
+  //int cur_id = info.GetActiveCell()->GetID();
+  //active_inst_ptr.GetCurHardware()->GetOrganism()->GetEnvironment()->GetID();
+  Print(11, 36, "%12s", cStringUtil::Stringf("(%2d, %2d)",
+                                             active_inst_ptr.GetMemSpace(),
+                                             active_inst_ptr.GetPosition())() );
+}
 
+void cZoomScreen::UpdateStats_SMT(cHardwareBase & hardware)
+{
+  cHardwareSMT& hardware4Stack = (cHardwareSMT&) hardware;
+  
   Print(10, 43, "%2d/%2d", hardware4Stack.GetCurThread() + 1,
-	hardware4Stack.GetNumThreads());
-
+        hardware4Stack.GetNumThreads());
+  
   Print(12, 34, "%14d", hardware4Stack.Stack(0).Top());
   Print(13, 34, "%14d", hardware4Stack.Stack(1).Top());
   Print(14, 34, "%14d", hardware4Stack.Stack(2).Top());
   Print(15, 34, "%14d", hardware4Stack.Stack(3).Top());
-
+  
   cHeadMultiMem inst_ptr(hardware4Stack.IP());
-   const cInstSet & inst_set = hardware4Stack.GetInstSet();
+  const cInstSet & inst_set = hardware4Stack.GetInstSet();
   
   for (int pos = 0; pos < 3; pos++) {
     // Clear the line
     Print(17+pos, 29, "                    ");
     if (inst_ptr.InMemory() == false) continue;
     if (pos == 1) SetColor(COLOR_CYAN);
-
+    
     // Draw the current instruction.
-      Print(17+pos, 29, "%s",	inst_set.GetName(inst_ptr.GetInst())());
+    Print(17+pos, 29, "%s",	inst_set.GetName(inst_ptr.GetInst())());
     inst_ptr.Advance();
   }
-
+  
   // Flags...
   //if (hardwareCPU.GetMalActive()) SetBoldColor(COLOR_CYAN);
   //else SetColor(COLOR_CYAN);
   //Print(CPU_FLAGS_Y + 1, CPU_FLAGS_X + 1, "Mem Allocated");
- 
+  
   // And print the IP.
   const cHeadMultiMem & active_inst_ptr = hardware4Stack.IP();
   // @CAO assume no parasites for now.
   //int cur_id = info.GetActiveCell()->GetID();
   //active_inst_ptr.GetCurHardware()->GetOrganism()->GetEnvironment()->GetID();
   Print(11, 36, "%12s", cStringUtil::Stringf("(%2d, %2d)",
-	active_inst_ptr.GetMemSpace(),
-	active_inst_ptr.GetPosition())() );
+                                             active_inst_ptr.GetMemSpace(),
+                                             active_inst_ptr.GetPosition())() );
 }
 
 void cZoomScreen::UpdateCPU(cHardwareBase & hardware)
 {
   // Place the visible section of the current memory onto the screen.
-
+  
   SetBoldColor(COLOR_WHITE);
   if (info.GetPauseLevel() == PAUSE_OFF) {
     // If not paused, then set user desired offset to zero AND always show
@@ -659,31 +808,33 @@
     memory_offset = 0;
     parasite_zoom = false;
   }
-
+  
   Print(14, 69, "%10d", info.GetActiveGenotypeID());
   Print(15, 69, "%10s", info.GetActiveName()());
-
+  
   cPhenotype & phenotype = info.GetActiveCell()->GetOrganism()->GetPhenotype();
   Print(17, 69, "%10d", phenotype.GetCurNumErrors());
   Print(18, 69, "%10d", phenotype.GetNumDivides());
   if (info.GetThreadLock() != -1) Print(19, 67, "LOCKED");
   else Print(19, 67, "      ");
-
-  if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+  
+  if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_ORIGINAL)
     UpdateCPU_Original(hardware);
-  else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_4STACK)
     UpdateCPU_4Stack(hardware);
-
+  else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT)
+    UpdateCPU_SMT(hardware);
+  
   // Place the input buffer on the screen.
-
+  
   SetBoldColor(COLOR_CYAN);
   Print(INPUT_Y+3, INPUT_X+2, "%12d", info.GetActiveCell()->GetInput(0));
-
+  
   SetColor(COLOR_CYAN);
   for (int i = 1; i < nHardware::IO_SIZE; i++) {
     Print(INPUT_Y+3+i, INPUT_X+2, "%12d", info.GetActiveCell()->GetInput(i));
   }
-
+  
   const cString & cur_fault = phenotype.GetFault();
   if (cur_fault.GetSize() > 0) {
     SetBoldColor(COLOR_RED);
@@ -693,13 +844,13 @@
   } else {
     Print(FAULT_Y, FAULT_X, "                                        ");
   }
-
+  
   SetBoldColor(COLOR_WHITE);
-
+  
   Print(13, 70, "[%3d,%3d] ",
-	info.GetActiveID() % population.GetWorldX(),
-	info.GetActiveID() / population.GetWorldY());
-
+        info.GetActiveID() % population.GetWorldX(),
+        info.GetActiveID() / population.GetWorldY());
+  
   SetBoldColor(COLOR_CYAN);
   Refresh();
 }
@@ -708,40 +859,40 @@
 {
   cHardwareCPU & hardwareCPU = (cHardwareCPU &) hardware;
   //hardwareCPU.SetThread(cur_view_thread);
-
+  
   // Place the registers onto the screen.
   SetBoldColor(COLOR_CYAN);
   for (int i = 0; i < nHardwareCPU::NUM_REGISTERS; i++) {
     Print(REG_Y+3 + i, REG_X+6, "%11d", hardwareCPU.Register(i));
   }
-
+  
   // Place the active stack onto the screen.
-
+  
   // Stack A
   // SetBoldColor(COLOR_CYAN);   // -Redundant
   SetColor(COLOR_WHITE);
   char stack_letter = 'A' + hardwareCPU.GetActiveStackID();
   Print(STACK_Y + 1, STACK_X + 2, "Stack %c", stack_letter);
-
+  
   SetBoldColor(COLOR_CYAN);
   Print(STACK_Y+3, STACK_X + 2, "%11d", hardwareCPU.GetStack(0));
   SetColor(COLOR_CYAN);
   for (int i = 1; i <= 2; i++) {
     Print(STACK_Y+3 + i, STACK_X+2, "%11d", hardwareCPU.GetStack(i));
   }
-
+  
   // Place the input buffer on the screen.
-
+  
   SetBoldColor(COLOR_CYAN);
   Print(INPUT_Y+3, INPUT_X+2, "%12d", info.GetActiveCell()->GetInput(0));
-
+  
   SetColor(COLOR_CYAN);
   for (int i = 1; i < nHardware::IO_SIZE; i++) {
     Print(INPUT_Y+3+i, INPUT_X+2, "%12d", info.GetActiveCell()->GetInput(i));
   }
-
+  
   Print(19, 74, "%2d/%2d", hardwareCPU.GetCurThread() + 1,
-	hardwareCPU.GetNumThreads());
+        hardwareCPU.GetNumThreads());
   
   // This line gets the creature that is currently executing. Usually the
   // creature we are viewing, but can also be a different one (if this is a
@@ -765,79 +916,79 @@
   int adj_inst_ptr = 0;
   int base_inst_ptr = hardwareCPU.IP().GetPosition();
   if (base_inst_ptr < 0 || parasite_zoom == true) base_inst_ptr = 0;
-
+  
   const cInstSet & inst_set = hardwareCPU.GetInstSet();
-
+  
   // Determine the center (must be between 0 and size - 1)
   int center_pos = (base_inst_ptr + memory_offset) % memory.GetSize();
   if (center_pos < 0) center_pos += memory.GetSize();
-
+  
   for (int i = -MEMORY_PRE_SIZE; i <= MEMORY_POST_SIZE; i++) {
     adj_inst_ptr = (center_pos + i) % (memory.GetSize() + 1);
     if (adj_inst_ptr < 0) adj_inst_ptr += memory.GetSize() + 1;
-
+    
     if (adj_inst_ptr == memory.GetSize()) {
       HLine(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, 36);
     } else {
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, CHAR_VLINE);
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 35, CHAR_VLINE);
-
+      
       // If we are on the instruction about to be executed by the CPU,
       // hilight it...
       if (adj_inst_ptr == base_inst_ptr) {
-	SetBoldColor(COLOR_WHITE);
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
-		  adj_inst_ptr);
-	SetBoldColor(COLOR_CYAN);
+        SetBoldColor(COLOR_WHITE);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        SetBoldColor(COLOR_CYAN);
       } else {
-	if (i == 0) SetBoldColor(COLOR_YELLOW);
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
-		  adj_inst_ptr);
-	// If we are scrolling through memory, make the current position
-	// yellow.
-	if (i == 0) SetColor(COLOR_YELLOW);
-	else SetColor(COLOR_CYAN);
+        if (i == 0) SetBoldColor(COLOR_YELLOW);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        // If we are scrolling through memory, make the current position
+        // yellow.
+        if (i == 0) SetColor(COLOR_YELLOW);
+        else SetColor(COLOR_CYAN);
       }
-
+      
       // Print the instruction...
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 6, "%8s ",
-	    inst_set.GetName( memory[adj_inst_ptr] )());
-
+            inst_set.GetName( memory[adj_inst_ptr] )());
+      
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15,
-	    "                    ");
-
+            "                    ");
+      
       // Only list the "Cpy" flag or the "Inj" flag...
       if (memory.FlagCopied(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Cpy");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Cpy");
       }
       if (memory.FlagInjected(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Inj");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Inj");
       }
-
+      
       // Other flags we're interested in...
       if (memory.FlagMutated(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 19, "Mut");
-	}
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 19, "Mut");
+      }
       if (memory.FlagExecuted(adj_inst_ptr) == true) {
-	  Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 23, "Exe");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 23, "Exe");
       }
       if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 27, "Bp");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 27, "Bp");
       }
-
+      
       if (adj_inst_ptr == hardwareCPU.GetHead(nHardware::HEAD_READ).GetPosition()) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 30, "R");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 30, "R");
       }
       if (adj_inst_ptr == hardwareCPU.GetHead(nHardware::HEAD_WRITE).GetPosition()) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 31, "W");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 31, "W");
       }
       if (adj_inst_ptr == hardwareCPU.GetHead(nHardware::HEAD_FLOW).GetPosition()) {
-	  Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 32, "F");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 32, "F");
       }
     }
     SetColor(COLOR_WHITE);
   }
-
+  
   DrawMiniMap();
 }
 
@@ -846,37 +997,180 @@
   cHardware4Stack & hardware4Stack = (cHardware4Stack &) hardware;
   
   if(cur_view_thread>=hardware4Stack.GetNumThreads())
-    {
-      cur_view_thread=0;
-      cur_mem_space = hardware4Stack.IP(cur_view_thread).GetMemSpace();
+  {
+    cur_view_thread=0;
+    cur_mem_space = hardware4Stack.IP(cur_view_thread).GetMemSpace();
+  }
+  //hardware4Stack.SetThread(cur_view_thread);
+  cHeadMultiMem & cur_ip = hardware4Stack.IP(cur_view_thread);
+  
+  // Place the stacks onto the screen.
+  SetBoldColor(COLOR_CYAN);
+  for (int i = 0; i < 4; i++) {
+    Print(REG_Y+2 + i, REG_X+6, "%11d", hardware4Stack.Stack(i, cur_view_thread).Top());
+  }
+  
+  // Place the active stack onto the screen.
+  
+  // Stack AX
+  //SetBoldColor(COLOR_CYAN);   // -Redundant
+  SetColor(COLOR_WHITE);
+  
+  Print(STACK_Y, STACK_X + 2, "Stack   :");
+  Print(STACK_Y, STACK_X + 8, "%s" , hardware4Stack.GetActiveStackID(cur_stack)());
+  
+  //SetBoldColor(COLOR_CYAN);
+  //Print(STACK_Y+2, STACK_X + 2, "%11d", hardware4Stack.GetStack(0, cur_stack));
+  SetColor(COLOR_CYAN);
+  for (int i = 0; i <= 3; i++) {
+    Print(STACK_Y+2 + i, STACK_X+2, "%11d", hardware4Stack.GetStack(i, cur_stack, cur_view_thread));
+  }
+  
+  Print(19, 74, "%2d/%2d", cur_view_thread + 1,
+        hardware4Stack.GetNumThreads());
+  
+  // This line gets the creature that is currently executing. Usually the
+  // creature we are viewing, but can also be a different one (if this is a
+  // parasite).
+  
+  const cCPUMemory & memory = hardware4Stack.GetMemory(cur_mem_space);
+  SetBoldColor(COLOR_BLUE);
+  Print(MEMORY_Y + 1, MEMORY_X + 8, " Space ");	
+  SetColor(COLOR_WHITE);
+  Print(MEMORY_Y + 1, MEMORY_X + 15, "%2d", cur_mem_space);
+  
+  Print(MEMORY_Y + 1, MEMORY_X + 17, ":");	
+  Print(MEMORY_Y + 1, MEMORY_X + 18, "%4d", memory.GetSize());
+  
+  
+  
+  // Nothing past this point gets executed for empty creatures....
+  if (memory.GetSize() == 0) {
+    for (int i = -MEMORY_PRE_SIZE; i <= MEMORY_POST_SIZE; i++) {
+      HLine(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, 36);
     }
+    return;
+  }
+  
+  int adj_inst_ptr = 0;
+  int base_inst_ptr = cur_ip.GetPosition();
+  if (base_inst_ptr < 0 || parasite_zoom == true) base_inst_ptr = 0;
+  
+  const cInstSet & inst_set = hardware4Stack.GetInstSet();
+  
+  // Determine the center (must be between 0 and size - 1)
+  int center_pos = (base_inst_ptr + memory_offset) % memory.GetSize();
+  if (center_pos < 0) center_pos += memory.GetSize();
+  
+  for (int i = -MEMORY_PRE_SIZE; i <= MEMORY_POST_SIZE; i++) {
+    adj_inst_ptr = (center_pos + i) % (memory.GetSize() + 1);
+    if (adj_inst_ptr < 0) adj_inst_ptr += memory.GetSize() + 1;
+    
+    if (adj_inst_ptr == memory.GetSize()) {
+      HLine(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, 36);
+    } else {
+      Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, CHAR_VLINE);
+      Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 35, CHAR_VLINE);
+      
+      // If we are on the instruction about to be executed by the CPU,
+      // hilight it...
+      if (adj_inst_ptr == base_inst_ptr && 
+          hardware4Stack.IP(cur_view_thread).GetMemSpace() == cur_mem_space) {
+        SetBoldColor(COLOR_WHITE);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        SetBoldColor(COLOR_CYAN);
+      } else {
+        if (i == 0) SetBoldColor(COLOR_YELLOW);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        // If we are scrolling through memory, make the current position
+        // yellow.
+        if (i == 0) SetColor(COLOR_YELLOW);
+        else SetColor(COLOR_CYAN);
+      }
+      
+      // Print the instruction...
+      Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 6, "%8s ",
+            inst_set.GetName( memory[adj_inst_ptr] )());
+      
+      Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15,
+            "                    ");
+      
+      // Only list the "Cpy" flag or the "Inj" flag...
+      if (memory.FlagCopied(adj_inst_ptr) == true) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Cpy");
+      }
+      if (memory.FlagInjected(adj_inst_ptr) == true) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Inj");
+      }
+      
+      // Other flags we're interested in...
+      if (memory.FlagMutated(adj_inst_ptr) == true) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 20, "Mut");
+      }
+      if (memory.FlagExecuted(adj_inst_ptr) == true) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 24, "Exe");
+      }
+      if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 28, "Bp");
+      }
+      
+      if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_READ, cur_view_thread).GetPosition() &&
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_READ, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 31, "R");
+      }
+      if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_WRITE, cur_view_thread).GetPosition() &&
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_WRITE, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 32, "W");
+      }
+      if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_FLOW, cur_view_thread).GetPosition() &&
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_FLOW, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 33, "F");
+      }
+    }
+    SetColor(COLOR_WHITE);
+  }
+  
+  DrawMiniMap();
+}
+
+void cZoomScreen::UpdateCPU_SMT(cHardwareBase & hardware)
+{
+  cHardwareSMT& hardware4Stack = (cHardwareSMT&) hardware;
+  
+  if(cur_view_thread>=hardware4Stack.GetNumThreads())
+  {
+    cur_view_thread=0;
+    cur_mem_space = hardware4Stack.IP(cur_view_thread).GetMemSpace();
+  }
   //hardware4Stack.SetThread(cur_view_thread);
   cHeadMultiMem & cur_ip = hardware4Stack.IP(cur_view_thread);
-
+  
   // Place the stacks onto the screen.
   SetBoldColor(COLOR_CYAN);
   for (int i = 0; i < 4; i++) {
     Print(REG_Y+2 + i, REG_X+6, "%11d", hardware4Stack.Stack(i, cur_view_thread).Top());
   }
-
+  
   // Place the active stack onto the screen.
-
+  
   // Stack AX
   //SetBoldColor(COLOR_CYAN);   // -Redundant
   SetColor(COLOR_WHITE);
   
   Print(STACK_Y, STACK_X + 2, "Stack   :");
   Print(STACK_Y, STACK_X + 8, "%s" , hardware4Stack.GetActiveStackID(cur_stack)());
-
+  
   //SetBoldColor(COLOR_CYAN);
   //Print(STACK_Y+2, STACK_X + 2, "%11d", hardware4Stack.GetStack(0, cur_stack));
   SetColor(COLOR_CYAN);
   for (int i = 0; i <= 3; i++) {
     Print(STACK_Y+2 + i, STACK_X+2, "%11d", hardware4Stack.GetStack(i, cur_stack, cur_view_thread));
-   }
-
+  }
+  
   Print(19, 74, "%2d/%2d", cur_view_thread + 1,
-	hardware4Stack.GetNumThreads());
+        hardware4Stack.GetNumThreads());
   
   // This line gets the creature that is currently executing. Usually the
   // creature we are viewing, but can also be a different one (if this is a
@@ -904,118 +1198,118 @@
   int adj_inst_ptr = 0;
   int base_inst_ptr = cur_ip.GetPosition();
   if (base_inst_ptr < 0 || parasite_zoom == true) base_inst_ptr = 0;
-
+  
   const cInstSet & inst_set = hardware4Stack.GetInstSet();
-
+  
   // Determine the center (must be between 0 and size - 1)
   int center_pos = (base_inst_ptr + memory_offset) % memory.GetSize();
   if (center_pos < 0) center_pos += memory.GetSize();
-
+  
   for (int i = -MEMORY_PRE_SIZE; i <= MEMORY_POST_SIZE; i++) {
     adj_inst_ptr = (center_pos + i) % (memory.GetSize() + 1);
     if (adj_inst_ptr < 0) adj_inst_ptr += memory.GetSize() + 1;
-
+    
     if (adj_inst_ptr == memory.GetSize()) {
       HLine(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, 36);
     } else {
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X, CHAR_VLINE);
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 35, CHAR_VLINE);
-
+      
       // If we are on the instruction about to be executed by the CPU,
       // hilight it...
       if (adj_inst_ptr == base_inst_ptr && 
-	  hardware4Stack.IP(cur_view_thread).GetMemSpace() == cur_mem_space) {
-	SetBoldColor(COLOR_WHITE);
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
-		  adj_inst_ptr);
-	SetBoldColor(COLOR_CYAN);
+          hardware4Stack.IP(cur_view_thread).GetMemSpace() == cur_mem_space) {
+        SetBoldColor(COLOR_WHITE);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        SetBoldColor(COLOR_CYAN);
       } else {
-	if (i == 0) SetBoldColor(COLOR_YELLOW);
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
-		  adj_inst_ptr);
-	// If we are scrolling through memory, make the current position
-	// yellow.
-	if (i == 0) SetColor(COLOR_YELLOW);
-	else SetColor(COLOR_CYAN);
+        if (i == 0) SetBoldColor(COLOR_YELLOW);
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 1, "%3d: ",
+              adj_inst_ptr);
+        // If we are scrolling through memory, make the current position
+        // yellow.
+        if (i == 0) SetColor(COLOR_YELLOW);
+        else SetColor(COLOR_CYAN);
       }
-
+      
       // Print the instruction...
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 6, "%8s ",
-	    inst_set.GetName( memory[adj_inst_ptr] )());
-
+            inst_set.GetName( memory[adj_inst_ptr] )());
+      
       Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15,
-         "                    ");
-
+            "                    ");
+      
       // Only list the "Cpy" flag or the "Inj" flag...
       if (memory.FlagCopied(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Cpy");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Cpy");
       }
       if (memory.FlagInjected(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Inj");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Inj");
       }
-
+      
       // Other flags we're interested in...
       if (memory.FlagMutated(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 20, "Mut");
-	}
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 20, "Mut");
+      }
       if (memory.FlagExecuted(adj_inst_ptr) == true) {
-	  Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 24, "Exe");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 24, "Exe");
       }
       if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 28, "Bp");
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 28, "Bp");
       }
-
+      
       if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_READ, cur_view_thread).GetPosition() &&
-	  cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_READ, cur_view_thread).GetMemSpace()) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 31, "R");
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_READ, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 31, "R");
       }
       if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_WRITE, cur_view_thread).GetPosition() &&
-	  cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_WRITE, cur_view_thread).GetMemSpace()) {
-	Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 32, "W");
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_WRITE, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 32, "W");
       }
       if (adj_inst_ptr == hardware4Stack.GetHead(nHardware::HEAD_FLOW, cur_view_thread).GetPosition() &&
-	  cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_FLOW, cur_view_thread).GetMemSpace()) {
-	  Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 33, "F");
+          cur_mem_space == hardware4Stack.GetHead(nHardware::HEAD_FLOW, cur_view_thread).GetMemSpace()) {
+        Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 33, "F");
       }
     }
     SetColor(COLOR_WHITE);
   }
-
+  
   DrawMiniMap();
 }
 
 void cZoomScreen::UpdateGenotype()
 {
   SetBoldColor(COLOR_CYAN);
-
-    Print(1, 12, "%9d", info.GetActiveGenotypeID());
-    Print(2, 12, "%9s", info.GetActiveName()());
-    Print(3, 12, "%9d", info.GetActiveSpeciesID());
-
+  
+  Print(1, 12, "%9d", info.GetActiveGenotypeID());
+  Print(2, 12, "%9s", info.GetActiveName()());
+  Print(3, 12, "%9d", info.GetActiveSpeciesID());
+  
   if (info.GetActiveGenotype() != NULL) {
     cGenotype & genotype = *(info.GetActiveGenotype());
     Print(5, 12, "%9d", genotype.GetNumOrganisms());
     Print(6, 12, "%9d", genotype.GetLength());
     Print(7, 12, "%9d", genotype.GetCopiedSize());
     Print(8, 12, "%9d", genotype.GetExecutedSize());
-
+    
     PrintFitness(10, 14, genotype.GetFitness());
     Print(11, 12, "%9f", genotype.GetGestationTime());
     Print(12, 14, "%9f", genotype.GetMerit());
     Print(13, 12, "%9f", genotype.GetReproRate());
-
+    
     // Column 2
     Print(1, 40, "%9d", genotype.GetUpdateBorn());
     Print(2, 40, "%9d", genotype.GetParentID());
     Print(3, 40, "%9d", genotype.GetParentDistance());
     Print(4, 40, "%9d", genotype.GetDepth());
-
+    
     Print(7, 40,  "%9d", genotype.GetThisDeaths());
     Print(8, 40,  "%9d", genotype.GetThisBirths());
     Print(9, 40,  "%9d", genotype.GetThisBreedTrue());
     Print(10, 40, "%9d", genotype.GetThisBreedIn());
     Print(11, 40, "%9d", genotype.GetThisBirths() - genotype.GetThisBreedTrue());
-
+    
     Print(14, 40, "%9d", genotype.GetTotalOrganisms());
     Print(15, 40, "%9d", genotype.GetBirths());
     Print(16, 40, "%9d", genotype.GetBreedTrue());
@@ -1027,24 +1321,24 @@
     Print(6, 12, "  -------");
     Print(7, 12, "  -------");
     Print(8, 12, "  -------");
-
+    
     Print(10, 12, "  -------");
     Print(11, 12, "  -------");
     Print(12, 12, "  -------");
     Print(13, 12, "  -------");
-
+    
     // Column 2
     Print(1, 40, "  -------");
     Print(2, 40, "  -------");
     Print(3, 40, "  -------");
     Print(4, 40, "  -------");
-
+    
     Print(7, 40,  "  -------");
     Print(8, 40,  "  -------");
     Print(9, 40,  "  -------");
     Print(10, 40, "  -------");
     Print(11, 40, "  -------");
-
+    
     Print(14, 40, "  -------");
     Print(15, 40, "  -------");
     Print(16, 40, "  -------");
@@ -1057,14 +1351,14 @@
 {
   // Collect all of the needed variables.
   cHardwareCPU & hardware =
-    (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
+  (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
   const cInstSet & inst_set = hardware.GetInstSet();
   cHeadCPU edit_head( hardware.IP() );
   if (parasite_zoom == true) {
     edit_head.Set(0, &(info.GetActiveCell()->GetOrganism()->GetHardware()) );
   }
   edit_head.LoopJump(memory_offset);
-
+  
   // Assemble first choice window.
   cMenuWindow menu1(NUM_INST_EDITS);
   menu1.SetTitle("Choose Edit method:");
@@ -1076,9 +1370,9 @@
   menu1.SetActive(INST_EDIT_CHANGE);
   int edit_method = menu1.Activate();
   cView::Redraw();
-
+  
   // If we need to choose a new instruction, bring up a window for it.
-
+  
   int new_inst = 0;
   if (edit_method == INST_EDIT_CHANGE || edit_method == INST_EDIT_INSERT) {
     cMenuWindow inst_menu(inst_set.GetSize());
@@ -1088,37 +1382,37 @@
     }
     inst_menu.SetActive(edit_head.GetInst().GetOp());
     new_inst = inst_menu.Activate();
-
+    
     cView::Redraw();
     if (new_inst == -1) {
       //  cView::Notify("Aborted!");
       return;
     }
   }
-
+  
   // Finally, act on the edit method!
   switch (edit_method) {
-  case INST_EDIT_BREAKPOINT:
-    ToggleBool( edit_head.FlagBreakpoint() );
-    break;
-  case INST_EDIT_JUMP_IP:
-    hardware.IP() = edit_head;
-    memory_offset = 0;
-    break;
-  case INST_EDIT_CHANGE:
-    edit_head.SetInst(cInstruction(new_inst));
-    break;
-  case INST_EDIT_INSERT:
-    edit_head.InsertInst(cInstruction(new_inst));
-    break;
-  case INST_EDIT_REMOVE:
-    edit_head.RemoveInst();
-    break;
-  default:
-    //    cView::Notify("Aborted!");
-    break;
+    case INST_EDIT_BREAKPOINT:
+      ToggleBool( edit_head.FlagBreakpoint() );
+      break;
+    case INST_EDIT_JUMP_IP:
+      hardware.IP() = edit_head;
+      memory_offset = 0;
+      break;
+    case INST_EDIT_CHANGE:
+      edit_head.SetInst(cInstruction(new_inst));
+      break;
+    case INST_EDIT_INSERT:
+      edit_head.InsertInst(cInstruction(new_inst));
+      break;
+    case INST_EDIT_REMOVE:
+      edit_head.RemoveInst();
+      break;
+    default:
+      //    cView::Notify("Aborted!");
+      break;
   }
-
+  
   Update();
 }
 
@@ -1126,25 +1420,25 @@
 {
   // Collect all of the needed variables.
   cHardwareCPU & hardware =
-    (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
+  (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
   //  cosnt cInstSet & inst_set = hardware.GetInstSet();
   cHeadCPU view_head( hardware.IP() );
   if (parasite_zoom == true) {
     view_head.Set(0, &(info.GetActiveCell()->GetOrganism()->GetHardware()) );
   }
   view_head.LoopJump(memory_offset);
-
+  
   // Act on the view method!
   if (inst_view_mode == true) inst_view_mode = false;
   else inst_view_mode = true;
-
+  
   Update();
 }
 
 void cZoomScreen::ThreadOptions()
 {
   int thread_method = THREAD_OPTIONS_VIEW;
-
+  
   // Assemble first choice window.
   cMenuWindow menu1(NUM_THREAD_OPTIONS);
   menu1.SetTitle("Choose threading option:");
@@ -1153,25 +1447,25 @@
   menu1.SetActive(THREAD_OPTIONS_VIEW);
   thread_method = menu1.Activate();
   cView::Redraw();
-
+  
   // Act on the view method!
   switch (thread_method) {
-  case THREAD_OPTIONS_VIEW:
-    ViewThreads();
-    break;
-  case THREAD_OPTIONS_LOCK:
-    if (info.GetThreadLock() != -1) info.SetThreadLock(-1);
-    else {
-      cHardwareCPU & hardware =
-	(cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
-      info.SetThreadLock( hardware.GetCurThread() );
-    }
-
-    break;
-  default:
-     break;
+    case THREAD_OPTIONS_VIEW:
+      ViewThreads();
+      break;
+    case THREAD_OPTIONS_LOCK:
+      if (info.GetThreadLock() != -1) info.SetThreadLock(-1);
+      else {
+        cHardwareCPU & hardware =
+        (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
+        info.SetThreadLock( hardware.GetCurThread() );
+      }
+        
+        break;
+    default:
+      break;
   }
-
+  
   Update();
 }
 
@@ -1180,9 +1474,9 @@
   cTextWindow * window = new cTextWindow(10, 40, 7, 20);
   window->SetBoldColor(COLOR_WHITE);
   window->Box();
-
+  
   // Place the data.
-
+  
   cHardwareCPU & hardware =
     (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
   cHeadCPU inst_ptr( hardware.IP() );
@@ -1190,64 +1484,64 @@
     inst_ptr.Set(0, &(info.GetActiveCell()->GetOrganism()->GetHardware()) );
   }
   inst_ptr.LoopJump(memory_offset);
-
+  
   const cInstSet & inst_set = hardware.GetInstSet();
-
+  
   window->SetBoldColor(COLOR_YELLOW);
   window->Print(2, 16, "%s", inst_set.GetName(inst_ptr.GetInst())());
-
+  
   window->SetBoldColor(COLOR_WHITE);
-
+  
   window->Print(2, 2, "Instruction: ");
   window->Print(4, 2, "Line Num...: ");
   window->Print(6, 2, "Redundancy.: ");
   window->Print(7, 2, "Cost.......: ");
-
+  
   window->SetBoldColor(COLOR_CYAN);
-
+  
   const int inst_id = inst_ptr.GetInst().GetOp();
-
+  
   window->Print(4, 14, "%3d", inst_ptr.GetPosition());
   window->Print(6, 14, "%3d", inst_set.GetRedundancy(cInstruction(inst_id)) );
   window->Print(7, 14, "%3d", inst_set.GetCost(cInstruction(inst_id)) );
-
+  
   if (inst_ptr.FlagCopied() == true) window->SetBoldColor(COLOR_CYAN);
   else window->SetColor(COLOR_CYAN);
   window->Print(4, 25, "Copied");
-
+  
   if (inst_ptr.FlagMutated() == true) window->SetBoldColor(COLOR_CYAN);
   else window->SetColor(COLOR_CYAN);
   window->Print(5, 25, "Mutated");
-
+  
   if (inst_ptr.FlagExecuted() == true) window->SetBoldColor(COLOR_CYAN);
   else window->SetColor(COLOR_CYAN);
   window->Print(6, 25, "Executed");
-
+  
   if (inst_ptr.FlagBreakpoint() == true) window->SetBoldColor(COLOR_CYAN);
   else window->SetColor(COLOR_CYAN);
   window->Print(7, 25, "Breakpoint");
-
-
+  
+  
   // Print it!
   window->Refresh();
-
+  
   // Wait for the results.
   bool finished = false;
   int cur_char;
-
+  
   while (finished == false) {
     cur_char = GetInput();
     switch (cur_char) {
-    case 'q':
-    case 'Q':
-    case ' ':
-    case '\n':
-    case '\r':
-      finished = true;
-      break;
+      case 'q':
+      case 'Q':
+      case ' ':
+      case '\n':
+      case '\r':
+        finished = true;
+        break;
     }
   }
-
+  
   delete window;
   cView::Redraw();
 }
@@ -1257,12 +1551,12 @@
   cTextWindow * window = new cTextWindow(9, 54, 4, 13);
   cHardwareCPU & hardware =
     (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
-
+  
   window->SetBoldColor(COLOR_WHITE);
   window->Box();
-
+  
   window->Print(2, 2, "Registers");
-
+  
   for (int i = 0; i < 3; i++) {
     const char reg_letter = 'A' + i;
     const int reg_value = hardware.Register(i);
@@ -1274,25 +1568,25 @@
     window->Print(4+i, 6, "%10d", reg_value);
     window->PrintBinary(4+i, 18, reg_value);
   }
-
+  
   // Print it!
   window->Refresh();
-
+  
   // Wait for the results.
   bool finished = false;
   while (!finished) {
     int cur_char = GetInput();
     switch (cur_char) {
-    case 'q':
-    case 'Q':
-    case ' ':
-    case '\n':
-    case '\r':
-      finished = true;
-      break;
+      case 'q':
+      case 'Q':
+      case ' ':
+      case '\n':
+      case '\r':
+        finished = true;
+        break;
     }
   }
-
+  
   delete window;
   cView::Redraw();
 }
@@ -1303,56 +1597,56 @@
   cTextWindow * window = new cTextWindow(16, 50, 4, 15);
   cHardwareCPU & hardware =
     (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
-
+  
   bool finished = false;
   int active_stack = hardware.GetActiveStackID();
-
-
+  
+  
   while (finished == false) {
     window->SetBoldColor(COLOR_WHITE);
     window->Box();
-
+    
     char stack_letter = 'A' + active_stack;
     window->Print(2, 5, "[<] Stack %c [>]", stack_letter);
     window->SetBoldColor(COLOR_CYAN);
     window->Print(2, 6, '<');
     window->Print(2, 18, '>');
-
+    
     window->SetBoldColor(COLOR_WHITE);
     for (int i = 0; i < 10; i++) {
       const int stack_value = hardware.GetStack(i,active_stack);
       window->Print(4+i, 2, "%10d : ", stack_value);
       window->PrintBinary(4+i, 15, stack_value);
     }
-
+    
     // Print it!
     window->Refresh();
-
+    
     // Wait for the results.
     bool legal_keypress = false;
     while (!legal_keypress) {
       int cur_char = GetInput();
       switch (cur_char) {
-      case ',':
-      case '<':
-      case '.':
-      case '>':
-	active_stack = 1 - active_stack;
-	legal_keypress = true;
-	break;
-      case 'q':
-      case 'Q':
-      case ' ':
-      case '\n':
-      case '\r':
-	finished = true;
-	legal_keypress = true;
-	break;
+        case ',':
+        case '<':
+        case '.':
+        case '>':
+          active_stack = 1 - active_stack;
+          legal_keypress = true;
+          break;
+        case 'q':
+        case 'Q':
+        case ' ':
+        case '\n':
+        case '\r':
+          finished = true;
+          legal_keypress = true;
+          break;
       }
     }
-
+    
   }
-
+  
   delete window;
   cView::Redraw();
 }
@@ -1361,12 +1655,12 @@
 void cZoomScreen::ViewInputs()
 {
   cTextWindow * window = new cTextWindow(9, 54, 4, 13);
-
+  
   window->SetBoldColor(COLOR_WHITE);
   window->Box();
-
+  
   window->Print(2, 2, "Inputs");
-
+  
   for (int i = 0; i < 3; i++) {
     const int input_value = info.GetActiveCell()->GetInput(i);
     window->SetBoldColor(COLOR_WHITE);
@@ -1377,25 +1671,25 @@
     window->Print(4+i, 6, "%10d", input_value);
     window->PrintBinary(4+i, 18, input_value);
   }
-
+  
   // Print it!
   window->Refresh();
-
+  
   // Wait for the results.
   bool finished = false;
   while (finished == false) {
     int cur_char = GetInput();
     switch (cur_char) {
-    case 'q':
-    case 'Q':
-    case ' ':
-    case '\n':
-    case '\r':
-      finished = true;
-      break;
+      case 'q':
+      case 'Q':
+      case ' ':
+      case '\n':
+      case '\r':
+        finished = true;
+        break;
     }
   }
-
+  
   delete window;
   cView::Redraw();
 }
@@ -1408,131 +1702,151 @@
 cCoords cZoomScreen::GetSectionCoords(int in_section)
 {
   switch (in_section) {
-  case ZOOM_SECTION_MEMORY:
-    return cCoords(MEMORY_X, MEMORY_Y);
-    break;
-
-  case ZOOM_SECTION_REGISTERS:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
-    {
-      return cCoords(REG_X, REG_Y);
-    }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+    case ZOOM_SECTION_MEMORY:
+      return cCoords(MEMORY_X, MEMORY_Y);
+      break;
+      
+    case ZOOM_SECTION_REGISTERS:
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
       {
-	return cCoords(REG_X, REG_Y-1);
+        return cCoords(REG_X, REG_Y);
       }
-    break;
-    
-  case ZOOM_SECTION_STACK:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
       {
-	return cCoords(STACK_X, STACK_Y);
+        return cCoords(REG_X, REG_Y-1);
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
       {
-	return cCoords(STACK_X, STACK_Y-1);
+        return cCoords(REG_X, REG_Y-1);
       }
-    break;
-
-  case ZOOM_SECTION_INPUTS:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+      break;
+      
+    case ZOOM_SECTION_STACK:
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
       {
-	return cCoords(INPUT_X, INPUT_Y);
+        return cCoords(STACK_X, STACK_Y);
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
       {
-	return cCoords(INPUT_X, INPUT_Y-1);
+        return cCoords(STACK_X, STACK_Y-1);
       }
-    break;
-    
-  case ZOOM_SECTION_MAP:
-    return cCoords(MINI_MAP_X, MINI_MAP_Y);
-    break;
-  }
-
-  return cCoords(0,0);
-}
-
-/*
-cString cZoomScreen::GetSectionName(int in_section)
-{
-  switch (in_section) {
-  case ZOOM_SECTION_MEMORY:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
       {
-	 return cString("Memory");
+        return cCoords(STACK_X, STACK_Y-1);
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      break;
+      
+    case ZOOM_SECTION_INPUTS:
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
       {
-	return cString("Memory Space");
+        return cCoords(INPUT_X, INPUT_Y);
       }
-    break;
-
-  case ZOOM_SECTION_REGISTERS:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
       {
-	 return cString("Registers:");
+        return cCoords(INPUT_X, INPUT_Y-1);
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
       {
-	return cString("Stacks:");
+        return cCoords(INPUT_X, INPUT_Y-1);
       }
-    break;
-
-  case ZOOM_SECTION_STACK:
-    return cString("Stack ");
-    break;
-
-  case ZOOM_SECTION_INPUTS:
-    return cString("Inputs:");
-    break;
-
-  case ZOOM_SECTION_MAP:
-    return cString("Mini-Map");
-    break;
+      break;
+      
+    case ZOOM_SECTION_MAP:
+      return cCoords(MINI_MAP_X, MINI_MAP_Y);
+      break;
   }
+  
+  return cCoords(0,0);
+}
 
-  return cString("Unknown!");
-}*/
+/*
+ cString cZoomScreen::GetSectionName(int in_section)
+ {
+   switch (in_section) {
+     case ZOOM_SECTION_MEMORY:
+       if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+       {
+         return cString("Memory");
+       }
+       else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+       {
+         return cString("Memory Space");
+       }
+       break;
+       
+     case ZOOM_SECTION_REGISTERS:
+       if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+       {
+         return cString("Registers:");
+       }
+       else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+       {
+         return cString("Stacks:");
+       }
+       break;
+       
+     case ZOOM_SECTION_STACK:
+       return cString("Stack ");
+       break;
+       
+     case ZOOM_SECTION_INPUTS:
+       return cString("Inputs:");
+       break;
+       
+     case ZOOM_SECTION_MAP:
+       return cString("Mini-Map");
+       break;
+   }
+   
+   return cString("Unknown!");
+ }*/
 
 char* cZoomScreen::GetSectionName(int in_section)
 {
   switch (in_section) {
-  case ZOOM_SECTION_MEMORY:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+    case ZOOM_SECTION_MEMORY:
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
       {
-	 return "Memory";
+        return "Memory";
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
       {
-	return "Memory Space";
+        return "Memory Space";
       }
-    break;
-
-  case ZOOM_SECTION_REGISTERS:
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
       {
-	 return "Registers:";
+        return "Memory Space";
       }
-    else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+      break;
+      
+    case ZOOM_SECTION_REGISTERS:
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
       {
-	return "Stacks:";
+        return "Registers:";
       }
-    break;
-
-  case ZOOM_SECTION_STACK:
-    return "Stack ";
-    break;
-
-  case ZOOM_SECTION_INPUTS:
-    return "Inputs:";
-    break;
-
-  case ZOOM_SECTION_MAP:
-    return "Mini-Map";
-    break;
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
+      {
+        return "Stacks:";
+      }
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
+      {
+        return "Stacks:";
+      }
+      break;
+      
+    case ZOOM_SECTION_STACK:
+      return "Stack ";
+      break;
+      
+    case ZOOM_SECTION_INPUTS:
+      return "Inputs:";
+      break;
+      
+    case ZOOM_SECTION_MAP:
+      return "Mini-Map";
+      break;
   }
-
+  
   return "Unknown!";
 }
 
@@ -1544,93 +1858,92 @@
     sect_coords.Translate(2, 1);
     SetColor(COLOR_WHITE);
     Print(sect_coords.GetY(), sect_coords.GetX(), "%s",
-	  GetSectionName(active_section));
+          GetSectionName(active_section));
     active_section = in_section;
   }
-
+  
   cCoords sect_coords(GetSectionCoords(active_section));
   sect_coords.Translate(2, 1);
   SetBoldColor(COLOR_BLUE);
   Print(sect_coords.GetY(), sect_coords.GetX(), "%s",
-	GetSectionName(active_section));
+        GetSectionName(active_section));
   SetColor(COLOR_WHITE);
 }
 
 void cZoomScreen::DoInput(int in_char)
 {
   // First do the Mode specific io...
-
+  
   if (mode == ZOOM_MODE_CPU      && DoInputCPU(in_char)) return;
   if (mode == ZOOM_MODE_STATS    && DoInputStats(in_char)) return;
   if (mode == ZOOM_MODE_GENOTYPE && DoInputGenotype(in_char)) return;
-
-  int num_threads;
-  if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_ORIGINAL)
+  
+  int num_threads = 0;
+  if (info.GetActiveCell()->GetOrganism() != NULL) {
+    if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_ORIGINAL)
     {
-       cHardwareCPU & hardwareCPU = 
-      (cHardwareCPU &) info.GetActiveCell()->GetOrganism()->GetHardware();
-       num_threads = hardwareCPU.GetNumThreads();
+      cHardwareCPU& hw = static_cast<cHardwareCPU&>(info.GetActiveCell()->GetOrganism()->GetHardware());
+      num_threads = hw.GetNumThreads();
     }
-  else if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
+    else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
     {
-      cHardware4Stack & hardware4Stack = 
-	(cHardware4Stack &) info.GetActiveCell()->GetOrganism()->GetHardware();
-      num_threads = hardware4Stack.GetNumThreads();
+      cHardware4Stack& hw = static_cast<cHardware4Stack&>(info.GetActiveCell()->GetOrganism()->GetHardware());
+      num_threads = hw.GetNumThreads();
     }
+    else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
+    {
+      cHardwareSMT& hw = static_cast<cHardwareSMT&>(info.GetActiveCell()->GetOrganism()->GetHardware());
+      num_threads = hw.GetNumThreads();
+    }
+  }
   switch(in_char) {
-  case 't':
-  case 'T':
-    if(num_threads>1)
+    case 't':
+    case 'T':
+      if(num_threads>1)
       {
-	memory_offset=0;
-	++cur_view_thread%=num_threads;
-	if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK)
-	  {
-	    cHardware4Stack & hardware4Stack = 
-	      (cHardware4Stack &) info.GetActiveCell()->GetOrganism()->GetHardware();
-	    cur_mem_space=hardware4Stack.IP(cur_view_thread).GetMemSpace();
-	  }
-	//ThreadOptions();
-	Update();
+        memory_offset=0;
+        ++cur_view_thread%=num_threads;
+        if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK)
+        {
+          cHardware4Stack & hardware4Stack = 
+          (cHardware4Stack &) info.GetActiveCell()->GetOrganism()->GetHardware();
+          cur_mem_space=hardware4Stack.IP(cur_view_thread).GetMemSpace();
+        }
+        else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT)
+        {
+          cHardwareSMT & hardwareSMT = 
+          (cHardwareSMT&) info.GetActiveCell()->GetOrganism()->GetHardware();
+          cur_mem_space=hardwareSMT.IP(cur_view_thread).GetMemSpace();
+        }
+        Update();
       }
-    break;
-  /*
-    case 'x':
-    case 'X':
-      // Toggle the parasite_zoom flag IF we are on a parasite
-      if (info.GetPauseLevel() && info.GetActiveCell() &&
-      info.GetActiveCell()->IsParasite()) {
-      parasite_zoom = !parasite_zoom;
-      Update();
-      }
       break;
-    */
-  case ' ':
-    memory_offset = 0;
-    parasite_zoom = false;
-    info.GetActiveCell()->GetOrganism()->GetPhenotype().SetFault("");
-    info.EngageStepMode();
-    break;
-  case '>':
-  case '.':
-    mode++;
-    if (mode == NUM_ZOOM_MODES) mode = 0;
-    Clear();
-    Draw();
-    break;
-  case '<':
-  case ',':
-    mode--;
-    if (mode == -1) mode = NUM_ZOOM_MODES - 1;
-
-    Clear();
-    Draw();
-    break;
-
-  default:
-    cerr << "Unknown Command (#"
-	 << (int) in_char << "): [" << in_char << "]" << endl;
-    break;
+    case ' ':
+      memory_offset = 0;
+      parasite_zoom = false;
+      info.GetActiveCell()->GetOrganism()->GetPhenotype().SetFault("");
+      info.EngageStepMode();
+      break;
+    case '>':
+    case '.':
+      mode++;
+      if (mode == NUM_ZOOM_MODES) mode = 0;
+        Clear();
+      Draw();
+      break;
+    case '<':
+    case ',':
+      mode--;
+      if (mode == -1) mode = NUM_ZOOM_MODES - 1;
+        
+        Clear();
+      Draw();
+      break;
+      
+    default:
+      cerr << "Unknown Command (#"
+      << (int) in_char << "): [" << in_char << "]" << endl;
+      break;
   }
 }
 
@@ -1638,178 +1951,184 @@
 bool cZoomScreen::DoInputCPU(int in_char)
 {
   switch(in_char) {
-  case '2':
-  case KEY_DOWN:
-    if (active_section == ZOOM_SECTION_MAP) {
-      mini_center_id += map_x_size;
-      mini_center_id %= population.GetSize();
-      cur_view_thread=0;
-      if (population.GetCell(mini_center_id).IsOccupied()) {
-	memory_offset = 0;
-	info.SetActiveCell( &(population.GetCell(mini_center_id)));
+    case '2':
+    case KEY_DOWN:
+      if (active_section == ZOOM_SECTION_MAP) {
+        mini_center_id += map_x_size;
+        mini_center_id %= population.GetSize();
+        cur_view_thread=0;
+        if (population.GetCell(mini_center_id).IsOccupied()) {
+          memory_offset = 0;
+          info.SetActiveCell( &(population.GetCell(mini_center_id)));
+        }
+        Update();
+      } else if (active_section == ZOOM_SECTION_MEMORY) {
+        memory_offset++;
+        Update();
       }
+      break;
+    case '8':
+    case KEY_UP:
+      if (active_section == ZOOM_SECTION_MAP) {
+        mini_center_id -= map_x_size;
+        cur_view_thread=0;
+        if (mini_center_id < 0) mini_center_id += population.GetSize();
+        if (population.GetCell(mini_center_id).IsOccupied()) {
+          memory_offset = 0;
+          info.SetActiveCell( &(population.GetCell(mini_center_id)));
+        }
+        Update();
+      } else if (active_section == ZOOM_SECTION_MEMORY) {
+        memory_offset--;
+        Update();
+      }
+      break;
+    case '6':
+    case KEY_RIGHT:
+      if (active_section == ZOOM_SECTION_MAP) {
+        mini_center_id++;
+        if (mini_center_id == population.GetSize()) mini_center_id = 0;
+        if (population.GetCell(mini_center_id).IsOccupied()) {
+          memory_offset = 0;
+          info.SetActiveCell( &(population.GetCell(mini_center_id)));
+        }
+      }
+      else if (active_section == ZOOM_SECTION_MEMORY) {
+        if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_4STACK)
+        {
+          cur_mem_space++;
+          cur_mem_space %= nHardware4Stack::NUM_MEMORY_SPACES;
+        }
+        else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT)
+        {
+          cur_mem_space++;
+          // DDD - Should handle the extensibility of SMT Memory Spaces
+          cur_mem_space %= 1;
+        }
+      }
+      Update(); 
+      break;
+    case '4':
+    case KEY_LEFT:
+      if (active_section == ZOOM_SECTION_MAP) {
+        mini_center_id--;
+        if (mini_center_id < 0) mini_center_id += population.GetSize();
+        if (population.GetCell(mini_center_id).IsOccupied()) {
+          memory_offset = 0;
+          info.SetActiveCell( &(population.GetCell(mini_center_id)));
+        }
+      }
+      else if (active_section == ZOOM_SECTION_MEMORY) {
+        if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK) {
+          cur_mem_space--;
+          if (cur_mem_space < 0) cur_mem_space = nHardware4Stack::NUM_MEMORY_SPACES - 1;
+        }
+        else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT) {
+          cur_mem_space--;
+          // DDD - Should handle the extensibility of SMT Memory Spaces
+          if (cur_mem_space < 0) cur_mem_space = 0;
+        }
+      }
       Update();
-    } else if (active_section == ZOOM_SECTION_MEMORY) {
-      memory_offset++;
-      Update();
-    }
-    break;
-  case '8':
-  case KEY_UP:
-    if (active_section == ZOOM_SECTION_MAP) {
-      mini_center_id -= map_x_size;
-      cur_view_thread=0;
-      if (mini_center_id < 0) mini_center_id += population.GetSize();
-      if (population.GetCell(mini_center_id).IsOccupied()) {
-	memory_offset = 0;
-	info.SetActiveCell( &(population.GetCell(mini_center_id)));
+      break;
+    case 'K':
+    case 'k':
+      if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_4STACK) {
+        ++cur_stack%=4;
       }
+      else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT) {
+        ++cur_stack%=4;
+      }
       Update();
-    } else if (active_section == ZOOM_SECTION_MEMORY) {
-      memory_offset--;
+      break;
+    case '+':
+    case '=':
+      info.IncMapMode();
       Update();
-    }
-    break;
-  case '6':
-  case KEY_RIGHT:
-    if (active_section == ZOOM_SECTION_MAP) {
-      mini_center_id++;
-      if (mini_center_id == population.GetSize()) mini_center_id = 0;
-      if (population.GetCell(mini_center_id).IsOccupied()) {
-	memory_offset = 0;
-	info.SetActiveCell( &(population.GetCell(mini_center_id)));
+      break;
+    case '-':
+    case '_':
+      info.DecMapMode();
+      Update();
+      break;
+    case '\n':
+    case '\r':
+      if (active_section == ZOOM_SECTION_MAP) {
+        memory_offset = 0;
+        info.SetActiveCell( &(population.GetCell(mini_center_id)));
       }
-    }
-    else if (active_section == ZOOM_SECTION_MEMORY) {
-      if(cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK)
-	{
-	  cur_mem_space++;
-	  cur_mem_space %= nHardware4Stack::NUM_MEMORY_SPACES;
-	}
-    }
-    Update(); 
-    break;
-  case '4':
-  case KEY_LEFT:
-    if (active_section == ZOOM_SECTION_MAP) {
-      mini_center_id--;
-      if (mini_center_id < 0) mini_center_id += population.GetSize();
-      if (population.GetCell(mini_center_id).IsOccupied()) {
-	memory_offset = 0;
-	info.SetActiveCell( &(population.GetCell(mini_center_id)));
-      }
-    }
-    else if (active_section == ZOOM_SECTION_MEMORY) {
-      if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK) {
-	cur_mem_space--;
-	if (cur_mem_space < 0) cur_mem_space = nHardware4Stack::NUM_MEMORY_SPACES - 1;
-      }
-    }
-    Update();
-    break;
-  case 'K':
-  case 'k':
-    if(cConfig::GetHardwareType()==HARDWARE_TYPE_CPU_4STACK) {
-      ++cur_stack%=4;
-    }
-    Update();
-    break;
-    //case '<':
-    // if(hardware_type==HARDWARE_TYPE_CPU_4STACK)
-    //  {
-    //cur_stack=(cur_stack-1);
-    //if(cur_stack<0) cur_stack=3;
-    //}
-    //Update();
-    //break;
-  case '+':
-  case '=':
-    info.IncMapMode();
-    Update();
-    break;
-  case '-':
-  case '_':
-    info.DecMapMode();
-    Update();
-    break;
-  case '\n':
-  case '\r':
-    if (active_section == ZOOM_SECTION_MAP) {
-      memory_offset = 0;
-      info.SetActiveCell( &(population.GetCell(mini_center_id)));
-    }
-    Update();
-    break;
-  case '\t':
+      Update();
+      break;
+    case '\t':
     {
       int next_section = active_section + 1;
       if (next_section == NUM_ZOOM_SECTIONS) next_section = 0;
       SetActiveSection(next_section);
     }
-    Refresh();
-    break;
-
-  case 'e':
-  case 'E':
-    if( active_section == ZOOM_SECTION_MEMORY) {
-      EditMemory();
-    }
-    break;
-
-  case 'v':
-  case 'V':
-    switch (active_section) {
-    case ZOOM_SECTION_MEMORY:
-      ViewMemory();
+      Refresh();
       break;
-    case ZOOM_SECTION_REGISTERS:
-      ViewRegisters();
+      
+    case 'e':
+    case 'E':
+      if( active_section == ZOOM_SECTION_MEMORY) {
+        EditMemory();
+      }
       break;
-    case ZOOM_SECTION_STACK:
-      ViewStack();
+      
+    case 'v':
+    case 'V':
+      switch (active_section) {
+        case ZOOM_SECTION_MEMORY:
+          ViewMemory();
+          break;
+        case ZOOM_SECTION_REGISTERS:
+          ViewRegisters();
+          break;
+        case ZOOM_SECTION_STACK:
+          ViewStack();
+          break;
+        case ZOOM_SECTION_INPUTS:
+          ViewInputs();
+          break;
+      }
       break;
-    case ZOOM_SECTION_INPUTS:
-      ViewInputs();
-      break;
-    }
-    break;
-
-
-  default:
-    return false;
+      
+      
+    default:
+      return false;
   };
 
-  return true;
+return true;
 }
 
 bool cZoomScreen::DoInputStats(int in_char)
 {
   switch(in_char) {
-  case '6':
-  case KEY_RIGHT:
+    case '6':
+    case KEY_RIGHT:
     {
       const int new_task_offset = task_offset + Height() - TASK_Y - 2;
-      if (new_task_offset < cConfig::GetNumTasks()) {
-	task_offset = new_task_offset;
-	Draw();
+      if (new_task_offset < info.GetWorld().GetNumTasks()) {
+        task_offset = new_task_offset;
+        Draw();
       }
     }
-    break;
-  case '4':
-  case KEY_LEFT:
+      break;
+    case '4':
+    case KEY_LEFT:
     {
       const int new_task_offset = task_offset - Height() + TASK_Y + 2;
       if (new_task_offset >= 0) {
-	task_offset = new_task_offset;
-	Draw();
+        task_offset = new_task_offset;
+        Draw();
       }
     }
-    break;
-
-  default:
-    return false;
+      break;
+      
+    default:
+      return false;
   }
-
+  
   return true;
 }
 
@@ -1822,11 +2141,11 @@
 {
   // if (GetSubWindow(0) == NULL) AddSubWindow(map_screen, 0);
   // map_screen->Update();
-
+  
   // Setup the start color for the map...
   SetColor(COLOR_WHITE);
   mini_center_id = info.GetActiveCell()->GetID();
-
+  
   const int name_x = MINI_MAP_X + 4;
   const int name_y = MINI_MAP_Y + 11;
   if (info.GetMapMode() == MAP_BASIC)           Print(name_y, name_x, "Genotypes");
@@ -1840,24 +2159,24 @@
   else if (info.GetMapMode() == MAP_MUTATIONS)  Print(name_y, name_x, "Mutations");
   else if (info.GetMapMode() == MAP_THREAD)     Print(name_y, name_x, " Threads ");
   else if (info.GetMapMode() == MAP_LINEAGE)    Print(name_y, name_x, " Lineage ");
-
-
+  
+  
   int virtual_x = (mini_center_id % map_x_size) + map_x_size;
   int virtual_y = (mini_center_id / map_x_size) + map_y_size;
-
+  
   info.SetupSymbolMaps(info.GetMapMode(), HasColors());
-
+  
   for (int y = -3; y <= 3 && y < map_y_size - 3; y++) {
     Move(MINI_MAP_Y + 6 + y, MINI_MAP_X + 2);
     int cur_y = (y + virtual_y) % map_y_size;
     for (int x = -3; x <= 3 && x < map_x_size - 3; x++) {
       int cur_x = (x + virtual_x) % map_x_size;
       int index = cur_y * map_x_size + cur_x;
-
+      
       SetSymbolColor(info.ColorSymbol(index));
       if (info.MapSymbol(index) > 0) Print(info.MapSymbol(index));
       else Print(CHAR_BULLET);
-
+      
       // Space between columns
       for (int i = 0; i < AVIDA_MAP_X_SPACING - 1; i++)  Print(' ');
     }
@@ -1865,7 +2184,7 @@
   SetColor(COLOR_WHITE);
   Print(MINI_MAP_Y + 6, MINI_MAP_X + 7, '[');
   Print(MINI_MAP_Y + 6, MINI_MAP_X + 9, ']');
-
+  
   Refresh();
 }
 

Modified: branches/brysonda/source/viewer/cZoomScreen.h
===================================================================
--- branches/brysonda/source/viewer/cZoomScreen.h	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/cZoomScreen.h	2005-10-25 13:05:04 UTC (rev 362)
@@ -5,11 +5,11 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef VIEW_ZOOM_SCREEN_HH
-#define VIEW_ZOOM_SCREEN_HH
+#ifndef cZoomScreen_h
+#define cZoomScreen_h
 
-#include "text_screen.hh"
-#include "map_screen.hh"
+#include "cScreen.h"
+#include "cMapScreen.h"
 
 #define ZOOM_MODE_STATS    0
 #define ZOOM_MODE_CPU      1
@@ -58,6 +58,8 @@
 #define THREAD_OPTIONS_LOCK   1
 #define NUM_THREAD_OPTIONS    2
 
+class cHardwareBase;
+
 class cZoomScreen : public cScreen {
 private:
   cPopulation & population;
@@ -80,14 +82,17 @@
 private:
   void DrawCPU_Original();
   void DrawCPU_4Stack();
+  void DrawCPU_SMT();
   void DrawStats();
   void DrawGenotype();
   void UpdateCPU(cHardwareBase & hardware);
   void UpdateCPU_Original(cHardwareBase & hardware);
   void UpdateCPU_4Stack(cHardwareBase & hardware);
+  void UpdateCPU_SMT(cHardwareBase & hardware);
   void UpdateStats(cHardwareBase & hardware);
   void UpdateStats_CPU(cHardwareBase & hardware);
   void UpdateStats_4Stack(cHardwareBase & hardware);
+  void UpdateStats_SMT(cHardwareBase & hardware);
   void UpdateGenotype();
 
   void EditMemory();

Modified: branches/brysonda/source/viewer/viewer.cc
===================================================================
--- branches/brysonda/source/viewer/viewer.cc	2005-10-24 15:31:38 UTC (rev 361)
+++ branches/brysonda/source/viewer/viewer.cc	2005-10-25 13:05:04 UTC (rev 362)
@@ -1,31 +1,21 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2001 California Institute of Technology             //
-//                                                                          //
-// Read the COPYING and README files, or contact 'avida at alife.org',         //
-// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
-//////////////////////////////////////////////////////////////////////////////
+/*
+ *  viewer.cc
+ *  Avida2
+ *
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *
+ */
 
-#ifndef VIEWER_HH
-#include "viewer.hh"
-#endif
+#include <signal.h>
 
-#ifndef CONFIG_HH
-#include "cConfig.h"
-#endif
-#ifndef ENVIRONMENT_HH
-#include "cEnvironment.h"
-#endif
-#ifndef POPULATION_HH
-#include "cPopulation.h"
-#endif
-#ifndef VIEW_HH
-#include "../viewers/view.hh"          // class cView
-#endif
+#include "avida.h"
+#include "cAvidaConfig.h"
+#include "cAvidaDriver_Analyze.h"
+#include "cAvidaDriver_TextPopViewer.h"
+#include "cWorld.h"
 
-
 using namespace std;
 
-
 int main(int argc, char * argv[])
 {
   // Catch Interrupt making sure to close appropriately
@@ -42,111 +32,18 @@
   cout << "under certain conditions. See file COPYING for details." << endl << endl;
   
   // Initialize the configuration data...
-  cConfig::InitGroupList();
-  cConfig::Setup(argc, argv);
-  cConfig::SetupMS();
-
-  cEnvironment environment;
-  cPopulationInterface test_interface;
-
-  SetupAvida(environment, test_interface);
-
-  if (cConfig::GetAnalyzeMode() == true) {
-    cAvidaDriver_Base::main_driver = new cAvidaDriver_Analyze();
+  cWorld* world = new cWorld(cAvidaConfig::LoadWithCmdLineArgs(argc, argv));
+  
+  if (world->GetConfig().ANALYZE_MODE.Get() > 0) {
+    cAvidaDriver_Base::main_driver = new cAvidaDriver_Analyze(world, (world->GetConfig().ANALYZE_MODE.Get() == 2));
+  } else {
+    cAvidaDriver_Base::main_driver = new cAvidaDriver_TextPopViewer(world);
   }
-  else {
-    cAvidaDriver_Base::main_driver = new cAvidaDriver_TextPopViewer(environment);
-  }
-
+  
+  cout << endl;
+  
   cAvidaDriver_Base::main_driver->Run();
 
   // Exit Nicely
   ExitAvida(0);
 }
-
-
-////////////////////////////////
-//  cAvidaDriver_TextPopViewer
-////////////////////////////////
-
-cAvidaDriver_TextPopViewer::
-cAvidaDriver_TextPopViewer(cEnvironment & environment)
-  : cAvidaDriver_Population(environment)
-  , viewer(NULL)
-{
-  cout << "Initializing Text Viewer... " << flush;
-
-  viewer = new cView(*population);
-  viewer->SetViewMode(cConfig::GetViewMode());
-
-  cout << " ...done" << endl;
-}
-
-cAvidaDriver_TextPopViewer::~cAvidaDriver_TextPopViewer()
-{
-  if (viewer != NULL) EndProg(0);
-}
-
-void cAvidaDriver_TextPopViewer::ProcessOrganisms()
-{
-  //  cout << "DEBUG: Running Update w/ Viewer" << endl;
-
-  // Process the update.
-  const int UD_size = cConfig::GetAveTimeslice()*population->GetNumOrganisms();
-  const double step_size = 1.0 / (double) UD_size;
-
-  // Are we stepping through an organism?
-  if (viewer->GetStepOrganism() != -1) {  // Yes we are!
-    // Keep the viewer informed about the organism we are stepping through...
-    for (int i = 0; i < UD_size; i++) {
-      const int next_id = population->ScheduleOrganism();
-      if (next_id == viewer->GetStepOrganism()) viewer->NotifyUpdate();
-      population->ProcessStep(step_size, next_id);
-    }
-  }
-  else {
-    for (int i = 0; i < UD_size; i++) population->ProcessStep(step_size);
-  }
-
-  // end of update stats...
-  population->CalcUpdateStats();
-
-  // Setup the viewer for the new update.
-  if (viewer->GetStepOrganism() == -1) NotifyUpdate();
-}
-
-void cAvidaDriver_TextPopViewer::NotifyComment(const cString & in_string)
-{
-  // Send a commment to the user.
-  viewer->NotifyComment(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyWarning(const cString & in_string)
-{
-  // Send a warning to the user.
-  viewer->NotifyWarning(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyError(const cString & in_string)
-{
-  // Send an error to the user.
-  viewer->NotifyError(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyUpdate()
-{
-  viewer->NotifyUpdate();
-  viewer->NewUpdate();
-
-  // This is needed to have the top bar drawn properly; I'm not sure why...
-  static bool first_update = true;
-  if (first_update) {
-    viewer->Refresh();
-    first_update = false;
-  }
-}
-
-void cAvidaDriver_TextPopViewer::SignalBreakpoint()
-{
-  viewer->DoBreakpoint();
-}




More information about the Avida-cvs mailing list