August AGI Interpreter Update

Talk about your programs in progress. Discuss how to implement features, etc.
Forum rules
This section is for testing Commander X16 programs and programs related to the CX16 for other platforms (compilers, data conversion tools, etc.)

Feel free to post works in progress, test builds, prototypes, and tech demos.

Finished works go in the Downloads category. Don't forget to add a hashtag (#) and the version number your program was meant to run on. (ie: #R41).
Post Reply
Manannan
Posts: 69
Joined: Fri Oct 14, 2022 7:23 am

General - CX16 August AGI Interpreter Update

Post 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
Post Reply