Jump to content
atari2600land

Video Poker

Recommended Posts

For my next project, I thought I'd do a game that isn't on the 2600: Video Poker. Despite my earlier efforts, I think i'll get farther in this game than i have on previous attempts to make a video poker game for the 2600. There are a few bugs, though.

#1 - the scanline is constant at 263, and

#2 - see the picture below.

 

You can select all five new cards by holding the reset button for a second or two.

post-9475-1238552422_thumb.png

videopoker.bas.bin

videopoker.bas

Share this post


Link to post
Share on other sites
For my next project, I thought I'd do a game that isn't on the 2600: Video Poker. Despite my earlier efforts, I think i'll get farther in this game than i have on previous attempts to make a video poker game for the 2600. There are a few bugs, though.

#1 - the scanline is constant at 263, and

#2 - see the picture below.

 

You can select all five new cards by holding the reset button for a second or two.

 

It's a good start. The batari kernel may not be good for showing multiple hands of cards. But if your opponent's hand is hidden, then perhaps you'd hit Difficult switch a to b to see the opposing hand. Or if it's a texas holdem poker, the common cards could be viewed by sliding the switch, and then switching back to your and with the switch. You could use the multisprite kernel for a 3 player hold-em game, you vs two comps. Switch back and forth between displaying the two-card hands and the 5 common cards.

 

Make it a supercharger game and use the extra ram for computer betting and folding A.I. I bet there's a way to use a pointer to a set of graphics without having to code manually all the cards for each sprite. There's 52 cards in a standard deck, so each card held could have a value of 1 to 52. A little if-then can prevent duplicates, and then you can call the appropriate subroutine to set the graphics for your sprite. I do believe there was a question posted here a few months back to that effect. I'll see if I can find it.

 

post-9499-1238600657.jpg

 

 

I used a blue outline just so i knew not to get outside the 8 pixel width limit. Perhaps something like that would be good for your game.

Share this post


Link to post
Share on other sites

This isn't a multiple-hands type of poker, this is the type of poker computer machine you'd find at a casino.

Share this post


Link to post
Share on other sites

Video Poker is the only electronic game I play at casinos, it's about the only electronic game there that requires some skill and attention to go with your luck. I hope your game allows you double-up when you win, and has Jacks or Better and Deuces Wild modes.

Share this post


Link to post
Share on other sites
Video Poker is the only electronic game I play at casinos, it's about the only electronic game there that requires some skill and attention to go with your luck. I hope your game allows you double-up when you win, and has Jacks or Better and Deuces Wild modes.

 

Good call, yeah. I got a little hot streak going the last time I went to Atlantic City. First I hit for a straight flush on the video poker at the bar, then racked up a couple of hundred out on the floor. You definitely do have to pay attention to what you are doing. It would be nice to have those options.

Share this post


Link to post
Share on other sites

You can now select cards to drop and get new ones. To do this, select a card you want to get rid of by using up & down and press fire. The card will then turn blue. To actually get the new cards, make the arrow go all the way down to the blank space and press fire. The version i'm posting here is different from the first, even though they have the same file name.

videopoker.bas.bin

videopoker.bas

Share this post


Link to post
Share on other sites
You can now select cards to drop and get new ones. To do this, select a card you want to get rid of by using up & down and press fire. The card will then turn blue. To actually get the new cards, make the arrow go all the way down to the blank space and press fire. The version i'm posting here is different from the first, even though they have the same file name.

 

Looks good, nice game so far. Are you working on any further additions to the game, like a scoring system or maybe a computer opponent? Piggles had some good suggestions, maybe you could switch between two separate screens for the player and computer's hands.

 

Steve

Share this post


Link to post
Share on other sites
You can now select cards to drop and get new ones. To do this, select a card you want to get rid of by using up & down and press fire. The card will then turn blue. To actually get the new cards, make the arrow go all the way down to the blank space and press fire. The version i'm posting here is different from the first, even though they have the same file name.

 

Looks good, nice game so far. Are you working on any further additions to the game, like a scoring system or maybe a computer opponent? Piggles had some good suggestions, maybe you could switch between two separate screens for the player and computer's hands.

 

Steve

 

