Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:28 26 Nov 2024 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 : MMB4W - blit, programming or hardware error - help

Author Message
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 05:12am 19 Nov 2023
Copy link to clipboard 
Print this post

I've been writing a adventure programme for a long time and I'm still stuck on my display routines. I intend to use 6 windows on a screen that update/scroll/etc independently using several resized pages to print to and then  BLIT that screen to the appropriate area on the main screen. It all works as intended but for one little problem that I can't solve.... artifacts on the main screen when the BLIT command is used. It's not program breaker but it looks ugly and not correct behaviour. I have not seen this in other programmes that I use the BLIT command in - eg in Mazist when BLIT is used to overlay the zoomed area on the main screen.

Are the artifacts a programming error on my part, an error (or unintentional side effect) of using the BLIT command, or something on my system. The artifacts become more apparent if the pause command is shortened and it looks like the programme has crashed if you have it very low or commented out (it has not as the full screen is displayed if you press the SPACE bar to exit the programme).

I'm sure I asked about this situation many months ago but didn't receive any solution/explanation of the behaviour - I do want to finish this programme though, and being stumped has had me not progress in its development for a very long time.

Here is my text programme.....
mode -16
option default integer
option base 1

colour rgb(red),rgb(black)
text 920,0,"Windows Test",C,3,6,rgb(red),rgb(black)
font 3

'set up window/pages
'wx(x)=horizontal size, wy(x)=vertical size, px(x)=x pos on screen 0, py(x)=y pos on screen 0
'a$(x) test text
'c(x) colour to print text
'hp(x) and vp(x) saves and sets cursor position
'bc(x) box colour
'bt - Box thickness, bo - box offset

dim wx(6),wy(6),px(6),py(6),a$(6),hp(6),vp(6)
dim c(6),bc(6),bt(6),bo(6)

for x= 1 to 6
read wx(x),wy(x),px(x),py(x),c(x),bc(x),bt(x),bo(x),a$(x)
page resize x,wx(x),wy(x)
hp(x)=0
vp(x)=0
page write x
cls
page write 0
box px(x)-bo(x),py(x)-bo(x),wx(x)+2*bo(x),wy(x)+2*bo(x),bt(x),bc(x)
next x

do
for x=1 to 6
 page write x
 colour c(x)
 print @(hp(x),vp(x))a$(x);space$(rnd*10);
 hp(x)=mm.info(hpos)
 vp(x)=mm.info(vpos)

 page write 0
 blit 0,0,px(x),py(x),wx(x),wy(x),x
next x

'pause 148 'edit this for faster/slower scrolling text
          '10 is t=interesting - lots of artifact
          '1 is "What the hell!!" - nearly all artifact 'til SPACE is pressed

loop until inkey$=" "

wins: data 1392,576,500,176,rgb(white),rgb(green),1,10,"WOOP DE DOOOO!!!! It appears to be working as I wanted it to.... now for functions to make it all easy!  "
data 416,264,20,176,rgb(green),rgb(white),2,4,"How about that!! I didn't think it'd work.... but it does!!!    "
data 416,264,20,488,rgb(pink),rgb(orange),1,6,"Some more stuff to take up space in that little rectangle.....   "
data 416,264,20,800,rgb(blue),rgb(gold),3,4,"I don't want anything printed here, but if I did that then I wouldn't know if the routine was working.... "
data 928,264,500,800,rgb(cyan),rgb(blue),2,8," Oooooo.... and now for the other big window... impressive? NO??? WTF!!! I'm impressed!       "
data 416,264,1480,800,rgb(gold),rgb(red),3,7,"19z48g 1494fnb 1968x4f41 149479 4fdt 14448cg   (random typing here!)  "
Thanks for your time.
Geoff
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 08:46am 19 Nov 2023
Copy link to clipboard 
Print this post

Hi Geoff,

I observe artifacts running it under Wine too.

Nothing screams out as wrong in your code to me; I say this as much because I believe it to be true, but because then someone will tell me I am wrong and thus your problem will be solved .

Have you tried it on real CMM2 hardware ? If the issue is present there then probably a bug in MMBasic. If not then there are more possible culprits.

Best wishes,

Tom
Edited 2023-11-19 19:03 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4038
Posted: 11:11am 19 Nov 2023
Copy link to clipboard 
Print this post

Minimal example that demonstrates the bug in MMB4W (running under Wine for me):
Mode 1
Page Write 0
Cls
? "Hello World"
Page Resize 1,200,200
Do
 Page Write 1
 Page Write 0
Loop


I'm thinking a bug in MMBasic when PAGE WRITE and PAGE RESIZE are used together.

Best wishes,

Tom
Edited 2023-11-19 21:11 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 12:55pm 19 Nov 2023
Copy link to clipboard 
Print this post

It seems that you are correct as far as PAGE WRITE and PAGE RESIZE are used together - if I REM out the BLIT command then I get several areas of 'artifact' - probably a different one for each page that I've re-sized. So it is definitely not BLIT that is the problem. It seems that there is nothing I can do at my end to prevent this.

Would Matherp be able to look at this?

I haven't tried the code on a real CMM2 as yet - long story, but this may be able to  happen soonish.

Thanks for looking at the problem.

Geoff
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 06:04am 29 Feb 2024
Copy link to clipboard 
Print this post

Has anyone looked at and/or solved the 'PAGE WRITE and PAGE RESIZE are used together' producing artifact on the screen yet?

Geoff
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 06:10am 01 Mar 2024
Copy link to clipboard 
Print this post

I tested the code on the last MMB4W running on Wine 9.3, and the problem still happens. It looks like a bug on MMB4W.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 10:06am 01 Mar 2024
Copy link to clipboard 
Print this post

Try this


MMBasic.zip
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 427
Posted: 10:19am 01 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Try this



juste small question
is "Bezier" function installed ???
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 10:55am 01 Mar 2024
Copy link to clipboard 
Print this post

  Quote  is "Bezier" function installed ???


Is now


MMBasic.zip
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 02:41pm 01 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Try this


I did 'try this' and it works wonderfully now. No artifacts and no crashes.

Thanks,
Geoff
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 02:55pm 01 Mar 2024
Copy link to clipboard 
Print this post

Sorry about the slow response - needed a moment of divine inspiration to realise where to find the problem
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 427
Posted: 03:28am 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  
  Quote  is "Bezier" function installed ???


Is now


MMBasic.zip


thank Peter
It works very well

just a small detail, "option default mode 16" does not work, it even tends to crash the program (no more keyboard access, no more cursor)
but in program, mode -16 work
Edited 2024-03-02 15:29 by goc30
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6786
Posted: 08:39am 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Sorry about the slow response - needed a moment of divine inspiration to realise where to find the problem



I love this. It proves that you are a mere mortal like the rest of us.  
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 08:50am 02 Mar 2024
Copy link to clipboard 
Print this post

  Quote  just a small detail, "option default mode 16" does not work, it even tends to crash the program (no more keyboard access, no more cursor)
but in program, mode -16 work


mode 16 will only work properly on screens bigger than 1080p - 2K or 4K. If I can work out how I'll block using mode 16 on 1920x1080 screens. Mode -16 is the correct choice if you want to use full resolution on a 1080p screen
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 427
Posted: 10:11am 02 Mar 2024
Copy link to clipboard 
Print this post

Hi Peter

its ok for me, now I know how to use

 
Print this page


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

© JAQ Software 2024