English Amiga Board


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

 
 
Thread Tools
Old 13 May 2021, 14:28   #1
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Image flipping/draw direction

Hi folks!

My current exercise is trying to flip/mirror an image so that it faces the other way. I've managed to successfully flip the pixels in the bytes, but the Blitter is drawing them in the wrong order.

As you can see from my test sprite/bob in the link below, the first image is the regular, un-flipped sprite, the second one is what I have at the moment with only the bytes reversed, and the third one is just the test sprite which was flipped in Dpaint and imported that way.

https://drive.google.com/file/d/1Xh7...ew?usp=sharing

When I did this on the Amstrad CPC I just set the horizontal screen drawing to "dec" instead of "inc" and it drew the bytes from right to left instead of left to right.

However, I can't quite figure out how to do this on the Amiga. I tried descending mode but that draws upward from the bottom right, and I think I need it to draw downward from the Top Right.

Would it be better to store the bytes in reverse order instead of just shunting them back into where they were after flipping?

Any advice would be great! Thanks!

Picture below
Brick Nash is offline  
Old 13 May 2021, 15:27   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Best way: do it with the CPU, you can find fast methods with a search on EAB.
Theoretically you can do it with the blitter too, but too slow and convoluted.

DESC mode is global, so what you want to do can't work.

You could, after having inverted the bits inside the word (not bytes!), copy in the front buffer one column at a time (using the modulo in an appropriate way for source and destination), but ... forget it ... flip the whole image at once and do a normal blit.
ross is offline  
Old 13 May 2021, 15:41   #3
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
You need to flip the byte order too for each line, as well as the bits within each byte
DanScott is offline  
Old 13 May 2021, 16:37   #4
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Thanks for the replies!

That's great, I wasn't sure which direction to go but that's made things clearer. I was fighting with the Blitter for a day or so there trying to get it to draw in the other direction, but I'll just focus on preparing a proper image for it.
Brick Nash is offline  
Old 13 May 2021, 23:08   #5
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
The thing you did on the CPC was reversing the direction of EITHER the source or destination pointer. When you set the blitter to DESC mode, you reverse the direction of both/all pointers
hooverphonique 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
Fast tile flipping on CD32 mcgeezer Coders. Asm / Hardware 32 07 August 2019 16:42
Workaround to X-Flipping issue found. No actual solution as yet. Brick Nash Coders. AMOS 12 13 October 2017 19:01
flipping through screens using middle mouse button Yulquen74 request.Apps 5 27 June 2014 21:31
A point in the right direction... vroom6sri New to Emulation or Amiga scene 15 26 November 2010 21:40
Flipping floppies Dave_wb support.Hardware 8 03 December 2006 12:36

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 16:30.

Top

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