Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:20 18 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.06exp: Huge performance improvement - please test

     Page 7 of 8    
Author Message
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 12:28am 26 Oct 2020
Copy link to clipboard 
Print this post

An observation regarding Welcome Tape / Lander and the firmware 5.05.06RC6.

IMHO the rotation is wrong. I use this code to fix it.

' The CMM2 5.05.06 firmware fixes a "bug" present in the direction of rotation
 ' produced by the IMAGE ROTATE command of the 5.05.05 firmware. This code is
 ' intended to identify and use the correct rotation.
 PIXEL 0,1  ' draw one white pixel, left edge middle of a 3x3 region
 IMAGE ROTATE 0,0,3,3,0,0,90
 IF PEEK(byte mm.info(page address 2) + 1) = 255 THEN ' test for pixel top center
   rotfactor = 1
 ELSE
   rotfactor = -1
 ENDIF


The "ghost.bas" file gives me an error message:
Error in line 16: Could not find the file


Please check!
 
Sasquatch

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 01:46am 26 Oct 2020
Copy link to clipboard 
Print this post

Warning: Long I2C timeouts (i.e. 1000ms or greater) can cause the dreaded system fault.
-Carl
 
thwill

Guru

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

  twofingers said  An observation regarding Welcome Tape / Lander and the firmware 5.05.06RC6.

...

Please check!


Thanks. It would help if I knew which version of the Welcome Tape you were using.  If it's a "release" version then the version number, if it's a "develop" version then the SHA from the head of the branch you are using.

Also is it firmware RC6 or an experimental version you are using, in the latter case a link to the dated firmware download would help.

Best wishes,

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

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 11:29am 26 Oct 2020
Copy link to clipboard 
Print this post

Hi Tom,

cmm2-welcome-develop-r0.5.
from: https://www.thebackshed.com/forum/ViewTopic.php?TID=12968&P=5#157612
Is that enough?

Regards
Michael
 
thwill

Guru

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

  twofingers said  Hi Tom,

cmm2-welcome-develop-r0.5.
from: https://www.thebackshed.com/forum/ViewTopic.php?TID=12968&P=5#157612
Is that enough?

Regards
Michael


Thanks, your probably mean the HEAD of that branch:



I'll check it out when I have an opportunity.

Best wishes,

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

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 11:35am 26 Oct 2020
Copy link to clipboard 
Print this post

Hi Tom,

cmm2-welcome-develop-r0.5.
from: https://www.thebackshed.com/forum/ViewTopic.php?TID=12968&P=5#157612

Firmware: 5.05.06RC6 (2020-10-26_001301_CMM2V1.5.zip)

Is that enough?

Regards
Michael
 
thwill

Guru

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

  twofingers said  Is that enough?


Thanks Michael.

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8604
Posted: 09:52am 27 Oct 2020
Copy link to clipboard 
Print this post

Hopefully this is the last experimental version before the next release candidate: V5.05.06exp2. I've now tried pretty much all of the V0.5 welcome tape, zmim, gauntlet, wolf3d, defender, ffight, massive sorts, mouse, classic with mouse, non word aligned blitting to and from SDRAM pages, and so far everything works and is fast.


CMM2V1.5.zip
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 01:10pm 27 Oct 2020
Copy link to clipboard 
Print this post

Hi Peter,

I tested EXP2. No objection from here! Please release!  

A wish for the next version: MM.INFO(FreeDataMemory) would be useful.
Especially because there is an OPTION RAM and an OPTION FLASH with different free memory. Thanks!

Kind Regards
Michael
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 02:23pm 27 Oct 2020
Copy link to clipboard 
Print this post

@Peter ...

Not sure if this belongs in the v5.05.06RC5 thread or here.

I seem to have found a bug in SELECT CASE or I am completely misreading the Manual.

However I try to use SELECT CASE in my program I get


This is the source code that produces the error:
'-------------------------------------------------------------------------------------------
' SELECT CASE Bug v5.05.06B15 and v5.05.06RC6 and EXP VERSION 2020-10-27_194858_CMM2V1.5
'-------------------------------------------------------------------------------------------

'Recommended Program Practice
OPTION EXPLICIT          ' Variables must be typed
OPTION DEFAULT NONE      ' Variables must be declared

