Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:03 26 Apr 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 : CMM2: V5.05.04 beta

     Page 1 of 5    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 10:29am 24 Jun 2020
Copy link to clipboard 
Print this post

In this thread I'll update the changes to the CMM2 firmware as I develop the beta for V5.05.04.

Note: some of the changes will be experimental and may not make it to the eventual release and syntax may also change however there will be no (intentional) changes that affect the operation of a program written to the manual under 5.05.03

First new version is V5.05.04b1b

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Changes as follows:

Bug fixes:
Fixed bug in GPS function when run from the command line
Fixed bug where graphics commands that were completely off-screen left a line

Existing files without an extension can now be edited.
The editor will still default to appending ".BAS" if the file does not exist. If you need a new file without an extension create it with an extension of ".tmp" and then rename it.

The keyboard auto-repeat rate is automatically scaled when in the editor if the screen is scrolled.
This will stop multiple keypresses stacking up when the screen can't keep up.

Better picture review in the filemanager
Pressing return on any picture file in the filemanager will switch to 800x600x16bit mode (mode 1,16) and display the picture as before. However, now pressing any key when the picture is displayed will return to the filemanager with everything left as before the picture was displayed.

New IMAGE subcommands
IMAGE ROTATE_FAST
IMAGE RESIZE_FAST
these commands have exactly the same syntax as the originals but use a nearest neighbour algorithm rather than bi-linear interpolation. As a result they are much faster (6x for rotate and 20x for resize) but, of course, the resulting image quality will not be as good

OPTION F11 and F12 restricted to 23 characters

BITMAP command removed as per the manual

OPTION PATH pathname$
This defines a path which will be searched when you use the existing RUN command or the new shortform RUN command if the file does not exist in the current directory

RUN filename$ command will search path
When you type RUN with a filename it will first look for the file in the current working directory and then any path specified by OPTION PATH. As before the filename must be a quoted string literal. Any text after a comma following the filename will be passed to the program in MM.CMDLINE$

Shortform run command at the command prompt
An asterix before a filename will be interpreted as the RUN command. The filename is not quoted and any text after a space following the filename will be passed to the program as MM.CMDLINE$.
The command will check for the existence of the file in the current directory and run it from there if found. If the file is not found the command will also search in any path defined by the OPTION PATH command.
The shortform run command is not available in a program
Edited 2020-06-24 20:51 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 10:56am 24 Jun 2020
Copy link to clipboard 
Print this post

<appreciative bow>

Woot! Woot!

Still don't know why we need to have PATH configurable though, I'd prefer longer F11/F12 strings.

Is there any way the following could be made to work? This is the last step in the puzzle as it allows commands in the PATH to redirect to real implementations elsewhere:

one.bas:
Print MM.CMDLINE$
Run "two.bas", MM.CMDLINE$


two.bas:
Print MM.CMDLINE$


What happens:
> *one foo
foo
¯'|2


What I would like to happen:
> *one foo
foo
foo


Thank you,

Tom
Edited 2020-06-24 21:03 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 12:26pm 24 Jun 2020
Copy link to clipboard 
Print this post

  Quote  Still don't know why we need to have PATH configurable though, I'd prefer longer F11/F12 strings.


Because not everyone thinks file layouts should be determinate like the Unix wonks  

  Quote  s there any way the following could be made to work?


Nearly, you will have to copy MM.CMDLINE$ but otherwise yes : watch this space

Print MM.CMDLINE$
d$=MM.CMDLINE$
Run "two.bas", D$
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 12:51pm 24 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  thwill said  Still don't know why we need to have PATH configurable though, I'd prefer longer F11/F12 strings.

Because not everyone thinks file layouts should be determinate like the Unix wonks  


I could argue, but it doesn't seem fruitful.

  matherp said  
  thwill said  Is there any way the following could be made to work?

Nearly, you will have to copy MM.CMDLINE$ but otherwise yes : watch this space

Print MM.CMDLINE$
d$=MM.CMDLINE$
Run "two.bas", D$


Great.

<bows again>
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3656
Posted: 12:54pm 24 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Still don't know why we need to have PATH configurable though, I'd prefer longer F11/F12 strings.


Because not everyone thinks file layouts should be determinate like the Unix wonks  

It's not determinate in UNIX so that's an odd quote :)

