Jump to content
IGNORED

BlackJack Theta VIII - 2600 game - 8K


azure

Recommended Posts

5 hours ago, azure said:

I'm uploading a new version 0.9. The biggest addition is the intermission screen. It's totally pointless, but I enjoyed working on it. I gained some insights I can use for my other game. It's a work in progress, so I'll be futzing with it more. I intend to reuse it for an idle screen and a game over "Break the Bank" screen that r_type2600 suggested.

I like the intermission screen, it works with your backstory of Theta VIII.

 

5 hours ago, azure said:

I also added a timer delay upon the end of a hand to momentary disable joystick input, so that the player has a chance to review the results without accidentally pressing the fire button.

 

Nice! I love it!

 

5 hours ago, azure said:

I don't have a flashback portable version, because it's not compiling at the moment and I want to work on more interesting features for now. I have to do some adjustments to the ballast data in order to get it to compile. I'll have an AFP version for the next update.

Works perfect on the AFP, as it does on Stella 6.0.1, but when the dealers cards are turning over the players score (amount) is changing also - game bug?

I will have to try it on Harmony and UNO another day when I get a chance.

  • Like 1
Link to comment
Share on other sites

On 8/28/2019 at 8:00 PM, Arenafoot said:

Works perfect on the AFP, as it does on Stella 6.0.1, but when the dealers cards are turning over the players score (amount) is changing also - game bug?

 I will have to try it on Harmony and UNO another day when I get a chance.

Hmm. That's weird, because I did nothing to make sure it works on AFP. I couldn't test on it, because my daughter took my AFP (again), so I'm not sure where it is at the moment. I guess moving some code around made a difference. The intermission code and data filled up some empty space in bank 4, so maybe that had something to do with it.

 

Also, I see what you're saying about the score. I'm not sure what is causing that. I'll look into it.

Edited by azure
  • Like 1
Link to comment
Share on other sites

I just realized yesterday shuffling is broken, so it will go to black screen when it runs out of cards. I think I know what it is. I'm trying to do two out of band tasks on the same frame, so the shuffling task gets overwritten by a card animation task. I only have 7 tasks, so I'm thinking I can store 2 in a byte to support two simultaneous tasks.

TSK_NONE                    = 0
TSK_DEAL_CARD               = 1
TSK_FLIP_CARD               = 2
TSK_SHUFFLE                 = 3
TSK_DEALER_DISCARD          = 4
TSK_PLAYER1_DISCARD         = 5
TSK_PLAYER2_DISCARD         = 6
TaskWork                    ds.b 1
TaskArg                     ds.b 1

Hmm, or I can pass the 2nd chained task in the TaskArg.

 

This bug must have been there since I implemented the card flip animation. Version 0.7 or 0.8 I think. Too lazy to check.

Link to comment
Share on other sites

  • 2 weeks later...

I downloaded it a week or so ago and keep finding myself loading it up every once in a while to play a couple of quick hands.  This is really good! Overall, the game plays well and is very polished.  The card animations are great.  The intro animation (ship crashing) is a nice touch... though it could use a bit of sound.

 

Looking forward to seeing the completed product.

  • Like 1
Link to comment
Share on other sites

4 hours ago, splendidnut said:

I downloaded it a week or so ago and keep finding myself loading it up every once in a while to play a couple of quick hands.  This is really good! Overall, the game plays well and is very polished.  The card animations are great.  The intro animation (ship crashing) is a nice touch... though it could use a bit of sound.

 

It's half started. I'm working on the sound, so my dev version has some sound already. I'll probably add a flame animation and a casino appearing in the background.

 

I've fixed a few serious bugs in my shuffle task (task logic in general). I was trying to run 2 simultaneous tasks when my design only supported one. It now supports two.

 

I've also fixed the player's score which was temporarily showing the dealer's accumulated score when the dealer is playing. I'm currently trying to fix a small graphics glitch with split hands. The colors flicker a little (similar issue).

 

I've also recovered 2 bytes of RAM, so that resolves an issue with the betting screen message bar where the stack and temporary variables were overlapping.

Edited by azure
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

A quick update on what I'm working on. I don't have a binary this time.

 

I spent several weeks on an experimental intermission kernel that didn't really pan out. I'll see later if I can reuse it for another game, because I like the strategy.

 

