English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 December 2013, 12:54   #1
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
WarpOS MiniGL blues.

Hello fellow coders:

I've been playing with the old Minigl static lib for months, trying to compile programs like BlitzQuake-GL or whatever GL code related for that Warpos lib. Reading old threads, gl-BQuake on Warpos leads to a crash in some systems (seems to be no problems with Mediator + Voodoo gfx, only on BVision ones). The same happens with vertex array demos from the library. No problem at all with 68k lib.
Depending on the code, you get a full hang or a "memory protection violation - Access 000000CE" exception.
So I tested some Warp3D code and found that if you use a classic function like :

Code:
void DrawThings(vertex  *P,W3D_Texture *tex)
{
void *VertexPointer;
void *TexCoordPointer;
void *ColorPointer;
UWORD stride=sizeof(vertex);
UWORD off_v,off_w;

	VertexPointer=	(void *)&(P->x);
	TexCoordPointer=(void *)&(P->u);
	ColorPointer=	(void *)&(P->RGBA);
	off_v=(UWORD)( (ULONG)&(P->v) - (ULONG)&(P->u));
	off_w=(UWORD)( (ULONG)&(P->w) - (ULONG)&(P->u));
	W3D_VertexPointer(context,VertexPointer,stride,W3D_VERTEX_F_F_F, 0);
	W3D_TexCoordPointer(context,TexCoordPointer,stride,0,off_v,off_w,W3D_TEXCOORD_NORMALIZED);
	W3D_ColorPointer(context,ColorPointer,stride,W3D_COLOR_UBYTE ,W3D_CMODE_RGBA,0);

        W3D_LockHardware(context);		
		W3D_BindTexture(context,0,tex);
		W3D_DrawArray(context,W3D_PRIMITIVE_TRISTRIP,0,4);
	W3D_UnLockHardware(context);
		
}
and if you call it with a NULL parameter instead of a texture pointer (tex), you hang the system. No problem if it is 68k code.
Documentation says that you can "unbind" a texture with W3D_BindTexture(context,0,NULL).

Of course, you can bridge the code checking if a NULL is given to "tex", or do another function for drawing something without textures.

MiniGL lib has nothing like W3D_BindTexture, it changes the "context" of Warp3D directly (if I understand what I read on it). Still the code checks for those NULL parameters, but....



Related to that, all code made works on.....Morphos 1.4 powerup (the old trick to copy all W3D libraries) (a better check for unaligned data?)

Any ideas ? Somebody fixed that ? ( proper envs: for W3D?, its W3DPPC.library or W3D_PermediaPPC.library ?, ugly MiniGL ?).

Cheers.

Last edited by Cowcat; 04 December 2013 at 13:39.
Cowcat is offline  
Old 29 December 2013, 20:44   #2
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
UPDATE:

Found the weird thing: In MGLInitContext from context.c , context->w3dContext->TPFlags[0] = W3D_TEXCOORD_NORMALIZED, is what crashed the system. Someway to fix this is giving a "0" value and then on vertexarray.c & vertexelements.c proceed like this:

Code:
vertexarray.c    

at  GLDrawArrays

if(context->Texture2D_State[0] == GL_TRUE)
   {
      Set_W3D_Texture(context->w3dContext, 0, context->w3dTexBuffer[context->CurrentBinding]);
   }
   else
   {
      Set_W3D_Texture(context->w3dContext, 0, NULL);
   }

fix: 

if(context->Texture2D_State[0] == GL_TRUE)
   {
      Set_W3D_Texture(context->w3dContext, 0, context->w3dTexBuffer[context->CurrentBinding]);
      context->w3dContext->TPFlags[0] = W3D_TEXCOORD_NORMALIZED;
   }
   else
   {
      Set_W3D_Texture(context->w3dContext, 0, NULL);
      context->w3dContext->TPFlags[0] = 0;
   
   }

same goes for vertexelements.c.
Now all demos like varray.c, etc, work.

But For BlitzQuake it didn't work


