Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:27 24 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 : MMBasic for Windows - pre-alphas

     Page 2 of 17    
Author Message
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 110
Posted: 03:08am 26 Jan 2022
Copy link to clipboard 
Print this post

I'm impressed on you speed of coding and your results. I took Mazist and broke it down to the essentials of generating a maze, printing it to screen and the using the mouse solve routine - couldn't use the original Mazist as it uses commands unknown to Windows MMBasic such as TEXT, MATH SET, GUI CURSOR and MAP commands. Each routine was timed and then I ran the same program on my MM2 to see the difference. My PC is an old I5 and only scores 185934 grains on KnviD's Benchmark.

Maze size 99x69 nodes
MM2: Generation: 1.8-2.7 seconds
    Print: 0 seconds!
    Solution: 1.55-2.33 Seconds
PC:  Generation: 0.2-0.28 Seconds
    Print: 0 Seconds!
    Solution: 0.16-0.18 Seconds

Near enough to 10 times the performance for these routines. I'm looking forward to future developments.


 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 03:12am 26 Jan 2022
Copy link to clipboard 
Print this post

good job Pete

I give my graphical test program

Testgraf.zip

it seem that "Text" function is not activ
"Stars" function don't work correctly



I have also problem with keyboard. I am in frech (azerty), but with mmbasic
some keys are in qwerty and others in azerty. It is very difficult to use
for exemple : all keys on up of keybord are in numeric mode by default and specials keys are not in same place as azerty. but all alphanum keys are good

also, I don't find key "_"
Edited 2022-01-26 13:14 by goc30
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 03:14am 26 Jan 2022
Copy link to clipboard 
Print this post

Its uk keyboard atm
Plasma
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 04:03am 26 Jan 2022
Copy link to clipboard 
Print this post

  Plasmamac said  Its uk keyboard atm


not exactly, no "_" key, and azerty for alpha keys not qwerty
 
Goksteroo
Senior Member

Joined: 15/03/2021
Location: Australia
Posts: 110
Posted: 04:27am 26 Jan 2022
Copy link to clipboard 
Print this post

  Plasmamac said  Its uk keyboard atm

I knew using an Amstrad many years ago would be useful - muscle memory found the " and ' keys straight away!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 05:29am 26 Jan 2022
Copy link to clipboard 
Print this post

I find the following very interesting and a bit confusing

Running MMB4L under mint 20.2, at the command line

> Timer = 0:For i = 1 to 1000000:Next i:Print timer
1898

Running MMB4W in wine under mint 20.2 (same physical machine, disk etc), at the command line

>Timer = 0:For i = 1 to 1000000:Next i:Print timer
232

Are the duration of milliseconds in Scotland the same as England?    

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

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 06:03am 26 Jan 2022
Copy link to clipboard 
Print this post

Fonts appear to be different from CMM2?


'Font Test
For f = 1 to 5
 Font f
 For i = 48 to 96
   Print chr$(i);
 Next i
 Print
Next f


I think font 4 should be font 2, with existing 2 and 3 being 3 and 4 respectively.
Also if exiting a program that had font 5 set, invoking the editor gives an error message about 'Error: Font too large' - easy work around, either change your font back to 1 thru 4 on the exit from your program or at the command line before entering edit.

D.

Edit: Sorry, my bad, was comparing MM+ fonts.
Edited 2022-01-26 16:06 by panky
... 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: 501
Posted: 07:05am 26 Jan 2022
Copy link to clipboard 
Print this post

Will Mode become Pages?
Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8573
Posted: 08:23am 26 Jan 2022
Copy link to clipboard 
Print this post

  Quote  Timer = 0:For i = 1 to 1000000:Next i:Print timer


31 on my native windows box

  Quote  not exactly, no "_" key, and azerty for alpha keys not qwerty


Interesting, it seems the keyboard routines deliver mapped keys for the alpha part but raw position codes for the numbers etc.

To solve this I'm going to need help from foreign language keyboard users (including US)

later today I'll post a special diagnostic version which will print the raw codes I receive together with the keyboard map and will be looking for someone with each language to create a map for their language
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 09:19am 26 Jan 2022
Copy link to clipboard 
Print this post

  matherp said  

Interesting, it seems the keyboard routines deliver mapped keys for the alpha part but raw position codes for the numbers etc.

To solve this I'm going to need help from foreign language keyboard users (including US)

later today I'll post a special diagnostic version which will print the raw codes I receive together with the keyboard map and will be looking for someone with each language to create a map for their language


