Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 10:44 20 May 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 : CMM2: V5.05.04 beta

     Page 4 of 5    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 07:08am 08 Jul 2020
Copy link to clipboard 
Print this post

  Quote  BUG: RUN is still not passing cmdline verbatim


This is a limitation which I'm not going attempt to solve. You can't use operators or reserved function names in the text. I'll include a note in the manual

UPDATE, may have a way
Edited 2020-07-08 17:31 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 08:48am 08 Jul 2020
Copy link to clipboard 
Print this post

  matherp said  This is a limitation which I'm not going attempt to solve. You can't use operators or reserved function names in the text. I'll include a note in the manual

UPDATE, may have a way


OK, I'm not that bothered, I just noticed the issue and brought it to your attention.

For my own education, would I be correct in guessing that you are tokenising the command line and that the funny symbols are simply the ASCII characters corresponding to the 1-byte token ids?

Hence:
> Run "test", Mid$
Mid$
> Run "test", Mid$(
˜


Regards,

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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 09:19am 08 Jul 2020
Copy link to clipboard 
Print this post

  thwill said  For my own education, would I be correct in guessing that you are tokenising the command line and that the funny symbols are simply the ASCII characters corresponding to the 1-byte token ids?


Correct.
Geoff Graham - http://geoffg.net
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 01:48pm 08 Jul 2020
Copy link to clipboard 
Print this post

New version is V5.05.04b3f

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Bug fixes
Fixed commandline being incorrectly tokenised in run command
Fixed passing float literals and functions yielding floats to CSUBs

New Functionality
Additional items added to ARMCFunctions.h

NB: for floats in CFunctions, always use MMFLOAT as the datatype. Mixing float and double is not recommended.
Edited 2020-07-08 23:49 by matherp
 
Sasquatch

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 02:01pm 08 Jul 2020
Copy link to clipboard 
Print this post

  matherp said  New version is V5.05.04b3f

Bug fixes
Fixed commandline being incorrectly tokenised in run command
Fixed passing float literals and functions yielding floats to CSUBs

New Functionality
Additional items added to ARMCFunctions.h

NB: for floats in CFunctions, always use MMFLOAT as the datatype. Mixing float and double is not recommended.


Thanks Peter!  I'll do some testing!


Update:  I have tried every combination of literals, expressions and function calls as parameters to the CSub and everything seems to work as expected!
Edited 2020-07-09 01:16 by Sasquatch
-Carl
 
Sasquatch

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 02:19pm 09 Jul 2020
Copy link to clipboard 
Print this post

I have a couple of hopefully "small" requests.  I'm not sure if these are practical or even possible, but hey if you don't ask.....


1.  It would be nice in the editor if holding the shift key and using the arrow keys could initiate select mode.  This would work the same as CTRL-S.  The logic would be something like:  

If (SelectMode = OFF) AND <Any arrow Key> + <Shift> THEN SelectMode = ON

Select mode would need to be enabled before the cursor position is updated in order to catch the first character or line of the desired select block.


2.  Block Comments.  It is sometimes convenient to comment or un-comment a block of code.  We could adopt the /*  */ from C but that wouldn't be "pure BASIC" and would require changes in the parser.  Here is an idea that should be simple to implement in the editor:  

If a block of text is selected and a designated key is pressed (ie CTRL-M or function key), insert a single ' comment character in the first column of each line in the block.  Only in the first column, before any spaces or other text on the line.  This is an unconditional insert of a ' in the first column of each line in the selected block of text.  If the text in the first column happens to already be a ' then there would now be two ' in a row like this ' '

Similarly, if a block of text is selected and a designated key is pressed, (ie CTRL-U or different function key) a single ' character is removed (deleted) from each line in the block only if it exists in the first column.

Edit:  If no block of text is selected, the designated keys could insert or delete a ' comment character in the first column of the line where the cursor is regardless of the position of the cursor on the line.

3.  In the editor, could the Cut/Copy buffer be made persistent to allow text to be copied from one edited file to the next?  It would work something like this:

Open a file in the Editor and Cut/Copy some text.  Exit the editor.  Open another file in the Editor and paste your copied code into the second file.  

I realize this would require allocating a block of RAM somewhere for the copy buffer.  We would likely have to limit the persistent copy buffer to a "reasonable" size.
Edited 2020-07-10 00:49 by Sasquatch
-Carl
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 12:16pm 10 Jul 2020
Copy link to clipboard 
Print this post

Version V5.05.04b4b

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Bug fixes:
Fixed a bug in the initial startup dialogue after battery loss. This was introduced when I added FR keyboard support.

New functionality:
Holding the shift key and using the right arrow or down arrow keys in the editor will initiate select mode. This only works with a USB keyboard and not a serial console as shift arrow is not interpreted on a serial console.

BLIT to and from the framebuffer is now supported for all graphics modes and with all orientation parameter support. To BLIT from the framebuffer to the current WRITE page use FRAMEBUFFER as the page parameter e.g.
PAGE WRITE 0
BLIT 50,50,500,500,75,75,FRAMEBUFFER

To BLIT from the framebuffer to a normal page just use the BLIT command as normal
PAGE WRITE FRAMEBUFFER
BLIT 500,500,50,50,75,75,0


BLIT READ/SPRITE READ now both support reading from the framebuffer

BLIT READ #1,100,100,100,100,FRAMEBUFFER


BOUND FUNCTION
BOUND( array() [,dimension])
This returns the upper limit of the array for the dimension requested. The dimension defaults to one if not specified. Specifying a dimension value of 0 will return the current value of OPTION BASE. Unused dimensions will return a value of zero. Thanks to MikoKisai for the idea of a sensible syntax
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 12:37pm 10 Jul 2020
Copy link to clipboard 
Print this post

  matherp said  Version V5.05.04b4b ...


All amazing stuff Peter.

  Quote  BOUND( array() [,dimension])


But where are the extra language tokens coming from? I know you've been consolidating some of the old ones but it seems like we are still getting more than we are losing?

Regards,

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

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 03:59pm 10 Jul 2020
Copy link to clipboard 
Print this post

  matherp said  Version V5.05.04b4b


New functionality:
Holding the shift key and using the right arrow or down arrow keys in the editor will initiate select mode. This only works with a USB keyboard and not a serial console as shift arrow is not interpreted on a serial console.



Thanks Peter!  I did notice a small anomaly in that <Shift>+<RightArrow> enables the select mode but refuses to move the selection farther to the right until the <Shift> key is released, whereas <Shift>+<DownArrow> continues to extend the selection even if the <Shift> key is held down.  Not sure what the difference is and I'm not complaining as it is quite functional and will save my brain-cells from needing to remember to use CTRL-S when moving between CMM2, PC, MAC etc.


I also found a minor glitch in the file manager.  If <PageDown> is pressed with less than a full page of files displayed, some interesting garbage shows up on the line near the bottom of the screen where the filename usually appears.  Occasionally this locks up the system and requires a reset. It looks like the code that displays the filename string gets pointed out into never-never land.
-Carl
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 04:13pm 10 Jul 2020
Copy link to clipboard 
Print this post

Version V5.05.04b4b

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Final functional changes that I'm intending to do both the command slots and function slots are now full.

New functionality:

Use Ctrl-B in the editor to save the contents of the paste buffer to a file. This allows you to then import code sections into another file using the existing F7 functionality

Full support for up to 3 Wii Classic controllers

Command:
WII CLASSIC OPEN [channel] [,interrupt]
WII CLASSIC CLOSE [channel]


As for the nunchuk the default channel is 3 which is the board edge connector. The others channels are I2C1 and I2C2 on the 40-pin connector.

There is a single interrupt routine which is optionally triggered when ever any of the buttons are pressed.

The Classic is interrogated using the CLASSIC function. The parameters are:

CLASSIC(LX [,chan]) 'returns the position of the analog left joystick x axis
CLASSIC(LY [,chan]) 'returns the position of the analog left joystick y axis
CLASSIC(RX [,chan]) 'returns the position of the analog right joystick x axis
CLASSIC(RY [,chan]) 'returns the position of the analog right joystick y axis
CLASSIC(L [,chan]) 'returns the position of the analog left button
CLASSIC(R [,chan]) 'returns the position of the analog right button
CLASSIC(B [,chan]) 'returns a bitmap of the state of all the buttons
CLASSIC(T [,chan]) 'returns the ID code of the controller - should be hex &H4200101


Analog reading are returned with a value of 0-255. The joysticks should read 128 at rest. The analog buttons A and B should read something close to zero at rest (mine read 16)

The button bitmap is as follows:

BIT 0: Button R
BIT 1: Button start  
BIT 2: Button home
BIT 3: Button select
BIT 4: Button L
BIT 5: Button down cursor
BIT 6: Button right cursor
BIT 7: Button up cursor
BIT 8: Button left cursor
BIT 9: Button ZR
BIT 10: Button x
BIT 11: Button a
BIT 12: Button y
BIT 13: Button b
BIT 14: Button ZL


Test program
wii classic open 3, myint1
do
print classic(lx),classic(ly),classic(rx),classic(ry),classic(L), classic(R)
pause 1000
loop
sub myint1
print bin$(classic(b),15)
end sub
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 08:50am 11 Jul 2020
Copy link to clipboard 
Print this post

Version V5.05.04b4d

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes faulty \ character in font 7 and ! character in font 4 - thanks Jim

Includes work round for PS2/USB keyboards that lock into PS2 mode

Minor change to WII CLASSIC OPEN

WII CLASSIC OPEN channel [,interrupt] [,bitmask]

The optional bitmask can only be specified if an interrupt routine is used. It specifies which of the buttons should generate an interrupt

e.g.
WII CLASSIC OPEN 3, myint ,&B10001


This says that only the L and R buttons will generate an interrupt. All other buttons can be checked using the CLASSIC(B) function, it is just the interrupt that is managed. This allows the programmer to avoid buttons not used in the code causing unwanted interrupts. The default is for all buttons to generate an interrupt
Edited 2020-07-11 19:48 by matherp
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 11:32pm 11 Jul 2020
Copy link to clipboard 
Print this post

Great Work Guys, many thanks from a newbie here

Just a quick question, I built my CMM2 over the last few days, its up an running with the "CMM2_Comstruction_Pack" firmware CMM2V5.05.03

I probably should be testing with something a bit more recent.

Which version would you recommend for a new build / new user who still needs to get his head around the Basic dialect ?

I'm still at the RTFM stage ... so hopefully something that has some correspondence to the excellent documentation aailable for the CMM2 project.

I appreciate the "bleeding edge" nature of the beast, but would like to avoid having to ask stupid questions.

Your Help would be appreciated.

Roy
(aka. Womble)
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 12:04am 12 Jul 2020
Copy link to clipboard 
Print this post

Hi Roy

As Tassyjim mentioned in your other post, you probably should be using the the latest firmware from matherp's link above.

I personally wait an update or two just in case there are some other issues involved. I'm a couple of updates behind ATM.

Brian
Edited 2020-07-12 10:05 by Chopperp
ChopperP
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1401
Posted: 12:08am 12 Jul 2020
Copy link to clipboard 
Print this post

Any command changes are listed in the readme file included with the firmware, including changes per version number. The majority of the base commands are still as per the manual so you should be fine with the latest build.

Welcome to the forum, there are no stupid questions here, only senior moments or late night questions that we all ask from time to time.

Mike.
It's all too hard.
Mike.
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 12:10am 12 Jul 2020
Copy link to clipboard 
Print this post

Good call Brian, thanks, I will update tomorrow  
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 842
Posted: 06:49am 12 Jul 2020
Copy link to clipboard 
Print this post

Hi Peter & Jim,
I was just about to whinge that Font 4 was missing "!" but I saw Peter's post above and loaded Version V5.05.04b4d.  
Now there is a "!".

Well done! and thanks for anticipating my every need!

Cheers,

Andrew

(I don't know how you are keeping on top of it but you are doing a great job - A)
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 01:04pm 12 Jul 2020
Copy link to clipboard 
Print this post

  KeepIS said  Any command changes are listed in the readme file included with the firmware, including changes per version number. The majority of the base commands are still as per the manual so you should be fine with the latest build.

Ah ... so thats how you keep track of the changes.
Makes sense to put the detals in with the firmware zip file.
Thank you for pointing that out Mike.  

  KeepIS said  there are no stupid questions here, only senior moments or late night questions that we all ask from time to time.
That should be my tagline.  I predict quite a few of those from me  
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3027
Posted: 08:42pm 12 Jul 2020
Copy link to clipboard 
Print this post

I have one win10 laptop (Dell E6430) with which I have no problem flashing the CMM2.

With another, a Lenovo T420, also win10, I get a beep when I plug in the USB-A to USB-A cable, but no port shows up in Device Manager, and STM32CubeProgrammer says no DFU device.

When I first plugged it in there was some message about DFU, but it disappeared before I could take note of it. Now I just get the beep, and nothing that I see in Device Manager indicates a problem.

Any ideas about where to look to try to solve this problem?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 09:27pm 12 Jul 2020
Copy link to clipboard 
Print this post

  lizby said  I have one win10 laptop (Dell E6430) with which I have no problem flashing the CMM2.

With another, a Lenovo T420, also win10, I get a beep when I plug in the USB-A to USB-A cable, but no port shows up in Device Manager, and STM32CubeProgrammer says no DFU device.

When I first plugged it in there was some message about DFU, but it disappeared before I could take note of it. Now I just get the beep, and nothing that I see in Device Manager indicates a problem.

Any ideas about where to look to try to solve this problem?


Try a different USB port.

What sequence are you using?
send UPDATE FIRMWARE command then plug in A-A cable
or
power down, set jumper, power up via A-A cable
or
...

I prefer option 2 but both should work.

Jim
VK7JH
MMedit   MMBasic Help
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3027
Posted: 09:34pm 12 Jul 2020
Copy link to clipboard 
Print this post

Tried different USB ports. Also powered down laptop and rebooted. I didn't know about the UPDATE FIRMWARE command--I'll look into that.

Process is: power down, set "system" switch (no jumpers are set on Waveshare board), power up by plugging in A-A cable.

I've updated several times with the laptop which works, but it's not in the same location as my VGA terminal.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 4 of 5    
Print this page
© JAQ Software 2024