Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:14 02 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 V5.05.06exp: Huge performance improvement - please test

     Page 6 of 8    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4032
Posted: 03:46pm 24 Oct 2020
Copy link to clipboard 
Print this post

Maybe in "A:/crash.bas" it's the global & local k$ ?

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10181
Posted: 04:01pm 24 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Maybe in "A:/crash.bas" it's the global & local k$ ?


No: that one is just a timeout but unrelated to the main issue
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 04:33pm 24 Oct 2020
Copy link to clipboard 
Print this post

If this isn't the issue then energy levels permitting I'll work on a menu-redux when I've got the family fed and to bed. I had a quick "play" and it looks like the issue is reproducible without the presence of EXECUTE.

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10181
Posted: 05:48pm 24 Oct 2020
Copy link to clipboard 
Print this post

Tom

Please find attached a version with lots of diagnostic prints - should be self explanatory. Any help to find the combination that fails greatly appreciated. Alternatively, if you can find a workaround in the real code that could also help track down the issue.

CMM2V1.5.zip
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 06:21pm 24 Oct 2020
Copy link to clipboard 
Print this post

I've not loaded the new firmware yet, but here is "proof" that it's nothing to do with EXECUTE:

> list "menu-redux-1.bas"
Option Explicit
Option Default Float
Option Base 0

Trace On

Play MP3 "/TweakerRaySpaceFlight-160kb.mp3"
Dim menu_label$
menu_label$ = show_menu$("")
End

Function show_menu$(menu_label$)
 Restore menu_top
 Local menu_name$
 Read menu_name$
 Local items$(20, 2)
 Local items_sz = read_string_array(items$())
 End
End Function

' @return  number of elements (of first index) read.
Function read_string_array(a$())
 Local lbound = Bound(a$(), 0)
 Local i = lbound, j = lbound, s$
 Do
   Read s$
   If s$ = "end" Then Exit Do
   a$(i, j) = s$
   j = j + 1
   If j = Bound(a$(), 2) + 1 Then j = lbound : i = i + 1
 Loop
 read_string_array = i - lbound
End Function

menu_top:
Data "Contents"
Data "1", "WHAT'S NEW?", "menu_new"
Data "2", "Games", "menu_games"
Data "3", "Other amusements", "menu_amusements"
Data "4", "Utilities", "menu_utils"
Data "5", "Demos - Graphics, 3D", "menu_3d"
Data "6", "Demos - Graphics, Fractals", "menu_fractals"
Data "7", "Demos - Graphics, Sprites", "menu_sprites"
Data "8", "Demos - Graphics, Turtle", "menu_turtle"
Data "9", "Demos - Sound", "menu_sound"
Data "X", "Demos - CSUBs", "menu_csub"
Data "C", "Show credits", "credits"
'Data "D", "COMING SOON", "menu_next"
Data "Q", "Quit", "quit"
Data "end"

> run "menu-redux-1.bas"
[7][8][9][13][14][15][16][17][23][24][25][26][27][28][29][30][31][26][27][28][29][30]Error: System fault - possible causes
- Incorrect use of POKE
- Faulty CSUB
- Reserved words used as variables
- Firmware problem
>


This crashes with "menu-redux-1.bas" in "A:/"

1. Reset CMM2
2. RUN "menu-redux-1.bas"
3. Error: System fault

Note that the trace does not always get to the same line number !!!

Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 06:41pm 24 Oct 2020
Copy link to clipboard 
Print this post

New firmware, starting with a reset, two sequential executions:

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

Searching for function: MM.STARTUP
Searching for function: MM.PROMPT
> run "menu-redux-1.bas"
[7][8]Creating variable : MENU_LABEL, at depth : 0, hash key : 967
[9]Searching for function: SHOW_MENU
Testing : SHOW_MENU
Found : SHOW_MENU, hash key : 334
Creating variable : MENU_LABEL, at depth : 1, hash key : 455
Creating variable : SHOW_MENU, at depth : 1, hash key : 334
[13][14]Creating variable : MENU_NAME, at depth : 1, hash key : 60
[15][16]Creating variable : ITEMS, at depth : 1, hash key : 47
[17]Creating variable : ITEMS_SZ, at depth : 1, hash key : 345
Searching for function: READ_STRING_ARRAY
Testing : READ_STRING_ARRAY
Found : READ_STRING_ARRAY, hash key : 477
Searching for function: ITEMS
Creating variable : A, at depth : 2, hash key : 204
Creating variable : READ_STRING_ARRAY, at depth : 2, hash key : 477
[23]Creating variable : LBOUND, at depth : 2, hash key : 145
[24]Creating variable : I, at depth : 2, hash key : 356
Creating variable : J, at depth : 2, hash key : 29
Creating variable : S, at depth : 2, hash key : 290
[25][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][28][29][30][31][26][27][32][33]Deleting S, 2, 290
Deleting J, 2, 29
Deleting I, 2, 356
Deleting LBOUND, 2, 145
Deleting READ_STRING_ARRAY, 2, 477
Deleting A, 2, 204
[18]
Searching for function: MM.PROMPT
> run "menu-redux-1.bas"
[7][8]Creating variable : MENU_LABEL, at depth : 0, hash key : 967
[9]Searching for function: SHOW_MENU
Testing : SHOW_MENU
Found : SHOW_MENU, hash key : 334
Creating variable : MENU_LABEL, at depth : 1, hash key : 455
Creating variable : SHOW_MENU, at depth : 1, hash key : 334
[13][14]Creating variable : MENU_NAME, at depth : 1, hash key : 60
[15][16]Creating variable : ITEMS, at depth : 1, hash key : 47
[17]Creating variable : ITEMS_SZ, at depth : 1, hash key : 345
Searching for function: READ_STRING_ARRAY
TeError: System fault - possible causes
- Incorrect use of POKE
- Faulty CSUB
- Reserved words used as variables
- Firmware problem
Searching for function: MM.STARTUP
Searching for function: MM.PROMPT


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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 06:55pm 24 Oct 2020
Copy link to clipboard 
Print this post

