trying to display an AGA image...
3 Attachment(s)
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. Attachment 71927 what I want to achieve Attachment 71919 the start of the pic is shifted (modulo issue?). this is exe + source code: Attachment 71928 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. |
Quote:
|
fmode is at 0. Setting 3 results in trashed display.But I'd like to be able to set FMODE to the fastest.
|
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!
|
correct! thanks a lot. The colors are now perfect. But the pic is still shifted. Check my edit.
|
I have loaded your raw picture into a converter and it appears your source image is already shifted. How did you convert the image?
|
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. |
great!
Code:
move.w #$FFF8,bpl1mod(a5) ; modulo de tous les plans = 40 I have used LoadView(NULL) with same result. Edited first post with proper data (8 bitplanes) |
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. |
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.
|
What I would do:
- realign the image: Code:
cnop 0,8 Code:
move.l #image_data+40,d1 Code:
move.w #$00b0,ddfstop(a5) Code:
move.w #$20C1,diwstop(a5) ; la fenĂȘtre Ă©cran ah!, and also remove this damn: Code:
clr.w copjmp1(a5) |
I'd rather fix the conversion instead of dealing with an incorrectly converted image, but to each his own I guess. :)
|
Quote:
Was just to use the available data (and can be useful for understanding alignments on AGA.. maybe.. :)) |
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 |
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. |
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. |
Quote:
A good way to slow down your AGA setup.. |
Quote:
Yes. That's what I meant with the modulo correction being ugly. :) |
Quote:
|
Quote:
|
All times are GMT +2. The time now is 11:19. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.