CommanderX16 February 2025 AGI Update
I have an update regarding my CX16 AGI Interpreter.
Over the past few months, I have completed three major tasks:
-Implementation of double buffering: The 3D effect mentioned in my previous post requires redrawing of sprites. To prevent this redrawing from occurring within an IRQ, double buffering was implemented, eliminating sprite flicker.
-Implementation of NPC movement routines: As shown in my GIF, the fairy, wolf, and bridge troll now move. They also remain within the boundaries set by the game.
-Implementation of sprite garbage collection
Focus for the Next Few Months
Developing a more efficient dynamic sprite memory allocator:
My current allocator is highly inefficient, as it allocates sprites in fixed sizes of either 32x32 or 64x64. With double buffering now in place, sprite memory requirements have significantly increased.
I have a C implementation of an allocator that works with blocks based on the smallest sprite size (8x8). If a sprite is larger, it is assigned multiple blocks. I will translate this into assembly code and replace my existing allocator.
Fixing object placement bugs:
There are several issues with object placement in the game. In particular, when the player walks into the moat or transitions to a new screen, objects are sometimes positioned incorrectly, and the Z-ordering is not always handled properly.
The current implementation lacks key logic, and I plan to reference known interpreters such as Lance Ewing’s Agile to improve accuracy.
AGI Interpreter February 2025 Update
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).
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).
Re: AGI Interpreter February 2025 Update
Very cool! I can't wait to see the final product! 

Suite16.au - Commander X16 games and tutorials
Re: AGI Interpreter February 2025 Update
Thanks for the update, and the screen shots - the fairy, troll, and the well!!! Good memories.
Still, I want to HEAR this game, someday ^.^ (oh, we can dual X16 it, use serial card to cue another X16 to play the audio with a few command bytes
)
Still, I want to HEAR this game, someday ^.^ (oh, we can dual X16 it, use serial card to cue another X16 to play the audio with a few command bytes

Re: AGI Interpreter February 2025 Update
Hi Xiphod,
Glad I could take you back to good old days

In terms of getting sounds implemented, here are the next three things I was planning to work on
- Fix Sprite Allocator
- Replace the object placement and movement code with the one in Lance Ewing's Meka
- Sound
The current object placement code is the cause of many bugs, and the game will never be fully playable until I have replaced it.
However if it would make for a better demo I could swap two and three? Is that your motivation?
Thanks
Last edited by Manannan on Fri Mar 07, 2025 11:46 pm, edited 1 time in total.
Re: AGI Interpreter February 2025 Update
The PSG is perfect for playing AGI sounds - I got it working when I was writing my interpreter. Very authentic sounds identical to the Tandy 1000. Really looking forward to seeing this all come together!
Re: AGI Interpreter February 2025 Update
Well, I put it this way: the AGI support on the CoCo3, they never managed audio support. So it would be nice to see that it is something an 8-bit system could pull off (via delegating to a support chip).
The CoCo3 could do multi-channel audio (see CoCoTracker, playing MODs at like 8KHz), but it's difficult to pull off (adapting the channel data to the 6-bit DAC, so there is a load process where that adaptation process is probably using a lot of RAM -- I don't think it's real time computed).
One special thing to me on the early Sierra games was the subtle background audio effects (like birds chirping). Specifically, here's an example of the original KQ1 PCjr version (1min 49 seconds in). Seems many later versions didn't include that background audio effect.
<https://www.youtube.com/watch?v=v5DSFvWrNWA&t=102s>
And for inspiration, here's an easter egg in KQ4 (notice the hamburger in space!)
Re: AGI Interpreter February 2025 Update
I have never heard those sounds before having only played the game on later DOS PC's.Xiphod wrote: ↑Sat Mar 08, 2025 10:55 amWell, I put it this way: the AGI support on the CoCo3, they never managed audio support. So it would be nice to see that it is something an 8-bit system could pull off (via delegating to a support chip).
The CoCo3 could do multi-channel audio (see CoCoTracker, playing MODs at like 8KHz), but it's difficult to pull off (adapting the channel data to the 6-bit DAC, so there is a load process where that adaptation process is probably using a lot of RAM -- I don't think it's real time computed).
One special thing to me on the early Sierra games was the subtle background audio effects (like birds chirping). Specifically, here's an example of the original KQ1 PCjr version (1min 49 seconds in). Seems many later versions didn't include that background audio effect.
<https://www.youtube.com/watch?v=v5DSFvWrNWA&t=102s>
And for inspiration, here's an easter egg in KQ4 (notice the hamburger in space!)
kq4spoof.jpg
The input to my program is the standard DOS version of the game, which lacks these sounds.
I will have to put some effort into obtaining a version of the game with sound effects (maybe Apple II) and modifying my program to be able to read the files.
Re: AGI Interpreter February 2025 Update
I seem to remember these sounds in the original Tandy version also (which had a 3-voice audio).
I might be mis-remembering, but as I recall King's Quest was an "in secret" launch title for the PCjr. IBM had Sierra do NDA's even about it. Then when it launched, IBM used their typical (gray) product covering, making it look really boring. The whole PCjr barely lasted a year before they gave up, and King's Quest was essentially forgotten about for about 2-3 years until it was relaunched for the Tandy 1000 (then maybe also Apple2, Amiga and other platforms).
In that same PCjr link, the audio is in other outdoor scenes, like around 33:00 or 36:30 (also sounds of water/waves).
I might be mis-remembering, but as I recall King's Quest was an "in secret" launch title for the PCjr. IBM had Sierra do NDA's even about it. Then when it launched, IBM used their typical (gray) product covering, making it look really boring. The whole PCjr barely lasted a year before they gave up, and King's Quest was essentially forgotten about for about 2-3 years until it was relaunched for the Tandy 1000 (then maybe also Apple2, Amiga and other platforms).
In that same PCjr link, the audio is in other outdoor scenes, like around 33:00 or 36:30 (also sounds of water/waves).
Re: AGI Interpreter February 2025 Update
Thanks. I managed to obtain the Tandy version. I will take a lookXiphod wrote: ↑Sun Mar 09, 2025 6:57 am I seem to remember these sounds in the original Tandy version also (which had a 3-voice audio).
I might be mis-remembering, but as I recall King's Quest was an "in secret" launch title for the PCjr. IBM had Sierra do NDA's even about it. Then when it launched, IBM used their typical (gray) product covering, making it look really boring. The whole PCjr barely lasted a year before they gave up, and King's Quest was essentially forgotten about for about 2-3 years until it was relaunched for the Tandy 1000 (then maybe also Apple2, Amiga and other platforms).
In that same PCjr link, the audio is in other outdoor scenes, like around 33:00 or 36:30 (also sounds of water/waves).
I have no idea how different the file layout is.
Once I do then I can work out how big a change is needed.