English Amiga Board


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

 
 
Thread Tools
Old 14 June 2014, 00:21   #1
ovale
Registered User

 
Join Date: Jun 2014
Location: milan / italy
Posts: 154
Hflip and capital punishment

Hello

This link says the game has a special blob routine performing hflip on the fly
http://clickboom.com/capitalpunishment/faq.shtml#tech

Is it possible? How?

Thanks!
ovale is offline  
Old 19 June 2014, 21:34   #2
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
even AMOSPro can do this, i never measured how fast it was though.

it would take several blits I think to hflip an image, or the CPU could do it with the help of look-up tables.
Mrs Beanbag is offline  
Old 20 June 2014, 17:05   #3
ovale
Registered User

 
Join Date: Jun 2014
Location: milan / italy
Posts: 154
Quote:
Originally Posted by Mrs Beanbag View Post
it would take several blits I think to hflip an image, or the CPU could do it with the help of look-up tables.
Exactly, this is what I read too on the web
and this is the reason I was so interested in a fast way to hflip blobs...

After all it would mean halve the memory for blobs in some games...

I hoped for some magic ..
ovale is offline  
Old 20 June 2014, 18:01   #4
Gunnar
Registered User

 
Join Date: Apr 2014
Location: Germany
Posts: 154
Quote:
Originally Posted by ovale View Post
Exactly, this is what I read too on the web
and this is the reason I was so interested in a fast way to hflip blobs...

After all it would mean halve the memory for blobs in some games...

I hoped for some magic ..

A HFLIP is a mirror on the horizontal = X achis right?

Flipping on the X-achis is no problem just count down instead up with the modulo
Gunnar is offline  
Old 20 June 2014, 19:02   #5
ovale
Registered User

 
Join Date: Jun 2014
Location: milan / italy
Posts: 154
Quote:
Originally Posted by Gunnar View Post
A HFLIP is a mirror on the horizontal = X achis right?

Flipping on the X-achis is no problem just count down instead up with the modulo
Ummm... Modulo is applied every line, so it can be used only to flip vertically.

Even if you use the reverse mode the blitter doesn't flip each single word.
ovale is offline  
Old 21 June 2014, 20:12   #6
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
reverse mode reverses both source and data anyway so it wouldn't be any help.

I'm guessing it relies on the fact that the player doesn't switch directions too often though, and stores the "flipped" version permanently until it needs to be flipped again, instead of flipping it every time it is drawn.
Mrs Beanbag is offline  
Old 21 June 2014, 22:59   #7
ovale
Registered User

 
Join Date: Jun 2014
Location: milan / italy
Posts: 154
This is definitivelly possible. It is trading fill rate for animation quality.

I guess this impacts the game play since to flip the animations takes time and therefore some moves are not available immediatly after changing orientation.

I have to try the game and see if it is true.
ovale is offline  
Old 22 June 2014, 10:53   #8
Gunnar
Registered User

 
Join Date: Apr 2014
Location: Germany
Posts: 154
off topic side note:

The Coldfire/68K cores have a CPU instruction which does a LEFT/RIGHT flip.
Its called BITREV.

This instruction makes coding this real easy.
Gunnar is offline  
Old 04 February 2015, 15:47   #9
Nekoniaow
Banned

 
Join Date: Dec 2014
Location: Montreal
Posts: 129
Quote:
Originally Posted by ovale View Post
This is definitivelly possible. It is trading fill rate for animation quality.

I guess this impacts the game play since to flip the animations takes time and therefore some moves are not available immediatly after changing orientation.

I have to try the game and see if it is true.
Did you end up doing hflips on the go in the end?

Hflip is one of those things which could have been implemented for an insignificant hardware cost but that the Amiga designers did somehow not include. (Scaling and negative/fractional modulos are another.)

I have been thinking that it might be possible to do some crude flipping using the Blitter with all three sources pointing to the same address but with different masks and shift values so that the masked bits of a source will lie at a different place at the destination.
Problems are that you can only work on a one word column at a time otherwise you will end up mixing bits of successive words together; and you need several passes before all bits are inverted. And of course it's dog slow since it uses all four channels, despite the three sources being identical (another missed Blitter optimization opportunity).
Nekoniaow is offline  
Old 04 February 2015, 15:58   #10
ovale
Registered User

 
Join Date: Jun 2014
Location: milan / italy
Posts: 154
No, I didn't try.
In the moment it was not in the fly I lost interest. Just advertisement.

I think you can hflip with 4 blits. Yes is not cheap.

And you are absolutely right that the Amiga Blitter could have been much better with just few tweaks.
ovale is offline  
Old 08 February 2015, 16:12   #11
dansauk
 
Posts: n/a
What we did at Core (for Wolfchild if I remember correctly, and possibly other games) is...

To store half of the sprite flipped one way, and the other half flipped the other.

So for a 16 pixel high sprite, the top 8 pixels are flipped.

When drawing, you only then have to flip half the sprite (either the top of the bottom) depending on which way you want the sprite to face.

You can use a 256 byte lookup table for flipping the bytes (or a 64k for flipping words)
 
Old 08 February 2015, 16:43   #12
dlfrsilver
CaptainM68K-SPS France
dlfrsilver's Avatar
 
Join Date: Dec 2004
Location: Melun nearby Paris/France
Age: 41
Posts: 7,825
Send a message via MSN to dlfrsilver
welcome dansauk And thanks for sharing these informations
dlfrsilver 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
Capital Punishment on HD bull4342 support.WinUAE 13 28 December 2010 23:42
capital punishment stuntpup support.Games 11 04 September 2007 20:44
Capital Punishment formater support.Games 5 08 June 2007 08:44
Capital Punishment staticgerbil Retrogaming General Discussion 12 26 May 2003 23:15
Capital Punishment colin2712 support.Games 0 10 February 2002 02:25

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 13:24.


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