Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:34 01 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: Nasty play/run/execute bug that is holding up Welcome Tape

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 05:54pm 13 Oct 2020
Copy link to clipboard 
Print this post

Hi Peter,

Here is another one of my freaky examples, I promise the real code isn't such nonsense - it's just the cycle of launching programs from the Welcome Tape and then quitting them to return to the menu:

> list "one.bas"
Print "One"
Play mp3 "TweakerRaySpaceFlight.mp3"
Pause 5000
Execute "Run " + Chr$(34) + "Two" + Chr$(34)

> list "two.bas"
Print "Two"
Pause 500
Execute "Run " + Chr$(34) + "One" + Chr$(34)

> run "one.bas"
One
Two
One
Two
One
Two
One
Error: System fault - possible causes
- Incorrect use of POKE
- Faulty CSUB
- Reserved words used as variables
- Firmware problem
>


Consistently crashes after the same number of "iterations".

Happens with both OPTION FLASH and OPTION RAM.

I'm assuming the actual .mp3 file doesn't matter, the one I'm using it a bit big to attach, plus I'd need TR's permission.

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: 10310
Posted: 06:23pm 13 Oct 2020
Copy link to clipboard 
Print this post

Try it with a PLAY STOP before the execute
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 06:30pm 13 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  Try it with a PLAY STOP before the execute


I tried that before, and I have just tried it again. It didn't help. Also tried adding a PAUSE 1000 between PLAY STOP and EXECUTE, it didn't help.

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 06:45pm 13 Oct 2020
Copy link to clipboard 
Print this post

The mp3 file may be a red herring:
> list "one.bas"
Print "One"
'Play mp3 "TweakerRaySpaceFlight.mp3"
Pause 50
'Play Stop
'Pause 1000
Execute "Run " + Chr$(34) + "Two" + Chr$(34)
'Run "Two.bas"

> list "two.bas"
Print "Two"
Pause 10
Execute "Run " + Chr$(34) + "One" + Chr$(34)
'Run "One.bas"

> run "one.bas"
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
One
Error: System fault - possible causes
- Incorrect use of POKE
- Faulty CSUB
- Reserved words used as variables
- Firmware problem
>


Last week BigMik reported an apparently random crash with the "Welcome Tape" to me that with the benefit of hindsight was probably this.

Best wishes,

Tom
Edited 2020-10-14 04:46 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
TweakerRay

Senior Member

Joined: 01/08/2020
Location: Germany
Posts: 138
Posted: 07:16pm 13 Oct 2020
Copy link to clipboard 
Print this post

@ tom: would it help if you get the mp3 in a lower quality ? I mean it's in 320kbit/s
I could try to reduce that if that may be too much for the cmm2 ? But I use a 320kbit file in my newest game "HEART ATTACK" and there it plays the music...

