CPCWiki forum

General Category => Programming => Topic started by: CpcPlusdoctor on 16:06, 22 August 20

Title: CPC PROGRAMMING TUTORIALS
Post by: CpcPlusdoctor on 16:06, 22 August 20
Hello to all cpc users.
i have a cpc 6128 and one 6128 plus model with 512kb ram and duke's m4board.
i would like to ask it it has not been asked before,since we our beloved machine has so many expansion capabilities and everyone inlcuding me have programming skills i have the following suggestion-suggestions:
1-i am a graduate of computer science and have created many programms for win pc including games as well many progtrammes since i was young in cpc 6128.I would like to make some application or games for our beloved machine so i was wondering if someone more experienced has gathered any websites or utilities  for games creation in order to save us time from searching.this way we can contribute all in order to make more app.
2-Any good tutorial for programming in c as well as any good ide for cpc 6128?
3-any tutorial on how to port games from other machines?or at least any clue?
4-in order to begin,ConvImgCpc save my picture to SCR format.Any tutorial on how to include it in a GW-basic programme ,for example for just loading it?Also any tutorial on how to make it work from a real 3inches disc?(It will be a fantastic help and start!!!)
if someone has already searched for all of these it is good to share with the rest of the forum in order to save us time and help us contribute.
Thanks.
Title: Re: CPC PROGRAMMING TUTORIALS
Post by: tjohnson on 10:25, 23 August 20
Suggest contacting @keith56 (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1886) he has produced some good asm tutorials, he has a good website here https://www.chibiakumas.com/z80/ and had produced a great set of videos on YouTube, search for chibiakumas.  Cheers Trevor
Title: Re: CPC PROGRAMMING TUTORIALS
Post by: robbarton on 19:23, 23 August 20
Hi @CpcPlusdoctor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=3879) ,
While I am probably the last person on here to be giving programming advice (!), I do have a line I cribbed from somewhere that will help you to load SCR in BASIC.
First save your picture as PIC.SCR on your disc. Then type this and save as LOADER.BAS (or whatever you want):

10 MODE 0:INK 0,13:INK 1,26:INK 2,14:INK 3,23:INK 4,10:INK 5,16:INK 6,0:INK 7,4:INK 8,5:INK 9,12:INK 10,11:INK 11,3:INK 12,26:INK 13,22:INK 14,7:INK 15,13:LOAD"PIC.SCR",&C000


Running this will set the appropriate inks for a Mode 0 picture (you'll need to change these to correctly match yours based on the palette in your specific picture), then load from "PIC.SCR" into memory at &C000 and thus display it on the screen immediately.

Hope this helps!
Title: Re: CPC PROGRAMMING TUTORIALS
Post by: SRS on 20:17, 23 August 20
Welcome, and if you like multi plattform arcade games try this: https://jonathan-cauldwell.itch.io/multi-platform-arcade-game-designer
For games in C look out for cpctelera (engine with lots of examples)
As for loading SCR of Amstrad in GW Basic I guess you need a special program,

Examples: 10 DEF SEG=&HB800 20 BLOAD"PICTURE", 0 The DEF SEG statement in line 10 points the segment at the screen buffer.
The DEF SEG statement in line 10 and the offset of 0 in line 20 guarantee that the correct address is used.
The BLOAD command in line 20 loads the file named picture into the screen buffer.
should not work :)

Title: Re: CPC PROGRAMMING TUTORIALS
Post by: pelrun on 06:34, 24 August 20
Are you sure you mean *GW*-basic? On what machine? Or did you just thinko and meant our regular Locomotive Basic? Because you'll have trouble with SCR's on anything not using the CPC's vram layout.

Anyway for loading SCR's made by ConvImgCpc from Locomotive Basic there's an easier method than manually copying the palette; simply select the "Code->Img" option before saving (keep Packed and Linear *off*). Then you can load it and set up mode/palette automatically with:LOAD"image.scr":CALL &C7D0
Title: Re: CPC PROGRAMMING TUTORIALS
Post by: teopl on 08:00, 25 August 20
for C game programming on CPC: cpctelera + wincpctelera + any ide you like should keep you busy for a long time :)

1. go to cpc retrodev page http://cpcretrodev.byterealms.com/juegos/ and download all games sources, look at them - there you can find tools and engines used also. and fun for many days.
(btw go to google and this forum programming section and do the same :) )

2. no ide for cpc but you can use wincpctelera with visual studio for very easy debugging on windows with great ide.

3. this depends very on a specific case but in any case porting requires either detailed knowledge of both platforms or ready to use tools (which we rarely can have)
for example, you must know possible resolutions, colors, how sound is created, speed limits, ... if you are porting from non z80 machine or game is not very simple, you will probably need to write it from scratch or most part. often graphics and music are "ported" also to fit the target limitations.

4. I don't know if there is GW basic for amstrad.
Title: Re: CPC PROGRAMMING TUTORIALS
Post by: GUNHED on 15:27, 26 August 20
Quote from: CpcPlusdoctor on 16:06, 22 August 20
... I would like to make some application or games for our beloved machine so i was wondering if someone more experienced has gathered any websites or utilities  for games creation in order to save us time from searching.this way we can contribute all in order to make more app.

Serious programming on the CPC involves (IMHO) the usage of machine language. There are some nice C derivatives too, but only machine language provides full flexibility and power.

For programming machine language I would suggest FutureOS, because it supports lots of expansions, is the fastest OS for the CPCs and provides by far the biggest flexibility. Some examples are full usage of the 2nd register set of the Z80, all RST vectors, own interrupt entry if needed, and much more.
Informations can be viewed at www.futureos.de (http://www.futureos.de)

Good luck with all your projects!
Powered by SMFPacks Menu Editor Mod