Jump to content
IGNORED

Minikernel - Player Scores


CurtisP

Recommended Posts

Not a answer but more personal experience and random thoughts.

 

I can confirm 6lives_statusbar.asm works with the multi sprite kernel. Having "icons" that can be changed around more easily than score digits is great.

post-13304-0-26158900-1531064497_thumb.png

 

Speaking of score you can edit the score character to be anything. It's just a matter of figuring out the word game (EDIT: which I clearly failed ~_^):

 

0123456789
USEPNCSTA_

USE___
OPEN__
CAST__
ESCAPE

.

My gut feeling is that when SpiceC rolls around it will have a text mode kernel of some sort. That should help greatly with strategy games.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Okay - here is my first stab at this. Use this like the original minikernel with the following exceptions:

 

  • Add the line " const onedigitscores = 1" to your code to enable single-digit mode
    • When using single-digit scores, there is no need to worry about the score being in BCD format
  • The original minikernel used a lot of stack variables, which caused issues for me when I've tries to use this minikernel in the past, so I changed around the variables to eliminate this usage.
    • If the kernel options pfheights or pfcolors is used, you will need to dim a variable to avoid incompatibility as follows: " dim temp0color = z". "z" can be any valid bB variable that is not already in used.

 

Here is the revised minikernel and a revised sample program that uses it. Let me know how this works for you!

 

 

playerscores.asm

playerscores.bas

  • Like 3
Link to comment
Share on other sites

Okay - here is my first stab at this. Use this like the original minikernel with the following exceptions:

 

  • Add the line " const onedigitscores = 1" to your code to enable single-digit mode
    • When using single-digit scores, there is no need to worry about the score being in BCD format
  • The original minikernel used a lot of stack variables, which caused issues for me when I've tries to use this minikernel in the past, so I changed around the variables to eliminate this usage.
    • If the kernel options pfheights or pfcolors is used, you will need to dim a variable to avoid incompatibility as follows: " dim temp0color = z". "z" can be any valid bB variable that is not already in used.

 

Here is the revised minikernel and a revised sample program that uses it. Let me know how this works for you!

 

 

Oh wow that's cool!

 

However I'd like to have the original 6 digits (or 4) down below. Then I can use the main number for score and the other two for powerups. So basically the original program with just 1 digit instead of two on both sides.

 

Could you do that? Sorry to be picky :P

Link to comment
Share on other sites

Oh wow that's cool!

 

However I'd like to have the original 6 digits (or 4) down below. Then I can use the main number for score and the other two for powerups. So basically the original program with just 1 digit instead of two on both sides.

 

Could you do that? Sorry to be picky :P

 

It is supposed to work that way when you set playerscores to 2, and do not set noscore, but it appears to not be working. I will take a look and try to get you a version that works as you describe.

Link to comment
Share on other sites

Here's attempt #2 that fixes my previous issue, and the sample program revised to use two single-digit scores in addition to the main score, each with its own color.

 

attachicon.gifScreen Shot 2018-08-15 at 4.34.05 PM.png

 

attachicon.gifplayerscores.asm

 

attachicon.gifplayerscores.bas

Awesome! Now to put this into my game. :)

I'm almost afraid to ask, but could you move the left number back by one so that they are symetrical? (Or the right one)

 

Also if I understand this correctly then this does not use any variables apart from pfheight and pfcolors? it seems to do something with my rand function because if I do this is always false. (and it was not before I implemented this)

 _rand1 = rand & 1
 if _left_right{0} && !_rand1 then gosub __branch 
 

I tried reading the asm file but its black magic to me :P

After some experimenting it doesn not seem to be the variables that I defined, as I turned them all off. It really is the .asm being included. (Code in attachement)

Could you take a look?

climbV0.4.bas

Edited by Coolcrab
Link to comment
Share on other sites

Sure - I'll take a look at this again tomorrow

 

Thanks! I tried to look at it but I have no idea where it is going wrong. Only thing that I can come up with is that the rand function stores in temp and the .asm overwrites it. But can't confirm it atm.

 

