Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:47 17 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 : Sprite questions

Author Message
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 299
Posted: 03:23pm 18 Dec 2020
Copy link to clipboard 
Print this post

Hi,

There i wrote few simple lines of code:  


box 0,0,50,50,4,rgb(red),rgb(white)
sprite read 1,0,0,50,50
a=0
b=0
d=12
do
if keydown(1) =129 and a<550 then a=a+1 : sprite show 1,b,a,0:pause d
if keydown(1) =128 and a>0 then a=a-1 : sprite show 1,b,a,0:pause d
if keydown(1) =130 and b>0 then b=b-1 : sprite show 1,b,a,0:pause d
if keydown(1) =131 and b<750 then b=b+1 : sprite show 1,b,a,0:pause d
loop


While moving up and down sprite i see black horizontal stripes on sprite. While moving left-right black line appears like "standing black strip" And if I realase keys, strips goes away, so it is synchro problem/timing ? (It`s PHILIPS 190S LCD monitor and board CPU runs at 480Mhz )

What I am doing incorrectly?
Is it ok only with static things, but with any animations I should route all changes  through PAGE COPY ? Or I am doing it somehow totally wrong way?

I am reading through forum/manuals etc., I`m really sorry if such question was already discussed, used to use forum search but maybe choosed wrong keywords.
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10590
Posted: 03:29pm 18 Dec 2020
Copy link to clipboard 
Print this post

  Quote   but with any animations I should route all changes  through PAGE COPY ?


Yes, either that or use getscanline to synchronise
Edited 2020-12-19 01:29 by matherp
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 299
Posted: 09:17pm 18 Dec 2020
Copy link to clipboard 
Print this post

Thank you for your precious time matherp!

This time I went optimal way and now it works nicely
Ha ha its almost Ms. Pacman now :D  


box 0,0,50,50,4,rgb(red),rgb(white)
sprite read 1,0,0,50,50
a=0
b=0
d=1
do
sync=getscanline
if sync < a+150 and sync > a-150 then goto rep
if keydown(1) =129 and a<550  then a=a+1 : sprite show 1,b,a,0 :pause d
if keydown(1) =128 and a>0    then a=a-1 : sprite show 1,b,a,0 :pause d
if keydown(1) =130 and b>0   then b=b-1 : sprite show 1,b,a,0 :pause d
if keydown(1) =131 and b<750   then b=b+1 : sprite show 1,b,a,0 :pause d
rep:
loop
do

Edited 2020-12-19 07:18 by electricat
My MMBasic 'sand box'
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 299
Posted: 12:51pm 22 Dec 2020
Copy link to clipboard 
Print this post

Matherp,

What could cause not clear picture in video I attached below ?

Soon after I played with GETSCANLINE I used to test also PAGE COPY , but noticed something like pixel noise, like scanlines blinking, I dont know how to name it exactly, but screen was not clear as could/should be.

So I tested example from "Graphics Programming on the Colour Maximite 2" but noticed the same "noise" effects please see video I attached.


Might it be my hardware or maximite`s firmware problem?
My fw version is 5.05.05

https://youtu.be/q5qoCdZ-W5I
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10590
Posted: 01:03pm 22 Dec 2020
Copy link to clipboard 
Print this post

Assuming you have a Waveshare based system you need to install the optional crystal oscillator
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 299
Posted: 02:27pm 22 Dec 2020
Copy link to clipboard 
Print this post

OK. I`ll try that.
My MMBasic 'sand box'
 
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