Author Topic: Button keys for Yabasic in Windows.  (Read 9669 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Button keys for Yabasic in Windows.
« on: May 23, 2011 »
Hi everyone; i love old videogames and made some simple games when i bought my PS2 by using the Yabasic program that was included at the PS2's demo, but it's already a long time since i don't program anything...
Now i've been looking for Yabasic compilator for Windows and found "Yabasic 2.763", but i have seen that the way i used at PS2 to set keys for my gamepad doesn't work here, so this is my question:
How can i set keys at a game made upon Yabasic for Windows? When i had this program for my old PS2, i used to make it with this command:

if and (peek ("port1"), 16384) = 0 then

In this example, "16384" sets the key for the "X" button at PS2's gamepad, but this setting way seems not to work at Windows. Wich is the command at Windows version of Yabasic to set keys for keyboard and gamepad? Somebody knows? Thanks.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #1 on: May 23, 2011 »
Welcome to the Forum JOE....I am sure there some people on here know about YABASIC to help ya out :D

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Button keys for Yabasic in Windows.
« Reply #2 on: May 23, 2011 »
Hi there, Joe.

First of all the Win32Yabasic is a different version of yabasic then the one you are familiar with. Jim's ps2yabasic interpreter is the de facto of programming ps2yabasic on a PC. So grab yourself a copy of the Jims Interpreter.

One thing that differs between ps2yabasic and win32yabasic is that ps2yabasic interfaces with controllers via peek("port1") or peek("port2") I think win32yabasic has only inkey$

Jims interpreter allows you to map buttons to the keyboard, but sadly does not support joypad input. So you wont be able to use a controller, but you can use a keyboard.

Also welcome to the forum and if you have any questions please don't be shy.

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #3 on: May 23, 2011 »
Hi Joe, welcome to the forum!

->rain - I think a joystick should work, I was using an official PS2 controller attached via a USB dongle to my PC to test it.  Code is there but maybe I never finished or released it?

Jim
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Button keys for Yabasic in Windows.
« Reply #4 on: May 23, 2011 »
You've been answered already I see Joe - but welcome to DBF :)  Hope you stick around and show us what you make.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Button keys for Yabasic in Windows.
« Reply #5 on: May 24, 2011 »
 :hi: Joe!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #6 on: May 24, 2011 »
Thank you all for answering  :cheers:
I've downloaded PS2Yabasic and, running a little program wich i made to taste controls,  returns this error:

"Sorry!
A terrible thing happened! Your code has been saved as 'Yabasic-autosave.txt'. Let Jim know what you were up to!"

After that, the compiler closes itself... Why does this happen?? Have i written something wrong at my program or is it a bug from the PS2Yabasic?  Here is my program, in case you want to check it out:

open window 640, 512
a=250
k=peek("port1")
label 1
fill circle a, 300, 50
if and(k,16384)=0 then
a=a+5
beep
fi
wait 0.03
clear screen
goto 1

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #7 on: May 24, 2011 »
That means something crashed really badly. :-(  Can you disable source code colouring in the settings and try again?
Jim
Challenge Trophies Won:

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #8 on: May 24, 2011 »
Hi Jim; i've disabled the source colouring and crashed again, and after that changed the other options one by one and still crashes  ??? So i don't know what else i can do... Have you tried my program at your PS2Yabasic, doesn't it crash too? Could this be because of my computer? I use Windows XP Professional.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Button keys for Yabasic in Windows.
« Reply #9 on: May 24, 2011 »
It seems to work here Joe,

A while circle moving from left to right and beeping as it goes.
Do all the programs you run in the emulator crash in the same way?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #10 on: May 24, 2011 »
Can you also please try removing things from the program until it stops crashing? Starting with 'beep'.
Cheers, Jim
Challenge Trophies Won:

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #11 on: May 24, 2011 »
Jim, i've been tasting what you say until my program stayed empty  :P
Shockwave, i looked for other Yabasic programs in the internet and none of them run at my PS2Yabasic (I get the same crash report), so i guess it's a problem of my PC...

Either i find other compiler, working at my PC and supporting joypad keys,  or i'll have to forget Yabasic.

Anyway, thanks for your answers. If i finally manage to make games with Yabasic again, i'll come here to post them  O0

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #12 on: May 25, 2011 »
Hi Joe,
It's a real shame you could not get it to work.  I've been working on that software for 10 (count em!) years and noone has ever had the problem you describe.
Last thing to check...are you sure you have an opengl compatible video card?
Thanks for trying to help me work out what the problems are.  Sadly, you won't find another PS2 compatible yabasic program anywhere.
You may also be able to run some of the older versions from here at sourceforge
http://sourceforge.net/projects/win32yabasic/files/win32-binary/
The yabasic language is exactly the same in all of them, they just have different user interfaces and slightly differing levels of compatibility, which might just get you over the line.
Good luck!

Jim
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Button keys for Yabasic in Windows.
« Reply #13 on: May 25, 2011 »
Hey Joe,
This sounds like a know issue that only occurs when source colouring is enabled. It use to happen to me when I start programming on the PC but since I fixed the problem it hasn't happened at all in like the last 4 or 5 years. The picture shows how to fix the problem. The one on the left is the broken configuration the one on the right is the solution, try this out and also make sure that your drivers are up to date, wouldn't hurt to get the latest DirectX installed too.

Challenge Trophies Won:

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #14 on: May 25, 2011 »
Hi Jim.
Oldest versions don't work either here (some of them even gave me the message that says the program has found a problem and must close when trying to run my little Yabasic program), and because i don't know too much about computers i don't know if my video card is compatible with opengl; but i can tell you my video card is "mobile intel (r) 965 express chipset family", maybe you do know if it's compatible or not...

Hi Rain_Storm.
I've already tried before that option setting (and all of possible settings) without getting the program to work.
And i've been at Windows update and it looks i don't need a new update for directx, so i give up this sudden programming fever of me for now (sigh)...

Maybe later in time i'll feel like learning a new programming language, but now i'm only gonna play old games at my arcade and console emulators, haha...

SEE YA  :cheers:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #15 on: May 26, 2011 »
You can get updated drivers for your 965M chipset here:
http://www.intel.com/support/graphics/intelg965/sb/CS-023713.htm

In general the OpenGL support for those older Intel chipsets was terrible. :(

DirectX updates, for some reason, do not come via Microsoft/Windows Update.
You need to go here
http://www.microsoft.com/downloads/en/details.aspx?familyid=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en
and run the web installer.  It will work out a diff specific to your machine and only download the files that are new or updated.

The yabasic emulator doesn't use DirectX, but it can't hurt to get up-to-date. :)

Jim
Challenge Trophies Won:

Offline Joe

  • Retrogamer
  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Button keys for Yabasic in Windows.
« Reply #16 on: May 26, 2011 »
Jim, i have just gotten updated and there's no change...
Thank you for helping me out, but i've already given up this matter, so never mind.

Greetings  ;)