News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Jonathan.

Arcade Game Designer

Started by Jonathan., 02:22, 18 February 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jonathan.



It has been a busy week but the editorless version of AGD has now been ported to the CPC.  Unlike the editor version that runs on the CPC itself, this is a full implementation of all the functionality that exists on the editorless Spectrum and Next/Timex versions.  So MENU, WHILE/ENDWHILE, READ/DATA/RESTORE, CONTROL, EXPLODE and much more are supported.


Converting games to or from Amstrad and Spectrum should be a doddle, it's little more than a case of pasting in new graphics.  Beyond that there are palette differences and the Spectrum has KEMPSTON and SINCLAIR as control options where the CPC has JOYSTICK0 and JOYSTICK1.  Redefineable keys are also an option, which was a concern for many with the previous CPC implementation.


If you can develop a game for the CPC with this you should be able to port it to the Spectrum with very little difficulty, and vice versa.  There are dozens, if not hundreds of users, mostly Spectrum ATM so hopefully we'll get some crossover and more games for both platforms.  As always, it's all done in a very simple scripting language inspired by BASIC.  There's an example program, Test.AGD included as well as a skeleton program to start you off with your own creations.  There's a directory with some coding templates too - platformer controls, timer bars, pushable blocks and other stuff are covered there.


Please take a look.  It's all source ATM so you'll need a C compiler to build the compiler.  I'm still using X86 which is why I've not included executables but if you can compile to x64 do feel free to make your executables available to others.


Download here.


Finally, I'm hoping to turn AGD into a truly multi-platform 8-bit game development tool (an Acorn Atom version is looking promising) so if you know anyone who might be interested in getting involved do let me know!   CPC graphics/screen editors would be really helpful and I'm always looking for more masochi.. er, I mean volunteers to convert this to other platforms.  Please spread the word...


jesusdelmas

Quote from: Jonathan. on 02:22, 18 February 18

It has been a busy week but the editorless version of AGD has now been ported to the CPC.  Unlike the editor version that runs on the CPC itself, this is a full implementation of all the functionality that exists on the editorless Spectrum and Next/Timex versions.  So MENU, WHILE/ENDWHILE, READ/DATA/RESTORE, CONTROL, EXPLODE and much more are supported.


Converting games to or from Amstrad and Spectrum should be a doddle, it's little more than a case of pasting in new graphics.  Beyond that there are palette differences and the Spectrum has KEMPSTON and SINCLAIR as control options where the CPC has JOYSTICK0 and JOYSTICK1.  Redefineable keys are also an option, which was a concern for many with the previous CPC implementation.


If you can develop a game for the CPC with this you should be able to port it to the Spectrum with very little difficulty, and vice versa.  There are dozens, if not hundreds of users, mostly Spectrum ATM so hopefully we'll get some crossover and more games for both platforms.  As always, it's all done in a very simple scripting language inspired by BASIC.  There's an example program, Test.AGD included as well as a skeleton program to start you off with your own creations.  There's a directory with some coding templates too - platformer controls, timer bars, pushable blocks and other stuff are covered there.


Please take a look.  It's all source ATM so you'll need a C compiler to build the compiler.  I'm still using X86 which is why I've not included executables but if you can compile to x64 do feel free to make your executables available to others.


Download here.


Finally, I'm hoping to turn AGD into a truly multi-platform 8-bit game development tool (an Acorn Atom version is looking promising) so if you know anyone who might be interested in getting involved do let me know!   CPC graphics/screen editors would be really helpful and I'm always looking for more masochi.. er, I mean volunteers to convert this to other platforms.  Please spread the word...




thanks a million!! amazing job. this version means that the spectrum tutorial that its on youtube will work for the amstrad cpc as well???


:)

robcfg

Hi @Jonathan ,


Could you upload the files here too? I'd like to take a look but I honestly don't want to register in another forum, and I cannot download the files there, as I'm not registered.


Cheers,
Rob

Jonathan.

Didn't realise I could do that until I read your post so here you go, it's attached.  I've added some executables too so no need to use a C compiler to build the AGD compilers any more.  C source code is still included though.


SRS

#4
Nice !

Somehow I do not manage to get test.agd compiled to one ASM that WinAPE "compiles" and after that it is runable on Emulator ...

ASM generated in Attachments:



johnlobo

Quote from: Jonathan. on 19:40, 18 February 18
Didn't realise I could do that until I read your post so here you go, it's attached.  I've added some executables too so no need to use a C compiler to build the AGD compilers any more.  C source code is still included though.


