Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:13 02 Aug 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: V5.06.00RC1

     Page 2 of 3    
Author Message
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 08:44pm 08 Dec 2020
Copy link to clipboard 
Print this post

  vegipete said  

It could be that disk access too quickly after the 'play modfile' is the cause of my problem. The extra hint is that the SD access LED is on when the system hangs.


Did you set OPTION SD TIMING FAST? If so try it with NORMAL instead of FAST. If it's already NORMAL, try it with FAST.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:07am 09 Dec 2020
Copy link to clipboard 
Print this post

Please download V5.06.00RC5
http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

This should be very close to the final version. Changes are limited to bringing CSUB functionality up to current spec. The zip includes an updated version (V1.4) of ARMCFunction.h. It also includes what should be a final version of the V5.06.00 release notes.

NOTE: compared to V5.05.05 there is a lot of new functionality but breaking changes are minimal:

BREAKING CHANGES FROM V5.05.05:
IMAGE ROTATE direction reversed to match IMAGE ROTATE_FAST, positive angles are clockwise
MM.INFO(AUTORUN) replaced with MM.INFO(OPTION AUTORUN)
Programs that peek and/or poke or use CSUBs to access video memory pages other than page 0  ( 8 and 16 bit colour) and pages 0 and 1 (12-bit colour) in modes 3,5,6,7,12 and 13 will not work as expected and may crash
GETSCANLINE now reports the first visible line as 0 rather than the first line after VSYNC
CSUBs may need re-compiling
Edited 2020-12-09 20:09 by matherp
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 04:37pm 09 Dec 2020
Copy link to clipboard 
Print this post

Great! I am really looking forward to a "stable" release so I can update the firmware on my CMM2. I have so far resisted going past 5.05.06RC15 because the updates have been coming so fast due to Peter's amazing work.

-Bill
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 04:03pm 10 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  
It also includes what should be a final version of the V5.06.00 release notes.


I don't see the 5.06.00 release notes in the ZIP, just the 5.05.06 notes. Are they the ones?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 04:14pm 10 Dec 2020
Copy link to clipboard 
Print this post

  Quote  I don't see the 5.06.00 release notes in the ZIP, just the 5.05.06 notes. Are they the ones?


Yes - now corrected
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 06:31pm 10 Dec 2020
Copy link to clipboard 
Print this post

Hi Peter,
I'm still on 5.06.00RC3, so maybe the bug is not in later FW, but this:
OPTION DEFAULT NONE
OPTION EXPLICIT
OPTION BASE 0

DIM INTEGER a(5), b(5), c(5,10), d(5,10), i, j

FOR i = 0 TO 5
 a(i) = 0
 b(i) = 0
 FOR j = 0 TO 10
   c(i, j) = 0
   d(i, j) = 0
 NEXT j
NEXT i

FOR i = 0 TO 5
 FOR j = 0 TO 10
   a(i) = a(i) + 1
   INC b(i)
   c(i, j) = c(i, j) + 1
   INC d(i,j)
 NEXT j
NEXT i

FOR i = 0 TO 5
 ? a(i)","b(i),
NEXT i
?
?
FOR i = 0 TO 5
 FOR j = 0 TO 10
   ? c(i, j)","d(i, j),
 NEXT j
 ?
NEXT i


gives:


Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 07:04pm 10 Dec 2020
Copy link to clipboard 
Print this post

  jirsoft said  



The Windows version of MMBASIC gives all ones.
Edited 2020-12-11 05:10 by toml_12953
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:55pm 10 Dec 2020
Copy link to clipboard 
Print this post

Just to be sure you are expecting

11, 11  11, 11  11, 11  11, 11  11, 11  11, 11

1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1
1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1
1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1
1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1
1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1
1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1    1, 1

?
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 08:27pm 10 Dec 2020
Copy link to clipboard 
Print this post

