Author Topic: CPC Basic 3  (Read 18449 times)

0 Members and 1 Guest are viewing this topic.

Offline Dinoneno

  • CPC464
  • **
  • Posts: 4
  • Country: es
  • Liked: 11
  • Likes Given: 0
CPC Basic 3
« on: 15:45, 14 March 12 »
We have a new version of CPC Basic. It's CPC Basic 3: cpcbasic.tk

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.393
  • Country: au
    • index.php?action=treasury
  • Liked: 1081
  • Likes Given: 1253
Re: CPC Basic 3
« Reply #1 on: 16:17, 14 March 12 »
Wow! That is a big surprise!

I think ccz80 is absolutely brilliant, so I'm very eager to have a look at this.
(I'm poppichicken on the ccz80 forum).

How long have you been working on this?
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline steve

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.263
  • Country: gb
  • Liked: 178
  • Likes Given: 210
Re: CPC Basic 3
« Reply #2 on: 16:22, 14 March 12 »
I thought it was a new version of basic for the CPC :D , perhaps you could compile your basic so we can put into megaflash or a cartridge or at least load it from disk or cassette.
« Last Edit: 16:31, 14 March 12 by steve »

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.050
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
Re: CPC Basic 3
« Reply #3 on: 18:56, 14 March 12 »
This looks interesting, thanks
EgoTrip's Stuff
EgoTrip's Stuff

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1982
  • Likes Given: 4650
Re: CPC Basic 3
« Reply #4 on: 19:01, 14 March 12 »
We have a new version of CPC Basic. It's CPC Basic 3: cpcbasic.tk

Well eahm... If I go there I get this:
 
Interactive Cybersecurity Training
 
Any mirror available?
 
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline MiguelSky

  • 464 Plus
  • *****
  • Posts: 384
  • Country: es
    • CPCGamesCD
  • Liked: 216
  • Likes Given: 448
Re: CPC Basic 3
« Reply #5 on: 03:16, 15 March 12 »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1982
  • Likes Given: 4650
Re: CPC Basic 3
« Reply #6 on: 04:28, 15 March 12 »
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Dinoneno

  • CPC464
  • **
  • Posts: 4
  • Country: es
  • Liked: 11
  • Likes Given: 0
Re: CPC Basic 3
« Reply #7 on: 08:48, 15 March 12 »
I thought it was a new version of basic for the CPC :D , perhaps you could compile your basic so we can put into megaflash or a cartridge or at least load it from disk or cassette.


Hello. CPC Basic is an application for Windows, so it's not possible put it in a support for Amstrad CPC as a ROM, cartridge, etc. Only you can put in a DISK, CDT, etc. the result generate by CPC Basic from the program you write with it.

Offline Dinoneno

  • CPC464
  • **
  • Posts: 4
  • Country: es
  • Liked: 11
  • Likes Given: 0
Re: CPC Basic 3
« Reply #8 on: 08:59, 15 March 12 »
Wow! That is a big surprise!

I think ccz80 is absolutely brilliant, so I'm very eager to have a look at this.
(I'm poppichicken on the ccz80 forum).

How long have you been working on this?


The main work is from November 2011, but it's a project in my head from many yeas ago. Maybe from 1985, when my parents buy me my Amstrad CPC  ;D ?

Offline Optimus

  • 464 Plus
  • *****
  • Posts: 353
  • Country: gr
  • Liked: 169
  • Likes Given: 141
Re: CPC Basic 3
« Reply #9 on: 20:05, 15 March 12 »
This is interesting for cross developing purposes. So, you code on windows and then transfer the compiled assembly code to an emulator. I am wondering if there is a wysiwyg window showing the result in windows before seeing it on the real CPC. Even if not it's interesting for people who are not familiar with C and prefer Basic and I am curious to see the speed and size of some test programs compared to my C programs. Several years ago when I was not familiar with C and enjoyed developing in basic, this would be even great for me. Now, I love C more so I am not switching, but might give it a try out of curiosity.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.084
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3493
  • Likes Given: 6293
Re: CPC Basic 3
« Reply #10 on: 15:53, 16 March 12 »
This sounds mighty interesting... any screenshots? Couldn't find any on the site!

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.393
  • Country: au
    • index.php?action=treasury
  • Liked: 1081
  • Likes Given: 1253
Re: CPC Basic 3
« Reply #11 on: 03:44, 17 March 12 »
It's really cool actually!
I'll be putting some screenies up shortly.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.084
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3493
  • Likes Given: 6293
Re: CPC Basic 3
« Reply #12 on: 20:06, 18 March 12 »
Thanks, that'll be interesting to see :)

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.393
  • Country: au
    • index.php?action=treasury
  • Liked: 1081
  • Likes Given: 1253
Re: CPC Basic 3
« Reply #13 on: 01:58, 19 March 12 »
WARNING! LONG post coming up!
 
Alrighty! I've been having a good look at CPC Basic 3, and I've gotta say, I'm really liking it!
For more serious stuff, I'll stick with ccz80 (also by the same dev), but for simpler stuff, CPC Basic 3 is FANTASTIC!
 
It's particularly good for prototyping, and for making magazine/book type-ins run about a bajillion times faster!
Your mileage may vary of course, as it still uses the same firmware routines for PRINT, PLOT, DRAW etc, but the actual program logic will be much, much quicker.
 
A few things to note:
CPC Basic 3 doesn't handle REAL values the same way that Locomotive Basic does.
This threw me at first, as the vast majority of the language works just like Locomotive.
In fact, I've typed up an old type-in from a book, and at least 95% of the code didn't need to change!
 
To handle real values, Emilio has developed a number of RSX commands, which allow you to pass in an element from a "table" of real variables. I had no idea how to get this working at first, but once I figured it out, it's actually pretty simple, and rather clever too.
 
If anyone wants to have a go with CPC Basic 3, and has troubles with REAL variables/values, post here and I'll do my best to help.
 
The website at cpcbasic.tk serves as the documentation. It needs to be read and understood, if only to learn about the differences from Locomotive. It's not too hard, and once again I'm happy to help with any questions (though I'm still learning as well!)  8)

For these screenshots, I'll be using this block of code:
 
Code: [Select]
10 REM Hello World!
20 RANDOMIZE TIME
30 MODE 1
40 FOR i=1 TO 10
50 LOCATE RND MOD 29+1,RND MOD 25+1
60 color=RND MOD 4
70 PAPER color:PEN (color+(RND MOD 3+1)) MOD 4
80 PRINT "Hello World!";
90 NEXT
100 PAPER 0:PEN 1:LOCATE 1,1

You'll notice a few instances of "RND MOD" in the code.
CPC Basic 3 handles RND a bit differently from Locomotive, but it is explained on the website, and is pretty simple to get working the same way.


NOTE that you can simply edit your program in a text file, and compile it using the command line (and therefore avoid the IDE entirely), and for many people that will be the preferred option. But for the more adventurous/nostalgic among us, the IDE is a lot of fun.


Okay, some screenies:


This is what you see when you run cpcbasic.exe.



Along the top of the IDE are some options:

This allows you to set the model of CPC you are targetting.



This allows you to select the output type.



And this allows you to tell the compiler how big the table of REAL values need to be.
There are also handy shortcuts to the Programs and Output folders.



Now for some cool things in the IDE.

You can type CLS to clear the screen.
It's not really a "screen", but a non-editable text window, syntax highlighted with CPC colours.
All typing is done in the white bit under the blue area.

You can click in the blue area, and use the arrow keys to move up/down through the window, to effectively see a history of what you've done.
Very handy for examining your program without having to use the LIST commands as on a real CPC.
Note that the blue section slows down if it gets too long, but can be cleared and sped up again by typing CLS.
You can also use PageUp/PageDown to move more quickly.

You can change the mode!
For example, here is the listing in mode 2 text.



The MODE commands are the same as on a real CPC.

Typing CAT lists the files in your Programs folder.



Typing LOAD"HELLO.BAS" will load that program, and it can be viewed by typing LIST.

Editing and deleting lines is done just like on a real CPC.
For example:
EDIT 80
The line will be made available to edit in the white editing area at the bottom.



Don't forget to SAVE your program periodically.
The saved file will be put into your Programs folder.

Typing RUN will compile the program according to the options you have selected at the top of the IDE.
In this example, it compiles the program, and automatically sends it to the included CPCE emulator.



Hopefully that'll be enough to get people started.
I'm really enjoying CPC Basic 3 so far, and I'm thinking of "updating" some old type-ins that I enjoyed back in the day.

« Last Edit: 03:23, 19 March 12 by ervin »
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.084
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3493
  • Likes Given: 6293
Re: CPC Basic 3
« Reply #14 on: 15:36, 19 March 12 »
Darn, it looks so cool it makes me want to start doing stuff again :)

Offline MugUK

  • CPC664
  • ***
  • Posts: 80
  • Country: gb
  • An old Atari ST music ripper and trainer maker :)
  • Liked: 12
  • Likes Given: 8
Re: CPC Basic 3
« Reply #15 on: 16:38, 19 March 12 »
Now that looks like fun ;-)

