News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_geebus

BASIC commands

Started by geebus, 22:09, 10 January 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

geebus

Hi all, I'm looking at making sprites for a game I'm adapting in BASIC. I've been looking into how to start learning making them and came across a few different programs. None of which I've yet understood. I thought I'd start with something very basic and use the type in from a magazine just to start learning. Always start at the beginning!
I'm using http://www.cpcwiki.eu/imgs/8/8a/ACU9110-043.jpg
I've already saved the massive BASIC code that is in the following pages using an emulator and I have no idea how to use it... Which is hilarious after the time it took to correct and debug the text after using an image to text program. Glad I didn't type it out on a real CPC.
ANYWAY, the small 14 line program in the linked page doesn't seem to work on my 464.
I've deleted the | from the start of the commands as it errored.
The complete command doesn't seem to work. I changed it to compile as I thought it might be a typo. Still nothing. The sprite command didn't work either.
Is this going to run on my 464 or am I doing something stupid.
I'm very new to BASIC but really looking to learn.Any help is appreciated.
I've got the learn BASIC tapes ready to go through for homework!



Fessor

This is described in the last paragraphs on page 46. If you're writing a program that needs these commands, you'll need to load that binary file and call it once to implement the RSX.

Johnny Olsen

#2
Line 120 is faulty is should be
120 |COMPILE,10,90

These command's is not native Amstrad Basic command's but RSX command.You have to read about RSX to understand it.

You can try run"smface1 or smface2 or smdemo to see The Spritemaker in action.
A word of advice, ask here before you enter a program, most listing's from magazines have already been entered.

AMSDOS

#3
The Spritemaker has a little message too when it's activated, so if you don't see "The SPRITEMAKER by Michael Gledhill '90" it's not running, but when using RSXes the Bar/Pipe (Shift+@) is required, though when RSXes aren't active you'll be getting Unknown Command error.


So for the Spritemaker, you should have a file called "sm.bin".


Load that with:



MEMORY &7FFF:LOAD"sm.bin",&9000
CALL &9000



which will produce that intro message. The examples which come with it should now work.


One thing I should point out, was within the large Binary File was another demo, though for some reason the program was renumbered. The Compile command which is used to point to the Start and End Line Numbers of the Graphics DATA will not automatically update those line numbers if RENUM is used, and as a result the published programme has the incorrect line numbers pointing to another spot as a result of a RENUM.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

geebus

Thanks all! I'll give it a go shortly on an emulator and see if I have any more questions.
Every day is a school day!

geebus

Quote from: Fessor on 23:55, 10 January 19
This is described in the last paragraphs on page 46. If you're writing a program that needs these commands, you'll need to load that binary file and call it once to implement the RSX.


Thanks! I have now learned something new about BASIC on the amstrad.
I'm used to coding in web languages, so I thought BASIC would be an easy one to learn. But it seems there are a lot of things to get my head around. I'll need to concentrate on this before moving to assembly language..

Johnny Olsen

I have updated the program and included smhello and smcheck.
Run smhello stop it "but not do a reset" then run smcheck ,now it's
possible to see the width, heigt and where in memory the sprite is stored.

If using WinApe go to Debug/Find Graphics to see the sprite.

A good way to learn Amstrad basic is to look at others peoples work.

Back in the good old days I was reading "Computing With the Amstrad"
They had a lot of artikles about basic programming.

I type a lot of type-ins, mostly game because i could see what happening
if i made some change to the program.

Also learned a lot by correcting my own miswriting.

In Computing With the Amstrad No.4 1985 there is a program "Get moving with the sprites"

Here is the File's. Very good webpage

http://www.cpc-power.com/index.php?page=detail&onglet=dumps&num=9514

And the Magazin's here. Very good webpage too.

https://acpc.me/#ACME/REVUES/[ENG]ENGLISH(UK)/[ENG][AMSTRAD]COMPUTING_WITH_THE_AMSTRAD

Please can you upload the main file spritemaker 2.3 Here?

geebus

So i finally worked out how to use the program haha!
See the attached image.

Quote from: Johnny Olsen on 14:30, 11 January 19
Please can you upload the main file spritemaker 2.3 Here?
I've attached a zip file containing the .dsk file I made.
Thanks for all the help! I'm slowly starting to understand this machine.

AMSDOS

Quote from: Johnny Olsen on 14:30, 11 January 19
I have updated the program and included smhello and smcheck.
Run smhello stop it "but not do a reset" then run smcheck ,now it's
possible to see the width, heigt and where in memory the sprite is stored.

If using WinApe go to Debug/Find Graphics to see the sprite.


In the Spritemaker article there's another section about a 3rd parameter for the COMPILE RSX, I haven't tried it though, but it looks like it can be used to work out where your last sprite is defined in memory, so presumably I guess if you have a few sprites, you can use the 3rd parameter on the last COMPILE to work out where your last sprite is situated, I think it's only there to get the address, so you can use MEMORY to protect the Sprites from BASIC.

QuoteI type a lot of type-ins, mostly game because i could see what happening
if i made some change to the program.

I thought the Spritemaker would be a good package to test on some of those old type-ins, particularly on games where it seems like the Graphics are slowing down the game. One such game I enjoy playing is N-SUB from Amstrad Computer User which unfortunately slows down when more things come into play. I don't know how much  Spritemaker would improve it and it's such a big game too.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

geebus

After playing with this for a little while at work (during my lunch break boss), I was wondering how useful this program was going to be seeing as you need to load the sprite maker along with your game. So, it'll first load the sprite maker, then your game..What is a better way of doing this? Just learn assembly?

AMSDOS

Quote from: geebus on 23:58, 11 January 19
After playing with this for a little while at work (during my lunch break boss), I was wondering how useful this program was going to be seeing as you need to load the sprite maker along with your game. So, it'll first load the sprite maker, then your game..What is a better way of doing this? Just learn assembly?


I normally have my main game first, followed by the Sprite Maker with a line in my game like this:


110 IF PEEK(&9000)=0 THEN MEMORY &7FFF:LOAD"sm.bin",&9000:CALL &9000


to check if Sprite Maker is in memory already.


It's not totally foolproof if another routine is occupying that spot, though resetting the computer will avoid that hassle and once it's loaded it won't reload should it exit back to BASIC. There's also a similar routine in the Sprite Maker pages as well.


I don't know what better way there is and learning Assembly won't really help with this. I mentioned in my other simple platform game thread that Spritemaker was designed for BASIC coders mainly, the Assembly part of the guide which is within the Spritemaker article is for people to design sprites using Spritemaker, but then use them with their Assembly Sprite driver and in order to do that you need to locate where the Sprite is in memory.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

PuzCPC


Hi,
The best way is to learn the assembly!
Not much harder than BASIC. Especially if you look at the keith56 tutorials with vampires that are here on CPCwiki.
You can do then REAL games. :)


PuzCPC

LambdaMikel

Quote from: PuzCPC on 00:22, 12 January 19
Hi,
The best way is to learn the assembly!
Not much harder than BASIC. Especially if you look at the keith56 tutorials with vampires that are here on CPCwiki.
You can do then REAL games. :)
True. But BASIC has it's strenghts, too - for once, it is very immediate, interactive, and great for prototyping!
Not all projects need the speed of MC.

PuzCPC

Quote from: LambdaMikel on 16:46, 06 March 19
True. But BASIC has it's strenghts, too - for once, it is very immediate, interactive, and great for prototyping!
Not all projects need the speed of MC.




True! For example, my Scramble editor is made in BASIC.
PuzCPC

Powered by SMFPacks Menu Editor Mod