Bugdom

AmigaOne X1000 platform specific issues related to Linux only.
Post Reply
User avatar
xeno74
Posts: 9277
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: 9277
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: 9277
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

Mario Locati has compiled Bugdom for Linux PPC64 with AltiVec support. :-)

Download: bugdom.linux-ppc64-with-altivec.deb
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9277
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: 9277
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: 9277
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
xeno74
Posts: 9277
Joined: Fri Mar 23, 2012 7:58 am

Re: Bugdom

Post by xeno74 »

xeno74 wrote: Sun Jun 04, 2023 7:39 am There are some graphical issues if you use Bugdom with ATi Radeon X19XX graphics cards.

Iliyas has created a patch for solving this issue.
Iliyas has improved this patch and added it to the Pomme (QuickDraw3D) source code. :-)

Link to the new patch: QD3D: Support 32-bit triangle point indices
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

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

Re: Bugdom

Post by xeno74 »

Hi All,

Jorio has released the new version 1.3.4 of Bugdom.

New:
  • Added support for 32-bit triangle point indices for ATi Radeon X19XX graphics cards to Pomme (QuickDraw3D)
  • Fixed framerate-dependent inconsistencies that were apparent at high framerates (100+ fps), including:
    • level 3: fish speed (after eating Rollie)
    • level 4: feet speed
    • level 5: fire effect on beehive
    • level 7: player speed when trapped in a ball of honey
    • level 8: tumbling boulder damage condition
  • More fitting cyclorama color in level 9 and 10 intros
  • macOS: Sonoma Game Mode support
  • macOS: Fix linear mouse acceleration mode that didn't always work
  • Windows: Fix rare bug if AppData\Local contains a file with a bad name encoding
  • Bump SDL to 2.28.5
I have compiled it for Linux PPC (32-bit).

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

Image

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

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

Re: Bugdom

Post by xeno74 »

xeno74 wrote: Fri Feb 09, 2024 7:08 pm Jorio has released the new version 1.3.4 of Bugdom.

New:
  • Added support for 32-bit triangle point indices for ATi Radeon X19XX graphics cards to Pomme (QuickDraw3D)
  • Fixed framerate-dependent inconsistencies that were apparent at high framerates (100+ fps), including:
    • level 3: fish speed (after eating Rollie)
    • level 4: feet speed
    • level 5: fire effect on beehive
    • level 7: player speed when trapped in a ball of honey
    • level 8: tumbling boulder damage condition
  • More fitting cyclorama color in level 9 and 10 intros
  • macOS: Sonoma Game Mode support
  • macOS: Fix linear mouse acceleration mode that didn't always work
  • Windows: Fix rare bug if AppData\Local contains a file with a bad name encoding
  • Bump SDL to 2.28.5
I have compiled it for Linux PPC64 too.

Download: Bugdom_1.3.4-linux-powerpc64.tar.gz

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

Running Linux on AmigaONEs can require some tinkering.
Post Reply