Sent from my Galaxy S2 using Tapatalk.
I love poking (and peeking) around files.  I used to write saved-game editors on the Atari ST (and Amiga) using GFA BASIC, so looking forward to having some fun with my 6128 :)

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1982
  • Likes Given: 4650
Re: CPC Basic 3
« Reply #16 on: 17:46, 19 March 12 »
It's nice that file have date and time, but one could read it betten when data and time would be separated by a blank.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Dinoneno

  • CPC464
  • **
  • Posts: 4
  • Country: es
  • Liked: 11
  • Likes Given: 0
Re: CPC Basic 3
« Reply #17 on: 20:23, 19 March 12 »
It's nice that file have date and time, but one could read it betten when data and time would be separated by a blank.
This problem is fixed in version 3.0.4. Dank der Beobachtung :D .

Offline MugUK

  • CPC664
  • ***
  • Posts: 80
  • Country: gb
  • An old Atari ST music ripper and trainer maker :)
  • Liked: 12
  • Likes Given: 8
Re: CPC Basic 3
« Reply #18 on: 20:20, 23 March 12 »
I installed this last night and tried a small listing from 'The Amazing Amstrad Omnibus' that I had bought.  OK, it didn't work due to too many INT(RND ...) statements but it was fun to type in a listing with actual line numbers.

