Jump to content
Sign in to follow this  
TooSlowGamer

Sample Code for Paddle Control?

Recommended Posts

Could someone point me to Batari Basic sample code/snippets that uses a paddle controller?

 

Also, I'm trying to use the readpaddle kernel option, but when I use type in "currentpaddle" it gets highlighted in yellow (in VbB) like it's not a real command.

Edited by TooSlowGamer

Share this post


Link to post
Share on other sites

Could someone point me to Batari Basic sample code/snippets that uses a paddle controller?

 

Also, I'm trying to use the readpaddle kernel option, but when I use type in "currentpaddle" it gets highlighted in yellow (in VbB) like it's not a real command.

VbB still doesn't know all of the valid commands and things. If you are sure it's correct, you can probably ignore any warnings. The bB page has one tiny example so far:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#paddlereading

 

And you can use the advanced search to search bB forum topics for the word paddle to see if there are better examples.

Edited by Random Terrain

Share this post


Link to post
Share on other sites

Could someone point me to Batari Basic sample code/snippets that uses a paddle controller?

 

Also, I'm trying to use the readpaddle kernel option, but when I use type in "currentpaddle" it gets highlighted in yellow (in VbB) like it's not a real command.

VbB still doesn't know all of valid commands and things. If you are sure it's correct, you can probably ignore any warnings. The bB page has one tiny example so far:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#paddlereading

 

And you can use the advanced search to search bB forum topics for the word paddle to see if there are better examples.

 

Well, it won't compile either. The only problem is I can't compile with VbB, so I always copy and paste it into Crimson Editor to paste it. So, I think, the eroor that comes up is different.

 

It says "Fatal Assembly Error: Source is not Resolvable" "Unresolved Code List: mul8 0000 ???? (R )"

Share this post


Link to post
Share on other sites

Here's the code I'm trying to compile

 

 rem Generated 8/31/2010 7:01:06 PM by Visual bB Version 1.0.0.550
rem **********************************
rem *<filename>                      *
rem *<description>                   *
rem *<author>                        *
rem *<contact info>                  *
rem *<license>                       *
rem **********************************


rem Generated 8/31/2010 7:01:06 PM by Visual bB Version 1.0.0.550
rem **********************************
rem *<filename>                      *
rem *<description>                   *
rem *<author>                        *
rem *<contact info>                  *
rem *<license>                       *
rem **********************************


set kernel_options no_blank_lines readpaddle
set tv ntsc

playfield:
....XXX........................
...X...X.......................
...X...........................
....XXX........................
.......X.......................
...X...X.......................
....XXX........................
...............................
....XXX........................
...X...X.......................
...X...X.......................
...............................
end

COLUPF = $3C

player0x=50: player0y=50

sprites
player0:
%01000010
%01111110
%01111110
%01101110
%01111010
%01011110
%01110110
111100
011000
011000
end

loop
drawscreen
currentpaddle = 0
drawscreen
player0x = 2 * paddle + 1 : if player0x > 153 then player0x = 153

goto sprites

Share this post


Link to post
Share on other sites

It looks like bB requires a "include div_mul.asm" line if you enable bB paddle support.

Share this post


Link to post
Share on other sites

It looks like bB requires a "include div_mul.asm" line if you enable bB paddle support.

 

Thanks, now it will compile, but the paddle function doesn't work. It places the sprite on the very left side of the screen and you can't move.

Share this post


Link to post
Share on other sites

Kaboom works fine in Stella, but I can't get my game to work or the game you linked. What the heck!?

Did you do this:

 

Tab key > Game Properties > Controller tab > paddles > close Stella > run game again.

Share this post


Link to post
Share on other sites

Kaboom works fine in Stella, but I can't get my game to work or the game you linked. What the heck!?

Stella knows Kaboom needs paddles because it has a game database.

 

Do what RT said and your program will work.

Share this post


Link to post
Share on other sites

Kaboom works fine in Stella, but I can't get my game to work or the game you linked. What the heck!?

Did you do this:

 

Tab key > Game Properties > Controller tab > paddles > close Stella > run game again.

 

Thanks a lot, it worked. But I'm still confused why Kaboom worked without this? I mean, there's no way the mouse could be set to joystick controls?

Share this post


Link to post
Share on other sites

It looks like bB requires a "include div_mul.asm" line if you enable bB paddle support.

The module is needed for the 2 * paddle + 1 above. If it were written as paddle * 2 + 1 it probably would not be needed. Looks like I should have the compiler check swapped multiplicands and choose the one that produces better code.

Share this post


Link to post
Share on other sites

:ponder:

 

Stella knows Kaboom needs paddles because it has a game database.

 

I was typing my response at the same time he was typing his, he just posted before me...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...