my azerty keyboard





each line is same as each keyboard key line
Edited 2022-01-26 19:26 by goc30
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 329
Posted: 10:35am 26 Jan 2022
Copy link to clipboard 
Print this post



Peter, this is what i get with qwerty keyboard. Not sure in what format you need to have it.
/Fred
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8573
Posted: 01:02pm 26 Jan 2022
Copy link to clipboard 
Print this post

Lots more stuff implemented : text, longstring, settick, maths, sort

MMBasic.zip

I've also massively reduced the CPU load. Very little now at the command prompt and just one fully active thread when a Basic program is running. The screen update rate is reduced to about 63Hz which means on a typical 60Hz refresh monitor there will be no impact. If you have a 120MHz monitor then every two frames may be the same but I think this is a price worth paying for reducing the CPU load.

The porting to a C++ environment is a bit of a pain. e.g. (for those who know C)

char c[]="hello"
int a=strlen(c)


gives a full error, not even a warning

to fix I need to cast c to a constant char

i.e.

char c[]="hello"
int a=strlen((const char *)c)
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3505
Posted: 01:22pm 26 Jan 2022
Copy link to clipboard 
Print this post

Quick feedback:

Regardless what video mode I use (mode 1, mode 2, mode.. mode16, all without parameters) when opening the editor, the last line (status/commands) is outside the opened window. With arrow down, it becomes visible.

This is on an i5 with 1920x1080 display panel.

CPU load is far down (idle is like 5% or so) but the
do:i=i+1:print i,:loop until i=1000 runs slower than a MM2 on 38400 baud.
Guess you throttled down too much...;)

Regards,

Volhout
Edited 2022-01-26 23:24 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 01:32pm 26 Jan 2022
Copy link to clipboard 
Print this post

Hi,

Editor Mode - 16 % cpu
Run    Mode - 30 % Cpu

Grainbench 130201

I5 2500S  with 2,7 Ghz

its a litte bit faster as version 1  12700 Grains


looks fine here
Edited 2022-01-26 23:38 by Plasmamac
Plasma
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3838
Posted: 01:48pm 26 Jan 2022
Copy link to clipboard 
Print this post

  matherp said  I've also massively reduced the CPU load ...


FWIW all that MMB4L currently does in this area is:

1. The blocking MMgetchar() functions sleeps (and thus yields) for 1ms each time it fails to read a character - principally this stops the CPU thrashing at the MMBasic prompt.

2. PAUSE does not do a completely busy wait, it intersperses it with 1us sleeps (and thus yields).

If the user wants their program not to thrash then it is up to them to call PAUSE at opportune moments.

I'm sure there are better/smarter things which could be done but this has sufficed so far.

Best wishes,

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

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 01:54pm 26 Jan 2022
Copy link to clipboard 
Print this post

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8573
Posted: 02:02pm 26 Jan 2022
Copy link to clipboard 
Print this post

  Quote  do:i=i+1:print i,:loop until i=1000 runs slower than a MM2 on 38400 baud.
Guess you throttled down too much...;)


You are simply measuring the time to scroll the screen, nothing to do with the changes - will be even slower on a CMM2. The MM2 doesn't have a screen so is outputting to a serial port via a buffered non-blocking background interrupt. Not the same at all.
Try
do: i=i+1:text 0,0,str$(i):loop until i=1000
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3505
Posted: 02:03pm 26 Jan 2022
Copy link to clipboard 
Print this post

  Plasmamac said  Hi,

Editor Mode - 16 % cpu
Run    Mode - 30 % Cpu

Grainbench 130201

I5 2500S  with 2,7 Ghz

its a litte bit faster as version 1  12700 Grains


looks fine here


I ran the grainbench on this i5 system: 175000 grains.
So the computation speed is top. While running grainbench it is 55% CPU load.

No idea why the text printing is slower. Maybe the throttle is removed from the graphics output routine, or my W10 machine is not HW compatible (driver mismatch on HW acceleration?). But I can watch youtube video's on this machine, so it is graphics capable.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8573
Posted: 02:07pm 26 Jan 2022
Copy link to clipboard 
Print this post

  Quote  No idea why the text printing is slower.


see my previous post
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 05:59pm 26 Jan 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  No idea why the text printing is slower.


see my previous post


new version is OK for "TEXT" function

but it seem that "ARC" function is not stable, once it works but if I restart the test it crashes
 
     Page 2 of 17    
Print this page
© JAQ Software 2024