Page 1 of 1

August AGI Interpreter Update

Posted: Mon Aug 26, 2024 10:47 am
by Manannan
This post is regarding my Sierra AGI interpreter for the CommanderX16 on which I have previously posted.
The last big block of work focused on drawing the screen faster, reducing screen algorithm memory requirements, and drawing the priority screen.

I used an algorithm by the Scanline algorithm by CosmicR, which was already quite optimised.
The source is https://github.com/cosmicr/astral_body and viewtopic.php?p=33151&hilit=forgot#p33151

I optimised it further by mainly:
- Rewriting the C parts as assembler
- Using 8 bit rather than 16 bit math, for coordinates (0 - 167 is the range)
- Using VERA auto increment in the loops
There is probably more that can be done, I can't claim to be the world's best optimizer.

You can see the results here.
https://www.youtube.com/watch?v=GHegsdkEFvE

This complicated screen now takes 120 jiffies or 2 seconds.
The old algorithm took around 6 seconds.
The old algorithm required a queue which chewed up 9 whole banks!
The new algorithm queue takes only 256 bytes.

A future update will focus on reducing the file IO overhead at the very beginning. I don't think you can beat memory mapped IO for this job.

The next block of work will focus on:
- Finishing optimising and tidying the algorithm
- Using the new priority screen to:
-Make background object solid so the character can't walk through them
-Adding the 3D effect. Making the character able to walk behind background objects