+#else
+ numberOfLinks = 0;
+
+ OPDumpObjectList(olp);
+#endif
+}
+
+
+// To do this properly, we have to use recursion...
+void OPDumpObjectList(uint32 address)
+{
+ // Sanity checking: If we've already visited this link, bail out!
+ for(uint32 i=0; i<numberOfLinks; i++)
+ {
+ if (address == objectLink[i])
+ return;
+ }
+
+ objectLink[numberOfLinks++] = address;
+ uint8 objectType = 0;
+
+ do
+ {
+ uint32 hi = JaguarReadLong(address + 0, OP);
+ uint32 lo = JaguarReadLong(address + 4, OP);
+ objectType = lo & 0x07;
+ uint32 link = ((hi << 11) | (lo >> 21)) & 0x3FFFF8;
+ WriteLog("%08X: %08X %08X %s", address, hi, lo, opType[objectType]);
+
+ if (objectType == 3)
+ {
+ uint16 ypos = (lo >> 3) & 0x7FF;
+ uint8 cc = (lo >> 14) & 0x07; // Proper # of bits == 3
+ WriteLog(" YPOS=%u, CC=%s, link=$%08X", ypos, ccType[cc], link);
+
+ // Recursion needed to follow all links!
+ WriteLog("\n");
+ OPDumpObjectList(address + 8);
+
+ // Do the sanity check after recursive call: We may have already seen this...
+ // Sanity checking: If we've already visited this link, bail out!
+//disnowok: we added ourself above
+// for(uint32 i=0; i<numberOfLinks; i++)
+// {
+// if (address == objectLink[i])
+// return;
+// }
+ }
+
+ WriteLog("\n");
+
+ if (objectType == 0)
+ DumpFixedObject(OPLoadPhrase(address + 0), OPLoadPhrase(address + 8));
+
+ if (objectType == 1)
+ DumpScaledObject(OPLoadPhrase(address + 0), OPLoadPhrase(address + 8),
+ OPLoadPhrase(address + 16));
+
+ if (address == link) // Ruh roh...
+ {
+ // Runaway recursive link is bad!
+ WriteLog("***** SELF REFERENTIAL LINK *****\n\n");
+ return;
+ }
+
+ address = link;
+ objectLink[numberOfLinks++] = address;
+ }
+ while (objectType != 4);