Jump to content

Atarius Maximus

+AtariAge Subscriber
  • Content Count

    1,973
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Atarius Maximus

  1. Here's the latest source code. JacksOrBetter_1.35_Source.bas card_gfx.zip
  2. Just some cosmetic changes in this version. I'm getting around to a few things that were at the bottom of my list. I haven't played all that much since yesterday, but still no further bugs found in the game. The backs of the cards now have the AA Logo Changed some colors A few minor revisions to sprites Changed some graphics and colors on the Statistics screen JacksOrBetter_1.35.a78 JacksOrBetter_1.35.bin
  3. Ok, I think I've got the winning hand detection bug worked out, and the hands won counter now works properly. The timing is important on calling the different subroutines that check for winning hands, and I found that If I use a pause timer between them it effectively solves the problem. Because winning hand detection is based on a frame counter now, I'm not sure if it will break running on a PAL system with the slight timing difference. Also, it's only been tested on the A7800 emulator, I haven't played with the Concerto or CC2 yet. I ran through over 100 hands again with this build and it worked perfectly, but as always I need to do more just to make sure. One minor thing that is not a bug but is noticeable nonetheless happens on a winning hand. You will see the "Better luck next time" and "You Lose" flash on the screen for a brief moment before it switches over to the proper "You win" text. Again because of how winning hand detection works in the main loop I can't seem to solve that problem, and believe me I spent hours on that one minor little thing. It may just stay in the final version. Anyway, here's the latest build that I'm playtesting now. JacksOrBetter_1.33.a78 JacksOrBetter_1.33.bin
  4. I fixed the "hands won" counter, but did come across another bug with detecting winning hands. I'm pulling my hair out over this one, I've spent at least 8 hours on a seemingly simple fix that I just can't get to work. There are rare circumstances where the game will falsely report a straight, and when I fix it, it then no longer reports a straight when it's supposed to. The math/logic behind it simply isn't working like I'd expect. I'm not going to post the latest version as it has known issues. Hopefully I'll get this figured out soon, this really is the last remaining item to fix.
  5. I added the new sorting code to the game. I played 100 hands this evening and didn't see any problems - no false positives and no winning hands that weren't correctly identified. I managed to hit every hand except for a royal flush and a straight flush. I did test those too by forcing those hands and the detection worked as expected. It's still possible there's an issue somewhere so I'm going to keep playtesting. I was experimenting with some different colors for this version. I thought it would fit the poker theme better if I used more shades of green and yellow, like a poker table. I may change my mind, but I kind of like how it looks. Changing colors is easy, deciding which ones to use isn't. I'm attaching the latest version and a screenshot (before I changed the colors) of my results after 100 hands. Edit: I see now that the total winning hands does not equal the "Hands Won" total. It's inconsequential to the game, but I'll take a look at testing and fixing that. JacksOrBetter_1.27.a78 JacksOrBetter_1.27.bin
  6. I'm pretty sure I've got the sorting figured out now. To make it easier to test and make changes, I wrote a separate utility that tests only that. Every combination of numbers I've changed the initial values to have sorted properly. Next I'll have to squeeze the sorting function into the game itself. I'll go ahead and share the utility in case the code helps someone out in the future. It displays 5 initial values of 5-4-3-2-1, the bubble sort function runs four passes continuously, and the 4th and final pass should always show the values sorted in ascending order. You can change the initial values to sort with the joystick and fire button. Note that this is definitely not the most optimal method to sort numbers. I enjoy the challenge of attacking it like I would have originally, sitting in front of my Commodore 64 as a 12 year old, with no manuals, no help, and relying almost completely on if...then statements for logic calculations. I had fun figuring this out today. To compile you'll have to update the code and point to a copy of an atascii and scoredigits file, both come with the 7800 distribution in samples\samplegfx. For reference, this is how a bubble sort works: Take an array of numbers "5 1 4 2 8", and sort the array from lowest number to greatest number using bubble sort. In each step, elements written in bold are being compared. Three passes will be required for this example. First Pass ( 5 1 4 2 8 ) → ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1. ( 1 5 4 2 8 ) → ( 1 4 5 2 8 ), Swap since 5 > 4 ( 1 4 5 2 8 ) → ( 1 4 2 5 8 ), Swap since 5 > 2 ( 1 4 2 5 8 ) → ( 1 4 2 5 8 ), Now, since these elements are already in order (8 > 5), algorithm does not swap them. Second Pass ( 1 4 2 5 8 ) → ( 1 4 2 5 8 ) ( 1 4 2 5 8 ) → ( 1 2 4 5 8 ), Swap since 4 > 2 ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) Now, the array is already sorted, but the algorithm does not know if it is completed. The algorithm needs one additional whole pass without any swap to know it is sorted. The maximum number of passes a bubble sort needs is n-1, so for 5 values you'd need a minimum of four passes to sort all 5 numbers. Third Pass ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) → ( 1 2 4 5 8 ) BubbleSort.a78 BubbleSort.bin BubbleSort.bas
  7. Thanks for sharing that, Trebor, that's very helpful. I ran that exact same hand through my debug version and it reported cards 04 - 05 - 07 - 06 - 08, cards 3 and 4 were not sorted properly and should have been swapped. So it's a problem with the sorting code that I added. I should be able to review and fix that. Steve
  8. Lots of behind the scenes changes here at the expense of removing most of the initial logo/intro sequence, it just briefly shows the AA Logo now. I may change that back if I can find any other code I can further optimize, but for now I'm just testing the detection code. All the DMA holes are stuffed and I only have about 40 bytes remaining in the 48k ROM. Wrap around values are now detected, and I individually tested winning hands for each combination by forcing certain cards to appear. This is the version I'm currently play testing, so far so good... but I'm going to keep playing, testing, and playing some more. JacksOrBetter_1.19.bas.a78 JacksOrBetter_1.19.bas.bin
  9. Not sure who you're asking here. I have 2 7800's, one with an AV mod and one without. My real-hardware pics are using my 7800 with the standard RF output. I don't know who would currently be able to help with a mod on the forums. I used Joe at ElectronicSentimentalities (the link seems to no longer work), I shipped my console to him and he modded it for me. He used the latest and greatest Longhorn Engineering A/V board mod at the time, I had that done back in 2015. Best Electronics may still offer it as well, but I believe you have to buy a console from them as well. Someone else may be able to give you more current information.
  10. Thanks for the explanation and the images, MrFish. I should be able to fix this by programmatically putting the cards in order before evaluating them. My issue now is ROM space, I've got some work to do on cleanup first.
  11. Thanks Trebor. The description of a straight does confirm what I assumed, however it doesn't specifically state that the cards cannot wrap around. As the code is written now, a flush CANNOT wrap around, thus 56789 is a straight but 89567 is not, even though they are in sequential order when you wrap the numbers. I found it mentioned here, a random page from berkeley.edu, it was the first hit on google: An ace can be the lowest card of a straight (ace, 2, 3, 4, 5) or the highest card of a straight (ten, jack, queen, king, ace), but a straight can't "wrap around"; a hand with queen, king, ace, 2, 3 would be worthless (unless it's a flush). I am checking for the special case of A/2/3/4/5 already, and the other case with an Ace, A/K/Q/J/10, is naturally checked for already in the code because the card value difference between the A and the 10 is four.
  12. I'm re-posting v1.14, the earlier version was corrupted. Renaming to v1.15 to avoid confusion. This version includes three new checks for variations of two pairs that weren't being checked for previously. Regarding the detection of a straight or straight flush, I believe I've got the code correct but I can change it if I'm misinterpreting a rule. Here's the logic I'm using in the game to check for a straight/straight flush with descriptions rather than the code itself: ; ;Check for a Straight or a Straight Flush ; ; 1. An ordered sequence is a straight if it does not contain doubles and if the difference in value between the first and last cards is 4. ; My card values: A=14, K=13, Q=12, J=11, 10=10, 9=9, 8=8, 7=7, 6=6, 5=5, 4=4, 3=3, 2=2 ; 3/4/5/6/7, diff is 4 | 7/6/5/4/3 diff is 4 | A/K/Q/J/10 diff is 4 | A/2/3/4/5 diff is 9 (special case) ; ; 2. Aces can be high or low, but cannot wrap around (K-A-2-3-4). ; ; 3. It's not a straight if cards 2,3 or 4 are an Ace. ; ; 4. A straight can only be made if the player has a 5 or 10. ; ; 5. There can be no pairs. ; ; 6. Check and special-case the wheel (A2345), the difference is 9 rather than 4 ; ; if ( highest rank card == ACE ) ; Check if other 4 cards are ; K, Q, J, 10 ; or 2, 3, 4, 5 ; ; 7. The cards cannot all be the same suit or it's a straight flush, not a straight. ; ; 8. Check the hand for a sequence of cards... ; - If all 5 suits match, this would be a straight flush (Matching Suits) ; - If any of the cards are different suits, it would be a flush (Non-Matching Suits) ; JacksOrBetter_1.15.a78 JacksOrBetter_1.15.bin
  13. Hi James. From what I’ve read on the rules of video poker, a straight must include 5 cards of consecutive value, regardless of suit. If that hand was 9H/10S/JS/QS/KD or KD/QS/JS/10S/9H it would be a straight. Because they are not in consecutive order, it’s not a straight. If you or anyone can point me to a rule book online that states otherwise I can change it, I’m not professing to be an expert here.
  14. You're right Trebor, sorry about that. I've been doing more than one thing at the same time today, I'm a little bit busy. The last version didn't compile correctly because I'm out of ROM space in the current build so I'll have to do some cleanup. I didn't notice that earlier. It'll have to wait until this evening.
  15. I found one more missing two pair check. At this point I'll just re-review all of the game logic to make sure there are no other omissions. If anyone plays and comes across a hand that doesn't register properly as a win or a loss, please let me know. JacksOrBetter_1.14.a78 JacksOrBetter_1.14.bin
  16. Here's the updated binary that addresses the bug that James found with checking for two pairs. JacksOrBetter_1.13.a78 JacksOrBetter_1.13.bin
  17. As I read the video poker rules originally, the hand above would not be a straight (King - Ace - 10 - Jack - Queen). The ace cannot be the 2nd, 3rd or 4th card, which is how my current game logic processes the hand when checking for a straight. The Ace must be high or low. I'll do a little more reading, but I think this is the expected result.
  18. I based the game logic simply on some basic rules I read on the internet for video poker. The hand in the picture should in fact be a 2 pair winner. I missed two checks for two pairs. Regarding the "jacks or better" rule, that only applies if you draw a single pair. I missed the two combinations below when checking for two pairs. it's been fixed and a new post with that fix is coming shortly. If you noticed any other hands that didn't properly register as a win please let me know. ; 1 2 3 4 5 ; --- --- --- --- --- ; x y y x ; x y y x
  19. Here's the source code. JacksOrBetter_1.12.bas card_gfx.zip
  20. Thanks moycon, and yeah that's the plan! I haven't posted much on this specific forum all that much over the past 20 years, I think about 1,800 of my 1,953 posts have been in the 2600 hacks, batariBasic and 7800basic forums. I always check here and read the latest when I'm online though.
  21. Yep, that was a problem. On your last coin it would not register the win or loss, and it wouldn't even show you on screen what happened on your final hand before switching over to the game over screen. This minor update fixes it. When you spend your last coin (or run out of time), it runs the stats check again and will display the final action on the screen for about 3 seconds... then automatically take you to the game over statistics screen. During that last 3 seconds you can't press the fire button to proceed (fire does nothing), but it's a very brief pause. Based on how much ROM space I have left it was the most efficient solution to the problem. JacksOrBetter_1.12.a78 JacksOrBetter_1.12.bin
  22. I forgot to mention how to access the stats screen and how it works. To access the statistics screen during the game, press the right button. The right button is also of course used when you're choosing to drop or hold a card, so simply press the right button whenever you're NOT on the drop/hold area. Once your enter the stats screen, press the left fire button to exit it. When the game ends, the "Statistics" title will change to "Game Over", and the game will restart with your previously chosen menu options when you press left fire rather than just returning you to the game. One other important note: The statistics are updated whenever you press "Deal". If you're in a timed game, you're close on time, make sure you deal the next hand to get credit for the win on the stats screen. Hmmm.... now that I just thought about this, when you use your very last coin you won't be able to select deal again, so it won't add to your stats. I'm going to test that and I'll add another call to the subroutine that checks it when your coins reach 0 if it's needed. There may be another update soon.
  23. Here's the updated binary that includes the items mentioned by @Trebor Version 1.10: Colors were brightened up. It's a bit bright in emulation, but looks much better on real hardware. The issue with the deck of cards occasionally showing up without the drop/hold option has been fixed. I added a new statistics screen that you can pull up in-game, and also shows up now when the game is over. It will show the number of each type of winning hand you drew, the number of hands you won and lost, and the number of coins used (or the timer selected) and your credits. I played it for a while and haven't noticed any bugs. I'll keep playtesting and post another update if I come across anything. If there are no further bugs discovered this will be the final version. I did a fair amount of code optimization in order to squeeze in the stats screen and I'm down to 100 or so bytes remaining in this build. It's unlikely I'll add any more features. Note: Update two posts down. JacksOrBetter_1.10.bin JacksOrBetter_1.10.a78
  24. Thanks for pointing those issues out Trebor, I'll take a look in the coming days and try to reproduce/fix them. Edit: I found and fixed the issue, but holding off a bit longer on posting an update. I freed up enough space to add something else I wanted to add and I'm working on that now...
  25. Since I know I'll forget to do it on August 21st, I thought I'd do it now while I'm thinking about it. It's been (really close to) 20 years now since I've joined AtariAge, and I thought I'd commemorate that milestone with a bump of my very first post on the forums from August 2002. Thanks to everyone for all the trades, the answered questions, the support when I attempted to first starting hacking and creating new games, for new friendships, for your patience with me, and for being such an awesome community in general. Cheers to all! Steve
×
×
  • Create New...