15 October 2010, 23:43 | #1 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Akiko Chunky-to-Planar conversion
Having looked through the WinUAE sources to see how WinUAE handles CD32 Akiko Chunky-to-Planar conversion, I noticed that Toni seemed dissatisfied with the choice of algorithm employed for this purpose.
From akiko.cpp: Code:
static void akiko_c2p_do (void) { int i; for (i = 0; i < 8; i++) akiko_result[i] = 0; /* FIXME: better c2p algoritm than this piece of crap.... */ for (i = 0; i < 8 * 32; i++) { if (akiko_buffer[7 - (i >> 5)] & (1 << (i & 31))) akiko_result[i & 7] |= 1 << (i >> 3); } } My question is, why is it a "piece of crap"? And can anyone think of a better alternative? |
16 October 2010, 21:29 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
It works but it is quite inefficient. (not that it does not really matter)
|
16 October 2010, 23:31 | #3 |
2 1200s in Wisconsin
|
If WinUAE works on mostly chunky H/W, or at least a chunky-based API (OpenGL or DirectX, can't remember WinUAE too much since using Ubuntu), I'd think the Akiko routines would be better served by a pass-through of some sort? Might explain why the original method is "crappy", because converting chunky to planer and back to chunky would be a pain.
|
17 October 2010, 11:47 | #4 | |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Quote:
A pass-through method works for RTG, but as far as I'm aware, Akiko's C2P is used to produce images displayable with the AGA chipset, which are then (potentially) subject to whatever bitplane-based modifications, copper effects and suchforth the programmer wishes to use before being outputted - as with any (emulated) AGA display. So chunky -> planar -> chunky conversion would likely be required for full compatibility. A pass-through option (as e.g. a "faster but less compatible Akiko emulation" tickbox) MIGHT potentially work in some cases though, and would be much faster. Perhaps it could speed up some CD32 games on slower PCs such as netbooks. But I'm not Toni, so can't really comment on the feasibility of such a method. |
|
17 October 2010, 12:57 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Akiko C2P is single long-word size register, program writes max 8 longs and then reads 8 longs back (quite stupid design, isn't it?)
You don't know what the program is attempting to do with the data, it might not be for real or display C2P but some other weird bit manipulation.. Either patch the application, replace WriteChunkPixels() gfx.library routine or use RTG |
21 January 2012, 10:50 | #6 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Optimised Akiko Chunky-to-Planar emulation | Mequa | support.WinUAE | 9 | 05 February 2012 02:47 |
Amiga Bitplanes & Planar vs Chunky - Technical Expert Required | CodyJarrett | project.APoV | 4 | 12 November 2009 11:14 |
Chunky to planar | pmc | Coders. Tutorials | 11 | 15 September 2009 16:20 |
Chunky to planar on a500 | Alter | Coders. General | 28 | 10 April 2007 02:53 |
|
|