Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:59 04 Sep 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 : MMBasic for Windows - alphas

     Page 2 of 12    
Author Message
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 375
Posted: 09:45pm 17 Feb 2022
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 10382
Posted: 10:38pm 17 Feb 2022
Copy link to clipboard 
Print this post

  Quote  I get such an error

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: Poland
Posts: 125
Posted: 11:03pm 17 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  
The radials are not allowed to be the same (modulus 360). You need to check for this in Basic

Though:
if y1%=x1% then y1%=x1%+1

Michal
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 12:37am 18 Feb 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 587
Posted: 01:30am 18 Feb 2022
Copy link to clipboard 
Print this post

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: Australia
Posts: 114
Posted: 01:46am 18 Feb 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 587
Posted: 01:55am 18 Feb 2022
Copy link to clipboard 
Print this post

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: Finland
Posts: 375
Posted: 08:14am 18 Feb 2022
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 10382
Posted: 09:32am 18 Feb 2022
Copy link to clipboard 
Print this post

  Quote  I am sorry for taking time from more relevant development issues.


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.

  Quote  frame problems
if box disabled all looks ok


Thanks for the report - found it and will fix in next version

  Quote  Fonts 1 and 4 only contain the 95 ASCII characters and not the extended 7F to FF characters that the CMM2 have.


The font files are the same but not being read the same - will investigate

  Quote  Though:
if y1%=x1% then y1%=x1%+1


Hmmm - will investigate

  Quote  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.


This is work-in-progress pending introduction of include files

  Quote  With all the GUI commands available (terrific), is there any way to emulate the GUI PAGE (it differs from the CMM2 PAGE command) ?


GUI PAGE - same as CMM2 - not tested

  Quote  IRETURN appears twice in LIST COMMANDS


will investigate
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8049
Posted: 09:42am 18 Feb 2022
Copy link to clipboard 
Print this post

  Pluto said  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

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: Germany
Posts: 587
Posted: 09:58am 18 Feb 2022
Copy link to clipboard 
Print this post

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: France
Posts: 24
Posted: 12:40pm 18 Feb 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  
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.

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 Kingdom
Posts: 8049
Posted: 01:54pm 18 Feb 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 587
Posted: 02:02pm 18 Feb 2022
Copy link to clipboard 
Print this post

Great! Thx Mixtel
Plasma
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 03:24pm 18 Feb 2022
Copy link to clipboard 
Print this post

Cheers, Mick. You are a much appreciated and huge asset to the community  

Regards,

Craig
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 03:40pm 18 Feb 2022
Copy link to clipboard 
Print this post

PDF Version


MMBasic_For_Windows.pdf
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10382
Posted: 05:52pm 18 Feb 2022
Copy link to clipboard 
Print this post

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.

  Quote  Though:
if y1%=x1% then y1%=x1%+1

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: Poland
Posts: 125
Posted: 07:25pm 18 Feb 2022
Copy link to clipboard 
Print this post

Hi matherp,
  matherp said  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"

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 Kingdom
Posts: 10382
Posted: 07:30pm 18 Feb 2022
Copy link to clipboard 
Print this post

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: Poland
Posts: 125
Posted: 07:48pm 18 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  Make els and ela integers and it will work. You are testing for equality between floats - never a good idea

The fact is, it works.

Michal
 
     Page 2 of 12    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025