24 February 2022, 15:15 | #21 |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
By the way, the Amiga Hardware Reference Manual does not mention anywhere that words passed to BLITSIZE width should be incremented by 1 if there is shifting involved.
I scanned the document's relevant paragraph at least 3 times...either I am blind and missed it or this detail is not mentioned. |
24 February 2022, 15:19 | #22 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
Quote:
just bad experience from a game I wrote on the Amiga which used C++. I love the language but my experience was that the game was bloated, big and unefficient despite using blitter I know it's possible to write efficient amiga code in C, but I just can't do it. Back to asm. (and I coded C and C++ for decades, I'm currently a C++ trainer in my company, I love C++ but I hate when code tries to get as close to the machine as possible and gets caught in implicit unsigned/signed cast, size cast (and truncation), to name a few. |
|
24 February 2022, 15:28 | #23 | ||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
From that section: Quote:
Source: http://amigadev.elowar.com/read/ADCD.../node0121.html |
||
24 February 2022, 23:53 | #24 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
Yes, indeed. Thank you. Now it is totally clear. |
|
18 March 2022, 12:51 | #25 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
https://ibb.co/6XHgfYP I am using a descending blit (force_desc flag == 1), to blit a 16x16 image at position 0, 200 to position 1, 220. The result is the above. If the target position is 0, 220, then there is no problem. |
|
18 March 2022, 14:26 | #26 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
|
|
18 March 2022, 15:44 | #27 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
I have added 2 bytes to the destination start address. It still does not work. The result is this: https://ibb.co/6rkRf7S If I subtract 2 bytes from the destination start address, the result is this (the last pixel column in missing): https://ibb.co/cQY83vH And if I move the source image to x=16 and the destination to x=17, I get this: https://ibb.co/smYrFNV |
|
18 March 2022, 15:59 | #28 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
Reason for asking is that all the pictures you show seem to me to be consistent with the shift going across the word boundary. This is why it seems to me to be a descending mode vs ascending mode setup issue. Hope you get it figured out |
|
18 March 2022, 16:11 | #29 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
If I also add 2 bytes to the source start address, it blits the white background. It seems I cannot figure it out. Everything seems to be correct. I have spent the last 5 hours scratching my head, doing small test changes, reading and reading the hardware reference manual and other sites, but I still cannot figure it out. Here is the code: https://pastebin.com/eiAeXVgm I am trying to create a blit function for moving bits around within an image. The code is based on the function 'copy_blit' by arcanist. For ascending mode, it works perfectly, for all positions and blit sizes. |
|
18 March 2022, 16:24 | #30 | |||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
Setting up for a position which takes into account shifting is then done by moving the destination pointer only, not the source. So you indeed don't need to add 2 bytes to the source. Quote:
Quote:
|
|||
18 March 2022, 16:26 | #31 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
|
|
18 March 2022, 16:35 | #32 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
To be honest, I did not manually calculate the values generated by the code for the mask, but I'd say that just swapping the values around as you do is not enough unless the mask is set to either $ffff or $0000.
Here's my thought experiment: Suppose that the ascending mask is set to first word %000111 and last word %100000 (pretending this mask represents all 16 bits rather than just 6). For descending mode this needs to be flipped around because the first word mask is applied to the last word of each line and vice versa. But that would mean that the first word fetched (i.e. the last word in the blit) now has a mask of %000111, which is surely not correct as that cuts of pixels on left and leaves pixels on the right. My guess is that you'd instead need to generate a mask based on the shift value and direction. Edit: this would be a lot easier if I actually had access to my assembler to check some stuff. Doing it all from memory is not the best way Edit 2: the above is not correct, I forgot that flipping the two values around does mean the last word in the blit gets the correct value. The only thing I'm still wondering about is what the left vs right shift means for the value of the mask. I'm still thinking that a mask for a left-shift blit and a mask for a right-shift mask can't be the same. Last edited by roondar; 18 March 2022 at 16:50. |
18 March 2022, 17:20 | #33 | |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Quote:
Anyway, even if I use 0xffff for both first and last world masks, nothing changes. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floppy disk image wont add | leeslangley | support.FS-UAE | 2 | 22 January 2017 12:46 |
Easily add CD ISO image as hardfile | mark_k | request.UAE Wishlist | 4 | 16 March 2014 19:11 |
Word vs not word aligned playfield question | nandius_c | Coders. Asm / Hardware | 8 | 03 December 2013 12:03 |
How in the World do you add an image? | RocketMack | project.EAB | 9 | 08 May 2002 00:48 |
Swear words | Kodoichi | project.EAB | 19 | 14 December 2001 00:53 |
|
|