Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:59 05 Jul 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 : CMM2 5.05.06 beta

     Page 6 of 12    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 05:56pm 17 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  In addition it implements a windowed watchdog timer in hardware . This should mean that the CMM2 should never lock up and will always return to the command prompt. I believe this will never trigger accidentally but if you think it has please report the cause.


That's awesome Peter. If it doesn't already do so is there any chance it can also print something e.g. "Program hung, returned to command prompt", as I suspect that may save much head scratching and WTFing should this ever happen.

Best wishes,

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

Joined: 29/07/2020
Location: United States
Posts: 24
Posted: 06:08pm 17 Sep 2020
Copy link to clipboard 
Print this post

Thanks for the explanation!

Here's another item for the documentation:

The sense of the rotation is opposite for IMAGE ROTATE versus IMAGE ROTATE_FAST.  For IMAGE ROTATE, angle of 45.0 degrees is 45 degrees to the left, while for IMAGE ROTATE_FAST, an angle of 45.0 degrees is 45 degrees to the right.  Admittedly, the documentation says that angle! is in degrees and never specifies which direction is positive rotation.  ;-)


BOX 0,0, 50,50, 1, RGB(BLUE),RGB(CYAN)
LINE 0,50, 25,0, 1, RGB(RED)
LINE 25,0, 50,50, 1, RGB(RED)
IMAGE ROTATE 0,0, 50,50, 100,0, 45.0, 0
IMAGE ROTATE_FAST 0,0, 50,50, 200,0, 45.0, 0
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 06:30pm 17 Sep 2020
Copy link to clipboard 
Print this post

  Quote  The sense of the rotation is opposite for IMAGE ROTATE versus IMAGE ROTATE_FAST.  F


That's really stupid. How come no-one noticed before? I've re-uploaded V5.05.06b6 with it fixed. Positive is clockwise.
 
djwildstar
Newbie

Joined: 29/07/2020
Location: United States
Posts: 24
Posted: 07:38pm 17 Sep 2020
Copy link to clipboard 
Print this post

In my Numeric Methods class (some 35+ years ago at this point), my professor claimed that no code could be considered fully debugged until it had been in use for at least 17 years, because he had to fix a bug in the industry-standard FORTRAN library that he wrote 17 years prior - nobody had used that particular sequence of functions in the years that the thing had been in use in the field.

I suspect that most people pick one approach (either performance or quality) early in their project and stick with it for the duration.  I was trying to decide if I could afford the time for the bilinear algorithm - so I made a quick change from ROTATE_FAST to ROTATE in the key part of my program to see if I still had the frame rates I wanted (and the answer is probably not - bilinear is significantly slower!).
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 09:50am 18 Sep 2020
Copy link to clipboard 
Print this post

Please find attached V5.05.06b7

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

New functionality:
MM.INFO(RESET) returns the cause of the last restart of the code. Possible values are Switch( i.e. the reset switch), Power-On, Software, and Watchdog (NB the latter is the H/W watchdog and unrelated to the MMbasic version which causes a software reset)
MM.INFO(OPTION option) returns the state of options that are relevant to how a program will run. i.e. ANGLE, AUTORUN, BASE, BREAK, DEFAULT, EXPLICIT, LEGACY, Y_AXIS


Breaking changes from V5.05.05
MM.INFO(AUTORUN) replaced with MM.INFO(OPTION AUTORUN)

A H/W watchdog failure and reset will occur if the firmware hangs for any reason. In 5.05.06b7 the only known way of forcing this is to use the PRINT command with an illegal reserved word as the "variable name" e.g. AS
In the event of a H/W watchdog timeout you will get the message "Error: System fault - check code"
Edited 2020-09-18 19:51 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:11am 18 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  Please find attached V5.05.06b7 ...


Nice, many thanks.

We're going to start to think that when you say ""No", you mean "Yes"

Best regards,

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

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 12:47pm 18 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  Please find attached V5.05.06b7

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

New functionality:
MM.INFO(RESET) returns the cause of the last restart of the code. Possible values are Switch( i.e. the reset switch), Power-On, Software, and Watchdog (NB the latter is the H/W watchdog and unrelated to the MMbasic version which causes a software reset)
MM.INFO(OPTION option) returns the state of options that are relevant to how a program will run. i.e. ANGLE, AUTORUN, BASE, BREAK, DEFAULT, EXPLICIT, LEGACY, Y_AXIS