Anyway: I fixed BlitzQuakeWOS (I was wrong, it wasn't minigl). Recompiled a new version with added code from other quake amiga sources. For those who never could run the original I will post the "updated" version if it is requested.

Happy New Year
Cowcat is offline  
Old 29 December 2013, 23:08   #3
DDNI
Targ Explorer
 
DDNI's Avatar
 
Join Date: Mar 2006
Location: Northern Ireland
Posts: 5,431
Send a message via ICQ to DDNI Send a message via MSN to DDNI
Excellent. Great to read about more people continuing to work on these things. Thanks and happy new year!
DDNI is offline  
Old 29 December 2013, 23:15   #4
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
Please post it!
Is there any speed gained using MorphOS 1.4 PUP vs. basic WB 3.9?
Bamiga2002 is offline  
Old 29 December 2013, 23:35   #5
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
Thanks mates. On MorphOS 1.4 it gets 2 more frames In fact BlitzQuake Wos original you get one + (3) (its a gcc compiled version, mine is vbcc but the sound it's better)

I used the original Blitz source and used Quake AGA/CGX sources for better sound & tweeks (really a "copy paste" + nightmares i'm not a coder )
Cowcat is offline  
Old 30 December 2013, 08:42   #6
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
I'll give it a run .
Btw. where to get MOS 1.4 PUP? I'd like to try it out.
Bamiga2002 is offline  
Old 30 December 2013, 09:29   #7
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
Here: http://powerup.morphos-team.net/ It's a little tricky to work: Basically you make a sfs partition, copy the whole cd in it and edit the boot script. But it is a little tricky to get to run: You need to mod the startup-sequence file in other way than its written. I'll post my own.
Cowcat is offline  
Old 30 December 2013, 11:41   #8
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
Aah feck! That's why I gave up earlier on this: I don't have a G-Rex, but a Mediator...
Bamiga2002 is offline  
Old 30 December 2013, 21:36   #9
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
I tested with my setup (Mediator+Voodoo3) powered with my FullWin-patch running 2 times each exe on "timedemo demo1" and results are:

blitz: 37.7 fps
vbcc: 34.0 fps
vbcc2: 36.8 fps

vbcc2-version gained speed nicely over vbcc-version but lost a little to original blitz-version.

But the main thing is that this works for those that never got it working right?
Bamiga2002 is offline  
Old 30 December 2013, 23:53   #10
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
To me is like going to Mars (more than 30 fps? ). I'm on the lower budget = blizzppc 175mhz + bvision (half busted)...

Thanks for testing !!
Cowcat is offline  
Old 31 December 2013, 12:10   #11
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
Stachu made it happen! Over 2x the mhz of your ppc lol ok enough bragging
What's wrong with your BVision?
Great to see someone is interested in improving a classic ppc game.
Bamiga2002 is offline  
Old 31 December 2013, 12:54   #12
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
I have to try FullWin-Patch. On this subject, I can (most than probably ) mod the code to clear the mouse pointer and remove window border + gadgets. Don't know if I can save CPU cycles, but I would add that as an option . Plus try to gain more optimizations.


Oks, "my bvision": Since I bought it more than a decade ago, I never could play W3D apps on full screen: Major texture problems and funny colors. Probably a low voltage or heat related.
That's why I need to add "the new option" )
Cowcat is offline  
Old 07 January 2014, 05:55   #13
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
Maybe you need to adjust the screenmodes, it's made for mediator but maybe create a 15-bit and a 16-bit screenmode and switch between them.
Let me know when you try or have any results
Bamiga2002 is offline  
Old 07 January 2014, 20:04   #14
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
Unlikely a problem with screenmodes. Switching to a lower resolution WB as FullWin does,aliviates a little, but the problem starts to appear later. The bigger the WorkBench the sooner you start to see "things". It's not only with W3D, it happens when you have diropus in one screen and some text program behind it. I'll post more of those problems on Blizzard PPC Club.
Cowcat is offline  
Old 22 February 2014, 17:30   #15
Michael
A1260T/PPC/BV/SCSI/NET
 
Michael's Avatar
 
Join Date: Jan 2013
Location: Moscow / Russia
Posts: 839
Very nice, finally got this GLQuake brunch working on my BVisionPPC, works perfectly and fast. 20-30 fps in 512x384 mode.
Michael is offline  
Old 22 February 2014, 18:34   #16
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
Perfect mate. Got the last build (number 4)? Wait for the "5th" update: Made some work on old bugs that crippled all glquakes, more optimizations and kind help & code from MattHey. We try to make the most robust Quake & faster than old gcc one (both for 68k & WOS).
Cowcat is offline  
Old 22 February 2014, 18:44   #17
Michael
A1260T/PPC/BV/SCSI/NET
 
Michael's Avatar
 
Join Date: Jan 2013
Location: Moscow / Russia
Posts: 839
Bummer, I am viewing the wrong thread! Moving to the other one with updates ;-)
Michael is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
BlitzQuake_wos.lha GLquake & GLqwcl for WOS (MiniGL/Warp3D) CRASH!!! keropi support.Apps 21 24 February 2014 04:06
Building WarpOS binaries on classic / 3.x mousehouse Coders. General 8 31 January 2012 16:52
SiN WarpOS/PPC Game fitzsteve request.Old Rare Games 7 03 May 2011 10:19
LHA v2.11 for WarpOS available on Aminet! keropi Amiga scene 8 16 March 2006 02:29
ppc.library and WarpOS oldpx support.Apps 5 23 August 2002 16:57

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:28.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11467 seconds with 15 queries