Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:43 14 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 - pre-alphas

     Page 10 of 17    
Author Message
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 10:34am 04 Feb 2022
Copy link to clipboard 
Print this post

Hi matherp,

1. 500ms of pause sometimes a bit too little, for me on some computers only 1000ms is enough
2. Could you please reduce the graphics load a little. For me, on the i5-2400, the MMBasic editing window itself takes 45% of the CPU.

Michal
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6223
Posted: 11:23pm 04 Feb 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  Isn't the correct way to ask the windows sub-system for a port? That will return a port number for you to use. It might be a physical one or it might be a virtual USB one. When you provide a serial number windows will try to provide the same port number that it last used for that application. When you have a lot of port numbers it's because you've been using apps that don't provide a serial number so windows issues the next port number.

I might be talking rubbish of course. :)


Sorry about the slow response to this.

Windows (and Linux) allocate the com port number when the device gets plugged in.
Internally, a Windows program gets a 'handle' to the port when it's opened but any program can access the device using the comport that Windows allocated.
You can go into device manager and change the allocated port number.

Widows retains a list of com port devices that have ever been plugged in. Windows tries to allocate the same number the next time a device is plugged in. If the device has a serial number, Windows can differentiate it from a same make device and therefore allocates a different port number.
This list usually never gets reset so if you are programming a batch of devices that have serial numbers, life can be a pain.
You can edit the registry to tell Windows to ignore serial numbers, something that helps in this case.

The registry key:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter\Devices
holds the list of known devices but doesn't tell you if the are currently plugged in.

You can reset the list by writing zeros to:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter
***Disclaimer: I haven't tried this recently so beware***

Jim
VK7JH
MMedit
 
ElectroPI
Newbie

Joined: 27/04/2012
Location: Australia
Posts: 37
Posted: 03:35am 05 Feb 2022
Copy link to clipboard 
Print this post

Hi Jim,
To clear used com ports in Windows 10 just open Device Manager and under menu item "View" select "Show Hidden Devices".
In the bottom box when you expand the "Ports (COM & LPT)" entry you'll see a complete list of all assigned com ports even if there's nothing currently using the port. Right-click each one and select "Uninstall" to remove it.

I do this all the time so anything I plug in is always assigned a low com port number.

Peter
 
KD5ZXG
Regular Member

Joined: 21/01/2022
Location: United States
Posts: 53
Posted: 06:23am 05 Feb 2022
Copy link to clipboard 
Print this post

Device Cleanup makes quick work of it. I test hundreds of EVMs with up to eight COM ports every day. But I caution against removing unused instances of anything not COM, HID, or memory stick. When you accumulate thousands of unused devices in the registry, you do not want multiple clicks to remove each instance. That method will take an eternity. Mind you, I can only speak for Windows 7.

https://www.uwe-sieber.de/misc_tools_e.html

I see a new tool "COM Name Arbiter" specifically for the COM port problem. Maybe I should try that next time. Not sure if its any safer.
Edited 2022-02-05 16:29 by KD5ZXG
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 06:53pm 05 Feb 2022
Copy link to clipboard 
Print this post

Fun Fact :small world . the Author above (uwe sieber) live 500 m near me.
Plasma
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1532
Posted: 07:05pm 05 Feb 2022
Copy link to clipboard 
Print this post

  Plasmamac said  Fun Fact :small world . the Author above (uwe sieber) live 500 m near me.

I've been using his tools for a while.
I think he has a lot of useful things on offer. Thanks for that.
Regards
Michael

Just an impression to show how many COM ports you can have.(Win7):

Edited 2022-02-06 05:22 by twofingers
causality ≠ correlation ≠ coincidence
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 08:08am 06 Feb 2022
Copy link to clipboard 
Print this post

It seems to me that setting up a startup PAUSE and CPU usage for graphics should be a configuration parameter at MMBasic startup.

Michal
 
matherp
Guru

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

Lots more stuff

MEMORY command, FRAMEBUFFER command, PAGE command, IMAGE command (rotate, resize, warp etc), LOAD JPG, LOAD BMP all as per CMM2 except jpg is more flexible and can overlap the screen

MMBasic.zip
 
Plasmamac

Guru

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

Thank you , you save my Sunday Night
Plasma
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 572
Posted: 10:33pm 06 Feb 2022
Copy link to clipboard 
Print this post

found a problem with blit :

Box 100,100,100,100,22,RGB(red),RGB(blue)
Blit 100,100,300,300,100,100
Blit read 1,100,100,20,20
Blit write 1,200,200