I have tried to build the example project (skeleton.AGD), but when I try to assemble the generated asm file in Winape, I get 46 undefined symbol errors... :-(  ...what am I missing??

SRS

#6
It doesn't seem to include "WINDOWTOP" etc. to the ASM-Source ?

If you use the ZX Compiler or Next one it does put them after game engine (lines 3500 and onward)

; Game-specific data and events code generated by the compiler ------------------


WINDOWTOP equ 1
WINDOWLFT equ 9
WINDOWHGT equ 22
WINDOWWID equ 22


which "confuses" Assembler ?

jesusdelmas

i dont know how to open this AGD0 file, i dont know if i need the AGD 4.7 for spectrum and later complile the game for amstrad, or just use the cpc 1.4 version..


im new in this so if there is a tutorial it will be very helpful for me :)


thanks anyway!




billamu

Hi jesusdelmas. AGD 1.4 is run on an Amstrad computer or emulator, whereas this is a Windows-based workflow - the .AGD file is a text file that can be exported to an assembly language file that in turn can be compiled to machine code, and run on the Amstrad.

...if we can work out how to do so!  :)

I copy-pasted both of SRS' code into WinApe and compiled it... yes it compiles, and it had a couple of doubles, but after I removed them it doesn't appear to run.

It would be great if someone works out how to make this work!

jesusdelmas

Quote from: Jonathan. on 02:22, 18 February 18

It has been a busy week but the editorless version of AGD has now been ported to the CPC.  Unlike the editor version that runs on the CPC itself, this is a full implementation of all the functionality that exists on the editorless Spectrum and Next/Timex versions.  So MENU, WHILE/ENDWHILE, READ/DATA/RESTORE, CONTROL, EXPLODE and much more are supported.


Converting games to or from Amstrad and Spectrum should be a doddle, it's little more than a case of pasting in new graphics.  Beyond that there are palette differences and the Spectrum has KEMPSTON and SINCLAIR as control options where the CPC has JOYSTICK0 and JOYSTICK1.  Redefineable keys are also an option, which was a concern for many with the previous CPC implementation.


If you can develop a game for the CPC with this you should be able to port it to the Spectrum with very little difficulty, and vice versa.  There are dozens, if not hundreds of users, mostly Spectrum ATM so hopefully we'll get some crossover and more games for both platforms.  As always, it's all done in a very simple scripting language inspired by BASIC.  There's an example program, Test.AGD included as well as a skeleton program to start you off with your own creations.  There's a directory with some coding templates too - platformer controls, timer bars, pushable blocks and other stuff are covered there.


Please take a look.  It's all source ATM so you'll need a C compiler to build the compiler.  I'm still using X86 which is why I've not included executables but if you can compile to x64 do feel free to make your executables available to others.


Download here.


Finally, I'm hoping to turn AGD into a truly multi-platform 8-bit game development tool (an Acorn Atom version is looking promising) so if you know anyone who might be interested in getting involved do let me know!   CPC graphics/screen editors would be really helpful and I'm always looking for more masochi.. er, I mean volunteers to convert this to other platforms.  Please spread the word...




Hi!!! i sorry to bother you, but can you tellnus how to run this AGD in an amstrad emulator? (win ape)


it is being really hard make this work...


thansk a million anyway  :)

arnoldemu

@Jonathan:

There are some small bugs in your code.

around line 956 this is new fixed code. you can also use fgetc and fputc and feof.



puts( "test4" );
char chData[1];
    lSize = fread(chData, 1, 1, pEngine );            /* read first character of engine source. */
puts( "test5" );

    while ( lSize > 0 )
    {
        fwrite(chData, 1, 1, pObject );                /* write code to output file. */
        lSize = fread(chData, 1, 1, pEngine );        /* read next byte of source. */
    }


it was reading and writing into a pointer before. This was causing a crash for me.

line 888:

should be:

    sprintf( szObjectFilename, "%s.asm", argv[ 1 ]);


too many parameters to sprintf.



My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

billamu

Okay, I got it to work. Here's what I did:

1. Make a folder called "Test Project" and put the following files into it:

       
  • CompilerCPC.exe
  • test.AGD
  • enginecpc.asm
2. Open Command Line (cmd)

3. In Command line, type the following:
cd [location_of_TEST_PROJECT_folder]
CompilerCPC test

Note: it says "test" not "test.AGD". If you type "test.AGD" CompilerCPC will look for "test.AGD.AGD" and upon not finding it, export a blank file+enginecpc.asm.

