Page 1 of 1

AGI for Beeb

Posted: Mon Jul 27, 2020 6:22 pm
by dudleysoft71
I think this is the right section for this, I've been working on a port of NAGI, in interpreter for Sierra's AGI adventure games.

It requires an ARM Co-processor, however that includes BeebEm's ARM7TDMI one, so unlike my other port project this one is a lot more accessible.

I'm still working on finalising the documentation. Since I can't distribute the game files with the engine, I've setup a simple batch file that allows you to place the DOS version of the game in a folder and inject the correct files into a folder for the Beeb version. Those can then be put into an ADFS (sorry no DFS, the games are too big) disk image and loaded onto any beeb that supports the Co-processor.

The games support VideoNULA if you have it but work equally as well with dithering on the standard mode 2 palette.
Screenshot 2020-07-27 12.54.41.png
In some ways I prefer the dithered Mode 2 palette to the original EGA colours (and it beats playing in CGA on the 80128 Co-processor)

I'm putting together a full package that will include build folders for King's Quest I, Leisure Suit Larry, Police Quest I and Space Quest I. The engine supports a lot more games so I'll include instructions on how to setup more games in the package.

At the moment the engine isn't complete, sound is still not implemented, but save/load does work. Joystick is not in yet and the menu isn't functional (it appears but options don't work)

Re: AGI for Beeb

Posted: Mon Jul 27, 2020 7:13 pm
by Lardo Boffin
Looking good! =D>

Re: AGI for Beeb

Posted: Tue Jul 28, 2020 12:49 pm
by fuzzel
Impressive! I enjoyed playing Leisure Suit Larry on my brother's C64 bitd so am looking forward to this.
From memory that's the game in your picture?

Re: AGI for Beeb

Posted: Tue Jul 28, 2020 1:51 pm
by dudleysoft71
Yes it is, right at the start (after the adult check), should be familiar to anyone who's played it before.

I haven't tested extensively but I played a fair bit of LSL for test purposes and it seems to be stable and it works as expected. I've also tested King's Quest I, Police Quest I and Space Quest I, they all seem to be working fine. Police Quest and Space Quest wont fit on an ADFS floppy though, which means those two will have to be HDD only for now, unless it's possible to use 800k ADFS floppies with ADFS on the Beeb.

Re: AGI for Beeb

Posted: Tue Jul 28, 2020 5:27 pm
by dudleysoft71
Okay, here's a very much work in progress build, I make no guarantee that you'll be able to get it working, I've tried to make the process as simple as possible, I did look at trying to automate the process of building the ADFS images, but found that disks created that way wouldn't load under BeebEm so that kind of defeats the purpose of using it.
NAGI_Beeb.zip
(755.67 KiB) Downloaded 19 times
There's a readme file in the zip, but in essence copy the dos version of the game you want to play (King's Quest, Leisure Suit Larry, Police Quest or Space Quest) into the appropriate folder (DOS\KQ, DOS\LSL, DOS\PQ or DOS\SQ) and run cpgame.bat <game_id> (KQ,LSL,PQ or SQ) to copy the files into the beeb folder for the game (if you've setup all 4 then you can run cpgames.bat instead.

You can add other supported games (check bin\standard for the full list of supported games) by running mkgame.bat <game_id> (you can get those from the bin\standard ini file section titles), this creates a new folder with the correctly named files, as well as a DOS\<game_id> folder to put the DOS game files in.

The easiest way to build the disk image is to use Beeb Image http://www.cowsarenotpurple.co.uk/beeb-image.html and create a new ADFS disk image (or to open a HDD image) and add the files from an appropriate folder, it should be noted that PQ and SQ wont fit on a standard 640KByte ADFS disk image. It should also probably be noted that using an ADFS floppy on a GoTEK is extremely slow loading, I had to remove the CRC check because it took several minutes to check the CRC for the data files for the game before it would attempt to load it.

Let me know if you have any issues, or if you can help with the automation of disk creation.

Re: AGI for Beeb

Posted: Thu Jul 30, 2020 8:42 pm
by dudleysoft71
I've gotten sound working, although it's pushed my host code to over a page (it's how 260 bytes). I was hoping to keep it to 1 page so it would load just below screen memory. The init function can cross into screen memory since it only needs to be called once.

Here's a video of the intro to LSL running in BeebEm.
https://youtu.be/0QwYH33iYcA
There's some slowdown here, I think I can overcome that, I'm going to "borrow" the frame counter from Frontier so it can correctly call the sound update enough times when the frame rate drops (mainly when loading and large screen changes)

Re: AGI for Beeb

Posted: Fri Jul 31, 2020 6:16 pm
by dudleysoft71
The frame counter code definitely helped with the music. I've also fixed a lot of niggly issues, and added support for multiple games under the game directory, along with loading the game using the executable filename.

I've added proper command line parameters, -N for VideoNULA, -M for mouse, -Q for quiet, and -P to specify the path to find games.

I'm putting together a series of disk images and a HDD image with a bunch of AGI Fan games, while I can't distribute the original Sierra games there's a lot of games that can be released.

Re: AGI for Beeb - Renamed BAGI (BBC Adventure Game Interpreter)

Posted: Wed Aug 05, 2020 5:33 pm
by dudleysoft71
BAGI (BBC Adventure Game Interpreter) is now the new name for the port.

Progress report:
Sound: working (almost perfect, long frame transfers affect playback of music)
Game selection menu: working
Mouse: working
ADFS disk creation: working

My biggest issue with the previous release was that I couldn't automate the creation of disk images, turns out the issue I was having with mkadfs was that I'd built it from source in Visual Studio and being windows it was opening the files in text mode (which automatically converts carriage returns into carriage return/line feeds for you) so it was inserting lots of lovely line-feeds into places they shouldn't have been, breaking the disk images.

I'm going to put together a new build, but for now a couple of demos on ADFS disk images:
AGI_Fan_Games.zip
(653.05 KiB) Downloaded 17 times
This has the first AGI Demo disk which has non-interactive demos of 6 games made in AGI, it also has 3 fan games (a Mouse Demo, Apocalyptic Quest which is an impressive demo that requires a mouse and Agent_0055 a spy adventure)
All of these should run using the modified BeebEm 4.15 executable I posted before, as well as on the Pi Native Arm and the Sprow Arm7tdmi co-processors. I will look at trying to put some of the smaller games on DFS disks, they'll have to be DSDs since they will require side 2 for the game data, the main executable file is about 140K on it's own.

Re: AGI for Beeb

Posted: Sat Aug 08, 2020 8:20 pm
by dudleysoft71
Found a major issue with my implementation of getcwd today, turns out reading the directory on in ADFS only returns the name of the current directory, not the whole path. I spent about ab hour or so implementing a recursive version of the function to build up the full path by going up the hierarchy until it reaches the root then unwinding back adding to the path.

The practical upshot of this is that I can now install BAGI anywhere on a Hard disk and it will find any game directories correctly (until you hit the 256 character limit on the path variable).

No new builds since this doesn't affect the Disk images I posted before, unless you tried installing them in folders inside a folder on a hard disk drive.