BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - rascalito

Pages: 1 [2]
16
Discussion - EVE / Filling a rectangle with tiles.
« on: June 04, 2021, 03:21:24 AM »
Hello!

I have been playing with bitmaps for a while, and I found something odd.
At first, after reading about bitmap layout, bitmap size, I discoverd that wrapx and wrapy
allow to tile a rectangle. Here is an example of tiling a rectangle with a smaller bitmap.
[apparently no way to attach pictures inline. I hope they will be attached below]

In the image IMG_4411.jpeg, the tile can be clearly shown. The tile size is 8 x 8.
The good thing about this is that with a very limited number of commands, you can
tile a large rectangle, even the full screen.

Now if I want to tile with a slightly different bitmap, it doesn't work at all. See the example
with a 8 x 9 bitmap. What I did is simply repeating the last line of the uint8[] array of that bitmap.

Here is what I could capture on the scope. It's the whole SPI communication between
the processor (STM32) and the LCD. Let's examine the 2 captures. Just to make sure
of what changes, I first took the 2 captures, separated everything by 4 bytes except the
3 first bytes, and then ran the diff utility on Ubuntu. I could make sure that only 3 lines
are different.
1. The working bitmap. Not much to say. There are 2 bitmaps, one large bitmap at (100, 0). tiled
with the small 8x8 bitmap that I also wrote at (0, 100).
Code: [Select]
B0 25 78 // Command buffer
00 FF FF FF // CMD_DLSTART
90 60 30 02 // Set clear color to bluish
07 00 00 26 // Clear with the 3 flags (0x07)
00 10 00 01 // Bitmap source (defined as 0x01000000 + address which is 0x1000)
08 20 00 07 // Bitmap layout (defined as 0x07000000. height = 8, linestride = 2 * 8 (0x10), shifted by 9 = 0x2000)
08 10 00 08 // Bitmap size (defined as 0x08000000. height = 8, width = 8, shifted by 9 = 0x1000
01 00 00 1F // DL_BEGIN bitmaps
00 40 06 80 // Vertex
00 10 00 01 // Same bitmap source as above
08 20 00 07 // Same bitmap layout
64 C8 0C 08 // Bitmap size. This time a large bitmap (100 x 100). 100 = 0x64. Shifted left by 9 is 0xC800 wrapx and wrapy flags.
01 00 00 1F // DL_BEGIN bitmaps
00 00 80 8C // Vertex
00 00 00 00 // DL_DISPLAY
01 FF FF FF // CMD_SWAP

2. The incorrect bitmap. Only lines 6, 7, 11 (marked with a * after //) change. The small tile
bitmap height is now 9 instead of 8. The width doesn't change.
Code: [Select]
B0 25 78 // Command buffer
00 FF FF FF // CMD_DLSTART
90 60 30 02 // Set clear color to bluish
07 00 00 26 // Clear with the 3 flags (0x07)
00 10 00 01 // Bitmap source (defined as 0x01000000 + address which is 0x1000)
09 20 00 07 //* Bitmap layout (defined as 0x07000000. height = 9, linestride = 2 * 8 (0x10), shifted by 9 = 0x2000)
09 10 00 08 //* Bitmap size (defined as 0x08000000. height = 9, width = 8, shifted by 9 = 0x1000
01 00 00 1F // DL_BEGIN bitmaps
00 40 06 80 // Vertex
00 10 00 01 // Same bitmap source as above
09 20 00 07 //* Same bitmap layout as above
64 C8 0C 08 // Bitmap size. This time a large bitmap (100 x 100). 100 = 0x64. Shifted left by 9 is 0xC800 wrapx and wrapy flags.
01 00 00 1F // DL_BEGIN bitmaps
00 00 80 8C // Vertex
00 00 00 00 // DL_DISPLAY
01 FF FF FF // CMD_SWAP

I also tried to tile with a 16x16 small bitmap and it works, even if the large bitmap is not a multiple of 16.
But I couldn't tile with a 48 x 48 bitmap.

So I would like to have some feedback. If it's not possible with other formats than
8x8, 16x16 and possibly a few others, I can live with it, but I just need to know.

Best regards,

R

Pages: 1 [2]