Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:35 11 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.06RC7

     Page 2 of 4    
Author Message
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 01:50pm 30 Oct 2020
Copy link to clipboard 
Print this post

  chris said  
  MauroXavier said  INTO THE DARKNESS works perfectly now!

Thanks for your hard work.


What's the FPS on the old versus new firmware?


In the old firmware, before the hash implementation, it hit about 8-11 FPS, now is about 12-16 FPS without touching the code.

Now I'm trying to reach 15-20 FPS with some optimizations.

It appears to be slow, but the gameplay is reasonably good enough.
Edited 2020-10-30 23:52 by MauroXavier
 
chris
Regular Member

Joined: 24/08/2020
Location: United Kingdom
Posts: 54
Posted: 07:25pm 30 Oct 2020
Copy link to clipboard 
Print this post

  MauroXavier said  
  chris said  
  MauroXavier said  INTO THE DARKNESS works perfectly now!

Thanks for your hard work.


What's the FPS on the old versus new firmware?


In the old firmware, before the hash implementation, it hit about 8-11 FPS, now is about 12-16 FPS without touching the code.

Now I'm trying to reach 15-20 FPS with some optimizations.

It appears to be slow, but the gameplay is reasonably good enough.


That's a wonderful speedup.

I know if you performed pixel by pixel texture mapping in BASIC it would be very very slow, but I wonder how much work it would be to benchmark such an approach. I would imagine if you write a BASIC implementation of texture mapping, that it would be useful to pass that to Peter to see if he could re-implement in the firmware? Seems to me that would be having your cake and eating it, because your game would still be 100% BASIC, but look more accurate, and run possibly at 30fps.

There is so much power to be tapped into, it's very exciting.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 07:56pm 30 Oct 2020
Copy link to clipboard 
Print this post

In my raycaster engine, all the textures are zoomed at each slice of raycast using the IMAGE RESIZE_FAST command from firmware.

The slow part is the raycasting calculation that I tried to optimize at my best but the excessive loops ruin the performance.

If we have some fast texture map command implemented in the firmware, then maybe I try to change the engine to BSP (Binary space partitioning), which is the same used in Doom. For sure I would have some good challenge to create one, as I never developed a BSP engine. To talk the truth, it's the first time I'm developing a 3D game, even my current raycast engine (that is a fake 3D). Before this, all my games were completely 2D tiled based.
Edited 2020-10-31 06:00 by MauroXavier
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 01:16pm 31 Oct 2020
Copy link to clipboard 
Print this post

One more tweak in V5.05.06RC11

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

This now optimises the use of labels for GOTO and GOSUB not that you should be using them but for fun I've posted on the old benchmark thread the impact of the change.

In addition it has a new command CALL

CALL usersubname$ [,usersubparameters,....]


This is an ultra-efficient way of programmatically calling user defined subroutines (not functions).

In many case it can allow you to get rid of complex SELECT and IF THEN ELSEIF ENDIF clauses in a much more efficient way

Examples:
dim calltable$(3) length 3 = ("add", "tak", "div", "mul")
c=10
d=5
for i=0 to 3
 caller calltable$(i),c,d
next i

sub caller a$, x, y
 call a$, x, y
end sub

sub add a,b
print a+b
end sub

sub tak a,b
print a-b
end sub

sub div a,b
print a/b
end sub

sub mul a,b
print a*b
end sub


a$="firstsub"
mysub 8,9
call "mysub", sin(rad(90)),7
call a$,a$
'
sub firstsub x$
 print x$," hello"
end sub
sub mysub a,b
 print a+b
end sub
 
qwerty823
Newbie

Joined: 30/07/2020
Location: United States
Posts: 30
Posted: 03:03pm 31 Oct 2020
Copy link to clipboard 
Print this post

option explicit
option default none
option base 0

Sub EmptySub(i as integer)
End Sub


Dim integer x = 10
Dim integer n
Dim string empty = "EmptySub"

cls
timer = 0
for n = 0 to 100000
 Call empty, x
next n
print timer

produces a

Error in line 5: Not enough String memory

I was trying to time the overhead of using call vs calling the function directly and noticed this error (using V5.05.06RC11 obviously).

BTW, for the curious, what sub got dumped to make room for "Call"?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 06:08pm 31 Oct 2020
Copy link to clipboard 
Print this post

qwerty823

Thanks for the report. You have found a serious bug which is nothing to do with the CALL command but is in most of the V5.05.06 versions
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 06:12pm 31 Oct 2020
Copy link to clipboard 
Print this post

Now if just CALL can be used to call ARM code simple with BL on end...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 06:30pm 31 Oct 2020
Copy link to clipboard 
Print this post

V5.05.06RC12 posted - fixes bad bug in RC10 and RC11 (RC9?)

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip
Edited 2020-11-01 19:00 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 04:26pm 04 Nov 2020
Copy link to clipboard 
Print this post

V5.05.06RC13 posted

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

Fixes bug in Call when used in .INC files
Fixes bug in editor when using large fonts
Fixed another bug I can't remember


Big performance improvement in IMAGE RESIZE_FAST (used for raycasting)

Various internal tidying

For reference - current performance vs V5.05.05


Test           V5.05.05   V5.05.06RC13    Measure
Grainbench      15968      16265       Arbitrary simple benchmark
zmim            1210       1697        Instructions per second
Solar Eclipse   14.08      8.03        Time to complete complex calculation
Speedtest       325826     358830      MMBasic Lines/second
Benchmark       0.328      0.1886      Simple benchmark with GOSUB and GOTO
Wolf3D          14         17.5        Framerate per second
Darkness        13         20          Framerate per second
Bucky Ball      68         54.5        Time to calc and display new position (mSec)

