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 3 of 17 | |||||
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
NOW with full GUI and Mouse support MMBasic.zip Really happy with this You can interrogate the mouse with the mouse function MOUSE(X) 'gets the x-coordinate MOUSE(Y) 'gets the y-coordinate MOUSE(W [,scale]) get the movement of the wheel since the last call of the function Use scale to adjust the sensitivity by dividing the internal count by scale (default 1) MOUSE(L) 'gets the left mouse button (1 is pressed) MOUSE(M) 'gets the middle mouse button (1 is pressed) MOUSE(R) 'gets the right mouse button (1 is pressed) MOUSE(D) D This allows you to detect a double click of the left mouse button . The algorithm say the two clicks must occur between 100 and 500 milliseconds apart. The report via MOUSE(D) is then valid for 500mSec before it times out or until it is read. NB: MM+ TOUCH() function is automatically translated to MOUSE() by the firmware, see the PicoMite manual for the touch GUI sub-functions mouse command MOUSE LEFTDOWNinterrupt [,RIGHTDOWNINTERRUPT] [,LEFTUPINTERRUPT] e.g. MOUSE leftint, rightint, leftup do if mouse(D) then print "Double click @ ",mouse(x),mouse(y) loop sub leftint print "left down @ ",mouse(x),mouse(y) end sub sub leftup print "left up @ ",mouse(x),mouse(y) end sub sub rightint print "right down @ ",mouse(x),mouse(y) end sub Test code for the GUI, please give it a try gui-test.zip |
||||
Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 330 |
Got this when i tried to download MMBasic.zip. /Fred |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5914 |
You are making good progress. I am still seeing resolution problems with the timer. Without any other programs running, the resolution is 10mS Start any other program that has timing involved such as MMEdit V5 or VLC and the timing resolution changes to 15-16mS I expect that it involves the timeBeginPeriod function (timeapi.h)from the Windows API An extract: I am running W10 and I think you are on W11. The test program used: DIM INTEGER starttime, laptime, midtime starttime = TIMER midtime = starttime FOR k = 1 TO 25 FOR n = 1 TO 10000 x = LOG(12346) NEXT n laptime = TIMER - midtime midtime = TIMER PRINT k, TIMER - starttime, laptime NEXT k Jim Edited 2022-01-27 06:03 by TassyJim VK7JH MMedit MMBasic Help |
||||
RetroJoe Senior Member Joined: 06/08/2020 Location: CanadaPosts: 290 |
Peter, gui-test works like a charm - very cool! One bugette: copying (right mouse click from browser) and pasting (CTRL-V) into the editor resulted in a "CLIPBOARD IS EMPTY" error Test platform specs: Windows 10 Pro Dell Inspiron 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz 2.80 GHz 16GB RAM NVIDIA GeForce MX350 P.S. Like some of the other 8-bit enthusiasts around here, I've been checking in from time to time on the Commander X16 project. The latest update on their website is thus: "As of December 2021 David has suggested there could be a '9 to 12 month' delay" (and, dollars to donuts, it won't be "generally available" even then i.e. they will be doing some limited KickStarter thing to fund the initial production run). Meaning, when your "WinMite" version is released, the mighty Mite ecosystem will have the retrocomputing pole position all to itself, for at least a year! Edited 2022-01-27 06:23 by RetroJoe Enjoy Every Sandwich / Joe P. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3663 |
False positive - ignore. John |
||||
RetroJoe Senior Member Joined: 06/08/2020 Location: CanadaPosts: 290 |
Just (re)-read the first post in this thread: If I'm interpreting that right, it seems like a major usability issue - copying and pasting code within the MM Editor, and from browser windows into the Editor, are very common operations. I guess "best practice" will be to use a 3rd-party editor? Enjoy Every Sandwich / Joe P. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
That's the way it is. You are trying to pastes a text string into a pixel mapped graphics window. It ain't going to work. You can't have everything |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 446 |
The MMBasic.exe is running fine on Wine It's complaining of Option angle degrees and Option keyboard. |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
hi, wow GUI support !great Progress works fine Edited 2022-01-27 12:12 by Plasmamac Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5914 |
A test program to show off the modes. The CIRCLE function creates artifacts on the outside of the circle. Use the C key to toggle the circle on/off Also, P -saving a BMP, creates a unreadable file. I will investigate that further. ' test card for MMB4W ' TassyJim January 2022 OPTION EXPLICIT OPTION DEFAULT NONE DIM INTEGER wd, ht, wbox, sh, x, w, n, nn, m, maxMode, mk, cir DIM FLOAT a DIM k$, imgtitle$, fname$, imgRes$ DIM INTEGER c(8) c(0) = RGB(BLACK) c(1) = RGB(YELLOW) c(2) = RGB(CYAN) c(3) = RGB(GREEN) c(4) = RGB(MAGENTA) c(5) = RGB(RED) c(6) = RGB(BLUE) c(7) = RGB(WHITE) c(8) = RGB(64,64,64) maxMode = 16 a = 1 cir = 1 CLS DO IF m = 0 THEN MODE 1 ',8 CLS TEXT 400,100, "Video mode test",cm,5,1 TEXT 400,180, "Ratio = aspect ratio used in the circle command",cm,1,1 TEXT 400,220, "Q to quit, P to save page as a BMP",cm,3,1 TEXT 400,260, "Up Down arrow or mouse wheel to change mode",cm,2,1 TEXT 400,300, "+ - to change circle aspect ratio",cm,2,1 TEXT 400,340, "C to toggle circle",cm,2,1 ELSE CLS ' erase video memory before mode change MODE m CLS PAUSE 100 wd = MM.HRES : ht = MM.VRES nn = INT(wd/80) imgtitle$ =" MODE "+STR$(m)+" Ratio "+STR$(a,1,3)+" " imgRes$ = " "+STR$(MM.HRES)+" x "+STR$(MM.VRES)+" " 'pages$ = " Maximum page number = "+STR$(mp)+" " wbox = wd / 8 FOR x = 0 TO 7 BOX x*wbox,ht/4,wbox,ht/2,0,c(x), c(x) NEXT x ' full gradient for each primary colour and greyscale FOR x = 0 TO wd-1 sh = 255*x/wd LINE x,0,x,ht/12,1,RGB(sh,0,0) LINE x,ht/12,x,ht/6,1,RGB(0,sh,0) LINE x,ht/6,x,ht/4,1,RGB(0,0,sh) LINE x,ht*9/12,x,ht*10/12,1,RGB(0,sh,sh) LINE x,ht*10/12,x,ht*11/12,1,RGB(sh,0,sh) LINE x,ht*11/12,x,ht,1,RGB(sh,sh,0) LINE x,ht/2,x,ht*3/4,1,RGB(sh,sh,sh) ' greyscale NEXT x ' circle to check aspect ratio IF cir THEN CIRCLE wd/2,ht/2, ht*15/32,3,a,c(7) sh = 0 x = wd/2 - 55*nn/2 ' black white bars to check monitor bandwidth FOR w = 10 TO 1 STEP -1 FOR n = 1 TO nn sh = 255 - sh LINE x,ht*3/8,x,ht*5/8,w,RGB(sh,sh,sh) x = x + w NEXT n NEXT w ' white and red border to check that image fits on monitor BOX 0,0,wd,ht,3,c(7) BOX 1,1,wd-2,ht-2,1,c(5) ' title IF wd > 600 THEN TEXT wd/2,ht/2-15, imgtitle$,cm,4,1 'TEXT wd/2,ht/2, pages$,cm,4,1 TEXT wd/2,ht/2+15, imgRes$,cm,4,1 ELSE TEXT wd/2,ht/2-11, imgtitle$,cm,1,1 'TEXT wd/2,ht/2, pages$,cm,1,1 TEXT wd/2,ht/2+11, imgRes$,cm,1,1 ENDIF ' show the new image ENDIF PAUSE 100 ' wait for keypress or mouse wheel DO k$ = INKEY$ mk = MOUSE(w) IF mk < 0 THEN k$ = CHR$(129) ELSEIF mk > 0 THEN k$ = CHR$(128) ENDIF LOOP UNTIL k$<>"" ' SELECT CASE k$ CASE "C","c" ' toggle circle cir = 1 - cir CASE "Q","q" EXIT DO CASE "P","p" fname$ = MID$(imgtitle$,2)+".bmp" TIMER = 0 SAVE IMAGE fname$ ' PAGE WRITE 0 TEXT wd/2,ht/2,"Saved as "+fname$+" in "+STR$(TIMER/1000,3,2)+" Sec" ,cm,1,1 DO k$ = INKEY$ LOOP UNTIL k$<>"" CASE CHR$(128) ' up arrow m = m - 1 IF m < 1 THEN m = maxMode CASE CHR$(129) ' down arrow m = m + 1 IF m > maxMode THEN m = 1 CASE "+" ' ratio plus IF a < 1.4 THEN a = a + 0.01 CASE "-" ' ratio minus IF a > 0.75 THEN a = a - 0.01 CASE ELSE ' same as down arrow m = m + 1 IF m > maxMode THEN m = 1 END SELECT LOOP CLS MODE 1 END Jim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
Hi, after startup and edit no option line on the Bottom after changing mode no code line pointer at Startup/edit Edited 2022-01-27 16:20 by Plasmamac Plasma |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Not implemented yet Know the issue - will fix Know the issue - will fix, this will also fix the arc problem as it uses the same code Need to find a better timer - any ideas? |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
HPET? Plasma |
||||
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 327 |
WoW! On my 3.5GHz i9 system running Windows 11, I only get 119210 grains. |
||||
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 327 |
The CIRCLE function creates artifacts on the outside of the circle. Use the C key to toggle the circle on/off Also, P -saving a BMP, creates a unreadable file. I will investigate that further. Jim With MMBasic version 5.07.03pa1 I get [29] TEXT 400,100, "Video mode test",cm,5,1 Error: Unknown command |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
Plasma |
||||
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 327 |
MMBasic.zip How do I change to the US keyboard? CONFIG KEYBOARD US doesn't work. |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
my i3 desktop with a 710 card Plasma |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 501 |
@toml its not in yet Plasma |
||||
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 327 |
Test code for the GUI, please give it a try gui-test.zip I get [23] GUI Interrupt Touchdown, Touchup Error : Unknown command If I try to turn on the mouse with OPTION MOUSE 0 I get invalid option. |
||||
Page 3 of 17 |
Print this page |