Jump to content
IGNORED

QuadTari sample code for bB


Karl G

Recommended Posts

I've created a sample 4-player QuadTari game for bB using the standard kernel. My implementation uses a small code change to the standard kernel, which should be rolled into a future batari Basic release. Versions for the Multisprite kernel and the DPC+ kernel will be forthcoming.

 

For now, to use this code, place the included std_kernel.asm file in your project directory. To enable the QuadTari code, dim a variable with the name qtcontroller, e.g.:

 

	dim qtcontroller=y

 

This variable will be used to set which pair of controllers will be read on the next frame (after drawscreen). Note that only bit 0 of this variable is used, so the other 7 bite can be used in the project without being overwritten.

 

By default, controllers 1 and 2 will be selected at the beginning of your game. To read from controllers 3 and 4, set the qtcontroller variable to 1, and then do a drawscreen. On the next frame, controllers 3 and 4 will be selected. To switch back to controllers 1 and 2, set the qtcontroller variable back to 0, and do a drawscreen. Note that if you are using the other bits of this variable for other purposes, you will instead want to set bit0 directly instead of setting the whole variable.

 

To allow Stella to detect your game as a QuadTari game, you can include the following data statement:

 

	data quadtari_detection
	$1B, $1F, $0B, $0E, $1E, $0B, $1C, $13
end

 

The included demo game "raindrops" also includes code to detect if the QuadTari hardware is detected (either present in Stella, or on real hardware). If it is not detected, the background color is turned to red.

 

Let me know if you have any questions, or find any bugs in this code.

 

Version 3 2/13/2021:

 

bb-qt-stdkernel.zip

raindrops.bin

 

 

 

raindrops.bas_3.thumb.png.203d34dbfc5ebfa4aab56b1944f8902a.png

  • Like 6
  • Thanks 2
Link to comment
Share on other sites

Raindrops game description:

 

You are a magical flying umbrella. Like all magical flying umbrellas, your goal is to avoid getting hit by raindrops, and capture purple things flying across the sky. If you get hit by a raindrop, you go back to your starting point. If you capture the purple thing, you gain a point. First player to 9 points wins the game.

  • Like 3
Link to comment
Share on other sites

@Gemintronic - your wish is my command.  ;-)

 

This is the version for the Multisprite kernel. It is used the same way as the standard kernel version, except that it will be the modified multisprite_kernel.asm that you place in your project directory.

 

The sample code shows an example of setting the active controllers using a single bit, and using another bit in the same variable for another purpose. This is also a demo of using the left side of the QuadTari, with a normal controller plugged into the right side for a 3-player game demo.

 

The sample code is a simple game called Space Debris. You are in a piloting competition in a hazardous sector. You are competing against 2 other pilots to see who can demonstrate the best piloting skills. Avoid the space debris and asteroids flying towards your ship. Each hit reduces your shield strength by one. The last pilot with remaining shields wins.

 

Version 3 (2/13/2021):

 

 

 

 

bb-qt-multisprite.zip

 

spacedebris.bin

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

And last but not least - here is the version for the DPC+ kernel, plus yet another game demo with sample code. I realized that the other two samples did not use the fire button, so this one makes use of it.

 

Witch's Tower: Your tower is being attacked by multiple dragons! Dragons can only be defeated by the combined power of 4 witches controlling their wands remotely. To shoot a dragon, all 4 players must be aiming their wands the same direction AND all 4 players must be hitting the fire button.

 

Version 2:

bb-qt-DPCplus.zip

witchtower.bin

 

witchtower.bas_1.thumb.png.05a1f85aabe7c82a60d15b7a7d2fe2d4.png

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

QUADTARI WORLD DEBUT!

 

ZeroPage Homebrew will be playing the three QuadTari demo games Raindrops, Space Debris and Witch's Tower that use Nathan Tolbert's brand new four joystick adapter, the QuadTari on tomorrow's (Fri Feb 12, 2021) stream LIVE on Twitch at 6PM PT | 9PM ET | 2AM GMT! Hope everyone can watch!

 

 

Games:

 

 (SET VIDEO TO 1080P60 FOR FULL QUALITY)

 

 

 

Edited by ZeroPage Homebrew
  • Like 3