Yes. I tried to simulate the difference between INC x and x = x + 1, which should be the same. I found this in SimplEd, but I don't know exactly where (I replaced it immediately with no-INC version)
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 08:55pm 10 Dec 2020
Copy link to clipboard 
Print this post

  jirsoft said  Yes. I tried to simulate the difference between INC x and x = x + 1, which should be the same. I found this in SimplEd, but I don't know exactly where (I replaced it immediately with no-INC version)


Wasn't there a previous post about an INC bug? Or was that only when the increment value was greater than 1?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:33pm 10 Dec 2020
Copy link to clipboard 
Print this post

The bug is because the value to be incremented is a 2D array element - will post a fix tomorrow. For the avoidance of doubt, no other version of MMBasic has the inc command
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 11:29pm 10 Dec 2020
Copy link to clipboard 
Print this post

Thanks Peter,
it was hard to find bug for me, because I put blame on SimplEd...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 03:42pm 11 Dec 2020
Copy link to clipboard 
Print this post

Hi Peter,
it looks like I found another bug   . When I use LOAD FONT, it (sometimes) "eats" first member of string array:


DIM INTEGER i
DIM STRING txt(2) = ("a", "b", "c")

FOR i = 0 TO BOUND(txt()):? txt(i):NEXT i
LOAD FONT "AtariST.FNT"
FOR i = 0 TO BOUND(txt()):? txt(i):NEXT i


Result is:

1
2
3

2
3

The txt(0) still exists, but is zero length string now...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:39pm 11 Dec 2020
Copy link to clipboard 
Print this post

Please post the font file so I have something to test with
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 11:49pm 11 Dec 2020
Copy link to clipboard 
Print this post

Here is it:
AtariST.FNT.zip
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 08:09am 12 Dec 2020
Copy link to clipboard 
Print this post

  Quote  Here is it:
AtariST.FNT.zip


Thanks - that found the bug. Your font uses exactly 3584 bytes. 3584 is 256*14. The original code asked for 3584 bytes of heap memory and heap is always allocated in chunks of 256 - no problem. BUT I forgot the 4 bytes for the header so should have asked for 3584+4.
For fonts where the size wasn't a multiple of 256 there was no issue so I couldn't replicate as there was always spare memory but as always the special case kills you

Please test the attached for this fix + the com3 issues and report back then assuming all OK I'll release it


CMM2V1.5.zip
Edited 2020-12-12 18:14 by matherp
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 10:27am 12 Dec 2020
Copy link to clipboard 
Print this post

Wow, that’s the mother of edge cases! There’s a very common  “Off By 1” defect pattern in software (e.g. starting your array index at 0 instead of 1, or ending a loop one iteration too early). In the same vein, this bug falls into the “Perfect Multiple” class of defects, or maybe it’s just a variation on the common page boundary pattern. In any case, great detective work!
Edited 2020-12-12 20:40 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 11:53am 12 Dec 2020
Copy link to clipboard 
Print this post

Peter is it the intention that this should work?

> Dim a$(2, 2)
> Cat a$(1, 1), "foo"
Expected a string


Best regards,

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

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 12:12pm 12 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Here is it:
AtariST.FNT.zip


Thanks - that found the bug. Your font uses exactly 3584 bytes. 3584 is 256*14. The original code asked for 3584 bytes of heap memory and heap is always allocated in chunks of 256 - no problem. BUT I forgot the 4 bytes for the header so should have asked for 3584+4.
For fonts where the size wasn't a multiple of 256 there was no issue so I couldn't replicate as there was always spare memory but as always the special case kills you

Please test the attached for this fix + the com3 issues and report back then assuming all OK I'll release it


CMM2V1.5.zip


Thanks Peter,
it's working (at least the font case) now. I'm specialist for edge cases...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
frnno967
Senior Member

Joined: 02/10/2020
Location: United States
Posts: 104
Posted: 07:19pm 12 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  Please test the attached for this fix + the com3 issues and report back then assuming all OK I'll release it


The COM3 interrupt issue is fixed but Xmodem still presents an error "Serial Console Disabled" when trying to operate over COM3 when in OPTION CONSOLE SCREEN mode.
Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer.
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025