Bugdom

AmigaOne X5000 platform specific issues related to Linux only.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Bugdom

Post by xeno74 »

Hi All,

Jorio has added PowerPC support to Bugdom. :-)
Bugdom is a 1999 Macintosh game by Pangea Software. You play as Rollie McFly, a pill bug on a quest to save ladybugs from King Thorax’s iron grip on the Bugdom.

The game was bundled with some Mac models of the era.
Further information:
I compiled it for Linux PPC (32-bit) today. It works with Void PPC, MintPPC, Fienix etc.

Download: Bugdom_1.3.3-linux-powerpc.tar.gz

Image

Have a lot of fun with Bugdom! :-)

Cheers,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

Bugdom icon:

Image
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

New Pangea games icon pack:

Image

Download: Pangea_games_icons_new.zip
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

Hi Skateman,

Bugdom works without any problems with my AMD Radeon HD 6970 (CAYMAN - OpenGL 3.1/3.2).

Unfortunately Bugdom has graphical issues with my ATi Radeon X1950 PRO Extreme (ATI RV570 - OpenGL 2.1).

Could you please test Bugdom with your ATi Radeon X1900 XT (ATI R580 - OpenGL 2.1)?

Maybe Bugdom needs OpenGL 3.0 or higher.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 858
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Bugdom

Post by Skateman »

My textures are broken using my ATI X1900.

Image

Big picture https://www.skateman.nl/wp-content/uplo ... -32-52.png

This seem to be the issue with most games at the moment.
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

Skateman wrote: Sat Apr 29, 2023 11:38 am My textures are broken using my ATI X1900.

This seem to be the issue with most games at the moment.
Thank you for testing. Yes, there are graphical issues in some games if you use ATi Radeon X1900 and X1950 graphics cards. :-(
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 858
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Bugdom

Post by Skateman »

Nanosaur has the same issues as Bugdom.. but Billy Frontier is working fine.

viewtopic.php?p=56843#p56843

I was in the impression that all those titles had the same way of processing graphics..
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

There are some graphical issues if you use Bugdom with ATi Radeon X19XX graphics cards.

Iliyas has created a patch for solving this issue.

bugdom-32bit-triangle-arrays.patch:

Code: Select all

Submodule extern/Pomme contains modified content
diff --git a/extern/Pomme/src/QD3D/3DMFParser.cpp b/extern/Pomme/src/QD3D/3DMFParser.cpp
index 75be008..0bbba75 100644
--- a/extern/Pomme/src/QD3D/3DMFParser.cpp
+++ b/extern/Pomme/src/QD3D/3DMFParser.cpp
@@ -328,9 +328,7 @@ void Q3MetaFileParser::Parse_tmsh(uint32_t chunkSize)
 	}
 	else
 	{
-		static_assert(sizeof(TQ3TriMeshTriangleData::pointIndices[0]) == 2);
-		Assert(false, "Meshes exceeding 65535 vertices are not supported");
-		//ReadTriangleVertexIndices<uint32_t>(f, numTriangles, currentMesh);
+		ReadTriangleVertexIndices<uint32_t>(f, numTriangles, currentMesh);
 	}
 
 	// Ensure all vertex indices are in the expected range
