Оберон-клуб «ВЄДАsoft» https://zx.oberon.org/forum/ |
|
lots of code, https://zx.oberon.org/forum/viewtopic.php?f=10&t=122 |
Страница 1 из 2 |
Автор: | slenkar [ 17 июн 2013, 19:11 ] |
Заголовок сообщения: | lots of code, |
I tried converting my A* pathfinding routine to oberon but for some reason the amount of code makes it not run Код: "OBERON"
if you run it it will say "hello" if you uncomment the functions it will not work Are the functions pushing the main function to the wrong place? So randomize USR 26000 doesnt work as the main function is not at 26000 anymore? |
Автор: | slenkar [ 17 июн 2013, 21:33 ] |
Заголовок сообщения: | Re: lots of code, |
If I put all the pathfinding functions into a different mod file then compile to path,.rel then compile to path.lib it works ![]() |
Автор: | Zorko [ 17 июн 2013, 23:22 ] |
Заголовок сообщения: | Re: lots of code, |
Now the first placed procedure of "main" module is started first. It's not very good, and tomorrow I will try to fix this problem by building a new "crt0.rel" file for SDCC, that will jump to C function "main", then we'll need to use special comment (*$MAIN*) to mark main module (in Oberon environment all modules are equivalent, and there isn't a main module). In Flower.Mod I've solved this problem so: Код: "OBERON"
How do you find Oberon? Is it useful? ![]() ![]() |
Автор: | slenkar [ 18 июн 2013, 00:09 ] |
Заголовок сообщения: | Re: lots of code, |
it is good, it took me a while to figure out that ALL C files have to be placed in the Obj/ folder or I will get linker errors here is the make file I use Код: "OBERON"
|
Автор: | slenkar [ 18 июн 2013, 01:22 ] | ||
Заголовок сообщения: | Re: lots of code, | ||
here is a little pathfinding demo W is a wall
|
Автор: | Zorko [ 18 июн 2013, 18:13 ] |
Заголовок сообщения: | Re: lots of code, |
I was positively impressed by the your little demo. ![]() Also I am grateful to you for your interest to Oberon and ZXDev. You have got very good results in short time. And the information, that was posted by you, will be useful for everyone who wants to try using Ofront under Linux. P.S. I see that hi.tap works in 32x22 resolution. Have you tried to get 32x24 by editing the configuration file "BasicCfg.h"? |
Автор: | Zorko [ 18 июн 2013, 21:28 ] |
Заголовок сообщения: | Re: lots of code, |
See the commit that solves the problem with correct entry point of the main module. I have used this simple crt0.s Код: "ASM" .module crt0 Now we always need to invoke SDCC without option --no-std-crt0 ("ZXDev/Bin/build.bat" is fixed) and use (*$MAIN*) directive to mark the main module (except a case, if a custom building script is used). Yes, for little funny projects with one procedure in main module, I just propose to write own building script with invoking of SDCC with option --no-std-crt0 and without (*$MAIN*) Aha! Since you use Ofront for Linux, just use option (probably -m as I remember?) to say Ofront, while compiling main module, to generate function "main". You can use the comment (*$MAIN*) too - for compatibility with ZXDev. |
Автор: | slenkar [ 18 июн 2013, 21:58 ] |
Заголовок сообщения: | Re: lots of code, |
ok thanks pathfinding can be used for many games like rebelstar Is there a way of converting REAL to INTEGER? like FLOOR, |
Автор: | Zorko [ 18 июн 2013, 22:25 ] |
Заголовок сообщения: | Re: lots of code, |
Sure. It's internal Oberon's procedure ENTIER (x: REAL): LONGINT; To have INTEGER result, just use: Код: "OBERON"
|
Автор: | slenkar [ 18 июн 2013, 23:38 ] |
Заголовок сообщения: | Re: lots of code, |
I cant seem to get entier to work, when linking it says '?ASlink-Warning-Undefined Global '_SYSTEM_ENTIER' referenced by module 'line' in the C source code the function is called SYSTEM_ENTIER without the first underrscore Am I not including a lib file somewhere? Is it something to do with XDev? |
Страница 1 из 2 | Часовой пояс: UTC + 2 часа |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |