Closed mateusz83 closed 2 years ago
the difference is using fsin
or calling a library function: http://franke.ms/cex/z/E8nxz3
stuttering: what library is used to link against?
crashing:
fsin
is handled by the 68060 support library. maybe that one is buggy?
Thank you for answering..
I tried use sin()
instead sinf()
and I got rid of -ffast-math
It worked SMOOTH like it should but... crashes in a while.. (just like when using sinf() and -ffast-math).
I am only using standard C libs:
#include <math.h>
I have no additional libs in linker only -lm
When I deleted my 68060.library - both sin()
and sinf()
worked jagged (without -ffast-math)
After adding -fast-math it was smooth but crashed.
Tested on WinUAE and A1200+V1200
questions:
Windows setup.exe version from 22 March 2021.
it worked ok?yes - Windows setup.exe version from 22 March 2021
was OK, I was using it all the time
(I switched to linux maybe 1-2 weeks ago to be up to date)
Of course - here are the sources: http://mstanisz.website.pl/tmp/amiga/msRay_devpack_v0.31.zip
EngineCommonLibs/RC_Raycaster.c
file in RC_Read_Input()
functionEngineFrameworkAmiga/src/AMIGA_Framework.c
TheGameOutput/
what I noticed so far: I changed the order of initializing the fpu and loading the libraries. Please try using the libnix folder from your windows version and check if it behaves ok again.
I copied libnix from window to linux, and the movement is still jagged, also everything looks very different: https://i.ibb.co/JRRgJCs/Przechwytywanie.jpg
you have to recompile all once the fix is live. But your program crashes reliably here:
// Free multi screen buffers.
if (FRM_mbuf_screen_buffer[0]) FreeScreenBuffer(FRM_screen, FRM_mbuf_screen_buffer[0]);
maybe it writes outside the buffer?
Hi, thank you very much for help.
Should I get it from: https://franke.ms/download/amiga-gcc.tgz
?
or by git clone https://github.com/bebbo/amiga-gcc
?
I tried bygit clone
andmake all
but there was still jagged. Then I download the daily prebuild from link and
un-tar on linux/wsl - but I get this mesage during compilation: /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
Hi, thank you very much for help. Should I get it from:
https://franke.ms/download/amiga-gcc.tgz
?
this get's an update every night
or by
git clone https://github.com/bebbo/amiga-gcc
?
and this is usually up to date one hour (building and testing takes its time) after a push to the devel1 branch.
I tried by
git clone
andmake all
but there was still jagged. Then I download the daily prebuild from link and un-tar on linux/wsl - but I get this mesage during compilation:/opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
you have missing dependencies, check the https://github.com/bebbo/amiga-gcc/blob/master/README.md and install what's needed to build - that's sufficient to run.
Hello, So I tried today again with fresh reinstalled wsl/ubuntu on Windows.
I downloaded from git hub
and make all
. The sinus is smooth also with '-ffast-math' and without it. I don't know why but that line of code RC_player_z = sinf(RC_player_z_accumulation) * RC_PLAYER_Z_MAX make crash after a two seconds in both cases. Maybe its some bug in my code. When I comment that line I had no crash. I also use sinf() and cosf() in diferent place that works.
I also tried with downloading prebuild from *.tgz archive.. but in this case I still I got that problem withlibmpfr.so.4
during compilation. I can't download that package: libmpfr.so.4.
Anyway I try to do something with that line of code.. if no I will just switch back to the 22 march version..
Thanks for help! Mateusz
that's my built version - with the uncommented line, I mentioned above. frm060_128.zip
It crashes here, if you leave the room and hit the border.
rty this to have movement wíthout using sinf:
// RC_player_z = sinf(RC_player_z_accumulation) * RC_PLAYER_Z_MAX;
static int index;
static float f[] = { -1.0, -0.7, -0.3, -0.1, 0.1, 0.3, 0.7, 1.0};
RC_player_z = f[7 & ++index] * RC_PLAYER_Z_MAX;
Thanks so much for help! I like the idea with array instead of sinf()
to verify that your code draws only inside:
Thats a very good trick, I will try that today..
Hello, So far I was using Windows setup.exe version from 22 March 2021. A few days ago I switched to Windows/WSL-Ubuntu and get the most recent grom github repository ans "make all" (not ndk 3.2)
On Windows I was using these compiler flags for a long time without issues:
-Wall -noixemul -O3 -m68060 -mtune=68060 -mhard-float -fomit-frame-pointer -lm
After switching to Linux recent version I noticed that up/down movement in my FPS engine is no longer smooth sin() result. Instead It feels like sin() output is cut or rounded so the movement is no longer smooth but very jaggy. Please see the example video: https://www.youtube.com/watch?v=5YxbBHIyQlQ
The code is very simple:
I tried to test different flags, and finally noticed that after adding "-ffast-math" the movement is very smooth again !
-Wall -noixemul -m68060 -mtune=68060 -mhard-float -ffast-math -O3 -fomit-frame-pointer
Unfortunately in my case -ffast-math makes my appliaction not stable and it crashes after while - so I can't use it.
Thank You in advance.