I finished the intermission screen of the ship landing. Afterward, I took a step back from the code. Over the course of the last few weeks I thought about what could be done better. I came up with a bunch of things. Since this is my first game and I know considerably more about the peculiarities of the machine today than I did when I started, there's a bit of questionable code going back to my 1st version.

 

I'm dealing with some design decisions that didn't account for an idle screen. The event flow has to handle being interrupted on the game screens and title screen. I'm working on a new design to redo the flow of game state. I'll be moving kernels around in the banks.

 

The game was bouncing during screen transitions on real hardware, which wasn't showing up on Stella. That's fixed; however, I'm still trying to figure out a strange rendering problem on the play screen. When the dealer has 3 cards the screen expands in height (top and bottom margins). It renders normally when the dealer has any other number of cards. It doesn't happen in Stella--only real hardware. It resembles a timer issue, but that doesn't explain why the top margin expands upward. It's probably an amalgamation of bugs with the timer. It was not happening in older versions.

 

I'm redoing parts of the game to free up more RAM. I can free up about 4 bytes by just being smarter with variables. I'm also redesigning my memory layout to formalize the reuse of temporary memory, because right now it's a bit of a hodgepodge. The layout will follow this format:

[global memory] [local memory] [stack memory]

Local memory is local to the bank. For example, I have a block of memory (12 bytes) that's not being used efficiently. It's reserved for the graphics of the 2nd split hand. It's only used on one screen, so it should be made available for the other banks.

 

I'm redoing the joystick and switch handling, because it's wasting 2 bytes. It reads the joystick in the vertical blank and then makes its joystick decision making in the overscan. It's all being moved to the overscan to avoid storing state.

 

Finishing these changes will greatly expand what I can do with the features, because I'm a bit boxed in at the moment. I think I should spend some time analyzing the ROM usage as well.

  • Like 5
Link to comment
Share on other sites

  • 4 months later...

An update to let people know I'm still around. I freed up 387 bytes in the 3rd bank. I was painted into a corner and running out of space. Bank 3 is where the main game kernel was running. I realized I was relying too much on macros which bloated my codebase. I'm working on freeing up more. I'm also cleaning up all the messy variables, file organization, and sloppy inefficient subroutines.

 

Also, the kernel to my Rampart inspired game is working very well even to my own surprise. It was the most difficult kernel I've worked on so far. It took months to get basic screen rendering working. I tried different designs until I got one that works. It's currently 4K, no bankswitching, no DPC. I have no idea if it's going to stay that way. I'd really like to release a 4K game at some point. That one is on pause while I work on Blackjack.

 

No binaries yet. Both kernels aren't presentable at the moment. I need to fix Blackjack's rendering, because all the timings have been changed due to code running more efficiently. And my Rampart style game has no game logic. It's super basic, so it wouldn't look impressive at all. I'm at a point where I need to flesh out how this game is going to work, so I need to do some research. I'm not even settled on whether it's going to be real-time or turn based strategy.

 

Development is going slow, because I don't have as much spare time as I used to. Although, that may change soon due to the virus situation.

  • Like 2
Link to comment
Share on other sites

I'm not sure if this is of interest to anyone. Here's the bit layout of my discard pile. You can see why 4 decks fits perfectly in 26 bytes. It's not going to be possible to add more decks, because there's just not enough RAM. It's ASCII because lot of my documentation is in the code.

 