diff --git a/extern/Pomme/src/QD3D/QD3D.cpp b/extern/Pomme/src/QD3D/QD3D.cpp
index 0b21fe6..9b815bf 100644
--- a/extern/Pomme/src/QD3D/QD3D.cpp
+++ b/extern/Pomme/src/QD3D/QD3D.cpp
@@ -232,9 +232,9 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 {
 	struct Edge
 	{
-		int a;
-		int b;
-		int midpoint;
+		TQ3PointIndex a;
+		TQ3PointIndex b;
+		TQ3PointIndex midpoint;
 	};
 
 	std::map<uint32_t, Edge> edges;
@@ -254,8 +254,8 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 
 		for (int e = 0; e < 3; e++)
 		{
-			int edgeP0 = triangle.pointIndices[e];
-			int edgeP1 = triangle.pointIndices[(e+1) % 3];
+			TQ3PointIndex edgeP0 = triangle.pointIndices[e];
+			TQ3PointIndex edgeP1 = triangle.pointIndices[(e+1) % 3];
 			if (edgeP0 > edgeP1)
 			{
 				int swap = edgeP0;
@@ -271,7 +271,7 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 			}
 			else
 			{
-				edges[edgeHash] = { edgeP0, edgeP1, -1 };
+				edges[edgeHash] = { edgeP0, edgeP1, (TQ3PointIndex) -1 };
 				triangleEdges[t*3 + e] = &edges[edgeHash];
 				numDistinctEdges++;
 			}
@@ -281,8 +281,8 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 	//-------------------------------------------------------------------------
 	// Reallocate mesh
 
-	int numPointsWritten		= oldNumPoints;
-	int numTrianglesWritten		= oldNumTriangles;
+	TQ3PointIndex numPointsWritten	= oldNumPoints;
+	int numTrianglesWritten			= oldNumTriangles;
 
 	mesh->numTriangles *= 4;
 	mesh->numPoints += numDistinctEdges;
@@ -353,12 +353,12 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 		   A        ^        C
 		*/
 
-		uint16_t A		= triangle.pointIndices[0];
-		uint16_t B		= triangle.pointIndices[1];
-		uint16_t C		= triangle.pointIndices[2];
-		uint16_t A2B	= triangleEdges[t*3 + 0]->midpoint;
-		uint16_t B2C	= triangleEdges[t*3 + 1]->midpoint;
-		uint16_t C2A	= triangleEdges[t*3 + 2]->midpoint;
+		TQ3PointIndex A		= triangle.pointIndices[0];
+		TQ3PointIndex B		= triangle.pointIndices[1];
+		TQ3PointIndex C		= triangle.pointIndices[2];
+		TQ3PointIndex A2B	= triangleEdges[t*3 + 0]->midpoint;
+		TQ3PointIndex B2C	= triangleEdges[t*3 + 1]->midpoint;
+		TQ3PointIndex C2A	= triangleEdges[t*3 + 2]->midpoint;
 
 		mesh->triangles[numTrianglesWritten++]	= {{A2B, B, B2C} };
 		mesh->triangles[numTrianglesWritten++]	= {{B2C, C, C2A} };
@@ -372,5 +372,5 @@ void Q3TriMeshData_SubdivideTriangles(TQ3TriMeshData* mesh)
 	delete[] triangleEdges;
 
 	Assert(numTrianglesWritten == 4*oldNumTriangles, "unexpected number of triangles written");
-	Assert(numPointsWritten == oldNumPoints + (int)edges.size(), "unexpected number of points written");
+	Assert(numPointsWritten == oldNumPoints + edges.size(), "unexpected number of points written");
 }
diff --git a/extern/Pomme/src/QD3D/QD3D.h b/extern/Pomme/src/QD3D/QD3D.h
index 295f631..2022a94 100644
--- a/extern/Pomme/src/QD3D/QD3D.h
+++ b/extern/Pomme/src/QD3D/QD3D.h
@@ -266,10 +266,12 @@ typedef struct TQ3PlaneEquation
 	float                                       constant;
 } TQ3PlaneEquation;
 
+typedef uint32_t TQ3PointIndex;
+
 // WARNING: this structure differs from QD3D (indices were originally 32-bit)
 typedef struct TQ3TriMeshTriangleData
 {
-	uint16_t									pointIndices[3];
+	TQ3PointIndex								pointIndices[3];
 } TQ3TriMeshTriangleData;
 
 // This structure differs from QD3D.