Breaking changes from V5.05.05
MM.INFO(AUTORUN) replaced with MM.INFO(OPTION AUTORUN)

A H/W watchdog failure and reset will occur if the firmware hangs for any reason. In 5.05.06b7 the only known way of forcing this is to use the PRINT command with an illegal reserved word as the "variable name" e.g. AS
In the event of a H/W watchdog timeout you will get the message "Error: System fault - check code"


THANK YOU!!!      Knew you could do it  

The failure information is also very useful for helping you track down bugs. I've had a few hangs that I couldn't replicate because I couldn't remember exactly what I had done and didn't know how to replicate. This should help.
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 01:27pm 18 Sep 2020
Copy link to clipboard 
Print this post

Very nice enhancement to the MM diagnostics capabilities.

Thanks for all your great work, Peter - you make every day feel like Christmas !
Enjoy Every Sandwich / Joe P.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1129
Posted: 05:55pm 18 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  The sense of the rotation is opposite for IMAGE ROTATE versus IMAGE ROTATE_FAST.  F


That's really stupid. How come no-one noticed before? I've re-uploaded V5.05.06b6 with it fixed. Positive is clockwise.

I was just thinking about this...

There is the new option to make the origin at the bottom left of the screen. For mathematical correctness in that circumstance, positive rotation should be counterclockwise.

What a Pandora's box!
Visit Vegipete's *Mite Library for cool programs.
 
djwildstar
Newbie

Joined: 29/07/2020
Location: United States
Posts: 24
Posted: 07:47pm 18 Sep 2020
Copy link to clipboard 
Print this post

@vegipete -- I also noticed that IMAGE ROTATE operates in degrees only, even if angle measures are set to radians (using it must've been a real pain before OPTION ANGLE DEGREES was available).  In the "it would be nice if ..." bucket, it would be nice if OPTION ANGLE affected all MMBasic statements that accept an angle measurement.

It isn't actually an issue for me, because I now make sure that the first few statements of any program I write are OPTION ANGLE DEGREES : OPTION EXPLICIT : OPTION DEFAULT NONE : OPTION BASE 1
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1129
Posted: 12:39am 19 Sep 2020
Copy link to clipboard 
Print this post

Not really a bug, just a heads up, if you play a MOD file and use samples from the MOD file.

If you stop the program with CTRL-C and then restart it with 'CONTINUE', the MOD file will not be restarted, so any attempt at playing a MODSAMPLE will generate an error.

============
@djwildstar: radians wasn't/isn't a huge problem. The RAD() and DEG() functions do the conversion work if you are moving between units. But yes, consistency across all functions working with angles would certainly be beneficial.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 07:10am 19 Sep 2020
Copy link to clipboard 
Print this post

  Quote  If you stop the program with CTRL-C and then restart it with 'CONTINUE', the MOD file will not be restarted, so any attempt at playing a MODSAMPLE will generate an error.


From the manual on CONTINUE - just added the word "music"  

  Quote  Note that it is not always possible to resume the program correctly – this particularly applies to complex programs with graphics, music, nested loops and/or nested subroutines and functions.
 
Arno
Newbie

Joined: 19/09/2020
Location: Germany
Posts: 15
Posted: 10:00am 19 Sep 2020
Copy link to clipboard 
Print this post

With the last beta the program Gauntlet fails and I geht the Error: System fault - check code.
The line where the Copyright.png is loaded is not working anymore. Loading this png fails
even outside the program, the smaller images are loaded without any error message.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 10:05am 19 Sep 2020
Copy link to clipboard 
Print this post

  Quote  With the last beta the program Gauntlet fails and I geht the Error: System fault - check code.


Thanks for the report. The png codec obviously takes longer than the watchdog timeout. Will try and fix in the next beta
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 01:15pm 19 Sep 2020
Copy link to clipboard 
Print this post

Please find attached V5.05.06b8

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

Fixes a few places where the watchdog wasn't being pinged in time (loading large png, copying large files, loading large jpg, plugging in USB keyboard)

If you have a widescreen monitor then try MODE 11  
Edited 2020-09-19 23:57 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:27am 20 Sep 2020
Copy link to clipboard 
Print this post

Hi Peter,

(Still running 5.05.06b7 if that is relevant)

1. Regarding the message "Error: System fault - check code", what "code" is this referring to, some status code? or the user's source code? If the former then how do we check this code? If the latter then unless they are using CSUBs isn't the problem actually a firmware issue and checking their code isn't going to help them?

2. Would it make sense to clear the value of Mm.Info$(Reset) after a command (or program) has executed successfully. Curently I can run several programs, look at Mm.Info$(Reset) and it still says "Watchdog" or whatever reason caused the last restart. i.e. would it make sense to extend it to give the last reason for return to the command prompt, instead of just the reason for the last restart ?

3. BUG:

   - Very occasionally exiting the Editor using F2 will hang the system (now report "System Fault") and reduce the file being edited to size 0 on the SD card !!!
   - Perhaps an SD TIMING issue (?) so I'm going to stop running with OPTION SD TIMING FAST and try to remember to always leave the editor with F6.
   - Given the devastating consequences is there any chance of changing the Editor program to use a more fault tolerant save pattern, e.g.
       - save to temporary file
       - copy temporary file over original file
       - delete temporary file
       - this should ensure that either the original or the new version of the file always survives this bug.
   - I think it is possible this is a new version of an old bug I occasionally saw where F2 would successfully save the file, but then hang the system when it tried to run it ... I haven't seen this in a while.

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 12:21pm 20 Sep 2020
Copy link to clipboard 
Print this post

  Quote  Still running 5.05.06b7 if that is relevant)