Subsequent RUNs without an intervening RESET don't seem to display the problem.

... I'm not convinced I'm looking at the same same issue as with the real "menu" program, but until this one is cleaned up it is difficult to make progress.

Tom
Edited 2020-10-25 05:26 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10181
Posted: 09:31pm 24 Oct 2020
Copy link to clipboard 
Print this post

Tom

I'm beginning to think it is a caching issue - will look more tomorrow. Can you create any problems without mp3 playing?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 11:03pm 24 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  Tom

I'm beginning to think it is a caching issue - will look more tomorrow. Can you create any problems without mp3 playing?


Sorry Peter I haven't had any further time this evening and I don't think I'll have any tomorrow either. I did see a system fault when I tried *replay in "Pirate Adventure" but that then seemed to disappear with the version that fixed CLEAR ... not that I was using CLEAR.

I'll try and make time to finish going through the Welcome Tape as soon as I can.

Prior to this experimental version TweakerRay and I were seeing various peculiarities with playing this MP3 which he eventually concluded were because it had an embedded image. This version does not have that image.

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10181
Posted: 02:22pm 25 Oct 2020
Copy link to clipboard 
Print this post

That was difficult - eventually tracked the problem to the 3rd party mp3 codec corrupting memory outside of its space. I've found an updated version and that seems to have fixed the problem. Please try and break (but no too hard   )



CMM2V1.5.zip


This version also fixes strange bug in blit when both the read and write pages are in SDRAM and the transfer is not word aligned
Edited 2020-10-26 05:21 by matherp
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1566
Posted: 08:50pm 25 Oct 2020
Copy link to clipboard 
Print this post

FYI:
The Welcome tape seems to work better now (5.05.06RC6).
But from brownian.bas I get the following message:
Error in ../../common/welcome.inc line 26: Variable type not specified

line 26 is "Local i, s$" in
Function we.sanitise_firmware_version$(v$)
 Local i, s$
 For i = 1 To Len(v$)
   If InStr("0123456789", Mid$(v$, i, 1)) > 0 Then s$ = s$ + Mid$(v$, i, 1)
 Next i
 Do While Len(s$) < 5 : s$ = s$ + "0" : Loop
 If Len(s$) > 5 Then Error "Unexpected firmware version format: " + v$
 we.sanitise_firmware_version$ = s$
End Function


??

Michael
causality ≠ correlation ≠ coincidence
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 09:48pm 25 Oct 2020
Copy link to clipboard 
Print this post

  twofingers said  FYI:
The Welcome tape seems to work better now (5.05.06RC6).
But from brownian.bas I get the following message:
Error in ../../common/welcome.inc line 26: Variable type not specified
...


Thanks Michael, I found that for myself yesterday but haven't pushed the fix. 'i' needs to be changed to 'i%' throughout. I think "brownian.bas" must be using OPTION DEFAULT NONE.

Tom
Edited 2020-10-26 07:49 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1566
Posted: 10:07pm 25 Oct 2020
Copy link to clipboard 
Print this post

Hi Tom,

that works! Great!
BTW: the Brownian program is very impressive!

Kind regards
Michael
causality ≠ correlation ≠ coincidence
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10181
Posted: 10:32pm 25 Oct 2020
Copy link to clipboard 
Print this post

  Quote  I think "brownian.bas" must be using OPTION DEFAULT NONE.

Of course it is - as should every program!!!!!
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 202
Posted: 10:38pm 25 Oct 2020
Copy link to clipboard 
Print this post

Peter - Maybe some blitting / framebuffer problems in 5.0506RC5.  Please see my thread on Graphics Commands, Arrays, and Terminating Conditions.  Due to my lack of experience with blitting / framebuffers on CMM2, this could easily be my problem, too.

- Steve "NPHighview" Johnson
Live in the Future. It's Just Starting Now!
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 10:45pm 25 Oct 2020
Copy link to clipboard 
Print this post

  twofingers said  BTW: the Brownian program is very impressive! [=D>


It's Peter's work not mine, I'm just the curator.

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 10:48pm 25 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I think "brownian.bas" must be using OPTION DEFAULT NONE.

Of course it is - as should every program!!!!!


I still haven't come to a conclusion on that and have been quite happy with OPTION DEFAULT INTEGER. Though the fact that common library code does need to use explicit types means that if I keep going long enough I will probably come round to your point of view.

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

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1566
Posted: 10:51pm 25 Oct 2020
Copy link to clipboard 
Print this post

@Tom
  Quote  It's Peter's work not mine, I'm just the curator.

I know! Anyway, good job! Must be a lot of work.
causality ≠ correlation ≠ coincidence
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4299
Posted: 10:53pm 25 Oct 2020
Copy link to clipboard 
Print this post

  twofingers said  @Tom
  Quote  It's Peter's work not mine, I'm just the curator.

I know! Anyway, good job! Must be a lot of work.


Thanks, it is turning out to be a problem. Plus there is this bloke who keeps making amazing improvements to the firmware that require me to retest everything
Edited 2020-10-26 09:04 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1566
Posted: 11:05pm 25 Oct 2020
Copy link to clipboard 
Print this post

  thwill said  Plus there is this really irritating bloke who keeps making outstanding improvements to the firmware that require me to retest everything

I think he must be overworked too. He does superhuman things.
Edited 2020-10-26 09:06 by twofingers
causality ≠ correlation ≠ coincidence
 
     Page 6 of 8    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025