'Global Variables and Constants
CONST WIDTH%    = 20       ' Number of Maze Columns (minimum 5) will be doubled+1 size
CONST LENTH%    = 20       ' Number of Maze Rows (minimum 5) will be doubled+1 size

'Declare Global Arrays
DIM m$(2*LENTH%+1) length 2*WIDTH+1   ' Maze String Array, each string 2*WIDTH+1 chars long

'-------------------------------------------------------------------------------------------
' Test Program

DIM mR%                   ' Counter for printing a row of the maze

FOR mR% = 1 TO (2*LENTH%+1)
   m$(mR%) = "#123456789X123456789@123456789X123456789#"
NEXT mR%

'Print Maze Description
CLS
COLOUR RGB(WHITE)
PRINT
PRINT "Width:" 2*WIDTH%+1 "  Length:" 2*LENTH%+1
PRINT

'Display the m$() array contents
COLOUR RGB(BROWN)
FOR mR% = 1 to (LENTH% + LENTH% +1)


'
'
' HERE IS THE BUG, AND THE VARIATIONS I TRIED
'
' This causes the dreaded Error System Fault v5.05.06B15 nd v5.05.06RC6 and 2020-10-27_194858_CMM2V1
'
   SELECT CASE m$(mR%)
      CASE "@"
         COLOUR RGB(RED)
      CASE "X"
         COLOUR RGB(GREEN)
      CASE ELSE
         COLOUR RGB(WHITE)
   END SELECT
   PRINT m$(mR%)
'
' So does this
'    SELECT CASE m$(mR%)
'       CASE "@"
'          COLOUR RGB(RED)
'          PRINT m$(mR%)
'       CASE "X"
'          COLOUR RGB(GREEN)
'          PRINT m$(mR%)
'       CASE ELSE
'          COLOUR RGB(WHITE)
'          PRINT m$(mR%)
'    END SELECT
'
' And This
'    SELECT CASE m$(mR%)
'       CASE "@", "X"
'          COLOUR RGB(RED)
'       CASE ELSE
'          COLOUR RGB(WHITE)
'    END SELECT
'    PRINT m$(mR%)
'
'
'
' Just printing without the COLOUR change works fine !!! No idea why?
'    PRINT m$(mR%)

'
'

NEXT mR%
COLOUR RGB(WHITE)

' Exit Program Gracefully
END

'-------------------------------------------------------------------------------------------

Bug_In_Select.zip
This is a little self contained test program to show the error I seem to have found, with commented sections to show what I tried.
I chopped this out of the program I am working on and made it selfcontained for easier testing (same code posted above).

The firmware versions I tried this on were:
v5.05.06B15 and v5.05.06RC6 and EXP VERSION 2020-10-27_194858_CMM2V1.5

Hopefully this is just me misunderstanding the instructions, or a simple bug fix.

Regards

Womble
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8604
Posted: 02:46pm 27 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Not sure if this belongs in the v5.05.06RC5 thread or here.


This appears to be an MMbasic bug that is in all versions, at least on the CMM2. I've contacted Geoff about it.

In 5.05.05 the system just locks up and ctrl-C doesn't recover it. In 5.05.06 I've implemented a hardware watchdog so you get the watchdog timeout error.

The issue seems to be in the use of an array element in the select case. The workaround is to copy the array element to a simple variable for the select case

t$=M$(mR%)
  SELECT CASE t$

Edited 2020-10-28 01:22 by matherp
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 03:24pm 27 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  The issue seems to be in the use of an array element in the select case. The workaround is to copy the array element to a simple variable for the select case
t$=M$(mR%)
  SELECT CASE t$

@Peter ...

Many thanks for the clarification, workaround, and for replying so fast.

This was the first time I had used SELECT CASE on the CMM2 and it had me completely foxed.

Your help is as always, Greatly Appreciated  

Womble
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 03:57pm 27 Oct 2020
Copy link to clipboard 
Print this post

@womble
I don't understand.

Is it this what you wanted to code:
SELECT CASE mid$(M$(mR%),mR%,1)


??
Michael
 
matherp
Guru

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

  Quote  Is it this what you wanted to code:


That also works without crashing but if you can use SELECT A$ then logically you should be able to use
SELECT ARRAY$(I%) . In both cases the match won't happen if the CASE string and the SELECT string aren't the same. So the code was probably functionally incorrect but shouldn't have crashed.
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 04:45pm 27 Oct 2020
Copy link to clipboard 
Print this post

I can only guess. Maybe that's what Womble means? Something like that?
'Global Variables and Constants
CONST WIDTH%    = 20       ' Number of Maze Columns (minimum 5) will be doubled+1 sizeCONST LENTH%
CONST LENTH%    = 20       ' Number of Maze Rows (minimum 5) will be doubled+1 size

'Declare Global Arrays
DIM m$(2*LENTH%+1) length 2*WIDTH+1   ' Maze String Array, each string 2*WIDTH+1 chars long
DIM mR%                   ' Counter for printing a row of the maze
DIM mC%                   ' Counter for printing a col of the maze

FOR mR% = 1 TO (2*LENTH%+1)
  m$(mR%) = "#123456789X123456789@123456789X123456789#"
NEXT mR%

'Print Maze Description
CLS
COLOUR RGB(WHITE)
PRINT
PRINT "Width:" 2*WIDTH%+1 "  Length:" 2*LENTH%+1
PRINT

'Display the m$() array contents
'COLOUR RGB(BROWN)

FOR mR% = 1 to (2*LENTH% +1)
  For mC% = 1 to (2*WIDTH% +1)
    SELECT CASE mid$(M$(mR%),mC%,1)
       CASE "@"
          COLOUR RGB(RED)
       CASE "X"
          COLOUR RGB(GREEN)
       CASE ELSE
          COLOUR RGB(BLUE)+&HA000
    END SELECT
    PRINT mid$(M$(mR%),mC%,1);
 NEXT mC%
 PRINT
NEXT mR%

COLOUR RGB(WHITE)

' Exit Program Gracefully
END

Edited 2020-10-28 03:17 by twofingers
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 07:08pm 27 Oct 2020
Copy link to clipboard 
Print this post

  twofingers said  An observation regarding Welcome Tape / Lander and the firmware 5.05.06RC6.

IMHO the rotation is wrong. I use this code to fix it:

<snip>

The "ghost.bas" file gives me an error message:
Error in line 16: Could not find the file

Please check!


Odd, with "exp2"

Most of the time Lunar Lander seems to work correctly, but just once it started up with controls reversed and some minor colour changes in the lander sprite.

I don't see that problem with "ghost.bas", but I believe Peter has.

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 07:14pm 27 Oct 2020
Copy link to clipboard 
Print this post

  thwill said  Most of the time Lunar Lander seems to work correctly, but just once it started up with controls reversed and some minor colour changes in the lander sprite.


OK, I've now seen it twice. I think the controls are fine because if you ignore the sprite the thrust occurs in the correct direction ... I think it's a graphical glitch and the sprite is being horizontally flipped for some reason - WTF! If it's a graphical issue it may also explain why the sprite colour looks off.

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

Joined: 02/06/2014
Location: Germany
Posts: 1141
Posted: 07:19pm 27 Oct 2020
Copy link to clipboard 
Print this post

Hi Tom,

with EXP2 this
IF PEEK(byte mm.info(page address 2) + 1) = 255 THEN ' test for pixel top center
  rotfactor = 1
ELSE
  rotfactor = -1
ENDIF
works for me.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 10:29pm 27 Oct 2020
Copy link to clipboard 
Print this post

With the last firmware, a little more complex SELECT CASE sequence makes the CMM2 reset with system fault error.

PS.: Iīm trying to get when it causes the error on the Into The Darkness, as Wolf3D uses almost the same engine and works perfectly.

PS2.: Itīs not related to the SELECT CASE, itīs something with BLIT command that I canīt reproduce (yet).
Edited 2020-10-28 08:45 by MauroXavier
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8604
Posted: 10:43pm 27 Oct 2020
Copy link to clipboard 
Print this post

Mauro

A bug has been discovered with select case when using strings. This is throughout MMbasic on all platforms as far as I can see. I think I have a fix but am waiting on Geoff's opinion. In the meantime avoid using select case with strings - use if, elseif etc.
 
     Page 7 of 8    
Print this page
© JAQ Software 2024