English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 15 October 2010, 23:43   #1
Mequa
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);
	}
}
From my understanding, this code takes part of a 256-color palleted image in "chunky" format, and splits it into 8 bitplanes for display on emulated AGA hardware. It relies heavily on C/C++ bitwise operators to manipulate the bits.

My question is, why is it a "piece of crap"? And can anyone think of a better alternative?
Mequa is offline  
Old 16 October 2010, 21:29   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 22,950
It works but it is quite inefficient. (not that it does not really matter)
Toni Wilen is offline  
Old 16 October 2010, 23:31   #3
watertonian
2 1200s in Wisconsin
watertonian's Avatar
 
Join Date: Mar 2008
Location: Wisconsin, USA
Age: 42
Posts: 115
Send a message via AIM to watertonian Send a message via Yahoo to watertonian
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.
watertonian is offline  
Old 17 October 2010, 11:47   #4
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Quote:
Originally Posted by watertonian View Post
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?
Which CD32/AGA games actually make use of this? I believe Microcosm is one, and Gloom Deluxe also appears to support Akiko C2P (though works much better with RTG for emulation).

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.
Mequa is offline  
Old 17 October 2010, 12:57   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 22,950
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
Toni Wilen is offline  
Old 21 January 2012, 10:50   #6
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Update: Optimised Akiko Chunky-to-Planar emulation
Mequa 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
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

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 02:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06318 seconds with 13 queries