April 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: 60
Joined: Fri Oct 14, 2022 7:23 am

General - CX16 April AGI Interpreter Update

Post by Manannan »

As you might know from my previous posts I have been working on the construction of a Sierra AGI Interpreter for the CommanderX16. This will allow old Sierra games like King's Quest to run.

These past few months I have been testing games other than King's Quest III, which has helped me to iron out a lot of bugs.

I can now run Space Quest I and II and King's Quest I, as well as the King's Quest III you have previous seen.

https://youtu.be/1QQPcwJxzV4
https://youtu.be/30RIplYHT70
https://youtu.be/NFPKbLQBAso


Each game I fix is easier than the last :).

I removed the loading screen in-between screen loads, as suggested by others previously.

The goal of the next iteration is the implementation of a faster flood algorithm, as well as the drawing of the priority screen.

My current algorithm is slow enough as it is without the priority screen even being drawn.

I will most likely use the Span Filling algorithm as suggested by DragWX ages ago.

It is here for reference: https://en.wikipedia.org/wiki/Flood_fill

I will also implement some basic keyboard input.
cosmicr
Posts: 17
Joined: Tue Nov 14, 2023 4:29 am

Re: April AGI Interpreter Update

Post by cosmicr »

Hey keep up the amazing work!

I forgot that I promised to share my code for my faster pic drawing routine. So anyway here it is:

https://github.com/cosmicr/astral_body

And here is a real-time recording of how fast it is:

Image

It can render this screen in approx 3 seconds. This uses a stack approach on a line by line basis, rather than the diamond queue that you're using. A lot of it is done in assembly. I'm also using a back buffer like the original interpreter used too. The good news is that there is still room for improvement! I reckon I could get it down to 2 seconds or maybe even 1 second!

I notice also you haven't yet implemented sound - if you check out my repo I have done this (albeit there is a new bug I'm hunting at the moment that stops it from working). The main goal for my version of the interpreter is to do it all without using bank ram for code. It's quite the challenge!

My text box display routine is special - it calculates how many 64x64, 32x32, 16x16, and 8x8 sprites would fit in the area, and then uses a palette trick to create black filled sprites behind the text layer and in front of the bitmap layer 0. The corners of the window are petscii chars.

Anyway, pick through my code, you might find some useful things in there. My code is very messy and illogical in places. Take what you like. If you prefer, I could make a modification to your code and do a pull request.
Manannan
Posts: 60
Joined: Fri Oct 14, 2022 7:23 am

Re: April AGI Interpreter Update

Post by Manannan »

cosmicr wrote: Tue Apr 16, 2024 10:24 pm Hey keep up the amazing work!

I forgot that I promised to share my code for my faster pic drawing routine. So anyway here it is:

https://github.com/cosmicr/astral_body

And here is a real-time recording of how fast it is:

Image

It can render this screen in approx 3 seconds. This uses a stack approach on a line by line basis, rather than the diamond queue that you're using. A lot of it is done in assembly. I'm also using a back buffer like the original interpreter used too. The good news is that there is still room for improvement! I reckon I could get it down to 2 seconds or maybe even 1 second!

I notice also you haven't yet implemented sound - if you check out my repo I have done this (albeit there is a new bug I'm hunting at the moment that stops it from working). The main goal for my version of the interpreter is to do it all without using bank ram for code. It's quite the challenge!

My text box display routine is special - it calculates how many 64x64, 32x32, 16x16, and 8x8 sprites would fit in the area, and then uses a palette trick to create black filled sprites behind the text layer and in front of the bitmap layer 0. The corners of the window are petscii chars.

Anyway, pick through my code, you might find some useful things in there. My code is very messy and illogical in places. Take what you like. If you prefer, I could make a modification to your code and do a pull request.
Hello,
Sorry for the late reply.

You have a really great algorithm, and I admit it is objectively better than mine.

I have an enormous amount of memory dedicated to my diamond flood bank queue, which would all be freed up if I used your algorithm.

I would love for you to do a PR, I will drop you a private message.

Thanks

There are some complicated topics I need to discuss with you.
Post Reply