![]() |
Forum Index : Microcontroller and PC projects : MMB4W - blit, programming or hardware error - help
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
Goksteroo Senior Member ![]() Joined: 15/03/2021 Location: AustraliaPosts: 114 |
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 Thanks for your time.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!) " Geoff |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4200 |
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 MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4200 |
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 MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Goksteroo Senior Member ![]() Joined: 15/03/2021 Location: AustraliaPosts: 114 |
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: AustraliaPosts: 114 |
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: CanadaPosts: 498 |
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 KingdomPosts: 9800 |
Try this MMBasic.zip |
||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
juste small question is "Bezier" function installed ??? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9800 |
Is now MMBasic.zip |
||||
Goksteroo Senior Member ![]() Joined: 15/03/2021 Location: AustraliaPosts: 114 |
I did 'try this' and it works wonderfully now. No artifacts and no crashes. Thanks, Geoff |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9800 |
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: FrancePosts: 435 |
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 KingdomPosts: 7339 |
![]() 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 KingdomPosts: 9800 |
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: FrancePosts: 435 |
Hi Peter its ok for me, now I know how to use ![]() |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 240 |
@Peter, It seems there is some problem. While reading text file (printscreen 03b23, tested also on 03b24 ) It does not input line if meets coma ->> , Please check attachement strange.zip Edited 2025-02-06 05:10 by electricat |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6181 |
Use LINE INPUT if you want the full line including any commas VK7JH MMedit |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2374 |
Will take a list of values separated by commas (,) entered at the console and will assign them to a sequential list of variables. INPUT #nbr, list of variables Same as above except that the input is read from a serial port or file previously opened for INPUT as ‘nbr’. See the OPEN command. |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 240 |
Thanks! Line input works. And now i see already about comas in user manual explanation. I read manual like a bible. However cames out, not accurate enough ![]() |
||||
bfwolf Regular Member ![]() Joined: 03/01/2025 Location: GermanyPosts: 51 |
On my laptop (HP Probook 6550b, Win10Pro, 22H2) MMB4W shows just a black screen - no "signon message" or anything else.. ![]() Valid for the last version linked above: https://www.thebackshed.com/forum/uploads/matherp/2024-03-01_205501_MMBasic.zip Same with V5.07.03b23 and V5.07.03b24.. V5.07.03b12 works.. Any ideas? bfwolf |
||||
Page 1 of 2 ![]() ![]() |
![]() |