4. Open the resulting "test.asm" file. If you have a file called "test.AGD.asm" it's because you typed "CompilerCPC test.AGD" which won't work.

5. Select all the text in the .asm file and copy it (Control+C)

6. Open WinApe

7. On the Amstrad, type:
MEMORY 1999

8. In WinApe select Assembler>Show Assembler (or press F3)

9. Paste the code into the corresponding window and compile it (by pressing F9). It should compile with no errors.

10. Back in the Amstrad type:
CALL 2000

The resulting code should run.



SRS

#12
After fixing the Errors @arnoldemu pointed to, and rebuilding a x64 version with devcpp, I got it to work following @billamu post (i did it that way, too, but with unfixed compiler it did not work ...)

I got it work !

Now, lets flood the CPC with AGD games ! Jihaa

Attached my "fixed" x64 version of AGD_CPC Compiler.
Now, ASSembler Pros, maybe you can enhance/speed up the "enginecpc.asm" for all of us ?

arnoldemu

Quote from: SRS on 21:53, 20 February 18
After fixing the Errors @arnoldemu pointed to, and rebuilding a x64 version with devcpp, I got it to work following @billamu post (i did it that way, too, but with unfixed compiler it did not work ...)

I got it work !

Now, lets flood the CPC with AGD games ! Jihaa

Attached my "fixed" x64 version of AGD_CPC Compiler.
Now, ASSembler Pros, maybe you can enhance/speed up the "enginecpc.asm" for all of us ?
I did the same as @SOS and @billamu but the AGD compiler always crashed. I loaded it up in visual studio ran the static code analysis on it, it reported those problems which I fixed (there were others but very minor) and it no longer crashed and I got output :)

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource


Sykobee (Briggsy)

Nice to see this! Shame I have a Mac though...


Would be nice to see the instructions on the Wiki.

SRS

There is no free C Compiler for Console on MAC ?

As @Jonathan was very nice giving the Source to compile the Compiler above :)

robcfg

Xcode is free and provides you gcc and g++ for command line.


I managed to compile the compiler (heh!) but crashes when processing a project file.


I'll try to do some debugging.

SRS

Thats cool !

Try my arnoldemu inspired source ?


robcfg

Yep!


Just tried it and it crashes too:


AGD Compiler for Amstrad CPC464 Version 0.4
(C) Jonathan Cauldwell February 2018
test1
test2
test3
test4
test5
Sourcename: test.agd
[1]    91575 abort      ../CompilerCPC_SRS test



I'll try to do some debugging tomorrow and get back to you guys.

robcfg

I managed to get it working.


Most errors are due to buffer sizes. For example, on the void CreateSprites( void ) function, there's a variable named cByte, which is an array of ten chars.


A couple of lines below cBytes declaration, there's the following line "cByte[ 10 ] = ( cByte[ 4 ] << 1 ) & 170;" which actually accesses the 11th element of the array, when there's only ten, causing a crash.


I think that rewriting the code using C++ and the standard template library would make the code easier to read and less error prone.


You'll find attached my version of the source C file. Most probably there are still errors so I'd go for a rewrite.

arnoldemu

Nice. I used it briefly.

I got it to build an asm output for skeleton.agd and then I was happy. :)

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Jonathan.

#22
Thanks guys.

A couple of errors were hangovers from previous implementations that were overlooked and it seems a few debug lines were still in there.  I've put in the fixes and echoed them to the Next/Timex and Spectrum versions.  The buffer size of 32768 will looking at when I get a chance.

The engine could certainly be improved, I don't pretend to be a CPC expert.  But it works and has the functionality of the other versions, if perhaps not as efficient as it could be.

I still need to implement DEFINESOUND before I think about looking at a version for MSX machines.  A tool to extract data from games written with AGD 4.7 and generate .agd files is also on the to-do list.

EgoTrip

It looks good, I certainly wish this existed back when I started using AGD. But now I have moved on to more advanced tools, it seems like it's a backwards step going back to AGD for me on the CPC.

However I definitely do recommend this to people to use AGD as a sketchpad for ideas or for beginners who want to get a functional game running with minimal effort.

Jonathan.

Snce my last post:


Kees Van Oss is making serious progress with an Acorn Atom conversion.  this is amazing work which could make a series of 6502 conversions possible!



https://www.youtube.com/watch?v=pRwtFTKOn0E


Meanwhile, I'm working on a tool to extract data from snapshots of dozens if not hundreds of Spectrum AGD games and generate new source files that could be converted to the CPC and other formats.


Powered by SMFPacks Menu Editor Mod