Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:58 21 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : strange behavior with BLIT operations on SSD1306I2C32

Author Message
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 288
Posted: 07:33pm 02 Nov 2022
Copy link to clipboard 
Print this post

Hi all,

just tried to shift around an image on a SSD1306I2C32 display via BLIT WRITE on a pico.
BLIT LOAD #1, "filename"
BLIT WRITE #1,1,1
works as expeced and the image is displayed properly.

Shifting the image down vertically by incrementing the y position in the BLIT WRITE works as expected.

BUT shifting the image horizontially, e.g. BLIT WRITE #1,2,1 gives a completely distorted image. Looks somehow like the image is starting always at or near x-pos 1 but having a scale-factor in the x direction as the x-value increases.

Is there something i'm doing wrong with the x/y coordinates?

Thanks for any advice and regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2681
Posted: 10:54pm 03 Nov 2022
Copy link to clipboard 
Print this post

2 pixel scrolling

OPTION EXPLICIT
dim counter
cls
'landscape
line 0,0,20,8
line 20,8,32,16
line 32,16,42,4
line 42,4,48,30
line 48,30,68,31
line 68,31,80,24
line 80,24,92,26
line 92,26,120,31
line 120,31,144,8
line 144,8,176,0
line 176,0,198,12
line 198,12,240,12
line 240,12,280,24
line 280,24,316,12
line 316,12,319,0



'
do
 for counter = 1 to 100
   scroll_left
 next counter
 
 for counter = 1 to 100
   scroll_right
 next counter
loop
'------
sub scroll_left
 blit read 1,0,0,2,32
 blit read 2,2,0,318,32
 blit write 2,0,0,318,32
 blit write 1,318,0,2,32
 blit close 2
 blit close 1
end sub

sub scroll_right
 blit read 1,318,0,2,32
 blit read 2,0,0,318,32
 blit write 2,2,0,318,32
 blit write 1,0,0,2,32
 blit close 2
 blit close 1  
end sub
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2833
Posted: 11:54pm 03 Nov 2022
Copy link to clipboard 
Print this post

@ville56

Although I don't have a SSD1306I2C32 display, on other displays you get that effect when the area being BLITed goes over the screen boundary.

Make sure
x + w < MM.HRES

and
y + h < MM.VRES
in
BLIT READ #b, x, y, w, h
BLIT WRITE #b, x, y, w, h
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 288
Posted: 11:07am 10 Nov 2022
Copy link to clipboard 
Print this post

Thanks for the hints and sorry for the late reply.

But for horizontial BLIT operations, meaning when the image is moved horizontially, i cannot get it working. Its either the BASIC internal display driver or the display hardware itself. So i probably have to live with it ...

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025