06 December 2013, 15:27 | #1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 788
|
interleaved bitmaps and blitting
Quick question.. I'm thinking of using an interleaved bitmap instead of the usual bitmap method of each bitmap one after the other.
The idea is that I should be able to blit all 5 planes in one blit rather than having to add plane size to the pointer on each blit. Anyone had any experience with this? Also is there an iff converter which will output the raw image this way? By my calculations the plane pointers in this case would be.. (for a 320 pixel width screen) plane 1 = source plane 2 = source+40 plane 3 = source+80 plane 4 = source+120 plane 5 = source+160 and the modulo would be 120. |
06 December 2013, 18:00 | #2 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 788
|
Seems to be the day for it today!! I found that PicCon can save interleaved raw bitmaps, chucked in the new values above and all went it perfick
|
06 December 2013, 21:10 | #3 |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 374
|
Blitting to multiple planes in with one blit is wonderful, especially if the dimensions of the pixel block are small. A case where blitting is only slightly faster than the CPU becomes a huge win with interleaved bitplanes.
|
07 December 2013, 12:22 | #4 |
2 contact me: email only!
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,188
|
If you can spare the extra chip memory to store the mask once for each plane - yes!
|
07 December 2013, 15:02 | #5 |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
I'm using interleaved bitplanes for my game. I create the interlaved data with IFFConverter which is very easy to use and can also generate palette and sprite data. As Codetapper said, I'm storing the mask once for every bitplane.
|
07 December 2013, 18:16 | #6 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 374
|
Quote:
I've been wondering, though: is there any extra use that can be gotten out of what is normally the mask in this case? Some special effect, possibly using some unusual LF? That way the extra copies of the mask aren't wasted. I'm thinking something like semi-transparency. If the palette is setup correctly, then semi-transparency can be done with something like LF=$B2. With that LF, whenever the bob is written on top of pixels not masked out, the underlying pixel is inverted. With the right palette, some colors can become the shaded versions of the others when the background images has its bits flipped when merged with the bob. |
|
07 December 2013, 20:58 | #7 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
even with only one mask and separate blits for each bitplane to draw a bob, a single blit could still be used for restoring background graphics.
|
03 August 2024, 07:10 | #8 |
DarkN3mo
Join Date: Jan 2021
Location: FRANCE
Posts: 46
|
Hello
After a lot of headaches , I've finally managed to come up with a mask blending routine. Here's an example. Don't hesitate to tell me if I'm doing something wrong. Now, that's all well and good, but I need to know what I do when I move the bob to refresh what was behind it? What's the best technique? https://mega.nz/file/cLlgVaLb#uG8iZ3...ZCPgbGV8MF6dIc Last edited by DarkN3mo; 05 August 2024 at 08:27. |
10 August 2024, 09:56 | #9 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 533
|
I use triple buffering for Reshoot R and Reshoot Proxima 3, as this allows me to blit interleaved objects without having to store background bitmap data for each blitted objects, each frame.
The digest of how it works:
You need to rotate these three buffers with each frame: BufferA becomes BufferB, Buffer B becomes BufferC, BufferC becomes BufferA and so on. Rotation is achieved non-expensive by swapping memory pointers. This works with static and scrolling environments. It's fast but heavy on memory as you need three framebuffers. Therefore it's well suited to AGA-chipsets with 2 MB Chipmem. If speed is not so much a concern, you can streamline the background restore process by simply copying the complete bitmap instead of partially restoring it. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Raw Interleaved Graphics | Hungry Horace | Coders. General | 12 | 28 January 2023 23:30 |
BPLxMOD for interleaved bitmaps | phx | Coders. Asm / Hardware | 12 | 02 June 2012 22:47 |
Bitmaps in FASTRAM and blitting - C++ | NovaCoder | Coders. General | 22 | 01 December 2010 23:40 |
Bitmaps Brothers | Djay | request.Old Rare Games | 22 | 23 November 2003 21:18 |
|
|