Edited 2020-11-05 02:26 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3854
Posted: 04:41pm 04 Nov 2020
Copy link to clipboard 
Print this post

Impressive.

Are you measuring on a 400 or 480 MHz CMM2 ?

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 08:02pm 04 Nov 2020
Copy link to clipboard 
Print this post

480MHz

Coming tomorrow - array slicing.
Take any dimension of an n-dimensional array and copy it into a 1D array in a single transaction

MATH SLICE sourcearray(), [d1] [,d2] [,d3] [,d4] [,d5] , destinationarray()

e.g.
OPTION BASE 1
DIM a(3,4,5)
DIM b(4)
MATH SLICE a(), 2, , 3, b()

The blank index specifies the  sice to be taken. i.e. copy elements

2,1,3:  2,2,3: 2,3,3: 2,4,3 into b()
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 08:32pm 04 Nov 2020
Copy link to clipboard 
Print this post

Hi Peter,
CALL and large font is working perfectly, but still is problem with the calling SUBs and FUNCTIONs from command line. Where I was able in 5.05.05 call it, now (and I think minimal since RC9) I'm getting Unknown command for SUBs and XXX is not declared for FUNCTIONs.
It's pretty important for debugging, please take look on it...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 08:07am 05 Nov 2020
Copy link to clipboard 
Print this post

  Quote   but still is problem with the calling SUBs and FUNCTIONs from command line

Sorry - fixed it but then lost the fix when I had disk problems and had to restore from backup. Will be fixed AGAIN in RC14 to be posted later today
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3854
Posted: 10:13am 05 Nov 2020
Copy link to clipboard 
Print this post

Hi Peter,

RC 12 & 13 bug just reported over on Facebook:

Run your "Brownian Motion" example (version on the Welcome Tape r0.5) and it craps out immediately with:
Error in line 57: OBJ Local variable already declared


I've looked at the code briefly and it looks fine to me.

Tom
Edited 2020-11-05 20:14 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3854
Posted: 11:32am 05 Nov 2020
Copy link to clipboard 
Print this post

And another new bug present in RC 12 & 13:

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

> list "speech.bas"
Do
 Input a$
 Play TTS a$,72,64
Loop

> run "speech.bas"
? help
? help
Error in line 3: Invalid phonetic text


Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3854
Posted: 12:02pm 05 Nov 2020
Copy link to clipboard 
Print this post

And another issue in new firmware:

Start the "Welcome Tape" menu and select "Show credits":

Error in line 240: A sub/fun has the same name: DENIZENS

There is actually a LOCAL variable conflicting with a "label" (as used by GOTO/GOSUB/RESTORE), but that didn't used to be a problem.

I suspect this is an accidental side-effect of recent optimisations to behaviour of GOTO/GOSUB.

Peter is this behavioural change to be considered a firmware "bug" or a "feature" that I need to change my code to work with?

Either way I think you probably need to update the error mesage.

Best wishes,

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

Joined: 07/10/2011
Location: Australia
Posts: 1328
Posted: 11:19am 06 Nov 2020
Copy link to clipboard 
Print this post

Same problem using RC 12 running Max-E-Man.
"Error in line 188: A sub/function has the same name : GHOSTSTARTPOS"

There is a label GHOSTSTARTPOS: and later in line 188 a variable is dimensioned,
dim ghoststartpos(numghosts,4).

Greg
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 01:38pm 06 Nov 2020
Copy link to clipboard 
Print this post

I had this problem on Demo X and changed the names.

I think it is understandable that the system cannot use a label, function, and variable with the same names.

I see this as a fix than a problem.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 02:27pm 06 Nov 2020
Copy link to clipboard 
Print this post

V5.05.06RC14 posted

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

Should fix all the above bugs. I've fixed the label issue against my better judgement as I think it should give an error but.....

New Functionality:
MATH SLICE sourcearray(), [d1] [,d2] [,d3] [,d4] [,d5] , destinationarray()
e.g.
OPTION BASE 1
DIM a(3,4,5)
DIM b(4)
MATH SLICE a(), 2, , 3, b()
The blank index specifies the  slice to be taken. i.e. copy elements from the slice specified into the target array.
You need as many index parameters as there are dimensions in the sourcearray


MEMORY SET address, byte, numberofbytes
MEMORY SET BYTE address, byte, numberofbytes
MEMORY SET SHORT address, short, numberofshorts '2 bytes per short
MEMORY SET WORD address, word, numberofwords '4 bytes per word
MEMORY SET INTEGER address, integervalue ,numberofintegers [,increment]
MEMORY SET FLOAT address, floatingvalue ,numberofloats [,increment]
MEMORY COPY sourceaddress, destinationaddres, numberofbytes
MEMORY COPY INTEGER sourceaddress, destinationaddress, numberofintegers [,sourceincrement][,destinationincrement]
MEMORY COPY FLOAT sourceaddress, destinationaddress, numberoffloats [,sourceincrement][,destinationincrement]


MATH SLICE Example
dim integer i,j,k
dim integer test(2,3,4), two(2),three(3),four(4)
for i=0 to 2
for j=0 to 3
for k=0 to 4
test(i,j,k)=i+(j<<4)+(k<<8)
next k
next j
next i
math slice test(),,3,4,two()
for i=0 to 2
print hex$(two(i),3), "  ";
next i
print ""

math slice test(),2,,4,three()
for i=0 to 3
print hex$(three(i),3), "  ";
next i
print ""

math slice test(),2,3,,four()
for i=0 to 4
print hex$(four(i),3), "  ";
next i
print ""
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 449
Posted: 04:19pm 06 Nov 2020
Copy link to clipboard 
Print this post

Peter

Is there a command to copy arrays with different dimensions?
 
     Page 2 of 4    
Print this page
© JAQ Software 2024