Or a new meaning of determinate?

BTW I like the changes.  Good enough.

(Tweaking the RUN command used within a program sounds sane, if it's easy enough to do.)

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 04:39pm 24 Jun 2020
Copy link to clipboard 
Print this post

Version 5.05.04b1c posted

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixed case matching bug in EVAL when user functions were called

RUN command can now take a string variable as the text for MM.CMDLINE$
so the following are all valid:
RUN "filename",string$ 'runs filename, will append .bas if not included in the string literal
RUN string$ 'runs the current program
RUN "filename", any text required
RUN any text required
Note: as specified in the manual, when a filename is used it must be a string literal and cannot be a variable
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1357
Posted: 01:36am 25 Jun 2020
Copy link to clipboard 
Print this post

The shortform Run cmd and option path are really nice additions
It's all too hard.
Mike.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1357
Posted: 01:54am 25 Jun 2020
Copy link to clipboard 
Print this post

  Quote  The keyboard auto-repeat rate is automatically scaled when in the editor if the screen is scrolled.
This will stop multiple keypresses stacking up when the screen can't keep up.


I like the idea but something does not feel right. Once I scroll off the current page, up or down, the key repeat rate drops to what feels like one line a second.

With OPTION KEYBOARD REPEAT 600,50 I never had key stacking and everything moved / stopped perfectly. Now if I want to scroll off the current page, say go down 10 lines of code, I have to rapidly press the DN key, or wait for what seems like 10 seconds for 10 lines to scroll. Using page UP/DN does not overcome the problem as the cursor now has to bought up or down the page again, but at least it's normal when moving on the current page.

Is it just me  thoughts
It's all too hard.
Mike.
 
abraxas
Regular Member

Joined: 16/06/2020
Location: Canada
Posts: 99
Posted: 02:05am 25 Jun 2020
Copy link to clipboard 
Print this post

  KeepIS said  
Is it just me  thoughts


Yeah, not just you. I have the exact same problem. Just muscle taught myself to hit pgUp pgDown whenever the line of interest is not my viewport. Hardly ideal.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1357
Posted: 03:03am 25 Jun 2020
Copy link to clipboard 
Print this post

Just noticed there is no key-repeat with page UP or DN. I hadn't noticed that before, but it may have already been like that? In any case, is this the intended operation? I feel that the Key-repeat modification would be more applicable to Page scrolling, with single line scrolling left untouched.
.
.
Edited 2020-06-25 14:13 by KeepIS
It's all too hard.
Mike.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 07:32am 25 Jun 2020
Copy link to clipboard 
Print this post

  Quote  I like the idea but something does not feel right. Once I scroll off the current page, up or down, the key repeat rate drops to what feels like one line a second.


The rate currently drops to the greater of repeat start (600 in your case) and 250mSec. Was intended to be greater of repeat rate (50 in your case) and 250mSec. Will fix in the next beta. Also I think I can drop the 250 to 175 and that will tune the repeat rate to the maximum the screen can update at.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 08:52am 25 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  RUN command can now take a string variable as the text for MM.CMDLINE$
so the following are all valid:
RUN "filename",string$ 'runs filename, will append .bas if not included in the string literal
RUN string$ 'runs the current program
RUN "filename", any text required
RUN any text required
Note: as specified in the manual, when a filename is used it must be a string literal and cannot be a variable


Just checking, not offering opinion either way, but is it correct that:
RUN "myprogram.bas", foo

Reports:
Error: foo is not declared


Is this an (un)intentional change of behaviour (caused by my earlier request) to RUN which as documented in the manual suggests that everything after the , is passed through to MM.CMDLINE$ without interpretation.

Regards,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 09:19am 25 Jun 2020
Copy link to clipboard 
Print this post

  Quote  Is this an (un)intentional change of behaviour (caused by my earlier request) to RUN which as documented in the manual suggests that everything after the , is passed through to MM.CMDLINE$ without interpretation.


Check you are running b1c downloaded from above link. Works for me both at the command line and in a program.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 09:44am 25 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Is this an (un)intentional change of behaviour (caused by my earlier request) to RUN which as documented in the manual suggests that everything after the , is passed through to MM.CMDLINE$ without interpretation.


Check you are running b1c downloaded from above link. Works for me both at the command line and in a program.


Right you are, it turns out the issue is more complex.

I had just ERRORed out of a program that used "Option Explicit On" ...

Try this, I started with a reset, and "myprogram.bas" does not exist:
> Colour Maximite 2
MMBasic Version 5.05.04b1c
Copyright 2011-2020 Geoff Graham
Copyright 2016-2020 Peter Mather

> New

> Option Explicit On
> RUN "myprogram.bas", foo
Error: foo is not declared

> Option Explicit Off
> RUN "myprogram.bas", foo
Error: foo is not declared

> New

> RUN "myprogram.bas", foo
Error: Could not find the file


Regards,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 09:55am 25 Jun 2020
Copy link to clipboard 
Print this post

  Quote  I had just ERRORed out of a program that used "Option Explicit On" ...


Easily fixed will be in the next beta
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 10:50am 25 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I had just ERRORed out of a program that used "Option Explicit On" ...


Easily fixed will be in the next beta


Great ... and another ...

Is this correct behaviour:
> Colour Maximite 2
MMBasic Version 5.05.04b1c
Copyright 2011-2020 Geoff Graham
Copyright 2016-2020 Peter Mather

> new

> run "myprogram.bas", foo bar
Error: Expression syntax


It appears the <cmdline> can't have spaces in it unless the whole thing is quoted?

Best regards,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 11:06am 25 Jun 2020
Copy link to clipboard 
Print this post

  Quote  Great ... and another ...

Possibly the same issue, doesn't do it in my corrected program unless you have got into another "special" condition before the test
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 11:16am 25 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Great ... and another ...

Possibly the same issue, doesn't do it in my corrected program unless you have got into another "special" condition before the test


Great, will test when we get that next beta, no rush.

I thought I'd posted this in the last hour, but it appears to have been swallowed by the forum

Can we programatically read the value of OPTIONs, specifically PATH .. I'm even happy to PEEK if you tell me where to look?

Also YMMV but perhaps a tweak to the output of OPTION LIST might make it more pleasant, from:
OPTION DISPLAY 50,100
OPTION USBKEYBOARD UK
CURRENT VGA mode 800x600 RGB332
OPTION F11 chdir "A:/zmim/src"

OPTION F12 chdir "/cmm/mmpp"

OPTION PATH /bin/


to something like:
OPTION DISPLAY 50,100
OPTION USBKEYBOARD UK
CURRENT VGA mode 800x600 RGB332
OPTION F11 chdir "A:/zmim/src" <CRLF>
OPTION F12 chdir "/cmm/mmpp" <CRLF>
OPTION PATH /bin/


And perhaps "CURRENT VGA mode" shouldn't be interleaved but either fixed at the top or bottom.

Regards,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 03:53pm 25 Jun 2020
Copy link to clipboard 
Print this post

V5.05.04b1e

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Tidy up of OPTION LIST
Avoid issue with OPTION EXPLICIT being specified when using RUN with a text commandline
Change auto repeat scaling in editor to impriove performance
Implemented support for $GN messages as well as $GP in the GPS background processor
BREAKING CHANGES
FFT replaced by MATH FFT otherwise syntax the same
TTS replaced by PLAY TTS otherwise syntax the same
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1357
Posted: 10:59pm 25 Jun 2020
Copy link to clipboard 
Print this post

Found an issue that's been there for a while.

Run a program that sets page write to a page >0. In this case the Demo audio frequency analyser posted by Peter (matherp) which sets page write 1 and copies to page 0.  

Exit (ctrl-c) and run another program that gets a section of screen memory and displays it:

Greatly simplified code below from my program:

 Mode 1,8
 cls
 BOX 1,1,400,300,1,Colours(ct),colours(ct)
 Save IMAGE "T1.bmp",1,1,400,300
 Load BMP "T1.bmp",1,1
   

The result:

The Box is displayed on screen.
The screen section is saved to a file.  
The reloaded image is from the previous program.

Unless I set Page Write 0 or some other action changes Page Write to 0, the second program will not work as expected. Since some programs only exit with a ctrl-c, they can't reset graphics.

File manage resets Mode but not Page. Should every program set page writes as well as mode on start? or is this action an oversight (bug?).
It's all too hard.
Mike.
 
     Page 1 of 5    
Print this page
© JAQ Software 2024