Link to comment
Share on other sites

4 minutes ago, Karl G said:

@ZeroPage Homebrew It's cool that you are including these on your show tomorrow. I hope that it's clear that these are quick and dirty proof-of-concept code, and not intended to be serious games. My family did seem to enjoy testing Raindrops, though. ?

Oh definitely, it's great that you've made these demos to show how people can start putting to use the QuadTari in batari Basic. I'm really looking forward to all the creative multiplayer games that will be coming out!

 

- James

Edited by ZeroPage Homebrew
  • Like 2
Link to comment
Share on other sites

10 minutes ago, Karl G said:

@ZeroPage Homebrew It's cool that you are including these on your show tomorrow. I hope that it's clear that these are quick and dirty proof-of-concept code, and not intended to be serious games. My family did seem to enjoy testing Raindrops, though. ?

I'm looking forward to seeing them. My QuadTari is scheduled to arrive tomorrow. I won't have a chance to test it before the show. Too busy with work.

  • Like 1
Link to comment
Share on other sites

I have updated the Multisprite kernel demo to be 3 players instead of 4. This is so I have a demo where the QuadTari is only plugged into one controller port (left). A normal controller is plugged into the right controller port to make a 3-player game. It also gives each of the ships more room to maneuver.

 

@ZeroPage Homebrew - if it's not too late, the new version of Space Debris might be better for the show tonight.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Karl G said:

I have updated the Multisprite kernel demo to be 3 players instead of 4. This is so I have a demo where the QuadTari is only plugged into one controller port (left). A normal controller is plugged into the right controller port to make a 3-player game. It also gives each of the ships more room to maneuver.

 

@ZeroPage Homebrew - if it's not too late, the new version of Space Debris might be better for the show tonight.

Thanks for the heads up Karl! I'll download the new version for tonight. ?

 

- James

Link to comment
Share on other sites

14 minutes ago, Karl G said:

I have updated the Multisprite kernel demo to be 3 players instead of 4. This is so I have a demo where the QuadTari is only plugged into one controller port (left). A normal controller is plugged into the right controller port to make a 3-player game. It also gives each of the ships more room to maneuver.

 

@ZeroPage Homebrew - if it's not too late, the new version of Space Debris might be better for the show tonight.

I really need to your games. -Thanks.?

Link to comment
Share on other sites

8 hours ago, Karl G said:

I've updated the Space Debris demo above based on issues identified in the ZPH stream:

  • 4th player score is no longer visible
  • Immortality bug has been fixed
  • Increased X-axis mobility for Tanya

The extra room to move is great, Tanya says thank you! ?

 

- James

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Just curious...

 

Is it difficult to modify this code to accommodate 8 players via paddle?

 

I was looking at making a simple little program that really just needs to put a fire button in 8 different people's hands. I had considered just using two joysticks and using the directions on each joystick but didn't know how possible something like this would be with a quadtari in bB.

Link to comment
Share on other sites

1 hour ago, KevKelley said:

Just curious...

 

Is it difficult to modify this code to accommodate 8 players via paddle?

 

I was looking at making a simple little program that really just needs to put a fire button in 8 different people's hands. I had considered just using two joysticks and using the directions on each joystick but didn't know how possible something like this would be with a quadtari in bB.

Not difficult at all, really. In this case, we are ignoring the paddle part of the paddles, and just reading the fire buttons, so you wouldn't even need the "readpaddle" kernel option. Normally, joy0left maps to the paddle0 button, joy0right maps to the paddle1 button, joy1left to the paddle2 button, and joy1right to the paddle3 button. With the quadtari and my modified kernel (which should be rolled into the next bB release, on frames where qtcontroller is set to 1, you could read the other 4 paddle buttons from the other sets of paddle controllers in the same manner.

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, KevKelley said:

How exactly are the paddles labeled in bB for 8 different paddles? Or when qtcontroller =1 it knows with the kernel what joy0left and the other directions mean?

Yeah; I had wanted to have aliases setup for joy2 and joy3, but there's not an easy way to do that. If you set qtcontroller to 1, then after the next drawscreen, joy0 will be joy2, and joy1 will be joy3. Then you can set it back to 0, and on the next drawscreen it will be back to the first sets of controllers again.

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...