buffer in use
Plasma
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 10:34pm 06 Feb 2022
Copy link to clipboard 
Print this post

Thanks matherp,

Now (5.07.03pa13):
i5-2400 3,1 GHz 20%CPU, grain.bas 44%CPU 253661 grains, gui-test.bas 44%CPU
E5450 3,0 GHz  22%CPU, grain.bas 44%CPU 183879 grains, gui-test.bas 38%CPU    
i7-4770s 3,1 GHz 8%CPU, grain.bas 24%CPU 317486 grains, gui-test.bas 19%CPU

Michal
Edited 2022-02-07 08:50 by Michal
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3319
Posted: 10:38pm 06 Feb 2022
Copy link to clipboard 
Print this post

  Plasmamac said  buffer in use


Worked for me, but got the error on a second run. Blit buffer must be closed before attempting BLIT READ a second time.

I use ON ERROR SKIP: BLIT CLOSE 1 before a BLIT READ just in case the BLIT buffer exists.
Edited 2022-02-07 08:41 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Tinine
Guru

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

Any speed-tests to load a full-screen bitmap happened yet?  
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3319
Posted: 10:46pm 06 Feb 2022
Copy link to clipboard 
Print this post


What am I doing wrong with this?

MODE 1,16

Error : 1 is invalid (valid is 100 to 3840)

Scratch that--I reread the beginning of the thread
Edited 2022-02-07 08:54 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Michal
Senior Member

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

And yet(5.07.03pa13):

i3-5005U 2GHz 27%CPU, grain.bas 54%CPU 138096 grains, gui-test.bas 45%CPU  

Michal
 
Goksteroo
Senior Member

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

I've been doing some testing of conversions of some of my programmes for the CMM2 to Windows MMB and have come across a few issues. There are workarounds for these and so I don't see any issues that need immediate attention, if at all - info is for interest sake only.

open "books.dat" for input as #1 gives a file #1 already open error but works as expected if the file number is changed. ? left over open file #1 from MMB boot.

framebuffer create 1600,1200 gives an error in some modes. Seems to accept only values 2x current V&H page resolution. Can use another page instead of the framebuffer and use page resize 1,1600,1200 instead.

mm.info(framebuffer) gives and erroneous result. mm.info(page address 1) works as expected.

#INCLUDE not yet working, but not an issue as you can just paste the INC files onto the end of the main .bas file.

Any one come across any other anomalies?
 
matherp
Guru

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

Thanks for the report

  Quote  open "books.dat" for input as #1 gives a file #1 already open error but works as expected if the file number is changed. ? left over open file #1 from MMB boot.


Please describe how exactly you get this. I haven't been able to replicate

  Quote  framebuffer create 1600,1200 gives an error in some modes.

You can't create a framebuffer smaller than the screen so this should happen in mode 16. Have you seen it in other modes?
By the way maximum framebuffer size is 7680x4320

  Quote  mm.info(framebuffer) gives an erroneous result.



Please explain further
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 114
Posted: 01:00pm 08 Feb 2022
Copy link to clipboard 
Print this post

load bmp "file.bmp",0,0
open "books.dat" for input as #1

Will give you the file number already open error. Seems to be the load bmp that produces the open file as a 'close #1' before the 'open' command works.

Frame buffer size - oops I was in mode 16 when I was producing the error. What happens to the framebuffer when mode is changed withing a program?

Further trials of mm.info(framebuffer) goes... I was using the FB address to load a book file as data to the frame buffer. If I used the CMM2 code MM Basic crashes and closes as the file is loaded, but if I change the code to an expanded 'normal' page then I get a syntax error. I had assumed the data was being loaded into some forbidden area of memory, hence the crash. I now assume 'load data File$,address' is not implemented?
Edited 2022-02-08 23:02 by Goksteroo
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10075
Posted: 02:15pm 08 Feb 2022
Copy link to clipboard 
Print this post

pa14

MMBasic.zip

Full sprite engine and blit from CMM2 now available. Framebuffer closed on change of mode. Bug in closing files fixed
Edited 2022-02-09 00:16 by matherp
 
Plasmamac

Guru

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

Hi

after :
Box 100,100,100,100,22,RGB(red),RGB(blue)
Blit 100,100,300,300,100,100
Blit read 1,100,100,20,20
Blit write 1,200,200


the next command will crash

*load
*new
etc



Edited 2022-02-09 02:33 by Plasmamac
Plasma
 
     Page 10 of 17    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025