Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:53 28 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 : MMBasic for Windows - betas

     Page 22 of 30    
Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 09:52am 30 Apr 2023
Copy link to clipboard 
Print this post

Hi Doug, I was writing a description on the use of CRCs and using the MATH CRC function but unfortunately it is apparent that nobody can explain the use and meaning of all of the parameters. It came from a Github site. I will have to reflect that in my description, suggest a few websites for research and suggest a trial and error approach. I'll send a copy when I am done and you can decide what to do with it. Volthout's program gives some examples and they will probably cover most people's requirements.

Meantime I have finished going through the manual, found some more issues and I hope to write up the details tomorrow.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 01:36am 01 May 2023
Copy link to clipboard 
Print this post

Hi Doug, Here is my attempt at writing about CRCs and their use:

Cyclic Redundancy Check.zip

It is in odt format. Please do what you want with it. Feel free to edit it as necessary to make it more understandable.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 04:39am 01 May 2023
Copy link to clipboard 
Print this post

Continuing: some of these have been mentioned but...

P52. not implemented.
MM.INFO(FREE SPACE)

P53. not implemented.
MM.INFO(UPTIME)

P55.
OPTION AUTORUN OFF/ON
Instructs MMBasic to automatically run the program in program flash memory on power up or restart (eg, by the WATCHDOG timer).
This is turned off by the NEW command but other commands that might change program memory (EDIT, etc) do not change this setting.
Entering the break key (default CTRL-C) at the console will interrupt the running program and return to the command prompt.
If the CMM2 is set to run programs from RAM (OPTION RAM) then the firmware will look for the file AUTORUN.BAS on reset or power up and execute it if found.

P55. not implemented.
OPTION BASELINE ON|OFF and
OPTION BAUDRATE nbr

P60.
CHDIR dir$
Change the current working directory on the SD card to ‘dir$’...

P92.
BAUDRATE( comm [, timeout] )
not implemented

P94.
On this page and in other places there is an extra space before and/after the bracket like DIR$( ). No problem but just 'looks wrong' to me. Ignore if you like.

P98.

MATH(SINH a)

MATH(TANH a)

Simple Statistics

