![]() |
Forum Index : Microcontroller and PC projects : MMBasic for Windows - alphas
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Pluto Guru ![]() Joined: 09/06/2017 Location: FinlandPosts: 375 |
revision a1 I have encountered problems when editing in MMB4W. When copying program lines from Notepad and pasting into program in MMB4W by using CTRL+V, the paste seems in first place to work correctly. Trying to run the program reveals that the copy-paste operation has done also other unintended changes to the program. Sometimes the pasted line has also been added (and overwriting) at other places in the program. The "overwritten" line can jump to a completely different position in the program. May be that I am doing something stupid. My Copy-Paste procedure: 1. Normal copy in Notepad 2. In MMB4W I put the cursor to desired location 3. The "pasting" by CTRL+V Have anybody else had similar observations? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10382 |
The radials are not allowed to be the same (modulus 360). You need to check for this in Basic |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
Though: if y1%=x1% then y1%=x1%+1 Michal |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1116 |
When an error is encountered in a program,entering EDIT at the command line would take you to the line the error was on. Now it just takes you to the last line that was edited. With all the GUI commands available (terrific), is there any way to emulate the GUI PAGE (it differs from the CMM2 PAGE command) ? IRETURN appears twice in LIST COMMANDS Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 587 |
ive tested My Copy-Paste procedure: 1. Normal copy in Notepad 2. In MMB4W I put the cursor to desired location 3. The "pasting" by CTRL+V i found only one error in 30 tests. i found 2 green background colored chars in the soure after extreme pasting. cant repeat , sry Plasma |
||||
Goksteroo Senior Member ![]() Joined: 15/03/2021 Location: AustraliaPosts: 114 |
Fonts 1 and 4 only contain the 95 ASCII characters and not the extended 7F to FF characters that the CMM2 have. |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 587 |
test your "atomsprite demo" ![]() frame problems if box disabled all looks ok option explicit option default none 'option console serial mode 9 page write 1 'brownian motion demo using sprites dim integer x(64),y(64),c(64) dim float direction(64) dim integer i,j,k, collision=0 dim string q$ for i=1 to 64 direction(i)=rnd*360 'establish the starting direction for each atom c(i)=rgb(rnd*255,rnd*255,rnd*255) 'give each atom a colour circle 10,10,14,1,,rgb(white),c(i) 'draw the atom sprite read i,6,6,19,19 'read it in as a sprite next i cls box 0,0,mm.hres,mm.vres k=1 for i=mm.hres\9 to mm.hres\9*8 step mm.hres\9 for j=mm.vres\9 to mm.vres\9*8 step mm.vres\9 sprite show k,i,j,1 x(k)=i y(k)=j vector k, direction(k), 0, x(k), y(k) 'load up the vector move k=k+1 next j next i ' do for i=1 to 64 vector i, direction(i), 1, x(i), y(i) sprite show safe i,x(i),y(i),1 if sprite(S,i)<>-1 then break_collision i endif next i page copy 1 to 0 loop ' Sub vector(obj As integer, angle As float, distance As float, x_new As integer, y_new As integer) Static float y_move(64), x_move(64) Static float x_last(69), y_last(64) Static float last_angle(64) If distance=0 Then x_last(obj)=x_new y_last(obj)=y_new EndIf If angle<>last_angle(obj) Then y_move(obj)=-Cos(Rad(angle)) x_move(obj)=Sin(Rad(angle)) last_angle(obj)=angle EndIf x_last(obj) = x_last(obj) + distance * x_move(obj) y_last(obj) = y_last(obj) + distance * y_move(obj) x_new=Cint(x_last(obj)) rem Graphics Programming on the Colour Maximite 2 45/66 y_new=Cint(y_last(obj)) Return ' keep doing stuff until we break the collisions sub break_collision(atom as integer) Local integer j=1 local float current_angle=direction(atom) 'start by a simple bounce to break the collision If sprite(e,atom)=1 Then 'collision with left of screen current_angle=360-current_angle Else If sprite(e,atom)=2 Then 'collision with top of screen current_angle=((540-current_angle) Mod 360) Else If sprite(e,atom)=4 Then 'collision with right of screen current_angle=360-current_angle Else If sprite(e,atom)=8 Then 'collision with bottom of screen current_angle=((540-current_angle) Mod 360) Else 'collision with another sprite or with a corner current_angle = current_angle+180 endif direction(atom)=current_angle vector atom,direction(atom),j,x(atom),y(atom) 'break the collision sprite show atom,x(atom),y(atom),1 'if the simple bounce didn't work try a random bounce do while (sprite(t,atom) or sprite(e,atom)) and j<10 do direction(atom)= rnd*360 vector atom,direction(atom),j,x(atom),y(atom) 'break the collision j=j+1 loop until x(atom)>=0 and x(atom)<=MM.HRES-sprite(w,atom) and y(atom)>=0 and y(atom)<=MM.VRES-sprite(h,atom) sprite show atom,x(atom),y(atom),1 loop ' if that didn't work then place the atom randomly do while (sprite(t,atom) or sprite(e,atom)) direction(atom)= rnd*360 x(atom)=rnd*mm.hres-sprite(w,atom) y(atom)=rnd*mm.vres-sprite(h,atom) vector atom,direction(atom),0,x(atom),y(atom) 'break the collision sprite show atom,x(atom),y(atom),1 loop End Sub Edited 2022-02-18 12:01 by Plasmamac Plasma |
||||
Pluto Guru ![]() Joined: 09/06/2017 Location: FinlandPosts: 375 |
Thanks Plasmamac for testing. You were more successful than me with the Copy-Paste. I think I need to take a break with MMB4W until a manual is available. I am sorry for taking time from more relevant development issues. Kind regards Fred |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10382 |
Please don't give up. Every report is useful and the more info the better. It is highly likely there is a bug in paste as this is new code that is completely different from the CMM2. Thanks for the report - found it and will fix in next version The font files are the same but not being read the same - will investigate Hmmm - will investigate This is work-in-progress pending introduction of include files GUI PAGE - same as CMM2 - not tested will investigate |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 8049 |
It's not easy producing a manual for something that's still in alpha. This I know from experience. :) Would it help if I went over the work so far and tried to put some sort of resource together like I did for the PicoMite? I've not really been following MMB4W. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 587 |
He Pluto ! You can't give up because i found a ghost char after your suggestion. ![]() Maybe a video from you to show us the Problem? Plasma |
||||
Romeo![]() Newbie ![]() Joined: 11/02/2022 Location: FrancePosts: 24 |
Definitively YES. But it could be an everyday work and a pain to do, big THANKS if you decide to do it anyway. ![]() |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 8049 |
Here it is then. If the updates aren't quite as fast as Peter's I'm sure you'll not be too hard on me. lol RTF format, alpha releases start on page 12. MMBasic For Windows 1802.zip Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 587 |
Great! Thx Mixtel Plasma |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Cheers, Mick. You are a much appreciated and huge asset to the community ![]() Regards, Craig |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
PDF Version MMBasic_For_Windows.pdf |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10382 |
V5.07.03a3 MMBasic.zip Fixes fonts 1 and 4 output of chars above ascii 127 Fixes bug in sprites overlapping screen edge Gets rid of duplicate IRETURN LIST command updated to support LIST FILE fname$ LIST FILE ALL fname$ LIST PAGES BIG CHANGE - SOUND NOW SUPPORTED PLAY TONE PLAY MODFILE PLAY MODSAMPLE PLAY FLAC PLAY WAV PLAY MP3 PLAY SOUND PLAY PAUSE PLAY RESUME PLAY STOP PLAY VOLUME Differences from CMM2: Playing all the music files in a directory not currently supported (trivial to do with Basic) WAV, FLAC and MP3 playback only support 44100Hz stereo PLAY TTS not implemented PLAY EFFECT not implemented Please note the sound system sets up yet another thread with a callback every 1/88200 seconds so let me know if you see performance issues starting up etc. This stops the radii being the same it doesn't stop the radials being the same You need "if els = ela then ela = ela + 1" Edited 2022-02-19 03:56 by matherp |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
Hi matherp, I did it too, but it still throws errors: mode 9 nbx%=1000 maxx=1024 maxy=768 For i%=1 To nbx% x%=Rnd()*maxx y%=Rnd()*maxy x1%=Rnd()*maxx y1%=Rnd()*maxy c%=Rnd()*&hffffff els=rnd()*360 ela=rnd()*360 if els=ela then ela=ela+1 Arc x%,y%,x1%,,els,ela,c% Next i% pause 1000 For i%=1 To nbx% x%=Rnd()*maxx y%=Rnd()*maxy x1%=Rnd()*maxx+1 y1%=x1%+(Rnd()*30) if y1%=x1% then y1%=x1%+1 c%=Rnd()*&hffffff els=rnd()* 360 ela=rnd()* 360 if els=ela then ela=ela+1 Arc x%,y%,x1%,y1%,els,ela,c% Next i% Michal |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10382 |
Make els and ela integers and it will work. You are testing for equality between floats - never a good idea |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
The fact is, it works. Michal |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |