Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:39 02 May 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.06RC7

     Page 4 of 4    
Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 499
Posted: 08:37pm 10 Nov 2020
Copy link to clipboard 
Print this post

There is an issue with the math v_mult command. If we use the same array to the in argument and the out argument the out values will be wrong.

math v_mult matrix(),vertices(),vertices()
 
chris
Regular Member

Joined: 24/08/2020
Location: United Kingdom
Posts: 56
Posted: 09:15pm 10 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  Perspective transforms in V5.05.06RC16

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






mode 1,16
load jpg "image2"
image warp_h 0,0,400,385, 400,0,385, 600,85,385-170
image warp_v 0,0,400,385,  0,385,400,  100,385*1.5,200
do:loop


The new commands are:

IMAGE WARP_H x, y, w, h, x1, y1, h1, x2, y2, h2 [,readpage] [,dontcopyblack]
IMAGE WARP_V x, y, w, h, x1, y1, w1, x2, y2, w2 [,readpage] [,dontcopyblack]


x, y, w, h defined the top left coordinates and the width and height to read from the current write page or optional read page
In both cases x1 and x1 define the top left corner of the area to write
In both cases x2 and y2 define the top right corner of the area to write
When warping horizontally h1 and h2 define the height of the transformed area at the left edge and right edge
When warping vertically w1 and w2 define the width of the transformed area at the top edge and bottom edge

Enjoy  




  Quote  I suspect you'll say isn't worth fixing

Correct


I wonder if this is fast enough so that the Wolfenstein BASIC port can use real texture mapping now?
 
jirsoft

Guru

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

Hi Peter,
I lost twice on RC15 and RC16 program including backup. It was after copying whole row in EDITOR, some strange chars appeared instead of correct ones on the end of the line, then CMM2 colapsed with firmware error message and program and backup had 0 bytes length.

No CSUBs in the code...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
qwerty823
Newbie

Joined: 30/07/2020
Location: United States
Posts: 30
Posted: 10:18pm 10 Nov 2020
Copy link to clipboard 
Print this post

I haven't lost a file yet, but earlier I had some strange chars in a file I was editing on RC15, so I second what Jiri had happen.

