A* implementation for msx

Page 1/3
| 2 | 3

By ARTRAG

Enlighted (6923)

ARTRAG's picture

12-05-2011, 00:58

Edit the levlmap.map file with any text editor: '.' is free, any othe char is blocking, leave a blank line, put coords for destination and source, save the file and run path.com under msxdos under screen 1 (i.e. mode 32)

The program will lead the '@' to the '$' across the maze you designed

Code and bin files at:

https://sites.google.com/site/devmsx/home/a-pathfinding-for-msx

(compile with HiTech C v7.8)

Login or register to post comments

By ARTRAG

Enlighted (6923)

ARTRAG's picture

12-05-2011, 08:20

@assembler

it takes a lot of time now, but it can be a good starting point to be optimized
(e.g. moving double to int and int to char whenever possible)

By assembler

Champion (414)

assembler's picture

12-05-2011, 08:40

I don't know if i will be capable to pass THAT to assembler, though it would be nice.

oO

By ARTRAG

Enlighted (6923)

ARTRAG's picture

12-05-2011, 08:48

I can give you the ASM files, no prob.
But I suggest to optimize the C code first so that teh asm files go smaller and simpler
BTW do you have HiTech C v7.8?

By ARTRAG

Enlighted (6923)

ARTRAG's picture

12-05-2011, 08:51

Mail me and i'll send you the files

By ARTRAG

Enlighted (6923)

ARTRAG's picture

12-05-2011, 10:21

ASM files included in the same repository https://sites.google.com/site/devmsx/home/a-pathfinding-for-msx
(generated by the the C compiler)

By assembler

Champion (414)

assembler's picture

12-05-2011, 13:04

oO

Thanks a lot

I will study them when I come to home.

By ARTRAG

Enlighted (6923)

ARTRAG's picture

13-05-2011, 00:47

new faster version at:
https://sites.google.com/site/devmsx/home/a-pathfinding-for-msx
(no more double/floats, integers only)

By ARTRAG

Enlighted (6923)

ARTRAG's picture

13-05-2011, 18:50

@assembler
Have you studied the code?
I think that a huge speed up could come from avoiding to pass nodes as values across functions that mange lists
Passing/returning pointers should be possible the most part of the time, thus saving a lot of push/pop and ldir in the assembed code

By assembler

Champion (414)

assembler's picture

13-05-2011, 20:12

I suppose that is possible to reduce the size a little, but 17KB is too big for my little game. Now I have 9KB Free and I need it for the musics and the IA.

I will use some type of movement blindly to avoid the obstacles, but I will keep your code for future references.

Thanks a lot

By ARTRAG

Enlighted (6923)

ARTRAG's picture

14-05-2011, 01:45

I was already arrived to 15 KB by rewriting some loops (in the "for" loops, changing indexes of arrays to pointers cuts CPU time and code space).
Naturally, the real jump in performaces would be passing to asm each single functon starting from the inner one.
BTW I'll not go any further if you do not need the code.

Page 1/3
| 2 | 3