14 May 2021, 18:31 | #1 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
trying to display an AGA image...
I've converted a PNG image to raw data + copperlist and it doesn't work as well as it should
the image is shifted EDIT: thanks to Stingray, found out that one bitplane was missing. One error less. what I want to achieve the start of the pic is shifted (modulo issue?). this is exe + source code: ecs_aga_pic_test.zip There's an ECS (EHB) test that works perfect. The AGA test does not. That's my first AGA attempt so of course I screwed something up For the ones who are curious: I've got the supercars2 source code and got it running with a rebuild using OCS assets and files ripped off the original disks. I'd like to use DOS assets to pimp up the game to an AGA version: title screen, comm screens and more (colored enemy cars would be cool and/or more colors in backgrounds for instance). What's also planned: adding more tracks. Last edited by jotd; 14 May 2021 at 21:56. |
14 May 2021, 19:50 | #2 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
|
|
14 May 2021, 20:43 | #3 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
fmode is at 0. Setting 3 results in trashed display.But I'd like to be able to set FMODE to the fastest.
|
14 May 2021, 21:05 | #4 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
First observation: 40*240*8 = 76800. Your picture has a size of 67204 bytes (40*240*7 + 4 bytes (padding?)) so there's one bitplane missing!
|
14 May 2021, 21:12 | #5 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
correct! thanks a lot. The colors are now perfect. But the pic is still shifted. Check my edit.
|
14 May 2021, 21:20 | #6 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I have loaded your raw picture into a converter and it appears your source image is already shifted. How did you convert the image?
|
14 May 2021, 21:29 | #7 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Several things:
- Stringray beat me to it, raw image size doesn't match bitplane size times depth, it's too short - fetch mode is not set in the source, but you later mentioned you use 0. OK, 0 works but if you want to use 3 you have to set modulos to -8 (they are 0 now) and align the image address to a quadword (8 bytes), it's aligned to a longword at the moment. - image is not shifted for me (it looks fine other than the missing data), maybe it's something inherited from your workbench screen (one of $dffxxx registers) because you are setting up your copper in a quick&dirty way without LoadView(NULL) etc. |
14 May 2021, 21:36 | #8 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
great!
Code:
move.w #$FFF8,bpl1mod(a5) ; modulo de tous les plans = 40 move.w #$FFF8,bpl2mod(a5) move.w #3,fmode(a5) I have used LoadView(NULL) with same result. Edited first post with proper data (8 bitplanes) Last edited by jotd; 14 May 2021 at 21:57. |
14 May 2021, 22:07 | #9 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
I've loaded the AGA picture into piccon as 320x240x256col, and the green/red jacket guy is the last person on the right side, there is no red/blue shirt girl next to him, she is the first person on the left side of the image.
It looks like the actual data you load from disk is shifted, nothing wrong with code/copperlist. edit: Looking at your python script bitplanelib.py, the problem is that you have also included picture dimensions (4 bytes) at the start of AGA picture. That's causing the shift by 32 pixels. Last edited by a/b; 14 May 2021 at 22:19. |
14 May 2021, 22:20 | #10 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
As I have already said, the source data is shifted! Either your conversion process is wrong or something else caused the shift but it's not related to the code. And adjusting the modulo for FMODE > 0 is ugly, better adapt your DDFSTOP settings.
|
14 May 2021, 22:25 | #11 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
What I would do:
- realign the image: Code:
cnop 0,8 image_data: dcb.b 36,0 incbin "title256.raw" Code:
move.l #image_data+40,d1 Code:
move.w #$00b0,ddfstop(a5) ... move.w #$0,bpl1mod(a5) ; modulo de tous les plans = 40 move.w #$0,bpl2mod(a5) Code:
move.w #$20C1,diwstop(a5) ; la fenêtre écran ah!, and also remove this damn: Code:
clr.w copjmp1(a5) |
14 May 2021, 22:32 | #12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I'd rather fix the conversion instead of dealing with an incorrectly converted image, but to each his own I guess.
|
14 May 2021, 23:05 | #13 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
14 May 2021, 23:13 | #14 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
spot on! yeah my bitplanelib (that I had developped to hack AAOW to english) has a default option to include dimensions. I overlooked it! stupid
and the display stop worked perfect. Perfect pic now! thanks all |
14 May 2021, 23:14 | #15 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Hmm, now that's interesting. I haven't done any AGA coding, other than messing around with my old sources, in the last ~20 years and even back then it was pretty much setup a fmode 3 screen for c2p and call it a day. And pretty much any doc, aga coding guide, you name it back then said for fmode 1 or 2 you have to 32-bit align and subtract 4 from modulos, and for fmode 3 use 64-bit align and subtract 8 bytes. Which honestly didn't feel entirely intuitive to me but whatever, it worked. And that's how I always remembered it in some remote corner of my brain.
Now, if you think about it, this is not just a matter of ugliness... Does it actually mean overfetching and then correcting it via modulos? Because that's how it looks like compared to the suggested alternative. |
14 May 2021, 23:17 | #16 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
ECS mode is well documented, AGA was less documented because Commodore didn't want people to bang the metal directly... All AGA docs come from reverse engineering by hobbyists.
Personally I'm lost at DIWSTRT/STOP datafetch stuff. |
14 May 2021, 23:21 | #17 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
15 May 2021, 11:35 | #18 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
15 May 2021, 12:11 | #19 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
|
15 May 2021, 14:06 | #20 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GUI taskbar display - current inserted DF0 disk image | solarmon | support.WinUAE | 2 | 16 July 2020 21:46 |
Display HAM image in Blitz - left edge fringing? | Marle | Coders. Blitz Basic | 4 | 16 November 2018 01:49 |
Minor image centering bug in Double & Scanlines display setting | xxxxx | support.WinUAE | 4 | 07 December 2014 09:17 |
AGA display | Dela | support.WinUAE | 4 | 06 October 2002 21:59 |
|
|