Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:36 10 May 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 6 of 12    
Author Message
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 04:50pm 21 Feb 2022
Copy link to clipboard 
Print this post

After grain.bas has finished, after "open with" the graphics console restarts (unable to read result)

Michal
Edited 2022-02-22 02:51 by Michal
 
KD5ZXG
Regular Member

Joined: 21/01/2022
Location: United States
Posts: 53
Posted: 04:53pm 21 Feb 2022
Copy link to clipboard 
Print this post

I launch COLORDEMO2.BAS and use CTRL-C to break, then type >EDIT
Last version that was working: 2022-02-20_050054_MMBasic.zip

Two versions released after have broken console that shows only > and the cursor _.
The cursor moves, but no character is displayed. Does not respond to LIST or EDIT.

I roll back to any older version, this problem does not yet exist.
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 07:15pm 21 Feb 2022
Copy link to clipboard 
Print this post

Thank you  
Even the open source is Great!!
What about  MAP commands?
Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 07:55pm 21 Feb 2022
Copy link to clipboard 
Print this post

  Quote  What about  MAP commands?

Not relevant when everything is RGB888
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 11:14pm 21 Feb 2022
Copy link to clipboard 
Print this post

Well... Now some of my games will need to detect this MMBasic Windows version and get some advantages about it ;)

Thanks a lot, matherp!
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 11:48pm 21 Feb 2022
Copy link to clipboard 
Print this post

Font 7 - is a 6x8 font. On the CMM2 mm.info(fontheight) reports the correct 8 but uses a line spacing of 10 so the printout is more readable. MMB4W uses 8 for font height and line spacing. Does this need to be changed for compatibility or not?
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1111
Posted: 04:41am 22 Feb 2022
Copy link to clipboard 
Print this post

I've done something wrong but I can't figure out what!!

Under a5, if I do the following

> load "junk1.bas"
> list
' comment
print "abc"
do
' comment
' comment
' comment
loop
end
> save "junk4.bas"
> list
' comment
print "abc"
do
' comment
' comment
' comment
loop
end

> load "junk4.bas"
> list
Print "abc"'|2
Do '|3
Loop '|7
End '|8


junk1.bas is 74 bytes long and is correct when viewed with Notepad, junk4.bas is 43 bytes long and appears in the strange debug style when viewed with Notepad.

The same action occurs for any file I load then save.

It appears that the SAVE commands is somehow saving the file in some sort of debug mode/format?

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2415
Posted: 06:29am 22 Feb 2022
Copy link to clipboard 
Print this post

Yes got similar result. Comments and blank lines have been removed. The "'|number" at the end of each line seems to be the original line number before removal.

Edit.
When loaded the modified file works normally.
Edited 2022-02-22 16:59 by phil99
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 07:40am 22 Feb 2022
Copy link to clipboard 
Print this post

Looks like the file resulting from the pre-processing CMM2 does to speed up a program when run.
  CMM2 Manual said  The reason for this arrangement is that when a program is loaded into memory for execution MMBasic will do a lot of pre-processing to speed up execution. This includes inserting any include files specified in the source, stripping out all comments, removing unnecessary spaces and so on. The resultant program is then saved in program memory but it cannot be edited or listed because after pre-processing the executable program is not easily human readable.
... and is the reason CMM2 does not have a save command and uses F1 or F2 instead. Looks like MMB4W is saving this post processed file and not the original text file.
Edited 2022-02-22 17:42 by Goksteroo
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 08:12am 22 Feb 2022
Copy link to clipboard 
Print this post

  Quote  and is the reason CMM2 does not have a save command and uses F1 or F2 instead.

Correct. I forgot to remove the SAVE command as everything now works from disk and it is no longer needed - same as the CMM2.

Major update coming where I will fix this and include a rework of all the file handling
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 09:35am 22 Feb 2022
Copy link to clipboard 
Print this post

V5.07.03a6


MMBasic.zip

This reworks all the file handling to properly "Canonicalize" all filenames (look it up   )

SAVE command is removed as SAVE is automatic on exit from the editor or autosave
Re the comments about text disappearing:
This one is difficult. In the last release I followed the CMM2 which is to reset the mode and font to the default at the end of running a program and after an error. This is because with the COLOUR, FONT and PAGE commands it is possible to be in a situation where text is not visible (e.g. being written to a non-displayed page)

In this version I don't change the mode but set the font to the default for that mode and reset the colours to white on black.

There is no right answer on this one so see how you go.

Tom: up to you now for SAAINT. Let me know if there are any MM.INFO functions I am missing that are in the CMM2
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 09:59am 22 Feb 2022
Copy link to clipboard 
Print this post

Here we go then:

1. LS as an alias of FILES is not supported, is this intentional? I don't object since it was an anacronysm on the CMM2. I might even remove it from MMB4L since I'm intending to allow access to all the Linux console commands simply by prefixing them with a !

2. It's a damn nuisance when it comes to bug reporting that I can't copy from the MMB4W console.

3. OPTION DEFAULT PATH error handling would benefit from improvement:



4. OPTION LIST uses an exciting mixture of cases :



5. Are you going to provide compatibility with the CSUB structure being (mis)used to include binary blobs in MMBasic files? If not then is there an alternative other than DATA statements ... I seem to recall something about misusing fonts ?

6. MM.CMDLINE$ is not supported !!!

That's me out again .

Best wishes,

Tom
Edited 2022-02-22 20:08 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 10:02am 22 Feb 2022
Copy link to clipboard 
Print this post

  thwill said  2. It's a damn nuisance when it comes to bug reporting that I can't copy from the MMB4W console.


