Posted April 24, 2025 by io.rrwm
#Tutorial #MPAGD #ZX Spectrum #Enterprise
A couple of years ago I started developing games for the ZX Spectrum using MPAGD (version 0.7.10). I found it fairly easy to use, but not without its quirks. About a dozen games later (not all of which were published) and a post on the MPAGD support forum was flagging a problem building an Enterprise version of a game. I'd not really looked at the Enterprise at this point, but I am always keen to help and test things out if able.
From this, I learnt that the AGD engine supplied with MPAGD was a beta version and they needed people with AGD knowledge to write games and try things out, which would lead to identifying (and fixing) bugs and adding extra levels of support. This would then make it easier for the many developers of Spectrum games (using MPAGD/AGD) to transfer their games to the Enterprise.
A few revisions of the code on, and Noel has created a solid implementation of the engine and, with the latest update, added support for common Spectrum Music engines and tools (Beepola, MPAGDMusicizer PT3).
In the first instance you will need a copy of MPAGD. This can be downloaded from: Jonathan Cauldwell's itch.io page. At time of writing the current version is 0.7.10, however I've seen that Jonathan is working on adding support for additional machines and a new version may be on the horizon. (If you've already created a game on the Spectrum using MPAGD, you'll have this already!)
The second thing you will need will be the updated code for the Enterprise engine. At time of writing, this has only been shared via the MPAGD support forum. If it becomes available officially (either as part of the MPAGD codebase or as a stand-alone enhancement) I'll update this page with the details. Essentially this will replace the files in the MPAGD "Suite EP" folder and includes a new version of the AGD engine for the Enterprise, a new version of the CompilerEP.EXE and a lot of assembler code that can be used to add Spectrum music to your game.
I have been given permission to share a link to the updated code for the Enterprise Compiler and Engine : Google Drive Link
Download that ZIP file and extract it into the main MPAGD folder. The contents of the ZIP archive will replace the previous SUITE EP folder and the build-ep.bat file.
MPAGD comes bundled with an Emulator for the Enterprise called: EP128-2.0.11this is a powerful emulator, but it isn't always obvious how to make it work. (I had to reach out for some advice!)
You will find the emulator in the Suite EP\EP128-2.0.11 subfolder and it can be started by typing ep128emu.exe -no-opengl at the command line.
After starting the emulator, the first thing you will need to do is ensure it is configured correctly.
From the main menu, select: Machine, Configure
In the General section, ensure that "Enable virtual File I/O" is selected.
Then select: Memory This is where we tell the emulator which ROMs you are going to need to use, and how much memory the Enterprise will have on board.
Make sure you have set the RAM Size in Kilobytes to 128.
(It may be 64K by default, but this causes the RAM to be contended with the Graphics and can cause slow-down in your games).
Make sure you have your ROM images set to:
00 - exos2.1.rom
04 - basic21.rom
10 - epfileio.rom
These may take a couple of slots, but don't worry. That is normal. The ROMs should be fairly self explanatory. The EXOS is the Operating System, the BASIC is the BASIC programming language and the EPFILEIO is a special ROM that allows you to load files directly from the Host PC's disk, rather than having to use a disk or tape image.
You will need to set the default location on the Host PC disk for EPFILEIO.
From the main menu, select Options and then Set working Directory
You will want to point this to the files subfolder. ( Suite EP\EP128-2.0.11\files )
This is where your exported games will need to go.
The Emulator should automatically save these settings.
Once they are in place, you are free to close the emulator for the time being.
Once all the configuration is sorted for the emulator, you should be ready to convert your first game to the Enterprise. To show and test the process, you are going to create the most basic of games. Open MPAGD. Create a new project. Select the machine to be Spectrum Standard or Spectrum ULAplus. (You do not select Enterprise. At the moment if you create a project specifically targeting the Enterprise, it will fail to build with a "DEFINEPALETTE requires 64 RGB definitions on line 152:" error).
You then create a simple sprite, a simple screen and register a sprite position for the Player respawn location. If you like, define your favourite keys for controlling your sprite. (All of these options are under Editor on the main menu)
You then can use the Script Generator tool to set the basic scripts for movement. Just make the player sprite have the Platformer set of scripts, and have everything else (except for Other Events) left as (existing). Other events set to "Auto Generate" (This will give you the intro menu which will allow you to redefine keys and start the game). If you've made a few MPAGD games already, you will be familiar with all this.
Save your project. I find one of the quirks of MPAGD is you then have to reload the project.
Build your game and confirm it works. It will load up a Speccy emulator window and it should autoload the game.
Now you've confirmed the game works, you need to convert it to the Enterprise.
Export your game; you will not need the TAP image. All you are looking for is the AGD file that gets generated.
I will call my game ETUT001.AGD as it's the Enterprise Tutorial 001. When it comes to naming your game for the Enterprise, you need to use the old 8.3 naming convention (8 characters for the title then a 3 letter file extension). The Enterprise will not support long filenames and could experience problems if you try to load a game with a long name.
You then need to go to the command line; you can do this as a regular user. You do not need admin permissions.
Go to the folder MPAGD is installed in. In my case it is: C:\DEV\V0.7.10-old5\V0.7.10
If you look at what is in this folder, you will see there are a lot of folders that start SUITE. These are the specific build engines and tools for each of those machines. For the Enterprise you will need to change into the SUITE EP folder. So, in my setup, this will be:
CD "C:\DEV\V0.7.10-old5\V0.7.10\SUITE EP"
In the Suite EP folder there are up to 6 folders. (6 in the latest build of the engine/ compiler code). These are
You now need to copy your AGD file you exported earlier to the AGDsources folder. It will be in the SUITE ZX\AGDsource folder.
Once you have done this, you can use the build.bat script to create your game. Type build.bat and the filename of your AGD code, without the AGD extension.
As you can see here, if it all succeeds you will have no errors and the emulator will automatically start.
Selecting 1 will start the game and you will be able to move your little sprite around as expected.
It is as simple as that. You have gone from having a Spectrum game to having an Enterprise game.
There are a couple of changes you will need to make to the AGD code that is generated when you export. The Enterprise does not have a Sinclair Joystick or a Kempston one. Instead it has a built in joystick and an option for up to two external joysticks. You should edit your AGD menu code to say Joystick1 and Joystick2 rather than Sinclair and Kempston.
It's easy enough to do this in notepad or any "plain text" file editor. (notepad++ is a good alternative)
type: notepad AGDsources\ETUT001.AGD
Changing these two lines and then running through the build process again gives you:
And that is it. You have converted (a very basic) game to the Enterprise.
An additional note. If you do not want to copy your AGD file from the SUITE ZX\AGDsource to the SUITE EP\AGDsources folder, you can place it in the main MPAGD folder. (In my instance this is: C:\DEV\V0.7.10-old5\V0.7.10 ) and then if you run "build-ep.bat AGDFILENAME" from that location it will compile the game and start the emulator for you.
The advantage of doing it this way is that you are able to pass additional parameters to the compiler, such as -a for adventure mode or -l for a loading screen.
My preferred method is to work in the SUITE EP folder, but both methods work well and are options.
My next tutorial will look at adding Spectrum sounds and music to the game.
Things to be aware of when converting your games:
If you are using the default engine as supplied with MPAGD v0.7.10, the following issues could exist. These have been fixed in the latest version of the engine and compiler. There may be others, but I have lost track of everything that has been fixed. Pretty much as soon as a bug has been found, Noel has identified and fixed it.
The following enhancements have been made.
(There may be other fixes and enhancements too which I am not recalling at this time).
These improvements and enhancements have all been down to the dedication and hard work of Noel Persa who has been fixing bugs as they've been found and has looked and worked at converting many of the Spectrum MPAGD game features to the Enterprise version of the engine. Without all this hard work, none of this would be possible.