Times have changed - for the better with my eyesight - as it was done on my 40" LCD TV via a wireless keyboard.  Looking forward to having a proper play with this once I get my 6128 :)
I love poking (and peeking) around files.  I used to write saved-game editors on the Atari ST (and Amiga) using GFA BASIC, so looking forward to having some fun with my 6128 :)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.084
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3493
  • Likes Given: 6293
Re: CPC Basic 3
« Reply #19 on: 23:08, 23 March 12 »
BASIC programming to the next level...


Indeed, trying some listings so many years after the proper era, be it in Locomotive BASIC or GFA or what have you, is unique... :)

Offline MiguelSky

  • 464 Plus
  • *****
  • Posts: 384
  • Country: es
    • CPCGamesCD
  • Liked: 216
  • Likes Given: 448
Re: CPC Basic 3
« Reply #20 on: 01:11, 24 March 12 »
I tried Mongui from Amstrad User listings but it hangs. Probably it is due the program creates and uses some RSX.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.393
  • Country: au
    • index.php?action=treasury
  • Liked: 1081
  • Likes Given: 1253
Re: CPC Basic 3
« Reply #21 on: 12:15, 24 March 12 »
I installed this last night and tried a small listing from 'The Amazing Amstrad Omnibus' that I had bought.  OK, it didn't work due to too many INT(RND ...) statements but it was fun to type in a listing with actual line numbers.

Times have changed - for the better with my eyesight - as it was done on my 40" LCD TV via a wireless keyboard.  Looking forward to having a proper play with this once I get my 6128 :)

Which program did you try?
I'd like to have an attempt.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.393
  • Country: au
    • index.php?action=treasury
  • Liked: 1081
  • Likes Given: 1253
Re: CPC Basic 3
« Reply #22 on: 12:18, 24 March 12 »
I tried Mongui from Amstrad User listings but it hangs. Probably it is due the program creates and uses some RSX.

Which issue of the magazine is Mongui in?
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline MugUK

  • CPC664
  • ***
  • Posts: 80
  • Country: gb
  • An old Atari ST music ripper and trainer maker :)
  • Liked: 12
  • Likes Given: 8
Re: CPC Basic 3
« Reply #23 on: 14:55, 24 March 12 »
Which program did you try?
I'd like to have an attempt.

The Phantom Composer on pages 386 & 387.  The error message generated was:

"Unsupported function in line 100 position 5
Unsupported function in line 120 position 5
Unsupported function in line 130 position 5
Unsupported function in line 140 position 5
Unsupported function in line 160 position 21
Unsupported function in line 220 position 5
Unsupported function in line 240 position 5
Unsupported function in line 290 position 5"

Any occurrence of 'INT(RND ..) was coming up with an error.
I love poking (and peeking) around files.  I used to write saved-game editors on the Atari ST (and Amiga) using GFA BASIC, so looking forward to having some fun with my 6128 :)

Offline MiguelSky

  • 464 Plus
  • *****
  • Posts: 384
  • Country: es
    • CPCGamesCD
  • Liked: 216
  • Likes Given: 448
Re: CPC Basic 3
« Reply #24 on: 23:57, 24 March 12 »
The Phantom Composer on pages 386 & 387. Any occurrence of 'INT(RND ..) was coming up with an error.
You must to edit the lines with the INT and delete the INT as the compiles assumes they are INT by default. The RND needs fixing too. From the cpcbasic page:
Quote
The RND function returns a value from 0 to 65535. To obtain a value in the
range  n to m must use the expression RND MOD (m - n + 1) + n. For example, to
obtain a  random value between 7 and 10 would RND MOD 4+7; for a random value
between 1  and 5 would RND MOD 5+1, for a random value between 0 and 20 would
RND MOD 21.

Quote
Which issue of the magazine is Mongui in?
I don't know :D I used the one at ftp://ftp.nvg.unit.no/pub/cpc/games/typeins/mongui.zip