FREQUENTLY ASKED QUESTIONS
Here are a few frequently asked questions from the beginner’s forum on the yabasic boards.
GENERAL QUESTIONS
1. What is yabasic?
YABASIC stands for Yet Another Basic and it is a BASIC programming language. In PAL regions the Playstation 2 was released with a special modified version of yabasic (which can be found on the demo disc) for developing games, demos and routines.
2.What is the difference between the PS2 version and the original yabasic language?
The difference between Yabasic and the PS2 Yabasic is that a few more features have been added while some have been modified or removed.
3. Can I make games and put them onto CD/DVD?
No. You can only play and develop games on the free demo disk you received with you PS2 (please note this is only with a PAL Playstation 2). Load the disc in to your PS2 and select yabasic from the main menu, where you can play and develop games. You cannot copy these onto other discs.
4. How can I save my games?
Insert a PAL bearing Playstation 2 memory card, which you can then use to save your games on.
5. Do I need a keyboard to use yabasic on the PS2?
No. You can use a Playstation 2 controller however a lot of users have commented that a keyboard is easier and more convenient. Also note it has to be a USB keyboard so it can connect to the USB port at the front of the PS2.
6. How do I use the controller to enter code?
You can use a virtual keyboard to enter text. Use the L1 button of a DUALSHOCK2 controller to bring up a virtual keyboard, and enter characters with the directional button. X - Select character Square - Delete character.
7. What is an X-PORT?
Basically X-PORT uses software, which allows you to transfer code from your memory card to your PC and to download code from Marc Gale’s site and load it into your memory card. You can find out more information at the manufacturer’s site.
8. Are there any books or manuals I can buy for the PS2 version of yabasic?
There are no specific PS2 yabasic guides however Arwin van Arum's site is great and highly recommended.
9. What is the future for the PS2 version of yabasic?
No future plans have yet been announced by Sony however it is possible a future update will be released when the official hard drive is released.
PROGRAMMING QUESTIONS
1. What type of programs can I make on yabasic?
You can do text or graphic programs on yabasic.
2. What are the commands for text and graphic programs?
To find the commands visit Arwin van Arum's site, which is a great site and highly recommended.
3. How do I open a graphics window?
Use this line of code:
open window 640,512
4. How can I clear or close a graphics window?
Use these lines of code:
close window – close the graphics window
clear window - clear all graphics from the graphics window
5. What are the double buffers?
The double buffers are generally used in programs with movement.
Basically while you look at the screen with an image, imagine another screen behind the first one where the next image is drawn while you look at the first one. The screens change so the first one goes to the back and you see the new screen with the new image. While you look at that, the next one is drawn behind and the screens change place and you see the new screen with the new image. This cycle continues until the program finishes. This keeps the graphics moving smoothly.
6. How do I use the buttons on the controller to put input into the program?
Use this line of code:
c=peek(“port1”)
if and (c,value> then
[use the input to do something]
endif
The value in the code above refers to the buttons you press. Every button has its own value. Here they are:
Value Button
1 Select
2 L3
4 R3
8 Start
16 Up
32 Right
64 Down
128 Left
256 L2
512 R2
1024 L1
2048 R1
4096 Triangle
8192 Circle
16384 Cross
32768 Square
7. Does yabasic have any sound commands?
Yes but yabasic is very limited for sound commands. The only sound available is the beep command, which is often used in conjunction with the wait command:
beep
wait 1
beep
wait 2
8. What is a parse error at end of line?
If there is a parse error message when you try and run your code and you are shown the end of the code then 9/10 times the error isn’t on the last line. It means that you have made a mistake earlier in the code. Check that:
each FOR is terminated by a NEXT
each WHILE is terminated by a WEND
each REPEAT is terminated by a UNTIL
all brackets are closed
If these aren’t completed properly then a parse error will occur.
9. How can I put comments on my code?
Use the REM command before a comment, which alerts the program a remark, will follow.
10. How do I do random numbers on yabasic?
Use this code:
variable=ran(maxvalue)
where variable will be the random number and maxvalue is the maximum value.
For example num=ran(10) would produce a number between 0-10.
However this would produce a decimal number like 4.50331, which isn't much use if you want a whole number (i.e. 5 or 4)
To get a whole number you have to change the code to:
num=int(ran(10)) where int means integer.