Also, no CSUBS, but I was using a MEMORY SET to see if that could clear the screen faster, but it happened even after commenting it out (and I'm pretty sure it had the address and sizes right, as it WAS working, just not really any faster).
Edited 2020-11-11 08:19 by qwerty823
 
matherp
Guru

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

If you are seeing editor issues please report exact configuration of options
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6212
Posted: 11:24pm 10 Nov 2020
Copy link to clipboard 
Print this post

I always knew my dog was a bit warped:



 MODE 1,16
 LOAD JPG "face"
 
 FOR n = 0 TO 390 STEP 10
   shift = SIN(RAD(n))*20+20
   shift2 = SIN(RAD(n+10))*20+20
   IMAGE WARP_H n,0,10,390, 400+n-1,shift,390, 410+n-1,shift2,390
 NEXT n
 
DO:LOOP UNTIL INKEY$ <> ""


Jim
VK7JH
MMedit
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 523
Posted: 11:50pm 10 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  Perspective transforms in V5.05.06RC16
....


Do you ever sleep? Another amazing update! Thank you!      
 
matherp
Guru

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

  Quote  There is an issue with the math v_mult command. If we use the same array to the in argument and the out argument the out values will be wrong.

This should give an error, the arrays should not be the same - will do in next release
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 11:12am 11 Nov 2020
Copy link to clipboard 
Print this post

  chris said  I wonder if this is fast enough so that the Wolfenstein BASIC port can use real texture mapping now?

The answer is: yes and no.

No, if I continue using a classic raycasting can't be considered as a real texture mapping and one of the main "CPU eater" is the excessive loops of the classic raycast implementation.

Yes, anyway it can be faster if I change the raycast to make slices in a way to use the warped textures to follow the perspective. At least I believe it can bring better quality to the rendering.

But the best approach that I will try is to rewrite all the engine to not use the classic raycast algorithm and see if the there is a speed improvement, and principally if the render quality can be upgraded to show the textures at the PC level.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 07:43pm 11 Nov 2020
Copy link to clipboard 
Print this post

Another matrix manipulation in V5.05.06RC17

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

This is the opposite of MATH SLICE and allows you, for example,  to substitute a single vector into an array of vectors with a single instruction

MATH INSERT targetarray(), [d1] [,d2] [,d3] [,d4] [,d5] , sourcearray()
e.g.
OPTION BASE 1
DIM target(3,4,5)
DIM source(4)=(1,2,3,4)
MATH INSERT target(), 2, , 3, source()
The blank index specifies the  slice to be inserted. i.e. the source array elements are copied into it

In addition I've optimised further IMAGE RESIZE_FAST when either the heights are the same, the widths are the same or both are the same (NB in the latter case the code is the same as a BLIT command.
It should be noted that because of the layout of video memory resizing just the width is much more efficient than just the height or both dimensions at the same time.

Check the video - code below:

I've added a warning if you start a new selection with an unpasted selection already in the buffer. Just press F4 or Ctrl-S or Shift-arrow again to ignore the warning

Finally, I've done more work on the memory management in the editor to try and overcome the issues reported in RC15 and RC16. Please let me know if you still see hit a problem and please report as much detail as possible (default screen mode etc.)

mode 1,16
option explicit
option default none
dim integer sines(61)
dim integer i,j,y
for i=0  to 60
sines(i)=cint(cos(rad(i*3-90))*8)
if sines(i)=0 then sines(i)=1
j=j+sines(i)
next i
page write 1
load bmp "tiger800"
page write 2
cls
do
 j=0
 for i=0 to 60
   image resize_fast 50,(i*8 + y) mod 480,680,8,25+sines(i)*2,150+j,680,sines(i),1
   j=j+sines(i)
 next i
 y=y+8
 circle 26,304,154,2,0.1,rgb(white),rgb(green)
 page copy 2 to 0,b
loop

Edited 2020-11-12 06:02 by matherp
 
George H
Newbie

Joined: 03/07/2020
Location: United States
Posts: 31
Posted: 03:26am 12 Nov 2020
Copy link to clipboard 
Print this post

Hi all, new here, CMM1 and CMM2 user.

It's probably me, but running RC15, the settick command seems broken.  The system stops execution and drops to the command prompt with no error message after executing the settick statement.

This silly program:  


print "hi"

settick 5, test

print "there"

do
loop

sub test

print "this is a test"

end sub

Print "hihi"


Gives 'hi', then drops to the prompt.  Expected a screen full of text and infinite loop.  What am I goofing up?

Thanks, George
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6212
Posted: 04:19am 12 Nov 2020
Copy link to clipboard 
Print this post

  George H said  Hi all, new here, CMM1 and CMM2 user.

It's probably me, but running RC15, the settick command seems broken.  The system stops execution and drops to the command prompt with no error message after executing the settick statement.

Thanks, George


Welcome to the group.

Works OK on RC17, so try that before tearing your hair out.

Jim
VK7JH
MMedit
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3988
Posted: 08:23am 12 Nov 2020
Copy link to clipboard 
Print this post

What happens with a longer settick - maybe 500 - to give it longer?

John
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 03:22pm 12 Nov 2020
Copy link to clipboard 
Print this post

Also, the main program is a tight buzz that is not giving the ISR any CPU time; try adding a small pause in the loop to give the scheduler some time to do its job.

-Bill
 
George H
Newbie

Joined: 03/07/2020
Location: United States
Posts: 31
Posted: 04:20pm 12 Nov 2020
Copy link to clipboard 
Print this post

Thanks all - I did try larger values on settick, no change.  Inserted a pause in the do/loop to no effect, but, it apparently never enters it as evidenced by not printing "there" first.

Anyway, I'll install RC17 and give it a go.

-G
 
matherp
Guru

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

Your program as listed works perfectly on RC15. Check for junk characters in the file or some other typo.

Use autosave "ticktest" and then cut and paste your listing above into teraterm then F2
and you will get the expected messages
 
George H
Newbie

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

OK based on that information, I just cycled the power and ran it again, still on RC15, and all is well now.  Not sure why, but I'll do that next time before posting in forums.  

Just for information, this was just a test program - it was also failing in another program I'm playing with, wanting to twinkle a star field on interrupts.  I'll run that now, I'm sure it's fine.  

Thanks all for the replies.  Did I mention I love the CMM2? I do! Kudos to all who have contributed to it.  

-G
 
jirsoft

Guru

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

Hi Peter,
I have in EDITOR the RC17 same problem as in RC16. When I run the program I get either Error in line 0: Syntax (on line 0 is just OPTION EXPLICIT) or with other version (I'm saving every after some time new version) I get scrambled text that can't be fixed:
FUNCTION NCpath(p AS STRING) AS STRING)

will be
FUNCTION NCpath(p STRIN A ASTSTNGNG

after save.

my config is:

CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 60,100
OPTION BAUDRATE 230400
OPTION USBKEYBOARD US
OPTION KEYBOARD REPEAT 500,80


Program is running in MODE 1,16...
And sometimes I have scrambled other
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 10:47pm 12 Nov 2020
Copy link to clipboard 
Print this post

Please put the baudrate back to 115200 and see if the problem still occurs. How big is the program?
Also, unless you are using teraterm/MMEdit, try OPTION CONSOLE SCREEN, OPTION CONSOLE SAVE
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 523
Posted: 11:54pm 12 Nov 2020
Copy link to clipboard 
Print this post

[deleted- posted to wrong thread]
Edited 2020-11-13 09:55 by PeteCotton
 
     Page 4 of 4    
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