Fast tile flipping on CD32
Hi all,
Does anyone know if there are any system calls I can make on a CD32 platform that will take a graphical tile and flip it on the X, Y or both axis? I have the CD32 developer documentation but for some reason I can't find anything specific to this Akiko chip and how to access it. I want to take a 32x32 pixel tile and flip it. Any help as always is really appreciated. Geezer |
Quote:
I do not know if it exists and in any case I imagine it would be slow.. Quote:
Around the x axis is very simple with both the cpu and the blitter (modulo is your friend). The alternative is to work completely in chunky, forgetting bitplanes and working only in bytes and then make the conversion with Akiko (that I have no idea how to program) or using one of the many chunky to planar routines available. Obviously the fastest thing is to use double the memory (or the triple if you want also the composite flips) with different copies of the same tile :D |
Quote:
|
Quote:
This code is wrong, see my post below for corrected version. Code:
move.l #$55555555,d1 |
3 Attachment(s)
Thanks for the suggestions guys, I guess i'm looking at doing it with the CPU.
There a couple of reasons I can't use memory, one being capacity and two complications. On the plus side I only need to do this flip when needed depending on what is in the Side Arms tile map. The other plus is that the scrolling only runs at 25 FPS so I should have plenty of time. I'll write the scroll routine over the next week or so, the challenge is getting all of the palettes to mesh together during scrolling without having to alter the arcade rom tile map - ugh. |
If there isn't enough memory for keeping mirrored copies of the same tile, then you might use some kind of graphical cache holding the last few ones that were used.
If you want to do that purely dynamic then the 256-byte table seems the best compromise. |
The good'ol' Side Arms! So underrated but also with some playability problems, would like to see it ported decently and improved from its original incarnation...
|
Quote:
However I will get a nice 8 way scrolling routine out of it supporting 16 or 32 pixel tile sets that I could use on other projects. |
Powder was using a scrolling trechnique similar to side arms and some tricks to run lot of stuff with 16 colors, have the source code if you want to give it a look
|
Quote:
|
Quote:
|
Quote:
This is a right version: (I have not thought that much if it can be optimized) Code:
move.l d0,d1 :great |
Quote:
Code:
move.l #$55555555,d1 |
Quote:
I haven't debugged or tried it yet but a short explanation of source data/dest would be really useful. Cheers, Geezer |
Quote:
Basically is like a SIMD approach because there is not carry between operations. Input D0 contains the 32 bits from a bitplane, output d0 the same bits flipped. |
Quote:
Quote:
|
Quote:
|
Quote:
Quote:
I like this because I can fit this in 68020 cache so it will go full speed. Appreciate it. |
Quote:
Thorham is a more optimized version based on eor property (i don't figure out a better optimization possible). At this point we need to test versus LUT, what will the winner be? |
Some non-scientific and quick tests.
Pure code seems slightly faster than this lazy bfextu 8bit LUT implementation: Code:
_lut8flip: Simple as: Code:
_lut16flip: suppose you have a lot of big AGA sprites (64x64,4planes) and also a lot of tiles (32x32,4/8planes) for a big total of 1MB of data, all to be flipped. In this case may be useful ;) (the waste becomes proportionally less and less significant, and CPU time is precious on 020..) But surely pure code, like Thorham suggested, is a great deal! [EDIT, PS] Why non-scientific? I do not have a CD32, nor an Amiga for that matter :sad So it's all based on the emulation of WinUAE which for 020 is not CE perfect (or it is for this simple code? well, it's not that important..). Also I had no will to write code other than bfextu and anyway the difference in speed between pure code and 8bit LUT does not seem significant enough to justify the exclusive use of LUT ;) |
All times are GMT +2. The time now is 19:17. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.