@matherp
I also experienced a few times some crashes while starting some of my own programms.
crashes which need to restart the machine. I also saw the error message a few times tom had... randomly...
I checked also some .mod files (for instance in the wolfenstein demo is a folder with .mod files... some play and one will crash my machine: called "alieni_vol_1.mod"
if you have the wolf3d demo you could check that.
Or are some modfiles not for playback ?
http://tweakerray.bandcamp.com
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 08:35pm 13 Oct 2020
Copy link to clipboard 
Print this post

  TweakerRay said  I checked also some .mod files (for instance in the wolfenstein demo is a folder with .mod files... some play and one will crash my machine: called "alieni_vol_1.mod"
if you have the wolf3d demo you could check that.
Or are some modfiles not for playback ?

This is strange behavior, this MOD always played well here. All MODs that I use in my games I edit them on the OpenMPT and save as protracker format, including with limited frequency to the Amiga standard.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 09:59pm 13 Oct 2020
Copy link to clipboard 
Print this post

It's as if Execute with Run doesn't fully initialise things and so eventually crashes with something like a stack overflow.

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 07:21am 14 Oct 2020
Copy link to clipboard 
Print this post

Not easily solvable - the issue is stack overflow. Playing MP3 just happens to hammer the stack. You will have to put a counter in your program (VAR SAVE) and get the user to re-run when the counter expires.

> list "zero.bas"
var clear
Execute "Run " + Chr$(34) + "One" + Chr$(34)

> list "one.bas"
var restore
Print "One"
print a,hex$(mm.info(stack))
a=a+1
if a=5 then end
var save a
Pause 5000
Execute "Run " + Chr$(34) + "Two" + Chr$(34)

> list "two.bas"
Print "Two"
Pause 500
Execute "Run " + Chr$(34) + "One" + Chr$(34)
Edited 2020-10-14 17:30 by matherp
 
matherp
Guru

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

OK ignore the above - had a brainwave - try the attached


CMM2V1.5.zip
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 08:50am 14 Oct 2020
Copy link to clipboard 
Print this post

Hi Peter,

  matherp said  Not easily solvable - the issue is stack overflow. Playing MP3 just happens to hammer the stack...


I dearly hope this is one of those occasions where you go off back to your shed and 4 hours (or less) later have fixed the problem.

As it is (except for the workaround I have provided below) this excludes any application where multiple programs cooperate to achieve a result, including any sort of shell program (GUI or command line) unless all its applications are built into the shell itself. Note even with this issue fixed the applications still have to know they were launched by, and return control to the shell ... unless we get something built into the firmware at a later date to facilitate this - I AM NOT ASKING NOW - first write the shell, then hassle the firmware guru.

From a position of complete ignorance (and thus probably "talking sh*t") I am guessing at the moment that when you have to act on an EXECUTE "RUN ..." you "perform X" to start the new program. Would an alternative be to set a flag, unwind (as if encountering an END) and then if the flag is set then "perform X" ?

  Quote  You will have to put a counter in your program (VAR SAVE) and get the user to re-run when the counter expires.


That doesn't even qualify as a bad workaround

For the moment I'm back to doing this as suggested by @TassyJim many months ago before EXECUTE was added to the firmware:
> list "one.bas"
Print "One"
Print "Stack = " + Hex$(Mm.Info(STACK))
Pause 50
Open "/run.tmp" For Output As #1
Print #1, "Run " + Chr$(34) + "Two" + Chr$(34)
Close #1
Run "/run.tmp"

> list "two.bas"
Print "Two"
Pause 10
Open "/run.tmp" For Output As #1
Print #1, "Run " + Chr$(34) + "One" + Chr$(34)
Close #1
Run "/run.tmp"


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: 4311
Posted: 08:53am 14 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  OK ignore the above - had a brainwave - try the attached

CMM2V1.5.zip


You make a rod for your own back my friend, I will go and fire up the Windows box.

Cheers,

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

Guru

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

THAT FIXED IT

You're "the man" Peter, thank you.

Back to the "code mines" for me,

Tom
Edited 2020-10-14 19:15 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
TweakerRay

Senior Member

Joined: 01/08/2020
Location: Germany
Posts: 138
Posted: 05:11pm 14 Oct 2020
Copy link to clipboard 
Print this post

I checked the welcome tape a little... what I found is that the pirate game had
a missing characters of the written text on the left side.

didn't you want to use the polysynth programm ? Have not seen that.
and no music on the beginning ... i may have the wrong file ? Where can i download the latest version ?
http://tweakerray.bandcamp.com
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 05:44pm 14 Oct 2020
Copy link to clipboard 
Print this post

Hi TR,

  TweakerRay said  I checked the welcome tape a little... what I found is that the pirate game had a missing characters of the written text on the left side.


I suspect your monitor is not properly adjusted for the mode that it uses. There may be an auto adjust feature on your monitor and/or manual hpos and vpos conttol

  Quote  didn't you want to use the polysynth programm ? Have not seen that.
and no music on the beginning ... i may have the wrong file ? Where can i download the latest version ?


There was a download link for an alpha version in the same email where I pointed you at the experimental firmware. Polysynth is included but I haven't fully integrated it with the menu yet.

Best wishes,

Tom
Edited 2020-10-15 03:55 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
TweakerRay

Senior Member

Joined: 01/08/2020
Location: Germany
Posts: 138
Posted: 07:05pm 14 Oct 2020
Copy link to clipboard 
Print this post

nope the screen was centered... and I had big borders around... so not screen problem of my tv...

I also have just tried to play a few mp3... a big mp3 with 12 mb which played a long time ago did not work... a different one worked and the spaceflight music did stuck and did work some times and sometime not... I suspect that the mp3 player from the color maximite might have problems with integrated coverimages ? Because they are in the header of the file and I just erased the coverartwork (which is sad since I think its cool to have that in the mp3) but I guess this might confuse the player... I try that out a little more... but I guess I am on a right track... also the tags which are in the mp3 might be a problem ? But I guess its the artwork... its a jpg which is in the mp3 so this might cause the problem.
http://tweakerray.bandcamp.com
 
TweakerRay

Senior Member

Joined: 01/08/2020
Location: Germany
Posts: 138
Posted: 07:09pm 14 Oct 2020
Copy link to clipboard 
Print this post

yep its the coverartwork... after i erased it out of the mp3 then the mp3 plays flawlessly in the commandline browser... this is unexspected since it worked before with the artwork. did something change in the player ? That now the artwork is a problem ?
http://tweakerray.bandcamp.com
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025