Author Topic: BASIC commands  (Read 688 times)

0 Members and 1 Guest are viewing this topic.

Offline geebus

  • Supporter
  • CPC664
  • *
  • Posts: 59
  • Country: scotland
    • Gee-k.net
  • Liked: 21
BASIC commands
« on: 23:09, 10 January 19 »
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!


Offline Fessor

  • CPC6128
  • ****
  • Posts: 177
  • Country: de
  • Liked: 143
Re: BASIC commands
« Reply #1 on: 00:55, 11 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.

Offline Johnny Olsen

  • Supporter
  • CPC6128
  • *
  • Posts: 211
  • Country: dk
  • Liked: 135
Re: BASIC commands
« Reply #2 on: 02:50, 11 January 19 »
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.
« Last Edit: 03:05, 11 January 19 by Johnny Olsen »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.550
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 813
Re: BASIC commands
« Reply #3 on: 07:50, 11 January 19 »
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:


Code: [Select]
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.
« Last Edit: 10:36, 11 January 19 by AMSDOS »
* Using some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline geebus

  • Supporter
  • CPC664
  • *
  • Posts: 59
  • Country: scotland
    • Gee-k.net
  • Liked: 21
Re: BASIC commands
« Reply #4 on: 12:24, 11 January 19 »
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!

Offline geebus

  • Supporter
  • CPC664
  • *
  • Posts: 59
  • Country: scotland
    • Gee-k.net
  • Liked: 21
Re: BASIC commands
« Reply #5 on: 12:49, 11 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..

Offline Johnny Olsen

  • Supporter
  • CPC6128
  • *
  • Posts: 211
  • Country: dk
  • Liked: 135
Re: BASIC commands
« Reply #6 on: 15: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.

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?

Offline geebus

  • Supporter
  • CPC664
  • *
  • Posts: 59
  • Country: scotland
    • Gee-k.net
  • Liked: 21
Re: BASIC commands
« Reply #7 on: 15:58, 11 January 19 »
So i finally worked out how to use the program haha!
See the attached image.


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.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.550
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 813
Re: BASIC commands
« Reply #8 on: 22:43, 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.

Quote
I 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 some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline geebus

  • Supporter
  • CPC664
  • *
  • Posts: 59
  • Country: scotland
    • Gee-k.net
  • Liked: 21
Re: BASIC commands
« Reply #9 on: 00:58, 12 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?

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.550
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 813
Re: BASIC commands
« Reply #10 on: 01:15, 12 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:


Code: [Select]
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 some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 134
Re: BASIC commands
« Reply #11 on: 01: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. :)


PuzCPC

Offline LambdaMikel

  • 6128 Plus
  • ******
  • Posts: 1.121
  • Country: us
    • Homepage
  • Liked: 565
Re: BASIC commands
« Reply #12 on: 17:46, 06 March 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.

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 134
Re: BASIC commands
« Reply #13 on: 21:19, 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