23 February 2018, 22:59 | #1 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
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! |
07 March 2018, 22:33 | #2 |
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?
|
07 March 2018, 23:13 | #3 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
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) |
08 March 2018, 06:36 | #4 |
Registered User
Join Date: Jun 2015
Location: Germany
Posts: 1,927
|
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.
|
08 March 2018, 08:14 | #5 |
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)
|
08 March 2018, 08:58 | #6 |
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) |
08 March 2018, 09:48 | #7 | |
Registered User
Join Date: Jun 2015
Location: Germany
Posts: 1,927
|
Quote:
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? |
|
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 |
|
|