Yes: please upgrade to >= 5.05.06b9

If the latter then unless they are using CSUBs isn't the problem actually a firmware issue and checking their code isn't going to help them?

You can do illegal things in Basic that the interpreter can't trap like PRINT AS or various POKES.

Very occasionally exiting the Editor using F2 will hang the system (now report "System Fault") and reduce the file being edited to size 0 on the SD card !!!


The way you leave the editor won't affect anything. When you press F1 or F2 the first thing the code does is save the file using a blocking transaction using the same code as F6. If the file is zero length it means the file open has happened in replace mode but for some reason the processor has crashed before writing the file.

  Quote  Would it make sense to clear the value of Mm.Info$(Reset) after a command (or program) has executed successfully.

I'll change it so it is cleared when read with MM.INFO
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 12:42pm 20 Sep 2020
Copy link to clipboard 
Print this post

Another bug?, this time reproducible.

It looks like Tab() doesn't function as described if used when Printing to a file.

> Colour Maximite 2
MMBasic Version 5.05.06b7
Copyright 2011-2020 Geoff Graham
Copyright 2016-2020 Peter Mather

> list "tab_bug.bas"
Option Explicit On
Option Default Integer

Open "tab_bug.out" For Output As #1
Print #1, "1" Tab(5) "2" Tab(10) "3" Tab(15) "4"
Close #1

Print #0, "1" Tab(5) "2" Tab(10) "3" Tab(15) "4"

Open "tab_bug.out" For Input As #1
Dim s$
Line Input #1, s$
Print #0, s$
Close #1

End

> run "tab_bug.bas"
1   2    3    4
1    2         3              4

>


Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 01:00pm 20 Sep 2020
Copy link to clipboard 
Print this post

  Quote  Another bug?,


No: documentation could perhaps be clearer but is correct

  Quote  Outputs spaces until the column indicated by 'number' has been reached on the console output.


The tab function can't work when printing to a file only the console. Same as on the MM+ etc.
Edited 2020-09-20 23:07 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10204
Posted: 03:14pm 20 Sep 2020
Copy link to clipboard 
Print this post

Please find attached V5.05.06b10

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

Fixes bug in sprites in 12-bit mode introduced since V5.05.05 which worked properly
Fixes bug where PEEK(SHORT n) returns a 4-byte answer rather than 2
Fixes issue in image resize triggering the H/W watchdog

MM.INFO(RESET) now returns the cause of the last restart of the frimware and then clears it.
 
     Page 6 of 12    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025