diff --git a/src/QD3D/Pick.c b/src/QD3D/Pick.c
index f039eea..91e2aa3 100644
--- a/src/QD3D/Pick.c
+++ b/src/QD3D/Pick.c
@@ -86,7 +86,7 @@ bool PickObject(int mouseX, int mouseY, int32_t *pickID)
 
 			for (int t = 0; t < mesh->numTriangles; t++)
 			{
-				const uint16_t* pointIndices = mesh->triangles[t].pointIndices;
+				const TQ3PointIndex* pointIndices = mesh->triangles[t].pointIndices;
 				const TQ3Point3D* p0 = &transformedPoints[pointIndices[0]];
 				const TQ3Point3D* p1 = &transformedPoints[pointIndices[1]];
 				const TQ3Point3D* p2 = &transformedPoints[pointIndices[2]];
diff --git a/src/QD3D/QD3D_Geometry.c b/src/QD3D/QD3D_Geometry.c
index 5fcc1c6..5388325 100644
--- a/src/QD3D/QD3D_Geometry.c
+++ b/src/QD3D/QD3D_Geometry.c
@@ -243,8 +243,8 @@ void QD3D_MirrorMeshesZ(ObjNode* theNode)
 		// Invert triangle winding
 		for (int t = 0; t < mesh->numTriangles; t++)
 		{
-			uint16_t* triPoints = theNode->MeshList[meshID]->triangles[t].pointIndices;
-			uint16_t temp = triPoints[0];
+			TQ3PointIndex* triPoints = theNode->MeshList[meshID]->triangles[t].pointIndices;
+			TQ3PointIndex temp = triPoints[0];
 			triPoints[0] = triPoints[2];
 			triPoints[2] = temp;
 		}
@@ -282,7 +282,7 @@ static void ExplodeTriMesh(
 
 		TQ3TriMeshData* sMesh = shard->mesh;
 
-		const uint16_t* ind = inMesh->triangles[t].pointIndices;		// get indices of 3 points
+		const TQ3PointIndex* ind = inMesh->triangles[t].pointIndices;		// get indices of 3 points
 
 				/*********************/
 				/* INIT TRIMESH DATA */
diff --git a/src/QD3D/Renderer.c b/src/QD3D/Renderer.c
index d7f9757..d1a6c02 100644
--- a/src/QD3D/Renderer.c
+++ b/src/QD3D/Renderer.c
@@ -847,7 +847,7 @@ static void SendGeometry(const MeshQueueEntry* entry)
 	}
 
 	// Draw the mesh
-	glDrawElements(GL_TRIANGLES, mesh->numTriangles*3, GL_UNSIGNED_SHORT, mesh->triangles);
+	glDrawElements(GL_TRIANGLES, mesh->numTriangles*3, GL_UNSIGNED_INT, mesh->triangles);
 	CHECK_GL_ERROR();
 
 	// Pass 2 to draw transparent meshes without face culling (see above for an explanation)
@@ -857,7 +857,7 @@ static void SendGeometry(const MeshQueueEntry* entry)
 		glCullFace(GL_BACK);	// pass 2: draw frontfaces (cull backfaces)
 
 		// Draw the mesh again
-		glDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->triangles);
+		glDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_INT, mesh->triangles);
 		CHECK_GL_ERROR();
 	}
 }

Instructions for patching and compiling:
  1. Code: Select all

    git clone --recurse-submodules https://github.com/jorio/Bugdom
  2. Code: Select all

    mv Bugdom a
  3. Code: Select all

    patch -p0 < bugdom-32bit-triangle-arrays.patch
    Output:

    Code: Select all

    patching file …
    
  4. Code: Select all

    cd a
  5. Code: Select all

    cmake -S . -B build
  6. Code: Select all

    cmake --build build
  7. Code: Select all

    cd build
  8. Code: Select all

    ./Bugdom
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

I compiled it with Jorio's new patch today.

Download: Bugdom_1.3.3-2-linux-powerpc.tar.gz

Please test it.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 858
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Bugdom

Post by Skateman »

Yess,

The patched version of Bugdom is also running fine!!
Best thing is that we now know where this issue is coming from

Image

big picture https://www.skateman.nl/wp-content/uplo ... -46-55.png
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
Post Reply