; Discard pile format:
;
;   Each byte contains 8 cards, so 1 bit per card. 26x8 = 208 cards or 4 decks.
;   Each nibble selects the deck and suit. Bits 0,1,2 of each nibble selects
;   the deck column. Bit 3 of each nibble selects the deck row.
;
;   Suit:           Spades  Hearts  Clubs   Diamonds
;   Column:         7,3     6,2     5,1     4,0
;
;   Bit values: 1 = discarded, 0 = in play
;
;                high nibble        low nibble
;   suits--->|  S | H | C | D  |  S | H | C | D  |
;   ---------|----|---|---|----|----|---|---|----|------
;   nibble-->|  3 | 2 | 1 | 0  |  3 | 2 | 1 | 0  |
;   byte|rank|  7 | 6 | 5 | 4  |  3 | 2 | 1 | 0  | index
;   ----|----|-----------------------------------|------
;     1    A |    |   |   |    |    |   |   |    |  0
;     2    2 |    |   |   |    |    |   |   |    |  1
;     3    3 |    |   |   |    |    |   |   |    |  2
;     4    4 |    |   |   |    |    |   |   |    |  3
;     5    5 |    |   |   |    |    |   |   |    |  4
;     6    6 |                 |                 |  5
;     7    7 |   Deck 1 (01)   |   Deck 0 (00)   |  6
;     8    8 |                 |                 |  7
;     9    9 |    |   |   |    |    |   |   |    |  8
;    10   10 |    |   |   |    |    |   |   |    |  9
;    11    J |    |   |   |    |    |   |   |    | 10
;    12    Q |    |   |   |    |    |   |   |    | 11
;    13    K |    |   |   |    |    |   |   |    | 12
;   ----|----|----+---+---+----+----+---+---+----|------
;    14    A |    |   |   |    |    |   |   |    | 13
;    15    2 |    |   |   |    |    |   |   |    | 14
;    16    3 |    |   |   |    |    |   |   |    | 15
;    17    4 |    |   |   |    |    |   |   |    | 16
;    18    5 |    |   |   |    |    |   |   |    | 17
;    19    6 |                 |                 | 18
;    20    7 |   Deck 3 (11)   |   Deck 2 (10)   | 19
;    21    8 |                 |                 | 20
;    22    9 |    |   |   |    |    |   |   |    | 21
;    23   10 |    |   |   |    |    |   |   |    | 22
;    24    J |    |   |   |    |    |   |   |    | 23
;    25    Q |    |   |   |    |    |   |   |    | 24
;    26    K |    |   |   |    |    |   |   |    | 25
;   ----|----|-----------------------------------|------
;   nibble-->|  3 | 2 | 1 | 0  |  3 | 2 | 1 | 0  |
;   ---------|----|---|---|----|----|---|---|----|------


 

  • Like 4
Link to comment
Share on other sites

  • 4 months later...

I've uploaded another version: 0.91. However, it's not well tested. I'm not sure if I've broken anything on real hardware. I just need to get a version out regardless of the state it's in.

 

What have I done with this one?

 

It's not visibly apparent, but the card rendering is completely rewritten. I rewrote it to reduce two pointer arrays down to one array. I was using one array for the top half (rank) and the other for the bottom half (suit). The change saved 12 bytes, but at the cost of using 6 bytes of temporary stack space inside the kernel, so 6 bytes were freed globally. It was the most difficult part, because animating the gap space between the rank and suit while loading graphics pointers was kind of tricky for me. It does both by interlacing the work.

 

I freed up a few more bytes here and there. I actually lost count how many. It's probably around 10 bytes total. I freed up more ROM space by redoing some dumb code and using more table lookups.

 

I finally implemented the selectable options for early and late surrender, dealer hitting or standing on soft 17, and 1, 2, and 4 decks are fully working. I don't intend to implement any more options other than card colors. I'm looking into the card colors, which can be done if I turn off the background texture.

 

I reworked the navigation help. I never liked it, because it looked bad. I moved the menu options to the middle of the screen to make them more obvious. I changed the joystick inputs to be more natural with the menu. The fire button now selects the current menu item.

 

I fixed a few bugs: cards flickering, status display flickering, and yet another bug in the random card dealing.

 

I expanded my task handling routine to support more than 15 tasks.

 

For the next version, I will be working on keypad input, card colors, and game over animations. The split hand interface really needs attention. There's just something about it I don't like. The controller menu on the title screen is a non-functional graphic. The intro animation is temporarily disabled, but it will return soon. I don't expect to be doing too much beyond that other than minor touches, testing, and bug fixes.

Edited by azure
  • Like 4
Link to comment
Share on other sites

I've uploaded another version as a result of testing on real hardware. There were a number of problems with scanline counts. I also re-enabled the landing screen. I also fixed a bug with the split automatically hitting the split hand twice.

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

I'm glad to see this project still in development! It is definitely looking good.

 

21 minutes ago, azure said:

I've uploaded another version as a result of testing on real hardware. There were a number of problems with scanline counts.

In case you didn't already know, you can also catch scanlines going over 262 in the Stella debugger with:

 

breakif _scan>#262

 

Link to comment
Share on other sites