It really makes the game look much better though!

Link to comment
Share on other sites

I've probably overwritten some area of memory that I should not have. That's due to me still being a novice with minikernels, but like I said, it's good practice for me. I'll see what I can figure out.

 

As for the number placement, I was thinking that it will look better if the width between individual scores is widened, anyway. I'll work on this as well.

 

To answer your other question, as it stands now, no additional variables need to be defined, but that may change if I discover that I'm using a memory location that I shouldn't.

  • Like 1
Link to comment
Share on other sites

Thank you Karl G for making this spiffy new mini kernel! Displaying extra information is always a challenge - your work makes it possible to create much more informative displays (and thus more detailed games.)

 

As a side your recent changes made it almsot fully compatible with the multi sprite kernel. The second score seems to point to, umm.. not the score font data? I wonder if that could be turned into a feature. Maybe have it point to a graphic data block different from the score font intentionally so we could display life icons and other goodies :)

 

Dunno if this is useful for this but Random Terrain has a memory map for both standard and MS kernels here: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#memorymaps

 

Again, thank you for taking an interest in mini kermels. I hope it's more fun than hassle!

 

post-13304-0-43763300-1534426446_thumb.png

 

Multi sprite example (edited version from original Karl G code)

KarlG_Playerscores.zip

Link to comment
Share on other sites

I've been looking at the memory map for the standard kernel, which I believe is off by two bites if you compare to the values in 2600basic.h. I haven't looked at the multisprite memory map yet to see what I may be overwriting there. Perhaps the multisprite kernel has a define I can use for conditional compilation to ensure compatibility with both.

 

Just to clarify, this minikernel isn't my work originally; I'm merely messing with it now. :-)

  • Like 1
Link to comment
Share on other sites

I see where I am overwriting rand now - it may be that I do need to have the user define a variable, or perhaps I can use one byte of stack, after all (better than the several bytes used in the original version, at least).

 

Edit: It looks like stack1 and stack2 are used as temp variables in the kernel, anyway, so perhaps I can make use of these without any risk.

  • Like 1
Link to comment
Share on other sites

Attempt #3, now with less memory corruption! Apart from that, improvements include:

 

  • Score spacing increased (I think it looks better this way)
  • Proper centering in both 1 and two digit modes

Here are some screenshots showing all 4 possible configurations:

 

post-48311-0-03276900-1534433966_thumb.png

 

post-48311-0-08481800-1534435142_thumb.png

 

post-48311-0-87881800-1534433963_thumb.png

 

post-48311-0-11748300-1534435141_thumb.png

 

playerscores.asm

 

playerscores.bas

  • Like 1
Link to comment
Share on other sites

Attempt #3, now with less memory corruption! Apart from that, improvements include:

 

  • Score spacing increased (I think it looks better this way)
  • Proper centering in both 1 and two digit modes

Here are some screenshots showing all 4 possible configurations:

 

attachicon.gifone digit with score.png

 

attachicon.giftwo digit with score.png

 

attachicon.gifone digit 4 scores.png

 

attachicon.giftwo digit 4 scores.png

 

Edit: Just found a bug - fixed version should be up shortly.

My program works again :) However.. (Feeling bad that I keep bothering you...)

Player0score and player1 score seems to be tied to pfscore0 and pfscore1, is it possible to tie it to seperate variables? I want to use the pdscore's for tracking lives.

Link to comment
Share on other sites

Another revised version. Once all of the obvious bugs have been ironed out, I will bundle it in a zip with updated documentation for any others that may benefit from these changes.

 

Anyway, give this version a shot, and let me know how it works for you. You will define the variables with something like this:

 dim player0score = y ; Define a variable for this only if pfscore1 is used
 dim player1score = x ; Define a variable for this only if pfscore2 is used

playerscores.asm

  • Like 1
Link to comment
Share on other sites

I don't know how my latest version would even compile with the multisprite kernel since aux1 and aux2 don't appear to be defined. I can give it a try and see if I can make a version that is compatible with that kernel - I'm sure it's just a matter of using different variables given the different memory map.

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