English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 23 February 2018, 22:59   #1
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 676
90deg Rotating C2P function

Is there a well established (fast ) c2p Routine available that would do 90deg rotation of the image at the same time? Ideally it should be 030 optimized.

Thanks!
pipper is offline  
Old 07 March 2018, 22:33   #2
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
I don't know of one myself, but, what are you going to use it for, if you did come across one? What's the purpose of the 90-degree rotation?
Kalms is offline  
Old 07 March 2018, 23:13   #3
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 676
I am currently porting ADoom and DoomAttack to bebbo’s GCC toolchain. The way the doom engine draws the world is mostly vertical. This means writes to the chunky buffer are mostly disjoint and you’ll need to add an offset to the output address for each pixel. Drawing the world 90deg rotated could speed up the inner loops. If the counter rotation happens during the C2P conversion for free(?) it could be a net gain.

Other rendering engines like voxelspace could profit most (doom still needs to write the floors and ceilings in the other orientation)
pipper is offline  
Old 08 March 2018, 06:36   #4
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,924
It can't be free because if you don't want to read and/or write multiple times for the same group of pixels, you would have to keep 32x32 pixels in processor registers during the conversion which is not possible on the 68k. Thus, you will spend many times what you were saving in another place.
grond is offline  
Old 08 March 2018, 08:14   #5
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
It may be possible to do the 90 degree rotation in a separate pass, before the actual c2p conversion. If you make two versions of the game - one which draws the graphics vertically, and one which draws it horizontally, and measure the time rendering takes in each case, we can then reason around how feasible it is to build a 90-degree rotation pass. (At a minimum it will need to read and write the entire chunkybuffer at ~30mb/s, plus time spent for about 1.5 merges)
Kalms is offline  
Old 08 March 2018, 08:58   #6
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Britelite did something to this extend with his Wolf3D preview:
http://eab.abime.net/showthread.php?t=90115&page=3 Post 49.

Ofcourse this is done on a lower resolution with only 16 colors and with the blitter, so might not be that usefull for a doom port.

And this is not a free "well established" C2P rutine, so you would have to disassemble to see the workings of it. (or ask)
LaBodilsen is offline  
Old 08 March 2018, 09:48   #7
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,924
Quote:
Originally Posted by Kalms View Post
It may be possible to do the 90 degree rotation in a separate pass, before the actual c2p conversion.
Yes, this could be done on groups of 4x4 pixels reading four longs and writing four longs. This could probably be as fast on 060 type processor as doing another mem copy pass of the chunky buffer.

However, I'm still not clear whether you really gain anything worth the effort. What do you save? An ADD operation instead of a free post-increment. Definitely not worth it. Doing all possible byte, word, long variants of the drawing routine depending on y_start modulo 4 seems complex but possible. But I'm not sure you would save much with that.

Caching strategies seem more relevant. How much effect will being able to do burst-writes of entire cache lines to mem have? I guess with just 8k of cache and a 64K chunky buffer, this will have quite some impact. But what about ceilings and floors drawn horizontally in Doom? Can you do two passes with a first one drawing all walls, then rotate the buffer and proceed to drawing all ceilings and floors?
grond 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
[Found: Road To Hell] Looking for a racing game which had a 3d rotating mouse pointer gulliver Looking for a game name ? 6 10 August 2017 14:17
Demo name? - Talking fish/human faces in tank & rotating Coke can Higgy request.Demos 0 08 May 2017 09:54
Rotating cube getting cutoff Knocker Coders. Asm / Hardware 2 07 September 2016 08:13
Any C2P experts here? oRBIT Coders. General 36 27 April 2010 07:26
C2P....help! NovaCoder Coders. General 8 17 December 2009 00:15

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 22:57.

Top

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