Could you (temporarily?) provide a flag/option to duplicate all console *output* into the "DOS Window" so I can copy error messages out of there ?

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 10:21am 22 Feb 2022
Copy link to clipboard 
Print this post

Pressing F1 or typing 'FILES' on the initial screen prints the list of files in my default font, but changes to Font 3 once list is done. edit: Also changes to font 3 when an error is produced. eg. funt 4
  matherp said  In this version I don't change the mode but set the font to the default for that mode and reset the colours to white on black.
Personally I'd like to return to my default mode and font... but in Black/White - either way it's no biggy and I'm sure I can can handle exits/errors in basic to do the same thing.
Edited 2022-02-22 20:29 by Goksteroo
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:26am 22 Feb 2022
Copy link to clipboard 
Print this post

  Quote  LS as an alias of FILES is not supported, is this intentional?


Yes. I don't currently intend to include the CMM2 "FILES" command as it seems unnecessary on an operating based system but I'm open to thoughts

  Quote  OPTION DEFAULT PATH error handling would benefit from improvement:

Done

  Quote  Are you going to provide compatibility with the CSUB structure being (mis)used to include binary blobs in MMBasic files? If not then is there another option other than DATA files ... I seem to recall something about misusing fonts ?


Given no significant limitation on program memory I think using DATA/READ is the correct "Basic" approach so don't intend to include CSUB. You can't use a font because I'm not allowing peek/poke access other than to HEAP, VARIABLES and PROGRAM space. You can use LOAD DATA to load a data file direct into an array

  Quote  MM.CMDLINE$ is not supported !!!

I'll look at it

  Quote  Could you (temporarily?) provide a flag/option to duplicate all console *output* into the "DOS Window" so I can copy error messages out of there ?

I'll set all errors to duplicate on the console window permanently - no downside I can see
Edited 2022-02-22 20:31 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 10:48am 22 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  LS as an alias of FILES is not supported, is this intentional?

Yes. I don't currently intend to include the CMM2 "FILES" command as it seems unnecessary on an operating based system but I'm open to thoughts


Fine by me, I always thought it should have been FILES & FILEMAN (or FM) rather than LS  & FILES.

  matherp said  
  Quote  Are you going to provide compatibility with the CSUB structure being (mis)used to include binary blobs in MMBasic files? If not then is there another option other than DATA files ... I seem to recall something about misusing fonts ?

Given no significant limitation on program memory I think using DATA/READ is the correct "Basic" approach so don't intend to include CSUB. You can't use a font because I'm not allowing peek/poke access other than to HEAP, VARIABLES and PROGRAM space. You can use LOAD DATA to load a data file direct into an array


As we've discussed previously the DATA/READ approach has a major downside for using libraries (.INC files) in BASIC. To be safe it requires both the library and client code to label all DATA and use RESTORE <label> religiously. Otherwise there is a distinct danger of the client code reading the wrong data from the  global "data pointer" ... just changing the order of #INCLUDE statements can change the behaviour.

I don't suppose you'd consider adding some sort of BINARY or BLOB language structure deliberately for this use-case and then I'll do the same for MMB4L ?

  matherp said  
  Quote  Could you (temporarily?) provide a flag/option to duplicate all console *output* into the "DOS Window" so I can copy error messages out of there ?

I'll set all errors to duplicate on the console window permanently - no downside I can see


For the purposes of reporting errors to you it would be nice to have more context than just the error message. Think back to the format I used for all the CMM2 error reports where I could just do a LIST followed by a RUN and send you the console output.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 11:03am 22 Feb 2022
Copy link to clipboard 
Print this post

  thwill said  I don't suppose you'd consider adding some sort of BINARY or BLOB language structure deliberately for this use-case and then I'll do the same for MMB4L ?


On reflection is that going too far "off piste" ?

Could we instead have LOAD DATA added to the PicoMite and the command syntax on both platforms enhanced to include optional arguments for the byte in the file to start reading from and the number of bytes to read.

EDIT: Meh, still a problem, a .INC file doesn't know where it is located so it can't really make use of LOAD DATA in a general fashion. Really do need to have capacity to embed data in the file itself which probably means DATA statements despite their problems ... sorry for the stream of consciousness.

Best wishes,

Tom
Edited 2022-02-22 21:13 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3998
Posted: 11:35am 22 Feb 2022
Copy link to clipboard 
Print this post

Are CSUBs supported?

If not, why not?

If they are, then it seems BINARY (BLOBS) should just work (with a bit of user effort to figure out how to get a PEEKable address) - right?

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 11:40am 22 Feb 2022
Copy link to clipboard 
Print this post

  JohnS said  Are CSUBs supported?

Nope.

  JohnS said  If not, why not?

I'm not sure that MMBasic style embedded CSUBs make sense. MMB4{W|L} should probably have something completely different so they can dynamically load and call .dll/.so with C API.

  Quote  If they are, then it seems BINARY (BLOBS) should just work (with a bit of user effort to figure out how to get a PEEKable address) - right?

Peter has restricted what can be PEEKed "to HEAP, VARIABLES and PROGRAM space".

For the moment I've implemented CSUBs in MMB4L just sufficient that I can use them as blobs.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3998
Posted: 12:19pm 22 Feb 2022
Copy link to clipboard 
Print this post

Dynamically using DLLs would be useful but I was just thinking of the ability to call C (or other language if anyone can be bothered to add whatever stuff it might require).

With that would come BLOBs I think.

C could bypass the restrictions, if that's required.

I suspect minimal CSUB support would be easy; the DLL stuff rather harder.

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