summaryrefslogtreecommitdiff
path: root/emulators/swarm/patches/patch-ae
blob: a96cf175c1ce8334d2012490d0608a52aefb4db0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
$NetBSD: patch-ae,v 1.2 2005/11/03 21:51:57 rillig Exp $

--- src/core.cpp	2004/08/12 17:16:45	1.1
+++ src/core.cpp	2004/08/12 17:17:18
@@ -26,7 +26,7 @@
 #include "core.h"
 #include "isa.h"
 #include <string.h>
-#include <iostream.h>
+#include <iostream>
 #include "disarm.h"
 #ifndef ARM6
 #include "booth.h"
@@ -34,6 +34,8 @@
 
 #include "memory.cpp"
 
+using namespace std;
+
 static const char* mode_str[16] = {"reset", "fiq", "irq", "svc", 
 				   NULL, NULL, NULL, "abort", 
 				   NULL, NULL, NULL, "undef", 
@@ -4031,22 +4033,29 @@
 {
   char str[80];
 
-  cout.form("-------------------------------------------------------------------------------\n");
-  cout.form("SWARM Core debug dump\n\n");
+  cout << "-------------------------------------------------------------------------------\n";
+  cout << "SWARM Core debug dump\n\n";
 
-  cout.form("Registers:");
+  cout << "Registers:";
   for (int j = 0; j < 4; j++)
     {
-      for (int i = 0; i < 4; i++)
-	cout.form("   0x%08X", m_regsWorking[i + (j * 4)]);
-      cout.form("\n\t  ");
+      for (int i = 0; i < 4; i++) {
+	cout << "   ";
+	cout << hex << m_regsWorking[i + (j * 4)];
+      }
+      cout << "\n\t  ";
     }
-  cout.form("   0x%08X", m_regsWorking[16]);
+  cout << "   ";
+  cout << hex << m_regsWorking[16];
 
-  if (m_mode == M_FIQ)
-    cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], m_regsFiq[7]);
-  else if ((m_mode == M_USER) || (m_mode == M_SYSTEM))
-    cout.form("\n\n");
+  if (m_mode == M_FIQ) {
+    cout << "\tSPSR_";
+    cout << mode_str[m_mode & 0xF];
+    cout << "[";
+    cout << hex << m_regsFiq[7];
+    cout << "]\n\n";
+  } else if ((m_mode == M_USER) || (m_mode == M_SYSTEM))
+    cout << "\n\n";
   else
     {
       uint32_t* temp;
@@ -4060,31 +4069,50 @@
 	  temp = NULL; break; // ???
 	}
            
-      if (temp != NULL)
-	cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], temp[2]);
+      if (temp != NULL) {
+	cout << "\tSPSR_";
+	cout << mode_str[m_mode & 0xF]; 
+	cout << "[";
+	cout << hex << temp[2];
+	cout << "]\n\n";
+      }
     }
 
-  cout.form("Instruction Pipe (top is current instruction):\n");
+  cout << "Instruction Pipe (top is current instruction):\n";
   for (int i = 2; i > 0; i--)
     {
-      cout.form("\t0x%08X - ", m_iPipe[i]);
+      cout << "\t0x";
+      cout << hex << m_iPipe[i];
+      cout << " - ";
       memset(str, 0, 80);
       CDisarm::Decode(m_iPipe[i], str);
-      cout.form("%s\n", str);
+      cout << str;
+      cout << "\n";
     }
   if (m_busCurrent != NULL)
     {
-      cout.form("\t0x%08X - ", m_busCurrent->Din);
+      cout << "\t0x";
+      cout << hex << m_busCurrent->Din;
+      cout << " - ";
       memset(str, 0, 80);
       CDisarm::Decode(m_busCurrent->Din, str);
-      cout.form("%s (suspect if bad address error)\n", str);
+      cout << str;
+      cout << " (suspect if bad address error)\n";
     }
-  cout.form("Instruction Stage last executed - %d\n\n", m_nCtrlCur);
-  
-  cout.form("DIn reg = 0x%08X    DOut reg = 0x%08X   Addr reg = 0x%08X\n",
-	    m_regDataIn, m_regDataOut, m_regAddr);
+  cout << "Instruction Stage last executed - ";
+  cout << dec << m_nCtrlCur;
+  cout << "\n\n";
+  
+  cout << "DIn reg = 0x";
+  cout << hex << m_regDataIn;
+  cout << "    DOut reg = 0x";
+  cout << hex << m_regDataOut;
+  cout << "   Addr reg = 0x";
+  cout << hex << m_regAddr;
+  cout << "\n";
+  cout << dec;
 
-  cout.form("-------------------------------------------------------------------------------\n");
+  cout << "-------------------------------------------------------------------------------\n";
 }