Jump to content
IGNORED

Can somebody post the bare minimum to read paddle?


potatohead

Recommended Posts

So, the timer is actually counting while the basic program is running.  At least that's the only reason I can see for such a large value.  So every 64 cycles of basic code should yield a different number.  Maybe I just didn't get lucky with my samples.  (trying that again.)

Yes, this is true.

Since I'm on Linux, Stella is basically the emulator I'm going to be running.

904921[/snapback]

There is now a Linux port for z26.

Link to comment
Share on other sites

Still a minor problem with display, now ALL pfpixel scanline breaks are 1 pixel too high! Paddle works though, thanks for the kernel.

 

For everyone's information, when drawing a playfield with PF0=128, the left boundary is 31 and the right is 151, giving you a 120 pixel playfield.

 

Also, what do I have to do to enable the ball? Just give it an X, Y, and height? I'm assuming a height of 0 disables it.

904872[/snapback]

You're right, I messed up that kernel too. I think I fixed this, so I edited the above post with what I hope to be a corrected version.

 

Also, on the ball, to turn it off, simply position it off of the visible screen by setting bally large enough. 100 should work.

Link to comment
Share on other sites

So, the timer is actually counting while the basic program is running.  At least that's the only reason I can see for such a large value.  So every 64 cycles of basic code should yield a different number.  Maybe I just didn't get lucky with my samples.  (trying that again.)

Yes, this is true.

Since I'm on Linux, Stella is basically the emulator I'm going to be running.

904921[/snapback]

There is now a Linux port for z26.

904935[/snapback]

 

 

Nice. I'll give this a shot at some point in the near future and give my plan b paddle idea another try. I liked supercat's idea too. Splitting the read over a few frames.

 

The only drawback would be the loss of instant paddle movement from extreme side to side.

 

However, moving 16 values at a time, per frame, doubled makes 32 pixel movement possible every frame. For almost all paddle moves, this would be really a good comprimise. The only difference the player would experience, over a full on kernel paddle read, would be a latency on extreme moves that could be as high as 1/3 second. (With the paddle value doubled that is.) For my game, that would be totally workable. Going to think his idea over a bit... I'll bet it takes two bytes of storage to implement though.

 

Right now, I don't need paddle support for the game. I think I probably should be working on is trimming the fat in order to add the last coupla features. I've about 300 bytes left at this point and 3 variables. If I can rewrite some things to free up another byte or two, that will be enough to allow for a power up (faster bullets) and some fast moving ooze drops to avoid while battling the ooze.

 

Hard to decide if the features are worth more than really intense gameplay would be with the features that exist today...

Edited by potatohead
Link to comment
Share on other sites

Well then the ball doesn't work either. :(

 

I have the following for ball code:

 

 ballx = 70
 bally = 50
 ballheight = 4

 

I inserted that before my drawscreen. The playfield obviously has a color, so I don't know why it won't show up.

905249[/snapback]

Well, first of all, I think the ball only exists in the paddle kernel that batari attached in this thread - it doesn't exist in the standard bB kernel.

 

Also: if the ball is in the same place as a playfield block, you won't see it - since they are both the same color! ;)

Link to comment
Share on other sites

Yes, I'm using Batari's paddle kernel. I made the line that jumps to loading a level jump to the next line, so there is no playfield at all.

905464[/snapback]

I thought I had correctly added the ball, but I didn't :dunce:

Anyway, I found the problem. Here's the corrected kernel. I've also deleted the kernel above. Hopefully everything works this time.

2600basic.zip

Link to comment
Share on other sites

I noticed the file size shrinks each time you upload a new one... :P

 

Does the ball have only one thickness?

905640[/snapback]

It has four thicknesses. In bB, you would change the ball thickness by the following:

 

1 pixel wide (default): CTRLPF=$01

2 pixels wide: CTRLPF=$11

4 pixels wide: CTRLPF=$21

8 pixels wide: CTRLPF=$31

Link to comment
Share on other sites

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

 

ballinit
 n = rand
 if n < 63 then t = 1 && u = 1
 if n < 127 && n > 63 then t = 1 && u = 0
 if n < 191 && n > 127 then t = 0 && u = 1
 if n < 255 && n > 191 then t = 0 && u = 0
 goto ballmove

ballmove
 if m = 0 then goto 70
 if t = 1 then ballx = ballx + 1
 if t = 0 then ballx = ballx - 1
 if u = 1 then bally = bally + 1
 if u = 0 then bally = bally - 1
goto 17

 

Why won't my ball move? M is set to 1 upon pressing fire.

Edited by Luigi301
Link to comment
Share on other sites

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

 

ballinit
 n = rand
 if n < 63 then t = 1 && u = 1
 if n < 127 && n > 63 then t = 1 && u = 0
 if n < 191 && n > 127 then t = 0 && u = 1
 if n < 255 && n > 191 then t = 0 && u = 0
 goto ballmove

ballmove
 if m = 0 then goto 70
 if t = 1 then ballx = ballx + 1
 if t = 0 then ballx = ballx - 1
 if u = 1 then bally = bally + 1
 if u = 0 then bally = bally - 1
goto 17

 

Why won't my ball move? M is set to 1 upon pressing fire.

905873[/snapback]

 

Can you post the whole thing?

Link to comment
Share on other sites

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

 

ballinit
 if n < 63 then t = 1 && u = 1
 if n < 127 && n > 63 then t = 1 && u = 0
 if n < 191 && n > 127 then t = 0 && u = 1
 if n < 255 && n > 191 then t = 0 && u = 0

Why won't my ball move? M is set to 1 upon pressing fire.

905873[/snapback]

I think you want to separate the statements after the "then" with a colon. If you use &&, for example on the first statement, I think it will assign t to the logical AND between 1 and u and ignore the second =. I'd try this:

ballinit
 if n < 63 then t = 1 : u = 1
 if n < 127 && n > 63 then t = 1 : u = 0
 if n < 191 && n > 127 then t = 0 : u = 1
 if n < 255 && n > 191 then t = 0 : u = 0

Edited by batari
Link to comment
Share on other sites

Doesn't work either. Here's my code.

906190[/snapback]

OK, that clears things up a bit.

 

I found a few issues in the code:

26 if o < 151 then o = 151 : if switchrightb then goto 27 : if o < 28 then o = 28 : if o > 142 then o = 142

You probably want to put these if-thens on their own lines. The last two will never be reached.

30 if switchleftb then goto 50 else goto 31

bB doesn't support "else" right now - the compiler will ignore the else.

51 if joy0fire && m = 0 then goto startball

The fire button on the paddles is actually read by joy0left and joy0right.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...