You're confusing this with a sim of sit-down Table Poker. In Casino Video Poker, you're not competing against another player. Video Poker is like a Slot Machine - solo game. You input whatever bet you'd like to make - up to the max. Youu're dealt five cards on the screen. You select the cards in your hand you want to keep and the dealer give you your replacement cards. Your final hand pays out depending on the poker hand. Usually the minimum payout is 1 to 1 for a pair of Jacks or better. Royal Flush is a 250-to-1 payout. Some machines have wild cards (Twos and Jokers) that make filling those better hands easier too.

 

So - no - there is no opponent to play against just like there is no opponent when you pay the slots.

Edited by Snider-man

Share this post


Link to post
Share on other sites

I decided to start over again - mainly because I got a new computer, and second if I looked at the code of the previous version, i would probably not be able to understand it. Right now, it displays 5 cards. That's it so far. This took about 2-3 hours.

vp1.bin

default.bas

Share this post


Link to post
Share on other sites

Now it plays more like it's supposed to: you can pick cards to keep and redeal. I haven't added any pair, flush or straight recognition yet. You'll notice when you start a new game, the score briefly turns red for a frame or so. Is there any way to tell what that number that is? I can't seem to time it right to pause it in Stella.

default.bas

vp3.bin

Share this post


Link to post
Share on other sites

Added some hands: one pair, two pair, three of a kind, full house, and flush. What I need to add is royal flush, four of a kind, straight flush and straight. I don't have any idea how I'm going to make it recognize a straight, though (i.e. 5, 6, 7, 8 & 9). Anyone have any ideas? Here's the breakdown of the "payments":

 

one pair (Jacks or better) - 1

two pair - 2

three of a kind - 3

straight (not implemented yet) - 4

flush - 5

full house - 6

four of a kind (not implemented yet) - 7

straight flush - 8

royal flush - 9

vp4.bin

default.bas

Edited by atari2600land

Share this post


Link to post
Share on other sites

Added some hands: one pair, two pair, three of a kind, full house, and flush. What I need to add is royal flush, four of a kind, straight flush and straight. I don't have any idea how I'm going to make it recognize a straight, though (i.e. 5, 6, 7, 8 & 9). Anyone have any ideas? Here's the breakdown of the "payments":

 

one pair (Jacks or better) - 1

two pair - 2

three of a kind - 3

straight (not implemented yet) - 4

flush - 5

full house - 6

four of a kind (not implemented yet) - 7

straight flush - 8

royal flush - 9

 

I will download it and try it out and let you know what I think when I get home this evening, looks like an interesting game!!!

 

Thanks

Disjaukifa

Share this post


Link to post
Share on other sites

To detect a straight, you could sort the card values from lowest to highest and check if card1=n and card2=n+1 and card3=n+2, etc. You could use a for-loop to make n=1 to 9 or whatever to let it check each possible straight.

 

Best regards,

Zuf

Share this post


Link to post
Share on other sites

Actually, I think you wouldn't need the for-loop if you sort the values, since you would know which card has the lowest value. You could just check that card1 equals card2-1, etc.

 

You could use another way to avoid sorting, though. You could use a loop to check that there are cards all with values n to n+4.

 

There are an infinite number of ways to solve any problem, so you may be able to come up with another solution.

Share this post


Link to post
Share on other sites

If one doesn't mind using 16-bit maths for things, one can rather easily detect card combinations with minimal RAM by using a bitmask table (0,0,0,0,0,0,0,0,1,2,4,8,16,32,64,128,0,0,0,0,0) and then doing something like:

; Initialization
 lda #0
 sta oddL
 sta oddH
 sta evenL
 sta evenH

; Assume following code is run once for each card; the card number in X register
; is in the range 0..12 (for A-K).
 lda mask+8,x
 and oddL
 eor evenL
 sta evenL
 lda mask+8,x
 eor oddL
 sta oddL
 lda mask,x
 and oddH
 eor evenH
 sta evenH
 lda mask,x
 eor oddH
 sta oddH

; Then run the following code to normalize things
; (may loop forever if there were a odd number of
; cards).
lp:
 lda oddL
 ora evenL
 lsr
 beq done
 lsr oddH
 ror oddL
 lsr evenH
 ror evenL
 jmp lp  

Now if oddH:oddL are $1E:01 the player has a royal; if oddL is $1F the player has a straight. If oddL is 1 and all other bytes are zero, player has four of a kind. I'll post the other card combinations later if you need.

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...