We'll be checking out Blackjack Theta VIII on today's (Wed Jul 22) ZeroPage Homebrew stream LIVE on Twitch at 11AM PT | 2PM ET | 6PM GMT! Hope everyone can watch!

 

Games:


(SET VIDEO TO 1080P60 FOR FULL QUALITY)

 

 

Edited by ZeroPage Homebrew
Link to comment
Share on other sites

4 minutes ago, azure said:

Stella's debug output was solid 262 the entire time. I just tested the breakif on the older versions. It didn't trigger.

Can you tell me details about the scanline problems (in 0.91 I suppose)? When did they happen? Maybe the info can help improving Stella's emulation.

Link to comment
Share on other sites

Sometimes the problem isn't going over the limit, but under it too.  The command mentioned by @Karl G addresses the former.  For the latter, look into the '_scanend' option.  It reports the scanline count in the last frame, so you can also detect underflow (if this is even what the problem was in your ROM).

Link to comment
Share on other sites

1 hour ago, Thomas Jentzsch said:

Can you tell me details about the scanline problems (in 0.91 I suppose)? When did they happen? Maybe the info can help improving Stella's emulation.

It was in 2 sections of code running in variable time inside the kernel. I didn't have them wrapped in a timer. My current hypothesis is I think they were probably cancelling each other out in the emulator. When the top row ran long the bottom row ran short (and vice versa), so the emulator saw a stable line count. They weren't cancelling on the hardware, so there must be a timing difference.

 

Showing a working example is going to take a little bit of effort without a full upload of all my files and support scripts. It may be easier if I reproduce it by transplanting the offending code into a sample program.

Link to comment
Share on other sites

42 minutes ago, stephena said:

Sometimes the problem isn't going over the limit, but under it too.  The command mentioned by @Karl G addresses the former.  For the latter, look into the '_scanend' option.  It reports the scanline count in the last frame, so you can also detect underflow (if this is even what the problem was in your ROM).

I was still on 6.0.2. I installed 6.2.1 and tried it out on the known bad version of my game. 

 

"print _scanend" shows #262 for both screens.

 

 

Link to comment
Share on other sites

27 minutes ago, azure said:

I was still on 6.0.2. I installed 6.2.1 and tried it out on the known bad version of my game. 

 

"print _scanend" shows #262 for both screens.

That only means the frame when you just ran the command ended in 262 scanlines.  That may not be true for all frames.  To detect underflow, you'd need to set a conditional breakpoint to check it on every frame.

 

Although if this isn't it, and there is a timer difference in Stella and real hardware, we would be interested in hearing about it.

Link to comment
Share on other sites

3 hours ago, stephena said:

That only means the frame when you just ran the command ended in 262 scanlines.  That may not be true for all frames.  To detect underflow, you'd need to set a conditional breakpoint to check it on every frame.

I had tried it with a breakif, but it didn't trigger. 

 

I'll post an update when I can better understand the precise point in the code it was having a problem. I'm switching between 3rd shift to 1st shift at work and I'm very sleep deprived at the moment.

Edited by azure
Link to comment
Share on other sites

@azure I just tested 0.91 on my console, but I didn't notice any screen rolls or screen jumps. 

 

On 7/22/2020 at 9:01 PM, azure said:

It was in 2 sections of code running in variable time inside the kernel. I didn't have them wrapped in a timer. My current hypothesis is I think they were probably cancelling each other out in the emulator. When the top row ran long the bottom row ran short (and vice versa), so the emulator saw a stable line count. They weren't cancelling on the hardware, so there must be a timing difference.

That would have caused the screen to jump up or down.

Link to comment
Share on other sites

  • 2 months later...

I haven't posted in a while, so I uploaded the current WIP. I redesigned the title screen using a new kernel that allows for dynamic palette changes. Watch the blue text and wait 4 seconds to see what I mean.

 

I'm working on changing the betting screen to allow for higher bets (5 or 6 digit amounts), but the change will touch a lot of code, so it's going to be a significant change. The 1K and x2 bets are not working yet. x2 will double the current bet. I have to reassess if I have the RAM. I don't believe I do at the moment. The new kernel is using a few more bytes RAM, so I'll find some other code to crunch.

 

These are not big changes, but I've been working on them for the past several weeks.

 

Next change after this is adding keypad support. I display the two controllers that will be supported on the title screen.

  • Like 2
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...