This is repeated from the previous page, should be deleted and replaced with the MATH(CRCn) function from the latest Pico manual (don't forget to add the missing commas from that source).

One last point, the evidence suggests that Rob Tillaart is the author of the CRC code used within MMBasic and, if this is correct, then he probably should be acknowledged as such in the manual.

Well that's all of the problems that I have found. If there are any more then they will probably come to light as people start to use to manual in ernest. I really only skimmed over most of the commands and functions and only questioned those I though were incorrect. No guarantees.

Thanks again for all of your work.

Bill
Keep safe. Live long and prosper.
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 899
Posted: 06:37am 01 May 2023
Copy link to clipboard 
Print this post

Hi Doug,
I posted some of these earlier but have updated them below.

Regards
Gerry

MMB4W Manual feed Back.

Page 18 The Console Window
I think the description is currently for the CMM2. I have not used it before but after playing a bit I think the text below is OK.
Essentially
OPTION CONSOLE SAVE is gone.
CONSOLE string$ is a command that is the same as PRINT but outputs to the console.

  New Text said  
The Console Window

MMBasic for Windows is started via a terminal window called the ‘Command Line Console’. Once started, MMBasic then  
opens its own MMBasic window (graphics window) to which all output is now directed.

For debugging purposes, the ‘Command Line Console’ window referred to above can have output from the main MMBasic window echoed to it. One significant advantage is that the ‘Command Line Console’ window is a ‘scrolling’ window thus you can scroll backwards and forwards to analyse any error messages.

The ‘Command Line Console’ window is not enabled for output by default, however it must NOT be closed – doing so will also close the main MMBasic window!

OPTION CONSOLE SCREEN is the default option and does not echo text to the '‘Command Line Console’
OPTION CONSOLE BOTH will echo text to both the ‘Command Line Console’ and the main graphics window.
OPTION CONSOLE SERIAL (only available within a program) will output text to the ‘Command Line Console’, but suppress text going to the main graphics window. This is usefully when developing/debugging graphics applications. When a program ends the OPTION CONSOLE setting reverts to its previous value.

The output of graphics commands will always go to the main graphics window and are never sent to the ‘Command Line Console’.
The CONSOLE command can also be used to send text to the ‘Command Line Console’  regardless of the setting of OPTION CONSOLE. The CONSOLE command is the same as a PRINT command, but goes to the ‘Command Line Console’. e.g. CONSOLE "Hello World"




  Revised OPTION Descriptions said  

OPTION CONSOLE [SCREEN|SERIAL|BOTH]
There are two possible destinations for MMBasic output. The main MMBasic window which acts as the console and can display text and graphics and, the MMBasic Command Line Console (the window you get when starting MMBasic initially. i.e. CLC). You cannot connect a VT100 terminal via a serial port as for other MMBasic implementations.

OPTION CONSOLE SCREEN is the default value and will direct all output (both GUI and text) to the open MMBasic window whether in command line mode or running a program.

OPTION CONSOLE SERIAL will disable text output to the main MMBasic window. All text will be redirected to the Command Line Console window. This is useful for debugging graphics applications as diagnostic PRINT statements will not corrupt the screen display.This can be only enabled in a program and is reverted to the previous value when the program ends.
Note: This has NOTHING to do with any serial ports.

OPTION CONSOLE BOTH will enable both the Command Line Console window and the main MMBasic window for output of text.input/output.
A big advantage to enabling the command line console window is that it is ‘scrollable’ thus enabling viewing of past commands/error msgs.


OPTION CRLF mode is not valid for MMB4W

Not sure if these are in there already but are useful info.
Cutting and Pasting.
You can paste into autosave using ctrl-V
You can also paste into the editor but only a single line will be accepted

CNTRL+SHIFT+x will close both the main MMbasic window and the command line console window. Handy if you want to reload from MMEdit which required MMB4W to be closed down.

COMMANDS
-add command CONSOLE
CONSOLE string$   This is the same as print but puts output to the console window - perfect for debugging

-add as per picomite
READ SAVE
READ RESTORE

-serial ports
Support for serial comms (any or all of com1 - com63)

Parameters available for serial comms - syntax same as all other MMbasic

Baudrate as specified, default if not 9600

Receive Buffer size as specified, default if not 256

Receive Interrupt can be specified - default no interrupt

Receive Interrupt count can be specified - default 1

Parity - default NONE
Available: EVEN, ODD, MARK, SPACE

Data Bits - default 8
Available 7BIT

Stop bits - default 1
Stop Bits 1.5 supported. (S1P5)
Available S2, S1P5 (1.5bits)

INV not implemented -remove from OPEN command and Appendix A.
RS485 not implemented -remove references to DEN and DEP in OPEN command and Appendix

It is possible to send a break.
PRINT #1 ,BREAK    
its a true BREAK set at 20 bit periods
Maybe a separate entry in PRINT command or in APPENDIX A

MODE command can take -ve mode value
Mode command - use a negative value for the mode and you will get full screen with no border e.g.
MODE -16 will fill a 1080p monitor perfectly as full screen with no border at the top.
You cannot set a full screen mode as the default.i.e OPTION MODE -16 would not be allowed.


FUNCTIONS
-missing function
COMPORT(portno) return 0 is port does not exist, 1 if exists.

FULL Screen Editor.
- new functionality
Home - Double press of Home in editor to move to start of the file
End -  Double press of End in editor to move to end of the file
Latest F4 Latest H7
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6101
Posted: 07:12am 01 May 2023
Copy link to clipboard 
Print this post

As part of my efforts to make the syntax lists in MMEdit more accurate, I have been scraping the source code of MMB4W (latest on github is Dec 22)

The attached zip contains the output of my work. It might be of help

As an example mm.info gives:
fun   MM.Info(
         SOUND
         SAMPLE PLAYING
         FONT POINTER
         FONT ADDRESS
         CPUSPEED
         MAX PAGES
         CPUSPEED
         PAGE ADDRESS
         FRAMEBUFFER
         DIRECTORY
         ENVVAR
         EXISTS FILE
         EXISTS DIR
         EXISTS
         OPTION
                   ANGLE
                   Y_AXIS
                   AUTORUN
                   EXPLICIT
                   DEFAULT
                   BASE
                   BREAK
                   CONSOLE
                   SEARCH PATH
                   DEFAULT PATH
         PROGRAM
         TRACK
         AUTORUN
         DEVICE
         DEFAULT PATH
         VERSION
         VARCNT
         CURRENT
         PATH
         FONTWIDTH
         FILESIZE
         FAST TIME
         FONTHEIGHT
         FONTCOUNT
         WIDTH
         HEIGHT
         HPOS
         VPOS
         ERRNO
         ERRMSG
         FCOLOUR
         BCOLOUR
         FRAMEH
         FRAMEV
         WRITE PAGE
         FONT



mmb4w_command_list.zip


Jim
VK7JH
MMedit   MMBasic Help
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 06:49am 02 May 2023
Copy link to clipboard 
Print this post


main:
print @(0,0) mouse (x); mouse(y)
goto main


when moving mouse to botom right and returning mouse to upper left,
there I see earlier printed y coord`s numbers. So current "y" starts look like a fake.
So I add empty spaces just to "clean up after"


main:
print @(0,0) mouse (x); mouse(y); print "               "
goto main


Now, it cleans up after "y" coord printed, but I always see not only printed "x" coords, "y" coords but also third number... "0"

But why?
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 07:19am 02 May 2023
Copy link to clipboard 
Print this post

Latest version of MMBasic for Windows User Manual.

Abridged version
Full version

All corrections/suggestions included.
Two versions - the smaller has just page thumbnails, the much larger has bookmarks to all headings and commands/functions etc.

As always, please feed back any errors/omissions you find.

Enjoy,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 12:58am 03 May 2023
Copy link to clipboard 
Print this post

Thanks Doug,
Just a couple of things:

Is it possible to supply the version with the bookmarks having them all collapsed? It makes it easier to navigate.

With the CRC bit there seems to be a extra tab crept in:
  Quote  
Note: A CRC is not an error correction code it is just for error detection.
The advantages of using a CRC when sending or saving data are that it is a fast and efficient method for detecting errors in data transmission and can detect errors that occur during transmission, and storage caused by things such as noise, interference or distortion.

Also, at the end, the external links don't seem to be all formatted the same.

Finally, if anyone still has issues with CRCs and the reasons for their use please feel free to comment or criticise. It's hard to proof read your own writing. I would really like people to be comfortable with using them now that they are a part of MMBasic for several devices.

Bill

EDIT: The extra tab is my fault. It is in my document. Sorry.  
Edited 2023-05-03 11:12 by Turbo46
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 06:33am 05 May 2023
Copy link to clipboard 
Print this post

Hi Doug, One more thing: Several of the command and function bookmark entries include more than just the command or function name like:



There are too many to list.

I think I said it before but I like the extra level of headings included in the index. I does make thing a lot easier to find when using a paper copy particularly.

Bill
Keep safe. Live long and prosper.
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 12:07pm 05 May 2023
Copy link to clipboard 
Print this post

Sometimes in editor I`m receiving mess like this (always @@@@@@ in place of one program line)

But can`t really catch how it happens.
MMB4W ver b15, WIN7, WIN10, two different notebooks, longer programs edited.

It seems to me, it appears randomly after I have copied something into buffer, run program, returning to edit and scrooling down/up inside editor`s window. And it needs some time (run/edit cycles) to appear. Not a big deal, really, but still kind of problem (say, if unnoticed, suddenly program throws an error to be found later some line was messed away :) )
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 02:53am 06 May 2023
Copy link to clipboard 
Print this post

  Turbo46 said  Hi Doug, One more thing: Several of the command and function bookmark entries include more than just the command or function name like:



There are too many to list.

I think I said it before but I like the extra level of headings included in the index. I does make thing a lot easier to find when using a paper copy particularly.

Bill

You are certainly keeping me honest mate      but very much appreciated.
Latest cut loaded which I THINK??? has all the corrections you have picked up for me.
Regards,
Doug.
MMB4W_User_Manual_v0.92
MMB4W_User_Manual_v0.92 - no index version
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 03:25am 06 May 2023
Copy link to clipboard 
Print this post

Thanks Doug,

I'll check it out later. I got no feedback on my writeup on CRCs. Are you happy with it? Does it need more examples?

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 06:03am 06 May 2023
Copy link to clipboard 
Print this post

Hi Doug,

There is still more information in the bookmarks. The illustration below shows the difference when compared to the CMM2 manual.

I suppose it's not a big deal but I think it looks better as Geoff does it and the items are easier to find.

Bill
Keep safe. Live long and prosper.
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 10:00am 09 May 2023
Copy link to clipboard 
Print this post

Matherp,

Just take a look - wrong vertical distance in the middle. If the distance is large enough, you would not notice this, but at shorter distances (3-5 px), there is a noticeable effect. 
It is hard for me to describe it in English, but I tried to capture an image for you and make measurements using Photoshop.

(My desktop computer leaves a black gap in the right part of the screen, and it might happen due to the video card, as my notebook PC fills the right part OK, but with wrong center distance however.)

MODE 9



draw_mesh (4,4)

sub draw_mesh (hstep,vstep)
hor=MM.HRES
vert=MM.VRES
for row = 0 to vert step vstep
for col= 0 to hor step hstep
pixel col, row ,RGB(white)
next col
next row
end sub


I might look crazy rise problem of one pixel :D
But I`m just drawing accurate mesh of pixels :D



https://imgur.com/a/kbdAuvp
Edited 2023-05-10 00:48 by electricat
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 145
Posted: 02:29pm 09 May 2023
Copy link to clipboard 
Print this post

This is also very similar to the above problem?

MMB4W V5.07.03b16

OPTION DEFAULT MODE 9 1024x768
OPTION DEFAULT FONT 2,1
OPTION DEFAULT path C:\.......
OPTION KEYBOARD US
CURRENT DISPLAY 38,85

> DO : PRINT CHR$(73); : LOOP

The bottom line of the first 42 characters of I or M is distorted on line 19.
I didn't notice this with the other fonts.

Is this new or discussed before?

Nice day.
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 03:05pm 09 May 2023
Copy link to clipboard 
Print this post

  Quote  This is also very similar to the above problem? MMB4W V5.07.03b16


@JanVolk Yes.MMB4W V5.07.03b17 too

I tried your example and see distortions too.
I started looking at MMB4W sources (curiosity killed the cat :D ), but Matherp sure would be faster at it :D

 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 03:53pm 09 May 2023
Copy link to clipboard 
Print this post

Two questions....
Is your screen's native resolution 1024x768?
Do you get the same 'distortion' if you use a full screen mode, eg "Mode -9"?
Edited 2023-05-10 01:55 by Goksteroo
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 04:44pm 09 May 2023
Copy link to clipboard 
Print this post

@Goksteroo

I believe, I follow what you have in mind.

Screen`s physical resolution is 1920x1200.  
And in mode -9 of I get even more fancy patterns of course :)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 04:58pm 09 May 2023
Copy link to clipboard 
Print this post

V5.07.03b18


MMBasic.zip


Should fix the above issue
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 145
Posted: 05:51pm 09 May 2023
Copy link to clipboard 
Print this post

Thanks Peter,

I'm new to fashion and ran into this distortion by trying and unfortunately got stuck at mode 14.
Got the latest version and worked immediately in mode 14 and my test program: > DO : PRINT CHR$(73); : LOOP works well for mode 14 and font 1,1 and display 45,120.
This is image filling with the data in the middle of the screen. Also tested mode 9 with font 2,1 and works fine now. Now to test the other modes and fonts, I probably have to do this again?
According to the manual there is mode 1 to 20, but many modes are invalid mode I found out.
Can I find the setup data somewhere on my laptop because I couldn't do anything with the previous version because the cursor was lost? But if everything continues to work well, that is not really necessary.

Nice day
 
     Page 22 of 30    
Print this page
© JAQ Software 2024